rc-slider
Advanced tools
Comparing version 10.4.0 to 10.4.1
@@ -20,4 +20,5 @@ import * as React from 'react'; | ||
render?: (origin: React.ReactElement<HandleProps>, props: RenderProps) => React.ReactElement; | ||
onChangeComplete?: () => void; | ||
} | ||
declare const Handle: React.ForwardRefExoticComponent<HandleProps & React.RefAttributes<HTMLDivElement>>; | ||
export default Handle; |
@@ -5,3 +5,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
var _excluded = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange"]; | ||
var _excluded = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange", "onChangeComplete"]; | ||
import cls from 'classnames'; | ||
@@ -22,2 +22,3 @@ import KeyCode from "rc-util/es/KeyCode"; | ||
onOffsetChange = props.onOffsetChange, | ||
onChangeComplete = props.onChangeComplete, | ||
restProps = _objectWithoutProperties(props, _excluded); | ||
@@ -88,2 +89,16 @@ var _React$useContext = React.useContext(SliderContext), | ||
}; | ||
var handleKeyUp = function handleKeyUp(e) { | ||
switch (e.which || e.keyCode) { | ||
case KeyCode.LEFT: | ||
case KeyCode.RIGHT: | ||
case KeyCode.UP: | ||
case KeyCode.DOWN: | ||
case KeyCode.HOME: | ||
case KeyCode.END: | ||
case KeyCode.PAGE_UP: | ||
case KeyCode.PAGE_DOWN: | ||
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(); | ||
break; | ||
} | ||
}; | ||
@@ -101,2 +116,3 @@ // ============================ Offset ============================ | ||
onKeyDown: onKeyDown, | ||
onKeyUp: handleKeyUp, | ||
tabIndex: disabled ? null : getIndex(tabIndex, valueIndex), | ||
@@ -103,0 +119,0 @@ role: "slider", |
@@ -14,2 +14,3 @@ import * as React from 'react'; | ||
draggingIndex: number; | ||
onChangeComplete?: () => void; | ||
} | ||
@@ -16,0 +17,0 @@ export interface HandlesRef { |
@@ -235,3 +235,2 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
triggerChange(cloneNextValues); | ||
onAfterChange === null || onAfterChange === void 0 || onAfterChange(getTriggerValue(cloneNextValues)); | ||
if (e) { | ||
@@ -283,3 +282,2 @@ onStartDrag(e, valueIndex, cloneNextValues); | ||
triggerChange(next.values); | ||
onAfterChange === null || onAfterChange === void 0 || onAfterChange(getTriggerValue(next.values)); | ||
setKeyboardValue(next.value); | ||
@@ -419,3 +417,4 @@ } | ||
onBlur: onBlur, | ||
handleRender: handleRender | ||
handleRender: handleRender, | ||
onChangeComplete: finishChange | ||
}), /*#__PURE__*/React.createElement(Marks, { | ||
@@ -422,0 +421,0 @@ prefixCls: prefixCls, |
@@ -20,4 +20,5 @@ import * as React from 'react'; | ||
render?: (origin: React.ReactElement<HandleProps>, props: RenderProps) => React.ReactElement; | ||
onChangeComplete?: () => void; | ||
} | ||
declare const Handle: React.ForwardRefExoticComponent<HandleProps & React.RefAttributes<HTMLDivElement>>; | ||
export default Handle; |
@@ -18,3 +18,3 @@ "use strict"; | ||
var _util = require("../util"); | ||
var _excluded = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange"]; | ||
var _excluded = ["prefixCls", "value", "valueIndex", "onStartMove", "style", "render", "dragging", "onOffsetChange", "onChangeComplete"]; | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } | ||
@@ -32,2 +32,3 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
onOffsetChange = props.onOffsetChange, | ||
onChangeComplete = props.onChangeComplete, | ||
restProps = (0, _objectWithoutProperties2.default)(props, _excluded); | ||
@@ -98,2 +99,16 @@ var _React$useContext = React.useContext(_context.default), | ||
}; | ||
var handleKeyUp = function handleKeyUp(e) { | ||
switch (e.which || e.keyCode) { | ||
case _KeyCode.default.LEFT: | ||
case _KeyCode.default.RIGHT: | ||
case _KeyCode.default.UP: | ||
case _KeyCode.default.DOWN: | ||
case _KeyCode.default.HOME: | ||
case _KeyCode.default.END: | ||
case _KeyCode.default.PAGE_UP: | ||
case _KeyCode.default.PAGE_DOWN: | ||
onChangeComplete === null || onChangeComplete === void 0 || onChangeComplete(); | ||
break; | ||
} | ||
}; | ||
@@ -111,2 +126,3 @@ // ============================ Offset ============================ | ||
onKeyDown: onKeyDown, | ||
onKeyUp: handleKeyUp, | ||
tabIndex: disabled ? null : (0, _util.getIndex)(tabIndex, valueIndex), | ||
@@ -113,0 +129,0 @@ role: "slider", |
@@ -14,2 +14,3 @@ import * as React from 'react'; | ||
draggingIndex: number; | ||
onChangeComplete?: () => void; | ||
} | ||
@@ -16,0 +17,0 @@ export interface HandlesRef { |
@@ -244,3 +244,2 @@ "use strict"; | ||
triggerChange(cloneNextValues); | ||
onAfterChange === null || onAfterChange === void 0 || onAfterChange(getTriggerValue(cloneNextValues)); | ||
if (e) { | ||
@@ -292,3 +291,2 @@ onStartDrag(e, valueIndex, cloneNextValues); | ||
triggerChange(next.values); | ||
onAfterChange === null || onAfterChange === void 0 || onAfterChange(getTriggerValue(next.values)); | ||
setKeyboardValue(next.value); | ||
@@ -428,3 +426,4 @@ } | ||
onBlur: onBlur, | ||
handleRender: handleRender | ||
handleRender: handleRender, | ||
onChangeComplete: finishChange | ||
}), /*#__PURE__*/React.createElement(_Marks.default, { | ||
@@ -431,0 +430,0 @@ prefixCls: prefixCls, |
{ | ||
"name": "rc-slider", | ||
"version": "10.4.0", | ||
"version": "10.4.1", | ||
"description": "Slider UI component for React", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
149845
3318