@fc-components/monaco-editor 0.1.18 → 0.1.20
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 +26 -6
- 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 +26 -6
- package/dist/monaco-editor.esm.js.map +1 -1
- package/dist/sql/index.d.ts +3 -0
- package/package.json +1 -1
- package/src/sql/index.tsx +20 -2
|
@@ -3478,17 +3478,20 @@ var SIZE_MAP$2 = {
|
|
|
3478
3478
|
small: {
|
|
3479
3479
|
className: 'ant-input-sm',
|
|
3480
3480
|
top: 1,
|
|
3481
|
-
bottom: 1
|
|
3481
|
+
bottom: 1,
|
|
3482
|
+
minHeight: 24
|
|
3482
3483
|
},
|
|
3483
3484
|
middle: {
|
|
3484
3485
|
className: 'ant-input-md',
|
|
3485
3486
|
top: 1,
|
|
3486
|
-
bottom: 1
|
|
3487
|
+
bottom: 1,
|
|
3488
|
+
minHeight: 32
|
|
3487
3489
|
},
|
|
3488
3490
|
large: {
|
|
3489
3491
|
className: 'ant-input-lg',
|
|
3490
3492
|
top: 3,
|
|
3491
|
-
bottom: 2
|
|
3493
|
+
bottom: 2,
|
|
3494
|
+
minHeight: 40
|
|
3492
3495
|
}
|
|
3493
3496
|
};
|
|
3494
3497
|
var themeMap$2 = {
|
|
@@ -3499,7 +3502,9 @@ var containerDisabledClassName$2 = /*#__PURE__*/css.css(_templateObject$2 || (_t
|
|
|
3499
3502
|
var containerReadOnlyClassName$2 = /*#__PURE__*/css.css(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important;\n }\n"])));
|
|
3500
3503
|
function SqlEditor(props) {
|
|
3501
3504
|
var id = uuid.v4();
|
|
3502
|
-
var
|
|
3505
|
+
var maxHeight = props.maxHeight,
|
|
3506
|
+
fontSize = props.fontSize,
|
|
3507
|
+
_props$size = props.size,
|
|
3503
3508
|
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
3504
3509
|
_props$theme = props.theme,
|
|
3505
3510
|
theme = _props$theme === void 0 ? 'light' : _props$theme,
|
|
@@ -3515,6 +3520,7 @@ function SqlEditor(props) {
|
|
|
3515
3520
|
onChange = props.onChange,
|
|
3516
3521
|
onEnter = props.onEnter,
|
|
3517
3522
|
onBlur = props.onBlur,
|
|
3523
|
+
onFocus = props.onFocus,
|
|
3518
3524
|
editorDidMount = props.editorDidMount;
|
|
3519
3525
|
var containerRef = React.useRef(null);
|
|
3520
3526
|
var editorRef = React.useRef(null);
|
|
@@ -3578,6 +3584,7 @@ function SqlEditor(props) {
|
|
|
3578
3584
|
});
|
|
3579
3585
|
editor.onDidFocusEditorText(function () {
|
|
3580
3586
|
isEditorFocused.set(true);
|
|
3587
|
+
onFocus == null || onFocus(editor.getValue());
|
|
3581
3588
|
});
|
|
3582
3589
|
// set the height of the editor container
|
|
3583
3590
|
var updateElementHeight = function updateElementHeight() {
|
|
@@ -3630,7 +3637,13 @@ function SqlEditor(props) {
|
|
|
3630
3637
|
};
|
|
3631
3638
|
var themeValue = themeMap$2[theme];
|
|
3632
3639
|
return React__default.createElement("div", {
|
|
3633
|
-
className: 'ant-input' + (size ? " " + SIZE_MAP$2[size].className : '') + (disabled ? " ant-input-disabled " + containerDisabledClassName$2 : '') + (readOnly ? " " + containerReadOnlyClassName$2 : '')
|
|
3640
|
+
className: 'ant-input' + (size ? " " + SIZE_MAP$2[size].className : '') + (disabled ? " ant-input-disabled " + containerDisabledClassName$2 : '') + (readOnly ? " " + containerReadOnlyClassName$2 : ''),
|
|
3641
|
+
style: {
|
|
3642
|
+
resize: 'vertical',
|
|
3643
|
+
overflow: 'auto',
|
|
3644
|
+
minHeight: SIZE_MAP$2[size].minHeight,
|
|
3645
|
+
maxHeight: maxHeight
|
|
3646
|
+
}
|
|
3634
3647
|
}, React__default.createElement("div", {
|
|
3635
3648
|
ref: containerRef
|
|
3636
3649
|
}, React__default.createElement(MonacoEditor, {
|
|
@@ -3653,9 +3666,11 @@ function SqlEditor(props) {
|
|
|
3653
3666
|
readOnly: readOnly || disabled,
|
|
3654
3667
|
scrollBeyondLastLine: false,
|
|
3655
3668
|
smoothScrolling: true,
|
|
3669
|
+
fontSize: fontSize,
|
|
3656
3670
|
tabSize: 2,
|
|
3657
3671
|
wordWrap: 'on',
|
|
3658
3672
|
automaticLayout: true,
|
|
3673
|
+
fixedOverflowWidgets: true,
|
|
3659
3674
|
glyphMargin: false,
|
|
3660
3675
|
lineNumbers: 'off',
|
|
3661
3676
|
lineNumbersMinChars: 0,
|
|
@@ -3665,7 +3680,12 @@ function SqlEditor(props) {
|
|
|
3665
3680
|
overviewRulerLanes: 0,
|
|
3666
3681
|
placeholder: placeholder,
|
|
3667
3682
|
renderLineHighlight: 'none',
|
|
3668
|
-
occurrencesHighlight: 'off'
|
|
3683
|
+
occurrencesHighlight: 'off',
|
|
3684
|
+
scrollbar: {
|
|
3685
|
+
vertical: 'hidden',
|
|
3686
|
+
horizontal: 'hidden',
|
|
3687
|
+
alwaysConsumeMouseWheel: false
|
|
3688
|
+
}
|
|
3669
3689
|
}
|
|
3670
3690
|
})));
|
|
3671
3691
|
}
|