@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.
@@ -3472,17 +3472,20 @@ var SIZE_MAP$2 = {
3472
3472
  small: {
3473
3473
  className: 'ant-input-sm',
3474
3474
  top: 1,
3475
- bottom: 1
3475
+ bottom: 1,
3476
+ minHeight: 24
3476
3477
  },
3477
3478
  middle: {
3478
3479
  className: 'ant-input-md',
3479
3480
  top: 1,
3480
- bottom: 1
3481
+ bottom: 1,
3482
+ minHeight: 32
3481
3483
  },
3482
3484
  large: {
3483
3485
  className: 'ant-input-lg',
3484
3486
  top: 3,
3485
- bottom: 2
3487
+ bottom: 2,
3488
+ minHeight: 40
3486
3489
  }
3487
3490
  };
3488
3491
  var themeMap$2 = {
@@ -3493,7 +3496,9 @@ var containerDisabledClassName$2 = /*#__PURE__*/css(_templateObject$2 || (_templ
3493
3496
  var containerReadOnlyClassName$2 = /*#__PURE__*/css(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .monaco-editor .cursors-layer > .cursor {\n opacity: 0 !important;\n }\n"])));
3494
3497
  function SqlEditor(props) {
3495
3498
  var id = v4();
3496
- var _props$size = props.size,
3499
+ var maxHeight = props.maxHeight,
3500
+ fontSize = props.fontSize,
3501
+ _props$size = props.size,
3497
3502
  size = _props$size === void 0 ? 'middle' : _props$size,
3498
3503
  _props$theme = props.theme,
3499
3504
  theme = _props$theme === void 0 ? 'light' : _props$theme,
@@ -3509,6 +3514,7 @@ function SqlEditor(props) {
3509
3514
  onChange = props.onChange,
3510
3515
  onEnter = props.onEnter,
3511
3516
  onBlur = props.onBlur,
3517
+ onFocus = props.onFocus,
3512
3518
  editorDidMount = props.editorDidMount;
3513
3519
  var containerRef = useRef(null);
3514
3520
  var editorRef = useRef(null);
@@ -3572,6 +3578,7 @@ function SqlEditor(props) {
3572
3578
  });
3573
3579
  editor$1.onDidFocusEditorText(function () {
3574
3580
  isEditorFocused.set(true);
3581
+ onFocus == null || onFocus(editor$1.getValue());
3575
3582
  });
3576
3583
  // set the height of the editor container
3577
3584
  var updateElementHeight = function updateElementHeight() {
@@ -3624,7 +3631,13 @@ function SqlEditor(props) {
3624
3631
  };
3625
3632
  var themeValue = themeMap$2[theme];
3626
3633
  return React.createElement("div", {
3627
- className: 'ant-input' + (size ? " " + SIZE_MAP$2[size].className : '') + (disabled ? " ant-input-disabled " + containerDisabledClassName$2 : '') + (readOnly ? " " + containerReadOnlyClassName$2 : '')
3634
+ className: 'ant-input' + (size ? " " + SIZE_MAP$2[size].className : '') + (disabled ? " ant-input-disabled " + containerDisabledClassName$2 : '') + (readOnly ? " " + containerReadOnlyClassName$2 : ''),
3635
+ style: {
3636
+ resize: 'vertical',
3637
+ overflow: 'auto',
3638
+ minHeight: SIZE_MAP$2[size].minHeight,
3639
+ maxHeight: maxHeight
3640
+ }
3628
3641
  }, React.createElement("div", {
3629
3642
  ref: containerRef
3630
3643
  }, React.createElement(MonacoEditor, {
@@ -3647,9 +3660,11 @@ function SqlEditor(props) {
3647
3660
  readOnly: readOnly || disabled,
3648
3661
  scrollBeyondLastLine: false,
3649
3662
  smoothScrolling: true,
3663
+ fontSize: fontSize,
3650
3664
  tabSize: 2,
3651
3665
  wordWrap: 'on',
3652
3666
  automaticLayout: true,
3667
+ fixedOverflowWidgets: true,
3653
3668
  glyphMargin: false,
3654
3669
  lineNumbers: 'off',
3655
3670
  lineNumbersMinChars: 0,
@@ -3659,7 +3674,12 @@ function SqlEditor(props) {
3659
3674
  overviewRulerLanes: 0,
3660
3675
  placeholder: placeholder,
3661
3676
  renderLineHighlight: 'none',
3662
- occurrencesHighlight: 'off'
3677
+ occurrencesHighlight: 'off',
3678
+ scrollbar: {
3679
+ vertical: 'hidden',
3680
+ horizontal: 'hidden',
3681
+ alwaysConsumeMouseWheel: false
3682
+ }
3663
3683
  }
3664
3684
  })));
3665
3685
  }