@leankylin-sheet/react 3.1.42 → 3.1.44

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/index.esm.js CHANGED
@@ -630,6 +630,8 @@ var RowHeader = function RowHeader() {
630
630
  var ContentEditable = function ContentEditable(_ref) {
631
631
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
632
632
  var lastHtml = useRef("");
633
+ var _useContext = useContext(WorkbookContext),
634
+ settings = _useContext.settings;
633
635
  var root = useRef(null);
634
636
  var autoFocus = props.autoFocus,
635
637
  initialContent = props.initialContent,
@@ -667,7 +669,9 @@ var ContentEditable = function ContentEditable(_ref) {
667
669
  return e.stopPropagation();
668
670
  },
669
671
  onClick: function onClick(e) {
670
- return e.stopPropagation();
672
+ var _settings$onClickCont;
673
+ e.stopPropagation();
674
+ (_settings$onClickCont = settings.onClickContentEditable) === null || _settings$onClickCont === void 0 ? void 0 : _settings$onClickCont.call(settings, e);
671
675
  }
672
676
  }, _.omit(props, "innerRef", "onChange", "html", "onBlur", "autoFocus", "allowEdit", "initialContent")), {}, {
673
677
  ref: function ref(e) {
@@ -9453,67 +9457,6 @@ var SVGDefines = function SVGDefines() {
9453
9457
  }))));
9454
9458
  };
9455
9459
 
9456
- var ChangeColor = function ChangeColor(_ref) {
9457
- var triggerParentUpdate = _ref.triggerParentUpdate;
9458
- var _useContext = useContext(WorkbookContext),
9459
- context = _useContext.context,
9460
- setContext = _useContext.setContext;
9461
- var _locale = locale(context),
9462
- toolbar = _locale.toolbar,
9463
- sheetconfig = _locale.sheetconfig,
9464
- button = _locale.button;
9465
- var _useState = useState("#000000"),
9466
- _useState2 = _slicedToArray(_useState, 2),
9467
- inputColor = _useState2[0],
9468
- setInputColor = _useState2[1];
9469
- var _useState3 = useState(context.luckysheetfile[getSheetIndex(context, context.currentSheetId)].color),
9470
- _useState4 = _slicedToArray(_useState3, 2),
9471
- selectColor = _useState4[0],
9472
- setSelectColor = _useState4[1];
9473
- var certainBtn = useCallback(function () {
9474
- setSelectColor(inputColor);
9475
- }, [inputColor]);
9476
- useEffect(function () {
9477
- setContext(function (ctx) {
9478
- if (ctx.allowEdit === false) return;
9479
- var index = getSheetIndex(ctx, ctx.currentSheetId);
9480
- ctx.luckysheetfile[index].color = selectColor;
9481
- });
9482
- }, [selectColor, setContext]);
9483
- return /*#__PURE__*/React.createElement("div", {
9484
- id: "leankylin-change-color"
9485
- }, /*#__PURE__*/React.createElement("div", {
9486
- className: "color-reset",
9487
- onClick: function onClick() {
9488
- return setSelectColor(undefined);
9489
- }
9490
- }, sheetconfig.resetColor), /*#__PURE__*/React.createElement("div", {
9491
- className: "custom-color"
9492
- }, /*#__PURE__*/React.createElement("div", null, toolbar.customColor, ":"), /*#__PURE__*/React.createElement("input", {
9493
- type: "color",
9494
- value: inputColor,
9495
- onChange: function onChange(e) {
9496
- return setInputColor(e.target.value);
9497
- },
9498
- onFocus: function onFocus() {
9499
- triggerParentUpdate(true);
9500
- },
9501
- onBlur: function onBlur() {
9502
- triggerParentUpdate(false);
9503
- }
9504
- }), /*#__PURE__*/React.createElement("div", {
9505
- className: "button-basic button-primary",
9506
- onClick: function onClick() {
9507
- certainBtn();
9508
- }
9509
- }, button.confirm)), /*#__PURE__*/React.createElement(ColorPicker, {
9510
- onPick: function onPick(color) {
9511
- setInputColor(color);
9512
- setSelectColor(color);
9513
- }
9514
- }));
9515
- };
9516
-
9517
9460
  var SheetTabContextMenu = function SheetTabContextMenu() {
9518
9461
  var _settings$sheetTabCon;
9519
9462
  var _useContext = useContext(WorkbookContext),
@@ -9611,6 +9554,13 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
9611
9554
  });
