@jiaozhiye/qm-design-react 1.0.0-beta.44 → 1.0.0-beta.45

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/lib/index.esm.js CHANGED
@@ -1879,8 +1879,10 @@ var QmSplit = function QmSplit(props) {
1879
1879
  uniqueKey = props.uniqueKey,
1880
1880
  className = props.className,
1881
1881
  style = props.style,
1882
- _props$onChange = props.onChange,
1883
- onChange = _props$onChange === void 0 ? noop$1 : _props$onChange;
1882
+ onDragStart = props.onDragStart,
1883
+ _props$onDrag = props.onDrag,
1884
+ onDrag = _props$onDrag === void 0 ? noop$1 : _props$onDrag,
1885
+ onDragEnd = props.onDragEnd;
1884
1886
 
1885
1887
  var _React$useContext = React__default.useContext(ConfigContext),
1886
1888
  global = _React$useContext.global;
@@ -1897,6 +1899,10 @@ var QmSplit = function QmSplit(props) {
1897
1899
  return Number(value) > 0 ? "".concat(value, "px") : isValidUnit(value.toString()) ? value.toString() : "".concat(Number.parseFloat(value), "px");
1898
1900
  };
1899
1901
 
1902
+ var toNumber = function toNumber(value) {
1903
+ return Number.parseInt(value, 10);
1904
+ };
1905
+
1900
1906
  var createMinValue = function createMinValue(C) {
1901
1907
  var _a;
1902
1908
 
@@ -1918,17 +1924,21 @@ var QmSplit = function QmSplit(props) {
1918
1924
  offset = _React$useState4[0],
1919
1925
  setOffset = _React$useState4[1];
1920
1926
 
1921
- var changeDebouncer = debounce(onChange, 10);
1927
+ var dragDebouncer = debounce(onDrag, 10);
1922
1928
 
1923
1929
  var dragHandle = function dragHandle(value) {
1924
1930
  setOffset(value);
1925
- changeDebouncer(Number.parseInt(value));
1931
+ dragDebouncer(toNumber(value));
1926
1932
  };
1927
1933
 
1928
1934
  useUpdateEffect(function () {
1929
- if (dragging) return;
1930
- localStorage.setItem(spliterKey, offset);
1931
- saveSplitConfig(spliterKey, offset);
1935
+ if (dragging) {
1936
+ onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(toNumber(offset));
1937
+ } else {
1938
+ onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(toNumber(offset));
1939
+ localStorage.setItem(spliterKey, offset);
1940
+ saveSplitConfig(spliterKey, offset);
1941
+ }
1932
1942
  }, [dragging]);
1933
1943
  React__default.useEffect(function () {
1934
1944
  getLocalValue();
@@ -32515,7 +32525,7 @@ QmPrint.defaultProps = {
32515
32525
  QmPrint.contextType = ConfigContext;
32516
32526
 
32517
32527
  var name = "@jiaozhiye/qm-design-react";
32518
- var version = "1.0.0-beta.44";
32528
+ var version = "1.0.0-beta.45";
32519
32529
  var description = "A Component Library for React";
32520
32530
  var keywords = [
32521
32531
  "React",