@v-c/slider 1.0.8 → 1.0.9
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/Handles/Handle.cjs +27 -24
- package/dist/Handles/Handle.js +1 -1
- package/dist/Handles/index.cjs +5 -2
- package/dist/Handles/index.js +1 -1
- package/dist/Marks/Mark.cjs +8 -5
- package/dist/Marks/Mark.js +2 -2
- package/dist/Marks/index.cjs +4 -1
- package/dist/Slider.cjs +15 -12
- package/dist/Steps/Dot.cjs +6 -3
- package/dist/Steps/index.cjs +4 -1
- package/dist/Tracks/Track.cjs +6 -3
- package/dist/Tracks/index.cjs +6 -3
- package/dist/context.cjs +1 -0
- package/dist/hooks/useDrag.cjs +6 -5
- package/dist/hooks/useDrag.js +2 -3
- package/dist/hooks/useOffset.cjs +4 -1
- package/dist/hooks/useRange.cjs +6 -3
- package/dist/index.cjs +4 -1
- package/dist/interface.cjs +1 -0
- package/dist/util.cjs +1 -0
- package/package.json +4 -4
package/dist/Handles/Handle.cjs
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
const require_util = require("../util.cjs");
|
|
5
8
|
let vue = require("vue");
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
+
let _v_c_util = require("@v-c/util");
|
|
10
|
+
let _v_c_util_dist_KeyCode = require("@v-c/util/dist/KeyCode");
|
|
11
|
+
_v_c_util_dist_KeyCode = require_rolldown_runtime.__toESM(_v_c_util_dist_KeyCode);
|
|
9
12
|
var Handle_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
10
13
|
name: "Handle",
|
|
11
14
|
props: {
|
|
@@ -83,32 +86,32 @@ var Handle_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
83
86
|
if (!disabled && keyboard) {
|
|
84
87
|
let offset = null;
|
|
85
88
|
switch (e.which || e.keyCode) {
|
|
86
|
-
case
|
|
89
|
+
case _v_c_util_dist_KeyCode.default.LEFT:
|
|
87
90
|
offset = direction === "ltr" || direction === "btt" ? -1 : 1;
|
|
88
91
|
break;
|
|
89
|
-
case
|
|
92
|
+
case _v_c_util_dist_KeyCode.default.RIGHT:
|
|
90
93
|
offset = direction === "ltr" || direction === "btt" ? 1 : -1;
|
|
91
94
|
break;
|
|
92
|
-
case
|
|
95
|
+
case _v_c_util_dist_KeyCode.default.UP:
|
|
93
96
|
offset = direction !== "ttb" ? 1 : -1;
|
|
94
97
|
break;
|
|
95
|
-
case
|
|
98
|
+
case _v_c_util_dist_KeyCode.default.DOWN:
|
|
96
99
|
offset = direction !== "ttb" ? -1 : 1;
|
|
97
100
|
break;
|
|
98
|
-
case
|
|
101
|
+
case _v_c_util_dist_KeyCode.default.HOME:
|
|
99
102
|
offset = "min";
|
|
100
103
|
break;
|
|
101
|
-
case
|
|
104
|
+
case _v_c_util_dist_KeyCode.default.END:
|
|
102
105
|
offset = "max";
|
|
103
106
|
break;
|
|
104
|
-
case
|
|
107
|
+
case _v_c_util_dist_KeyCode.default.PAGE_UP:
|
|
105
108
|
offset = 2;
|
|
106
109
|
break;
|
|
107
|
-
case
|
|
110
|
+
case _v_c_util_dist_KeyCode.default.PAGE_DOWN:
|
|
108
111
|
offset = -2;
|
|
109
112
|
break;
|
|
110
|
-
case
|
|
111
|
-
case
|
|
113
|
+
case _v_c_util_dist_KeyCode.default.BACKSPACE:
|
|
114
|
+
case _v_c_util_dist_KeyCode.default.DELETE:
|
|
112
115
|
emit("delete", e, props.valueIndex);
|
|
113
116
|
break;
|
|
114
117
|
}
|
|
@@ -120,14 +123,14 @@ var Handle_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
120
123
|
};
|
|
121
124
|
const handleKeyUp = (e) => {
|
|
122
125
|
switch (e.which || e.keyCode) {
|
|
123
|
-
case
|
|
124
|
-
case
|
|
125
|
-
case
|
|
126
|
-
case
|
|
127
|
-
case
|
|
128
|
-
case
|
|
129
|
-
case
|
|
130
|
-
case
|
|
126
|
+
case _v_c_util_dist_KeyCode.default.LEFT:
|
|
127
|
+
case _v_c_util_dist_KeyCode.default.RIGHT:
|
|
128
|
+
case _v_c_util_dist_KeyCode.default.UP:
|
|
129
|
+
case _v_c_util_dist_KeyCode.default.DOWN:
|
|
130
|
+
case _v_c_util_dist_KeyCode.default.HOME:
|
|
131
|
+
case _v_c_util_dist_KeyCode.default.END:
|
|
132
|
+
case _v_c_util_dist_KeyCode.default.PAGE_UP:
|
|
133
|
+
case _v_c_util_dist_KeyCode.default.PAGE_DOWN:
|
|
131
134
|
emit("changeComplete");
|
|
132
135
|
break;
|
|
133
136
|
}
|
|
@@ -136,7 +139,7 @@ var Handle_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
136
139
|
handleNodeRef.value?.focus();
|
|
137
140
|
} });
|
|
138
141
|
return () => {
|
|
139
|
-
const { prefixCls, value, valueIndex, onStartMove, onDelete, render, dragging, draggingDelete, onOffsetChange, onChangeComplete, onFocus, onMouseenter
|
|
142
|
+
const { prefixCls, value, valueIndex, onStartMove, onDelete, render, dragging, draggingDelete, onOffsetChange, onChangeComplete, onFocus, onMouseenter, ...restProps } = props;
|
|
140
143
|
const { min, max, direction, disabled, range, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaRequired, ariaValueTextFormatterForHandle, classNames, styles } = sliderContext.value;
|
|
141
144
|
const positionStyle = require_util.getDirectionStyle(direction, value, min, max);
|
|
142
145
|
if (valueIndex !== null) divProps.value = {
|
|
@@ -161,7 +164,7 @@ var Handle_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
161
164
|
};
|
|
162
165
|
else divProps.value = { ...restProps };
|
|
163
166
|
const handlePrefixCls = `${prefixCls}-handle`;
|
|
164
|
-
handleClass.value = (0,
|
|
167
|
+
handleClass.value = (0, _v_c_util.classNames)(handlePrefixCls, {
|
|
165
168
|
[`${handlePrefixCls}-${valueIndex + 1}`]: valueIndex !== null && range,
|
|
166
169
|
[`${handlePrefixCls}-dragging`]: dragging,
|
|
167
170
|
[`${handlePrefixCls}-dragging-delete`]: draggingDelete
|
package/dist/Handles/Handle.js
CHANGED
|
@@ -133,7 +133,7 @@ var Handle_default = /* @__PURE__ */ defineComponent({
|
|
|
133
133
|
handleNodeRef.value?.focus();
|
|
134
134
|
} });
|
|
135
135
|
return () => {
|
|
136
|
-
const { prefixCls, value, valueIndex, onStartMove, onDelete, render, dragging, draggingDelete, onOffsetChange, onChangeComplete, onFocus, onMouseenter
|
|
136
|
+
const { prefixCls, value, valueIndex, onStartMove, onDelete, render, dragging, draggingDelete, onOffsetChange, onChangeComplete, onFocus, onMouseenter, ...restProps } = props;
|
|
137
137
|
const { min, max, direction, disabled, range, tabIndex, ariaLabelForHandle, ariaLabelledByForHandle, ariaRequired, ariaValueTextFormatterForHandle, classNames: classNames$1, styles } = sliderContext.value;
|
|
138
138
|
const positionStyle = getDirectionStyle(direction, value, min, max);
|
|
139
139
|
if (valueIndex !== null) divProps.value = {
|
package/dist/Handles/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_util = require("../util.cjs");
|
|
4
7
|
const require_Handle = require("./Handle.cjs");
|
|
@@ -71,7 +74,7 @@ var Handles_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
76
|
return () => {
|
|
74
|
-
const { prefixCls, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, onBlur, handleStyle
|
|
77
|
+
const { prefixCls, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, onBlur, handleStyle, ...restProps } = props;
|
|
75
78
|
const handleProps = {
|
|
76
79
|
prefixCls,
|
|
77
80
|
onStartMove,
|
package/dist/Handles/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var Handles_default = /* @__PURE__ */ defineComponent({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
return () => {
|
|
72
|
-
const { prefixCls, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, onBlur, handleStyle
|
|
72
|
+
const { prefixCls, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, onBlur, handleStyle, ...restProps } = props;
|
|
73
73
|
const handleProps = {
|
|
74
74
|
prefixCls,
|
|
75
75
|
onStartMove,
|
package/dist/Marks/Mark.cjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
const require_util = require("../util.cjs");
|
|
5
8
|
let vue = require("vue");
|
|
6
|
-
let
|
|
7
|
-
var Mark = /* @__PURE__ */ (0, vue.defineComponent)((props, {
|
|
9
|
+
let _v_c_util = require("@v-c/util");
|
|
10
|
+
var Mark = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
|
|
8
11
|
const sliderContext = require_context.useInjectSlider();
|
|
9
12
|
return () => {
|
|
10
13
|
const { prefixCls, value } = props;
|
|
@@ -12,10 +15,10 @@ var Mark = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots }) =>
|
|
|
12
15
|
const textCls = `${prefixCls}-text`;
|
|
13
16
|
const positionStyle = require_util.getDirectionStyle(direction, value, min, max);
|
|
14
17
|
return (0, vue.createVNode)("span", {
|
|
15
|
-
"class": (0,
|
|
18
|
+
"class": (0, _v_c_util.classNames)(textCls, { [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd }),
|
|
16
19
|
"style": {
|
|
17
20
|
...positionStyle,
|
|
18
|
-
...
|
|
21
|
+
...props.style || {}
|
|
19
22
|
},
|
|
20
23
|
"onMousedown": (e) => {
|
|
21
24
|
e.stopPropagation();
|
package/dist/Marks/Mark.js
CHANGED
|
@@ -2,7 +2,7 @@ import { useInjectSlider } from "../context.js";
|
|
|
2
2
|
import { getDirectionStyle } from "../util.js";
|
|
3
3
|
import { createVNode, defineComponent } from "vue";
|
|
4
4
|
import { classNames } from "@v-c/util";
|
|
5
|
-
var Mark_default = /* @__PURE__ */ defineComponent((props, {
|
|
5
|
+
var Mark_default = /* @__PURE__ */ defineComponent((props, { slots }) => {
|
|
6
6
|
const sliderContext = useInjectSlider();
|
|
7
7
|
return () => {
|
|
8
8
|
const { prefixCls, value } = props;
|
|
@@ -13,7 +13,7 @@ var Mark_default = /* @__PURE__ */ defineComponent((props, { attrs, slots }) =>
|
|
|
13
13
|
"class": classNames(textCls, { [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd }),
|
|
14
14
|
"style": {
|
|
15
15
|
...positionStyle,
|
|
16
|
-
...
|
|
16
|
+
...props.style || {}
|
|
17
17
|
},
|
|
18
18
|
"onMousedown": (e) => {
|
|
19
19
|
e.stopPropagation();
|
package/dist/Marks/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_Mark = require("./Mark.cjs");
|
|
4
7
|
let vue = require("vue");
|
package/dist/Slider.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("./_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("./context.cjs");
|
|
4
7
|
const require_index = require("./Handles/index.cjs");
|
|
@@ -9,11 +12,11 @@ const require_index$1 = require("./Marks/index.cjs");
|
|
|
9
12
|
const require_index$2 = require("./Steps/index.cjs");
|
|
10
13
|
const require_index$3 = require("./Tracks/index.cjs");
|
|
11
14
|
let vue = require("vue");
|
|
12
|
-
let
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
let
|
|
16
|
-
|
|
15
|
+
let _v_c_util = require("@v-c/util");
|
|
16
|
+
let _v_c_util_dist_isEqual = require("@v-c/util/dist/isEqual");
|
|
17
|
+
_v_c_util_dist_isEqual = require_rolldown_runtime.__toESM(_v_c_util_dist_isEqual);
|
|
18
|
+
let _v_c_util_dist_warning = require("@v-c/util/dist/warning");
|
|
19
|
+
_v_c_util_dist_warning = require_rolldown_runtime.__toESM(_v_c_util_dist_warning);
|
|
17
20
|
var sliderDefaults = {
|
|
18
21
|
prefixCls: "vc-slider",
|
|
19
22
|
keyboard: true,
|
|
@@ -106,7 +109,7 @@ var Slider = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots, em
|
|
|
106
109
|
const getTriggerValue = (triggerValues) => rangeEnabled.value ? triggerValues : triggerValues[0];
|
|
107
110
|
const triggerChange = (nextValues) => {
|
|
108
111
|
const cloneNextValues = [...nextValues].sort((a, b) => a - b);
|
|
109
|
-
if (!(0,
|
|
112
|
+
if (!(0, _v_c_util_dist_isEqual.default)(cloneNextValues, rawValues.value, true)) {
|
|
110
113
|
const triggerValue = getTriggerValue(cloneNextValues);
|
|
111
114
|
emit("change", triggerValue);
|
|
112
115
|
props.onChange?.(triggerValue);
|
|
@@ -118,7 +121,7 @@ var Slider = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots, em
|
|
|
118
121
|
const finishValue = getTriggerValue(rawValues.value);
|
|
119
122
|
emit("afterChange", finishValue);
|
|
120
123
|
props.onAfterChange?.(finishValue);
|
|
121
|
-
(0,
|
|
124
|
+
(0, _v_c_util_dist_warning.default)(!props.onAfterChange, "[vc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.");
|
|
122
125
|
emit("changeComplete", finishValue);
|
|
123
126
|
props.onChangeComplete?.(finishValue);
|
|
124
127
|
};
|
|
@@ -164,7 +167,7 @@ var Slider = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots, em
|
|
|
164
167
|
onStartDrag(e, focusIndex, cloneNextValues);
|
|
165
168
|
} else {
|
|
166
169
|
props.onAfterChange?.(nextValue);
|
|
167
|
-
(0,
|
|
170
|
+
(0, _v_c_util_dist_warning.default)(!props.onAfterChange, "[vc-slider] `onAfterChange` is deprecated. Please use `onChangeComplete` instead.");
|
|
168
171
|
emit("changeComplete", nextValue);
|
|
169
172
|
props.onChangeComplete?.(nextValue);
|
|
170
173
|
}
|
|
@@ -211,7 +214,7 @@ var Slider = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots, em
|
|
|
211
214
|
});
|
|
212
215
|
const mergedDraggableTrack = (0, vue.computed)(() => {
|
|
213
216
|
if (rangeDraggableTrack.value && mergedStep.value === null) {
|
|
214
|
-
if (process.env.NODE_ENV !== "production") (0,
|
|
217
|
+
if (process.env.NODE_ENV !== "production") (0, _v_c_util_dist_warning.default)(false, "`draggableTrack` is not supported when `step` is `null`.");
|
|
215
218
|
return false;
|
|
216
219
|
}
|
|
217
220
|
return rangeDraggableTrack.value;
|
|
@@ -269,7 +272,7 @@ var Slider = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots, em
|
|
|
269
272
|
})));
|
|
270
273
|
return () => {
|
|
271
274
|
const { id, startPoint, trackStyle, handleStyle, railStyle, dotStyle, activeDotStyle, dots, handleRender, activeHandleRender, classNames, styles } = props;
|
|
272
|
-
const mergedClassName = (0,
|
|
275
|
+
const mergedClassName = (0, _v_c_util.classNames)(prefixCls.value, props.className, attrs.class, {
|
|
273
276
|
[`${prefixCls.value}-disabled`]: disabled.value,
|
|
274
277
|
[`${prefixCls.value}-vertical`]: props.vertical,
|
|
275
278
|
[`${prefixCls.value}-horizontal`]: !props.vertical,
|
|
@@ -287,7 +290,7 @@ var Slider = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots, em
|
|
|
287
290
|
"id": id
|
|
288
291
|
}, [
|
|
289
292
|
(0, vue.createVNode)("div", {
|
|
290
|
-
"class": (0,
|
|
293
|
+
"class": (0, _v_c_util.classNames)(`${prefixCls.value}-rail`, classNames?.rail),
|
|
291
294
|
"style": {
|
|
292
295
|
...railStyle,
|
|
293
296
|
...styles?.rail
|
package/dist/Steps/Dot.cjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
const require_util = require("../util.cjs");
|
|
5
8
|
let vue = require("vue");
|
|
6
|
-
let
|
|
9
|
+
let _v_c_util = require("@v-c/util");
|
|
7
10
|
var Dot = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
8
11
|
const sliderContext = require_context.useInjectSlider();
|
|
9
12
|
return () => {
|
|
@@ -17,7 +20,7 @@ var Dot = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs }) => {
|
|
|
17
20
|
...typeof activeStyle === "function" ? activeStyle(value) : activeStyle
|
|
18
21
|
};
|
|
19
22
|
return (0, vue.createVNode)("span", {
|
|
20
|
-
"class": (0,
|
|
23
|
+
"class": (0, _v_c_util.classNames)(dotClassName, { [`${dotClassName}-active`]: active }),
|
|
21
24
|
"style": {
|
|
22
25
|
...mergedStyle,
|
|
23
26
|
...attrs.style
|
package/dist/Steps/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
const require_Dot = require("./Dot.cjs");
|
package/dist/Tracks/Track.cjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
const require_util = require("../util.cjs");
|
|
5
8
|
let vue = require("vue");
|
|
6
|
-
let
|
|
9
|
+
let _v_c_util = require("@v-c/util");
|
|
7
10
|
var Track = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
8
11
|
name: "Track",
|
|
9
12
|
props: {
|
|
@@ -37,7 +40,7 @@ var Track = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
37
40
|
const offsetStart = require_util.getOffset(start, min, max);
|
|
38
41
|
const offsetEnd = require_util.getOffset(end, min, max);
|
|
39
42
|
const trackPrefixCls = `${prefixCls}-track`;
|
|
40
|
-
const className = replaceCls || (0,
|
|
43
|
+
const className = replaceCls || (0, _v_c_util.classNames)(trackPrefixCls, {
|
|
41
44
|
[`${trackPrefixCls}-${index + 1}`]: index !== null && range,
|
|
42
45
|
[`${prefixCls}-track-draggable`]: onStartMove
|
|
43
46
|
}, classNames.track);
|
package/dist/Tracks/index.cjs
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
const require_util = require("../util.cjs");
|
|
5
8
|
const require_Track = require("./Track.cjs");
|
|
6
9
|
let vue = require("vue");
|
|
7
|
-
let
|
|
10
|
+
let _v_c_util = require("@v-c/util");
|
|
8
11
|
var Tracks = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
9
12
|
name: "Tracks",
|
|
10
13
|
props: {
|
|
@@ -49,7 +52,7 @@ var Tracks = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
|
49
52
|
"prefixCls": props.prefixCls,
|
|
50
53
|
"start": trackList.value[0].start,
|
|
51
54
|
"end": trackList.value[trackList.value.length - 1].end,
|
|
52
|
-
"replaceCls": (0,
|
|
55
|
+
"replaceCls": (0, _v_c_util.classNames)(classNames.tracks, `${props.prefixCls}-tracks`),
|
|
53
56
|
"style": styles.tracks
|
|
54
57
|
}, null) : null, trackList.value.map(({ start, end }, index) => (0, vue.createVNode)(require_Track.default, {
|
|
55
58
|
"index": index,
|
package/dist/context.cjs
CHANGED
package/dist/hooks/useDrag.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
6
|
const require_context = require("../context.cjs");
|
|
4
7
|
let vue = require("vue");
|
|
5
|
-
let __v_c_util_dist_hooks_useEvent = require("@v-c/util/dist/hooks/useEvent");
|
|
6
|
-
__v_c_util_dist_hooks_useEvent = require_rolldown_runtime.__toESM(__v_c_util_dist_hooks_useEvent);
|
|
7
8
|
var REMOVE_DIST = 130;
|
|
8
9
|
function getPosition(e) {
|
|
9
10
|
const obj = "targetTouches" in e ? e.targetTouches[0] : e;
|
|
@@ -49,7 +50,7 @@ function useDrag(containerRef, direction, rawValues, min, max, formatValue, trig
|
|
|
49
50
|
draggingValue: nextValue
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
|
-
const updateCacheValue = (
|
|
53
|
+
const updateCacheValue = (valueIndex, offsetPercent, deleteMark) => {
|
|
53
54
|
if (valueIndex === -1) {
|
|
54
55
|
const startValue = originValues.value[0];
|
|
55
56
|
const endValue = originValues.value[originValues.value.length - 1];
|
|
@@ -67,7 +68,7 @@ function useDrag(containerRef, direction, rawValues, min, max, formatValue, trig
|
|
|
67
68
|
const next = offsetValues.value(cloneValues, offsetDist, valueIndex, "dist");
|
|
68
69
|
flushValues(next.values, next.value, deleteMark);
|
|
69
70
|
}
|
|
70
|
-
}
|
|
71
|
+
};
|
|
71
72
|
const onStartMove = (e, valueIndex, startValues) => {
|
|
72
73
|
e.stopPropagation();
|
|
73
74
|
const initialValues = startValues || rawValues.value;
|
package/dist/hooks/useDrag.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { UnstableContextKey, defaultUnstableContextValue } from "../context.js";
|
|
2
2
|
import { computed, inject, onUnmounted, ref, watch } from "vue";
|
|
3
|
-
import useEvent from "@v-c/util/dist/hooks/useEvent";
|
|
4
3
|
var REMOVE_DIST = 130;
|
|
5
4
|
function getPosition(e) {
|
|
6
5
|
const obj = "targetTouches" in e ? e.targetTouches[0] : e;
|
|
@@ -46,7 +45,7 @@ function useDrag(containerRef, direction, rawValues, min, max, formatValue, trig
|
|
|
46
45
|
draggingValue: nextValue
|
|
47
46
|
});
|
|
48
47
|
};
|
|
49
|
-
const updateCacheValue =
|
|
48
|
+
const updateCacheValue = (valueIndex, offsetPercent, deleteMark) => {
|
|
50
49
|
if (valueIndex === -1) {
|
|
51
50
|
const startValue = originValues.value[0];
|
|
52
51
|
const endValue = originValues.value[originValues.value.length - 1];
|
|
@@ -64,7 +63,7 @@ function useDrag(containerRef, direction, rawValues, min, max, formatValue, trig
|
|
|
64
63
|
const next = offsetValues.value(cloneValues, offsetDist, valueIndex, "dist");
|
|
65
64
|
flushValues(next.values, next.value, deleteMark);
|
|
66
65
|
}
|
|
67
|
-
}
|
|
66
|
+
};
|
|
68
67
|
const onStartMove = (e, valueIndex, startValues) => {
|
|
69
68
|
e.stopPropagation();
|
|
70
69
|
const initialValues = startValues || rawValues.value;
|
package/dist/hooks/useOffset.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
function useOffset(min, max, step, markList, allowCross, pushable) {
|
|
3
6
|
const formatRangeValue = (val) => Math.max(min.value, Math.min(max.value, val));
|
|
4
7
|
const formatStepValue = (val) => {
|
package/dist/hooks/useRange.cjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
-
let
|
|
6
|
+
let _v_c_util_dist_warning = require("@v-c/util/dist/warning");
|
|
4
7
|
function useRange(range) {
|
|
5
8
|
if (range === true || !range) return [
|
|
6
9
|
!!range,
|
|
@@ -9,7 +12,7 @@ function useRange(range) {
|
|
|
9
12
|
0
|
|
10
13
|
];
|
|
11
14
|
const { editable = false, draggableTrack = false, minCount, maxCount } = range;
|
|
12
|
-
if (process.env.NODE_ENV !== "production") (0,
|
|
15
|
+
if (process.env.NODE_ENV !== "production") (0, _v_c_util_dist_warning.warning)(!editable || !draggableTrack, "`editable` can not work with `draggableTrack`.");
|
|
13
16
|
return [
|
|
14
17
|
true,
|
|
15
18
|
editable,
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Object.
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
2
5
|
const require_context = require("./context.cjs");
|
|
3
6
|
const require_Slider = require("./Slider.cjs");
|
|
4
7
|
var src_default = require_Slider.default;
|
package/dist/interface.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
package/dist/util.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/slider",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"./dist/*": "./dist/*",
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
|
-
"main": "index.js",
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
24
|
"files": [
|
|
25
25
|
"dist",
|
|
26
26
|
"package.json"
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"vue": "^3.0.0"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@v-c/util": "^1.0.
|
|
32
|
+
"@v-c/util": "^1.0.8"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@v-c/tooltip": "^1.0.
|
|
35
|
+
"@v-c/tooltip": "^1.0.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "vite build",
|