9612
9555
  });
9613
9556
  }, [context.allowEdit, setContext, sheet === null || sheet === void 0 ? void 0 : sheet.id]);
9557
+ var changeColor = function changeColor(selectColor) {
9558
+ setContext(function (ctx) {
9559
+ if (ctx.allowEdit === false) return;
9560
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
9561
+ ctx.luckysheetfile[index].color = selectColor;
9562
+ });
9563
+ };
9614
9564
  if (!sheet || x == null || y == null) return null;
9615
9565
  return /*#__PURE__*/React.createElement("div", {
9616
9566
  className: "leankylin-context-menu luckysheet-cols-menu",
@@ -9707,9 +9657,15 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
9707
9657
  }, /*#__PURE__*/React.createElement(SVGIcon, {
9708
9658
  name: "rightArrow",
9709
9659
  width: 18
9710
- })), isShowChangeColor && context.allowEdit && ( /*#__PURE__*/React.createElement(ChangeColor, {
9711
- triggerParentUpdate: updateShowInputColor
9712
- })));
9660
+ })), isShowChangeColor && context.allowEdit && ( /*#__PURE__*/React.createElement("div", {
9661
+ className: "leankylin-sheet-color-change"
9662
+ }, /*#__PURE__*/React.createElement(CustomColor, {
9663
+ onCustomPick: function onCustomPick(color) {
9664
+ changeColor(color);
9665
+ setIsShowChangeColor(false);
9666
+ },
9667
+ onColorPick: changeColor
9668
+ }))));
9713
9669
  }
9714
9670
  if (name === "focus") {
9715
9671
  return /*#__PURE__*/React.createElement(Menu, {
package/dist/index.js CHANGED
@@ -640,6 +640,8 @@ var RowHeader = function RowHeader() {
640
640
  var ContentEditable = function ContentEditable(_ref) {
641
641
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
642
642
  var lastHtml = React.useRef("");
643
+ var _useContext = React.useContext(WorkbookContext),
644
+ settings = _useContext.settings;
643
645
  var root = React.useRef(null);
644
646
  var autoFocus = props.autoFocus,
645
647
  initialContent = props.initialContent,
@@ -677,7 +679,9 @@ var ContentEditable = function ContentEditable(_ref) {
677
679
  return e.stopPropagation();
678
680
  },
679
681
  onClick: function onClick(e) {
680
- return e.stopPropagation();
682
+ var _settings$onClickCont;
683
+ e.stopPropagation();
684
+ (_settings$onClickCont = settings.onClickContentEditable) === null || _settings$onClickCont === void 0 ? void 0 : _settings$onClickCont.call(settings, e);
681
685
  }
682
686
  }, ___default['default'].omit(props, "innerRef", "onChange", "html", "onBlur", "autoFocus", "allowEdit", "initialContent")), {}, {
683
687
  ref: function ref(e) {
@@ -9463,67 +9467,6 @@ var SVGDefines = function SVGDefines() {
9463
9467
  }))));
9464
9468
  };
9465
9469
 
