@reltio/components 1.4.2051 → 1.4.2052
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/AttributeListItem/AttributeListItem.d.ts +1 -1
- package/ChartTooltip/ChartTooltip.js +3 -3
- package/ColumnsSettings/components/ColumnListItem/ColumnListItem.d.ts +11 -26
- package/ColumnsSettings/components/ColumnListItem/ColumnListItem.js +0 -14
- package/DropDownMenuButton/DropDownMenuButton.js +1 -1
- package/HOCs/withAsyncMount/withAsyncMount.test.js +52 -52
- package/IgnoreButton/IgnoreButton.spec.js +109 -20
- package/Image/Image.d.ts +1 -1
- package/Image/Image.js +8 -8
- package/Image/Image.test.js +46 -51
- package/ImageActionsOverlay/ImageActionsOverlay.js +2 -1
- package/ImageActionsOverlay/ImageActionsOverlay.test.js +207 -125
- package/ImageActionsOverlay/components/CheckedIcon/CheckedIcon.js +1 -1
- package/ImageAttributesGallery/ImageAttributesGallery.test.js +525 -281
- package/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/ImageAttributesLine/ImageAttributesLine.test.js +187 -193
- package/ImageAttributesLine/imageAttributeValues.test-data.d.ts +10 -0
- package/ImageAttributesLine/imageAttributeValues.test-data.js +22 -0
- package/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +315 -298
- package/ImageDetailsView/ImageDetailsView.test.js +529 -55
- package/ImageDetailsView/attributes.test-data.d.ts +4 -1
- package/ImageDetailsView/attributes.test-data.js +98 -1
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +2 -2
- package/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.js +1 -1
- package/ImageDetailsView/components/MetaInfoList/MetaInfoList.js +1 -1
- package/ImageDetailsView/components/Thumbnails/Thumbnails.js +1 -1
- package/ImageDetailsView/helpers.test.js +4 -4
- package/ImageGalleryDialog/ImageGalleryDialog.test.js +89 -46
- package/ImportButton/ImportButton.test.js +94 -24
- package/InlineAttributesList/InlineAttributesList.test.js +22 -62
- package/InlineAttributesList/attributes.test-data.d.ts +4 -2
- package/InlineAttributesList/attributes.test-data.js +40 -1
- package/InlineAttributesPager/InlineAttributesPager.d.ts +1 -2
- package/InlineAttributesPager/InlineAttributesPager.js +1 -4
- package/InlineAttributesPager/InlineAttributesPager.test.js +393 -183
- package/InlineComplexAttribute/InlineComplexAttribute.js +1 -1
- package/InlineComplexAttribute/InlineComplexAttribute.test.js +396 -182
- package/InlineImageAttribute/InlineImageAttribute.test.js +103 -55
- package/InlineNestedAttribute/InlineNestedAttribute.test.js +105 -43
- package/InlineReferenceAttribute/InlineReferenceAttribute.test.js +165 -107
- package/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +352 -346
- package/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.test.js +285 -194
- package/InternalLink/InternalLink.test.js +41 -11
- package/LookupEditor/LookupEditor.test.js +180 -44
- package/LookupEditor/components/GroupedDropDownEditor/helpers.test.js +1 -1
- package/MapChart/MapChart.js +3 -8
- package/MapChart/MapChart.test.js +152 -188
- package/MapChart/components/Legend/Legend.js +3 -3
- package/MaskingSwitcher/MaskingSwitcher.js +1 -1
- package/MatchRulesBadge/MatchRulesBadge.test.js +93 -24
- package/SelectEditor/SelectEditor.d.ts +4 -10
- package/SelectEditor/SelectEditor.js +0 -4
- package/SelectEditor/SelectEditor.test.js +79 -9
- package/cjs/AttributeListItem/AttributeListItem.d.ts +1 -1
- package/cjs/ChartTooltip/ChartTooltip.js +3 -3
- package/cjs/ColumnsSettings/components/ColumnListItem/ColumnListItem.d.ts +11 -26
- package/cjs/ColumnsSettings/components/ColumnListItem/ColumnListItem.js +0 -14
- package/cjs/DropDownMenuButton/DropDownMenuButton.js +1 -1
- package/cjs/HOCs/withAsyncMount/withAsyncMount.test.js +56 -56
- package/cjs/IgnoreButton/IgnoreButton.spec.js +109 -20
- package/cjs/Image/Image.d.ts +1 -1
- package/cjs/Image/Image.js +8 -8
- package/cjs/Image/Image.test.js +46 -51
- package/cjs/ImageActionsOverlay/ImageActionsOverlay.js +2 -1
- package/cjs/ImageActionsOverlay/ImageActionsOverlay.test.js +207 -125
- package/cjs/ImageActionsOverlay/components/CheckedIcon/CheckedIcon.js +1 -1
- package/cjs/ImageAttributesGallery/ImageAttributesGallery.test.js +525 -281
- package/cjs/ImageAttributesLine/ImageAttributesLine.js +1 -1
- package/cjs/ImageAttributesLine/ImageAttributesLine.test.js +195 -224
- package/cjs/ImageAttributesLine/imageAttributeValues.test-data.d.ts +10 -0
- package/cjs/ImageAttributesLine/imageAttributeValues.test-data.js +23 -1
- package/cjs/ImageAttributesLineEditor/ImageAttributesLineEditor.test.js +316 -299
- package/cjs/ImageDetailsView/ImageDetailsView.test.js +529 -55
- package/cjs/ImageDetailsView/attributes.test-data.d.ts +4 -1
- package/cjs/ImageDetailsView/attributes.test-data.js +99 -2
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.js +2 -2
- package/cjs/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.js +1 -1
- package/cjs/ImageDetailsView/components/MetaInfoList/MetaInfoList.js +1 -1
- package/cjs/ImageDetailsView/components/Thumbnails/Thumbnails.js +1 -1
- package/cjs/ImageDetailsView/helpers.test.js +3 -3
- package/cjs/ImageGalleryDialog/ImageGalleryDialog.test.js +89 -46
- package/cjs/ImportButton/ImportButton.test.js +94 -24
- package/cjs/InlineAttributesList/InlineAttributesList.test.js +22 -62
- package/cjs/InlineAttributesList/attributes.test-data.d.ts +4 -2
- package/cjs/InlineAttributesList/attributes.test-data.js +41 -2
- package/cjs/InlineAttributesPager/InlineAttributesPager.d.ts +1 -2
- package/cjs/InlineAttributesPager/InlineAttributesPager.js +1 -4
- package/cjs/InlineAttributesPager/InlineAttributesPager.test.js +393 -183
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.js +1 -1
- package/cjs/InlineComplexAttribute/InlineComplexAttribute.test.js +395 -204
- package/cjs/InlineImageAttribute/InlineImageAttribute.test.js +103 -55
- package/cjs/InlineNestedAttribute/InlineNestedAttribute.test.js +105 -43
- package/cjs/InlineReferenceAttribute/InlineReferenceAttribute.test.js +164 -106
- package/cjs/InlineSimpleAttribute/InlineSimpleAttribute.spec.js +351 -345
- package/cjs/InlineSimpleAttributeEditor/InlineSimpleAttributeEditor.test.js +307 -193
- package/cjs/InternalLink/InternalLink.test.js +40 -10
- package/cjs/LookupEditor/LookupEditor.test.js +178 -65
- package/cjs/LookupEditor/components/GroupedDropDownEditor/helpers.test.js +1 -1
- package/cjs/MapChart/MapChart.js +3 -8
- package/cjs/MapChart/MapChart.test.js +152 -188
- package/cjs/MapChart/components/Legend/Legend.js +3 -3
- package/cjs/MaskingSwitcher/MaskingSwitcher.js +1 -1
- package/cjs/MatchRulesBadge/MatchRulesBadge.test.js +93 -24
- package/cjs/SelectEditor/SelectEditor.d.ts +4 -10
- package/cjs/SelectEditor/SelectEditor.js +0 -4
- package/cjs/SelectEditor/SelectEditor.test.js +79 -9
- package/cjs/hooks/useAsyncMount/useAsyncMount.d.ts +1 -1
- package/cjs/hooks/useAsyncMount/useAsyncMount.js +1 -1
- package/hooks/useAsyncMount/useAsyncMount.d.ts +1 -1
- package/hooks/useAsyncMount/useAsyncMount.js +1 -1
- package/package.json +1 -1
- package/HOCs/withTableContext/withTableContext.test.d.ts +0 -1
- package/HOCs/withTableContext/withTableContext.test.js +0 -41
- package/ImageAttributesGallery/components/GalleryView/GalleryView.test.d.ts +0 -1
- package/ImageAttributesGallery/components/GalleryView/GalleryView.test.js +0 -98
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.d.ts +0 -1
- package/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.js +0 -99
- package/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.d.ts +0 -1
- package/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.js +0 -65
- package/ImageDetailsView/components/MetaInfo/MetaInfo.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfo/MetaInfo.test.js +0 -306
- package/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.js +0 -134
- package/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.js +0 -99
- package/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.js +0 -36
- package/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.d.ts +0 -1
- package/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.js +0 -161
- package/ImageDetailsView/components/Thumbnails/Thumbnails.test.d.ts +0 -1
- package/ImageDetailsView/components/Thumbnails/Thumbnails.test.js +0 -76
- package/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.d.ts +0 -1
- package/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.js +0 -104
- package/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.d.ts +0 -1
- package/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +0 -114
- package/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.d.ts +0 -1
- package/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.js +0 -177
- package/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.d.ts +0 -1
- package/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.js +0 -52
- package/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.d.ts +0 -1
- package/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +0 -37
- package/cjs/HOCs/withTableContext/withTableContext.test.d.ts +0 -1
- package/cjs/HOCs/withTableContext/withTableContext.test.js +0 -46
- package/cjs/ImageAttributesGallery/components/GalleryView/GalleryView.test.d.ts +0 -1
- package/cjs/ImageAttributesGallery/components/GalleryView/GalleryView.test.js +0 -103
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/ImageDetailsViewCarousel/ImageDetailsViewCarousel.test.js +0 -104
- package/cjs/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/ImageDetailsViewSidebar/ImageDetailsViewSidebar.test.js +0 -70
- package/cjs/ImageDetailsView/components/MetaInfo/MetaInfo.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfo/MetaInfo.test.js +0 -311
- package/cjs/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoForm/MetaInfoForm.test.js +0 -139
- package/cjs/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoHeader/MetaInfoHeader.test.js +0 -104
- package/cjs/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoItem/MetaInfoItem.test.js +0 -41
- package/cjs/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/MetaInfoList/MetaInfoList.test.js +0 -166
- package/cjs/ImageDetailsView/components/Thumbnails/Thumbnails.test.d.ts +0 -1
- package/cjs/ImageDetailsView/components/Thumbnails/Thumbnails.test.js +0 -81
- package/cjs/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.d.ts +0 -1
- package/cjs/InlineAttributesPager/components/InlineImageAttributesBlock/InlineImageAttributesBlock.test.js +0 -109
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.d.ts +0 -1
- package/cjs/InlineAttributesPager/components/InlineNestedAttributesBlock/InlineNestedAttributesBlock.test.js +0 -119
- package/cjs/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.d.ts +0 -1
- package/cjs/InlineAttributesPager/components/InlineReferenceAttributesBlock/InlineReferenceAttributesBlock.test.js +0 -182
- package/cjs/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.d.ts +0 -1
- package/cjs/InlineSimpleAttribute/components/CrosswalkMenuItem/CrosswalkMenuItem.spec.js +0 -57
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.d.ts +0 -1
- package/cjs/LookupEditor/components/GroupedDropDownEditor/GroupedDropDownEditor.test.js +0 -42
|
@@ -51,201 +51,178 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
51
|
};
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
53
|
var react_1 = __importDefault(require("react"));
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var MapChart_1 = __importDefault(require("./MapChart"));
|
|
57
|
-
var recharts_1 = require("recharts");
|
|
58
|
-
var Legend_1 = require("./components/Legend");
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
59
56
|
var constants_1 = require("./constants");
|
|
60
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
var react_simple_maps_1 = require("react-simple-maps");
|
|
63
57
|
var PageRequestsAbortingContext_1 = require("../contexts/PageRequestsAbortingContext");
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
[
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
iso_n3: '008',
|
|
104
|
-
name: 'Albania',
|
|
105
|
-
iso_a3: 'ALB',
|
|
106
|
-
iso_a2: 'AL'
|
|
107
|
-
},
|
|
108
|
-
arcs: [[0]]
|
|
58
|
+
var MapChart_1 = __importDefault(require("./MapChart"));
|
|
59
|
+
var data = [
|
|
60
|
+
{ label: 'first', value: 1, percent: 1, group: 'AL' },
|
|
61
|
+
{ label: 'second', value: 2, percent: 99, group: 'AD' }
|
|
62
|
+
];
|
|
63
|
+
var defaultProps = {
|
|
64
|
+
data: data,
|
|
65
|
+
width: 600,
|
|
66
|
+
height: 300,
|
|
67
|
+
options: { geoUrl: 'some/geo/url', geoIdName: 'iso_a2' }
|
|
68
|
+
};
|
|
69
|
+
var geography = {
|
|
70
|
+
type: 'Topology',
|
|
71
|
+
arcs: [
|
|
72
|
+
[
|
|
73
|
+
[5840, 2515],
|
|
74
|
+
[5, -5],
|
|
75
|
+
[10, -26],
|
|
76
|
+
[6, -22],
|
|
77
|
+
[13, -7],
|
|
78
|
+
[7, -9],
|
|
79
|
+
[10, -13],
|
|
80
|
+
[4, -13],
|
|
81
|
+
[6, -40],
|
|
82
|
+
[1, -25],
|
|
83
|
+
[-2, -11]
|
|
84
|
+
]
|
|
85
|
+
],
|
|
86
|
+
objects: {
|
|
87
|
+
europe: {
|
|
88
|
+
type: 'GeometryCollection',
|
|
89
|
+
geometries: [
|
|
90
|
+
{
|
|
91
|
+
type: 'Polygon',
|
|
92
|
+
properties: {
|
|
93
|
+
iso_n3: '008',
|
|
94
|
+
name: 'Albania',
|
|
95
|
+
iso_a3: 'ALB',
|
|
96
|
+
iso_a2: 'AL'
|
|
109
97
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
98
|
+
arcs: [[0]]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: 'Polygon',
|
|
102
|
+
properties: {
|
|
103
|
+
iso_n3: '020',
|
|
104
|
+
name: 'Andorra',
|
|
105
|
+
iso_a3: 'AND',
|
|
106
|
+
iso_a2: 'AD'
|
|
107
|
+
},
|
|
108
|
+
arcs: [[0]]
|
|
109
|
+
}
|
|
110
|
+
]
|
|
122
111
|
}
|
|
123
|
-
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
describe('MapChart', function () {
|
|
115
|
+
var signal = new AbortController().signal;
|
|
124
116
|
beforeAll(function () {
|
|
125
|
-
jest.spyOn(window, 'fetch').mockResolvedValue({
|
|
126
|
-
ok: true,
|
|
127
|
-
json: function () { return Promise.resolve(geography); }
|
|
128
|
-
});
|
|
117
|
+
jest.spyOn(window, 'fetch').mockResolvedValue({ ok: true, json: function () { return Promise.resolve(geography); } });
|
|
129
118
|
});
|
|
119
|
+
var setUp = function (props) {
|
|
120
|
+
if (props === void 0) { props = {}; }
|
|
121
|
+
var user = user_event_1.default.setup();
|
|
122
|
+
var Providers = function (_a) {
|
|
123
|
+
var children = _a.children;
|
|
124
|
+
return (react_1.default.createElement(PageRequestsAbortingContext_1.PageRequestsAbortingContext.Provider, { value: signal }, children));
|
|
125
|
+
};
|
|
126
|
+
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(MapChart_1.default, __assign({}, defaultProps, props)), { wrapper: Providers }));
|
|
127
|
+
};
|
|
130
128
|
it('should render ComposableMap with Geographies, Legend and Tooltip', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
131
|
-
var
|
|
132
|
-
return __generator(this, function (
|
|
133
|
-
switch (
|
|
134
|
-
case 0:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
129
|
+
var user, mapChart, mapChartSvg, _a, firstGeo, secondGeo;
|
|
130
|
+
return __generator(this, function (_b) {
|
|
131
|
+
switch (_b.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
user = setUp().user;
|
|
134
|
+
expect(window.fetch).toHaveBeenCalledWith(defaultProps.options.geoUrl, { signal: signal });
|
|
135
|
+
mapChart = react_2.screen.getByTestId('map-chart');
|
|
136
|
+
mapChartSvg = mapChart.querySelector('svg');
|
|
137
|
+
expect(mapChart).toHaveStyle({ width: "".concat(defaultProps.width, "px"), height: "".concat(defaultProps.height, "px") });
|
|
138
|
+
expect(mapChartSvg).toHaveAttribute('width', "".concat(defaultProps.width - constants_1.LEGEND_WIDTH));
|
|
139
|
+
expect(mapChartSvg).toHaveAttribute('height', "".concat(defaultProps.height));
|
|
140
|
+
return [4 /*yield*/, react_2.screen.findAllByTestId('map-geography')];
|
|
141
141
|
case 1:
|
|
142
|
-
_a.sent();
|
|
143
|
-
|
|
144
|
-
expect(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
expect(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
});
|
|
156
|
-
expect(map.find(react_simple_maps_1.Geographies).prop('geography')).toBe(geography);
|
|
157
|
-
g = map.find(react_simple_maps_1.Geography);
|
|
158
|
-
expect(g).toHaveLength(2);
|
|
159
|
-
expect(g.first().prop('fill')).toBe('rgb(205, 224, 254)'); //#CDE0FE
|
|
160
|
-
expect(g.last().prop('fill')).toBe('rgb(1, 96, 173)'); //#0160AD
|
|
161
|
-
expect(wrapper.find(Legend_1.Legend).props()).toMatchObject({
|
|
162
|
-
width: constants_1.LEGEND_WIDTH,
|
|
163
|
-
minValue: 1,
|
|
164
|
-
maxValue: 2
|
|
165
|
-
});
|
|
166
|
-
expect(wrapper.find(recharts_1.Tooltip)).toHaveLength(1);
|
|
142
|
+
_a = _b.sent(), firstGeo = _a[0], secondGeo = _a[1];
|
|
143
|
+
expect(firstGeo).toHaveAttribute('fill', 'rgb(205, 224, 254)');
|
|
144
|
+
expect(secondGeo).toHaveAttribute('fill', 'rgb(1, 96, 173)');
|
|
145
|
+
expect(react_2.screen.getByTestId('map-chart-legend')).toBeInTheDocument();
|
|
146
|
+
expect(react_2.screen.getByTestId('max-legend-metric')).toHaveTextContent('2');
|
|
147
|
+
expect(react_2.screen.getByTestId('min-legend-metric')).toHaveTextContent('1');
|
|
148
|
+
expect(react_2.screen.queryByText('first')).not.toBeInTheDocument();
|
|
149
|
+
return [4 /*yield*/, user.hover(firstGeo)];
|
|
150
|
+
case 2:
|
|
151
|
+
_b.sent();
|
|
152
|
+
expect(react_2.screen.getByTestId('chart-tooltip')).toBeInTheDocument();
|
|
153
|
+
expect(react_2.screen.getByText('first')).toBeInTheDocument();
|
|
154
|
+
expect(react_2.screen.getByTestId('chart-tooltip-value')).toHaveTextContent('1 (33.3%)');
|
|
167
155
|
return [2 /*return*/];
|
|
168
156
|
}
|
|
169
157
|
});
|
|
170
158
|
}); });
|
|
171
159
|
it('should not fail and use default projection when it is empty string', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
|
-
var
|
|
173
|
-
return __generator(this, function (
|
|
174
|
-
switch (
|
|
175
|
-
case 0:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
projection: ''
|
|
181
|
-
} })));
|
|
182
|
-
return [2 /*return*/];
|
|
183
|
-
});
|
|
184
|
-
}); })];
|
|
160
|
+
var _a;
|
|
161
|
+
return __generator(this, function (_b) {
|
|
162
|
+
switch (_b.label) {
|
|
163
|
+
case 0:
|
|
164
|
+
setUp({ options: __assign(__assign({}, defaultProps.options), { projection: '' }) });
|
|
165
|
+
expect(window.fetch).toHaveBeenCalledWith(defaultProps.options.geoUrl, { signal: signal });
|
|
166
|
+
_a = expect;
|
|
167
|
+
return [4 /*yield*/, react_2.screen.findAllByTestId('map-geography')];
|
|
185
168
|
case 1:
|
|
186
|
-
_a.sent();
|
|
187
|
-
|
|
188
|
-
mapProvider = wrapper.find(react_simple_maps_1.MapProvider);
|
|
189
|
-
expect(mapProvider).toHaveLength(1);
|
|
190
|
-
expect(mapProvider.find('svg')).toHaveLength(1);
|
|
191
|
-
expect(mapProvider.find(react_simple_maps_1.Geographies).prop('geography')).toBe(geography);
|
|
169
|
+
_a.apply(void 0, [_b.sent()]).toHaveLength(2);
|
|
170
|
+
expect(react_2.screen.getByTestId('map-chart')).toBeInTheDocument();
|
|
192
171
|
return [2 /*return*/];
|
|
193
172
|
}
|
|
194
173
|
});
|
|
195
174
|
}); });
|
|
196
175
|
it('should not fail and use default projection when it is incorrect', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
197
|
-
var
|
|
198
|
-
return __generator(this, function (
|
|
199
|
-
switch (
|
|
200
|
-
case 0:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
projection: 'wrong'
|
|
206
|
-
} })));
|
|
207
|
-
return [2 /*return*/];
|
|
208
|
-
});
|
|
209
|
-
}); })];
|
|
176
|
+
var _a;
|
|
177
|
+
return __generator(this, function (_b) {
|
|
178
|
+
switch (_b.label) {
|
|
179
|
+
case 0:
|
|
180
|
+
setUp({ options: __assign(__assign({}, defaultProps.options), { projection: 'wrong' }) });
|
|
181
|
+
expect(window.fetch).toHaveBeenCalledWith(defaultProps.options.geoUrl, { signal: signal });
|
|
182
|
+
_a = expect;
|
|
183
|
+
return [4 /*yield*/, react_2.screen.findAllByTestId('map-geography')];
|
|
210
184
|
case 1:
|
|
211
|
-
_a.sent();
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
185
|
+
_a.apply(void 0, [_b.sent()]).toHaveLength(2);
|
|
186
|
+
expect(react_2.screen.getByTestId('map-chart')).toBeInTheDocument();
|
|
187
|
+
return [2 /*return*/];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}); });
|
|
191
|
+
it('should not render Legend when props.options.showLegend = false', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
192
|
+
var _a;
|
|
193
|
+
return __generator(this, function (_b) {
|
|
194
|
+
switch (_b.label) {
|
|
195
|
+
case 0:
|
|
196
|
+
setUp({ options: __assign(__assign({}, defaultProps.options), { showLegend: false }) });
|
|
197
|
+
_a = expect;
|
|
198
|
+
return [4 /*yield*/, react_2.screen.findAllByTestId('map-geography')];
|
|
199
|
+
case 1:
|
|
200
|
+
_a.apply(void 0, [_b.sent()]).toHaveLength(2);
|
|
201
|
+
expect(react_2.screen.queryByTestId('map-chart-legend')).not.toBeInTheDocument();
|
|
217
202
|
return [2 /*return*/];
|
|
218
203
|
}
|
|
219
204
|
});
|
|
220
205
|
}); });
|
|
221
|
-
it('should not render Legend when props.options.showLegend = false', function () {
|
|
222
|
-
var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(MapChart_1.default, __assign({}, props, { options: { showLegend: false } })));
|
|
223
|
-
expect(wrapper.find(Legend_1.Legend)).toHaveLength(0);
|
|
224
|
-
});
|
|
225
206
|
it('should call props.onItemClick on geography click', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
226
|
-
var onItemClick,
|
|
207
|
+
var onItemClick, user, firstGeo;
|
|
227
208
|
return __generator(this, function (_a) {
|
|
228
209
|
switch (_a.label) {
|
|
229
210
|
case 0:
|
|
230
211
|
onItemClick = jest.fn();
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
wrapper = (0, enzyme_1.mount)(react_1.default.createElement(MapChart_1.default, __assign({}, props, { onItemClick: onItemClick })));
|
|
234
|
-
return [2 /*return*/];
|
|
235
|
-
});
|
|
236
|
-
}); })];
|
|
212
|
+
user = setUp({ onItemClick: onItemClick }).user;
|
|
213
|
+
return [4 /*yield*/, react_2.screen.findAllByTestId('map-geography')];
|
|
237
214
|
case 1:
|
|
215
|
+
firstGeo = (_a.sent())[0];
|
|
216
|
+
return [4 /*yield*/, user.click(firstGeo)];
|
|
217
|
+
case 2:
|
|
238
218
|
_a.sent();
|
|
239
|
-
wrapper.update();
|
|
240
|
-
geography = wrapper.find(react_simple_maps_1.Geography).first();
|
|
241
|
-
geography.simulate('click');
|
|
242
219
|
expect(onItemClick).toHaveBeenCalledWith('AL');
|
|
243
220
|
return [2 /*return*/];
|
|
244
221
|
}
|
|
245
222
|
});
|
|
246
223
|
}); });
|
|
247
224
|
it('should render ComposableMap with Geographies, Legend and Tooltip if we get FeatureCollection instead of GeometryCollection', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
248
|
-
var FutureCollection,
|
|
225
|
+
var FutureCollection, user, mapChart, mapChartSvg, geo;
|
|
249
226
|
return __generator(this, function (_a) {
|
|
250
227
|
switch (_a.label) {
|
|
251
228
|
case 0:
|
|
@@ -291,38 +268,25 @@ describe('MapChart', function () {
|
|
|
291
268
|
ok: true,
|
|
292
269
|
json: function () { return Promise.resolve(FutureCollection); }
|
|
293
270
|
});
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
271
|
+
user = setUp().user;
|
|
272
|
+
expect(window.fetch).toHaveBeenCalledWith(defaultProps.options.geoUrl, { signal: signal });
|
|
273
|
+
mapChart = react_2.screen.getByTestId('map-chart');
|
|
274
|
+
mapChartSvg = mapChart.querySelector('svg');
|
|
275
|
+
expect(mapChart).toHaveStyle({ width: "".concat(defaultProps.width, "px"), height: "".concat(defaultProps.height, "px") });
|
|
276
|
+
expect(mapChartSvg).toHaveAttribute('width', "".concat(defaultProps.width - constants_1.LEGEND_WIDTH));
|
|
277
|
+
expect(mapChartSvg).toHaveAttribute('height', "".concat(defaultProps.height));
|
|
278
|
+
return [4 /*yield*/, react_2.screen.findByTestId('map-geography')];
|
|
301
279
|
case 1:
|
|
280
|
+
geo = _a.sent();
|
|
281
|
+
expect(geo).toHaveAttribute('fill', '#EEE');
|
|
282
|
+
expect(react_2.screen.getByTestId('map-chart-legend')).toBeInTheDocument();
|
|
283
|
+
expect(react_2.screen.getByTestId('max-legend-metric')).toHaveTextContent('2');
|
|
284
|
+
expect(react_2.screen.getByTestId('min-legend-metric')).toHaveTextContent('1');
|
|
285
|
+
expect(react_2.screen.queryByText('first')).not.toBeInTheDocument();
|
|
286
|
+
return [4 /*yield*/, user.hover(geo)];
|
|
287
|
+
case 2:
|
|
302
288
|
_a.sent();
|
|
303
|
-
|
|
304
|
-
expect(window.fetch).toHaveBeenCalledWith(props.options.geoUrl, { signal: signal });
|
|
305
|
-
mapWidth = props.width - constants_1.LEGEND_WIDTH;
|
|
306
|
-
mapHeight = props.height;
|
|
307
|
-
mapProvider = wrapper.find(react_simple_maps_1.MapProvider);
|
|
308
|
-
expect(mapProvider.prop('width')).toBe(mapWidth);
|
|
309
|
-
expect(mapProvider.prop('height')).toBe(mapHeight);
|
|
310
|
-
map = mapProvider.find('svg');
|
|
311
|
-
expect(map.props()).toMatchObject({
|
|
312
|
-
width: mapWidth,
|
|
313
|
-
height: mapHeight,
|
|
314
|
-
viewBox: "0 0 ".concat(mapWidth, " ").concat(mapHeight)
|
|
315
|
-
});
|
|
316
|
-
expect(map.find(react_simple_maps_1.Geographies).prop('geography')).toBe(FutureCollection);
|
|
317
|
-
g = map.find(react_simple_maps_1.Geography);
|
|
318
|
-
expect(g).toHaveLength(1);
|
|
319
|
-
expect(g.first().prop('fill')).toBe('#EEE');
|
|
320
|
-
expect(wrapper.find(Legend_1.Legend).props()).toMatchObject({
|
|
321
|
-
width: constants_1.LEGEND_WIDTH,
|
|
322
|
-
minValue: 1,
|
|
323
|
-
maxValue: 2
|
|
324
|
-
});
|
|
325
|
-
expect(wrapper.find(recharts_1.Tooltip)).toHaveLength(1);
|
|
289
|
+
expect(react_2.screen.getByTestId('chart-tooltip')).toBeInTheDocument();
|
|
326
290
|
return [2 /*return*/];
|
|
327
291
|
}
|
|
328
292
|
});
|
|
@@ -15,9 +15,9 @@ var Legend = function (_a) {
|
|
|
15
15
|
colors: colors,
|
|
16
16
|
width: width
|
|
17
17
|
});
|
|
18
|
-
return (react_1.default.createElement("div", { className: styles.legendContainer },
|
|
19
|
-
react_1.default.createElement(Typography_1.default, { className: (0, classnames_1.default)(styles.legendLabel, styles.alignTop) }, (0, mdm_sdk_1.formatNumberAsMetric)(maxValue)),
|
|
18
|
+
return (react_1.default.createElement("div", { "data-reltio-id": "map-chart-legend", className: styles.legendContainer },
|
|
19
|
+
react_1.default.createElement(Typography_1.default, { "data-reltio-id": "max-legend-metric", className: (0, classnames_1.default)(styles.legendLabel, styles.alignTop) }, (0, mdm_sdk_1.formatNumberAsMetric)(maxValue)),
|
|
20
20
|
react_1.default.createElement("div", { className: styles.legendBar }),
|
|
21
|
-
react_1.default.createElement(Typography_1.default, { className: (0, classnames_1.default)(styles.legendLabel, styles.alignBottom) }, (0, mdm_sdk_1.formatNumberAsMetric)(minValue))));
|
|
21
|
+
react_1.default.createElement(Typography_1.default, { "data-reltio-id": "min-legend-metric", className: (0, classnames_1.default)(styles.legendLabel, styles.alignBottom) }, (0, mdm_sdk_1.formatNumberAsMetric)(minValue))));
|
|
22
22
|
};
|
|
23
23
|
exports.Legend = Legend;
|
|
@@ -18,6 +18,6 @@ var MaskingSwitcher = function (_a) {
|
|
|
18
18
|
var styles = (0, styles_1.useStyles)();
|
|
19
19
|
var tooltipTitle = isMasked ? ui_i18n_1.default.text('Show') : ui_i18n_1.default.text('Hide');
|
|
20
20
|
return isUnmasking ? (react_1.default.createElement(CircularProgress_1.default, { size: 16, className: (0, classnames_1.default)(className, styles.switcherWrapper) })) : (react_1.default.createElement(Tooltip_1.default, { key: String(isMasked), title: tooltipTitle },
|
|
21
|
-
react_1.default.createElement(IconButton_1.default, { "aria-label": tooltipTitle, onClick: onToggleMasking, className: (0, classnames_1.default)(className, styles.switcherWrapper) }, isMasked ? react_1.default.createElement(Visibility_1.default, { className: styles.icon }) : react_1.default.createElement(VisibilityOff_1.default, { className: styles.icon }))));
|
|
21
|
+
react_1.default.createElement(IconButton_1.default, { "data-reltio-id": "masking-switcher", "aria-label": tooltipTitle, onClick: onToggleMasking, className: (0, classnames_1.default)(className, styles.switcherWrapper) }, isMasked ? react_1.default.createElement(Visibility_1.default, { className: styles.icon }) : react_1.default.createElement(VisibilityOff_1.default, { className: styles.icon }))));
|
|
22
22
|
};
|
|
23
23
|
exports.MaskingSwitcher = MaskingSwitcher;
|
|
@@ -10,40 +10,109 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
13
49
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
50
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
51
|
};
|
|
16
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
53
|
var react_1 = __importDefault(require("react"));
|
|
18
|
-
var
|
|
54
|
+
var react_2 = require("@testing-library/react");
|
|
55
|
+
var user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
19
56
|
var MatchRulesBadge_1 = require("./MatchRulesBadge");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
57
|
+
var test_utils_1 = require("../test-utils");
|
|
58
|
+
var defaultProps = {
|
|
59
|
+
children: 'label',
|
|
60
|
+
expanded: false,
|
|
61
|
+
onExpand: jest.fn()
|
|
62
|
+
};
|
|
63
|
+
var setUp = function (props) {
|
|
64
|
+
if (props === void 0) { props = {}; }
|
|
65
|
+
var user = user_event_1.default.setup();
|
|
66
|
+
return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(MatchRulesBadge_1.MatchRulesBadge, __assign({}, defaultProps, props))));
|
|
67
|
+
};
|
|
68
|
+
describe('MatchRulesBadge tests', function () {
|
|
26
69
|
it('should render children as label correctly', function () {
|
|
27
|
-
|
|
28
|
-
expect(
|
|
70
|
+
setUp();
|
|
71
|
+
expect(react_2.screen.getByText('label')).toBeInTheDocument();
|
|
29
72
|
});
|
|
30
73
|
it('should provide expanded prop to arrow', function () {
|
|
31
|
-
var
|
|
32
|
-
expect(
|
|
33
|
-
|
|
34
|
-
expect(
|
|
74
|
+
var rerender = setUp({ expanded: true }).rerender;
|
|
75
|
+
expect((0, test_utils_1.getMuiIconByName)('ArrowRight')).toHaveClass('expanded');
|
|
76
|
+
rerender(react_1.default.createElement(MatchRulesBadge_1.MatchRulesBadge, __assign({}, defaultProps, { expanded: false }), "label"));
|
|
77
|
+
expect((0, test_utils_1.getMuiIconByName)('ArrowRight')).not.toHaveClass('expanded');
|
|
35
78
|
});
|
|
36
|
-
it('should provide onExpand
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
79
|
+
it('should provide call onExpand on click', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
|
+
var user;
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
switch (_a.label) {
|
|
83
|
+
case 0:
|
|
84
|
+
user = setUp().user;
|
|
85
|
+
return [4 /*yield*/, user.click(react_2.screen.getByRole('button'))];
|
|
86
|
+
case 1:
|
|
87
|
+
_a.sent();
|
|
88
|
+
expect(defaultProps.onExpand).toHaveBeenCalled();
|
|
89
|
+
return [2 /*return*/];
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}); });
|
|
93
|
+
it('should provide other props to container for work with withTooltip hoc', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
94
|
+
var onMouseEnter, user;
|
|
95
|
+
return __generator(this, function (_a) {
|
|
96
|
+
switch (_a.label) {
|
|
97
|
+
case 0:
|
|
98
|
+
onMouseEnter = jest.fn();
|
|
99
|
+
user = setUp({ onMouseEnter: onMouseEnter }).user;
|
|
100
|
+
return [4 /*yield*/, user.hover(react_2.screen.getByRole('button'))];
|
|
101
|
+
case 1:
|
|
102
|
+
_a.sent();
|
|
103
|
+
expect(onMouseEnter).toHaveBeenCalled();
|
|
104
|
+
return [2 /*return*/];
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}); });
|
|
108
|
+
it('should apply custom className', function () {
|
|
109
|
+
var className = 'custom-class';
|
|
110
|
+
setUp({ className: className });
|
|
111
|
+
expect(react_2.screen.getByRole('button').parentElement).toHaveClass(className);
|
|
42
112
|
});
|
|
43
|
-
it('should
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
expect(container.prop('onHover')).toBe(onHover);
|
|
113
|
+
it('should forward ref to the container', function () {
|
|
114
|
+
var ref = react_1.default.createRef();
|
|
115
|
+
setUp({ ref: ref });
|
|
116
|
+
expect(ref.current).toBeInstanceOf(HTMLDivElement);
|
|
48
117
|
});
|
|
49
118
|
});
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
export function SelectEditor({ classes, ...otherProps }: {
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
classes: any;
|
|
4
|
-
}): React.JSX.Element;
|
|
5
|
-
export namespace SelectEditor {
|
|
6
|
-
namespace propTypes {
|
|
7
|
-
let classes: PropTypes.Requireable<object>;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
1
|
import React from 'react';
|
|
11
|
-
import
|
|
2
|
+
import { DropDownEditor } from '../DropDownEditor';
|
|
3
|
+
type Props = React.ComponentProps<typeof DropDownEditor>;
|
|
4
|
+
export declare const SelectEditor: ({ classes, ...otherProps }: Props) => React.JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -27,7 +27,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
exports.SelectEditor = void 0;
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
31
30
|
var classnames_1 = __importDefault(require("classnames"));
|
|
32
31
|
var ramda_1 = require("ramda");
|
|
33
32
|
var DropDownEditor_1 = require("../DropDownEditor");
|
|
@@ -40,6 +39,3 @@ var SelectEditor = function (_a) {
|
|
|
40
39
|
}, classes: __assign(__assign({}, classes), { root: (0, classnames_1.default)(styles.root, (0, ramda_1.prop)('root', classes)), icon: (0, classnames_1.default)(styles.icon, (0, ramda_1.prop)('icon', classes)) }) }, otherProps)));
|
|
41
40
|
};
|
|
42
41
|
exports.SelectEditor = SelectEditor;
|
|
43
|
-
exports.SelectEditor.propTypes = {
|
|
44
|
-
classes: prop_types_1.default.object
|
|
45
|
-
};
|