@qrvey/widget-configurability 0.0.0-beta.4737 → 0.0.0-beta.4750
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 +20 -0
- package/dist/cjs/metadata/customization-applicability.js +58 -0
- package/dist/cjs/metadata/customization-applicability.js.map +1 -0
- package/dist/cjs/metadata/customization-docs.js +15 -12
- package/dist/cjs/metadata/customization-docs.js.map +1 -1
- package/dist/cjs/metadata/customization-metadata.js +64 -6
- package/dist/cjs/metadata/customization-metadata.js.map +1 -1
- package/dist/cjs/metadata/index.js +2 -1
- package/dist/cjs/metadata/index.js.map +1 -1
- package/dist/cjs/metadata/labels/dashboard.applicability.js +108 -0
- package/dist/cjs/metadata/labels/dashboard.applicability.js.map +1 -0
- package/dist/esm/metadata.mjs +463 -43
- package/dist/esm/metadata.mjs.map +1 -1
- package/dist/types/metadata.d.ts +47 -6
- package/package.json +1 -1
package/dist/esm/metadata.mjs
CHANGED
|
@@ -32,6 +32,84 @@ var __objRest = (source, exclude) => {
|
|
|
32
32
|
};
|
|
33
33
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
|
|
35
|
+
// src/constants/structure.constants.ts
|
|
36
|
+
var STRUCTURE_SECTION_NAME_SEPARATOR = ".";
|
|
37
|
+
var STRUCTURE_VIEW_NAME_SEPARATOR = "::";
|
|
38
|
+
var STRUCTURE_RESERVED_WORDS = [
|
|
39
|
+
"views",
|
|
40
|
+
"defaults",
|
|
41
|
+
"subModules"
|
|
42
|
+
];
|
|
43
|
+
var Widget = /* @__PURE__ */ function(Widget2) {
|
|
44
|
+
Widget2["DASHBOARD"] = "dashboard";
|
|
45
|
+
Widget2["REPORT"] = "report";
|
|
46
|
+
Widget2["DOWNLOAD_MANAGER"] = "download-manager";
|
|
47
|
+
Widget2["DOWNLOAD_MODAL"] = "download-modal";
|
|
48
|
+
Widget2["CHART_PANEL"] = "chart-panel";
|
|
49
|
+
Widget2["CHART_GALLERY"] = "chart-gallery";
|
|
50
|
+
Widget2["CHART_BUILDER"] = "chart-builder";
|
|
51
|
+
return Widget2;
|
|
52
|
+
}({});
|
|
53
|
+
var WIDGET_SUBMODULE_NAMES = {
|
|
54
|
+
["download-modal"]: "downloadModal",
|
|
55
|
+
["chart-panel"]: "chartPanel",
|
|
56
|
+
["chart-gallery"]: "chartGallery",
|
|
57
|
+
["chart-builder"]: "chartBuilder"
|
|
58
|
+
};
|
|
59
|
+
var WIDGET_STRUCTURE_SCOPE_KIND = "qrvey.widget-structure-scope";
|
|
60
|
+
var WIDGET_STRUCTURE_SCOPE_FORMAT = 1;
|
|
61
|
+
var WidgetVersion = /* @__PURE__ */ function(WidgetVersion2) {
|
|
62
|
+
WidgetVersion2["v1"] = "1.0";
|
|
63
|
+
WidgetVersion2["latest"] = "latest";
|
|
64
|
+
return WidgetVersion2;
|
|
65
|
+
}({});
|
|
66
|
+
|
|
67
|
+
// src/metadata/customization-applicability.ts
|
|
68
|
+
var chainOf = /* @__PURE__ */ __name((key) => key.split(STRUCTURE_SECTION_NAME_SEPARATOR).map((_, index, parts) => parts.slice(0, index + 1).join(STRUCTURE_SECTION_NAME_SEPARATOR)), "chainOf");
|
|
69
|
+
var defaultRole = /* @__PURE__ */ __name((kind) => kind === "item" ? "item" : "group", "defaultRole");
|
|
70
|
+
function resolveApplicability(map, key, view, kind, gate) {
|
|
71
|
+
var _a, _b, _c, _d;
|
|
72
|
+
const chain = chainOf(key);
|
|
73
|
+
let views = gate == null ? void 0 : gate.views;
|
|
74
|
+
const requires = new Set((_a = gate == null ? void 0 : gate.requires) != null ? _a : []);
|
|
75
|
+
let underNone = false;
|
|
76
|
+
chain.forEach((path) => {
|
|
77
|
+
var _a2;
|
|
78
|
+
const entry = map[path];
|
|
79
|
+
if (!entry) return;
|
|
80
|
+
if (entry.views) {
|
|
81
|
+
const declared = entry.views;
|
|
82
|
+
views = views ? views.filter((name) => declared.includes(name)) : [
|
|
83
|
+
...declared
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
(_a2 = entry.requires) == null ? void 0 : _a2.forEach((requirement) => requires.add(requirement));
|
|
87
|
+
if (path !== key && entry.role === "none") underNone = true;
|
|
88
|
+
});
|
|
89
|
+
const role = (_c = (_b = map[key]) == null ? void 0 : _b.role) != null ? _c : defaultRole(kind);
|
|
90
|
+
const applies = role !== "none" && !underNone && ((_d = gate == null ? void 0 : gate.applies) != null ? _d : true) && (view === void 0 || !views || views.includes(view));
|
|
91
|
+
return __spreadValues(__spreadValues({
|
|
92
|
+
role,
|
|
93
|
+
applies,
|
|
94
|
+
toggleable: applies && (role === "item" || role === "group")
|
|
95
|
+
}, views && {
|
|
96
|
+
views
|
|
97
|
+
}), requires.size && {
|
|
98
|
+
requires: [
|
|
99
|
+
...requires
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
__name(resolveApplicability, "resolveApplicability");
|
|
104
|
+
function mergeApplicability(states) {
|
|
105
|
+
const [first] = states;
|
|
106
|
+
return __spreadProps(__spreadValues({}, first), {
|
|
107
|
+
applies: states.some((state) => state.applies),
|
|
108
|
+
toggleable: states.some((state) => state.toggleable)
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
__name(mergeApplicability, "mergeApplicability");
|
|
112
|
+
|
|
35
113
|
// src/metadata/labels/chart-panel.defaults.ts
|
|
36
114
|
var CHART_PANEL_DEFAULTS = {
|
|
37
115
|
menuLayout: {
|
|
@@ -523,6 +601,326 @@ var CHART_PANEL_LABELS = {
|
|
|
523
601
|
}
|
|
524
602
|
};
|
|
525
603
|
|
|
604
|
+
// src/metadata/labels/dashboard.applicability.ts
|
|
605
|
+
var each = /* @__PURE__ */ __name((keys, applicability) => Object.fromEntries(keys.map((key) => [
|
|
606
|
+
key,
|
|
607
|
+
applicability
|
|
608
|
+
])), "each");
|
|
609
|
+
var DASHBOARD_APPLICABILITY = __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({
|
|
610
|
+
// The manager bar is not rendered in dummy mode, nor for a single dashboard outside Composer.
|
|
611
|
+
navBar: {
|
|
612
|
+
requires: [
|
|
613
|
+
"environment"
|
|
614
|
+
]
|
|
615
|
+
},
|
|
616
|
+
"navBar.qBackButton": {
|
|
617
|
+
views: [
|
|
618
|
+
"design",
|
|
619
|
+
"preview",
|
|
620
|
+
"endUser"
|
|
621
|
+
]
|
|
622
|
+
},
|
|
623
|
+
// Dashboard list. Card and table fields only show in their mode of the list.
|
|
624
|
+
"assetList.asset.card": {
|
|
625
|
+
requires: [
|
|
626
|
+
"cardView"
|
|
627
|
+
]
|
|
628
|
+
},
|
|
629
|
+
"assetList.asset.table": {
|
|
630
|
+
requires: [
|
|
631
|
+
"tableView"
|
|
632
|
+
]
|
|
633
|
+
},
|
|
634
|
+
// Nothing reads it: the list has one Duplicate option whose modal asks about the charts.
|
|
635
|
+
"assetList.asset.optionMenu.qDuplDashAndCharts": {
|
|
636
|
+
role: "none"
|
|
637
|
+
}
|
|
638
|
+
}, each([
|
|
639
|
+
"assetList.asset.optionMenu.qEditDash",
|
|
640
|
+
"assetList.asset.optionMenu.qUseDash",
|
|
641
|
+
"assetList.asset.optionMenu.qRenameDash",
|
|
642
|
+
"assetList.asset.optionMenu.qDuplDash",
|
|
643
|
+
"assetList.asset.optionMenu.qManageSharing",
|
|
644
|
+
"controlBarLeft.qCreateDash"
|
|
645
|
+
], {
|
|
646
|
+
requires: [
|
|
647
|
+
"permission"
|
|
648
|
+
]
|
|
649
|
+
})), each([
|
|
650
|
+
"controlBarRight.qSwitchView",
|
|
651
|
+
"controlBarRight.timezone",
|
|
652
|
+
"controlBarRight.qFilterBy",
|
|
653
|
+
"controlBarRight.qFilterByTags",
|
|
654
|
+
"controlBarRight.qSearch"
|
|
655
|
+
], {
|
|
656
|
+
views: [
|
|
657
|
+
"list"
|
|
658
|
+
]
|
|
659
|
+
})), {
|
|
660
|
+
"controlBarRight.qSortBy": {
|
|
661
|
+
views: [
|
|
662
|
+
"list"
|
|
663
|
+
],
|
|
664
|
+
requires: [
|
|
665
|
+
"cardView"
|
|
666
|
+
]
|
|
667
|
+
},
|
|
668
|
+
"controlBarRight.qSelectColumn": {
|
|
669
|
+
views: [
|
|
670
|
+
"list"
|
|
671
|
+
],
|
|
672
|
+
requires: [
|
|
673
|
+
"tableView"
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
}), each([
|
|
677
|
+
"controlBarRight.qPreview",
|
|
678
|
+
"controlBarRight.qDiscard",
|
|
679
|
+
"controlBarRight.qPublish",
|
|
680
|
+
"controlBarRight.qUnpublish",
|
|
681
|
+
"controlBarRight.qSwitchMode"
|
|
682
|
+
], {
|
|
683
|
+
views: [
|
|
684
|
+
"design"
|
|
685
|
+
]
|
|
686
|
+
})), {
|
|
687
|
+
"controlBarRight.qDesign": {
|
|
688
|
+
views: [
|
|
689
|
+
"preview"
|
|
690
|
+
],
|
|
691
|
+
requires: [
|
|
692
|
+
"permission"
|
|
693
|
+
]
|
|
694
|
+
}
|
|
695
|
+
}), each([
|
|
696
|
+
"controlBarRight.qStatus",
|
|
697
|
+
"controlBarRight.qDownloadList"
|
|
698
|
+
], {
|
|
699
|
+
views: [
|
|
700
|
+
"design",
|
|
701
|
+
"preview"
|
|
702
|
+
]
|
|
703
|
+
})), {
|
|
704
|
+
// Only after a 401 (expired qv_token), or a go-to-dashboard navigation.
|
|
705
|
+
qQvTokenExpiredMessage: {
|
|
706
|
+
requires: [
|
|
707
|
+
"environment"
|
|
708
|
+
]
|
|
709
|
+
},
|
|
710
|
+
qGoToDashBackButton: {
|
|
711
|
+
requires: [
|
|
712
|
+
"navigation"
|
|
713
|
+
]
|
|
714
|
+
},
|
|
715
|
+
// Duplicating is a command, and dummy mode refuses commands. The options node only carries defaults nobody reads:
|
|
716
|
+
// DashboardX reads them from duplicateModal.
|
|
717
|
+
duplicateModal: {
|
|
718
|
+
requires: [
|
|
719
|
+
"environment"
|
|
720
|
+
]
|
|
721
|
+
},
|
|
722
|
+
"duplicateModal.options": {
|
|
723
|
+
role: "none"
|
|
724
|
+
},
|
|
725
|
+
// Only defaults (drag, resize, remove, changeLayout, unsavedChangesBehavior). Removing it hides no control, it
|
|
726
|
+
// drops the defaults, which turns off dragging and resizing in design.
|
|
727
|
+
canvas: {
|
|
728
|
+
role: "defaults"
|
|
729
|
+
},
|
|
730
|
+
"header.qTags": {
|
|
731
|
+
requires: [
|
|
732
|
+
"content"
|
|
733
|
+
]
|
|
734
|
+
},
|
|
735
|
+
// Design menu bar.
|
|
736
|
+
"menuBar.file.qMnuDuplicateDashAndCharts": {
|
|
737
|
+
role: "none"
|
|
738
|
+
},
|
|
739
|
+
"menuBar.edit.qSelectAllContElem": {
|
|
740
|
+
role: "none"
|
|
741
|
+
}
|
|
742
|
+
}), each([
|
|
743
|
+
"menuBar.file.qMnuCanvasSize",
|
|
744
|
+
"menuBar.grid.qMnuSnapToGrid",
|
|
745
|
+
"menuBar.qMnuArrange",
|
|
746
|
+
"menuBar.insert.qMnuInsertHeader"
|
|
747
|
+
], {
|
|
748
|
+
requires: [
|
|
749
|
+
"fixedCanvas"
|
|
750
|
+
]
|
|
751
|
+
})), each([
|
|
752
|
+
"menuBar.file.qManageSharing",
|
|
753
|
+
"menuBar.file.qCreateDataset",
|
|
754
|
+
"menuBar.insert.qMnuInsertChart.qMnuNewChartAI"
|
|
755
|
+
], {
|
|
756
|
+
requires: [
|
|
757
|
+
"permission"
|
|
758
|
+
]
|
|
759
|
+
})), each([
|
|
760
|
+
"toolBar.qInsertChart",
|
|
761
|
+
"toolBar.qInsertFilterCtrl",
|
|
762
|
+
"toolBar.qInsertShape",
|
|
763
|
+
"toolBar.grid",
|
|
764
|
+
"toolBar.qResponsiveView",
|
|
765
|
+
"toolBar.qInsertText",
|
|
766
|
+
"toolBar.qInsertImage",
|
|
767
|
+
"toolBar.qInsertButton",
|
|
768
|
+
"toolBar.qInsertContainer",
|
|
769
|
+
"toolBar.qThemes"
|
|
770
|
+
], {
|
|
771
|
+
views: [
|
|
772
|
+
"design"
|
|
773
|
+
]
|
|
774
|
+
})), each([
|
|
775
|
+
"toolBar.qCanvasSize",
|
|
776
|
+
"toolBar.qArrange",
|
|
777
|
+
"toolBar.qAlign"
|
|
778
|
+
], {
|
|
779
|
+
views: [
|
|
780
|
+
"design"
|
|
781
|
+
],
|
|
782
|
+
requires: [
|
|
783
|
+
"fixedCanvas"
|
|
784
|
+
]
|
|
785
|
+
})), {
|
|
786
|
+
"toolBar.grid.qSnapToGrid": {
|
|
787
|
+
requires: [
|
|
788
|
+
"fixedCanvas"
|
|
789
|
+
]
|
|
790
|
+
}
|
|
791
|
+
}), each([
|
|
792
|
+
"toolBar.qRespGridMargins",
|
|
793
|
+
"toolBar.qRespGridColumns"
|
|
794
|
+
], {
|
|
795
|
+
views: [
|
|
796
|
+
"design"
|
|
797
|
+
],
|
|
798
|
+
requires: [
|
|
799
|
+
"responsiveCanvas"
|
|
800
|
+
]
|
|
801
|
+
})), {
|
|
802
|
+
"toolBar.qResponsiveView.qBreakpoints": {
|
|
803
|
+
requires: [
|
|
804
|
+
"responsiveCanvas"
|
|
805
|
+
]
|
|
806
|
+
},
|
|
807
|
+
"toolBar.qCreateDataset": {
|
|
808
|
+
views: [
|
|
809
|
+
"design"
|
|
810
|
+
],
|
|
811
|
+
requires: [
|
|
812
|
+
"permission"
|
|
813
|
+
]
|
|
814
|
+
},
|
|
815
|
+
"toolBar.qInsertChart.qNewChartAI": {
|
|
816
|
+
requires: [
|
|
817
|
+
"permission"
|
|
818
|
+
]
|
|
819
|
+
},
|
|
820
|
+
"toolBar.qDownloadDash": {
|
|
821
|
+
requires: [
|
|
822
|
+
"permission"
|
|
823
|
+
]
|
|
824
|
+
}
|
|
825
|
+
}), each([
|
|
826
|
+
"toolBar.qDashVersion",
|
|
827
|
+
"toolBar.qDiscard",
|
|
828
|
+
"toolBar.qSave",
|
|
829
|
+
"toolBar.qSwitchMode",
|
|
830
|
+
"toolBar.qHideToolBar",
|
|
831
|
+
"toolBar.qDownloadList",
|
|
832
|
+
"toolBar.qChangeLayout"
|
|
833
|
+
], {
|
|
834
|
+
views: [
|
|
835
|
+
"endUser"
|
|
836
|
+
]
|
|
837
|
+
})), each([
|
|
838
|
+
"toolBar.qGetDashVersion",
|
|
839
|
+
"toolBar.qSourceDashBanner",
|
|
840
|
+
"toolBar.qHiddenItems"
|
|
841
|
+
], {
|
|
842
|
+
views: [
|
|
843
|
+
"endUser"
|
|
844
|
+
],
|
|
845
|
+
requires: [
|
|
846
|
+
"personalization"
|
|
847
|
+
]
|
|
848
|
+
})), {
|
|
849
|
+
// The filter settings button needs the canvas in edit mode; view-only filters come from navigation.
|
|
850
|
+
"filterPanel.qFilterSettings": {
|
|
851
|
+
views: [
|
|
852
|
+
"design"
|
|
853
|
+
]
|
|
854
|
+
},
|
|
855
|
+
"filterPanel.viewOnlyFilterScope": {
|
|
856
|
+
views: [
|
|
857
|
+
"preview",
|
|
858
|
+
"endUser"
|
|
859
|
+
],
|
|
860
|
+
requires: [
|
|
861
|
+
"navigation"
|
|
862
|
+
]
|
|
863
|
+
}
|
|
864
|
+
}), each([
|
|
865
|
+
"filterPanel.tabFilterScope",
|
|
866
|
+
"filterPanel.panelFilterScope"
|
|
867
|
+
], {
|
|
868
|
+
requires: [
|
|
869
|
+
"content"
|
|
870
|
+
]
|
|
871
|
+
})), each([
|
|
872
|
+
"downloadModal.qExportVersion",
|
|
873
|
+
"downloadModal.qSavedVersionWarning"
|
|
874
|
+
], {
|
|
875
|
+
views: [
|
|
876
|
+
"endUser"
|
|
877
|
+
]
|
|
878
|
+
})), {
|
|
879
|
+
"downloadModal.qUnsavedVersionWarning": {
|
|
880
|
+
views: [
|
|
881
|
+
"endUser"
|
|
882
|
+
],
|
|
883
|
+
requires: [
|
|
884
|
+
"personalization"
|
|
885
|
+
]
|
|
886
|
+
},
|
|
887
|
+
// Only an admin editing a schedule reads it, and DashboardX never opens the modal that way.
|
|
888
|
+
"downloadModal.qSubscribeOwner": {
|
|
889
|
+
role: "none"
|
|
890
|
+
},
|
|
891
|
+
// No reader in DashboardX nor in the qomponents export modal.
|
|
892
|
+
"downloadModal.qIncludeHeader": {
|
|
893
|
+
role: "none"
|
|
894
|
+
},
|
|
895
|
+
"downloadModal.qSubscribeOrganization": {
|
|
896
|
+
requires: [
|
|
897
|
+
"composer"
|
|
898
|
+
]
|
|
899
|
+
},
|
|
900
|
+
"downloadModal.qIncludeHyperlinks": {
|
|
901
|
+
requires: [
|
|
902
|
+
"content"
|
|
903
|
+
]
|
|
904
|
+
},
|
|
905
|
+
// The chart panel has no charts to render in the list; the gallery always reads its design keys, also in endUser;
|
|
906
|
+
// nothing reads the chart builder's.
|
|
907
|
+
"subModules.chartPanel": {
|
|
908
|
+
views: [
|
|
909
|
+
"design",
|
|
910
|
+
"preview",
|
|
911
|
+
"endUser"
|
|
912
|
+
]
|
|
913
|
+
},
|
|
914
|
+
"subModules.chartGallery": {
|
|
915
|
+
views: [
|
|
916
|
+
"design"
|
|
917
|
+
]
|
|
918
|
+
},
|
|
919
|
+
"subModules.chartBuilder": {
|
|
920
|
+
role: "none"
|
|
921
|
+
}
|
|
922
|
+
});
|
|
923
|
+
|
|
526
924
|
// src/metadata/labels/dashboard.defaults.ts
|
|
527
925
|
var COLOR = "Color names or hex, e.g. '#000000', 'green', 'GREEN'";
|
|
528
926
|
var IMAGE_URL = "Valid image url";
|
|
@@ -2407,38 +2805,6 @@ var DASHBOARD_LABELS = {
|
|
|
2407
2805
|
}
|
|
2408
2806
|
};
|
|
2409
2807
|
|
|
2410
|
-
// src/constants/structure.constants.ts
|
|
2411
|
-
var STRUCTURE_SECTION_NAME_SEPARATOR = ".";
|
|
2412
|
-
var STRUCTURE_VIEW_NAME_SEPARATOR = "::";
|
|
2413
|
-
var STRUCTURE_RESERVED_WORDS = [
|
|
2414
|
-
"views",
|
|
2415
|
-
"defaults",
|
|
2416
|
-
"subModules"
|
|
2417
|
-
];
|
|
2418
|
-
var Widget = /* @__PURE__ */ function(Widget2) {
|
|
2419
|
-
Widget2["DASHBOARD"] = "dashboard";
|
|
2420
|
-
Widget2["REPORT"] = "report";
|
|
2421
|
-
Widget2["DOWNLOAD_MANAGER"] = "download-manager";
|
|
2422
|
-
Widget2["DOWNLOAD_MODAL"] = "download-modal";
|
|
2423
|
-
Widget2["CHART_PANEL"] = "chart-panel";
|
|
2424
|
-
Widget2["CHART_GALLERY"] = "chart-gallery";
|
|
2425
|
-
Widget2["CHART_BUILDER"] = "chart-builder";
|
|
2426
|
-
return Widget2;
|
|
2427
|
-
}({});
|
|
2428
|
-
var WIDGET_SUBMODULE_NAMES = {
|
|
2429
|
-
["download-modal"]: "downloadModal",
|
|
2430
|
-
["chart-panel"]: "chartPanel",
|
|
2431
|
-
["chart-gallery"]: "chartGallery",
|
|
2432
|
-
["chart-builder"]: "chartBuilder"
|
|
2433
|
-
};
|
|
2434
|
-
var WIDGET_STRUCTURE_SCOPE_KIND = "qrvey.widget-structure-scope";
|
|
2435
|
-
var WIDGET_STRUCTURE_SCOPE_FORMAT = 1;
|
|
2436
|
-
var WidgetVersion = /* @__PURE__ */ function(WidgetVersion2) {
|
|
2437
|
-
WidgetVersion2["v1"] = "1.0";
|
|
2438
|
-
WidgetVersion2["latest"] = "latest";
|
|
2439
|
-
return WidgetVersion2;
|
|
2440
|
-
}({});
|
|
2441
|
-
|
|
2442
2808
|
// src/utils/defaults.helpers.ts
|
|
2443
2809
|
var FONT_SIZES2 = [
|
|
2444
2810
|
8,
|
|
@@ -4230,7 +4596,8 @@ __name(structureFromSubmodule, "structureFromSubmodule");
|
|
|
4230
4596
|
var widgetMetadata = {
|
|
4231
4597
|
[Widget.DASHBOARD]: {
|
|
4232
4598
|
labels: DASHBOARD_LABELS,
|
|
4233
|
-
defaults: DASHBOARD_DEFAULTS
|
|
4599
|
+
defaults: DASHBOARD_DEFAULTS,
|
|
4600
|
+
applicability: DASHBOARD_APPLICABILITY
|
|
4234
4601
|
},
|
|
4235
4602
|
[Widget.CHART_PANEL]: {
|
|
4236
4603
|
labels: CHART_PANEL_LABELS,
|
|
@@ -4305,6 +4672,49 @@ function getCustomizationLabel(widget, key) {
|
|
|
4305
4672
|
};
|
|
4306
4673
|
}
|
|
4307
4674
|
__name(getCustomizationLabel, "getCustomizationLabel");
|
|
4675
|
+
var SUBMODULES_PREFIX = `subModules${STRUCTURE_SECTION_NAME_SEPARATOR}`;
|
|
4676
|
+
var applicabilityMapOf = /* @__PURE__ */ __name((widget) => {
|
|
4677
|
+
var _a, _b;
|
|
4678
|
+
return (_b = (_a = widgetMetadata[widget]) == null ? void 0 : _a.applicability) != null ? _b : {};
|
|
4679
|
+
}, "applicabilityMapOf");
|
|
4680
|
+
var subModuleGate = /* @__PURE__ */ __name((widget, name, view) => resolveApplicability(applicabilityMapOf(widget), `${SUBMODULES_PREFIX}${name}`, view, "subModule"), "subModuleGate");
|
|
4681
|
+
function getKeyApplicability(widget, key, view, options = {}) {
|
|
4682
|
+
const { subModule } = options;
|
|
4683
|
+
if (!subModule && key.startsWith(SUBMODULES_PREFIX)) {
|
|
4684
|
+
return subModuleGate(widget, key.slice(SUBMODULES_PREFIX.length), view);
|
|
4685
|
+
}
|
|
4686
|
+
const owner = subModule ? widgetOfSubmodule(subModule) : widget;
|
|
4687
|
+
const structure = structureRootOf(owner, options, subModule);
|
|
4688
|
+
const keys = structureKeysOf(owner, structure.views ? view : void 0, void 0, {
|
|
4689
|
+
structure
|
|
4690
|
+
});
|
|
4691
|
+
const kind = keys.some((other) => other.startsWith(`${key}${STRUCTURE_SECTION_NAME_SEPARATOR}`)) ? "section" : "item";
|
|
4692
|
+
const applicability = resolveApplicability(applicabilityMapOf(owner), key, view, kind, subModule ? subModuleGate(widget, subModule, view) : void 0);
|
|
4693
|
+
return keys.includes(key) ? applicability : __spreadProps(__spreadValues({}, applicability), {
|
|
4694
|
+
applies: false,
|
|
4695
|
+
toggleable: false
|
|
4696
|
+
});
|
|
4697
|
+
}
|
|
4698
|
+
__name(getKeyApplicability, "getKeyApplicability");
|
|
4699
|
+
function withApplicability(host, widget, target, nodes, applicableOnly) {
|
|
4700
|
+
var _a;
|
|
4701
|
+
const views = target.views.length ? target.views : [
|
|
4702
|
+
void 0
|
|
4703
|
+
];
|
|
4704
|
+
const subModules = (_a = target.subModules) != null ? _a : [];
|
|
4705
|
+
const gates = views.map((view) => subModules.length ? subModuleGate(host, subModules[subModules.length - 1], view) : void 0);
|
|
4706
|
+
const map = applicabilityMapOf(widget);
|
|
4707
|
+
const annotate = /* @__PURE__ */ __name((list) => list.map((node) => {
|
|
4708
|
+
const applicability = mergeApplicability(views.map((view, index) => resolveApplicability(map, node.key, view, node.kind, gates[index])));
|
|
4709
|
+
const children = node.children && annotate(node.children);
|
|
4710
|
+
const annotated = __spreadValues(__spreadValues({}, node), applicability);
|
|
4711
|
+
if (children == null ? void 0 : children.length) annotated.children = children;
|
|
4712
|
+
else delete annotated.children;
|
|
4713
|
+
return annotated;
|
|
4714
|
+
}).filter((node) => !applicableOnly || node.applies), "annotate");
|
|
4715
|
+
return annotate(nodes);
|
|
4716
|
+
}
|
|
4717
|
+
__name(withApplicability, "withApplicability");
|
|
4308
4718
|
function getCustomizationTree(widget, target, options = {}) {
|
|
4309
4719
|
const resolved = resolveTarget(widget, target, options);
|
|
4310
4720
|
const ordered = [];
|
|
@@ -4326,7 +4736,10 @@ function getCustomizationTree(widget, target, options = {}) {
|
|
|
4326
4736
|
}, description && {
|
|
4327
4737
|
description
|
|
4328
4738
|
}), {
|
|
4329
|
-
kind: "item"
|
|
4739
|
+
kind: "item",
|
|
4740
|
+
role: "item",
|
|
4741
|
+
applies: true,
|
|
4742
|
+
toggleable: true
|
|
4330
4743
|
});
|
|
4331
4744
|
nodes.set(key, node);
|
|
4332
4745
|
if (parts.length === 1) {
|
|
@@ -4342,7 +4755,7 @@ function getCustomizationTree(widget, target, options = {}) {
|
|
|
4342
4755
|
return node;
|
|
4343
4756
|
}, "ensure");
|
|
4344
4757
|
ordered.forEach(ensure);
|
|
4345
|
-
return roots;
|
|
4758
|
+
return withApplicability(widget, resolved.widget, target, roots, !!options.applicableOnly);
|
|
4346
4759
|
}
|
|
4347
4760
|
__name(getCustomizationTree, "getCustomizationTree");
|
|
4348
4761
|
function instanceFor(widget, customization, target, view) {
|
|
@@ -4409,9 +4822,9 @@ function lockOf(customization, target, view, key, hiddenParent) {
|
|
|
4409
4822
|
};
|
|
4410
4823
|
}
|
|
4411
4824
|
__name(lockOf, "lockOf");
|
|
4412
|
-
function getCustomizationTreeState(widget, customization, target) {
|
|
4825
|
+
function getCustomizationTreeState(widget, customization, target, options = {}) {
|
|
4413
4826
|
var _a;
|
|
4414
|
-
const tree = getCustomizationTree(widget, target);
|
|
4827
|
+
const tree = getCustomizationTree(widget, target, options);
|
|
4415
4828
|
const embedded = !!((_a = target.subModules) == null ? void 0 : _a.length);
|
|
4416
4829
|
const instances = target.views.map((view) => ({
|
|
4417
4830
|
view,
|
|
@@ -4613,6 +5026,11 @@ function flatten(widget, tree, scope, defaults) {
|
|
|
4613
5026
|
since,
|
|
4614
5027
|
notes,
|
|
4615
5028
|
audience: own,
|
|
5029
|
+
role: node.role,
|
|
5030
|
+
applies: node.applies,
|
|
5031
|
+
toggleable: node.toggleable,
|
|
5032
|
+
views: node.views,
|
|
5033
|
+
requires: node.requires,
|
|
4616
5034
|
defaults: byKey.get(node.key)
|
|
4617
5035
|
});
|
|
4618
5036
|
return [
|
|
@@ -4623,13 +5041,13 @@ function flatten(widget, tree, scope, defaults) {
|
|
|
4623
5041
|
return walk(tree, null, DEFAULT_AUDIENCE);
|
|
4624
5042
|
}
|
|
4625
5043
|
__name(flatten, "flatten");
|
|
4626
|
-
function subModuleEntry(widget, name,
|
|
5044
|
+
function subModuleEntry(widget, name, view) {
|
|
4627
5045
|
var _a;
|
|
4628
5046
|
const key = `subModules${STRUCTURE_SECTION_NAME_SEPARATOR}${name}`;
|
|
4629
5047
|
const { label, description, since, notes, audience } = (_a = SUBMODULE_LABELS[name]) != null ? _a : getCustomizationLabel(widget, key);
|
|
4630
|
-
return compact({
|
|
5048
|
+
return compact(__spreadValues({
|
|
4631
5049
|
key,
|
|
4632
|
-
scope,
|
|
5050
|
+
scope: view != null ? view : "",
|
|
4633
5051
|
parent: null,
|
|
4634
5052
|
kind: "subModule",
|
|
4635
5053
|
label,
|
|
@@ -4637,7 +5055,7 @@ function subModuleEntry(widget, name, scope) {
|
|
|
4637
5055
|
since,
|
|
4638
5056
|
notes,
|
|
4639
5057
|
audience: audience != null ? audience : DEFAULT_AUDIENCE
|
|
4640
|
-
});
|
|
5058
|
+
}, getKeyApplicability(widget, key, view)));
|
|
4641
5059
|
}
|
|
4642
5060
|
__name(subModuleEntry, "subModuleEntry");
|
|
4643
5061
|
function getCustomizationDocs(widget, options = {}) {
|
|
@@ -4656,7 +5074,9 @@ function getCustomizationDocs(widget, options = {}) {
|
|
|
4656
5074
|
};
|
|
4657
5075
|
const entries = flatten(widget, getCustomizationTree(widget, target, options), scope, hostDefaults);
|
|
4658
5076
|
Object.keys(asObject(map[`${viewPrefix(view)}subModules`])).filter((name) => !options.subModules || options.subModules.includes(name)).forEach((name) => {
|
|
4659
|
-
|
|
5077
|
+
const entry = subModuleEntry(widget, name, view);
|
|
5078
|
+
if (options.applicableOnly && !entry.applies) return;
|
|
5079
|
+
entries.push(entry);
|
|
4660
5080
|
const embedded = findWidgetOfSubmodule(name);
|
|
4661
5081
|
if (!embedded) return;
|
|
4662
5082
|
entries.push(...flatten(embedded, getCustomizationTree(widget, __spreadProps(__spreadValues({}, target), {
|
|
@@ -4689,6 +5109,6 @@ function getCustomizationDefaultDocs(widget, options = {}) {
|
|
|
4689
5109
|
}
|
|
4690
5110
|
__name(getCustomizationDefaultDocs, "getCustomizationDefaultDocs");
|
|
4691
5111
|
|
|
4692
|
-
export { getCustomizationDefaultDocs, getCustomizationDocs, getCustomizationLabel, getCustomizationTree, getCustomizationTreeState, structureKeysOf, toggleCustomizationKey, widgetMetadata };
|
|
5112
|
+
export { getCustomizationDefaultDocs, getCustomizationDocs, getCustomizationLabel, getCustomizationTree, getCustomizationTreeState, getKeyApplicability, structureKeysOf, toggleCustomizationKey, widgetMetadata };
|
|
4693
5113
|
//# sourceMappingURL=metadata.mjs.map
|
|
4694
5114
|
//# sourceMappingURL=metadata.mjs.map
|