@qrvey/widget-configurability 0.0.0-beta.4589 → 0.0.0-beta.4657
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/README.md +53 -0
- package/dist/cjs/index.js +12 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/metadata/customization-metadata.js +241 -0
- package/dist/cjs/metadata/customization-metadata.js.map +1 -0
- package/dist/cjs/metadata/index.js +11 -0
- package/dist/cjs/metadata/index.js.map +1 -0
- package/dist/cjs/metadata/labels/chart-panel.labels.js +56 -0
- package/dist/cjs/metadata/labels/chart-panel.labels.js.map +1 -0
- package/dist/cjs/metadata/labels/dashboard.labels.js +207 -0
- package/dist/cjs/metadata/labels/dashboard.labels.js.map +1 -0
- package/dist/cjs/metadata/metadata.models.js +3 -0
- package/dist/cjs/metadata/metadata.models.js.map +1 -0
- package/dist/cjs/models/remote.models.js +3 -0
- package/dist/cjs/models/remote.models.js.map +1 -0
- package/dist/cjs/models/validation.models.js +3 -0
- package/dist/cjs/models/validation.models.js.map +1 -0
- package/dist/cjs/remote/remote-customization.loader.js +213 -0
- package/dist/cjs/remote/remote-customization.loader.js.map +1 -0
- package/dist/cjs/structural-manager.js +35 -2
- package/dist/cjs/structural-manager.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils/defaults.helpers.js +3 -0
- package/dist/cjs/utils/defaults.helpers.js.map +1 -1
- package/dist/cjs/utils/layers.helpers.js +178 -0
- package/dist/cjs/utils/layers.helpers.js.map +1 -0
- package/dist/cjs/utils/logger.helpers.js +10 -0
- package/dist/cjs/utils/logger.helpers.js.map +1 -0
- package/dist/cjs/utils/scope.helpers.js +4 -1
- package/dist/cjs/utils/scope.helpers.js.map +1 -1
- package/dist/cjs/validation/customization.validator.js +366 -0
- package/dist/cjs/validation/customization.validator.js.map +1 -0
- package/dist/esm/index.mjs +846 -28
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/metadata.mjs +2750 -0
- package/dist/esm/metadata.mjs.map +1 -0
- package/dist/types/customization.models-CCSWjfb2.d.ts +47 -0
- package/dist/types/index.d.ts +98 -47
- package/dist/types/metadata.d.ts +59 -0
- package/package.json +7 -1
|
@@ -0,0 +1,2750 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
|
+
|
|
35
|
+
// src/metadata/labels/chart-panel.labels.ts
|
|
36
|
+
var CHART_PANEL_LABELS = {
|
|
37
|
+
header: {
|
|
38
|
+
label: "Chart header"
|
|
39
|
+
},
|
|
40
|
+
floatingMenu: {
|
|
41
|
+
label: "Floating menu"
|
|
42
|
+
},
|
|
43
|
+
menuLayout: {
|
|
44
|
+
label: "Menu layout"
|
|
45
|
+
},
|
|
46
|
+
body: {
|
|
47
|
+
label: "Chart body"
|
|
48
|
+
},
|
|
49
|
+
"body.actions": {
|
|
50
|
+
label: "Chart actions"
|
|
51
|
+
},
|
|
52
|
+
optionMenu: {
|
|
53
|
+
label: "Chart options menu"
|
|
54
|
+
},
|
|
55
|
+
optionDateGrouping: {
|
|
56
|
+
label: "Date grouping options"
|
|
57
|
+
},
|
|
58
|
+
dashFilterScope: {
|
|
59
|
+
label: "Dashboard filters"
|
|
60
|
+
},
|
|
61
|
+
tabFilterScope: {
|
|
62
|
+
label: "Tab filters"
|
|
63
|
+
},
|
|
64
|
+
panelFilterScope: {
|
|
65
|
+
label: "Panel filters"
|
|
66
|
+
},
|
|
67
|
+
qChartName: {
|
|
68
|
+
label: "Chart name"
|
|
69
|
+
},
|
|
70
|
+
qFitPanel: {
|
|
71
|
+
label: "Fit to panel"
|
|
72
|
+
},
|
|
73
|
+
qChartSelection: {
|
|
74
|
+
label: "Chart type selection"
|
|
75
|
+
},
|
|
76
|
+
qColumnSection: {
|
|
77
|
+
label: "Column section"
|
|
78
|
+
},
|
|
79
|
+
qSorting: {
|
|
80
|
+
label: "Sorting"
|
|
81
|
+
},
|
|
82
|
+
qColumnReplacement: {
|
|
83
|
+
label: "Column replacement"
|
|
84
|
+
},
|
|
85
|
+
qColumnAggregation: {
|
|
86
|
+
label: "Column aggregation"
|
|
87
|
+
},
|
|
88
|
+
qColumnGrouping: {
|
|
89
|
+
label: "Column grouping"
|
|
90
|
+
},
|
|
91
|
+
qDateGrouping: {
|
|
92
|
+
label: "Date grouping"
|
|
93
|
+
},
|
|
94
|
+
qColumnSelection: {
|
|
95
|
+
label: "Column selection"
|
|
96
|
+
},
|
|
97
|
+
qResetColumnsWidth: {
|
|
98
|
+
label: "Reset column widths"
|
|
99
|
+
},
|
|
100
|
+
qSmartAnalyzer: {
|
|
101
|
+
label: "Smart analyzer"
|
|
102
|
+
},
|
|
103
|
+
qEditChart: {
|
|
104
|
+
label: "Edit chart"
|
|
105
|
+
},
|
|
106
|
+
qDuplicateChart: {
|
|
107
|
+
label: "Duplicate chart"
|
|
108
|
+
},
|
|
109
|
+
qDownloadChart: {
|
|
110
|
+
label: "Download"
|
|
111
|
+
},
|
|
112
|
+
qChartJPG: {
|
|
113
|
+
label: "JPG"
|
|
114
|
+
},
|
|
115
|
+
qChartPDF: {
|
|
116
|
+
label: "PDF"
|
|
117
|
+
},
|
|
118
|
+
qChartCSV: {
|
|
119
|
+
label: "CSV"
|
|
120
|
+
},
|
|
121
|
+
qChartSummary: {
|
|
122
|
+
label: "Summary"
|
|
123
|
+
},
|
|
124
|
+
qChartExcel: {
|
|
125
|
+
label: "Excel"
|
|
126
|
+
},
|
|
127
|
+
qFilter: {
|
|
128
|
+
label: "Filters"
|
|
129
|
+
},
|
|
130
|
+
qAddFilter: {
|
|
131
|
+
label: "Add filter"
|
|
132
|
+
},
|
|
133
|
+
qEditFilter: {
|
|
134
|
+
label: "Edit filter"
|
|
135
|
+
},
|
|
136
|
+
qDeleteFilter: {
|
|
137
|
+
label: "Delete filter"
|
|
138
|
+
},
|
|
139
|
+
qYear: {
|
|
140
|
+
label: "Year"
|
|
141
|
+
},
|
|
142
|
+
qQuarter: {
|
|
143
|
+
label: "Quarter"
|
|
144
|
+
},
|
|
145
|
+
qQuarterOnly: {
|
|
146
|
+
label: "Quarter only"
|
|
147
|
+
},
|
|
148
|
+
qMonth: {
|
|
149
|
+
label: "Month"
|
|
150
|
+
},
|
|
151
|
+
qMonthOnly: {
|
|
152
|
+
label: "Month only"
|
|
153
|
+
},
|
|
154
|
+
qWeek: {
|
|
155
|
+
label: "Week"
|
|
156
|
+
},
|
|
157
|
+
qDay: {
|
|
158
|
+
label: "Day"
|
|
159
|
+
},
|
|
160
|
+
qDayOnly: {
|
|
161
|
+
label: "Day only"
|
|
162
|
+
},
|
|
163
|
+
qHour: {
|
|
164
|
+
label: "Hour"
|
|
165
|
+
},
|
|
166
|
+
qHourOnly: {
|
|
167
|
+
label: "Hour only"
|
|
168
|
+
},
|
|
169
|
+
qMinute: {
|
|
170
|
+
label: "Minute"
|
|
171
|
+
},
|
|
172
|
+
qMinuteOnly: {
|
|
173
|
+
label: "Minute only"
|
|
174
|
+
},
|
|
175
|
+
qSecond: {
|
|
176
|
+
label: "Second"
|
|
177
|
+
},
|
|
178
|
+
qSecondOnly: {
|
|
179
|
+
label: "Second only"
|
|
180
|
+
},
|
|
181
|
+
qComparativeAnalysis: {
|
|
182
|
+
label: "Comparative analysis"
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
// src/metadata/labels/dashboard.labels.ts
|
|
187
|
+
var DASHBOARD_LABELS = {
|
|
188
|
+
// Sections
|
|
189
|
+
navBar: {
|
|
190
|
+
label: "Navigation bar"
|
|
191
|
+
},
|
|
192
|
+
assetList: {
|
|
193
|
+
label: "Dashboard list"
|
|
194
|
+
},
|
|
195
|
+
"assetList.asset": {
|
|
196
|
+
label: "Dashboard item"
|
|
197
|
+
},
|
|
198
|
+
"assetList.asset.optionMenu": {
|
|
199
|
+
label: "Dashboard options menu"
|
|
200
|
+
},
|
|
201
|
+
"assetList.asset.card": {
|
|
202
|
+
label: "Card view"
|
|
203
|
+
},
|
|
204
|
+
"assetList.asset.table": {
|
|
205
|
+
label: "Table view"
|
|
206
|
+
},
|
|
207
|
+
controlBarLeft: {
|
|
208
|
+
label: "Left control bar"
|
|
209
|
+
},
|
|
210
|
+
controlBarRight: {
|
|
211
|
+
label: "Right control bar"
|
|
212
|
+
},
|
|
213
|
+
header: {
|
|
214
|
+
label: "Dashboard header"
|
|
215
|
+
},
|
|
216
|
+
"header.qOptionsMenu": {
|
|
217
|
+
label: "Dashboard options menu"
|
|
218
|
+
},
|
|
219
|
+
menuBar: {
|
|
220
|
+
label: "Menu bar"
|
|
221
|
+
},
|
|
222
|
+
"menuBar.file": {
|
|
223
|
+
label: "File menu"
|
|
224
|
+
},
|
|
225
|
+
"menuBar.edit": {
|
|
226
|
+
label: "Edit menu"
|
|
227
|
+
},
|
|
228
|
+
"menuBar.insert": {
|
|
229
|
+
label: "Insert menu"
|
|
230
|
+
},
|
|
231
|
+
toolBar: {
|
|
232
|
+
label: "Toolbar"
|
|
233
|
+
},
|
|
234
|
+
configPanel: {
|
|
235
|
+
label: "Configuration panel"
|
|
236
|
+
},
|
|
237
|
+
filterPanel: {
|
|
238
|
+
label: "Filter panel"
|
|
239
|
+
},
|
|
240
|
+
downloadModal: {
|
|
241
|
+
label: "Download modal"
|
|
242
|
+
},
|
|
243
|
+
canvas: {
|
|
244
|
+
label: "Canvas"
|
|
245
|
+
},
|
|
246
|
+
duplicateModal: {
|
|
247
|
+
label: "Duplicate modal"
|
|
248
|
+
},
|
|
249
|
+
"duplicateModal.options": {
|
|
250
|
+
label: "Duplicate options"
|
|
251
|
+
},
|
|
252
|
+
grid: {
|
|
253
|
+
label: "Grid"
|
|
254
|
+
},
|
|
255
|
+
dashFilterScope: {
|
|
256
|
+
label: "Dashboard filters"
|
|
257
|
+
},
|
|
258
|
+
tabFilterScope: {
|
|
259
|
+
label: "Tab filters"
|
|
260
|
+
},
|
|
261
|
+
containerFilterScope: {
|
|
262
|
+
label: "Container filters"
|
|
263
|
+
},
|
|
264
|
+
panelFilterScope: {
|
|
265
|
+
label: "Panel filters"
|
|
266
|
+
},
|
|
267
|
+
viewOnlyFilterScope: {
|
|
268
|
+
label: "View-only filters"
|
|
269
|
+
},
|
|
270
|
+
edit: {
|
|
271
|
+
label: "Edit menu"
|
|
272
|
+
},
|
|
273
|
+
file: {
|
|
274
|
+
label: "File menu"
|
|
275
|
+
},
|
|
276
|
+
insert: {
|
|
277
|
+
label: "Insert menu"
|
|
278
|
+
},
|
|
279
|
+
options: {
|
|
280
|
+
label: "Options"
|
|
281
|
+
},
|
|
282
|
+
timezone: {
|
|
283
|
+
label: "Timezone"
|
|
284
|
+
},
|
|
285
|
+
// Navigation and list
|
|
286
|
+
qAppTitle: {
|
|
287
|
+
label: "Application title"
|
|
288
|
+
},
|
|
289
|
+
qBackButton: {
|
|
290
|
+
label: "Back button"
|
|
291
|
+
},
|
|
292
|
+
qQvTokenExpiredMessage: {
|
|
293
|
+
label: "Session expired message"
|
|
294
|
+
},
|
|
295
|
+
qGoToDashBackButton: {
|
|
296
|
+
label: "Back to source dashboard button"
|
|
297
|
+
},
|
|
298
|
+
qCreateDash: {
|
|
299
|
+
label: "Create dashboard"
|
|
300
|
+
},
|
|
301
|
+
qSwitchView: {
|
|
302
|
+
label: "Card/table switch"
|
|
303
|
+
},
|
|
304
|
+
qFilterBy: {
|
|
305
|
+
label: "Filter by"
|
|
306
|
+
},
|
|
307
|
+
qSortBy: {
|
|
308
|
+
label: "Sort by"
|
|
309
|
+
},
|
|
310
|
+
qSearch: {
|
|
311
|
+
label: "Search"
|
|
312
|
+
},
|
|
313
|
+
qSelectColumn: {
|
|
314
|
+
label: "Column selection"
|
|
315
|
+
},
|
|
316
|
+
qStatus: {
|
|
317
|
+
label: "Status"
|
|
318
|
+
},
|
|
319
|
+
qPreview: {
|
|
320
|
+
label: "Preview"
|
|
321
|
+
},
|
|
322
|
+
qPublish: {
|
|
323
|
+
label: "Publish"
|
|
324
|
+
},
|
|
325
|
+
qUnpublish: {
|
|
326
|
+
label: "Unpublish"
|
|
327
|
+
},
|
|
328
|
+
qDesign: {
|
|
329
|
+
label: "Design"
|
|
330
|
+
},
|
|
331
|
+
qEditDash: {
|
|
332
|
+
label: "Edit dashboard"
|
|
333
|
+
},
|
|
334
|
+
qUseDash: {
|
|
335
|
+
label: "Use dashboard"
|
|
336
|
+
},
|
|
337
|
+
qRenameDash: {
|
|
338
|
+
label: "Rename dashboard"
|
|
339
|
+
},
|
|
340
|
+
qDeleteDash: {
|
|
341
|
+
label: "Delete dashboard"
|
|
342
|
+
},
|
|
343
|
+
qManageTags: {
|
|
344
|
+
label: "Manage tags"
|
|
345
|
+
},
|
|
346
|
+
qTags: {
|
|
347
|
+
label: "Tags"
|
|
348
|
+
},
|
|
349
|
+
qFilterByTags: {
|
|
350
|
+
label: "Filter by tags"
|
|
351
|
+
},
|
|
352
|
+
qDuplDash: {
|
|
353
|
+
label: "Duplicate dashboard"
|
|
354
|
+
},
|
|
355
|
+
qDuplDashAndCharts: {
|
|
356
|
+
label: "Duplicate dashboard and charts"
|
|
357
|
+
},
|
|
358
|
+
qManageSharing: {
|
|
359
|
+
label: "Manage sharing"
|
|
360
|
+
},
|
|
361
|
+
qFavorite: {
|
|
362
|
+
label: "Favorite"
|
|
363
|
+
},
|
|
364
|
+
qCreatedDate: {
|
|
365
|
+
label: "Created date"
|
|
366
|
+
},
|
|
367
|
+
qLastModifDate: {
|
|
368
|
+
label: "Last modified date"
|
|
369
|
+
},
|
|
370
|
+
qNumberOfCharts: {
|
|
371
|
+
label: "Number of charts"
|
|
372
|
+
},
|
|
373
|
+
qSharing: {
|
|
374
|
+
label: "Sharing"
|
|
375
|
+
},
|
|
376
|
+
qSharingIcon: {
|
|
377
|
+
label: "Sharing icon"
|
|
378
|
+
},
|
|
379
|
+
qOwner: {
|
|
380
|
+
label: "Owner"
|
|
381
|
+
},
|
|
382
|
+
qDescription: {
|
|
383
|
+
label: "Description"
|
|
384
|
+
},
|
|
385
|
+
// Header
|
|
386
|
+
qDashFavorite: {
|
|
387
|
+
label: "Favorite"
|
|
388
|
+
},
|
|
389
|
+
qDashName: {
|
|
390
|
+
label: "Dashboard name"
|
|
391
|
+
},
|
|
392
|
+
qDashDesc: {
|
|
393
|
+
label: "Dashboard description"
|
|
394
|
+
},
|
|
395
|
+
// Menu bar
|
|
396
|
+
qMnuCreateDash: {
|
|
397
|
+
label: "New dashboard"
|
|
398
|
+
},
|
|
399
|
+
qMnuOpenDash: {
|
|
400
|
+
label: "Open dashboard"
|
|
401
|
+
},
|
|
402
|
+
qMnuDuplicateDash: {
|
|
403
|
+
label: "Duplicate dashboard"
|
|
404
|
+
},
|
|
405
|
+
qMnuDuplicateDashAndCharts: {
|
|
406
|
+
label: "Duplicate dashboard and charts"
|
|
407
|
+
},
|
|
408
|
+
qMnuCanvasSize: {
|
|
409
|
+
label: "Canvas size"
|
|
410
|
+
},
|
|
411
|
+
qMnuThemes: {
|
|
412
|
+
label: "Themes"
|
|
413
|
+
},
|
|
414
|
+
qMnuDeleteDash: {
|
|
415
|
+
label: "Delete dashboard"
|
|
416
|
+
},
|
|
417
|
+
qMnuDownloadDash: {
|
|
418
|
+
label: "Download"
|
|
419
|
+
},
|
|
420
|
+
qCreateDataset: {
|
|
421
|
+
label: "Custom dataset"
|
|
422
|
+
},
|
|
423
|
+
qCreateCustomDataset: {
|
|
424
|
+
label: "Create custom dataset"
|
|
425
|
+
},
|
|
426
|
+
qViewCustomDataset: {
|
|
427
|
+
label: "View custom dataset"
|
|
428
|
+
},
|
|
429
|
+
qUndoRedo: {
|
|
430
|
+
label: "Undo / redo"
|
|
431
|
+
},
|
|
432
|
+
qCopyElement: {
|
|
433
|
+
label: "Copy"
|
|
434
|
+
},
|
|
435
|
+
qPasteElement: {
|
|
436
|
+
label: "Paste"
|
|
437
|
+
},
|
|
438
|
+
qCutElement: {
|
|
439
|
+
label: "Cut"
|
|
440
|
+
},
|
|
441
|
+
qRemoveElement: {
|
|
442
|
+
label: "Remove"
|
|
443
|
+
},
|
|
444
|
+
qDuplElement: {
|
|
445
|
+
label: "Duplicate"
|
|
446
|
+
},
|
|
447
|
+
qSelectAllElem: {
|
|
448
|
+
label: "Select all"
|
|
449
|
+
},
|
|
450
|
+
qSelectAllContElem: {
|
|
451
|
+
label: "Select all in container"
|
|
452
|
+
},
|
|
453
|
+
qMnuInsertChart: {
|
|
454
|
+
label: "Chart"
|
|
455
|
+
},
|
|
456
|
+
qMnuExistingChart: {
|
|
457
|
+
label: "Existing chart"
|
|
458
|
+
},
|
|
459
|
+
qMnuNewChart: {
|
|
460
|
+
label: "New chart"
|
|
461
|
+
},
|
|
462
|
+
qMnuNewChartAI: {
|
|
463
|
+
label: "New chart with AI"
|
|
464
|
+
},
|
|
465
|
+
qMnuInsertFilterCtrl: {
|
|
466
|
+
label: "Filter control"
|
|
467
|
+
},
|
|
468
|
+
qMnuDatePicker: {
|
|
469
|
+
label: "Date picker"
|
|
470
|
+
},
|
|
471
|
+
qMnuInputBox: {
|
|
472
|
+
label: "Input box"
|
|
473
|
+
},
|
|
474
|
+
qMnuMultiSelectList: {
|
|
475
|
+
label: "Multi-select list"
|
|
476
|
+
},
|
|
477
|
+
qMnuSingleSelectList: {
|
|
478
|
+
label: "Single-select list"
|
|
479
|
+
},
|
|
480
|
+
qMnuInsertShape: {
|
|
481
|
+
label: "Shape"
|
|
482
|
+
},
|
|
483
|
+
qMnuLine: {
|
|
484
|
+
label: "Line"
|
|
485
|
+
},
|
|
486
|
+
qMnuRectangle: {
|
|
487
|
+
label: "Rectangle"
|
|
488
|
+
},
|
|
489
|
+
qMnuEllipse: {
|
|
490
|
+
label: "Ellipse"
|
|
491
|
+
},
|
|
492
|
+
qMnuInsertText: {
|
|
493
|
+
label: "Text"
|
|
494
|
+
},
|
|
495
|
+
qMnuInsertImage: {
|
|
496
|
+
label: "Image"
|
|
497
|
+
},
|
|
498
|
+
qMnuInsertButton: {
|
|
499
|
+
label: "Button"
|
|
500
|
+
},
|
|
501
|
+
qMnuInsertContainer: {
|
|
502
|
+
label: "Container"
|
|
503
|
+
},
|
|
504
|
+
qMnuInsertHeader: {
|
|
505
|
+
label: "Header"
|
|
506
|
+
},
|
|
507
|
+
qMnuInsertTabs: {
|
|
508
|
+
label: "Tabs"
|
|
509
|
+
},
|
|
510
|
+
qMnuArrange: {
|
|
511
|
+
label: "Arrange"
|
|
512
|
+
},
|
|
513
|
+
qMnuBringToFront: {
|
|
514
|
+
label: "Bring to front"
|
|
515
|
+
},
|
|
516
|
+
qMnuSendToBack: {
|
|
517
|
+
label: "Send to back"
|
|
518
|
+
},
|
|
519
|
+
qMnuAlign: {
|
|
520
|
+
label: "Align"
|
|
521
|
+
},
|
|
522
|
+
qMnuDisplayGrid: {
|
|
523
|
+
label: "Display grid"
|
|
524
|
+
},
|
|
525
|
+
qMnuSnapToGrid: {
|
|
526
|
+
label: "Snap to grid"
|
|
527
|
+
},
|
|
528
|
+
qMnuSwitchGrid: {
|
|
529
|
+
label: "Switch grid"
|
|
530
|
+
},
|
|
531
|
+
// Toolbar
|
|
532
|
+
qCanvasSize: {
|
|
533
|
+
label: "Canvas size"
|
|
534
|
+
},
|
|
535
|
+
qInsertChart: {
|
|
536
|
+
label: "Insert chart"
|
|
537
|
+
},
|
|
538
|
+
qExistingChart: {
|
|
539
|
+
label: "Existing chart"
|
|
540
|
+
},
|
|
541
|
+
qNewChart: {
|
|
542
|
+
label: "New chart"
|
|
543
|
+
},
|
|
544
|
+
qNewChartAI: {
|
|
545
|
+
label: "New chart with AI"
|
|
546
|
+
},
|
|
547
|
+
qInsertFilterCtrl: {
|
|
548
|
+
label: "Insert filter control"
|
|
549
|
+
},
|
|
550
|
+
qDatePicker: {
|
|
551
|
+
label: "Date picker"
|
|
552
|
+
},
|
|
553
|
+
qInputBox: {
|
|
554
|
+
label: "Input box"
|
|
555
|
+
},
|
|
556
|
+
qMultiSelectList: {
|
|
557
|
+
label: "Multi-select list"
|
|
558
|
+
},
|
|
559
|
+
qSingleSelectList: {
|
|
560
|
+
label: "Single-select list"
|
|
561
|
+
},
|
|
562
|
+
qInsertShape: {
|
|
563
|
+
label: "Insert shape"
|
|
564
|
+
},
|
|
565
|
+
qLine: {
|
|
566
|
+
label: "Line"
|
|
567
|
+
},
|
|
568
|
+
qRectangle: {
|
|
569
|
+
label: "Rectangle"
|
|
570
|
+
},
|
|
571
|
+
qEllipse: {
|
|
572
|
+
label: "Ellipse"
|
|
573
|
+
},
|
|
574
|
+
qSnapToGrid: {
|
|
575
|
+
label: "Snap to grid"
|
|
576
|
+
},
|
|
577
|
+
qDisplayGrid: {
|
|
578
|
+
label: "Display grid"
|
|
579
|
+
},
|
|
580
|
+
qSwitchGrid: {
|
|
581
|
+
label: "Switch grid"
|
|
582
|
+
},
|
|
583
|
+
qDownloadDash: {
|
|
584
|
+
label: "Download"
|
|
585
|
+
},
|
|
586
|
+
qDashPDF: {
|
|
587
|
+
label: "PDF"
|
|
588
|
+
},
|
|
589
|
+
qDashCSV: {
|
|
590
|
+
label: "CSV"
|
|
591
|
+
},
|
|
592
|
+
qDashExcel: {
|
|
593
|
+
label: "Excel"
|
|
594
|
+
},
|
|
595
|
+
qDashDataset: {
|
|
596
|
+
label: "Dataset"
|
|
597
|
+
},
|
|
598
|
+
qArrange: {
|
|
599
|
+
label: "Arrange"
|
|
600
|
+
},
|
|
601
|
+
qBringToFront: {
|
|
602
|
+
label: "Bring to front"
|
|
603
|
+
},
|
|
604
|
+
qSendToBack: {
|
|
605
|
+
label: "Send to back"
|
|
606
|
+
},
|
|
607
|
+
qResponsiveView: {
|
|
608
|
+
label: "Responsive view"
|
|
609
|
+
},
|
|
610
|
+
qDesktop: {
|
|
611
|
+
label: "Desktop"
|
|
612
|
+
},
|
|
613
|
+
qTablet: {
|
|
614
|
+
label: "Tablet"
|
|
615
|
+
},
|
|
616
|
+
qMobile: {
|
|
617
|
+
label: "Mobile"
|
|
618
|
+
},
|
|
619
|
+
qBreakpoints: {
|
|
620
|
+
label: "Breakpoints"
|
|
621
|
+
},
|
|
622
|
+
qAlign: {
|
|
623
|
+
label: "Align"
|
|
624
|
+
},
|
|
625
|
+
qAlignRight: {
|
|
626
|
+
label: "Align right"
|
|
627
|
+
},
|
|
628
|
+
qAlignLeft: {
|
|
629
|
+
label: "Align left"
|
|
630
|
+
},
|
|
631
|
+
qAlignCenter: {
|
|
632
|
+
label: "Align center"
|
|
633
|
+
},
|
|
634
|
+
qAlignTop: {
|
|
635
|
+
label: "Align top"
|
|
636
|
+
},
|
|
637
|
+
qAlignMiddle: {
|
|
638
|
+
label: "Align middle"
|
|
639
|
+
},
|
|
640
|
+
qAlignBottom: {
|
|
641
|
+
label: "Align bottom"
|
|
642
|
+
},
|
|
643
|
+
qInsertText: {
|
|
644
|
+
label: "Insert text"
|
|
645
|
+
},
|
|
646
|
+
qInsertImage: {
|
|
647
|
+
label: "Insert image"
|
|
648
|
+
},
|
|
649
|
+
qInsertButton: {
|
|
650
|
+
label: "Insert button"
|
|
651
|
+
},
|
|
652
|
+
qInsertContainer: {
|
|
653
|
+
label: "Insert container"
|
|
654
|
+
},
|
|
655
|
+
qRespGridMargins: {
|
|
656
|
+
label: "Responsive grid margins"
|
|
657
|
+
},
|
|
658
|
+
qRespGridColumns: {
|
|
659
|
+
label: "Responsive grid columns"
|
|
660
|
+
},
|
|
661
|
+
qThemes: {
|
|
662
|
+
label: "Themes"
|
|
663
|
+
},
|
|
664
|
+
qDashVersion: {
|
|
665
|
+
label: "Dashboard version"
|
|
666
|
+
},
|
|
667
|
+
qGetDashVersion: {
|
|
668
|
+
label: "Change version"
|
|
669
|
+
},
|
|
670
|
+
qSourceDashBanner: {
|
|
671
|
+
label: "Personalization banner"
|
|
672
|
+
},
|
|
673
|
+
qHiddenItems: {
|
|
674
|
+
label: "Hidden items"
|
|
675
|
+
},
|
|
676
|
+
qDiscard: {
|
|
677
|
+
label: "Discard changes"
|
|
678
|
+
},
|
|
679
|
+
qSave: {
|
|
680
|
+
label: "Save changes"
|
|
681
|
+
},
|
|
682
|
+
qSwitchMode: {
|
|
683
|
+
label: "Interact / design switch"
|
|
684
|
+
},
|
|
685
|
+
qHideToolBar: {
|
|
686
|
+
label: "Hide toolbar"
|
|
687
|
+
},
|
|
688
|
+
qDownloadList: {
|
|
689
|
+
label: "Download list"
|
|
690
|
+
},
|
|
691
|
+
qChangeLayout: {
|
|
692
|
+
label: "Change layout"
|
|
693
|
+
},
|
|
694
|
+
// Filter panel
|
|
695
|
+
qAddFilter: {
|
|
696
|
+
label: "Add filter"
|
|
697
|
+
},
|
|
698
|
+
qEnabDisabAllFilters: {
|
|
699
|
+
label: "Enable / disable all filters"
|
|
700
|
+
},
|
|
701
|
+
qDeleteAllFilters: {
|
|
702
|
+
label: "Delete all filters"
|
|
703
|
+
},
|
|
704
|
+
qFilterSettings: {
|
|
705
|
+
label: "Filter settings"
|
|
706
|
+
},
|
|
707
|
+
qEditFilter: {
|
|
708
|
+
label: "Edit filter"
|
|
709
|
+
},
|
|
710
|
+
qEnabDisabFilter: {
|
|
711
|
+
label: "Enable / disable filter"
|
|
712
|
+
},
|
|
713
|
+
qDeleteFilter: {
|
|
714
|
+
label: "Delete filter"
|
|
715
|
+
},
|
|
716
|
+
// Download modal
|
|
717
|
+
qScheduleOption: {
|
|
718
|
+
label: "Schedule"
|
|
719
|
+
},
|
|
720
|
+
qSubscribeOption: {
|
|
721
|
+
label: "Subscribe"
|
|
722
|
+
},
|
|
723
|
+
qSubscribeExternalUsers: {
|
|
724
|
+
label: "Subscribe external users"
|
|
725
|
+
},
|
|
726
|
+
qSubscribeBanner: {
|
|
727
|
+
label: "Subscription banner"
|
|
728
|
+
},
|
|
729
|
+
qOwnerLabel: {
|
|
730
|
+
label: "Owner"
|
|
731
|
+
},
|
|
732
|
+
qSubscribeOrganization: {
|
|
733
|
+
label: "Subscribe organization"
|
|
734
|
+
},
|
|
735
|
+
qSubscribeMyself: {
|
|
736
|
+
label: "Subscribe myself"
|
|
737
|
+
},
|
|
738
|
+
qSubscribeSpecificPeople: {
|
|
739
|
+
label: "Subscribe specific people"
|
|
740
|
+
},
|
|
741
|
+
qSubscribeOwner: {
|
|
742
|
+
label: "Subscribe owner"
|
|
743
|
+
},
|
|
744
|
+
qIncludeHeader: {
|
|
745
|
+
label: "Include header"
|
|
746
|
+
},
|
|
747
|
+
qIncludeHyperlinks: {
|
|
748
|
+
label: "Include hyperlinks"
|
|
749
|
+
},
|
|
750
|
+
qExportVersion: {
|
|
751
|
+
label: "Export version"
|
|
752
|
+
},
|
|
753
|
+
qSavedVersionWarning: {
|
|
754
|
+
label: "Saved version banner"
|
|
755
|
+
},
|
|
756
|
+
qUnsavedVersionWarning: {
|
|
757
|
+
label: "Unsaved version banner"
|
|
758
|
+
},
|
|
759
|
+
// Duplicate modal
|
|
760
|
+
qCharts: {
|
|
761
|
+
label: "Charts"
|
|
762
|
+
},
|
|
763
|
+
qFilters: {
|
|
764
|
+
label: "Filters"
|
|
765
|
+
},
|
|
766
|
+
qDashActions: {
|
|
767
|
+
label: "Dashboard actions"
|
|
768
|
+
}
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
// src/constants/structure.constants.ts
|
|
772
|
+
var STRUCTURE_SECTION_NAME_SEPARATOR = ".";
|
|
773
|
+
var STRUCTURE_VIEW_NAME_SEPARATOR = "::";
|
|
774
|
+
var STRUCTURE_RESERVED_WORDS = [
|
|
775
|
+
"views",
|
|
776
|
+
"defaults",
|
|
777
|
+
"subModules"
|
|
778
|
+
];
|
|
779
|
+
var Widget = /* @__PURE__ */ function(Widget2) {
|
|
780
|
+
Widget2["DASHBOARD"] = "dashboard";
|
|
781
|
+
Widget2["REPORT"] = "report";
|
|
782
|
+
Widget2["DOWNLOAD_MANAGER"] = "download-manager";
|
|
783
|
+
Widget2["DOWNLOAD_MODAL"] = "download-modal";
|
|
784
|
+
Widget2["CHART_PANEL"] = "chart-panel";
|
|
785
|
+
Widget2["CHART_GALLERY"] = "chart-gallery";
|
|
786
|
+
Widget2["CHART_BUILDER"] = "chart-builder";
|
|
787
|
+
return Widget2;
|
|
788
|
+
}({});
|
|
789
|
+
var WIDGET_SUBMODULE_NAMES = {
|
|
790
|
+
["download-modal"]: "downloadModal",
|
|
791
|
+
["chart-panel"]: "chartPanel",
|
|
792
|
+
["chart-gallery"]: "chartGallery",
|
|
793
|
+
["chart-builder"]: "chartBuilder"
|
|
794
|
+
};
|
|
795
|
+
var WIDGET_STRUCTURE_SCOPE_KIND = "qrvey.widget-structure-scope";
|
|
796
|
+
var WIDGET_STRUCTURE_SCOPE_FORMAT = 1;
|
|
797
|
+
var WidgetVersion = /* @__PURE__ */ function(WidgetVersion2) {
|
|
798
|
+
WidgetVersion2["v1"] = "1.0";
|
|
799
|
+
WidgetVersion2["latest"] = "latest";
|
|
800
|
+
return WidgetVersion2;
|
|
801
|
+
}({});
|
|
802
|
+
|
|
803
|
+
// src/utils/defaults.helpers.ts
|
|
804
|
+
var FONT_SIZES = [
|
|
805
|
+
8,
|
|
806
|
+
9,
|
|
807
|
+
10,
|
|
808
|
+
11,
|
|
809
|
+
12,
|
|
810
|
+
14,
|
|
811
|
+
15,
|
|
812
|
+
16,
|
|
813
|
+
18,
|
|
814
|
+
24,
|
|
815
|
+
30,
|
|
816
|
+
36,
|
|
817
|
+
48,
|
|
818
|
+
60,
|
|
819
|
+
72,
|
|
820
|
+
96
|
|
821
|
+
];
|
|
822
|
+
function applyValidation(currentObj, validatorMap, parentKey = "", sanitize) {
|
|
823
|
+
const validatedObj = {};
|
|
824
|
+
Object.keys(currentObj).forEach((key) => {
|
|
825
|
+
const fullKey = parentKey ? `${parentKey}.${key}` : key;
|
|
826
|
+
const value = currentObj[key];
|
|
827
|
+
if (typeof value === "object" && !Array.isArray(value) && value !== null) {
|
|
828
|
+
validatedObj[key] = applyValidation(value, validatorMap, fullKey, sanitize);
|
|
829
|
+
} else if (validatorMap[fullKey]) {
|
|
830
|
+
validatedObj[key] = validatorMap[fullKey](value);
|
|
831
|
+
} else {
|
|
832
|
+
validatedObj[key] = sanitize && typeof value === "string" ? sanitize(value) : value;
|
|
833
|
+
}
|
|
834
|
+
});
|
|
835
|
+
return validatedObj;
|
|
836
|
+
}
|
|
837
|
+
__name(applyValidation, "applyValidation");
|
|
838
|
+
function validateDefaults(obj, validatorMap, sanitize) {
|
|
839
|
+
return applyValidation(obj, validatorMap, "", sanitize);
|
|
840
|
+
}
|
|
841
|
+
__name(validateDefaults, "validateDefaults");
|
|
842
|
+
var isANumber = /* @__PURE__ */ __name((value) => {
|
|
843
|
+
const _value = Number(value);
|
|
844
|
+
if (!_value || isNaN(_value)) return void 0;
|
|
845
|
+
return _value;
|
|
846
|
+
}, "isANumber");
|
|
847
|
+
var numberMinMaxValue = /* @__PURE__ */ __name((maxValue, minValue) => (value) => {
|
|
848
|
+
const _value = isANumber(value);
|
|
849
|
+
if (!_value) return void 0;
|
|
850
|
+
if (minValue && _value < minValue) return minValue;
|
|
851
|
+
if (_value > maxValue) return maxValue;
|
|
852
|
+
return _value;
|
|
853
|
+
}, "numberMinMaxValue");
|
|
854
|
+
var fontSizeMinMaxValue = /* @__PURE__ */ __name((minSize, maxSize) => (value) => {
|
|
855
|
+
const inputSize = parseInt(value, 10);
|
|
856
|
+
if (FONT_SIZES.includes(inputSize) && inputSize >= minSize && inputSize <= maxSize) {
|
|
857
|
+
return `${inputSize}px`;
|
|
858
|
+
}
|
|
859
|
+
const validFontSizes = FONT_SIZES.filter((size) => size >= minSize && size <= maxSize);
|
|
860
|
+
if (validFontSizes.length === 0) {
|
|
861
|
+
return void 0;
|
|
862
|
+
}
|
|
863
|
+
let closestSize = validFontSizes[0];
|
|
864
|
+
let smallestDiff = Math.abs(inputSize - closestSize);
|
|
865
|
+
for (const size of validFontSizes) {
|
|
866
|
+
const diff = Math.abs(inputSize - size);
|
|
867
|
+
if (diff < smallestDiff) {
|
|
868
|
+
smallestDiff = diff;
|
|
869
|
+
closestSize = size;
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
return `${closestSize}px`;
|
|
873
|
+
}, "fontSizeMinMaxValue");
|
|
874
|
+
var fontColorValue = /* @__PURE__ */ __name((value) => {
|
|
875
|
+
if (typeof value !== "string") return void 0;
|
|
876
|
+
const normalizedColor = value.toLowerCase();
|
|
877
|
+
return normalizedColor;
|
|
878
|
+
}, "fontColorValue");
|
|
879
|
+
var validateBoolean = /* @__PURE__ */ __name((value) => typeof value === "boolean" ? value : void 0, "validateBoolean");
|
|
880
|
+
var validateUnsavedChangesBehavior = /* @__PURE__ */ __name((value) => {
|
|
881
|
+
if (typeof value !== "string") return void 0;
|
|
882
|
+
return [
|
|
883
|
+
"prompt",
|
|
884
|
+
"autoSave",
|
|
885
|
+
"discard"
|
|
886
|
+
].includes(value) ? value : void 0;
|
|
887
|
+
}, "validateUnsavedChangesBehavior");
|
|
888
|
+
var validateType = /* @__PURE__ */ __name((validValues) => (value) => {
|
|
889
|
+
if (typeof value !== "string") return void 0;
|
|
890
|
+
const receivedValue = value.toUpperCase();
|
|
891
|
+
return validValues.includes(receivedValue) ? receivedValue : void 0;
|
|
892
|
+
}, "validateType");
|
|
893
|
+
var DX_VALIDATOR_MAP = {
|
|
894
|
+
"customStyles.header.height": numberMinMaxValue(300, 10),
|
|
895
|
+
"customStyles.text.fontSize": fontSizeMinMaxValue(8, 96),
|
|
896
|
+
"customStyles.text.fontColor": fontColorValue,
|
|
897
|
+
"customStyles.container.borderWidth": numberMinMaxValue(20, 1),
|
|
898
|
+
"customStyles.line.lineWidth": numberMinMaxValue(20, 1),
|
|
899
|
+
"customStyles.rectangle.borderWidth": numberMinMaxValue(20, 1),
|
|
900
|
+
"customStyles.ellipse.borderWidth": numberMinMaxValue(20, 1),
|
|
901
|
+
"customStyles.container.borderRadius": numberMinMaxValue(100, 0),
|
|
902
|
+
// Filter Controls: MULTISELECT LIST
|
|
903
|
+
"customStyles.filterList.type": validateType([
|
|
904
|
+
"LIST",
|
|
905
|
+
"DROPDOWN"
|
|
906
|
+
]),
|
|
907
|
+
"customStyles.filterList.triggerType": validateType([
|
|
908
|
+
"BUTTON",
|
|
909
|
+
"AUTOMATIC"
|
|
910
|
+
]),
|
|
911
|
+
// Filter Controls: INPUTBOX
|
|
912
|
+
"customStyles.filterInput.triggerType": validateType([
|
|
913
|
+
"BUTTON",
|
|
914
|
+
"AUTOMATIC"
|
|
915
|
+
]),
|
|
916
|
+
// Filter Controls: DATE
|
|
917
|
+
"customStyles.filterDate.triggerType": validateType([
|
|
918
|
+
"BUTTON",
|
|
919
|
+
"AUTOMATIC"
|
|
920
|
+
]),
|
|
921
|
+
// Unsaved Changes Behavior
|
|
922
|
+
unsavedChangesBehavior: validateUnsavedChangesBehavior,
|
|
923
|
+
// Download modal
|
|
924
|
+
"downloadModal.subscribeMyself": validateBoolean
|
|
925
|
+
};
|
|
926
|
+
var DOWNLOAD_MODAL_VALIDATOR_MAP = {
|
|
927
|
+
subscribeMyself: validateBoolean
|
|
928
|
+
};
|
|
929
|
+
|
|
930
|
+
// src/structures/download-modal.structure.v1.ts
|
|
931
|
+
var DOWNLOAD_MODAL_V1_KEYS = [
|
|
932
|
+
"qScheduleOption",
|
|
933
|
+
"qSubscribeOption",
|
|
934
|
+
"qSubscribeExternalUsers",
|
|
935
|
+
"qSubscribeBanner",
|
|
936
|
+
"qOwnerLabel",
|
|
937
|
+
"qSubscribeOwner",
|
|
938
|
+
"qSubscribeOrganization",
|
|
939
|
+
"qSubscribeMyself",
|
|
940
|
+
"qSubscribeSpecificPeople",
|
|
941
|
+
"qIncludeHyperlinks",
|
|
942
|
+
"qIncludeHeader"
|
|
943
|
+
];
|
|
944
|
+
var DOWNLOAD_MODAL_V1_KEEP_INHERITANCE = {
|
|
945
|
+
qSubscribeBanner: "qSubscribeOption",
|
|
946
|
+
qOwnerLabel: "qSubscribeOption",
|
|
947
|
+
qSubscribeOwner: "qSubscribeOption",
|
|
948
|
+
qSubscribeOrganization: "qSubscribeOption",
|
|
949
|
+
qSubscribeMyself: "qSubscribeOption",
|
|
950
|
+
qSubscribeSpecificPeople: "qSubscribeOption"
|
|
951
|
+
};
|
|
952
|
+
var hostKeepInheritance = /* @__PURE__ */ __name((section = "downloadModal") => Object.fromEntries(Object.entries(DOWNLOAD_MODAL_V1_KEEP_INHERITANCE).map(([key, alias]) => [
|
|
953
|
+
`${section}.${key}`,
|
|
954
|
+
`${section}.${alias}`
|
|
955
|
+
])), "hostKeepInheritance");
|
|
956
|
+
var DOWNLOAD_MODAL_V1_DEFAULTS = {
|
|
957
|
+
subscribeMyself: true
|
|
958
|
+
};
|
|
959
|
+
var downloadModalV1Config = {
|
|
960
|
+
version: "1.0",
|
|
961
|
+
keepInheritance: DOWNLOAD_MODAL_V1_KEEP_INHERITANCE,
|
|
962
|
+
baseStructure: __spreadValues({
|
|
963
|
+
defaults: __spreadValues({}, DOWNLOAD_MODAL_V1_DEFAULTS)
|
|
964
|
+
}, Object.fromEntries(DOWNLOAD_MODAL_V1_KEYS.map((key) => [
|
|
965
|
+
key,
|
|
966
|
+
true
|
|
967
|
+
])))
|
|
968
|
+
};
|
|
969
|
+
var download_modal_structure_v1_default = downloadModalV1Config;
|
|
970
|
+
|
|
971
|
+
// src/structures/dashboard.structure.v1.ts
|
|
972
|
+
var DOWNLOAD_MODAL_HOST_KEYS = [
|
|
973
|
+
"qExportVersion",
|
|
974
|
+
"qSavedVersionWarning",
|
|
975
|
+
"qUnsavedVersionWarning"
|
|
976
|
+
];
|
|
977
|
+
var dashboardV1Config = {
|
|
978
|
+
version: "1.0",
|
|
979
|
+
keepInheritance: hostKeepInheritance("downloadModal"),
|
|
980
|
+
baseStructure: {
|
|
981
|
+
views: {
|
|
982
|
+
list: [
|
|
983
|
+
"navBar",
|
|
984
|
+
"assetList",
|
|
985
|
+
"controlBarLeft",
|
|
986
|
+
"controlBarRight",
|
|
987
|
+
"qQvTokenExpiredMessage",
|
|
988
|
+
"duplicateModal"
|
|
989
|
+
],
|
|
990
|
+
design: [
|
|
991
|
+
"navBar",
|
|
992
|
+
"header",
|
|
993
|
+
"controlBarRight",
|
|
994
|
+
"menuBar",
|
|
995
|
+
"toolBar",
|
|
996
|
+
"configPanel",
|
|
997
|
+
"filterPanel",
|
|
998
|
+
"downloadModal",
|
|
999
|
+
"canvas",
|
|
1000
|
+
"qQvTokenExpiredMessage",
|
|
1001
|
+
"duplicateModal"
|
|
1002
|
+
],
|
|
1003
|
+
preview: [
|
|
1004
|
+
"navBar",
|
|
1005
|
+
"header",
|
|
1006
|
+
"controlBarRight",
|
|
1007
|
+
"filterPanel",
|
|
1008
|
+
"qGoToDashBackButton",
|
|
1009
|
+
"qQvTokenExpiredMessage"
|
|
1010
|
+
],
|
|
1011
|
+
endUser: [
|
|
1012
|
+
"navBar",
|
|
1013
|
+
"toolBar",
|
|
1014
|
+
"filterPanel",
|
|
1015
|
+
"downloadModal",
|
|
1016
|
+
"canvas",
|
|
1017
|
+
"qGoToDashBackButton",
|
|
1018
|
+
"qQvTokenExpiredMessage"
|
|
1019
|
+
]
|
|
1020
|
+
},
|
|
1021
|
+
navBar: [
|
|
1022
|
+
"qAppTitle",
|
|
1023
|
+
"qBackButton"
|
|
1024
|
+
],
|
|
1025
|
+
endUserTopBar: [
|
|
1026
|
+
"indicator",
|
|
1027
|
+
"options"
|
|
1028
|
+
],
|
|
1029
|
+
assetList: {
|
|
1030
|
+
defaults: {
|
|
1031
|
+
assetListViewMode: "card"
|
|
1032
|
+
},
|
|
1033
|
+
asset: {
|
|
1034
|
+
optionMenu: [
|
|
1035
|
+
"qEditDash",
|
|
1036
|
+
"qUseDash",
|
|
1037
|
+
"qRenameDash",
|
|
1038
|
+
"qDeleteDash",
|
|
1039
|
+
"qDuplDash",
|
|
1040
|
+
"qDuplDashAndCharts",
|
|
1041
|
+
"qManageSharing",
|
|
1042
|
+
"qManageTags"
|
|
1043
|
+
],
|
|
1044
|
+
card: [
|
|
1045
|
+
"qFavorite",
|
|
1046
|
+
"qCreatedDate",
|
|
1047
|
+
"qLastModifDate",
|
|
1048
|
+
"qStatus",
|
|
1049
|
+
"qNumberOfCharts",
|
|
1050
|
+
"qSharing",
|
|
1051
|
+
"qSharingIcon",
|
|
1052
|
+
"qOwner",
|
|
1053
|
+
"qDescription",
|
|
1054
|
+
"qTags"
|
|
1055
|
+
],
|
|
1056
|
+
table: [
|
|
1057
|
+
"qFavorite",
|
|
1058
|
+
"qCreatedDate",
|
|
1059
|
+
"qLastModifDate",
|
|
1060
|
+
"qStatus",
|
|
1061
|
+
"qNumberOfCharts",
|
|
1062
|
+
"qSharing",
|
|
1063
|
+
"qSharingIcon",
|
|
1064
|
+
"qOwner",
|
|
1065
|
+
"qDescription",
|
|
1066
|
+
"qTags"
|
|
1067
|
+
]
|
|
1068
|
+
}
|
|
1069
|
+
},
|
|
1070
|
+
canvas: {
|
|
1071
|
+
defaults: {
|
|
1072
|
+
removeElement: true,
|
|
1073
|
+
dragElement: true,
|
|
1074
|
+
resizeElement: true
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
controlBarLeft: [
|
|
1078
|
+
"qCreateDash"
|
|
1079
|
+
],
|
|
1080
|
+
controlBarRight: [
|
|
1081
|
+
"qSwitchView",
|
|
1082
|
+
"timezone",
|
|
1083
|
+
"qFilterBy",
|
|
1084
|
+
"qFilterByTags",
|
|
1085
|
+
"qSortBy",
|
|
1086
|
+
"qSearch",
|
|
1087
|
+
"qSelectColumn",
|
|
1088
|
+
"qStatus",
|
|
1089
|
+
"qPreview",
|
|
1090
|
+
"qDiscard",
|
|
1091
|
+
"qPublish",
|
|
1092
|
+
"qUnpublish",
|
|
1093
|
+
"qSwitchMode",
|
|
1094
|
+
"qDesign",
|
|
1095
|
+
"qDownloadList"
|
|
1096
|
+
],
|
|
1097
|
+
header: [
|
|
1098
|
+
"qDashFavorite",
|
|
1099
|
+
"qSharingIcon",
|
|
1100
|
+
"qDashName",
|
|
1101
|
+
"qDashDesc",
|
|
1102
|
+
"qTags",
|
|
1103
|
+
{
|
|
1104
|
+
qOptionsMenu: [
|
|
1105
|
+
"qDuplDash",
|
|
1106
|
+
"qDeleteDash",
|
|
1107
|
+
"qManageSharing",
|
|
1108
|
+
"qManageTags"
|
|
1109
|
+
]
|
|
1110
|
+
}
|
|
1111
|
+
],
|
|
1112
|
+
menuBar: {
|
|
1113
|
+
file: [
|
|
1114
|
+
"qMnuCreateDash",
|
|
1115
|
+
"qMnuOpenDash",
|
|
1116
|
+
"qMnuDuplicateDash",
|
|
1117
|
+
"qMnuDuplicateDashAndCharts",
|
|
1118
|
+
"qMnuCanvasSize",
|
|
1119
|
+
"qMnuThemes",
|
|
1120
|
+
"qManageSharing",
|
|
1121
|
+
"qManageTags",
|
|
1122
|
+
"qMnuDeleteDash",
|
|
1123
|
+
{
|
|
1124
|
+
qCreateDataset: [
|
|
1125
|
+
"qCreateCustomDataset",
|
|
1126
|
+
"qViewCustomDataset"
|
|
1127
|
+
],
|
|
1128
|
+
qMnuDownloadDash: [
|
|
1129
|
+
"qDashPDF",
|
|
1130
|
+
"qDashCSV",
|
|
1131
|
+
"qDashExcel",
|
|
1132
|
+
"qDashDataset"
|
|
1133
|
+
]
|
|
1134
|
+
}
|
|
1135
|
+
],
|
|
1136
|
+
edit: [
|
|
1137
|
+
"qUndoRedo",
|
|
1138
|
+
"qCopyElement",
|
|
1139
|
+
"qPasteElement",
|
|
1140
|
+
"qCutElement",
|
|
1141
|
+
"qRemoveElement",
|
|
1142
|
+
"qDuplElement",
|
|
1143
|
+
"qSelectAllElem",
|
|
1144
|
+
"qSelectAllContElem"
|
|
1145
|
+
],
|
|
1146
|
+
grid: [
|
|
1147
|
+
"qMnuSnapToGrid",
|
|
1148
|
+
"qMnuDisplayGrid",
|
|
1149
|
+
"qMnuSwitchGrid"
|
|
1150
|
+
],
|
|
1151
|
+
insert: [
|
|
1152
|
+
{
|
|
1153
|
+
qMnuInsertChart: [
|
|
1154
|
+
"qMnuExistingChart",
|
|
1155
|
+
"qMnuNewChart",
|
|
1156
|
+
"qMnuNewChartAI"
|
|
1157
|
+
],
|
|
1158
|
+
qMnuInsertFilterCtrl: [
|
|
1159
|
+
"qMnuDatePicker",
|
|
1160
|
+
"qMnuInputBox",
|
|
1161
|
+
"qMnuMultiSelectList",
|
|
1162
|
+
"qMnuSingleSelectList"
|
|
1163
|
+
],
|
|
1164
|
+
qMnuInsertShape: [
|
|
1165
|
+
"qMnuLine",
|
|
1166
|
+
"qMnuRectangle",
|
|
1167
|
+
"qMnuEllipse"
|
|
1168
|
+
]
|
|
1169
|
+
},
|
|
1170
|
+
"qMnuInsertText",
|
|
1171
|
+
"qMnuInsertImage",
|
|
1172
|
+
"qMnuInsertButton",
|
|
1173
|
+
"qMnuInsertContainer",
|
|
1174
|
+
"qMnuInsertHeader",
|
|
1175
|
+
"qMnuInsertTabs"
|
|
1176
|
+
],
|
|
1177
|
+
qMnuArrange: [
|
|
1178
|
+
"qMnuBringToFront",
|
|
1179
|
+
"qMnuSendToBack",
|
|
1180
|
+
{
|
|
1181
|
+
qMnuAlign: [
|
|
1182
|
+
"qAlignRight",
|
|
1183
|
+
"qAlignLeft",
|
|
1184
|
+
"qAlignCenter",
|
|
1185
|
+
"qAlignTop",
|
|
1186
|
+
"qAlignMiddle",
|
|
1187
|
+
"qAlignBottom"
|
|
1188
|
+
]
|
|
1189
|
+
}
|
|
1190
|
+
]
|
|
1191
|
+
},
|
|
1192
|
+
toolBar: [
|
|
1193
|
+
"qCanvasSize",
|
|
1194
|
+
{
|
|
1195
|
+
qInsertChart: [
|
|
1196
|
+
"qExistingChart",
|
|
1197
|
+
"qNewChart",
|
|
1198
|
+
"qNewChartAI"
|
|
1199
|
+
],
|
|
1200
|
+
qInsertFilterCtrl: [
|
|
1201
|
+
"qDatePicker",
|
|
1202
|
+
"qInputBox",
|
|
1203
|
+
"qMultiSelectList",
|
|
1204
|
+
"qSingleSelectList"
|
|
1205
|
+
],
|
|
1206
|
+
qInsertShape: [
|
|
1207
|
+
"qLine",
|
|
1208
|
+
"qRectangle",
|
|
1209
|
+
"qEllipse"
|
|
1210
|
+
],
|
|
1211
|
+
grid: [
|
|
1212
|
+
"qSnapToGrid",
|
|
1213
|
+
"qDisplayGrid",
|
|
1214
|
+
"qSwitchGrid"
|
|
1215
|
+
],
|
|
1216
|
+
qDownloadDash: [
|
|
1217
|
+
"qDashPDF",
|
|
1218
|
+
"qDashCSV",
|
|
1219
|
+
"qDashExcel",
|
|
1220
|
+
"qDashDataset"
|
|
1221
|
+
],
|
|
1222
|
+
qArrange: [
|
|
1223
|
+
"qBringToFront",
|
|
1224
|
+
"qSendToBack"
|
|
1225
|
+
],
|
|
1226
|
+
qResponsiveView: [
|
|
1227
|
+
"qDesktop",
|
|
1228
|
+
"qTablet",
|
|
1229
|
+
"qMobile",
|
|
1230
|
+
"qBreakpoints"
|
|
1231
|
+
],
|
|
1232
|
+
qAlign: [
|
|
1233
|
+
"qAlignRight",
|
|
1234
|
+
"qAlignLeft",
|
|
1235
|
+
"qAlignCenter",
|
|
1236
|
+
"qAlignTop",
|
|
1237
|
+
"qAlignMiddle",
|
|
1238
|
+
"qAlignBottom"
|
|
1239
|
+
],
|
|
1240
|
+
qCreateDataset: [
|
|
1241
|
+
"qCreateCustomDataset",
|
|
1242
|
+
"qViewCustomDataset"
|
|
1243
|
+
]
|
|
1244
|
+
},
|
|
1245
|
+
"qInsertText",
|
|
1246
|
+
"qInsertImage",
|
|
1247
|
+
"qInsertButton",
|
|
1248
|
+
"qInsertContainer",
|
|
1249
|
+
"qRespGridMargins",
|
|
1250
|
+
"qRespGridColumns",
|
|
1251
|
+
"qThemes",
|
|
1252
|
+
"qUndoRedo",
|
|
1253
|
+
// only for end user
|
|
1254
|
+
"qDashVersion",
|
|
1255
|
+
"qGetDashVersion",
|
|
1256
|
+
"qSourceDashBanner",
|
|
1257
|
+
"qHiddenItems",
|
|
1258
|
+
"qDiscard",
|
|
1259
|
+
"qSave",
|
|
1260
|
+
"qSwitchMode",
|
|
1261
|
+
"qHideToolBar",
|
|
1262
|
+
"qDownloadList",
|
|
1263
|
+
"qChangeLayout"
|
|
1264
|
+
],
|
|
1265
|
+
qQvTokenExpiredMessage: true,
|
|
1266
|
+
qGoToDashBackButton: true,
|
|
1267
|
+
configPanel: true,
|
|
1268
|
+
filterPanel: {
|
|
1269
|
+
qAddFilter: true,
|
|
1270
|
+
qEnabDisabAllFilters: true,
|
|
1271
|
+
qDeleteAllFilters: true,
|
|
1272
|
+
qFilterSettings: true,
|
|
1273
|
+
viewOnlyFilterScope: true,
|
|
1274
|
+
dashFilterScope: [
|
|
1275
|
+
"qEditFilter",
|
|
1276
|
+
"qEnabDisabFilter",
|
|
1277
|
+
"qDeleteFilter"
|
|
1278
|
+
],
|
|
1279
|
+
tabFilterScope: [
|
|
1280
|
+
"qEditFilter",
|
|
1281
|
+
"qEnabDisabFilter",
|
|
1282
|
+
"qDeleteFilter"
|
|
1283
|
+
],
|
|
1284
|
+
containerFilterScope: [
|
|
1285
|
+
"qEditFilter",
|
|
1286
|
+
"qEnabDisabFilter",
|
|
1287
|
+
"qDeleteFilter"
|
|
1288
|
+
],
|
|
1289
|
+
panelFilterScope: [
|
|
1290
|
+
"qEditFilter",
|
|
1291
|
+
"qEnabDisabFilter",
|
|
1292
|
+
"qDeleteFilter"
|
|
1293
|
+
]
|
|
1294
|
+
},
|
|
1295
|
+
downloadModal: [
|
|
1296
|
+
...DOWNLOAD_MODAL_V1_KEYS,
|
|
1297
|
+
...DOWNLOAD_MODAL_HOST_KEYS
|
|
1298
|
+
],
|
|
1299
|
+
duplicateModal: [
|
|
1300
|
+
"qCharts",
|
|
1301
|
+
"qFilters",
|
|
1302
|
+
"qDashActions",
|
|
1303
|
+
{
|
|
1304
|
+
options: {
|
|
1305
|
+
defaults: {
|
|
1306
|
+
qCharts: true,
|
|
1307
|
+
qFilters: true,
|
|
1308
|
+
qDashActions: true
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
],
|
|
1313
|
+
subModules: {
|
|
1314
|
+
chartPanel: {},
|
|
1315
|
+
chartGallery: {},
|
|
1316
|
+
chartBuilder: {}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1320
|
+
var dashboard_structure_v1_default = dashboardV1Config;
|
|
1321
|
+
|
|
1322
|
+
// src/structures/download-manager.structure.v1.ts
|
|
1323
|
+
var downloadManagerV1Config = {
|
|
1324
|
+
version: "1.0",
|
|
1325
|
+
keepInheritance: hostKeepInheritance("downloadModal"),
|
|
1326
|
+
baseStructure: {
|
|
1327
|
+
views: {
|
|
1328
|
+
main: [
|
|
1329
|
+
"header",
|
|
1330
|
+
"controlBar",
|
|
1331
|
+
"assetList",
|
|
1332
|
+
"moreInfoModal",
|
|
1333
|
+
"downloadModal"
|
|
1334
|
+
],
|
|
1335
|
+
detail: [
|
|
1336
|
+
"header",
|
|
1337
|
+
"controlBar",
|
|
1338
|
+
"assetList",
|
|
1339
|
+
"moreInfoModal",
|
|
1340
|
+
"bottomBar",
|
|
1341
|
+
"downloadModal"
|
|
1342
|
+
]
|
|
1343
|
+
},
|
|
1344
|
+
header: [
|
|
1345
|
+
"qTitle"
|
|
1346
|
+
],
|
|
1347
|
+
controlBar: {
|
|
1348
|
+
defaults: {
|
|
1349
|
+
filters: {}
|
|
1350
|
+
},
|
|
1351
|
+
qFilterByFileType: [
|
|
1352
|
+
"qTypePDF",
|
|
1353
|
+
"qTypeJPG",
|
|
1354
|
+
"qTypeCSV",
|
|
1355
|
+
"qTypeExcel",
|
|
1356
|
+
"qTypeZIP"
|
|
1357
|
+
],
|
|
1358
|
+
qFilterByExecution: [
|
|
1359
|
+
"qExecScheduled",
|
|
1360
|
+
"qExecOthers"
|
|
1361
|
+
],
|
|
1362
|
+
qFilterByWidget: [
|
|
1363
|
+
"qWidgetAnalyze",
|
|
1364
|
+
"qWidgetAutomation",
|
|
1365
|
+
"qWidgetDash",
|
|
1366
|
+
"qWidgetLegacyDash",
|
|
1367
|
+
"qWidgetSubscriptions",
|
|
1368
|
+
"qWidgetPPR"
|
|
1369
|
+
],
|
|
1370
|
+
qFilterByAsset: true,
|
|
1371
|
+
qFilterByOrganization: true,
|
|
1372
|
+
qFilterByOwner: true,
|
|
1373
|
+
qSearch: true,
|
|
1374
|
+
qRemoveFilters: true,
|
|
1375
|
+
qScheduleDetail: true,
|
|
1376
|
+
qFilesExported: true,
|
|
1377
|
+
qMoreInfo: true
|
|
1378
|
+
},
|
|
1379
|
+
assetList: {
|
|
1380
|
+
asset: [
|
|
1381
|
+
{
|
|
1382
|
+
optionMenu: [
|
|
1383
|
+
"qDelete",
|
|
1384
|
+
"qMoreInfo",
|
|
1385
|
+
"qDeleteAllFiles",
|
|
1386
|
+
"qEditSched",
|
|
1387
|
+
"qPauseRestartSched",
|
|
1388
|
+
"qUnsubscribe",
|
|
1389
|
+
"qSubscribe"
|
|
1390
|
+
],
|
|
1391
|
+
table: [
|
|
1392
|
+
"qType",
|
|
1393
|
+
"qSchedule",
|
|
1394
|
+
"qSize",
|
|
1395
|
+
"qCreationDate",
|
|
1396
|
+
"qExpirationDate",
|
|
1397
|
+
"qDownload",
|
|
1398
|
+
"qOrganization",
|
|
1399
|
+
"qOwner"
|
|
1400
|
+
]
|
|
1401
|
+
},
|
|
1402
|
+
"qDrillToDetail",
|
|
1403
|
+
"qUnsubscribe",
|
|
1404
|
+
"qSubscribe"
|
|
1405
|
+
]
|
|
1406
|
+
},
|
|
1407
|
+
bottomBar: [
|
|
1408
|
+
"qDeleteAllFiles",
|
|
1409
|
+
"qEditSched",
|
|
1410
|
+
"qPauseRestartSched",
|
|
1411
|
+
"qDelete"
|
|
1412
|
+
],
|
|
1413
|
+
// The export modal's own keys, so a scope of this section carries all of them.
|
|
1414
|
+
downloadModal: [
|
|
1415
|
+
...DOWNLOAD_MODAL_V1_KEYS
|
|
1416
|
+
],
|
|
1417
|
+
moreInfoModal: [
|
|
1418
|
+
"qFileType",
|
|
1419
|
+
"qSource",
|
|
1420
|
+
"qOwner",
|
|
1421
|
+
"qApplication",
|
|
1422
|
+
"qPath",
|
|
1423
|
+
"qOrganization",
|
|
1424
|
+
"qErrorMessage"
|
|
1425
|
+
]
|
|
1426
|
+
}
|
|
1427
|
+
};
|
|
1428
|
+
var download_manager_structure_v1_default = downloadManagerV1Config;
|
|
1429
|
+
|
|
1430
|
+
// src/structures/report.structure.v1.ts
|
|
1431
|
+
var reportV1Config = {
|
|
1432
|
+
version: "1.0",
|
|
1433
|
+
baseStructure: {
|
|
1434
|
+
views: {
|
|
1435
|
+
list: [
|
|
1436
|
+
"navBar",
|
|
1437
|
+
"assetList",
|
|
1438
|
+
"controlBarLeft",
|
|
1439
|
+
"controlBarRight"
|
|
1440
|
+
],
|
|
1441
|
+
design: [
|
|
1442
|
+
"navBar",
|
|
1443
|
+
"controlBarRight",
|
|
1444
|
+
"menuBar",
|
|
1445
|
+
"toolBar",
|
|
1446
|
+
"configPanel",
|
|
1447
|
+
"filterPanel",
|
|
1448
|
+
"dataPanel"
|
|
1449
|
+
],
|
|
1450
|
+
preview: [
|
|
1451
|
+
"navBar",
|
|
1452
|
+
"tabBar",
|
|
1453
|
+
"toolBar",
|
|
1454
|
+
"pagePreview",
|
|
1455
|
+
"controlBarRight",
|
|
1456
|
+
"downloadModal"
|
|
1457
|
+
]
|
|
1458
|
+
},
|
|
1459
|
+
navBar: [
|
|
1460
|
+
"qAppTitle",
|
|
1461
|
+
"qBackButton"
|
|
1462
|
+
],
|
|
1463
|
+
tabBar: [
|
|
1464
|
+
"qTabSelector",
|
|
1465
|
+
"qScrollButton"
|
|
1466
|
+
],
|
|
1467
|
+
assetList: {
|
|
1468
|
+
defaults: {
|
|
1469
|
+
assetListViewMode: "card"
|
|
1470
|
+
},
|
|
1471
|
+
asset: {
|
|
1472
|
+
optionMenu: [
|
|
1473
|
+
"qEditRep",
|
|
1474
|
+
"qRenameRep",
|
|
1475
|
+
"qDeleteRep",
|
|
1476
|
+
"qDuplRep"
|
|
1477
|
+
]
|
|
1478
|
+
}
|
|
1479
|
+
},
|
|
1480
|
+
controlBarLeft: [
|
|
1481
|
+
"qCreateRep"
|
|
1482
|
+
],
|
|
1483
|
+
controlBarRight: [
|
|
1484
|
+
"qSwitchView",
|
|
1485
|
+
"timezone",
|
|
1486
|
+
"qFilterBy",
|
|
1487
|
+
"qSortBy",
|
|
1488
|
+
"qSearch",
|
|
1489
|
+
"qPreview",
|
|
1490
|
+
"qDesign"
|
|
1491
|
+
],
|
|
1492
|
+
menuBar: {
|
|
1493
|
+
edit: [
|
|
1494
|
+
"qCopyElement",
|
|
1495
|
+
"qPasteElement"
|
|
1496
|
+
]
|
|
1497
|
+
},
|
|
1498
|
+
toolBar: [
|
|
1499
|
+
"qPageSetup",
|
|
1500
|
+
{
|
|
1501
|
+
qInsertShape: [
|
|
1502
|
+
"qLine",
|
|
1503
|
+
"qRectangle",
|
|
1504
|
+
"qEllipse"
|
|
1505
|
+
],
|
|
1506
|
+
grid: [
|
|
1507
|
+
"qDisplayRuler",
|
|
1508
|
+
"qDisplayGrid"
|
|
1509
|
+
],
|
|
1510
|
+
qArrange: [
|
|
1511
|
+
"qBringToFront",
|
|
1512
|
+
"qSendToBack"
|
|
1513
|
+
],
|
|
1514
|
+
qAlign: [
|
|
1515
|
+
"qAlignRight",
|
|
1516
|
+
"qAlignLeft",
|
|
1517
|
+
"qAlignCenter",
|
|
1518
|
+
"qAlignTop",
|
|
1519
|
+
"qAlignMiddle",
|
|
1520
|
+
"qAlignBottom"
|
|
1521
|
+
],
|
|
1522
|
+
qDownloadReport: [
|
|
1523
|
+
"qReportPDF",
|
|
1524
|
+
"qReportExcel"
|
|
1525
|
+
]
|
|
1526
|
+
},
|
|
1527
|
+
"qUndoRedo",
|
|
1528
|
+
"qInsertDTable",
|
|
1529
|
+
"qInsertSTable",
|
|
1530
|
+
"qInsertImage",
|
|
1531
|
+
"qInsertText",
|
|
1532
|
+
"qInsertPageGroup",
|
|
1533
|
+
"qInsertFormula",
|
|
1534
|
+
"qInsertBucket",
|
|
1535
|
+
"qInsertPageBreak"
|
|
1536
|
+
],
|
|
1537
|
+
configPanel: true,
|
|
1538
|
+
dataPanel: {
|
|
1539
|
+
tabDataset: [
|
|
1540
|
+
"qChangeDataSet",
|
|
1541
|
+
"qSearch"
|
|
1542
|
+
],
|
|
1543
|
+
tabParameters: [
|
|
1544
|
+
"qAddParameter",
|
|
1545
|
+
"qSearch"
|
|
1546
|
+
]
|
|
1547
|
+
},
|
|
1548
|
+
filterPanel: {
|
|
1549
|
+
qAddFilter: true,
|
|
1550
|
+
qEnabDisabAllFilters: true,
|
|
1551
|
+
qDeleteAllFilters: true,
|
|
1552
|
+
qFilterSettings: true,
|
|
1553
|
+
repoFilterScope: [
|
|
1554
|
+
"qEditFilter",
|
|
1555
|
+
"qEnabDisabFilter",
|
|
1556
|
+
"qDeleteFilter"
|
|
1557
|
+
],
|
|
1558
|
+
tabFilterScope: [
|
|
1559
|
+
"qEditFilter",
|
|
1560
|
+
"qEnabDisabFilter",
|
|
1561
|
+
"qDeleteFilter"
|
|
1562
|
+
],
|
|
1563
|
+
panelFilterScope: [
|
|
1564
|
+
"qEditFilter",
|
|
1565
|
+
"qEnabDisabFilter",
|
|
1566
|
+
"qDeleteFilter"
|
|
1567
|
+
]
|
|
1568
|
+
},
|
|
1569
|
+
downloadModal: [
|
|
1570
|
+
"qScheduleOption",
|
|
1571
|
+
"qSubscribeOption",
|
|
1572
|
+
"qSubscribeExternalUsers"
|
|
1573
|
+
]
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
var report_structure_v1_default = reportV1Config;
|
|
1577
|
+
|
|
1578
|
+
// src/structures/chart-panel.structure.v1.ts
|
|
1579
|
+
var optionMenuChildren = [
|
|
1580
|
+
"qEditChart",
|
|
1581
|
+
"qDuplicateChart",
|
|
1582
|
+
{
|
|
1583
|
+
qDownloadChart: [
|
|
1584
|
+
"qChartJPG",
|
|
1585
|
+
"qChartPDF",
|
|
1586
|
+
"qChartCSV",
|
|
1587
|
+
"qChartSummary",
|
|
1588
|
+
"qChartExcel"
|
|
1589
|
+
]
|
|
1590
|
+
}
|
|
1591
|
+
];
|
|
1592
|
+
var headerConfig = [
|
|
1593
|
+
"qChartName",
|
|
1594
|
+
"qFitPanel",
|
|
1595
|
+
"qChartSelection",
|
|
1596
|
+
"qColumnSection",
|
|
1597
|
+
"qSorting",
|
|
1598
|
+
"qColumnReplacement",
|
|
1599
|
+
"qColumnAggregation",
|
|
1600
|
+
"qColumnGrouping",
|
|
1601
|
+
"qDateGrouping",
|
|
1602
|
+
"qColumnSelection",
|
|
1603
|
+
"qResetColumnsWidth",
|
|
1604
|
+
"qSmartAnalyzer",
|
|
1605
|
+
{
|
|
1606
|
+
optionMenu: optionMenuChildren
|
|
1607
|
+
},
|
|
1608
|
+
{
|
|
1609
|
+
qFilter: [
|
|
1610
|
+
"qAddFilter",
|
|
1611
|
+
{
|
|
1612
|
+
dashFilterScope: [
|
|
1613
|
+
"qEditFilter",
|
|
1614
|
+
"qDeleteFilter"
|
|
1615
|
+
]
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
tabFilterScope: [
|
|
1619
|
+
"qEditFilter",
|
|
1620
|
+
"qDeleteFilter"
|
|
1621
|
+
]
|
|
1622
|
+
},
|
|
1623
|
+
{
|
|
1624
|
+
panelFilterScope: [
|
|
1625
|
+
"qEditFilter",
|
|
1626
|
+
"qDeleteFilter"
|
|
1627
|
+
]
|
|
1628
|
+
}
|
|
1629
|
+
]
|
|
1630
|
+
},
|
|
1631
|
+
{
|
|
1632
|
+
optionDateGrouping: [
|
|
1633
|
+
"qDayOnly",
|
|
1634
|
+
"qMonth",
|
|
1635
|
+
"qMonthOnly",
|
|
1636
|
+
"qQuarter",
|
|
1637
|
+
"qQuarterOnly",
|
|
1638
|
+
"qWeek",
|
|
1639
|
+
"qYear",
|
|
1640
|
+
"qDay",
|
|
1641
|
+
"qHour",
|
|
1642
|
+
"qHourOnly",
|
|
1643
|
+
"qMinute",
|
|
1644
|
+
"qMinuteOnly",
|
|
1645
|
+
"qSecond",
|
|
1646
|
+
"qSecondOnly"
|
|
1647
|
+
]
|
|
1648
|
+
}
|
|
1649
|
+
];
|
|
1650
|
+
var floatingMenuConfig = [
|
|
1651
|
+
...headerConfig.filter((item) => typeof item !== "object" || !("optionMenu" in item)),
|
|
1652
|
+
...optionMenuChildren
|
|
1653
|
+
];
|
|
1654
|
+
var chartPanelV1Config = {
|
|
1655
|
+
version: "1.0",
|
|
1656
|
+
baseStructure: {
|
|
1657
|
+
header: headerConfig,
|
|
1658
|
+
floatingMenu: floatingMenuConfig,
|
|
1659
|
+
menuLayout: {
|
|
1660
|
+
defaults: {
|
|
1661
|
+
menuLayout: void 0
|
|
1662
|
+
}
|
|
1663
|
+
},
|
|
1664
|
+
body: [
|
|
1665
|
+
"actions",
|
|
1666
|
+
"qComparativeAnalysis"
|
|
1667
|
+
]
|
|
1668
|
+
}
|
|
1669
|
+
};
|
|
1670
|
+
var chart_panel_structure_v1_default = chartPanelV1Config;
|
|
1671
|
+
|
|
1672
|
+
// src/structures/chart-gallery.structure.v1.ts
|
|
1673
|
+
var chartGalleryV1Config = {
|
|
1674
|
+
version: "1.0",
|
|
1675
|
+
baseStructure: {
|
|
1676
|
+
chartTypeFilter: true,
|
|
1677
|
+
showSummary: true,
|
|
1678
|
+
inputSearch: true,
|
|
1679
|
+
switch: true,
|
|
1680
|
+
subModules: {
|
|
1681
|
+
chartPanel: {
|
|
1682
|
+
title: false
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
var chart_gallery_structure_v1_default = chartGalleryV1Config;
|
|
1688
|
+
|
|
1689
|
+
// src/structures/chart-builder.structure.v1.ts
|
|
1690
|
+
var chartBuilderV1Config = {
|
|
1691
|
+
version: "1.0",
|
|
1692
|
+
baseStructure: {
|
|
1693
|
+
chartTypeFilter: true,
|
|
1694
|
+
showSummary: true,
|
|
1695
|
+
inputSearch: true,
|
|
1696
|
+
switch: true,
|
|
1697
|
+
subModules: {
|
|
1698
|
+
chartPanel: {
|
|
1699
|
+
title: false
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
var chart_builder_structure_v1_default = chartBuilderV1Config;
|
|
1705
|
+
|
|
1706
|
+
// src/constants/configs.ts
|
|
1707
|
+
var widgetConfigs = {
|
|
1708
|
+
[Widget.DASHBOARD]: {
|
|
1709
|
+
[WidgetVersion.v1]: dashboard_structure_v1_default,
|
|
1710
|
+
[WidgetVersion.latest]: dashboard_structure_v1_default
|
|
1711
|
+
},
|
|
1712
|
+
[Widget.REPORT]: {
|
|
1713
|
+
[WidgetVersion.v1]: report_structure_v1_default,
|
|
1714
|
+
[WidgetVersion.latest]: report_structure_v1_default
|
|
1715
|
+
},
|
|
1716
|
+
[Widget.DOWNLOAD_MANAGER]: {
|
|
1717
|
+
[WidgetVersion.v1]: download_manager_structure_v1_default,
|
|
1718
|
+
[WidgetVersion.latest]: download_manager_structure_v1_default
|
|
1719
|
+
},
|
|
1720
|
+
[Widget.DOWNLOAD_MODAL]: {
|
|
1721
|
+
[WidgetVersion.v1]: download_modal_structure_v1_default,
|
|
1722
|
+
[WidgetVersion.latest]: download_modal_structure_v1_default
|
|
1723
|
+
},
|
|
1724
|
+
[Widget.CHART_PANEL]: {
|
|
1725
|
+
[WidgetVersion.v1]: chart_panel_structure_v1_default,
|
|
1726
|
+
[WidgetVersion.latest]: chart_panel_structure_v1_default
|
|
1727
|
+
},
|
|
1728
|
+
[Widget.CHART_GALLERY]: {
|
|
1729
|
+
[WidgetVersion.v1]: chart_gallery_structure_v1_default,
|
|
1730
|
+
[WidgetVersion.latest]: chart_gallery_structure_v1_default
|
|
1731
|
+
},
|
|
1732
|
+
[Widget.CHART_BUILDER]: {
|
|
1733
|
+
[WidgetVersion.v1]: chart_builder_structure_v1_default,
|
|
1734
|
+
[WidgetVersion.latest]: chart_builder_structure_v1_default
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
var widgetValidators = {
|
|
1738
|
+
[Widget.DASHBOARD]: DX_VALIDATOR_MAP,
|
|
1739
|
+
[Widget.REPORT]: DX_VALIDATOR_MAP,
|
|
1740
|
+
[Widget.DOWNLOAD_MANAGER]: DX_VALIDATOR_MAP,
|
|
1741
|
+
[Widget.DOWNLOAD_MODAL]: DOWNLOAD_MODAL_VALIDATOR_MAP
|
|
1742
|
+
};
|
|
1743
|
+
|
|
1744
|
+
// src/models/conditions.models.ts
|
|
1745
|
+
var allowedOperators = [
|
|
1746
|
+
"=",
|
|
1747
|
+
"!=",
|
|
1748
|
+
">",
|
|
1749
|
+
">=",
|
|
1750
|
+
"<",
|
|
1751
|
+
"<=",
|
|
1752
|
+
"startsWith",
|
|
1753
|
+
"endsWith",
|
|
1754
|
+
"contains"
|
|
1755
|
+
];
|
|
1756
|
+
|
|
1757
|
+
// src/utils/conditions.helpers.ts
|
|
1758
|
+
function isOperator(value) {
|
|
1759
|
+
return allowedOperators.includes(value);
|
|
1760
|
+
}
|
|
1761
|
+
__name(isOperator, "isOperator");
|
|
1762
|
+
function getValue(condition, state) {
|
|
1763
|
+
return state[condition.field];
|
|
1764
|
+
}
|
|
1765
|
+
__name(getValue, "getValue");
|
|
1766
|
+
function _evalConditionOperator(condition, state, operator) {
|
|
1767
|
+
const value = getValue(condition, state);
|
|
1768
|
+
if (value == null) return false;
|
|
1769
|
+
return operator(value, condition.value);
|
|
1770
|
+
}
|
|
1771
|
+
__name(_evalConditionOperator, "_evalConditionOperator");
|
|
1772
|
+
var OPERATOR_MAP = {
|
|
1773
|
+
"=": /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => a == b), "="),
|
|
1774
|
+
"!=": /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => a != b), "!="),
|
|
1775
|
+
"<": /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => a < b), "<"),
|
|
1776
|
+
"<=": /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => a <= b), "<="),
|
|
1777
|
+
">": /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => a > b), ">"),
|
|
1778
|
+
">=": /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => a >= b), ">="),
|
|
1779
|
+
startsWith: /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => typeof a === "string" && typeof b === "string" && a.startsWith(b)), "startsWith"),
|
|
1780
|
+
endsWith: /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => typeof a === "string" && typeof b === "string" && a.endsWith(b)), "endsWith"),
|
|
1781
|
+
contains: /* @__PURE__ */ __name((condition, state) => _evalConditionOperator(condition, state, (a, b) => typeof a === "string" && typeof b === "string" && a.includes(b)), "contains")
|
|
1782
|
+
};
|
|
1783
|
+
function evaluateCondition(state, ...conditions) {
|
|
1784
|
+
if (!state) return false;
|
|
1785
|
+
if (conditions.length === 0) return true;
|
|
1786
|
+
return conditions.every((c) => _evalCondition(state, c));
|
|
1787
|
+
}
|
|
1788
|
+
__name(evaluateCondition, "evaluateCondition");
|
|
1789
|
+
function _evalCondition(state, condition) {
|
|
1790
|
+
if (!isOperator(condition.operator)) return false;
|
|
1791
|
+
const evalFn = OPERATOR_MAP[condition.operator];
|
|
1792
|
+
return evalFn(condition, state);
|
|
1793
|
+
}
|
|
1794
|
+
__name(_evalCondition, "_evalCondition");
|
|
1795
|
+
function checkConditions(state, conditions) {
|
|
1796
|
+
if (!state) return false;
|
|
1797
|
+
for (const cond of conditions) {
|
|
1798
|
+
if (cond.effect === "keep") continue;
|
|
1799
|
+
const result = evaluateCondition(state, cond.condition);
|
|
1800
|
+
if (result) return false;
|
|
1801
|
+
}
|
|
1802
|
+
return true;
|
|
1803
|
+
}
|
|
1804
|
+
__name(checkConditions, "checkConditions");
|
|
1805
|
+
|
|
1806
|
+
// src/utils/merge.helpers.ts
|
|
1807
|
+
function mergeDeep(obj1, obj2, settings) {
|
|
1808
|
+
var _a, _b;
|
|
1809
|
+
const defaultSettings = {
|
|
1810
|
+
mergeExistingValues: (_a = settings == null ? void 0 : settings.mergeExistingValues) != null ? _a : true,
|
|
1811
|
+
mergeMissingProperties: (_b = settings == null ? void 0 : settings.mergeMissingProperties) != null ? _b : true
|
|
1812
|
+
};
|
|
1813
|
+
if (!isValid(obj1, obj2)) return objectCopy(obj1);
|
|
1814
|
+
const result = Array.isArray(obj1) ? [] : {};
|
|
1815
|
+
for (const key in obj1) {
|
|
1816
|
+
const val1 = obj1[key];
|
|
1817
|
+
const val2 = obj2 == null ? void 0 : obj2[key];
|
|
1818
|
+
if (isObject(val1) || Array.isArray(val1)) {
|
|
1819
|
+
result[key] = mergeDeep(val1, val2, defaultSettings);
|
|
1820
|
+
} else if (key in obj2 && defaultSettings.mergeExistingValues) {
|
|
1821
|
+
result[key] = val2;
|
|
1822
|
+
} else {
|
|
1823
|
+
result[key] = val1;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
if (defaultSettings.mergeMissingProperties) {
|
|
1827
|
+
for (const key in obj2) {
|
|
1828
|
+
if (!(key in result)) {
|
|
1829
|
+
result[key] = obj2[key];
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
return result;
|
|
1834
|
+
}
|
|
1835
|
+
__name(mergeDeep, "mergeDeep");
|
|
1836
|
+
function isValid(obj1, obj2) {
|
|
1837
|
+
return isObject(obj1) && isObject(obj2) || Array.isArray(obj1) && Array.isArray(obj2);
|
|
1838
|
+
}
|
|
1839
|
+
__name(isValid, "isValid");
|
|
1840
|
+
function objectCopy(obj) {
|
|
1841
|
+
if (obj === null || typeof obj !== "object") return obj;
|
|
1842
|
+
if (Array.isArray(obj)) {
|
|
1843
|
+
return obj.map((item) => objectCopy(item));
|
|
1844
|
+
}
|
|
1845
|
+
const result = {};
|
|
1846
|
+
for (const key in obj) {
|
|
1847
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
1848
|
+
result[key] = objectCopy(obj[key]);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
return result;
|
|
1852
|
+
}
|
|
1853
|
+
__name(objectCopy, "objectCopy");
|
|
1854
|
+
function isObject(value) {
|
|
1855
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]";
|
|
1856
|
+
}
|
|
1857
|
+
__name(isObject, "isObject");
|
|
1858
|
+
|
|
1859
|
+
// src/utils/layers.helpers.ts
|
|
1860
|
+
var SUBMODULES_KEY = "subModules";
|
|
1861
|
+
var isPlainObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.prototype.toString.call(value) === "[object Object]", "isPlainObject");
|
|
1862
|
+
var stringList = /* @__PURE__ */ __name((value) => Array.isArray(value) ? value.filter((item) => typeof item === "string") : void 0, "stringList");
|
|
1863
|
+
function normalizeCondition(value) {
|
|
1864
|
+
if (!isPlainObject(value)) return void 0;
|
|
1865
|
+
const { field, operator, value: conditionValue } = value;
|
|
1866
|
+
if (typeof field !== "string") return void 0;
|
|
1867
|
+
if (!allowedOperators.includes(operator)) return void 0;
|
|
1868
|
+
if (typeof conditionValue !== "string" && typeof conditionValue !== "number") return void 0;
|
|
1869
|
+
return {
|
|
1870
|
+
field,
|
|
1871
|
+
operator,
|
|
1872
|
+
value: conditionValue
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
__name(normalizeCondition, "normalizeCondition");
|
|
1876
|
+
function normalizeSubmodules(value) {
|
|
1877
|
+
if (!isPlainObject(value)) return void 0;
|
|
1878
|
+
const result = {};
|
|
1879
|
+
Object.keys(value).forEach((name) => {
|
|
1880
|
+
const submodule = normalizeLayer(value[name]);
|
|
1881
|
+
if (submodule) result[name] = submodule;
|
|
1882
|
+
});
|
|
1883
|
+
return result;
|
|
1884
|
+
}
|
|
1885
|
+
__name(normalizeSubmodules, "normalizeSubmodules");
|
|
1886
|
+
function normalizeLayer(value, allowViews = true) {
|
|
1887
|
+
if (!isPlainObject(value)) return void 0;
|
|
1888
|
+
const layer = {};
|
|
1889
|
+
const remove = stringList(value.remove);
|
|
1890
|
+
const keep = stringList(value.keep);
|
|
1891
|
+
if (remove) layer.remove = remove;
|
|
1892
|
+
if (keep) layer.keep = keep;
|
|
1893
|
+
if (isPlainObject(value.defaults)) layer.defaults = value.defaults;
|
|
1894
|
+
const subModules = normalizeSubmodules(value.subModules);
|
|
1895
|
+
if (subModules) layer.subModules = subModules;
|
|
1896
|
+
if (Array.isArray(value.conditional)) {
|
|
1897
|
+
layer.conditional = value.conditional.flatMap((item) => {
|
|
1898
|
+
const condition = isPlainObject(item) ? normalizeCondition(item.condition) : void 0;
|
|
1899
|
+
const rest = condition ? normalizeLayer(item, false) : void 0;
|
|
1900
|
+
return condition && rest ? [
|
|
1901
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
1902
|
+
condition
|
|
1903
|
+
})
|
|
1904
|
+
] : [];
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
if (allowViews && isPlainObject(value.views)) {
|
|
1908
|
+
const views = value.views;
|
|
1909
|
+
layer.views = {};
|
|
1910
|
+
Object.keys(views).forEach((view) => {
|
|
1911
|
+
const viewLayer = normalizeLayer(views[view], false);
|
|
1912
|
+
if (viewLayer) layer.views[view] = viewLayer;
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
return layer;
|
|
1916
|
+
}
|
|
1917
|
+
__name(normalizeLayer, "normalizeLayer");
|
|
1918
|
+
function mergeDefaults(previous, next) {
|
|
1919
|
+
if (!isPlainObject(next)) return previous;
|
|
1920
|
+
return previous ? mergeDeep(previous, next) : next;
|
|
1921
|
+
}
|
|
1922
|
+
__name(mergeDefaults, "mergeDefaults");
|
|
1923
|
+
function mergeLayerDefaults(layers) {
|
|
1924
|
+
var _a;
|
|
1925
|
+
const last = (_a = layers[layers.length - 1]) != null ? _a : {};
|
|
1926
|
+
const viewNames = new Set(layers.flatMap((layer) => {
|
|
1927
|
+
var _a2;
|
|
1928
|
+
return Object.keys((_a2 = layer.views) != null ? _a2 : {});
|
|
1929
|
+
}));
|
|
1930
|
+
const rootDefaults = layers.reduce((merged, layer) => mergeDefaults(merged, layer.defaults), void 0);
|
|
1931
|
+
const views = __spreadValues({}, last.views);
|
|
1932
|
+
viewNames.forEach((view) => {
|
|
1933
|
+
var _a2;
|
|
1934
|
+
const viewDefaults = layers.reduce((merged, layer) => {
|
|
1935
|
+
var _a3, _b;
|
|
1936
|
+
return mergeDefaults(mergeDefaults(merged, layer.defaults), (_b = (_a3 = layer.views) == null ? void 0 : _a3[view]) == null ? void 0 : _b.defaults);
|
|
1937
|
+
}, void 0);
|
|
1938
|
+
if (viewDefaults) {
|
|
1939
|
+
views[view] = __spreadProps(__spreadValues({}, (_a2 = last.views) == null ? void 0 : _a2[view]), {
|
|
1940
|
+
defaults: viewDefaults
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
});
|
|
1944
|
+
const effective = __spreadValues({}, last);
|
|
1945
|
+
if (rootDefaults) effective.defaults = rootDefaults;
|
|
1946
|
+
if (viewNames.size) effective.views = views;
|
|
1947
|
+
return effective;
|
|
1948
|
+
}
|
|
1949
|
+
__name(mergeLayerDefaults, "mergeLayerDefaults");
|
|
1950
|
+
var isSubmodulesKey = /* @__PURE__ */ __name((key) => key === SUBMODULES_KEY || key.endsWith(`::${SUBMODULES_KEY}`), "isSubmodulesKey");
|
|
1951
|
+
var asItemObject = /* @__PURE__ */ __name((value) => isPlainObject(value) ? value : {}, "asItemObject");
|
|
1952
|
+
function intersectItem(current, other) {
|
|
1953
|
+
var _a, _b, _c;
|
|
1954
|
+
const item = asItemObject(current);
|
|
1955
|
+
const otherItem = asItemObject(other);
|
|
1956
|
+
const childMap = item.childMap ? intersectViewMaps(item.childMap, (_a = otherItem.childMap) != null ? _a : {}) : void 0;
|
|
1957
|
+
const conditions = [
|
|
1958
|
+
...(_b = otherItem.conditions) != null ? _b : [],
|
|
1959
|
+
...(_c = item.conditions) != null ? _c : []
|
|
1960
|
+
];
|
|
1961
|
+
const hasDefaults = !!item.defaults && Object.keys(item.defaults).length > 0;
|
|
1962
|
+
const hasChildMap = !!childMap && Object.keys(childMap).length > 0;
|
|
1963
|
+
if (!hasDefaults && !hasChildMap && !conditions.length) {
|
|
1964
|
+
return isPlainObject(current) ? true : current;
|
|
1965
|
+
}
|
|
1966
|
+
return __spreadValues(__spreadValues(__spreadValues({}, hasDefaults && {
|
|
1967
|
+
defaults: item.defaults
|
|
1968
|
+
}), hasChildMap && {
|
|
1969
|
+
childMap
|
|
1970
|
+
}), conditions.length && {
|
|
1971
|
+
conditions
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
__name(intersectItem, "intersectItem");
|
|
1975
|
+
function intersectViewMaps(current, other) {
|
|
1976
|
+
const result = {};
|
|
1977
|
+
Object.keys(current).forEach((key) => {
|
|
1978
|
+
if (isSubmodulesKey(key)) {
|
|
1979
|
+
result[key] = current[key];
|
|
1980
|
+
} else if (key in other) {
|
|
1981
|
+
result[key] = intersectItem(current[key], other[key]);
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
return result;
|
|
1985
|
+
}
|
|
1986
|
+
__name(intersectViewMaps, "intersectViewMaps");
|
|
1987
|
+
function collectSubmoduleLayers(maps) {
|
|
1988
|
+
const result = {};
|
|
1989
|
+
maps.forEach((map) => {
|
|
1990
|
+
Object.keys(map).filter(isSubmodulesKey).forEach((key) => {
|
|
1991
|
+
const collection = map[key];
|
|
1992
|
+
if (!isPlainObject(collection)) return;
|
|
1993
|
+
Object.keys(collection).forEach((name) => {
|
|
1994
|
+
var _a, _b;
|
|
1995
|
+
const submodule = collection[name];
|
|
1996
|
+
if (!isPlainObject(submodule)) return;
|
|
1997
|
+
if (!Object.keys(submodule).length) return;
|
|
1998
|
+
result[key] = (_a = result[key]) != null ? _a : {};
|
|
1999
|
+
result[key][name] = [
|
|
2000
|
+
...(_b = result[key][name]) != null ? _b : [],
|
|
2001
|
+
submodule
|
|
2002
|
+
];
|
|
2003
|
+
});
|
|
2004
|
+
});
|
|
2005
|
+
});
|
|
2006
|
+
return Object.keys(result).length ? result : void 0;
|
|
2007
|
+
}
|
|
2008
|
+
__name(collectSubmoduleLayers, "collectSubmoduleLayers");
|
|
2009
|
+
|
|
2010
|
+
// src/utils/logger.helpers.ts
|
|
2011
|
+
var LOG_PREFIX = "[widget-configurability]";
|
|
2012
|
+
function logWarning(message) {
|
|
2013
|
+
console.warn(`${LOG_PREFIX} ${message}`);
|
|
2014
|
+
}
|
|
2015
|
+
__name(logWarning, "logWarning");
|
|
2016
|
+
|
|
2017
|
+
// src/utils/structural.helpers.ts
|
|
2018
|
+
function getWidgetStructure(config, customization, validationMap, options) {
|
|
2019
|
+
return calculateViewMap(config.baseStructure, customization, validationMap, __spreadProps(__spreadValues({}, options), {
|
|
2020
|
+
keepInheritance: config.keepInheritance
|
|
2021
|
+
}));
|
|
2022
|
+
}
|
|
2023
|
+
__name(getWidgetStructure, "getWidgetStructure");
|
|
2024
|
+
function calculateViewMap(config, customization, validationMap, options) {
|
|
2025
|
+
const permissionMap = {};
|
|
2026
|
+
const keepAliases = options == null ? void 0 : options.keepInheritance;
|
|
2027
|
+
if (config.views) {
|
|
2028
|
+
for (const view in config.views) {
|
|
2029
|
+
Object.assign(permissionMap, calculateSpecificViewMap(view, config, customization, validationMap, options));
|
|
2030
|
+
}
|
|
2031
|
+
} else {
|
|
2032
|
+
const customDefaults = calculateCustomDefaults(customization, void 0, validationMap, options == null ? void 0 : options.sanitize);
|
|
2033
|
+
const prevDefaults = config.defaults;
|
|
2034
|
+
const submodules = calculateSubmodules(config, customization);
|
|
2035
|
+
if (submodules) {
|
|
2036
|
+
permissionMap.subModules = submodules;
|
|
2037
|
+
}
|
|
2038
|
+
const conditionMaps = calculateConditions(config, customization, void 0, keepAliases);
|
|
2039
|
+
Object.assign(permissionMap, calculatePermissionMap(config, customization, {
|
|
2040
|
+
prevDefaults,
|
|
2041
|
+
customDefaults,
|
|
2042
|
+
conditionMaps,
|
|
2043
|
+
keepAliases
|
|
2044
|
+
}));
|
|
2045
|
+
}
|
|
2046
|
+
return permissionMap;
|
|
2047
|
+
}
|
|
2048
|
+
__name(calculateViewMap, "calculateViewMap");
|
|
2049
|
+
function calculateRootDefaults(config, customization, validationMap, sanitize) {
|
|
2050
|
+
return calculateDefaults(config.defaults, void 0, calculateCustomDefaults(customization, void 0, validationMap, sanitize));
|
|
2051
|
+
}
|
|
2052
|
+
__name(calculateRootDefaults, "calculateRootDefaults");
|
|
2053
|
+
function calculateSpecificViewMap(view, config, customization, validationMap, options) {
|
|
2054
|
+
const viewDefinition = config.views[view];
|
|
2055
|
+
const keepAliases = options == null ? void 0 : options.keepInheritance;
|
|
2056
|
+
const customDefaults = calculateCustomDefaults(customization, view, validationMap, options == null ? void 0 : options.sanitize);
|
|
2057
|
+
const prevDefaults = config.defaults;
|
|
2058
|
+
const permissionMap = {};
|
|
2059
|
+
const submodules = calculateSubmodules(config, customization, view);
|
|
2060
|
+
if (submodules) {
|
|
2061
|
+
permissionMap[`${view}::subModules`] = submodules;
|
|
2062
|
+
}
|
|
2063
|
+
const conditionMaps = (options == null ? void 0 : options.viewConditionals) === false ? void 0 : calculateConditions(config, customization, view, keepAliases);
|
|
2064
|
+
Object.assign(permissionMap, calculatePermissionMap(config, customization, {
|
|
2065
|
+
viewKeys: viewDefinition,
|
|
2066
|
+
viewPrefix: view,
|
|
2067
|
+
prevDefaults,
|
|
2068
|
+
customDefaults,
|
|
2069
|
+
conditionMaps,
|
|
2070
|
+
keepAliases
|
|
2071
|
+
}));
|
|
2072
|
+
return permissionMap;
|
|
2073
|
+
}
|
|
2074
|
+
__name(calculateSpecificViewMap, "calculateSpecificViewMap");
|
|
2075
|
+
function getViewPrefix(view) {
|
|
2076
|
+
return view ? `${view}${STRUCTURE_VIEW_NAME_SEPARATOR}` : "";
|
|
2077
|
+
}
|
|
2078
|
+
__name(getViewPrefix, "getViewPrefix");
|
|
2079
|
+
function getStructureKey(key, viewPrefix) {
|
|
2080
|
+
const viewValue = getViewPrefix(viewPrefix);
|
|
2081
|
+
return `${viewValue}${key}`;
|
|
2082
|
+
}
|
|
2083
|
+
__name(getStructureKey, "getStructureKey");
|
|
2084
|
+
var matchWildcard = /* @__PURE__ */ __name((pattern, value) => {
|
|
2085
|
+
const regexPattern = new RegExp("^" + pattern.replace(/\./g, "\\.").replace(/\*/g, ".*") + "$");
|
|
2086
|
+
return regexPattern.test(value);
|
|
2087
|
+
}, "matchWildcard");
|
|
2088
|
+
function keyIsIncludedInKeep(key, customization, keepAliases) {
|
|
2089
|
+
const { keep = [] } = customization;
|
|
2090
|
+
const alias = keepAliases == null ? void 0 : keepAliases[key];
|
|
2091
|
+
for (const pattern of keep) {
|
|
2092
|
+
if (pattern === key || matchWildcard(pattern, key)) {
|
|
2093
|
+
return true;
|
|
2094
|
+
}
|
|
2095
|
+
if (alias && (pattern === alias || matchWildcard(pattern, alias))) {
|
|
2096
|
+
return true;
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
return false;
|
|
2100
|
+
}
|
|
2101
|
+
__name(keyIsIncludedInKeep, "keyIsIncludedInKeep");
|
|
2102
|
+
function keyIsIncludedInRemove(key, customization) {
|
|
2103
|
+
const { remove = [] } = customization;
|
|
2104
|
+
for (const pattern of remove) {
|
|
2105
|
+
if (pattern === key || matchWildcard(pattern, key)) {
|
|
2106
|
+
return true;
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
return false;
|
|
2110
|
+
}
|
|
2111
|
+
__name(keyIsIncludedInRemove, "keyIsIncludedInRemove");
|
|
2112
|
+
function canInsertInCustomization(key, customization, validateKeepOption, keepAliases) {
|
|
2113
|
+
const includedInRemove = keyIsIncludedInRemove(key, customization);
|
|
2114
|
+
const includedInKeep = keyIsIncludedInKeep(key, customization, keepAliases);
|
|
2115
|
+
const canInsert = !includedInRemove && (!validateKeepOption || includedInKeep);
|
|
2116
|
+
const keepValue = includedInKeep ? "keep" : "remove";
|
|
2117
|
+
const keepResult = validateKeepOption ? keepValue : false;
|
|
2118
|
+
const conditionAffect = includedInRemove ? "remove" : keepResult;
|
|
2119
|
+
return {
|
|
2120
|
+
canInsert,
|
|
2121
|
+
conditionAffect
|
|
2122
|
+
};
|
|
2123
|
+
}
|
|
2124
|
+
__name(canInsertInCustomization, "canInsertInCustomization");
|
|
2125
|
+
function evalInsertKey(key, { viewKeys, viewPrefix = "", hasKeepOption, keepAliases }, customization) {
|
|
2126
|
+
var _a;
|
|
2127
|
+
const customizationView = (_a = customization == null ? void 0 : customization.views) == null ? void 0 : _a[viewPrefix];
|
|
2128
|
+
const custCanInsert = customization ? canInsertInCustomization(key, customization, hasKeepOption === "root", keepAliases) : {
|
|
2129
|
+
canInsert: true,
|
|
2130
|
+
conditionAffect: false
|
|
2131
|
+
};
|
|
2132
|
+
const custViewCanInsert = customizationView ? canInsertInCustomization(key, customizationView, hasKeepOption === "view", keepAliases) : {
|
|
2133
|
+
canInsert: true,
|
|
2134
|
+
conditionAffect: false
|
|
2135
|
+
};
|
|
2136
|
+
const canInsert = (!viewKeys || viewKeys.some((x) => key.startsWith(x))) && custCanInsert.canInsert && custViewCanInsert.canInsert;
|
|
2137
|
+
const conditionAffect = custCanInsert.conditionAffect || custViewCanInsert.conditionAffect;
|
|
2138
|
+
return {
|
|
2139
|
+
canInsert,
|
|
2140
|
+
conditionAffect
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2143
|
+
__name(evalInsertKey, "evalInsertKey");
|
|
2144
|
+
function canInsertKey(key, { viewKeys, viewPrefix = "", hasKeepOption, checkCondition = false, keepAliases }, customization) {
|
|
2145
|
+
const result = evalInsertKey(key, {
|
|
2146
|
+
viewKeys,
|
|
2147
|
+
viewPrefix,
|
|
2148
|
+
hasKeepOption,
|
|
2149
|
+
keepAliases
|
|
2150
|
+
}, customization);
|
|
2151
|
+
const canInsert = checkCondition || result.canInsert;
|
|
2152
|
+
return {
|
|
2153
|
+
canInsert,
|
|
2154
|
+
conditionAffect: result.conditionAffect
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
__name(canInsertKey, "canInsertKey");
|
|
2158
|
+
function addKeyToPermissions(permissionMap, key, { viewPrefix, checkCondition, conditionMaps }, defaults, childMap, conditionAffect) {
|
|
2159
|
+
const keyAttr = getStructureKey(key, viewPrefix);
|
|
2160
|
+
if (checkCondition && conditionAffect != null) {
|
|
2161
|
+
permissionMap[keyAttr] = conditionAffect;
|
|
2162
|
+
return;
|
|
2163
|
+
}
|
|
2164
|
+
const addDefaultKey = defaults && Object.keys(defaults).length > 0;
|
|
2165
|
+
const addChildMapKey = childMap && Object.keys(childMap).length > 0;
|
|
2166
|
+
const conditions = getConditionsForKey(key, conditionMaps);
|
|
2167
|
+
permissionMap[keyAttr] = !addDefaultKey && !addChildMapKey && !conditions ? true : __spreadValues(__spreadValues(__spreadValues({}, addDefaultKey && {
|
|
2168
|
+
defaults
|
|
2169
|
+
}), addChildMapKey && {
|
|
2170
|
+
childMap
|
|
2171
|
+
}), conditions && {
|
|
2172
|
+
conditions
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2175
|
+
__name(addKeyToPermissions, "addKeyToPermissions");
|
|
2176
|
+
function calculatePermissionMap(config, customization, { viewKeys, pathPrefix = "", viewPrefix = "", hasKeepOption: previousKeepOption, prevDefaults, customDefaults, conditionMaps, checkCondition, keepAliases }) {
|
|
2177
|
+
const permissionMap = {};
|
|
2178
|
+
const currentKeepOption = nodeHasKeepOption(config, customization, {
|
|
2179
|
+
viewPrefix,
|
|
2180
|
+
pathPrefix
|
|
2181
|
+
});
|
|
2182
|
+
for (const key in config) {
|
|
2183
|
+
if (STRUCTURE_RESERVED_WORDS.includes(key)) {
|
|
2184
|
+
continue;
|
|
2185
|
+
}
|
|
2186
|
+
const hasKeepOption = previousKeepOption != null ? previousKeepOption : currentKeepOption;
|
|
2187
|
+
const configValue = config[key];
|
|
2188
|
+
const currentKey = `${pathPrefix}${key}`;
|
|
2189
|
+
const newPrefix = `${currentKey}${STRUCTURE_SECTION_NAME_SEPARATOR}`;
|
|
2190
|
+
const canInsertResult = canInsertKey(currentKey, {
|
|
2191
|
+
viewKeys,
|
|
2192
|
+
viewPrefix,
|
|
2193
|
+
hasKeepOption,
|
|
2194
|
+
checkCondition,
|
|
2195
|
+
keepAliases
|
|
2196
|
+
}, customization);
|
|
2197
|
+
if (!canInsertResult.canInsert) {
|
|
2198
|
+
continue;
|
|
2199
|
+
}
|
|
2200
|
+
let defaults = prevDefaults;
|
|
2201
|
+
let childMap = void 0;
|
|
2202
|
+
if (Array.isArray(configValue)) {
|
|
2203
|
+
defaults = calculateDefaults(prevDefaults, {}, customDefaults);
|
|
2204
|
+
childMap = calculatePermissionMapArray(configValue, customization, {
|
|
2205
|
+
viewKeys,
|
|
2206
|
+
viewPrefix,
|
|
2207
|
+
pathPrefix: newPrefix,
|
|
2208
|
+
prevDefaults,
|
|
2209
|
+
customDefaults,
|
|
2210
|
+
conditionMaps,
|
|
2211
|
+
checkCondition,
|
|
2212
|
+
keepAliases
|
|
2213
|
+
});
|
|
2214
|
+
Object.assign(permissionMap, childMap);
|
|
2215
|
+
} else if (typeof configValue === "object" && !Array.isArray(configValue)) {
|
|
2216
|
+
defaults = calculateDefaults(prevDefaults, configValue.defaults, customDefaults);
|
|
2217
|
+
childMap = calculatePermissionMap(configValue, customization, {
|
|
2218
|
+
viewKeys,
|
|
2219
|
+
viewPrefix,
|
|
2220
|
+
pathPrefix: newPrefix,
|
|
2221
|
+
prevDefaults: defaults,
|
|
2222
|
+
conditionMaps,
|
|
2223
|
+
checkCondition,
|
|
2224
|
+
keepAliases
|
|
2225
|
+
});
|
|
2226
|
+
Object.assign(permissionMap, childMap);
|
|
2227
|
+
} else if (typeof configValue === "boolean" && !configValue) {
|
|
2228
|
+
continue;
|
|
2229
|
+
} else if (typeof configValue === "boolean" && configValue) {
|
|
2230
|
+
defaults = calculateDefaults(prevDefaults, {}, customDefaults);
|
|
2231
|
+
}
|
|
2232
|
+
addKeyToPermissions(permissionMap, currentKey, {
|
|
2233
|
+
viewPrefix,
|
|
2234
|
+
checkCondition,
|
|
2235
|
+
conditionMaps
|
|
2236
|
+
}, defaults, childMap, canInsertResult.conditionAffect);
|
|
2237
|
+
}
|
|
2238
|
+
return permissionMap;
|
|
2239
|
+
}
|
|
2240
|
+
__name(calculatePermissionMap, "calculatePermissionMap");
|
|
2241
|
+
function getConditionsForKey(key, conditionMaps) {
|
|
2242
|
+
if (!conditionMaps || conditionMaps.length === 0) return void 0;
|
|
2243
|
+
const result = conditionMaps.reduce((result2, x) => {
|
|
2244
|
+
const mapValue = x.map[key];
|
|
2245
|
+
if (typeof mapValue === "string" && (mapValue === "keep" || mapValue === "remove")) {
|
|
2246
|
+
result2.push({
|
|
2247
|
+
effect: mapValue,
|
|
2248
|
+
condition: x.condition
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
return result2;
|
|
2252
|
+
}, []);
|
|
2253
|
+
if (result.length === 0) return void 0;
|
|
2254
|
+
return result;
|
|
2255
|
+
}
|
|
2256
|
+
__name(getConditionsForKey, "getConditionsForKey");
|
|
2257
|
+
function calculateConditions(config, customization, view, keepAliases) {
|
|
2258
|
+
var _a, _b, _c;
|
|
2259
|
+
const rootConditionals = customization == null ? void 0 : customization.conditional;
|
|
2260
|
+
const viewConditionals = view ? (_b = (_a = customization == null ? void 0 : customization.views) == null ? void 0 : _a[view]) == null ? void 0 : _b.conditional : void 0;
|
|
2261
|
+
if (!rootConditionals && !viewConditionals) return void 0;
|
|
2262
|
+
const customConditionals = [
|
|
2263
|
+
...rootConditionals != null ? rootConditionals : [],
|
|
2264
|
+
...viewConditionals != null ? viewConditionals : []
|
|
2265
|
+
];
|
|
2266
|
+
return (_c = customConditionals == null ? void 0 : customConditionals.map((c) => ({
|
|
2267
|
+
condition: c.condition,
|
|
2268
|
+
map: calculatePermissionMap(config, c, {
|
|
2269
|
+
checkCondition: true,
|
|
2270
|
+
keepAliases
|
|
2271
|
+
})
|
|
2272
|
+
}))) != null ? _c : void 0;
|
|
2273
|
+
}
|
|
2274
|
+
__name(calculateConditions, "calculateConditions");
|
|
2275
|
+
function calculateSubmodules(config, customization, view) {
|
|
2276
|
+
var _a, _b;
|
|
2277
|
+
const viewSubmodules = view ? (_b = (_a = customization == null ? void 0 : customization.views) == null ? void 0 : _a[view]) == null ? void 0 : _b.subModules : void 0;
|
|
2278
|
+
const customRootSubmodules = customization == null ? void 0 : customization.subModules;
|
|
2279
|
+
const customSubmodules = viewSubmodules ? mergeObjects(customRootSubmodules, viewSubmodules) : customRootSubmodules;
|
|
2280
|
+
return mergeObjects(config.subModules, customSubmodules);
|
|
2281
|
+
}
|
|
2282
|
+
__name(calculateSubmodules, "calculateSubmodules");
|
|
2283
|
+
function calculateCustomDefaults(customization, view, validationMap, sanitize) {
|
|
2284
|
+
var _a, _b, _c;
|
|
2285
|
+
const viewDefaults = view ? (_b = (_a = customization == null ? void 0 : customization.views) == null ? void 0 : _a[view]) == null ? void 0 : _b.defaults : void 0;
|
|
2286
|
+
const customRootDefaults = (_c = customization == null ? void 0 : customization.defaults) != null ? _c : {};
|
|
2287
|
+
const defaultObj = viewDefaults ? mergeObjects(customRootDefaults, viewDefaults) : customRootDefaults;
|
|
2288
|
+
if (!defaultObj || !validationMap && !sanitize) return defaultObj;
|
|
2289
|
+
return validateDefaults(defaultObj, validationMap != null ? validationMap : {}, sanitize);
|
|
2290
|
+
}
|
|
2291
|
+
__name(calculateCustomDefaults, "calculateCustomDefaults");
|
|
2292
|
+
function calculateDefaults(structureDefaults, itemDefaults, customDefaults) {
|
|
2293
|
+
const baseDefaults = mergeObjects(structureDefaults, itemDefaults);
|
|
2294
|
+
return mergeObjects(baseDefaults, customDefaults);
|
|
2295
|
+
}
|
|
2296
|
+
__name(calculateDefaults, "calculateDefaults");
|
|
2297
|
+
function mergeObjects(prevObj, newObj) {
|
|
2298
|
+
if (!newObj && !prevObj) return void 0;
|
|
2299
|
+
if (!newObj) return prevObj;
|
|
2300
|
+
if (typeof newObj !== "object" || Array.isArray(newObj)) return prevObj;
|
|
2301
|
+
return !prevObj ? newObj : mergeDeep(prevObj, newObj);
|
|
2302
|
+
}
|
|
2303
|
+
__name(mergeObjects, "mergeObjects");
|
|
2304
|
+
function mapObjKeys(configValue, { pathPrefix }) {
|
|
2305
|
+
return Object.keys(configValue).map((x) => getStructureKey(`${pathPrefix}${x}`));
|
|
2306
|
+
}
|
|
2307
|
+
__name(mapObjKeys, "mapObjKeys");
|
|
2308
|
+
function mapArrayKeys(configValue, { viewPrefix, pathPrefix }) {
|
|
2309
|
+
return configValue.reduce((result, value) => {
|
|
2310
|
+
if (typeof value === "string") {
|
|
2311
|
+
result.push(getStructureKey(`${pathPrefix}${value}`));
|
|
2312
|
+
} else {
|
|
2313
|
+
result.push(...mapObjKeys(value, {
|
|
2314
|
+
pathPrefix
|
|
2315
|
+
}));
|
|
2316
|
+
}
|
|
2317
|
+
return result;
|
|
2318
|
+
}, []);
|
|
2319
|
+
}
|
|
2320
|
+
__name(mapArrayKeys, "mapArrayKeys");
|
|
2321
|
+
function nodeHasKeepOption(configValue, customization, { viewPrefix, pathPrefix }) {
|
|
2322
|
+
var _a;
|
|
2323
|
+
if (!customization) return;
|
|
2324
|
+
const nodeKeys = Array.isArray(configValue) ? mapArrayKeys(configValue, {
|
|
2325
|
+
viewPrefix,
|
|
2326
|
+
pathPrefix
|
|
2327
|
+
}) : mapObjKeys(configValue, {
|
|
2328
|
+
pathPrefix
|
|
2329
|
+
});
|
|
2330
|
+
const customizationView = viewPrefix ? (_a = customization == null ? void 0 : customization.views) == null ? void 0 : _a[viewPrefix] : void 0;
|
|
2331
|
+
for (const key of nodeKeys) {
|
|
2332
|
+
if (keyIsIncludedInKeep(key, customization)) {
|
|
2333
|
+
return "root";
|
|
2334
|
+
} else if (customizationView && keyIsIncludedInKeep(key, customizationView)) {
|
|
2335
|
+
return "view";
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
return void 0;
|
|
2339
|
+
}
|
|
2340
|
+
__name(nodeHasKeepOption, "nodeHasKeepOption");
|
|
2341
|
+
function calculatePermissionMapArray(configValue, customization, { viewKeys, viewPrefix, pathPrefix, prevDefaults, customDefaults, conditionMaps, checkCondition, keepAliases }) {
|
|
2342
|
+
const permissionMap = {};
|
|
2343
|
+
const hasKeepOption = nodeHasKeepOption(configValue, customization, {
|
|
2344
|
+
viewPrefix,
|
|
2345
|
+
pathPrefix
|
|
2346
|
+
});
|
|
2347
|
+
const defaultsSimple = calculateDefaults(prevDefaults, void 0, customDefaults);
|
|
2348
|
+
configValue.forEach((option) => {
|
|
2349
|
+
const fullPath = `${pathPrefix}${option}`;
|
|
2350
|
+
if (typeof option === "string") {
|
|
2351
|
+
const canInsertResult = canInsertKey(fullPath, {
|
|
2352
|
+
viewKeys,
|
|
2353
|
+
viewPrefix,
|
|
2354
|
+
hasKeepOption,
|
|
2355
|
+
checkCondition,
|
|
2356
|
+
keepAliases
|
|
2357
|
+
}, customization);
|
|
2358
|
+
if (!canInsertResult.canInsert) {
|
|
2359
|
+
return;
|
|
2360
|
+
}
|
|
2361
|
+
addKeyToPermissions(permissionMap, fullPath, {
|
|
2362
|
+
viewPrefix,
|
|
2363
|
+
checkCondition,
|
|
2364
|
+
conditionMaps
|
|
2365
|
+
}, defaultsSimple, void 0, canInsertResult.conditionAffect);
|
|
2366
|
+
} else {
|
|
2367
|
+
Object.assign(permissionMap, calculatePermissionMap(option, customization, {
|
|
2368
|
+
viewKeys,
|
|
2369
|
+
pathPrefix,
|
|
2370
|
+
viewPrefix,
|
|
2371
|
+
hasKeepOption,
|
|
2372
|
+
prevDefaults,
|
|
2373
|
+
customDefaults,
|
|
2374
|
+
conditionMaps,
|
|
2375
|
+
checkCondition,
|
|
2376
|
+
keepAliases
|
|
2377
|
+
}));
|
|
2378
|
+
}
|
|
2379
|
+
});
|
|
2380
|
+
return permissionMap;
|
|
2381
|
+
}
|
|
2382
|
+
__name(calculatePermissionMapArray, "calculatePermissionMapArray");
|
|
2383
|
+
|
|
2384
|
+
// src/structural-manager.ts
|
|
2385
|
+
function getWidgetConfig(widget, version) {
|
|
2386
|
+
var _a;
|
|
2387
|
+
const versionSet = version != null ? version : WidgetVersion.latest;
|
|
2388
|
+
const widgetConfigurability = (_a = widgetConfigs[widget]) == null ? void 0 : _a[versionSet];
|
|
2389
|
+
if (!widgetConfigurability) {
|
|
2390
|
+
throw new Error(`No config found for widget ${widget} and version ${version}`);
|
|
2391
|
+
}
|
|
2392
|
+
return widgetConfigurability;
|
|
2393
|
+
}
|
|
2394
|
+
__name(getWidgetConfig, "getWidgetConfig");
|
|
2395
|
+
function buildStructure(widget, customization, version, options) {
|
|
2396
|
+
var _a, _b;
|
|
2397
|
+
const config = getWidgetConfig(widget, version);
|
|
2398
|
+
const validationMap = (_a = options == null ? void 0 : options.validationMap) != null ? _a : widgetValidators[widget];
|
|
2399
|
+
const layers = ((_b = options == null ? void 0 : options.layers) != null ? _b : []).map((layer) => normalizeLayer(layer)).filter((layer) => !!layer);
|
|
2400
|
+
if (layers.length) {
|
|
2401
|
+
try {
|
|
2402
|
+
return buildLayeredStructure(config, layers, customization, validationMap, options);
|
|
2403
|
+
} catch (error) {
|
|
2404
|
+
logWarning(`ignoring the ${widget} customization layers: ${error.message}`);
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
const structureMap = getWidgetStructure(config, customization, validationMap, options);
|
|
2408
|
+
const rootDefaults = config.baseStructure.views ? void 0 : calculateRootDefaults(config.baseStructure, customization, validationMap, options == null ? void 0 : options.sanitize);
|
|
2409
|
+
return new WidgetStructureInstance(structureMap, rootDefaults);
|
|
2410
|
+
}
|
|
2411
|
+
__name(buildStructure, "buildStructure");
|
|
2412
|
+
function buildLayeredStructure(config, layers, customization, validationMap, options) {
|
|
2413
|
+
const inline = isPlainObject(customization) ? customization : {};
|
|
2414
|
+
const effective = mergeLayerDefaults([
|
|
2415
|
+
...layers,
|
|
2416
|
+
inline
|
|
2417
|
+
]);
|
|
2418
|
+
const engineOptions = {
|
|
2419
|
+
viewConditionals: options == null ? void 0 : options.viewConditionals
|
|
2420
|
+
};
|
|
2421
|
+
const layerMaps = layers.map((layer) => getWidgetStructure(config, layer, void 0, engineOptions));
|
|
2422
|
+
const structureMap = layerMaps.reduce((result, layerMap) => intersectViewMaps(result, layerMap), getWidgetStructure(config, effective, validationMap, options));
|
|
2423
|
+
const rootDefaults = config.baseStructure.views ? void 0 : calculateRootDefaults(config.baseStructure, effective, validationMap, options == null ? void 0 : options.sanitize);
|
|
2424
|
+
return new WidgetStructureInstance(structureMap, rootDefaults, collectSubmoduleLayers(layerMaps));
|
|
2425
|
+
}
|
|
2426
|
+
__name(buildLayeredStructure, "buildLayeredStructure");
|
|
2427
|
+
var _WidgetStructureInstance = class _WidgetStructureInstance {
|
|
2428
|
+
constructor(viewMap, rootDefaults, submoduleLayers) {
|
|
2429
|
+
__publicField(this, "viewMap");
|
|
2430
|
+
__publicField(this, "rootDefaults");
|
|
2431
|
+
__publicField(this, "submoduleLayers");
|
|
2432
|
+
this.viewMap = viewMap;
|
|
2433
|
+
this.rootDefaults = rootDefaults;
|
|
2434
|
+
this.submoduleLayers = submoduleLayers;
|
|
2435
|
+
}
|
|
2436
|
+
getValue(key) {
|
|
2437
|
+
return this.viewMap[key];
|
|
2438
|
+
}
|
|
2439
|
+
isVisible(key, state) {
|
|
2440
|
+
const value = this.getValue(key);
|
|
2441
|
+
if (!value) return false;
|
|
2442
|
+
if (typeof value === "object" && value.conditions) {
|
|
2443
|
+
return checkConditions(state, value.conditions);
|
|
2444
|
+
}
|
|
2445
|
+
return true;
|
|
2446
|
+
}
|
|
2447
|
+
getChildMap(key) {
|
|
2448
|
+
const value = this.getValue(key);
|
|
2449
|
+
if (!value || typeof value === "boolean" || typeof value === "string" || !value.childMap) return void 0;
|
|
2450
|
+
return value.childMap;
|
|
2451
|
+
}
|
|
2452
|
+
getSubmodule(module, view) {
|
|
2453
|
+
const key = `${view ? view + "::" : ""}subModules`;
|
|
2454
|
+
const value = this.getValue(key);
|
|
2455
|
+
return value == null ? void 0 : value[module];
|
|
2456
|
+
}
|
|
2457
|
+
/**
|
|
2458
|
+
* Submodule customizations of the stored layers, to pass as layers when building the embedded widget (structureFromSubmodule).
|
|
2459
|
+
*/
|
|
2460
|
+
getSubmoduleLayers(module, view) {
|
|
2461
|
+
var _a, _b;
|
|
2462
|
+
const key = `${view ? view + "::" : ""}subModules`;
|
|
2463
|
+
return (_b = (_a = this.submoduleLayers) == null ? void 0 : _a[key]) == null ? void 0 : _b[module];
|
|
2464
|
+
}
|
|
2465
|
+
getDefaults(key) {
|
|
2466
|
+
const value = this.getValue(key);
|
|
2467
|
+
if (!value || typeof value === "boolean" || typeof value === "string" || !value.defaults) return void 0;
|
|
2468
|
+
return value.defaults;
|
|
2469
|
+
}
|
|
2470
|
+
getRootDefaults() {
|
|
2471
|
+
return this.rootDefaults;
|
|
2472
|
+
}
|
|
2473
|
+
/**
|
|
2474
|
+
* Re-roots a resolved section (`design::downloadModal`) as plain JSON another bundle can rebuild a structure from.
|
|
2475
|
+
*/
|
|
2476
|
+
scope(prefixKey, options = {}) {
|
|
2477
|
+
var _a;
|
|
2478
|
+
const { widget, version, state } = options;
|
|
2479
|
+
const present = this.isVisible(prefixKey, state);
|
|
2480
|
+
const sectionPath = (_a = prefixKey.split(STRUCTURE_VIEW_NAME_SEPARATOR).pop()) != null ? _a : prefixKey;
|
|
2481
|
+
const namespace = options.defaultsNamespace === void 0 ? sectionPath.split(STRUCTURE_SECTION_NAME_SEPARATOR).pop() : options.defaultsNamespace;
|
|
2482
|
+
const sectionDefaults = present ? this.getDefaults(prefixKey) : void 0;
|
|
2483
|
+
const defaults = namespace ? sectionDefaults == null ? void 0 : sectionDefaults[namespace] : sectionDefaults;
|
|
2484
|
+
const childPrefix = `${prefixKey}${STRUCTURE_SECTION_NAME_SEPARATOR}`;
|
|
2485
|
+
const map = {};
|
|
2486
|
+
let structureVersion;
|
|
2487
|
+
if (widget) {
|
|
2488
|
+
const config = getWidgetConfig(widget, version);
|
|
2489
|
+
structureVersion = config.version;
|
|
2490
|
+
Object.keys(calculateViewMap(config.baseStructure)).filter((key) => key !== "subModules").forEach((key) => {
|
|
2491
|
+
map[key] = present && this.isVisible(`${childPrefix}${key}`, state);
|
|
2492
|
+
});
|
|
2493
|
+
} else if (present) {
|
|
2494
|
+
Object.keys(this.viewMap).filter((key) => key.startsWith(childPrefix)).forEach((key) => {
|
|
2495
|
+
if (this.isVisible(key, state)) {
|
|
2496
|
+
map[key.slice(childPrefix.length)] = true;
|
|
2497
|
+
}
|
|
2498
|
+
});
|
|
2499
|
+
}
|
|
2500
|
+
return JSON.parse(JSON.stringify({
|
|
2501
|
+
kind: WIDGET_STRUCTURE_SCOPE_KIND,
|
|
2502
|
+
format: WIDGET_STRUCTURE_SCOPE_FORMAT,
|
|
2503
|
+
widget,
|
|
2504
|
+
structureVersion,
|
|
2505
|
+
source: prefixKey,
|
|
2506
|
+
present,
|
|
2507
|
+
map,
|
|
2508
|
+
defaults
|
|
2509
|
+
}));
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
__name(_WidgetStructureInstance, "WidgetStructureInstance");
|
|
2513
|
+
var WidgetStructureInstance = _WidgetStructureInstance;
|
|
2514
|
+
|
|
2515
|
+
// src/utils/scope.helpers.ts
|
|
2516
|
+
function structureFromSubmodule(parent, module, view, options) {
|
|
2517
|
+
var _a;
|
|
2518
|
+
const widget = Object.keys(WIDGET_SUBMODULE_NAMES).find((key) => WIDGET_SUBMODULE_NAMES[key] === module);
|
|
2519
|
+
if (!widget) {
|
|
2520
|
+
throw new Error(`No widget registered for the submodule ${module}`);
|
|
2521
|
+
}
|
|
2522
|
+
const layers = parent.getSubmoduleLayers(module, view);
|
|
2523
|
+
return buildStructure(widget, parent.getSubmodule(module, view), void 0, layers ? __spreadProps(__spreadValues({}, options), {
|
|
2524
|
+
layers: [
|
|
2525
|
+
...(_a = options == null ? void 0 : options.layers) != null ? _a : [],
|
|
2526
|
+
...layers
|
|
2527
|
+
]
|
|
2528
|
+
}) : options);
|
|
2529
|
+
}
|
|
2530
|
+
__name(structureFromSubmodule, "structureFromSubmodule");
|
|
2531
|
+
|
|
2532
|
+
// src/metadata/customization-metadata.ts
|
|
2533
|
+
var widgetMetadata = {
|
|
2534
|
+
[Widget.DASHBOARD]: {
|
|
2535
|
+
labels: DASHBOARD_LABELS
|
|
2536
|
+
},
|
|
2537
|
+
[Widget.CHART_PANEL]: {
|
|
2538
|
+
labels: CHART_PANEL_LABELS
|
|
2539
|
+
}
|
|
2540
|
+
};
|
|
2541
|
+
var widgetOfSubmodule = /* @__PURE__ */ __name((name) => {
|
|
2542
|
+
const widget = Object.keys(WIDGET_SUBMODULE_NAMES).find((key) => WIDGET_SUBMODULE_NAMES[key] === name);
|
|
2543
|
+
if (!widget) throw new Error(`No widget registered for the submodule ${name}`);
|
|
2544
|
+
return widget;
|
|
2545
|
+
}, "widgetOfSubmodule");
|
|
2546
|
+
function resolveTarget(widget, target, version) {
|
|
2547
|
+
var _a, _b;
|
|
2548
|
+
const embedded = ((_a = target.subModules) == null ? void 0 : _a.length) ? widgetOfSubmodule(target.subModules[target.subModules.length - 1]) : widget;
|
|
2549
|
+
const config = getWidgetConfig(embedded, ((_b = target.subModules) == null ? void 0 : _b.length) ? void 0 : version);
|
|
2550
|
+
return {
|
|
2551
|
+
widget: embedded,
|
|
2552
|
+
views: config.baseStructure.views ? target.views : [
|
|
2553
|
+
void 0
|
|
2554
|
+
]
|
|
2555
|
+
};
|
|
2556
|
+
}
|
|
2557
|
+
__name(resolveTarget, "resolveTarget");
|
|
2558
|
+
function structureKeysOf(widget, view, version) {
|
|
2559
|
+
const map = calculateViewMap(getWidgetConfig(widget, version).baseStructure);
|
|
2560
|
+
const prefix = view ? `${view}${STRUCTURE_VIEW_NAME_SEPARATOR}` : "";
|
|
2561
|
+
return Object.keys(map).filter((key) => view ? key.startsWith(prefix) : !key.includes(STRUCTURE_VIEW_NAME_SEPARATOR)).map((key) => key.slice(prefix.length)).filter((key) => key !== "subModules");
|
|
2562
|
+
}
|
|
2563
|
+
__name(structureKeysOf, "structureKeysOf");
|
|
2564
|
+
var humanize = /* @__PURE__ */ __name((id) => id.replace(/^q(?=[A-Z])/, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (char) => char.toUpperCase()), "humanize");
|
|
2565
|
+
function getCustomizationLabel(widget, key) {
|
|
2566
|
+
var _a, _b, _c, _d, _e;
|
|
2567
|
+
const labels = (_b = (_a = widgetMetadata[widget]) == null ? void 0 : _a.labels) != null ? _b : {};
|
|
2568
|
+
const id = (_c = key.split(STRUCTURE_SECTION_NAME_SEPARATOR).pop()) != null ? _c : key;
|
|
2569
|
+
return (_e = (_d = labels[key]) != null ? _d : labels[id]) != null ? _e : {
|
|
2570
|
+
label: humanize(id)
|
|
2571
|
+
};
|
|
2572
|
+
}
|
|
2573
|
+
__name(getCustomizationLabel, "getCustomizationLabel");
|
|
2574
|
+
function getCustomizationTree(widget, target, options = {}) {
|
|
2575
|
+
const resolved = resolveTarget(widget, target, options.version);
|
|
2576
|
+
const ordered = [];
|
|
2577
|
+
resolved.views.forEach((view) => {
|
|
2578
|
+
var _a;
|
|
2579
|
+
return structureKeysOf(resolved.widget, view, ((_a = target.subModules) == null ? void 0 : _a.length) ? void 0 : options.version).forEach((key) => {
|
|
2580
|
+
if (!ordered.includes(key)) ordered.push(key);
|
|
2581
|
+
});
|
|
2582
|
+
});
|
|
2583
|
+
const roots = [];
|
|
2584
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
2585
|
+
const ensure = /* @__PURE__ */ __name((key) => {
|
|
2586
|
+
var _a;
|
|
2587
|
+
const existing = nodes.get(key);
|
|
2588
|
+
if (existing) return existing;
|
|
2589
|
+
const parts = key.split(STRUCTURE_SECTION_NAME_SEPARATOR);
|
|
2590
|
+
const { label, description } = getCustomizationLabel(resolved.widget, key);
|
|
2591
|
+
const node = __spreadProps(__spreadValues({
|
|
2592
|
+
key,
|
|
2593
|
+
id: parts[parts.length - 1],
|
|
2594
|
+
label
|
|
2595
|
+
}, description && {
|
|
2596
|
+
description
|
|
2597
|
+
}), {
|
|
2598
|
+
kind: "item"
|
|
2599
|
+
});
|
|
2600
|
+
nodes.set(key, node);
|
|
2601
|
+
if (parts.length === 1) {
|
|
2602
|
+
roots.push(node);
|
|
2603
|
+
} else {
|
|
2604
|
+
const parent = ensure(parts.slice(0, -1).join(STRUCTURE_SECTION_NAME_SEPARATOR));
|
|
2605
|
+
parent.kind = "section";
|
|
2606
|
+
parent.children = [
|
|
2607
|
+
...(_a = parent.children) != null ? _a : [],
|
|
2608
|
+
node
|
|
2609
|
+
];
|
|
2610
|
+
}
|
|
2611
|
+
return node;
|
|
2612
|
+
}, "ensure");
|
|
2613
|
+
ordered.forEach(ensure);
|
|
2614
|
+
return roots;
|
|
2615
|
+
}
|
|
2616
|
+
__name(getCustomizationTree, "getCustomizationTree");
|
|
2617
|
+
function instanceFor(widget, customization, target, view) {
|
|
2618
|
+
var _a;
|
|
2619
|
+
let instance = buildStructure(widget, customization);
|
|
2620
|
+
((_a = target.subModules) != null ? _a : []).forEach((name) => {
|
|
2621
|
+
instance = structureFromSubmodule(instance, name, view);
|
|
2622
|
+
});
|
|
2623
|
+
return instance;
|
|
2624
|
+
}
|
|
2625
|
+
__name(instanceFor, "instanceFor");
|
|
2626
|
+
var matches = /* @__PURE__ */ __name((pattern, key) => pattern === key || new RegExp(`^${pattern.replace(/\./g, "\\.").replace(/\*/g, ".*")}$`).test(key), "matches");
|
|
2627
|
+
function scopesOf(customization, target, view) {
|
|
2628
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2629
|
+
const subModules = (_a = target.subModules) != null ? _a : [];
|
|
2630
|
+
if (!subModules.length) {
|
|
2631
|
+
return {
|
|
2632
|
+
own: (_b = customization == null ? void 0 : customization.views) == null ? void 0 : _b[view],
|
|
2633
|
+
root: customization
|
|
2634
|
+
};
|
|
2635
|
+
}
|
|
2636
|
+
const name = subModules[subModules.length - 1];
|
|
2637
|
+
return {
|
|
2638
|
+
own: (_e = (_d = (_c = customization == null ? void 0 : customization.views) == null ? void 0 : _c[view]) == null ? void 0 : _d.subModules) == null ? void 0 : _e[name],
|
|
2639
|
+
root: (_f = customization == null ? void 0 : customization.subModules) == null ? void 0 : _f[name]
|
|
2640
|
+
};
|
|
2641
|
+
}
|
|
2642
|
+
__name(scopesOf, "scopesOf");
|
|
2643
|
+
function lockOf(customization, target, view, key, hiddenParent) {
|
|
2644
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2645
|
+
const { own, root } = scopesOf(customization, target, view);
|
|
2646
|
+
if (hiddenParent) return {
|
|
2647
|
+
verb: "remove",
|
|
2648
|
+
pattern: hiddenParent,
|
|
2649
|
+
scope: "parent"
|
|
2650
|
+
};
|
|
2651
|
+
if ((_a = own == null ? void 0 : own.remove) == null ? void 0 : _a.includes(key)) return void 0;
|
|
2652
|
+
const rootRemove = (_b = root == null ? void 0 : root.remove) == null ? void 0 : _b.find((pattern) => matches(pattern, key));
|
|
2653
|
+
if (rootRemove) return {
|
|
2654
|
+
verb: "remove",
|
|
2655
|
+
pattern: rootRemove,
|
|
2656
|
+
scope: "root"
|
|
2657
|
+
};
|
|
2658
|
+
const viewRemove = (_c = own == null ? void 0 : own.remove) == null ? void 0 : _c.find((pattern) => matches(pattern, key));
|
|
2659
|
+
if (viewRemove) return {
|
|
2660
|
+
verb: "remove",
|
|
2661
|
+
pattern: viewRemove,
|
|
2662
|
+
scope: "view"
|
|
2663
|
+
};
|
|
2664
|
+
if ((_d = root == null ? void 0 : root.keep) == null ? void 0 : _d.length) return {
|
|
2665
|
+
verb: "keep",
|
|
2666
|
+
pattern: root.keep.join(", "),
|
|
2667
|
+
scope: "root"
|
|
2668
|
+
};
|
|
2669
|
+
if ((_e = own == null ? void 0 : own.keep) == null ? void 0 : _e.length) return {
|
|
2670
|
+
verb: "keep",
|
|
2671
|
+
pattern: own.keep.join(", "),
|
|
2672
|
+
scope: "view"
|
|
2673
|
+
};
|
|
2674
|
+
return {
|
|
2675
|
+
verb: "remove",
|
|
2676
|
+
pattern: key,
|
|
2677
|
+
scope: ((_f = own == null ? void 0 : own.conditional) == null ? void 0 : _f.length) || ((_g = root == null ? void 0 : root.conditional) == null ? void 0 : _g.length) ? "conditional" : "view"
|
|
2678
|
+
};
|
|
2679
|
+
}
|
|
2680
|
+
__name(lockOf, "lockOf");
|
|
2681
|
+
function getCustomizationTreeState(widget, customization, target) {
|
|
2682
|
+
var _a;
|
|
2683
|
+
const tree = getCustomizationTree(widget, target);
|
|
2684
|
+
const embedded = !!((_a = target.subModules) == null ? void 0 : _a.length);
|
|
2685
|
+
const instances = target.views.map((view) => ({
|
|
2686
|
+
view,
|
|
2687
|
+
instance: instanceFor(widget, customization, target, view)
|
|
2688
|
+
}));
|
|
2689
|
+
const isVisible = /* @__PURE__ */ __name((instance, view, key) => instance.isVisible(embedded ? key : `${view}${STRUCTURE_VIEW_NAME_SEPARATOR}${key}`, {}), "isVisible");
|
|
2690
|
+
const walk = /* @__PURE__ */ __name((nodes, hiddenParents) => nodes.map((node) => {
|
|
2691
|
+
const states = instances.map(({ view, instance }) => isVisible(instance, view, node.key));
|
|
2692
|
+
const visible = states.every(Boolean) ? true : states.some(Boolean) ? "mixed" : false;
|
|
2693
|
+
const locks = visible === false ? instances.map(({ view }, index) => lockOf(customization, target, view, node.key, hiddenParents[index])) : [];
|
|
2694
|
+
const lockedBy = locks.length && locks.every(Boolean) ? locks[0] : void 0;
|
|
2695
|
+
const childParents = states.map((state, index) => {
|
|
2696
|
+
var _a3;
|
|
2697
|
+
return (_a3 = hiddenParents[index]) != null ? _a3 : state ? void 0 : node.key;
|
|
2698
|
+
});
|
|
2699
|
+
const _a2 = node, { children } = _a2, rest = __objRest(_a2, ["children"]);
|
|
2700
|
+
const stateNode = __spreadProps(__spreadValues({}, rest), {
|
|
2701
|
+
visible
|
|
2702
|
+
});
|
|
2703
|
+
if (lockedBy) stateNode.lockedBy = lockedBy;
|
|
2704
|
+
if (children) stateNode.children = walk(children, childParents);
|
|
2705
|
+
return stateNode;
|
|
2706
|
+
}), "walk");
|
|
2707
|
+
return walk(tree, instances.map(() => void 0));
|
|
2708
|
+
}
|
|
2709
|
+
__name(getCustomizationTreeState, "getCustomizationTreeState");
|
|
2710
|
+
var isEmptyObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value) && Object.keys(value).length === 0, "isEmptyObject");
|
|
2711
|
+
function toggleCustomizationKey(customization, target, key, visible) {
|
|
2712
|
+
const result = JSON.parse(JSON.stringify(customization != null ? customization : {}));
|
|
2713
|
+
target.views.forEach((view) => {
|
|
2714
|
+
var _a, _b;
|
|
2715
|
+
const chain = [
|
|
2716
|
+
result
|
|
2717
|
+
];
|
|
2718
|
+
const step = /* @__PURE__ */ __name((holder, name) => {
|
|
2719
|
+
var _a2;
|
|
2720
|
+
holder[name] = (_a2 = holder[name]) != null ? _a2 : {};
|
|
2721
|
+
chain.push(holder[name]);
|
|
2722
|
+
return holder[name];
|
|
2723
|
+
}, "step");
|
|
2724
|
+
let block = step(step(result, "views"), view);
|
|
2725
|
+
((_a = target.subModules) != null ? _a : []).forEach((name) => {
|
|
2726
|
+
block = step(step(block, "subModules"), name);
|
|
2727
|
+
});
|
|
2728
|
+
const remove = (_b = block.remove) != null ? _b : [];
|
|
2729
|
+
if (!visible && !remove.includes(key)) block.remove = [
|
|
2730
|
+
...remove,
|
|
2731
|
+
key
|
|
2732
|
+
];
|
|
2733
|
+
if (visible) {
|
|
2734
|
+
const next = remove.filter((item) => item !== key);
|
|
2735
|
+
if (next.length) block.remove = next;
|
|
2736
|
+
else delete block.remove;
|
|
2737
|
+
}
|
|
2738
|
+
for (let index = chain.length - 1; index > 0; index--) {
|
|
2739
|
+
const holder = chain[index - 1];
|
|
2740
|
+
const name = Object.keys(holder).find((property) => holder[property] === chain[index]);
|
|
2741
|
+
if (name && isEmptyObject(chain[index])) delete holder[name];
|
|
2742
|
+
}
|
|
2743
|
+
});
|
|
2744
|
+
return result;
|
|
2745
|
+
}
|
|
2746
|
+
__name(toggleCustomizationKey, "toggleCustomizationKey");
|
|
2747
|
+
|
|
2748
|
+
export { getCustomizationLabel, getCustomizationTree, getCustomizationTreeState, structureKeysOf, toggleCustomizationKey, widgetMetadata };
|
|
2749
|
+
//# sourceMappingURL=metadata.mjs.map
|
|
2750
|
+
//# sourceMappingURL=metadata.mjs.map
|