@fc-components/monaco-editor 0.1.21 → 0.1.23
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/dist/monaco-editor.cjs.development.js +11 -10
- package/dist/monaco-editor.cjs.development.js.map +1 -1
- package/dist/monaco-editor.cjs.production.min.js +1 -1
- package/dist/monaco-editor.cjs.production.min.js.map +1 -1
- package/dist/monaco-editor.esm.js +11 -10
- package/dist/monaco-editor.esm.js.map +1 -1
- package/dist/sql/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/promql/index.tsx +2 -5
- package/src/sql/index.tsx +12 -3
package/dist/sql/index.d.ts
CHANGED
package/package.json
CHANGED
package/src/promql/index.tsx
CHANGED
|
@@ -89,7 +89,7 @@ const getStyles = (placeholder?: string) => {
|
|
|
89
89
|
export default function PromQLEditor(props: PromQLEditorProps & DataProviderParams) {
|
|
90
90
|
const id = uuidv4();
|
|
91
91
|
const {
|
|
92
|
-
className
|
|
92
|
+
className,
|
|
93
93
|
size = 'middle',
|
|
94
94
|
theme = 'light',
|
|
95
95
|
value,
|
|
@@ -347,11 +347,8 @@ export default function PromQLEditor(props: PromQLEditorProps & DataProviderPara
|
|
|
347
347
|
(size ? ` ${SIZE_MAP[size].className}` : '') +
|
|
348
348
|
(disabled ? ` ant-input-disabled ${containerDisabledClassName}` : '') +
|
|
349
349
|
(readOnly ? ` ${containerReadOnlyClassName}` : '') +
|
|
350
|
-
` ${className}`
|
|
350
|
+
(className ? ` ${className}` : '')
|
|
351
351
|
}
|
|
352
|
-
style={{
|
|
353
|
-
display: 'block',
|
|
354
|
-
}}
|
|
355
352
|
>
|
|
356
353
|
<div ref={containerRef}>
|
|
357
354
|
<MonacoEditor
|
package/src/sql/index.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import { language, languageConfiguration } from './sql';
|
|
|
8
8
|
import { getSqlCompletionProvider } from './completion/getCompletionProvider';
|
|
9
9
|
|
|
10
10
|
interface SqlEditorProps {
|
|
11
|
+
className?: string;
|
|
11
12
|
maxHeight?: number | string;
|
|
12
13
|
fontSize?: number;
|
|
13
14
|
size?: 'small' | 'middle' | 'large';
|
|
@@ -75,6 +76,7 @@ const containerReadOnlyClassName = css`
|
|
|
75
76
|
export default function SqlEditor(props: SqlEditorProps) {
|
|
76
77
|
const id = uuidv4();
|
|
77
78
|
const {
|
|
79
|
+
className,
|
|
78
80
|
maxHeight,
|
|
79
81
|
fontSize,
|
|
80
82
|
size = 'middle',
|
|
@@ -163,7 +165,7 @@ export default function SqlEditor(props: SqlEditorProps) {
|
|
|
163
165
|
const containerDiv = containerRef.current;
|
|
164
166
|
if (containerDiv !== null) {
|
|
165
167
|
const pixelHeight = editor.getContentHeight();
|
|
166
|
-
containerDiv.style.
|
|
168
|
+
containerDiv.style.minHeight = `${pixelHeight}px`;
|
|
167
169
|
containerDiv.style.width = '100%';
|
|
168
170
|
const pixelWidth = containerDiv.clientWidth;
|
|
169
171
|
editor.layout({ width: pixelWidth, height: pixelHeight });
|
|
@@ -229,16 +231,23 @@ export default function SqlEditor(props: SqlEditorProps) {
|
|
|
229
231
|
'ant-input' +
|
|
230
232
|
(size ? ` ${SIZE_MAP[size].className}` : '') +
|
|
231
233
|
(disabled ? ` ant-input-disabled ${containerDisabledClassName}` : '') +
|
|
232
|
-
(readOnly ? ` ${containerReadOnlyClassName}` : '')
|
|
234
|
+
(readOnly ? ` ${containerReadOnlyClassName}` : '') +
|
|
235
|
+
(className ? ` ${className}` : '')
|
|
233
236
|
}
|
|
234
237
|
style={{
|
|
238
|
+
display: 'block',
|
|
235
239
|
resize: 'vertical',
|
|
236
240
|
overflow: 'auto',
|
|
237
241
|
minHeight: SIZE_MAP[size].minHeight,
|
|
238
242
|
maxHeight,
|
|
239
243
|
}}
|
|
240
244
|
>
|
|
241
|
-
<div
|
|
245
|
+
<div
|
|
246
|
+
ref={containerRef}
|
|
247
|
+
style={{
|
|
248
|
+
height: '100%',
|
|
249
|
+
}}
|
|
250
|
+
>
|
|
242
251
|
<MonacoEditor
|
|
243
252
|
width='100%'
|
|
244
253
|
height='100%'
|