9466
- var ChangeColor = function ChangeColor(_ref) {
9467
- var triggerParentUpdate = _ref.triggerParentUpdate;
9468
- var _useContext = React.useContext(WorkbookContext),
9469
- context = _useContext.context,
9470
- setContext = _useContext.setContext;
9471
- var _locale = core.locale(context),
9472
- toolbar = _locale.toolbar,
9473
- sheetconfig = _locale.sheetconfig,
9474
- button = _locale.button;
9475
- var _useState = React.useState("#000000"),
9476
- _useState2 = _slicedToArray(_useState, 2),
9477
- inputColor = _useState2[0],
9478
- setInputColor = _useState2[1];
9479
- var _useState3 = React.useState(context.luckysheetfile[core.getSheetIndex(context, context.currentSheetId)].color),
9480
- _useState4 = _slicedToArray(_useState3, 2),
9481
- selectColor = _useState4[0],
9482
- setSelectColor = _useState4[1];
9483
- var certainBtn = React.useCallback(function () {
9484
- setSelectColor(inputColor);
9485
- }, [inputColor]);
9486
- React.useEffect(function () {
9487
- setContext(function (ctx) {
9488
- if (ctx.allowEdit === false) return;
9489
- var index = core.getSheetIndex(ctx, ctx.currentSheetId);
9490
- ctx.luckysheetfile[index].color = selectColor;
9491
- });
9492
- }, [selectColor, setContext]);
9493
- return /*#__PURE__*/React__default['default'].createElement("div", {
9494
- id: "leankylin-change-color"
9495
- }, /*#__PURE__*/React__default['default'].createElement("div", {
9496
- className: "color-reset",
9497
- onClick: function onClick() {
9498
- return setSelectColor(undefined);
9499
- }
9500
- }, sheetconfig.resetColor), /*#__PURE__*/React__default['default'].createElement("div", {
9501
- className: "custom-color"
9502
- }, /*#__PURE__*/React__default['default'].createElement("div", null, toolbar.customColor, ":"), /*#__PURE__*/React__default['default'].createElement("input", {
9503
- type: "color",
9504
- value: inputColor,
9505
- onChange: function onChange(e) {
9506
- return setInputColor(e.target.value);
9507
- },
9508
- onFocus: function onFocus() {
9509
- triggerParentUpdate(true);
9510
- },
9511
- onBlur: function onBlur() {
9512
- triggerParentUpdate(false);
9513
- }
9514
- }), /*#__PURE__*/React__default['default'].createElement("div", {
9515
- className: "button-basic button-primary",
9516
- onClick: function onClick() {
9517
- certainBtn();
9518
- }
9519
- }, button.confirm)), /*#__PURE__*/React__default['default'].createElement(ColorPicker, {
9520
- onPick: function onPick(color) {
9521
- setInputColor(color);
9522
- setSelectColor(color);
9523
- }
9524
- }));
9525
- };
9526
-
9527
9470
  var SheetTabContextMenu = function SheetTabContextMenu() {
9528
9471
  var _settings$sheetTabCon;
9529
9472
  var _useContext = React.useContext(WorkbookContext),
@@ -9621,6 +9564,13 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
9621
9564
  });
9622
9565
  });
9623
9566
  }, [context.allowEdit, setContext, sheet === null || sheet === void 0 ? void 0 : sheet.id]);
9567
+ var changeColor = function changeColor(selectColor) {
9568
+ setContext(function (ctx) {
9569
+ if (ctx.allowEdit === false) return;
9570
+ var index = core.getSheetIndex(ctx, ctx.currentSheetId);
9571
+ ctx.luckysheetfile[index].color = selectColor;
9572
+ });
9573
+ };
9624
9574
  if (!sheet || x == null || y == null) return null;
9625
9575
  return /*#__PURE__*/React__default['default'].createElement("div", {
9626
9576
  className: "leankylin-context-menu luckysheet-cols-menu",
@@ -9717,9 +9667,15 @@ var SheetTabContextMenu = function SheetTabContextMenu() {
9717
9667
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
9718
9668
  name: "rightArrow",
9719
9669
  width: 18
9720
- })), isShowChangeColor && context.allowEdit && ( /*#__PURE__*/React__default['default'].createElement(ChangeColor, {
9721
- triggerParentUpdate: updateShowInputColor
9722
- })));
9670
+ })), isShowChangeColor && context.allowEdit && ( /*#__PURE__*/React__default['default'].createElement("div", {
9671
+ className: "leankylin-sheet-color-change"
9672
+ }, /*#__PURE__*/React__default['default'].createElement(CustomColor, {
9673
+ onCustomPick: function onCustomPick(color) {
9674
+ changeColor(color);
9675
+ setIsShowChangeColor(false);
9676
+ },
9677
+ onColorPick: changeColor
9678
+ }))));
9723
9679
  }
