@v-c/slider 1.0.3 → 1.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/dist/Handles/Handle.cjs +195 -1
- package/dist/Handles/Handle.d.ts +4 -4
- package/dist/Handles/Handle.js +191 -204
- package/dist/Handles/index.cjs +108 -1
- package/dist/Handles/index.d.ts +1 -1
- package/dist/Handles/index.js +105 -120
- package/dist/Marks/Mark.cjs +51 -1
- package/dist/Marks/Mark.d.ts +2 -2
- package/dist/Marks/Mark.js +48 -39
- package/dist/Marks/index.cjs +39 -1
- package/dist/Marks/index.d.ts +2 -2
- package/dist/Marks/index.js +36 -32
- package/dist/Slider.cjs +569 -1
- package/dist/Slider.d.ts +53 -267
- package/dist/Slider.js +563 -352
- package/dist/Steps/Dot.cjs +52 -1
- package/dist/Steps/Dot.d.ts +2 -2
- package/dist/Steps/Dot.js +49 -38
- package/dist/Steps/index.cjs +64 -1
- package/dist/Steps/index.d.ts +2 -2
- package/dist/Steps/index.js +61 -41
- package/dist/Tracks/Track.cjs +74 -1
- package/dist/Tracks/Track.js +70 -81
- package/dist/Tracks/index.cjs +70 -1
- package/dist/Tracks/index.js +66 -82
- package/dist/_virtual/rolldown_runtime.cjs +21 -0
- package/dist/context.cjs +39 -1
- package/dist/context.d.ts +13 -7
- package/dist/context.js +29 -24
- package/dist/hooks/useDrag.cjs +160 -1
- package/dist/hooks/useDrag.d.ts +2 -2
- package/dist/hooks/useDrag.js +155 -86
- package/dist/hooks/useOffset.cjs +124 -1
- package/dist/hooks/useOffset.d.ts +2 -1
- package/dist/hooks/useOffset.js +122 -110
- package/dist/hooks/useRange.cjs +21 -1
- package/dist/hooks/useRange.js +18 -9
- package/dist/index.cjs +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4 -4
- package/dist/interface.cjs +0 -1
- package/dist/interface.js +0 -1
- package/dist/util.cjs +32 -1
- package/dist/util.js +27 -26
- package/package.json +18 -10
- package/docs/TooltipSlider.tsx +0 -94
- package/docs/assets/anim.less +0 -63
- package/docs/assets/bootstrap.less +0 -163
- package/docs/assets/index.less +0 -337
- package/docs/debug.vue +0 -59
- package/docs/editable.vue +0 -58
- package/docs/handle.vue +0 -51
- package/docs/marks.vue +0 -104
- package/docs/multiple.vue +0 -50
- package/docs/range.vue +0 -224
- package/docs/slider.stories.vue +0 -45
- package/docs/sliderDemo.vue +0 -283
- package/docs/vertical.vue +0 -135
- package/src/Handles/Handle.tsx +0 -232
- package/src/Handles/index.tsx +0 -132
- package/src/Marks/Mark.tsx +0 -40
- package/src/Marks/index.tsx +0 -40
- package/src/Slider.tsx +0 -602
- package/src/Steps/Dot.tsx +0 -40
- package/src/Steps/index.tsx +0 -54
- package/src/Tracks/Track.tsx +0 -89
- package/src/Tracks/index.tsx +0 -92
- package/src/context.ts +0 -65
- package/src/hooks/useDrag.ts +0 -243
- package/src/hooks/useOffset.ts +0 -272
- package/src/hooks/useRange.ts +0 -24
- package/src/index.ts +0 -8
- package/src/interface.ts +0 -17
- package/src/util.ts +0 -41
- package/vite.config.ts +0 -18
- package/vitest.config.ts +0 -11
package/dist/Handles/index.cjs
CHANGED
|
@@ -1 +1,108 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
+
const require_util = require("../util.cjs");
|
|
4
|
+
const require_Handle = require("./Handle.cjs");
|
|
5
|
+
let vue = require("vue");
|
|
6
|
+
var Handles_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
7
|
+
name: "Handles",
|
|
8
|
+
props: {
|
|
9
|
+
prefixCls: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
values: {
|
|
14
|
+
type: Array,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
handleStyle: { type: [Object, Array] },
|
|
18
|
+
onStartMove: {
|
|
19
|
+
type: Function,
|
|
20
|
+
required: true
|
|
21
|
+
},
|
|
22
|
+
onOffsetChange: {
|
|
23
|
+
type: Function,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
onFocus: { type: Function },
|
|
27
|
+
onBlur: { type: Function },
|
|
28
|
+
onDelete: {
|
|
29
|
+
type: Function,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
handleRender: { type: Function },
|
|
33
|
+
activeHandleRender: { type: Function },
|
|
34
|
+
draggingIndex: {
|
|
35
|
+
type: Number,
|
|
36
|
+
default: -1
|
|
37
|
+
},
|
|
38
|
+
draggingDelete: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
onChangeComplete: Function
|
|
43
|
+
},
|
|
44
|
+
emits: ["focus"],
|
|
45
|
+
slots: Object,
|
|
46
|
+
setup(props, { emit, expose }) {
|
|
47
|
+
const handleRefs = (0, vue.shallowRef)({});
|
|
48
|
+
const activeVisible = (0, vue.ref)(false);
|
|
49
|
+
const activeIndex = (0, vue.ref)(-1);
|
|
50
|
+
const onActive = (index) => {
|
|
51
|
+
activeIndex.value = index;
|
|
52
|
+
activeVisible.value = true;
|
|
53
|
+
};
|
|
54
|
+
const onHandleFocus = (e, index) => {
|
|
55
|
+
onActive(index);
|
|
56
|
+
emit("focus", e);
|
|
57
|
+
};
|
|
58
|
+
const onHandleMouseEnter = (_e, index) => {
|
|
59
|
+
onActive(index);
|
|
60
|
+
};
|
|
61
|
+
const setHandleRef = (index, node) => {
|
|
62
|
+
if (!node) delete handleRefs.value[index];
|
|
63
|
+
else handleRefs.value[index] = node;
|
|
64
|
+
};
|
|
65
|
+
expose({
|
|
66
|
+
focus: (index) => {
|
|
67
|
+
handleRefs.value[index]?.focus?.();
|
|
68
|
+
},
|
|
69
|
+
hideHelp: () => {
|
|
70
|
+
activeVisible.value = false;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return () => {
|
|
74
|
+
const { prefixCls, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, onBlur, handleStyle,...restProps } = props;
|
|
75
|
+
const handleProps = {
|
|
76
|
+
prefixCls,
|
|
77
|
+
onStartMove,
|
|
78
|
+
onOffsetChange,
|
|
79
|
+
render: handleRender,
|
|
80
|
+
onFocus: onHandleFocus,
|
|
81
|
+
onMouseenter: onHandleMouseEnter,
|
|
82
|
+
onBlur,
|
|
83
|
+
...restProps
|
|
84
|
+
};
|
|
85
|
+
return (0, vue.createVNode)(vue.Fragment, null, [values?.map((value, index) => {
|
|
86
|
+
const dragging = draggingIndex === index;
|
|
87
|
+
return (0, vue.createVNode)(require_Handle.default, (0, vue.mergeProps)({
|
|
88
|
+
"ref": (node) => setHandleRef(index, node),
|
|
89
|
+
"dragging": dragging,
|
|
90
|
+
"draggingDelete": dragging && draggingDelete,
|
|
91
|
+
"style": require_util.getIndex(handleStyle, index),
|
|
92
|
+
"key": index,
|
|
93
|
+
"value": value,
|
|
94
|
+
"valueIndex": index
|
|
95
|
+
}, handleProps), null);
|
|
96
|
+
}), activeHandleRender && activeVisible.value && (0, vue.createVNode)(require_Handle.default, (0, vue.mergeProps)({ "key": "a11y" }, handleProps, {
|
|
97
|
+
"value": values[activeIndex.value],
|
|
98
|
+
"valueIndex": null,
|
|
99
|
+
"dragging": draggingIndex !== -1,
|
|
100
|
+
"draggingDelete": draggingDelete,
|
|
101
|
+
"render": activeHandleRender,
|
|
102
|
+
"style": { pointerEvents: "none" },
|
|
103
|
+
"aria-hidden": true
|
|
104
|
+
}), null)]);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
exports.default = Handles_default;
|
package/dist/Handles/index.d.ts
CHANGED
package/dist/Handles/index.js
CHANGED
|
@@ -1,121 +1,106 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}, p, {
|
|
106
|
-
value: d[u.value],
|
|
107
|
-
valueIndex: 1,
|
|
108
|
-
dragging: c !== -1,
|
|
109
|
-
draggingDelete: g,
|
|
110
|
-
render: i,
|
|
111
|
-
style: {
|
|
112
|
-
pointerEvents: "none"
|
|
113
|
-
},
|
|
114
|
-
"aria-hidden": !0
|
|
115
|
-
}), null)]);
|
|
116
|
-
};
|
|
117
|
-
}
|
|
1
|
+
import { getIndex } from "../util.js";
|
|
2
|
+
import Handle_default from "./Handle.js";
|
|
3
|
+
import { Fragment, createVNode, defineComponent, mergeProps, ref, shallowRef } from "vue";
|
|
4
|
+
var Handles_default = /* @__PURE__ */ defineComponent({
|
|
5
|
+
name: "Handles",
|
|
6
|
+
props: {
|
|
7
|
+
prefixCls: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
values: {
|
|
12
|
+
type: Array,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
handleStyle: { type: [Object, Array] },
|
|
16
|
+
onStartMove: {
|
|
17
|
+
type: Function,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
onOffsetChange: {
|
|
21
|
+
type: Function,
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
onFocus: { type: Function },
|
|
25
|
+
onBlur: { type: Function },
|
|
26
|
+
onDelete: {
|
|
27
|
+
type: Function,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
handleRender: { type: Function },
|
|
31
|
+
activeHandleRender: { type: Function },
|
|
32
|
+
draggingIndex: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: -1
|
|
35
|
+
},
|
|
36
|
+
draggingDelete: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
onChangeComplete: Function
|
|
41
|
+
},
|
|
42
|
+
emits: ["focus"],
|
|
43
|
+
slots: Object,
|
|
44
|
+
setup(props, { emit, expose }) {
|
|
45
|
+
const handleRefs = shallowRef({});
|
|
46
|
+
const activeVisible = ref(false);
|
|
47
|
+
const activeIndex = ref(-1);
|
|
48
|
+
const onActive = (index) => {
|
|
49
|
+
activeIndex.value = index;
|
|
50
|
+
activeVisible.value = true;
|
|
51
|
+
};
|
|
52
|
+
const onHandleFocus = (e, index) => {
|
|
53
|
+
onActive(index);
|
|
54
|
+
emit("focus", e);
|
|
55
|
+
};
|
|
56
|
+
const onHandleMouseEnter = (_e, index) => {
|
|
57
|
+
onActive(index);
|
|
58
|
+
};
|
|
59
|
+
const setHandleRef = (index, node) => {
|
|
60
|
+
if (!node) delete handleRefs.value[index];
|
|
61
|
+
else handleRefs.value[index] = node;
|
|
62
|
+
};
|
|
63
|
+
expose({
|
|
64
|
+
focus: (index) => {
|
|
65
|
+
handleRefs.value[index]?.focus?.();
|
|
66
|
+
},
|
|
67
|
+
hideHelp: () => {
|
|
68
|
+
activeVisible.value = false;
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return () => {
|
|
72
|
+
const { prefixCls, onStartMove, onOffsetChange, values, handleRender, activeHandleRender, draggingIndex, draggingDelete, onFocus, onBlur, handleStyle,...restProps } = props;
|
|
73
|
+
const handleProps = {
|
|
74
|
+
prefixCls,
|
|
75
|
+
onStartMove,
|
|
76
|
+
onOffsetChange,
|
|
77
|
+
render: handleRender,
|
|
78
|
+
onFocus: onHandleFocus,
|
|
79
|
+
onMouseenter: onHandleMouseEnter,
|
|
80
|
+
onBlur,
|
|
81
|
+
...restProps
|
|
82
|
+
};
|
|
83
|
+
return createVNode(Fragment, null, [values?.map((value, index) => {
|
|
84
|
+
const dragging = draggingIndex === index;
|
|
85
|
+
return createVNode(Handle_default, mergeProps({
|
|
86
|
+
"ref": (node) => setHandleRef(index, node),
|
|
87
|
+
"dragging": dragging,
|
|
88
|
+
"draggingDelete": dragging && draggingDelete,
|
|
89
|
+
"style": getIndex(handleStyle, index),
|
|
90
|
+
"key": index,
|
|
91
|
+
"value": value,
|
|
92
|
+
"valueIndex": index
|
|
93
|
+
}, handleProps), null);
|
|
94
|
+
}), activeHandleRender && activeVisible.value && createVNode(Handle_default, mergeProps({ "key": "a11y" }, handleProps, {
|
|
95
|
+
"value": values[activeIndex.value],
|
|
96
|
+
"valueIndex": null,
|
|
97
|
+
"dragging": draggingIndex !== -1,
|
|
98
|
+
"draggingDelete": draggingDelete,
|
|
99
|
+
"render": activeHandleRender,
|
|
100
|
+
"style": { pointerEvents: "none" },
|
|
101
|
+
"aria-hidden": true
|
|
102
|
+
}), null)]);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
118
105
|
});
|
|
119
|
-
export {
|
|
120
|
-
k as default
|
|
121
|
-
};
|
|
106
|
+
export { Handles_default as default };
|
package/dist/Marks/Mark.cjs
CHANGED
|
@@ -1 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
+
const require_context = require("../context.cjs");
|
|
4
|
+
const require_util = require("../util.cjs");
|
|
5
|
+
let vue = require("vue");
|
|
6
|
+
let __v_c_util = require("@v-c/util");
|
|
7
|
+
var Mark = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots }) => {
|
|
8
|
+
const sliderContext = require_context.useInjectSlider();
|
|
9
|
+
return () => {
|
|
10
|
+
const { prefixCls, value } = props;
|
|
11
|
+
const { min, max, direction, includedStart, includedEnd, included } = sliderContext.value;
|
|
12
|
+
const textCls = `${prefixCls}-text`;
|
|
13
|
+
const positionStyle = require_util.getDirectionStyle(direction, value, min, max);
|
|
14
|
+
return (0, vue.createVNode)("span", {
|
|
15
|
+
"class": (0, __v_c_util.classNames)(textCls, { [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd }),
|
|
16
|
+
"style": {
|
|
17
|
+
...positionStyle,
|
|
18
|
+
...attrs.style
|
|
19
|
+
},
|
|
20
|
+
"onMousedown": (e) => {
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
},
|
|
23
|
+
"onClick": () => {
|
|
24
|
+
props?.onClick?.(value);
|
|
25
|
+
}
|
|
26
|
+
}, [slots.default?.()]);
|
|
27
|
+
};
|
|
28
|
+
}, { props: {
|
|
29
|
+
prefixCls: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
default: void 0
|
|
33
|
+
},
|
|
34
|
+
value: {
|
|
35
|
+
type: Number,
|
|
36
|
+
required: true,
|
|
37
|
+
default: void 0
|
|
38
|
+
},
|
|
39
|
+
style: {
|
|
40
|
+
type: null,
|
|
41
|
+
required: false,
|
|
42
|
+
default: void 0
|
|
43
|
+
},
|
|
44
|
+
onClick: {
|
|
45
|
+
type: Function,
|
|
46
|
+
required: false,
|
|
47
|
+
default: void 0
|
|
48
|
+
}
|
|
49
|
+
} });
|
|
50
|
+
var Mark_default = Mark;
|
|
51
|
+
exports.default = Mark_default;
|
package/dist/Marks/Mark.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { CSSProperties
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
2
|
export interface MarkProps {
|
|
3
3
|
prefixCls: string;
|
|
4
4
|
value: number;
|
|
5
5
|
style?: CSSProperties;
|
|
6
6
|
onClick?: Function;
|
|
7
7
|
}
|
|
8
|
-
declare const Mark:
|
|
8
|
+
declare const Mark: import('vue').DefineSetupFnComponent<MarkProps, {}, {}, MarkProps & {}, import('vue').PublicProps>;
|
|
9
9
|
export default Mark;
|
package/dist/Marks/Mark.js
CHANGED
|
@@ -1,39 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import { useInjectSlider } from "../context.js";
|
|
2
|
+
import { getDirectionStyle } from "../util.js";
|
|
3
|
+
import { createVNode, defineComponent } from "vue";
|
|
4
|
+
import { classNames } from "@v-c/util";
|
|
5
|
+
var Mark_default = /* @__PURE__ */ defineComponent((props, { attrs, slots }) => {
|
|
6
|
+
const sliderContext = useInjectSlider();
|
|
7
|
+
return () => {
|
|
8
|
+
const { prefixCls, value } = props;
|
|
9
|
+
const { min, max, direction, includedStart, includedEnd, included } = sliderContext.value;
|
|
10
|
+
const textCls = `${prefixCls}-text`;
|
|
11
|
+
const positionStyle = getDirectionStyle(direction, value, min, max);
|
|
12
|
+
return createVNode("span", {
|
|
13
|
+
"class": classNames(textCls, { [`${textCls}-active`]: included && includedStart <= value && value <= includedEnd }),
|
|
14
|
+
"style": {
|
|
15
|
+
...positionStyle,
|
|
16
|
+
...attrs.style
|
|
17
|
+
},
|
|
18
|
+
"onMousedown": (e) => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
},
|
|
21
|
+
"onClick": () => {
|
|
22
|
+
props?.onClick?.(value);
|
|
23
|
+
}
|
|
24
|
+
}, [slots.default?.()]);
|
|
25
|
+
};
|
|
26
|
+
}, { props: {
|
|
27
|
+
prefixCls: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: true,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
style: {
|
|
38
|
+
type: null,
|
|
39
|
+
required: false,
|
|
40
|
+
default: void 0
|
|
41
|
+
},
|
|
42
|
+
onClick: {
|
|
43
|
+
type: Function,
|
|
44
|
+
required: false,
|
|
45
|
+
default: void 0
|
|
46
|
+
}
|
|
47
|
+
} });
|
|
48
|
+
export { Mark_default as default };
|
package/dist/Marks/index.cjs
CHANGED
|
@@ -1 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
|
|
3
|
+
const require_Mark = require("./Mark.cjs");
|
|
4
|
+
let vue = require("vue");
|
|
5
|
+
var Marks = /* @__PURE__ */ (0, vue.defineComponent)((props, { emit, slots }) => {
|
|
6
|
+
return () => {
|
|
7
|
+
const { prefixCls, marks = [] } = props;
|
|
8
|
+
const markPrefixCls = `${prefixCls}-mark`;
|
|
9
|
+
if (!marks.length) return null;
|
|
10
|
+
return (0, vue.createVNode)("div", { "class": markPrefixCls }, [marks.map(({ value, style, label }) => (0, vue.createVNode)(require_Mark.default, {
|
|
11
|
+
"key": value,
|
|
12
|
+
"prefixCls": markPrefixCls,
|
|
13
|
+
"style": style,
|
|
14
|
+
"value": value,
|
|
15
|
+
"onClick": () => emit("click", value)
|
|
16
|
+
}, { default: () => [slots.mark?.({
|
|
17
|
+
point: value,
|
|
18
|
+
label
|
|
19
|
+
}) || label] }))]);
|
|
20
|
+
};
|
|
21
|
+
}, { props: {
|
|
22
|
+
prefixCls: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
default: void 0
|
|
26
|
+
},
|
|
27
|
+
marks: {
|
|
28
|
+
type: Array,
|
|
29
|
+
required: false,
|
|
30
|
+
default: void 0
|
|
31
|
+
},
|
|
32
|
+
onClick: {
|
|
33
|
+
type: Function,
|
|
34
|
+
required: false,
|
|
35
|
+
default: void 0
|
|
36
|
+
}
|
|
37
|
+
} });
|
|
38
|
+
var Marks_default = Marks;
|
|
39
|
+
exports.default = Marks_default;
|
package/dist/Marks/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties
|
|
1
|
+
import { CSSProperties } from 'vue';
|
|
2
2
|
export interface MarkObj {
|
|
3
3
|
style?: CSSProperties;
|
|
4
4
|
label?: any;
|
|
@@ -11,5 +11,5 @@ export interface MarksProps {
|
|
|
11
11
|
marks?: InternalMarkObj[];
|
|
12
12
|
onClick?: (value: number) => void;
|
|
13
13
|
}
|
|
14
|
-
declare const Marks:
|
|
14
|
+
declare const Marks: import('vue').DefineSetupFnComponent<MarksProps, {}, {}, MarksProps & {}, import('vue').PublicProps>;
|
|
15
15
|
export default Marks;
|
package/dist/Marks/index.js
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import Mark_default from "./Mark.js";
|
|
2
|
+
import { createVNode, defineComponent } from "vue";
|
|
3
|
+
var Marks_default = /* @__PURE__ */ defineComponent((props, { emit, slots }) => {
|
|
4
|
+
return () => {
|
|
5
|
+
const { prefixCls, marks = [] } = props;
|
|
6
|
+
const markPrefixCls = `${prefixCls}-mark`;
|
|
7
|
+
if (!marks.length) return null;
|
|
8
|
+
return createVNode("div", { "class": markPrefixCls }, [marks.map(({ value, style, label }) => createVNode(Mark_default, {
|
|
9
|
+
"key": value,
|
|
10
|
+
"prefixCls": markPrefixCls,
|
|
11
|
+
"style": style,
|
|
12
|
+
"value": value,
|
|
13
|
+
"onClick": () => emit("click", value)
|
|
14
|
+
}, { default: () => [slots.mark?.({
|
|
15
|
+
point: value,
|
|
16
|
+
label
|
|
17
|
+
}) || label] }))]);
|
|
18
|
+
};
|
|
19
|
+
}, { props: {
|
|
20
|
+
prefixCls: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
marks: {
|
|
26
|
+
type: Array,
|
|
27
|
+
required: false,
|
|
28
|
+
default: void 0
|
|
29
|
+
},
|
|
30
|
+
onClick: {
|
|
31
|
+
type: Function,
|
|
32
|
+
required: false,
|
|
33
|
+
default: void 0
|
|
34
|
+
}
|
|
35
|
+
} });
|
|
36
|
+
export { Marks_default as default };
|