@mui/x-charts 8.9.2 → 8.10.1
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/BarChart/BarChart.js +20 -0
- package/CHANGELOG.md +217 -6
- package/ChartContainer/ChartContainer.js +30 -0
- package/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
- package/ChartsAxisHighlight/ChartsXAxisHighlight.js +1 -3
- package/ChartsAxisHighlight/ChartsYAxisHighlight.js +1 -3
- package/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltip.d.ts +2 -1
- package/ChartsTooltip/ChartsTooltip.js +3 -3
- package/ChartsTooltip/ChartsTooltipContainer.d.ts +5 -5
- package/ChartsTooltip/ChartsTooltipContainer.js +11 -5
- package/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/ChartsTooltip/ChartsTooltipTable.js +1 -0
- package/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/ChartsXAxis/ChartsGroupedXAxis.d.ts +7 -0
- package/ChartsXAxis/ChartsGroupedXAxis.js +143 -0
- package/ChartsXAxis/ChartsSingleXAxis.d.ts +7 -0
- package/ChartsXAxis/ChartsSingleXAxis.js +144 -0
- package/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/ChartsXAxis/ChartsXAxis.js +8 -210
- package/ChartsXAxis/getVisibleLabels.d.ts +2 -2
- package/ChartsXAxis/useAxisProps.d.ts +4526 -0
- package/ChartsXAxis/useAxisProps.js +105 -0
- package/ChartsXAxis/utilities.d.ts +11 -0
- package/ChartsXAxis/utilities.js +43 -0
- package/ChartsYAxis/ChartsGroupedYAxis.d.ts +7 -0
- package/ChartsYAxis/ChartsGroupedYAxis.js +144 -0
- package/ChartsYAxis/ChartsSingleYAxis.d.ts +7 -0
- package/ChartsYAxis/ChartsSingleYAxis.js +133 -0
- package/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/ChartsYAxis/ChartsYAxis.js +12 -211
- package/ChartsYAxis/useAxisProps.d.ts +4452 -0
- package/ChartsYAxis/useAxisProps.js +115 -0
- package/ChartsYAxis/utilities.d.ts +10 -0
- package/ChartsYAxis/utilities.js +42 -0
- package/LineChart/LineChart.js +20 -0
- package/RadarChart/index.d.ts +9 -2
- package/RadarChart/index.js +13 -14
- package/ScatterChart/ScatterChart.d.ts +8 -1
- package/ScatterChart/ScatterChart.js +20 -0
- package/SparkLineChart/SparkLineChart.d.ts +15 -5
- package/SparkLineChart/SparkLineChart.js +77 -34
- package/esm/BarChart/BarChart.js +20 -0
- package/esm/ChartContainer/ChartContainer.js +30 -0
- package/esm/ChartsAxisHighlight/ChartsAxisHighlight.js +2 -2
- package/esm/ChartsAxisHighlight/ChartsXAxisHighlight.js +1 -3
- package/esm/ChartsAxisHighlight/ChartsYAxisHighlight.js +1 -3
- package/esm/ChartsLabel/labelGradientClasses.d.ts +1 -1
- package/esm/ChartsLabel/labelMarkClasses.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsXReferenceLine.d.ts +1 -1
- package/esm/ChartsReferenceLine/ChartsYReferenceLine.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsTooltip.d.ts +2 -1
- package/esm/ChartsTooltip/ChartsTooltip.js +3 -3
- package/esm/ChartsTooltip/ChartsTooltipContainer.d.ts +5 -5
- package/esm/ChartsTooltip/ChartsTooltipContainer.js +11 -5
- package/esm/ChartsTooltip/ChartsTooltipTable.d.ts +1 -1
- package/esm/ChartsTooltip/ChartsTooltipTable.js +1 -0
- package/esm/ChartsTooltip/chartsTooltipClasses.d.ts +1 -1
- package/esm/ChartsXAxis/ChartsGroupedXAxis.d.ts +7 -0
- package/esm/ChartsXAxis/ChartsGroupedXAxis.js +137 -0
- package/esm/ChartsXAxis/ChartsSingleXAxis.d.ts +7 -0
- package/esm/ChartsXAxis/ChartsSingleXAxis.js +140 -0
- package/esm/ChartsXAxis/ChartsXAxis.d.ts +1 -1
- package/esm/ChartsXAxis/ChartsXAxis.js +7 -207
- package/esm/ChartsXAxis/getVisibleLabels.d.ts +2 -2
- package/esm/ChartsXAxis/useAxisProps.d.ts +4526 -0
- package/esm/ChartsXAxis/useAxisProps.js +98 -0
- package/esm/ChartsXAxis/utilities.d.ts +11 -0
- package/esm/ChartsXAxis/utilities.js +35 -0
- package/esm/ChartsYAxis/ChartsGroupedYAxis.d.ts +7 -0
- package/esm/ChartsYAxis/ChartsGroupedYAxis.js +138 -0
- package/esm/ChartsYAxis/ChartsSingleYAxis.d.ts +7 -0
- package/esm/ChartsYAxis/ChartsSingleYAxis.js +129 -0
- package/esm/ChartsYAxis/ChartsYAxis.d.ts +1 -1
- package/esm/ChartsYAxis/ChartsYAxis.js +10 -207
- package/esm/ChartsYAxis/useAxisProps.d.ts +4452 -0
- package/esm/ChartsYAxis/useAxisProps.js +108 -0
- package/esm/ChartsYAxis/utilities.d.ts +10 -0
- package/esm/ChartsYAxis/utilities.js +34 -0
- package/esm/LineChart/LineChart.js +20 -0
- package/esm/RadarChart/index.d.ts +9 -2
- package/esm/RadarChart/index.js +12 -2
- package/esm/ScatterChart/ScatterChart.d.ts +8 -1
- package/esm/ScatterChart/ScatterChart.js +20 -0
- package/esm/SparkLineChart/SparkLineChart.d.ts +15 -5
- package/esm/SparkLineChart/SparkLineChart.js +77 -34
- package/esm/hooks/useTicksGrouped.d.ts +28 -0
- package/esm/hooks/useTicksGrouped.js +98 -0
- package/esm/index.js +1 -1
- package/esm/internals/animation/Transition.js +2 -5
- package/esm/internals/configInit.js +2 -2
- package/esm/internals/getScale.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +32 -23
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +1 -1
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -4
- package/esm/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +2 -2
- package/esm/internals/plugins/utils/ChartStore.js +16 -18
- package/esm/models/axis.d.ts +46 -2
- package/esm/tests/web-components.js +2 -4
- package/hooks/useTicksGrouped.d.ts +28 -0
- package/hooks/useTicksGrouped.js +104 -0
- package/index.js +1 -1
- package/internals/animation/Transition.js +2 -5
- package/internals/configInit.js +2 -2
- package/internals/getScale.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.d.ts +3 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/createAxisFilterMapper.js +34 -23
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisExtremum.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.d.ts +1 -1
- package/internals/plugins/featurePlugins/useChartCartesianAxis/getAxisValue.js +3 -4
- package/internals/plugins/featurePlugins/useChartCartesianAxis/useChartCartesianInteraction.selectors.js +2 -2
- package/internals/plugins/utils/ChartStore.js +16 -18
- package/models/axis.d.ts +46 -2
- package/package.json +16 -18
- package/tests/web-components.js +2 -4
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createAxisFilterMapper = createAxisFilterMapper;
|
|
7
|
+
exports.createContinuousScaleGetAxisFilter = createContinuousScaleGetAxisFilter;
|
|
8
|
+
exports.createDiscreteScaleGetAxisFilter = createDiscreteScaleGetAxisFilter;
|
|
7
9
|
exports.createGetAxisFilters = void 0;
|
|
8
10
|
var _isDefined = require("../../../isDefined");
|
|
9
11
|
var _getAxisExtremum = require("./getAxisExtremum");
|
|
@@ -25,32 +27,41 @@ function createAxisFilterMapper({
|
|
|
25
27
|
// No zoom, or zoom with all data visible
|
|
26
28
|
return null;
|
|
27
29
|
}
|
|
28
|
-
let extremums = [];
|
|
29
30
|
const scaleType = axis.scaleType;
|
|
30
31
|
if (scaleType === 'point' || scaleType === 'band') {
|
|
31
|
-
|
|
32
|
-
} else {
|
|
33
|
-
extremums = (0, _getAxisExtremum.getAxisExtremum)(axis, direction, seriesConfig, axisIndex, formattedSeries);
|
|
32
|
+
return createDiscreteScaleGetAxisFilter(axis.data, zoom.start, zoom.end, direction);
|
|
34
33
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
return createContinuousScaleGetAxisFilter(scaleType, (0, _getAxisExtremum.getAxisExtremum)(axis, direction, seriesConfig, axisIndex, formattedSeries), zoom.start, zoom.end, direction, axis.data);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function createDiscreteScaleGetAxisFilter(axisData, zoomStart, zoomEnd, direction) {
|
|
38
|
+
const maxIndex = axisData?.length ?? 0;
|
|
39
|
+
const minVal = Math.floor(zoomStart * maxIndex / 100);
|
|
40
|
+
const maxVal = Math.ceil(zoomEnd * maxIndex / 100);
|
|
41
|
+
return function filterAxis(value, dataIndex) {
|
|
42
|
+
const val = value[direction] ?? axisData?.[dataIndex];
|
|
43
|
+
if (val == null) {
|
|
44
|
+
// If the value does not exist because of missing data point, or out of range index, we just ignore.
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return dataIndex >= minVal && dataIndex < maxVal;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function createContinuousScaleGetAxisFilter(scaleType, extrema, zoomStart, zoomEnd, direction, axisData) {
|
|
51
|
+
let min;
|
|
52
|
+
let max;
|
|
53
|
+
[min, max] = (0, _getScale.getScale)(scaleType ?? 'linear', extrema, [0, 100]).nice().domain();
|
|
54
|
+
min = min instanceof Date ? min.getTime() : min;
|
|
55
|
+
max = max instanceof Date ? max.getTime() : max;
|
|
56
|
+
const minVal = min + zoomStart * (max - min) / 100;
|
|
57
|
+
const maxVal = min + zoomEnd * (max - min) / 100;
|
|
58
|
+
return function filterAxis(value, dataIndex) {
|
|
59
|
+
const val = value[direction] ?? axisData?.[dataIndex];
|
|
60
|
+
if (val == null) {
|
|
61
|
+
// If the value does not exist because of missing data point, or out of range index, we just ignore.
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
return val >= minVal && val <= maxVal;
|
|
54
65
|
};
|
|
55
66
|
}
|
|
56
67
|
const createGetAxisFilters = filters => ({
|
|
@@ -3,4 +3,4 @@ import { CartesianChartSeriesType } from "../../../../models/seriesType/config.j
|
|
|
3
3
|
import { ChartSeriesConfig } from "../../models/seriesConfig/index.js";
|
|
4
4
|
import { ProcessedSeries } from "../../corePlugins/useChartSeries/useChartSeries.types.js";
|
|
5
5
|
import { GetZoomAxisFilters } from "./zoom.types.js";
|
|
6
|
-
export declare const getAxisExtremum: <T extends CartesianChartSeriesType>(axis: AxisConfig, axisDirection: "x" | "y", seriesConfig: ChartSeriesConfig<T>, axisIndex: number, formattedSeries: ProcessedSeries<T>, getFilters?: GetZoomAxisFilters) => number
|
|
6
|
+
export declare const getAxisExtremum: <T extends CartesianChartSeriesType>(axis: AxisConfig, axisDirection: "x" | "y", seriesConfig: ChartSeriesConfig<T>, axisIndex: number, formattedSeries: ProcessedSeries<T>, getFilters?: GetZoomAxisFilters) => [number, number];
|
|
@@ -8,4 +8,4 @@ export declare function getAxisIndex(axisConfig: ComputedAxis, pointerValue: num
|
|
|
8
8
|
* For a pointer coordinate, this function returns the value associated.
|
|
9
9
|
* Returns `null` if the coordinate has no value associated.
|
|
10
10
|
*/
|
|
11
|
-
export declare function getAxisValue(axisConfig: ComputedAxis, pointerValue: number, dataIndex: number): number | Date | null;
|
|
11
|
+
export declare function getAxisValue(axisConfig: ComputedAxis, pointerValue: number, dataIndex: number | null): number | Date | null;
|
|
@@ -59,13 +59,12 @@ function getAxisValue(axisConfig, pointerValue, dataIndex) {
|
|
|
59
59
|
data: axisData
|
|
60
60
|
} = axisConfig;
|
|
61
61
|
if (!(0, _isBandScale.isBandScale)(scale)) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return value;
|
|
62
|
+
if (dataIndex === null) {
|
|
63
|
+
return scale.invert(pointerValue);
|
|
65
64
|
}
|
|
66
65
|
return axisData[dataIndex];
|
|
67
66
|
}
|
|
68
|
-
if (dataIndex < 0 || dataIndex >= axisData.length) {
|
|
67
|
+
if (dataIndex === null || dataIndex < 0 || dataIndex >= axisData.length) {
|
|
69
68
|
return null;
|
|
70
69
|
}
|
|
71
70
|
return axisData[dataIndex];
|
|
@@ -44,13 +44,13 @@ function valueGetter(value, axes, indexes, ids = axes.axisIds[0]) {
|
|
|
44
44
|
return Array.isArray(ids) ? ids.map((id, axisIndex) => (0, _getAxisValue.getAxisValue)(axes.axis[id], value, indexes[axisIndex])) : (0, _getAxisValue.getAxisValue)(axes.axis[ids], value, indexes);
|
|
45
45
|
}
|
|
46
46
|
const selectorChartsInteractionXAxisValue = exports.selectorChartsInteractionXAxisValue = (0, _selectors.createSelector)([_useChartInteraction.selectorChartsInteractionPointerX, _useChartCartesianAxisRendering.selectorChartXAxis, selectorChartsInteractionXAxisIndex, optionalGetAxisId], (x, xAxes, xIndex, id) => {
|
|
47
|
-
if (x === null ||
|
|
47
|
+
if (x === null || xAxes.axisIds.length === 0) {
|
|
48
48
|
return null;
|
|
49
49
|
}
|
|
50
50
|
return valueGetter(x, xAxes, xIndex, id);
|
|
51
51
|
});
|
|
52
52
|
const selectorChartsInteractionYAxisValue = exports.selectorChartsInteractionYAxisValue = (0, _selectors.createSelector)([_useChartInteraction.selectorChartsInteractionPointerY, _useChartCartesianAxisRendering.selectorChartYAxis, selectorChartsInteractionYAxisIndex, optionalGetAxisId], (y, yAxes, yIndex, id) => {
|
|
53
|
-
if (y === null ||
|
|
53
|
+
if (y === null || yAxes.axisIds.length === 0) {
|
|
54
54
|
return null;
|
|
55
55
|
}
|
|
56
56
|
return valueGetter(y, yAxes, yIndex, id);
|
|
@@ -6,26 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ChartStore = void 0;
|
|
7
7
|
class ChartStore {
|
|
8
8
|
constructor(value) {
|
|
9
|
-
this.value = void 0;
|
|
10
|
-
this.listeners = void 0;
|
|
11
|
-
this.subscribe = fn => {
|
|
12
|
-
this.listeners.add(fn);
|
|
13
|
-
return () => {
|
|
14
|
-
this.listeners.delete(fn);
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
this.getSnapshot = () => {
|
|
18
|
-
return this.value;
|
|
19
|
-
};
|
|
20
|
-
this.update = updater => {
|
|
21
|
-
const newState = updater(this.value);
|
|
22
|
-
if (newState !== this.value) {
|
|
23
|
-
this.value = newState;
|
|
24
|
-
this.listeners.forEach(l => l(newState));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
9
|
this.value = value;
|
|
28
10
|
this.listeners = new Set();
|
|
29
11
|
}
|
|
12
|
+
subscribe = fn => {
|
|
13
|
+
this.listeners.add(fn);
|
|
14
|
+
return () => {
|
|
15
|
+
this.listeners.delete(fn);
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
getSnapshot = () => {
|
|
19
|
+
return this.value;
|
|
20
|
+
};
|
|
21
|
+
update = updater => {
|
|
22
|
+
const newState = updater(this.value);
|
|
23
|
+
if (newState !== this.value) {
|
|
24
|
+
this.value = newState;
|
|
25
|
+
this.listeners.forEach(l => l(newState));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
30
28
|
}
|
|
31
29
|
exports.ChartStore = ChartStore;
|
package/models/axis.d.ts
CHANGED
|
@@ -180,6 +180,50 @@ export interface ChartsRadiusAxisProps extends ChartsAxisProps {
|
|
|
180
180
|
}
|
|
181
181
|
export type ScaleName = keyof AxisScaleConfig;
|
|
182
182
|
export type ContinuousScaleName = 'linear' | 'log' | 'symlog' | 'pow' | 'sqrt' | 'time' | 'utc';
|
|
183
|
+
export type AxisGroup = {
|
|
184
|
+
/**
|
|
185
|
+
* The function used to return the value for this group.
|
|
186
|
+
*
|
|
187
|
+
* @param {any} value The value of the axis item.
|
|
188
|
+
* @param {number} dataIndex The index of the data item.
|
|
189
|
+
* @returns {string | number | Date} The value that will be used to group the axis items.
|
|
190
|
+
*/
|
|
191
|
+
getValue: (value: any, dataIndex: number) => string | number | Date;
|
|
192
|
+
/**
|
|
193
|
+
* The size of the tick in pixels.
|
|
194
|
+
* @default 6
|
|
195
|
+
*/
|
|
196
|
+
tickSize?: number;
|
|
197
|
+
/**
|
|
198
|
+
* The style applied to ticks text.
|
|
199
|
+
*/
|
|
200
|
+
tickLabelStyle?: ChartsTextProps['style'];
|
|
201
|
+
};
|
|
202
|
+
export type AxisGroups = {
|
|
203
|
+
/**
|
|
204
|
+
* Each group will have a label that is the stringified value of the group.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
207
|
+
* If the axis is grouped by day, month and year.
|
|
208
|
+
*
|
|
209
|
+
* ```tsx
|
|
210
|
+
* [
|
|
211
|
+
* { getValue: getDate },
|
|
212
|
+
* { getValue: getMonth },
|
|
213
|
+
* { getValue: getFullYear }
|
|
214
|
+
* ]
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* Then the axis will have three rows, one for each group.
|
|
218
|
+
*
|
|
219
|
+
* ```bash
|
|
220
|
+
* | 31 | 1 | 2 |
|
|
221
|
+
* | Jan | Feb |
|
|
222
|
+
* | 2021 |
|
|
223
|
+
* ```
|
|
224
|
+
*/
|
|
225
|
+
groups?: AxisGroup[];
|
|
226
|
+
};
|
|
183
227
|
export interface AxisScaleConfig {
|
|
184
228
|
band: {
|
|
185
229
|
scaleType: 'band';
|
|
@@ -197,12 +241,12 @@ export interface AxisScaleConfig {
|
|
|
197
241
|
*/
|
|
198
242
|
barGapRatio: number;
|
|
199
243
|
colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig;
|
|
200
|
-
} & Pick<TickParams, 'tickPlacement' | 'tickLabelPlacement'>;
|
|
244
|
+
} & AxisGroups & Pick<TickParams, 'tickPlacement' | 'tickLabelPlacement'>;
|
|
201
245
|
point: {
|
|
202
246
|
scaleType: 'point';
|
|
203
247
|
scale: ScalePoint<number | Date | string>;
|
|
204
248
|
colorMap?: OrdinalColorConfig | ContinuousColorConfig | PiecewiseColorConfig;
|
|
205
|
-
};
|
|
249
|
+
} & AxisGroups;
|
|
206
250
|
log: {
|
|
207
251
|
scaleType: 'log';
|
|
208
252
|
scale: ScaleLogarithmic<number, number>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-charts",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.1",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of MUI X Charts components.",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.28.2",
|
|
32
|
-
"@mui/utils": "^7.
|
|
32
|
+
"@mui/utils": "^7.3.1",
|
|
33
33
|
"bezier-easing": "^2.1.0",
|
|
34
34
|
"clsx": "^2.1.1",
|
|
35
35
|
"prop-types": "^15.8.1",
|
|
36
36
|
"reselect": "^5.1.1",
|
|
37
37
|
"use-sync-external-store": "^1.5.0",
|
|
38
38
|
"@mui/x-charts-vendor": "8.6.0",
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-
|
|
39
|
+
"@mui/x-internals": "8.10.0",
|
|
40
|
+
"@mui/x-internal-gestures": "0.2.4"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@emotion/react": "^11.9.0",
|
|
@@ -58,32 +58,30 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=14.0.0"
|
|
60
60
|
},
|
|
61
|
-
"
|
|
62
|
-
"
|
|
61
|
+
"type": "commonjs",
|
|
62
|
+
"types": "./index.d.ts",
|
|
63
63
|
"exports": {
|
|
64
64
|
"./package.json": "./package.json",
|
|
65
65
|
".": {
|
|
66
|
-
"require": {
|
|
67
|
-
"types": "./index.d.ts",
|
|
68
|
-
"default": "./index.js"
|
|
69
|
-
},
|
|
70
66
|
"import": {
|
|
71
67
|
"types": "./esm/index.d.ts",
|
|
72
68
|
"default": "./esm/index.js"
|
|
69
|
+
},
|
|
70
|
+
"require": {
|
|
71
|
+
"types": "./index.d.ts",
|
|
72
|
+
"default": "./index.js"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"./*": {
|
|
76
|
-
"require": {
|
|
77
|
-
"types": "./*/index.d.ts",
|
|
78
|
-
"default": "./*/index.js"
|
|
79
|
-
},
|
|
80
76
|
"import": {
|
|
81
77
|
"types": "./esm/*/index.d.ts",
|
|
82
78
|
"default": "./esm/*/index.js"
|
|
79
|
+
},
|
|
80
|
+
"require": {
|
|
81
|
+
"types": "./*/index.d.ts",
|
|
82
|
+
"default": "./*/index.js"
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
-
"./esm": null
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
"types": "./index.d.ts"
|
|
85
|
+
"./esm": null
|
|
86
|
+
}
|
|
89
87
|
}
|
package/tests/web-components.js
CHANGED
|
@@ -16,12 +16,10 @@ function reactToWebComponent(ReactComponent, options, renderer) {
|
|
|
16
16
|
static get observedAttributes() {
|
|
17
17
|
return [];
|
|
18
18
|
}
|
|
19
|
+
[connectedSymbol] = true;
|
|
20
|
+
[propsSymbol] = {};
|
|
19
21
|
constructor() {
|
|
20
22
|
super();
|
|
21
|
-
this[connectedSymbol] = true;
|
|
22
|
-
this[contextSymbol] = void 0;
|
|
23
|
-
this[propsSymbol] = {};
|
|
24
|
-
this.container = void 0;
|
|
25
23
|
if (options.shadow) {
|
|
26
24
|
this.container = this.attachShadow({
|
|
27
25
|
mode: options.shadow
|