9724
9680
  if (name === "focus") {
9725
9681
  return /*#__PURE__*/React__default['default'].createElement(Menu, {
@@ -2017,7 +2017,7 @@ html::-webkit-scrollbar-button {
2017
2017
  .leankylin-toolbar {
2018
2018
  display: flex;
2019
2019
  flex-direction: row;
2020
- background: #fafafc;
2020
+ background: #fff;
2021
2021
  position: relative;
2022
2022
  padding: 5px 0px 3px 15px;
2023
2023
  border-bottom: 1px solid #d4d4d4;
@@ -2663,10 +2663,10 @@ label {
2663
2663
  .luckysheet-sheet-area {
2664
2664
  width: 100%;
2665
2665
  box-sizing: border-box;
2666
- background-color: #fafafc;
2666
+ background-color: #fff;
2667
2667
  color: #444;
2668
- height: 31px;
2669
- padding: 0 30px 0 44px;
2668
+ height: 36px;
2669
+ padding: 4px 30px 4px 44px;
2670
2670
  margin: 0;
2671
2671
  -webkit-touch-callout: none;
2672
2672
  cursor: default;
@@ -2675,6 +2675,7 @@ label {
2675
2675
  align-items: center;
2676
2676
  justify-content: space-between;
2677
2677
  position: relative;
2678
+ border-top: 1px solid rgb(227, 229, 234);
2678
2679
  }
2679
2680
 
2680
2681
  #luckysheet-sheet-content {
@@ -2693,7 +2694,7 @@ label {
2693
2694
  white-space: nowrap;
2694
2695
  }
2695
2696
 
2696
- .luckysheet-sheet-area>div,
2697
+ .luckysheet-sheet-area > div,
2697
2698
  .luckysheet-sheet-area .luckysheet-sheets-item {
2698
2699
  display: inline-block;
2699
2700
  /* margin-right: 6px;
@@ -2754,23 +2755,21 @@ label {
2754
2755
  }
2755
2756
 
2756
2757
  .luckysheet-sheet-area div.luckysheet-sheets-item {
2757
- padding: 2px 6px;
2758
- height: 29px;
2759
- line-height: 29px;
2760
- background-color: #fafafc;
2758
+ height: 28px;
2759
+ line-height: 28px;
2760
+ background-color: #fff;
2761
2761
  color: #676464;
2762
2762
  min-width: 30px;
2763
2763
  top: 0px;
2764
2764
  position: relative;
2765
- margin-right: -1px;
2766
2765
  cursor: pointer;
2767
2766
  transition: all 0.1s;
2768
2767
  font-size: 13px;
2769
- padding: 2px 19px 0px 5px;
2770
2768
  box-sizing: border-box;
2771
- border-left: 1px solid #e0e0e0;
2772
- border-right: 1px solid #e0e0e0;
2773
2769
  vertical-align: middle;
2770
+ margin: 0 6px;
2771
+ border-radius: 4px;
2772
+ padding: 0 6px;
2774
2773
  }
2775
2774
 
2776
2775
  .luckysheet-sheet-area div.luckysheet-sheets-item:last-child {
@@ -2796,7 +2795,9 @@ label {
2796
2795
  text-align: center;
2797
2796
  }
2798
2797
 
2799
- .luckysheet-sheet-area div.luckysheet-sheets-item .luckysheet-sheets-item-menu:hover {
2798
+ .luckysheet-sheet-area
2799
+ div.luckysheet-sheets-item
2800
+ .luckysheet-sheets-item-menu:hover {
2800
2801
  color: #2a2a2a;
2801
2802
  cursor: pointer;
2802
2803
  }
@@ -2813,7 +2814,9 @@ label {
2813
2814
  left: 0;
2814
2815
  }
2815
2816
 
2816
- .luckysheet-sheet-area div.luckysheet-sheets-item .luckysheet-sheets-item-name[contenteditable="true"] {
2817
+ .luckysheet-sheet-area
2818
+ div.luckysheet-sheets-item
2819
+ .luckysheet-sheets-item-name[contenteditable="true"] {
2817
2820
  border: 1px solid #d9d9d9;
2818
2821
  display: inline-block;
2819
2822
  height: 18px;
@@ -2827,7 +2830,9 @@ label {
2827
2830
  -webkit-user-select: text !important;
2828
2831
  }
2829
2832
 
2830
- .luckysheet-sheet-area div.luckysheet-sheets-item .luckysheet-sheets-item-name[contenteditable="true"]:focus {
2833
+ .luckysheet-sheet-area
2834
+ div.luckysheet-sheets-item
2835
+ .luckysheet-sheets-item-name[contenteditable="true"]:focus {
2831
2836
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
2832
2837
  -moz-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
2833
2838
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
@@ -2837,8 +2842,8 @@ label {
2837
2842
 
2838
2843
  .luckysheet-sheet-area div.luckysheet-sheets-item-active {
2839
2844
  /* padding: 2px 8px; */
2840
- height: 29px;
2841
- line-height: 29px;
2845
+ height: 28px;
2846
+ line-height: 28px;
2842
2847
  background-color: #efefef;
2843
2848
  /* border-color: #aaa; */
2844
2849
  border-top-color: #fff;
@@ -2860,16 +2865,19 @@ label {
2860
2865
  display: flex;
2861
2866
  align-items: center;
2862
2867
  justify-content: center;
2863
- height: 29px;
2864
- width: 29px;
2868
+ height: 28px;
2869
+ width: 28px;
2870
+ cursor: pointer;
2871
+ border-radius: 4px;
2872
+ margin: 0 6px;
2865
2873
  }
2866
2874
 
2867
2875
  .leankylin-sheettab-button:hover {
2868
2876
  display: flex;
2869
2877
  align-items: center;
2870
2878
  justify-content: center;
2871
- height: 29px;
2872
- width: 29px;
2879
+ height: 28px;
2880
+ width: 28px;
2873
2881
  background-color: #efefef;
2874
2882
  }
2875
2883
 
@@ -2885,7 +2893,7 @@ label {
2885
2893
  display: flex;
2886
2894
  align-items: center;
2887
2895
  padding: 0 5px;
2888
- height: 29px;
2896
+ height: 28px;
2889
2897
  cursor: pointer;
2890
2898
  }
2891
2899
 
@@ -2896,8 +2904,8 @@ label {
2896
2904
  .leankylin-sheettab-placeholder {
2897
2905
  display: inline-block;
2898
2906
  width: 30px;
2899
- height: 29px;
2900
- line-height: 29px;
2907
+ height: 28px;
2908
+ line-height: 28px;
2901
2909
  vertical-align: middle;
2902
2910
  }
2903
2911
 
@@ -2924,16 +2932,23 @@ label {
2924
2932
  }
2925
2933
 
2926
2934
  .luckysheet-sheets-item-function {
2927
- width: 12px;
2928
- height: 24px;
2935
+ display: none;
2936
+ width: 28px;
2937
+ height: 28px;
2929
2938
  position: absolute;
2939
+ text-align: center;
2930
2940
  top: 4px;
2931
2941
  right: 2px;
2942
+ cursor: pointer;
2943
+ }
2944
+ .luckysheet-sheets-item-function:hover {
2945
+ background-color: #f1f1f1;
2932
2946
  }
2933
2947
 
2934
2948
  .leankylin-sheet-area-right {
2935
2949
  display: flex !important;
2936
2950
  }
2951
+
2937
2952
  .leankylin-zoom-container {
2938
2953
  white-space: nowrap;
2939
2954
  overflow: visible;
@@ -2951,6 +2966,8 @@ label {
2951
2966
  justify-content: center;
2952
2967
  width: 24px;
2953
2968
  height: 24px;
2969
+ border-radius: 4px;
2970
+ margin: 0 6px;
2954
2971
  }
2955
2972
 
2956
2973
  .leankylin-zoom-button:hover {
@@ -2961,14 +2978,14 @@ label {
2961
2978
  position: relative;
2962
2979
  display: flex;
2963
2980
  justify-content: center;
2964
- width: 48px;
2965
2981
  color: #1e1e1f;
2966
2982
  font-size: 12px;
2967
2983
  cursor: pointer;
2968
2984
  }
2969
2985
 
2970
2986
  .leankylin-zoom-ratio-current {
2971
- width: 100%;
2987
+ padding: 0 12px;
2988
+ margin: 0;
2972
2989
  }
2973
2990
 
2974
2991
  .leankylin-zoom-ratio-item:hover {
@@ -2995,7 +3012,6 @@ label {
2995
3012
  max-height: 100%;
2996
3013
  overflow-y: auto;
2997
3014
  border-radius: 4px;
2998
- box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.15);
2999
3015
  transition: opacity 0.218s;
3000
3016
  background: #fff;
3001
3017
  cursor: default;
@@ -3010,8 +3026,13 @@ label {
3010
3026
  -moz-user-select: none;
3011
3027
  user-select: none;
3012
3028
  border: none;
3029
+ width: 248px;
3013
3030
  border-radius: 8px;
3014
3031
  line-height: 22px;
3032
+ padding: 4px 8px;
3033
+ border: 1px solid #e3e5ea;
3034
+ box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
3035
+ rgba(0, 0, 0, 0) 0px 0px 0px 0px;
3015
3036
  }
3016
3037
 
3017
3038
  .leankylin-context-menu input.luckysheet-mousedown-cancel {
@@ -3044,12 +3065,13 @@ label {
3044
3065
  -webkit-user-select: none;
3045
3066
  -moz-user-select: none;
3046
3067
  user-select: none;
3068
+ border-radius: 4px;
3047
3069
  }
3048
3070
 
3049
3071
  /* 右击菜单项目 hover背景色 */
3050
3072
  .luckysheet-cols-menu .luckysheet-cols-menuitem:hover,
3051
3073
  .luckysheet-cols-menu .luckysheet-cols-menuitem-hover {
3052
- background: #efefef;
3074
+ background: #f9fafb;
3053
3075
  }
3054
3076
 
3055
3077
  .luckysheet-cols-menu
@@ -3283,6 +3305,12 @@ label {
3283
3305
  right: -18px;
3284
3306
  }
3285
3307
 
3308
+ .leankylin-sheet-color-change {
3309
+ position: absolute;
3310
+ left: 200px;
3311
+ bottom: -100px;
3312
+ }
3313
+
3286
3314
  .leankylin-sort-title {
3287
3315
  background-color: #fff;
3288
3316
  color: #000;
@@ -3307,76 +3335,6 @@ label {
3307
3335
  margin-bottom: 25px;
3308
3336
  }
3309
3337
 
3310
- #leankylin-change-color {
3311
- min-width: 164px;
3312
- height: 252px;
3313
- background: rgb(240, 240, 240);
3314
- position: absolute;
3315
- bottom: -110px;
3316
- left: 197px;
3317
- border-radius: 6px;
3318
- box-shadow: 0 2px 4px rgb(0 0 0 / 20%);
3319
- border: 1px solid rgba(0, 0, 0, .2);
3320
- }
3321
-
3322
- #leankylin-change-color .color-reset {
3323
- position: relative;
3324
- color: #333;
3325
- cursor: pointer;
3326
- list-style: none;
3327
- padding: 10px;
3328
- white-space: nowrap;
3329
- padding-left: 8px;
3330
- vertical-align: middle;
3331
- padding-right: 24px;
3332
- -webkit-user-select: none;
3333
- -moz-user-select: none;
3334
- user-select: none;
3335
- border-radius: 6px;
3336
- background: white;
3337
- }
3338
-
3339
- #leankylin-change-color .color-reset:hover {
3340
- background: rgb(230, 230, 230);
3341
- }
3342
-
3343
- #leankylin-change-color .custom-color {
3344
- position: relative;
3345
- margin: auto;
3346
- padding: 10px;
3347
- border-radius: 6px;
3348
- background: white;
3349
- display: flex;
3350
- align-items: center;
3351
- margin: 1px 0px;
3352
- display: flex;
3353
- justify-content: space-around;
3354
- }
3355
-
3356
- .button-basic {
3357
- display: inline-block;
3358
- margin-bottom: 0;
3359
- font-weight: 400;
3360
- text-align: center;
3361
- vertical-align: middle;
3362
- touch-action: manipulation;
3363
- cursor: pointer;
3364
- white-space: nowrap;
3365
- padding: 4px 8px;
3366
- font-size: 12px;
3367
- line-height: 1.42857143;
3368
- border-radius: 2px;
3369
- -webkit-user-select: none;
3370
- -moz-user-select: none;
3371
- user-select: none;
3372
- }
3373
-
3374
- .button-primary {
3375
- background: #0188fb;
3376
- border: 1px solid #0188fb;
3377
- color: #fff;
3378
- margin-right: -4px;
3379
- }
3380
3338
  .leankylin-sheet-list {
3381
3339
  overflow-y: auto;
3382
3340
  overflow-x: hidden;
package/dist/index.umd.js CHANGED
@@ -93952,6 +93952,8 @@
93952
93952
  var ContentEditable = function ContentEditable(_ref) {
93953
93953
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
93954
93954
  var lastHtml = React.useRef("");
93955
+ var _useContext = React.useContext(WorkbookContext),
93956
+ settings = _useContext.settings;
93955
93957
  var root = React.useRef(null);
93956
93958
  var autoFocus = props.autoFocus,
93957
93959
  initialContent = props.initialContent,
@@ -93989,7 +93991,9 @@
93989
93991
  return e.stopPropagation();
93990
93992
  },
93991
93993
  onClick: function onClick(e) {
93992
- return e.stopPropagation();
93994
+ var _settings$onClickCont;
93995
+ e.stopPropagation();
93996
+ (_settings$onClickCont = settings.onClickContentEditable) === null || _settings$onClickCont === void 0 ? void 0 : _settings$onClickCont.call(settings, e);
93993
93997
  }
93994
93998
  }, lodash.omit(props, "innerRef", "onChange", "html", "onBlur", "autoFocus", "allowEdit", "initialContent")), {}, {
93995
93999
  ref: function ref(e) {
@@ -102775,67 +102779,6 @@
102775
102779
  }))));
102776
102780
  };
102777
102781
 
102778
- var ChangeColor = function ChangeColor(_ref) {
102779
- var triggerParentUpdate = _ref.triggerParentUpdate;
102780
- var _useContext = React.useContext(WorkbookContext),
102781
- context = _useContext.context,
102782
- setContext = _useContext.setContext;
102783
- var _locale = locale(context),
102784
- toolbar = _locale.toolbar,
102785
- sheetconfig = _locale.sheetconfig,
102786
- button = _locale.button;
102787
- var _useState = React.useState("#000000"),
102788
- _useState2 = _slicedToArray(_useState, 2),
102789
- inputColor = _useState2[0],
102790
- setInputColor = _useState2[1];
102791
- var _useState3 = React.useState(context.luckysheetfile[getSheetIndex(context, context.currentSheetId)].color),
102792
- _useState4 = _slicedToArray(_useState3, 2),
102793
- selectColor = _useState4[0],
102794
- setSelectColor = _useState4[1];
102795
- var certainBtn = React.useCallback(function () {
102796
- setSelectColor(inputColor);
102797
- }, [inputColor]);
102798
- React.useEffect(function () {
102799
- setContext(function (ctx) {
102800
- if (ctx.allowEdit === false) return;
102801
- var index = getSheetIndex(ctx, ctx.currentSheetId);
102802
- ctx.luckysheetfile[index].color = selectColor;
102803
- });
102804
- }, [selectColor, setContext]);
102805
- return /*#__PURE__*/React__default['default'].createElement("div", {
102806
- id: "leankylin-change-color"
102807
- }, /*#__PURE__*/React__default['default'].createElement("div", {
102808
- className: "color-reset",
102809
- onClick: function onClick() {
102810
- return setSelectColor(undefined);
102811
- }
102812
- }, sheetconfig.resetColor), /*#__PURE__*/React__default['default'].createElement("div", {
102813
- className: "custom-color"
102814
- }, /*#__PURE__*/React__default['default'].createElement("div", null, toolbar.customColor, ":"), /*#__PURE__*/React__default['default'].createElement("input", {
102815
- type: "color",
102816
- value: inputColor,
102817
- onChange: function onChange(e) {
102818
- return setInputColor(e.target.value);
102819
- },
102820
- onFocus: function onFocus() {
102821
- triggerParentUpdate(true);
102822
- },
102823
- onBlur: function onBlur() {
102824
- triggerParentUpdate(false);
102825
- }
102826
- }), /*#__PURE__*/React__default['default'].createElement("div", {
102827
- className: "button-basic button-primary",
102828
- onClick: function onClick() {
102829
- certainBtn();
102830
- }
102831
- }, button.confirm)), /*#__PURE__*/React__default['default'].createElement(ColorPicker, {
102832
- onPick: function onPick(color) {
102833
- setInputColor(color);
102834
- setSelectColor(color);
102835
- }
102836
- }));
102837
- };
102838
-
102839
102782
  var SheetTabContextMenu = function SheetTabContextMenu() {
102840
102783
  var _settings$sheetTabCon;
102841
102784
  var _useContext = React.useContext(WorkbookContext),
@@ -102933,6 +102876,13 @@
102933
102876
  });
102934
102877
  });
102935
102878
  }, [context.allowEdit, setContext, sheet === null || sheet === void 0 ? void 0 : sheet.id]);
