dotdata_widgets 0.1.2 → 0.1.4
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 +27 -3
- package/css/colors.css +4 -0
- package/css/typography.css +9 -0
- package/css/widget.css +39 -4
- package/dist/index.js +74 -1
- package/lib/components/accordion/Accordion.js +47 -13
- package/lib/components/accordion/index.js +18 -1
- package/lib/components/input/index.js +18 -1
- package/lib/components/input/input.js +11 -3
- package/lib/extension.js +18 -1
- package/lib/feature/feature-details/FeatureCorrelatedFeaturesTable.js +22 -0
- package/lib/feature/feature-details/FeatureDistributionChart.js +218 -0
- package/lib/feature/feature-details/FeatureStatisticsTable.js +44 -0
- package/lib/feature/feature-details/index.js +20 -0
- package/lib/feature/feature-explanation/FeatureExplanation.js +48 -0
- package/lib/feature/feature-explanation/components/ColoredExplanationBlock.js +36 -0
- package/lib/feature/feature-explanation/components/ColumnExplanationBlock.js +12 -0
- package/lib/feature/feature-explanation/components/DataSlotExplanationBlock.js +12 -0
- package/lib/feature/feature-explanation/components/PetExplanationBlock.js +11 -0
- package/lib/feature/feature-explanation/components/TextExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/TextWithDataSlotContextExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/TopicExplanationBlock.js +10 -0
- package/lib/feature/feature-explanation/components/UnknownExplanationBlock.js +10 -0
- package/lib/feature/feature-likes/feature-likes.js +38 -0
- package/lib/feature/feature-likes/index.js +18 -0
- package/lib/feature-descriptor/context/fd-domains-descriptions-selection.context.js +37 -0
- package/lib/feature-descriptor/context/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/column-tree-item.js +16 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/descriptions-tree-item.js +50 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/tree-item-label.js +56 -0
- package/lib/feature-descriptor/domains-descriptors-tree/components/type-tree-item.js +19 -0
- package/lib/feature-descriptor/domains-descriptors-tree/context/domains-descriptions-tree-item-selection-context.js +56 -0
- package/lib/feature-descriptor/domains-descriptors-tree/context/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/domains-descriptions-tree.js +44 -0
- package/lib/feature-descriptor/domains-descriptors-tree/index.js +21 -0
- package/lib/feature-descriptor/domains-descriptors-tree/models/domains-descriptions-tree.model.js +37 -0
- package/lib/feature-descriptor/domains-descriptors-tree/models/index.js +18 -0
- package/lib/feature-descriptor/domains-descriptors-tree/utils/create-domain-predicate.js +16 -0
- package/lib/feature-descriptor/domains-descriptors-tree/utils/filter-domains-descriptions-tree.js +23 -0
- package/lib/feature-descriptor/domains-descriptors-tree/utils/index.js +19 -0
- package/lib/feature-descriptor/feature-details/FeatureCorrelatedFeaturesTable.js +21 -13
- package/lib/feature-descriptor/feature-details/FeatureDistributionChart.js +36 -8
- package/lib/feature-descriptor/feature-details/FeatureStatisticsTable.js +25 -17
- package/lib/feature-descriptor/feature-details/index.js +20 -3
- package/lib/feature-descriptor/feature-explanation/FeatureExplanation.js +40 -32
- package/lib/feature-descriptor/feature-explanation/components/ColoredExplanationBlock.js +17 -9
- package/lib/feature-descriptor/feature-explanation/components/ColumnExplanationBlock.js +12 -4
- package/lib/feature-descriptor/feature-explanation/components/DataSlotExplanationBlock.js +12 -4
- package/lib/feature-descriptor/feature-explanation/components/PetExplanationBlock.js +11 -3
- package/lib/feature-descriptor/feature-explanation/components/TextExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-explanation/components/TextWithDataSlotContextExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-explanation/components/TopicExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-explanation/components/UnknownExplanationBlock.js +10 -2
- package/lib/feature-descriptor/feature-exploration-path/exploration-path-header.js +38 -0
- package/lib/feature-descriptor/feature-exploration-path/exploration-path-join-list.js +28 -0
- package/lib/feature-descriptor/feature-exploration-path/index.js +19 -0
- package/lib/feature-descriptors-domain/context/feature-domain-descriptions-selection.context.js +37 -0
- package/lib/feature-descriptors-domain/context/feature-domain-selection.context.js +37 -0
- package/lib/feature-descriptors-domain/context/index.js +19 -0
- package/lib/feature-descriptors-domain/exploration-path/exploration-path-header.js +15 -7
- package/lib/feature-descriptors-domain/exploration-path/exploration-path-join-list.js +11 -3
- package/lib/feature-descriptors-domain/exploration-path/index.js +19 -2
- package/lib/feature-descriptors-domain/fd-grouped-domain-tree.js +81 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/column-tree-item.js +17 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/descriptions-tree-item.js +49 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/selection-indicator-with-label.js +40 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/components/type-tree-item.js +16 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/feature-descriptor-domain-descriptions-context.js +43 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/feature-descriptor-domain-descriptions-tree.js +57 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/column-tree-item.js +17 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/description-tree-item.js +2 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/descriptions-tree-item.js +49 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/selection-indicator-with-label.js +19 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/tree-item-label.js +15 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/tree-level-item.js +54 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/components/type-tree-item.js +16 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/feature-descriptor-domain-descriptions-tree.js +55 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/feature-descriptor-domain-descriptions-tree.model.js +2 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/utils/filter-domain-descriptions.js +21 -0
- package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/utils/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-descriptor-grouped-domain-tree.js +87 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/column-tree-item.js +16 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/descriptions-tree-item.js +50 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/selection-indicator-with-label.js +67 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/components/type-tree-item.js +19 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/feature-domain-descriptions-context.js +37 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/feature-domain-descriptions-tree.js +51 -0
- package/lib/feature-descriptors-domain/feature-domain-descriptions/index.js +18 -0
- package/lib/feature-descriptors-domain/feature-exploration-path/exploration-path-header.js +38 -0
- package/lib/feature-descriptors-domain/feature-exploration-path/exploration-path-join-list.js +36 -0
- package/lib/feature-descriptors-domain/feature-exploration-path/index.js +19 -0
- package/lib/feature-descriptors-domain/grouped-domains-descriptions-list.js +28 -17
- package/lib/feature-descriptors-domain/selected-feature-domain-context.js +2 -0
- package/lib/feature-descriptors-domain/utils/filter-domain-descriptions.js +23 -0
- package/lib/feature-descriptors-domain/utils/filter-grouped-domain-descriptions.js +23 -0
- package/lib/feature-descriptors-domain/utils/index.js +18 -0
- package/lib/index.js +19 -2
- package/lib/models/column/column.js +3 -1
- package/lib/models/column/index.js +18 -1
- package/lib/models/feature/feature-histogram.js +8 -4
- package/lib/models/feature/feature-leaderboard.js +3 -1
- package/lib/models/feature/feature-metric.js +16 -0
- package/lib/models/feature/feature.js +3 -12
- package/lib/models/feature/index.js +20 -2
- package/lib/models/feature-descriptor/feature-descriptor.js +3 -0
- package/lib/models/feature-descriptor/feature-descriptors-domain.js +3 -0
- package/lib/models/feature-descriptor-domain/fd-domains-description.js +3 -0
- package/lib/models/feature-descriptor-domain/fd-join-description.js +3 -0
- package/lib/models/feature-descriptor-domain/index.js +19 -0
- package/lib/models/feature-descriptors-domain/fd-domain-description.js +9 -1
- package/lib/models/feature-descriptors-domain/fd-grouped-domain-descriptions.js +3 -1
- package/lib/models/feature-descriptors-domain/index.js +19 -2
- package/lib/models/feature-explanation/feature-explanation.model.js +6 -2
- package/lib/models/feature-explanation/index.js +18 -1
- package/lib/models/feature-leaderboard/feature-leaderboard.js +3 -1
- package/lib/models/feature-leaderboard/index.js +18 -1
- package/lib/models/feature-space/exploration-path.js +3 -0
- package/lib/models/feature-space/feature-space-description.js +3 -0
- package/lib/models/feature-space/feature-space.js +3 -1
- package/lib/models/feature-space/grouped-domains-descriptions.js +3 -0
- package/lib/models/feature-space/index.js +20 -1
- package/lib/models/index.js +1 -0
- package/lib/plugin.js +33 -7
- package/lib/utils/asserations.js +6 -1
- package/lib/utils/index.js +20 -3
- package/lib/utils/localize.js +8 -4
- package/lib/utils/model-transform-hook.js +21 -0
- package/lib/utils/object/extract-property.js +6 -1
- package/lib/utils/object/index.js +19 -2
- package/lib/utils/object/is-set.js +8 -2
- package/lib/utils/set.js +14 -0
- package/lib/utils/widget/index.js +19 -2
- package/lib/utils/widget/widget-model-context.js +36 -7
- package/lib/utils/widget/widget-model.js +14 -8
- package/lib/utils/widget-model/index.js +19 -0
- package/lib/utils/widget-model/widget-model-context.js +42 -0
- package/lib/utils/widget-model/widget-model.js +30 -0
- package/lib/utils/widget-theme/index.js +18 -0
- package/lib/utils/widget-theme/widget-theme.js +99 -0
- package/lib/version.js +6 -2
- package/lib/widgets/FeatureLeaderboardWidget.js +27 -15
- package/lib/widgets/FeatureSpaceWidget.js +27 -15
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardEntries.js +17 -9
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardOverview.js +15 -18
- package/lib/widgets/feature-leaderboard/FeatureLeaderboardView.js +26 -14
- package/lib/widgets/feature-leaderboard/components/leaderboard-feature-likes.js +50 -0
- package/lib/widgets/feature-leaderboard/entry-item/FeatureLeaderboardEntryDetails.js +22 -14
- package/lib/widgets/feature-leaderboard/entry-item/FeatureLeaderboardEntryHeader.js +35 -0
- package/lib/widgets/feature-leaderboard/entry-item/FeatureLeaderboardEntryItem.js +17 -15
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntry.js +22 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryDetails.js +23 -0
- package/lib/widgets/feature-leaderboard/leaderboard-entry/FeatureLeaderboardEntryRow.js +29 -0
- package/lib/widgets/feature-leaderboard/leaderboard-overview/overview-metric-slider.js +2 -0
- package/lib/widgets/feature-leaderboard/leaderboard-overview/overview-slider.js +62 -0
- package/lib/widgets/feature-space/FeatureDomainsDescriptions.js +82 -0
- package/lib/widgets/feature-space/FeatureExplorationPaths.js +14 -35
- package/lib/widgets/feature-space/FeatureSpaceDomain.js +75 -0
- package/lib/widgets/feature-space/FeatureSpaceDomainDescriptions.js +80 -0
- package/lib/widgets/feature-space/FeatureSpaceDomainsDescriptions.js +63 -28
- package/lib/widgets/feature-space/FeatureSpaceView.js +47 -10
- package/lib/widgets/index.js +20 -3
- package/package.json +8 -3
- package/LICENSE.txt +0 -27
- package/lib/hooks/index.js +0 -1
- package/lib/hooks/widget-model.js +0 -1
- package/lib/utils/widget/widget-context-wrapper.js +0 -9
- package/lib/widget.js +0 -34
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature-descriptor-domain-descriptions-tree"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterDomainDescriptions = void 0;
|
|
4
|
+
const isNotEmpty = (arr) => arr.length > 0;
|
|
5
|
+
function filterDomainDescriptions(domains, predicateFn) {
|
|
6
|
+
return {
|
|
7
|
+
types: domains.types
|
|
8
|
+
.map(({ summary, columns }) => ({
|
|
9
|
+
summary,
|
|
10
|
+
columns: columns
|
|
11
|
+
.map(column => ({
|
|
12
|
+
summary: column.summary,
|
|
13
|
+
descriptions: column.descriptions.filter(predicateFn),
|
|
14
|
+
}))
|
|
15
|
+
.filter(({ descriptions }) => isNotEmpty(descriptions)),
|
|
16
|
+
}))
|
|
17
|
+
.filter(({ columns }) => isNotEmpty(columns)),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
exports.filterDomainDescriptions = filterDomainDescriptions;
|
|
21
|
+
//# sourceMappingURL=filter-domain-descriptions.js.map
|
package/lib/feature-descriptors-domain/feature-descriptor-domain-descriptions-tree/utils/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./filter-domain-descriptions"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FeatureDescriptorGroupedDomainTree = exports.FeatureDescriptorGroupedDomainTreeHeader = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
10
|
+
const ChevronRight_1 = __importDefault(require("@mui/icons-material/ChevronRight"));
|
|
11
|
+
const components_1 = require("./feature-descriptor-domain-descriptions-tree/components");
|
|
12
|
+
const TreeView_1 = __importDefault(require("@mui/lab/TreeView"));
|
|
13
|
+
const TreeItem_1 = __importDefault(require("@mui/lab/TreeItem"));
|
|
14
|
+
const UnfoldLess_1 = __importDefault(require("@mui/icons-material/UnfoldLess"));
|
|
15
|
+
const UnfoldMore_1 = __importDefault(require("@mui/icons-material/UnfoldMore"));
|
|
16
|
+
// interface DomainDescriptionTreeLevel {
|
|
17
|
+
// label: string;
|
|
18
|
+
// items: DomainDescriptionTreeLevel[] | DomainDescription[];
|
|
19
|
+
// }
|
|
20
|
+
// type DomainDescriptionTreeView = DomainDescriptionTreeLevel[] | DomainDescription[];
|
|
21
|
+
// const aaa: DomainDescriptionTreeView = [{
|
|
22
|
+
// label: '3',
|
|
23
|
+
// id: 4
|
|
24
|
+
// }];
|
|
25
|
+
// console.log(aaa);
|
|
26
|
+
const hasOnlyOneItem = (arr) => arr.length === 1;
|
|
27
|
+
const Label = props => {
|
|
28
|
+
return (react_1.default.createElement(material_1.FormControlLabel, { className: "text-ellipsis", control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' } }), label: props.label }));
|
|
29
|
+
};
|
|
30
|
+
const ColumnTreeItem = ({ column, typeIdx, columnIdx, onLabelClick }) => {
|
|
31
|
+
return hasOnlyOneItem(column.descriptions) ? (
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
33
|
+
react_1.default.createElement(components_1.DescriptionsTreeItem, { descriptions: column.descriptions, onLabelClick: onLabelClick })) : (react_1.default.createElement(TreeItem_1.default, { nodeId: `type_${typeIdx}_column_${columnIdx}`, label: react_1.default.createElement(Label, { label: column.summary, onClick: label => onLabelClick(label, column.descriptions) }) },
|
|
34
|
+
react_1.default.createElement(components_1.DescriptionsTreeItem, { descriptions: column.descriptions, onLabelClick: onLabelClick })));
|
|
35
|
+
};
|
|
36
|
+
const TypeTreeItem = ({ type, typeIdx, onLabelClick }) => {
|
|
37
|
+
return hasOnlyOneItem(type.columns) ? (react_1.default.createElement(ColumnTreeItem, { typeIdx: typeIdx, columnIdx: 0, column: type.columns[0], onLabelClick: onLabelClick })) : (react_1.default.createElement(TreeItem_1.default, { nodeId: `type_${typeIdx}`, label: react_1.default.createElement(Label, { label: type.summary, onClick: onLabelClick }) }, type.columns.map((column, colIdx) => (react_1.default.createElement(ColumnTreeItem, { typeIdx: typeIdx, columnIdx: colIdx, column: column, onLabelClick: onLabelClick })))));
|
|
38
|
+
};
|
|
39
|
+
const FeatureDescriptorGroupedDomainTreeHeader = (props) => react_1.default.createElement(react_1.default.Fragment, null, props.children);
|
|
40
|
+
exports.FeatureDescriptorGroupedDomainTreeHeader = FeatureDescriptorGroupedDomainTreeHeader;
|
|
41
|
+
const FeatureDescriptorGroupedDomainTree = props => {
|
|
42
|
+
const [allDomainGroupIds] = react_1.default.useState(() => getAllDomainGroupIds(props.groupedDomain));
|
|
43
|
+
const [expanded, setExpanded] = react_1.default.useState(() => []);
|
|
44
|
+
const { types } = props.groupedDomain;
|
|
45
|
+
const handleToggle = (event, nodeIds) => {
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
event.stopPropagation();
|
|
48
|
+
// console.log(nodeIds);
|
|
49
|
+
setExpanded(nodeIds);
|
|
50
|
+
};
|
|
51
|
+
function toggleExpansion() {
|
|
52
|
+
if (expanded.length === 0) {
|
|
53
|
+
setExpanded(allDomainGroupIds);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
setExpanded([]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function onLabelClickCb(label, deps) {
|
|
60
|
+
// console.log(label, deps);
|
|
61
|
+
}
|
|
62
|
+
return (react_1.default.createElement("div", null,
|
|
63
|
+
react_1.default.createElement("div", { className: "feature-space-domain-header" },
|
|
64
|
+
react_1.default.createElement(material_1.Button, { variant: "outlined", sx: {
|
|
65
|
+
minWidth: 'revert',
|
|
66
|
+
paddingBlock: '2px',
|
|
67
|
+
paddingInline: '6px',
|
|
68
|
+
marginRight: '10px',
|
|
69
|
+
}, startIcon: allDomainGroupIds.length === expanded.length ? (react_1.default.createElement(UnfoldLess_1.default, { sx: { marginRight: '-10px' } })) : (react_1.default.createElement(UnfoldMore_1.default, { sx: { marginRight: '-10px' } })), onClick: () => toggleExpansion() }),
|
|
70
|
+
react_1.default.Children.toArray(props.children)
|
|
71
|
+
.filter(react_1.default.isValidElement)
|
|
72
|
+
.filter(child => child?.type === exports.FeatureDescriptorGroupedDomainTreeHeader)),
|
|
73
|
+
react_1.default.createElement("div", null,
|
|
74
|
+
react_1.default.createElement(TreeView_1.default, { defaultCollapseIcon: react_1.default.createElement(ExpandMore_1.default, null), defaultExpandIcon: react_1.default.createElement(ChevronRight_1.default, null), disabledItemsFocusable: false, multiSelect: true,
|
|
75
|
+
// disableSelection={true}
|
|
76
|
+
expanded: expanded, onNodeToggle: handleToggle }, types.map((type, typeIdx) => (react_1.default.createElement(TypeTreeItem, { type: type, typeIdx: typeIdx, onLabelClick: onLabelClickCb })))))));
|
|
77
|
+
};
|
|
78
|
+
exports.FeatureDescriptorGroupedDomainTree = FeatureDescriptorGroupedDomainTree;
|
|
79
|
+
function getAllDomainGroupIds(domains) {
|
|
80
|
+
return domains.types
|
|
81
|
+
.map(({ columns }, typeIdx) => [
|
|
82
|
+
`type_${typeIdx}`,
|
|
83
|
+
columns.map((_, columnIdx) => `type_${typeIdx}_column_${columnIdx}`),
|
|
84
|
+
])
|
|
85
|
+
.flat(2);
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=feature-descriptor-grouped-domain-tree.js.map
|
package/lib/feature-descriptors-domain/feature-domain-descriptions/components/column-tree-item.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ColumnTreeItem = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const TreeItem_1 = __importDefault(require("@mui/lab/TreeItem"));
|
|
9
|
+
const descriptions_tree_item_1 = require("./descriptions-tree-item");
|
|
10
|
+
const selection_indicator_with_label_1 = require("./selection-indicator-with-label");
|
|
11
|
+
const ColumnTreeItem = ({ column }) => {
|
|
12
|
+
return column.descriptions.length === 1 ? (react_1.default.createElement(descriptions_tree_item_1.DescriptionsTreeItem, { descriptions: column.descriptions })) : (react_1.default.createElement(TreeItem_1.default, { nodeId: column.uuid, label: react_1.default.createElement(selection_indicator_with_label_1.SelectionIndicatorWithLabel, { label: column.summary, id: column.uuid, managedDescriptions: column.descriptions }) },
|
|
13
|
+
react_1.default.createElement(descriptions_tree_item_1.DescriptionsTreeItem, { descriptions: column.descriptions })));
|
|
14
|
+
};
|
|
15
|
+
exports.ColumnTreeItem = ColumnTreeItem;
|
|
16
|
+
//# sourceMappingURL=column-tree-item.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DescriptionsTreeItem = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_virtual_1 = require("@tanstack/react-virtual");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const selection_indicator_with_label_1 = require("./selection-indicator-with-label");
|
|
11
|
+
const listLeftIndentation = '31px';
|
|
12
|
+
const DescriptionsVirtualList = ({ descriptions, }) => {
|
|
13
|
+
const parentRef = react_1.default.useRef(null);
|
|
14
|
+
const rowVirtualizer = (0, react_virtual_1.useVirtualizer)({
|
|
15
|
+
count: descriptions.length,
|
|
16
|
+
getScrollElement: () => parentRef.current,
|
|
17
|
+
estimateSize: () => 25,
|
|
18
|
+
overscan: 5,
|
|
19
|
+
});
|
|
20
|
+
return (react_1.default.createElement("div", { ref: parentRef, style: {
|
|
21
|
+
height: `${Math.min(25 * descriptions.length, 500)}px`,
|
|
22
|
+
overflowY: 'auto',
|
|
23
|
+
overflowX: 'hidden',
|
|
24
|
+
} },
|
|
25
|
+
react_1.default.createElement("div", { style: {
|
|
26
|
+
height: `${rowVirtualizer.getTotalSize()}px`,
|
|
27
|
+
position: 'relative',
|
|
28
|
+
} }, rowVirtualizer.getVirtualItems().map(virtualRow => (react_1.default.createElement("div", { key: virtualRow.index, style: {
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
top: 0,
|
|
31
|
+
right: 0,
|
|
32
|
+
left: listLeftIndentation,
|
|
33
|
+
height: `${virtualRow.size}px`,
|
|
34
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
35
|
+
} },
|
|
36
|
+
react_1.default.createElement(selection_indicator_with_label_1.SelectionIndicatorWithLabel, { label: descriptions[virtualRow.index].description, id: descriptions[virtualRow.index].uuid, managedDescriptions: [descriptions[virtualRow.index]] })))))));
|
|
37
|
+
};
|
|
38
|
+
const DescriptionsList = ({ descriptions }) => {
|
|
39
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, descriptions.map(description => (react_1.default.createElement(selection_indicator_with_label_1.SelectionIndicatorWithLabel, { key: description.id, label: description.description, id: description.uuid, managedDescriptions: [description] })))));
|
|
40
|
+
};
|
|
41
|
+
const DescriptionsTreeItem = ({ descriptions, }) => {
|
|
42
|
+
const [isVirtualListVisible, setIsVirtualListVisible] = react_1.default.useState(() => false);
|
|
43
|
+
const [limitedDescriptions] = react_1.default.useState(() => descriptions.length < 6 ? descriptions : descriptions.slice(0, 3));
|
|
44
|
+
const isWithShowMore = descriptions.length >= 6;
|
|
45
|
+
return isVirtualListVisible ? (react_1.default.createElement(DescriptionsVirtualList, { descriptions: descriptions })) : (react_1.default.createElement("div", { style: { marginLeft: listLeftIndentation } },
|
|
46
|
+
react_1.default.createElement(DescriptionsList, { descriptions: limitedDescriptions }),
|
|
47
|
+
isWithShowMore ? (react_1.default.createElement(material_1.Button, { sx: { textTransform: 'lowercase', display: 'block' }, size: "small", onClick: () => setIsVirtualListVisible(true) }, "more")) : null));
|
|
48
|
+
};
|
|
49
|
+
exports.DescriptionsTreeItem = DescriptionsTreeItem;
|
|
50
|
+
//# sourceMappingURL=descriptions-tree-item.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./type-tree-item"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SelectionIndicatorWithLabel = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const lodash_1 = require("lodash");
|
|
10
|
+
const _utils_1 = require("../../../utils");
|
|
11
|
+
const context_1 = require("../../context");
|
|
12
|
+
var SelectionIndicator;
|
|
13
|
+
(function (SelectionIndicator) {
|
|
14
|
+
SelectionIndicator["Checked"] = "checked";
|
|
15
|
+
SelectionIndicator["Unchecked"] = "unchecked";
|
|
16
|
+
SelectionIndicator["Indeterminate"] = "indeterminate";
|
|
17
|
+
})(SelectionIndicator || (SelectionIndicator = {}));
|
|
18
|
+
const SelectionIndicatorWithLabel = props => {
|
|
19
|
+
const [checked, setChecked] = react_1.default.useState(() => SelectionIndicator.Checked);
|
|
20
|
+
const [selectedDomainDescriptionsIds, setSelectedDomainDescriptionsIds] = (0, context_1.useFeatureDomainDescriptionsSelection)();
|
|
21
|
+
const [selectedDomains, setSelectedDomains] = (0, context_1.useFeatureDomainSelection)();
|
|
22
|
+
const handleChange = (isChecked) => {
|
|
23
|
+
const ids = isChecked
|
|
24
|
+
? (0, lodash_1.union)([
|
|
25
|
+
...selectedDomainDescriptionsIds,
|
|
26
|
+
...props.managedDescriptions.map((0, _utils_1.extractProperty)('id')),
|
|
27
|
+
])
|
|
28
|
+
: (0, lodash_1.without)(selectedDomainDescriptionsIds, ...props.managedDescriptions.map((0, _utils_1.extractProperty)('id')));
|
|
29
|
+
setSelectedDomainDescriptionsIds(ids);
|
|
30
|
+
};
|
|
31
|
+
react_1.default.useEffect(() => {
|
|
32
|
+
const managedNotSelectedIds = (0, lodash_1.without)(props.managedDescriptions.map((0, _utils_1.extractProperty)('id')), ...selectedDomainDescriptionsIds).length;
|
|
33
|
+
const areAllChecked = managedNotSelectedIds === 0;
|
|
34
|
+
const areAllUnselected = managedNotSelectedIds === props.managedDescriptions.length;
|
|
35
|
+
setChecked(areAllChecked
|
|
36
|
+
? SelectionIndicator.Checked
|
|
37
|
+
: areAllUnselected
|
|
38
|
+
? SelectionIndicator.Unchecked
|
|
39
|
+
: SelectionIndicator.Indeterminate);
|
|
40
|
+
}, [selectedDomainDescriptionsIds]);
|
|
41
|
+
function toggleDomainSelection() {
|
|
42
|
+
if ((0, _utils_1.isSet)(selectedDomains[props.id])) {
|
|
43
|
+
const { [props.id]: _remove, ...rest } = selectedDomains;
|
|
44
|
+
setSelectedDomains(rest);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
setSelectedDomains({
|
|
48
|
+
...selectedDomains,
|
|
49
|
+
[props.id]: (0, lodash_1.uniqBy)(props.managedDescriptions.flatMap((0, _utils_1.extractProperty)('domains')), JSON.stringify),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function isSelected() {
|
|
54
|
+
return (0, _utils_1.isSet)(selectedDomains[props.id]);
|
|
55
|
+
}
|
|
56
|
+
return (react_1.default.createElement(material_1.FormControlLabel, { className: `text-ellipsis selection-indicator ${isSelected() ? 'selected' : ''}`, sx: { display: 'block' }, control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' }, checked: checked === SelectionIndicator.Checked, indeterminate: checked === SelectionIndicator.Indeterminate, onClick: event => {
|
|
57
|
+
event.stopPropagation();
|
|
58
|
+
handleChange(event.target
|
|
59
|
+
.checked);
|
|
60
|
+
} }), label: props.label, onClick: event => {
|
|
61
|
+
toggleDomainSelection();
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
} }));
|
|
65
|
+
};
|
|
66
|
+
exports.SelectionIndicatorWithLabel = SelectionIndicatorWithLabel;
|
|
67
|
+
//# sourceMappingURL=selection-indicator-with-label.js.map
|
package/lib/feature-descriptors-domain/feature-domain-descriptions/components/type-tree-item.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TypeTreeItem = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const TreeItem_1 = __importDefault(require("@mui/lab/TreeItem"));
|
|
9
|
+
const column_tree_item_1 = require("./column-tree-item");
|
|
10
|
+
const selection_indicator_with_label_1 = require("./selection-indicator-with-label");
|
|
11
|
+
const _utils_1 = require("../../../utils");
|
|
12
|
+
const TypeTreeItem = ({ type }) => {
|
|
13
|
+
return type.columns.length === 1 ? (react_1.default.createElement(column_tree_item_1.ColumnTreeItem, { column: type.columns[0] })) : (react_1.default.createElement(TreeItem_1.default, { nodeId: type.uuid, classes: {
|
|
14
|
+
focused: 'tree-item-focused',
|
|
15
|
+
selected: 'tree-item-focused',
|
|
16
|
+
}, label: react_1.default.createElement(selection_indicator_with_label_1.SelectionIndicatorWithLabel, { label: type.summary, id: type.uuid, managedDescriptions: type.columns.flatMap((0, _utils_1.extractProperty)('descriptions')) }) }, type.columns.map((column, idx) => (react_1.default.createElement(column_tree_item_1.ColumnTreeItem, { key: column.summary, column: column })))));
|
|
17
|
+
};
|
|
18
|
+
exports.TypeTreeItem = TypeTreeItem;
|
|
19
|
+
//# sourceMappingURL=type-tree-item.js.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.useFeatureDomainDescriptorsSelection = exports.FeatureDomainDescriptorsSelectionContext = void 0;
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
exports.FeatureDomainDescriptorsSelectionContext = React.createContext(undefined);
|
|
29
|
+
function useFeatureDomainDescriptorsSelection() {
|
|
30
|
+
const context = React.useContext(exports.FeatureDomainDescriptorsSelectionContext);
|
|
31
|
+
if (context === undefined) {
|
|
32
|
+
throw new Error('useFeatureDomainDescriptorsSelection must be used within a FeatureDomainDescriptorsSelectionContext');
|
|
33
|
+
}
|
|
34
|
+
return context;
|
|
35
|
+
}
|
|
36
|
+
exports.useFeatureDomainDescriptorsSelection = useFeatureDomainDescriptorsSelection;
|
|
37
|
+
//# sourceMappingURL=feature-domain-descriptions-context.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FeatureDomainDescriptionsTree = exports.FeatureDomainDescriptionsTreeHeader = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const TreeView_1 = __importDefault(require("@mui/lab/TreeView"));
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
10
|
+
const UnfoldLess_1 = __importDefault(require("@mui/icons-material/UnfoldLess"));
|
|
11
|
+
const UnfoldMore_1 = __importDefault(require("@mui/icons-material/UnfoldMore"));
|
|
12
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
13
|
+
const ChevronRight_1 = __importDefault(require("@mui/icons-material/ChevronRight"));
|
|
14
|
+
const components_1 = require("./components");
|
|
15
|
+
const _utils_1 = require("../../utils");
|
|
16
|
+
const FeatureDomainDescriptionsTreeHeader = (props) => react_1.default.createElement(react_1.default.Fragment, null, props.children);
|
|
17
|
+
exports.FeatureDomainDescriptionsTreeHeader = FeatureDomainDescriptionsTreeHeader;
|
|
18
|
+
const FeatureDomainDescriptionsTree = props => {
|
|
19
|
+
const [allDomainGroupIds] = react_1.default.useState(() => getAllDomainGroupIds(props.groupedDomain));
|
|
20
|
+
const [expanded, setExpanded] = react_1.default.useState(() => []);
|
|
21
|
+
const { types } = props.groupedDomain;
|
|
22
|
+
const handleToggle = (event, nodeIds) => {
|
|
23
|
+
setExpanded(nodeIds);
|
|
24
|
+
};
|
|
25
|
+
function toggleExpansion() {
|
|
26
|
+
if (expanded.length === 0) {
|
|
27
|
+
setExpanded(allDomainGroupIds);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
setExpanded([]);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return (react_1.default.createElement("div", { className: "feature-domain-descriptions-tree" },
|
|
34
|
+
react_1.default.createElement("div", { className: "domain-descriptions-tree-header" },
|
|
35
|
+
react_1.default.createElement(material_1.Button, { className: "toggle-all-nodes-btn", variant: "outlined", startIcon: allDomainGroupIds.length === expanded.length ? (react_1.default.createElement(UnfoldLess_1.default, { sx: { marginRight: '-10px' } })) : (react_1.default.createElement(UnfoldMore_1.default, { sx: { marginRight: '-10px' } })), onClick: () => toggleExpansion() }),
|
|
36
|
+
react_1.default.Children.toArray(props.children)
|
|
37
|
+
.filter(react_1.default.isValidElement)
|
|
38
|
+
.filter(child => child?.type === exports.FeatureDomainDescriptionsTreeHeader)),
|
|
39
|
+
react_1.default.createElement("div", null,
|
|
40
|
+
react_1.default.createElement(TreeView_1.default, { defaultCollapseIcon: react_1.default.createElement(ExpandMore_1.default, null), defaultExpandIcon: react_1.default.createElement(ChevronRight_1.default, null), disabledItemsFocusable: false, multiSelect: true, expanded: expanded, onNodeToggle: handleToggle }, types.map(type => (react_1.default.createElement(components_1.TypeTreeItem, { key: type.uuid, type: type })))))));
|
|
41
|
+
};
|
|
42
|
+
exports.FeatureDomainDescriptionsTree = FeatureDomainDescriptionsTree;
|
|
43
|
+
function getAllDomainGroupIds(domains) {
|
|
44
|
+
return domains.types
|
|
45
|
+
.map(({ columns, uuid }, typeIdx) => [
|
|
46
|
+
uuid,
|
|
47
|
+
columns.map((0, _utils_1.extractProperty)('uuid')),
|
|
48
|
+
])
|
|
49
|
+
.flat(2);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=feature-domain-descriptions-tree.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./feature-domain-descriptions-tree"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExplorationPathHeader = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const ExplorationPathHeader = props => {
|
|
9
|
+
const { targetTable, sourceTable, targetColumns, sourceColumns } = props.explorationPath;
|
|
10
|
+
return (react_1.default.createElement("div", { style: {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
alignItems: 'baseline',
|
|
13
|
+
padding: '12px 16px',
|
|
14
|
+
gap: '8px',
|
|
15
|
+
background: 'var(--c-catskill-white)',
|
|
16
|
+
} },
|
|
17
|
+
react_1.default.createElement("h4", { className: "grey-label", style: { margin: 0 } },
|
|
18
|
+
"[#",
|
|
19
|
+
props.explorationPathIndex,
|
|
20
|
+
"]"),
|
|
21
|
+
react_1.default.createElement("div", null,
|
|
22
|
+
targetTable,
|
|
23
|
+
"[",
|
|
24
|
+
react_1.default.createElement("span", { style: {
|
|
25
|
+
color: 'var(--c-blue-700)',
|
|
26
|
+
fontWeight: '500',
|
|
27
|
+
} }, targetColumns.join(', ')),
|
|
28
|
+
"] - ",
|
|
29
|
+
sourceTable,
|
|
30
|
+
"[",
|
|
31
|
+
react_1.default.createElement("span", { style: {
|
|
32
|
+
color: 'var(--c-blue-700)',
|
|
33
|
+
fontWeight: '500',
|
|
34
|
+
} }, sourceColumns.join(', ')),
|
|
35
|
+
"]")));
|
|
36
|
+
};
|
|
37
|
+
exports.ExplorationPathHeader = ExplorationPathHeader;
|
|
38
|
+
//# sourceMappingURL=exploration-path-header.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ExplorationPathJoinList = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const context_1 = require("../context");
|
|
9
|
+
const _utils_1 = require("../../utils");
|
|
10
|
+
const joinId = (join) => `join_${join.joinId}`;
|
|
11
|
+
const ExplorationPathJoinList = props => {
|
|
12
|
+
const [selectedDomains, setSelectedDomain] = (0, context_1.useFeatureDomainSelection)();
|
|
13
|
+
const isJoinSelected = (join) => !!selectedDomains[joinId(join)];
|
|
14
|
+
function toggleJoinSelection(join) {
|
|
15
|
+
const id = joinId(join);
|
|
16
|
+
if ((0, _utils_1.isSet)(selectedDomains[id])) {
|
|
17
|
+
const { [id]: _remove, ...rest } = selectedDomains;
|
|
18
|
+
setSelectedDomain(rest);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
setSelectedDomain({ ...selectedDomains, [id]: [join.joinId] });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
25
|
+
react_1.default.createElement("h4", null, "Joins (# of features)"),
|
|
26
|
+
react_1.default.createElement("div", { style: { columns: 3 } }, props.joins.map((join, idx) => (react_1.default.createElement("div", { key: join.joinId, className: `exploration-path-join ${isJoinSelected(join) ? 'selected' : ''}`, onClick: () => toggleJoinSelection(join) },
|
|
27
|
+
"[",
|
|
28
|
+
join.joinId,
|
|
29
|
+
"] ",
|
|
30
|
+
join.description,
|
|
31
|
+
" (",
|
|
32
|
+
join.numFeatures,
|
|
33
|
+
")"))))));
|
|
34
|
+
};
|
|
35
|
+
exports.ExplorationPathJoinList = ExplorationPathJoinList;
|
|
36
|
+
//# sourceMappingURL=exploration-path-join-list.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./exploration-path-header"), exports);
|
|
18
|
+
__exportStar(require("./exploration-path-join-list"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GroupedDomainsDescriptionsList = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const accordion_1 = require("../components/accordion");
|
|
9
|
+
const material_1 = require("@mui/material");
|
|
3
10
|
const listStyle = {
|
|
4
11
|
paddingLeft: 0,
|
|
5
12
|
listStyleType: 'none',
|
|
@@ -24,24 +31,28 @@ const accordionProps = {
|
|
|
24
31
|
const ColumnDescriptions = props => {
|
|
25
32
|
const onlyOneDescription = props.column.descriptions.length === 1;
|
|
26
33
|
const firstDescription = props.column.descriptions[0];
|
|
27
|
-
return onlyOneDescription ? (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
return onlyOneDescription ? (react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' } }), label: firstDescription.description })) : (react_1.default.createElement("div", null,
|
|
35
|
+
react_1.default.createElement(accordion_1.Accordion, { ...accordionProps },
|
|
36
|
+
react_1.default.createElement(accordion_1.AccordionHeader, null,
|
|
37
|
+
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' } }), label: props.column.summary })),
|
|
38
|
+
react_1.default.createElement(accordion_1.AccordionDetails, null,
|
|
39
|
+
react_1.default.createElement("ul", { style: listStyle }, props.column.descriptions.map(({ description }) => (react_1.default.createElement("li", { key: description, style: { display: 'flex' } },
|
|
40
|
+
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' } }), label: description })))))))));
|
|
33
41
|
};
|
|
34
42
|
const TypeColumns = props => {
|
|
35
43
|
const onlyOneColumn = props.type.columns.length === 1;
|
|
36
44
|
const firstColumn = props.type.columns[0];
|
|
37
|
-
return onlyOneColumn ? (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
+
return onlyOneColumn ? (react_1.default.createElement("div", { style: { display: 'flex' } },
|
|
46
|
+
react_1.default.createElement(ColumnDescriptions, { column: firstColumn }))) : (react_1.default.createElement("div", null,
|
|
47
|
+
react_1.default.createElement(accordion_1.Accordion, { ...accordionProps },
|
|
48
|
+
react_1.default.createElement(accordion_1.AccordionHeader, null,
|
|
49
|
+
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { sx: { paddingBlock: '2px' } }), label: props.type.summary })),
|
|
50
|
+
react_1.default.createElement(accordion_1.AccordionDetails, null,
|
|
51
|
+
react_1.default.createElement("ul", { style: listStyle }, props.type.columns.map((column, idx) => (react_1.default.createElement("li", { key: idx, style: { display: 'flex' } }, react_1.default.createElement(ColumnDescriptions, { column: column })))))))));
|
|
52
|
+
};
|
|
53
|
+
const GroupedDomainsDescriptionsList = props => {
|
|
45
54
|
const { types } = props.groupedDomain;
|
|
46
|
-
return (
|
|
55
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, types.map(type => (react_1.default.createElement(TypeColumns, { key: type.summary, type: type })))));
|
|
47
56
|
};
|
|
57
|
+
exports.GroupedDomainsDescriptionsList = GroupedDomainsDescriptionsList;
|
|
58
|
+
//# sourceMappingURL=grouped-domains-descriptions-list.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterDomainDescriptions = void 0;
|
|
4
|
+
const isNotEmpty = (arr) => arr.length > 0;
|
|
5
|
+
function filterDomainDescriptions(domains, predicateFn) {
|
|
6
|
+
return {
|
|
7
|
+
types: domains.types
|
|
8
|
+
.map(({ summary, columns, uuid }) => ({
|
|
9
|
+
summary,
|
|
10
|
+
uuid,
|
|
11
|
+
columns: columns
|
|
12
|
+
.map(column => ({
|
|
13
|
+
summary: column.summary,
|
|
14
|
+
uuid: column.uuid,
|
|
15
|
+
descriptions: column.descriptions.filter(predicateFn),
|
|
16
|
+
}))
|
|
17
|
+
.filter(({ descriptions }) => isNotEmpty(descriptions)),
|
|
18
|
+
}))
|
|
19
|
+
.filter(({ columns }) => isNotEmpty(columns)),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.filterDomainDescriptions = filterDomainDescriptions;
|
|
23
|
+
//# sourceMappingURL=filter-domain-descriptions.js.map
|