aio-range 2.0.3 → 2.0.4
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/index.d.ts +2 -0
- package/index.js +10 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -245,12 +245,16 @@ const useRange = (PROPS, type) => {
|
|
|
245
245
|
dom: mainDom.current,
|
|
246
246
|
childIndexAttr: 'data-range-index',
|
|
247
247
|
start: ({ index }) => {
|
|
248
|
+
var _a;
|
|
248
249
|
const { disabled } = propsRef.current;
|
|
249
250
|
if (disabled === true) {
|
|
250
251
|
return false;
|
|
251
252
|
}
|
|
252
253
|
temp.index = index;
|
|
253
254
|
temp.start = [...values];
|
|
255
|
+
if ((_a = PROPS.rangeOption) === null || _a === void 0 ? void 0 : _a.onStartDrag) {
|
|
256
|
+
PROPS.rangeOption.onStartDrag(index || 0);
|
|
257
|
+
}
|
|
254
258
|
return [0, 0];
|
|
255
259
|
},
|
|
256
260
|
move: (p) => {
|
|
@@ -259,6 +263,12 @@ const useRange = (PROPS, type) => {
|
|
|
259
263
|
changeHandle({ dx: change.dx, dy: change.dy, deltaCenterAngle: change.deltaCenterAngle, centerAngle: mousePosition.centerAngle });
|
|
260
264
|
}
|
|
261
265
|
},
|
|
266
|
+
end: () => {
|
|
267
|
+
var _a;
|
|
268
|
+
if ((_a = PROPS.rangeOption) === null || _a === void 0 ? void 0 : _a.onEndDrag) {
|
|
269
|
+
PROPS.rangeOption.onEndDrag();
|
|
270
|
+
}
|
|
271
|
+
},
|
|
262
272
|
onClick: function (p) {
|
|
263
273
|
const { disabled } = propsRef.current;
|
|
264
274
|
if (disabled) {
|