102879
+ var changeColor = function changeColor(selectColor) {
102880
+ setContext(function (ctx) {
102881
+ if (ctx.allowEdit === false) return;
102882
+ var index = getSheetIndex(ctx, ctx.currentSheetId);
102883
+ ctx.luckysheetfile[index].color = selectColor;
102884
+ });
102885
+ };
102936
102886
  if (!sheet || x == null || y == null) return null;
102937
102887
  return /*#__PURE__*/React__default['default'].createElement("div", {
102938
102888
  className: "leankylin-context-menu luckysheet-cols-menu",
@@ -103029,9 +102979,15 @@
103029
102979
  }, /*#__PURE__*/React__default['default'].createElement(SVGIcon, {
103030
102980
  name: "rightArrow",
103031
102981
  width: 18
103032
- })), isShowChangeColor && context.allowEdit && ( /*#__PURE__*/React__default['default'].createElement(ChangeColor, {
103033
- triggerParentUpdate: updateShowInputColor
103034
- })));
102982
+ })), isShowChangeColor && context.allowEdit && ( /*#__PURE__*/React__default['default'].createElement("div", {
102983
+ className: "leankylin-sheet-color-change"
102984
+ }, /*#__PURE__*/React__default['default'].createElement(CustomColor, {
102985
+ onCustomPick: function onCustomPick(color) {
102986
+ changeColor(color);
102987
+ setIsShowChangeColor(false);
102988
+ },
102989
+ onColorPick: changeColor
102990
+ }))));
103035
102991
  }
103036
102992
  if (name === "focus") {
103037
102993
  return /*#__PURE__*/React__default['default'].createElement(Menu, {