@pie-lib/graphing-solution-set 2.34.3-next.0 → 2.34.3-next.155
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/CHANGELOG.md +7 -78
- package/esm/package.json +3 -0
- package/lib/axis/arrow.js +19 -55
- package/lib/axis/arrow.js.map +1 -1
- package/lib/axis/axes.js +103 -193
- package/lib/axis/axes.js.map +1 -1
- package/lib/axis/index.js +1 -6
- package/lib/axis/index.js.map +1 -1
- package/lib/bg.js +21 -49
- package/lib/bg.js.map +1 -1
- package/lib/container/actions.js +2 -8
- package/lib/container/actions.js.map +1 -1
- package/lib/container/index.js +14 -60
- package/lib/container/index.js.map +1 -1
- package/lib/container/marks.js +1 -6
- package/lib/container/marks.js.map +1 -1
- package/lib/container/middleware.js +2 -8
- package/lib/container/middleware.js.map +1 -1
- package/lib/container/reducer.js +1 -8
- package/lib/container/reducer.js.map +1 -1
- package/lib/coordinates-label.js +23 -55
- package/lib/coordinates-label.js.map +1 -1
- package/lib/graph-with-controls.js +129 -203
- package/lib/graph-with-controls.js.map +1 -1
- package/lib/graph.js +61 -126
- package/lib/graph.js.map +1 -1
- package/lib/grid-setup.js +168 -224
- package/lib/grid-setup.js.map +1 -1
- package/lib/grid.js +29 -74
- package/lib/grid.js.map +1 -1
- package/lib/index.js +1 -12
- package/lib/index.js.map +1 -1
- package/lib/labels.js +84 -184
- package/lib/labels.js.map +1 -1
- package/lib/mark-label.js +39 -88
- package/lib/mark-label.js.map +1 -1
- package/lib/toggle-bar.js +155 -243
- package/lib/toggle-bar.js.map +1 -1
- package/lib/tool-menu.js +93 -200
- package/lib/tool-menu.js.map +1 -1
- package/lib/tools/index.js +2 -7
- package/lib/tools/index.js.map +1 -1
- package/lib/tools/line/component.js +48 -62
- package/lib/tools/line/component.js.map +1 -1
- package/lib/tools/line/index.js +1 -6
- package/lib/tools/line/index.js.map +1 -1
- package/lib/tools/polygon/component.js +76 -173
- package/lib/tools/polygon/component.js.map +1 -1
- package/lib/tools/polygon/index.js +6 -23
- package/lib/tools/polygon/index.js.map +1 -1
- package/lib/tools/polygon/line.js +48 -85
- package/lib/tools/polygon/line.js.map +1 -1
- package/lib/tools/polygon/polygon.js +62 -102
- package/lib/tools/polygon/polygon.js.map +1 -1
- package/lib/tools/shared/arrow-head.js +7 -20
- package/lib/tools/shared/arrow-head.js.map +1 -1
- package/lib/tools/shared/line/index.js +89 -185
- package/lib/tools/shared/line/index.js.map +1 -1
- package/lib/tools/shared/line/line-path.js +71 -95
- package/lib/tools/shared/line/line-path.js.map +1 -1
- package/lib/tools/shared/line/with-root-edge.js +22 -56
- package/lib/tools/shared/line/with-root-edge.js.map +1 -1
- package/lib/tools/shared/point/arrow-point.js +18 -45
- package/lib/tools/shared/point/arrow-point.js.map +1 -1
- package/lib/tools/shared/point/arrow.js +16 -42
- package/lib/tools/shared/point/arrow.js.map +1 -1
- package/lib/tools/shared/point/base-point.js +44 -58
- package/lib/tools/shared/point/base-point.js.map +1 -1
- package/lib/tools/shared/point/index.js +38 -52
- package/lib/tools/shared/point/index.js.map +1 -1
- package/lib/tools/shared/styles.js +8 -31
- package/lib/tools/shared/styles.js.map +1 -1
- package/lib/tools/shared/types.js +1 -5
- package/lib/tools/shared/types.js.map +1 -1
- package/lib/undo-redo.js +27 -67
- package/lib/undo-redo.js.map +1 -1
- package/lib/use-debounce.js +4 -11
- package/lib/use-debounce.js.map +1 -1
- package/lib/utils.js +56 -131
- package/lib/utils.js.map +1 -1
- package/package.json +34 -23
- package/src/__tests__/graph-with-controls.test.jsx +23 -10
- package/src/__tests__/graph.test.jsx +36 -171
- package/src/__tests__/grid.test.jsx +9 -6
- package/src/__tests__/labels.test.jsx +11 -8
- package/src/__tests__/mark-label.test.jsx +15 -17
- package/src/__tests__/toggle-bar.test.jsx +46 -17
- package/src/__tests__/tool-menu.test.jsx +12 -8
- package/src/__tests__/undo-redo.test.jsx +9 -8
- package/src/__tests__/utils.js +3 -0
- package/src/axis/__tests__/arrow.test.jsx +21 -17
- package/src/axis/__tests__/axes.test.jsx +117 -155
- package/src/axis/arrow.jsx +7 -12
- package/src/axis/axes.jsx +41 -51
- package/src/coordinates-label.jsx +13 -18
- package/src/graph-with-controls.jsx +90 -93
- package/src/grid-setup.jsx +210 -206
- package/src/grid.jsx +2 -4
- package/src/labels.jsx +83 -124
- package/src/mark-label.jsx +14 -25
- package/src/toggle-bar.jsx +135 -163
- package/src/tool-menu.jsx +136 -195
- package/src/tools/line/__tests__/component.test.jsx +7 -7
- package/src/tools/line/component.jsx +29 -29
- package/src/tools/polygon/__tests__/component.test.jsx +13 -152
- package/src/tools/polygon/__tests__/line.test.jsx +7 -9
- package/src/tools/polygon/__tests__/polygon.test.jsx +8 -8
- package/src/tools/polygon/component.jsx +2 -4
- package/src/tools/polygon/line.jsx +26 -24
- package/src/tools/polygon/polygon.jsx +35 -40
- package/src/tools/shared/__tests__/arrow-head.test.jsx +16 -17
- package/src/tools/shared/line/__tests__/index.test.jsx +26 -163
- package/src/tools/shared/line/__tests__/line-path.test.jsx +9 -9
- package/src/tools/shared/line/__tests__/with-root-edge.test.jsx +14 -24
- package/src/tools/shared/line/index.jsx +3 -3
- package/src/tools/shared/line/line-path.jsx +51 -48
- package/src/tools/shared/line/with-root-edge.jsx +1 -1
- package/src/tools/shared/point/__tests__/arrow-point.test.jsx +15 -11
- package/src/tools/shared/point/__tests__/base-point.test.jsx +14 -11
- package/src/tools/shared/point/base-point.jsx +33 -6
- package/src/tools/shared/point/index.jsx +30 -32
- package/src/undo-redo.jsx +16 -24
- package/src/__tests__/__snapshots__/graph-with-controls.test.jsx.snap +0 -114
- package/src/__tests__/__snapshots__/graph.test.jsx.snap +0 -213
- package/src/__tests__/__snapshots__/grid.test.jsx.snap +0 -54
- package/src/__tests__/__snapshots__/labels.test.jsx.snap +0 -30
- package/src/__tests__/__snapshots__/mark-label.test.jsx.snap +0 -37
- package/src/__tests__/__snapshots__/toggle-bar.test.jsx.snap +0 -7
- package/src/__tests__/__snapshots__/tool-menu.test.jsx.snap +0 -35
- package/src/__tests__/__snapshots__/undo-redo.test.jsx.snap +0 -15
- package/src/axis/__tests__/__snapshots__/arrow.test.jsx.snap +0 -33
- package/src/axis/__tests__/__snapshots__/axes.test.jsx.snap +0 -122
- package/src/tools/line/__tests__/__snapshots__/component.test.jsx.snap +0 -20
- package/src/tools/polygon/__tests__/__snapshots__/component.test.jsx.snap +0 -94
- package/src/tools/polygon/__tests__/__snapshots__/line.test.jsx.snap +0 -44
- package/src/tools/polygon/__tests__/__snapshots__/polygon.test.jsx.snap +0 -53
- package/src/tools/shared/__tests__/__snapshots__/arrow-head.test.jsx.snap +0 -32
- package/src/tools/shared/line/__tests__/__snapshots__/index.test.jsx.snap +0 -360
- package/src/tools/shared/line/__tests__/__snapshots__/line-path.test.jsx.snap +0 -57
- package/src/tools/shared/line/__tests__/__snapshots__/with-root-edge.test.jsx.snap +0 -63
- package/src/tools/shared/point/__tests__/__snapshots__/arrow-point.test.jsx.snap +0 -55
- package/src/tools/shared/point/__tests__/__snapshots__/base-point.test.jsx.snap +0 -43
package/src/labels.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { types } from '@pie-lib/plot';
|
|
5
5
|
import { color, Readable } from '@pie-lib/render-ui';
|
|
6
6
|
import EditableHtml from '@pie-lib/editable-html';
|
|
@@ -16,24 +16,15 @@ const rotations = {
|
|
|
16
16
|
export const getTransform = (side, width, height) => {
|
|
17
17
|
const t = (x, y, rotate) => `translate(${x}, ${y}), rotate(${rotate})`;
|
|
18
18
|
|
|
19
|
-
if (side === 'left')
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (side === '
|
|
23
|
-
return t(width + 30, height / 2, rotations[side]);
|
|
24
|
-
}
|
|
25
|
-
if (side === 'top') {
|
|
26
|
-
return t(width / 2, -20, rotations[side]);
|
|
27
|
-
}
|
|
28
|
-
if (side === 'bottom') {
|
|
29
|
-
return t(width / 2, height + 30, rotations[side]);
|
|
30
|
-
}
|
|
19
|
+
if (side === 'left') return t(-20, height / 2, rotations[side]);
|
|
20
|
+
if (side === 'right') return t(width + 30, height / 2, rotations[side]);
|
|
21
|
+
if (side === 'top') return t(width / 2, -20, rotations[side]);
|
|
22
|
+
if (side === 'bottom') return t(width / 2, height + 30, rotations[side]);
|
|
31
23
|
};
|
|
32
24
|
|
|
33
25
|
const getY = (side, height) => {
|
|
34
26
|
switch (side) {
|
|
35
27
|
case 'left':
|
|
36
|
-
return -height;
|
|
37
28
|
case 'top':
|
|
38
29
|
return -height;
|
|
39
30
|
case 'right':
|
|
@@ -43,15 +34,40 @@ const getY = (side, height) => {
|
|
|
43
34
|
}
|
|
44
35
|
};
|
|
45
36
|
|
|
37
|
+
const PREFIX = 'Label';
|
|
38
|
+
const classes = {
|
|
39
|
+
label: `${PREFIX}-label`,
|
|
40
|
+
axisLabel: `${PREFIX}-axisLabel`,
|
|
41
|
+
disabledAxisLabel: `${PREFIX}-disabledAxisLabel`,
|
|
42
|
+
bottomLabel: `${PREFIX}-bottomLabel`,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const Root = styled('div')(({ theme }) => ({
|
|
46
|
+
[`& .${classes.label}`]: {
|
|
47
|
+
fill: color.defaults.SECONDARY,
|
|
48
|
+
},
|
|
49
|
+
[`& .${classes.axisLabel}`]: {
|
|
50
|
+
fontSize: theme.typography.fontSize - 2,
|
|
51
|
+
textAlign: 'center',
|
|
52
|
+
padding: '0 4px',
|
|
53
|
+
},
|
|
54
|
+
[`& .${classes.disabledAxisLabel}`]: {
|
|
55
|
+
pointerEvents: 'none',
|
|
56
|
+
},
|
|
57
|
+
[`& .${classes.bottomLabel}`]: {
|
|
58
|
+
marginTop: '44px',
|
|
59
|
+
},
|
|
60
|
+
}));
|
|
61
|
+
|
|
46
62
|
class RawLabel extends React.Component {
|
|
47
63
|
static propTypes = {
|
|
48
64
|
text: PropTypes.string,
|
|
49
65
|
side: PropTypes.string,
|
|
50
|
-
classes: PropTypes.object,
|
|
51
66
|
disabledLabel: PropTypes.bool,
|
|
52
67
|
placeholder: PropTypes.string,
|
|
53
68
|
graphProps: types.GraphPropsType.isRequired,
|
|
54
69
|
onChange: PropTypes.func,
|
|
70
|
+
mathMlOptions: PropTypes.object,
|
|
55
71
|
};
|
|
56
72
|
|
|
57
73
|
static defaultProps = {
|
|
@@ -59,7 +75,7 @@ class RawLabel extends React.Component {
|
|
|
59
75
|
};
|
|
60
76
|
|
|
61
77
|
render() {
|
|
62
|
-
const { disabledLabel, placeholder, text, side, graphProps,
|
|
78
|
+
const { disabledLabel, placeholder, text, side, graphProps, onChange, mathMlOptions = {} } = this.props;
|
|
63
79
|
const { size, domain, range } = graphProps;
|
|
64
80
|
const totalHeight = (size.height || 500) + (range.padding || 0) * 2;
|
|
65
81
|
const totalWidth = (size.width || 500) + (domain.padding || 0) * 2;
|
|
@@ -70,67 +86,45 @@ class RawLabel extends React.Component {
|
|
|
70
86
|
const y = getY(side, height);
|
|
71
87
|
const finalHeight = side === 'bottom' ? height + 22 : height + 18;
|
|
72
88
|
|
|
73
|
-
const activePlugins = [
|
|
74
|
-
'bold',
|
|
75
|
-
'italic',
|
|
76
|
-
'underline',
|
|
77
|
-
'strikethrough',
|
|
78
|
-
'math',
|
|
79
|
-
// 'languageCharacters'
|
|
80
|
-
];
|
|
89
|
+
const activePlugins = ['bold', 'italic', 'underline', 'strikethrough', 'math'];
|
|
81
90
|
|
|
82
91
|
return (
|
|
83
|
-
<
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
92
|
+
<Root>
|
|
93
|
+
<foreignObject
|
|
94
|
+
x={-(width / 2)}
|
|
95
|
+
y={y}
|
|
96
|
+
width={width}
|
|
97
|
+
height={finalHeight}
|
|
98
|
+
transform={transform}
|
|
99
|
+
textAnchor="middle"
|
|
100
|
+
>
|
|
101
|
+
<Readable>
|
|
102
|
+
<EditableHtml
|
|
103
|
+
className={cn(
|
|
104
|
+
{
|
|
105
|
+
[classes.bottomLabel]: side === 'bottom',
|
|
106
|
+
[classes.disabledAxisLabel]: disabledLabel,
|
|
107
|
+
},
|
|
108
|
+
classes.axisLabel,
|
|
109
|
+
)}
|
|
110
|
+
markup={text || ''}
|
|
111
|
+
onChange={onChange}
|
|
112
|
+
placeholder={!disabledLabel && placeholder}
|
|
113
|
+
toolbarOpts={{
|
|
114
|
+
position: side === 'bottom' ? 'top' : 'bottom',
|
|
115
|
+
noPadding: true,
|
|
116
|
+
noBorder: true,
|
|
117
|
+
}}
|
|
118
|
+
activePlugins={activePlugins}
|
|
119
|
+
mathMlOptions={mathMlOptions}
|
|
120
|
+
/>
|
|
121
|
+
</Readable>
|
|
122
|
+
</foreignObject>
|
|
123
|
+
</Root>
|
|
113
124
|
);
|
|
114
125
|
}
|
|
115
126
|
}
|
|
116
127
|
|
|
117
|
-
const Label = withStyles((theme) => ({
|
|
118
|
-
label: {
|
|
119
|
-
fill: color.defaults.SECONDARY,
|
|
120
|
-
},
|
|
121
|
-
axisLabel: {
|
|
122
|
-
fontSize: theme.typography.fontSize - 2,
|
|
123
|
-
textAlign: 'center',
|
|
124
|
-
padding: '0 4px',
|
|
125
|
-
},
|
|
126
|
-
disabledAxisLabel: {
|
|
127
|
-
pointerEvents: 'none',
|
|
128
|
-
},
|
|
129
|
-
bottomLabel: {
|
|
130
|
-
marginTop: '44px',
|
|
131
|
-
},
|
|
132
|
-
}))(RawLabel);
|
|
133
|
-
|
|
134
128
|
export const LabelType = {
|
|
135
129
|
left: PropTypes.string,
|
|
136
130
|
top: PropTypes.string,
|
|
@@ -140,24 +134,17 @@ export const LabelType = {
|
|
|
140
134
|
|
|
141
135
|
export class Labels extends React.Component {
|
|
142
136
|
static propTypes = {
|
|
143
|
-
classes: PropTypes.object,
|
|
144
|
-
className: PropTypes.string,
|
|
145
137
|
disabledLabels: PropTypes.bool,
|
|
146
138
|
placeholders: PropTypes.object,
|
|
147
139
|
value: PropTypes.shape(LabelType),
|
|
148
140
|
graphProps: PropTypes.object,
|
|
149
|
-
onChange: PropTypes.
|
|
141
|
+
onChange: PropTypes.func,
|
|
142
|
+
mathMlOptions: PropTypes.object,
|
|
150
143
|
};
|
|
151
144
|
|
|
152
|
-
static defaultProps = {};
|
|
153
|
-
|
|
154
145
|
onChangeLabel = (newValue, side) => {
|
|
155
146
|
const { value, onChange } = this.props;
|
|
156
|
-
const labels = {
|
|
157
|
-
...value,
|
|
158
|
-
[side]: newValue,
|
|
159
|
-
};
|
|
160
|
-
|
|
147
|
+
const labels = { ...value, [side]: newValue };
|
|
161
148
|
onChange(labels);
|
|
162
149
|
};
|
|
163
150
|
|
|
@@ -165,50 +152,22 @@ export class Labels extends React.Component {
|
|
|
165
152
|
const { disabledLabels, placeholders = {}, value = {}, graphProps, mathMlOptions = {} } = this.props;
|
|
166
153
|
|
|
167
154
|
return (
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
text={value.top}
|
|
183
|
-
disabledLabel={disabledLabels}
|
|
184
|
-
placeholder={placeholders.top}
|
|
185
|
-
graphProps={graphProps}
|
|
186
|
-
onChange={(value) => this.onChangeLabel(value, 'top')}
|
|
187
|
-
mathMlOptions={mathMlOptions}
|
|
188
|
-
/>
|
|
189
|
-
<Label
|
|
190
|
-
key="bottom"
|
|
191
|
-
side="bottom"
|
|
192
|
-
text={value.bottom}
|
|
193
|
-
disabledLabel={disabledLabels}
|
|
194
|
-
placeholder={placeholders.bottom}
|
|
195
|
-
graphProps={graphProps}
|
|
196
|
-
onChange={(value) => this.onChangeLabel(value, 'bottom')}
|
|
197
|
-
mathMlOptions={mathMlOptions}
|
|
198
|
-
/>
|
|
199
|
-
<Label
|
|
200
|
-
key="right"
|
|
201
|
-
side="right"
|
|
202
|
-
text={value.right}
|
|
203
|
-
disabledLabel={disabledLabels}
|
|
204
|
-
placeholder={placeholders.right}
|
|
205
|
-
graphProps={graphProps}
|
|
206
|
-
onChange={(value) => this.onChangeLabel(value, 'right')}
|
|
207
|
-
mathMlOptions={mathMlOptions}
|
|
208
|
-
/>
|
|
209
|
-
</React.Fragment>
|
|
155
|
+
<>
|
|
156
|
+
{['left', 'top', 'bottom', 'right'].map((side) => (
|
|
157
|
+
<RawLabel
|
|
158
|
+
key={side}
|
|
159
|
+
side={side}
|
|
160
|
+
text={value[side]}
|
|
161
|
+
disabledLabel={disabledLabels}
|
|
162
|
+
placeholder={placeholders[side]}
|
|
163
|
+
graphProps={graphProps}
|
|
164
|
+
onChange={(val) => this.onChangeLabel(val, side)}
|
|
165
|
+
mathMlOptions={mathMlOptions}
|
|
166
|
+
/>
|
|
167
|
+
))}
|
|
168
|
+
</>
|
|
210
169
|
);
|
|
211
170
|
}
|
|
212
171
|
}
|
|
213
172
|
|
|
214
|
-
export default
|
|
173
|
+
export default RawLabel;
|
package/src/mark-label.jsx
CHANGED
|
@@ -1,32 +1,25 @@
|
|
|
1
1
|
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
-
import cn from 'classnames';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
|
-
import {
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
5
4
|
import AutosizeInput from 'react-input-autosize';
|
|
6
5
|
import { useDebounce } from './use-debounce';
|
|
7
6
|
import { types } from '@pie-lib/plot';
|
|
8
7
|
import { color } from '@pie-lib/render-ui';
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
|
|
9
|
+
const StyledAutosizeInput = styled(AutosizeInput, {
|
|
10
|
+
shouldForwardProp: (prop) => !['disabled', 'markDisabled'].includes(prop),
|
|
11
|
+
})(({ theme, disabled, markDisabled }) => ({
|
|
12
|
+
'& input': {
|
|
12
13
|
float: 'right',
|
|
13
|
-
padding: theme.spacing
|
|
14
|
+
padding: theme.spacing(0.5),
|
|
14
15
|
fontFamily: theme.typography.fontFamily,
|
|
15
16
|
fontSize: theme.typography.fontSize,
|
|
16
|
-
border: `solid 1px ${color.defaults.SECONDARY}`,
|
|
17
|
+
border: `solid 1px ${disabled ? color.defaults.PRIMARY_DARK : markDisabled ? color.disabled() : color.defaults.SECONDARY}`,
|
|
17
18
|
borderRadius: '3px',
|
|
18
|
-
color: color.defaults.PRIMARY_DARK,
|
|
19
|
+
color: markDisabled ? color.disabled() : color.defaults.PRIMARY_DARK,
|
|
20
|
+
background: (disabled || markDisabled) ? theme.palette.background.paper : 'transparent',
|
|
19
21
|
},
|
|
20
|
-
|
|
21
|
-
border: `solid 1px ${color.defaults.PRIMARY_DARK}`,
|
|
22
|
-
background: theme.palette.background.paper,
|
|
23
|
-
},
|
|
24
|
-
disabledMark: {
|
|
25
|
-
border: `solid 1px ${color.disabled()}`,
|
|
26
|
-
background: theme.palette.background.paper,
|
|
27
|
-
color: color.disabled(),
|
|
28
|
-
},
|
|
29
|
-
});
|
|
22
|
+
}));
|
|
30
23
|
|
|
31
24
|
export const position = (graphProps, mark, rect) => {
|
|
32
25
|
rect = rect || { width: 0, height: 0 };
|
|
@@ -73,7 +66,7 @@ export const MarkLabel = (props) => {
|
|
|
73
66
|
const [input, setInput] = useState(null);
|
|
74
67
|
const _ref = useCallback((node) => setInput(node));
|
|
75
68
|
|
|
76
|
-
const { mark, graphProps,
|
|
69
|
+
const { mark, graphProps, disabled, inputRef: externalInputRef } = props;
|
|
77
70
|
|
|
78
71
|
const [label, setLabel] = useState(mark.label);
|
|
79
72
|
|
|
@@ -106,16 +99,13 @@ export const MarkLabel = (props) => {
|
|
|
106
99
|
const disabledInput = disabled || mark.disabled;
|
|
107
100
|
|
|
108
101
|
return (
|
|
109
|
-
<
|
|
102
|
+
<StyledAutosizeInput
|
|
110
103
|
inputRef={(r) => {
|
|
111
104
|
_ref(r);
|
|
112
105
|
externalInputRef(r);
|
|
113
106
|
}}
|
|
114
107
|
disabled={disabledInput}
|
|
115
|
-
|
|
116
|
-
[classes.disabled]: disabled,
|
|
117
|
-
[classes.disabledMark]: mark.disabled,
|
|
118
|
-
})}
|
|
108
|
+
markDisabled={mark.disabled}
|
|
119
109
|
value={label}
|
|
120
110
|
style={style}
|
|
121
111
|
onChange={onChange}
|
|
@@ -127,10 +117,9 @@ MarkLabel.propTypes = {
|
|
|
127
117
|
disabled: PropTypes.bool,
|
|
128
118
|
onChange: PropTypes.func,
|
|
129
119
|
graphProps: types.GraphPropsType,
|
|
130
|
-
classes: PropTypes.object,
|
|
131
120
|
inputRef: PropTypes.func,
|
|
132
121
|
mark: PropTypes.object,
|
|
133
122
|
theme: PropTypes.object,
|
|
134
123
|
};
|
|
135
124
|
|
|
136
|
-
export default
|
|
125
|
+
export default MarkLabel;
|