@v-c/slider 1.0.2 → 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.
Files changed (76) hide show
  1. package/dist/Handles/Handle.cjs +195 -1
  2. package/dist/Handles/Handle.d.ts +17 -5
  3. package/dist/Handles/Handle.js +191 -202
  4. package/dist/Handles/index.cjs +108 -1
  5. package/dist/Handles/index.d.ts +20 -4
  6. package/dist/Handles/index.js +105 -116
  7. package/dist/Marks/Mark.cjs +51 -1
  8. package/dist/Marks/Mark.d.ts +2 -2
  9. package/dist/Marks/Mark.js +48 -39
  10. package/dist/Marks/index.cjs +39 -1
  11. package/dist/Marks/index.d.ts +2 -2
  12. package/dist/Marks/index.js +36 -32
  13. package/dist/Slider.cjs +569 -1
  14. package/dist/Slider.d.ts +60 -263
  15. package/dist/Slider.js +563 -352
  16. package/dist/Steps/Dot.cjs +52 -1
  17. package/dist/Steps/Dot.d.ts +2 -2
  18. package/dist/Steps/Dot.js +49 -38
  19. package/dist/Steps/index.cjs +64 -1
  20. package/dist/Steps/index.d.ts +2 -2
  21. package/dist/Steps/index.js +61 -41
  22. package/dist/Tracks/Track.cjs +74 -1
  23. package/dist/Tracks/Track.js +70 -81
  24. package/dist/Tracks/index.cjs +70 -1
  25. package/dist/Tracks/index.js +66 -82
  26. package/dist/_virtual/rolldown_runtime.cjs +21 -0
  27. package/dist/context.cjs +39 -1
  28. package/dist/context.d.ts +13 -7
  29. package/dist/context.js +29 -24
  30. package/dist/hooks/useDrag.cjs +160 -1
  31. package/dist/hooks/useDrag.d.ts +2 -2
  32. package/dist/hooks/useDrag.js +155 -86
  33. package/dist/hooks/useOffset.cjs +124 -1
  34. package/dist/hooks/useOffset.d.ts +2 -1
  35. package/dist/hooks/useOffset.js +122 -97
  36. package/dist/hooks/useRange.cjs +21 -1
  37. package/dist/hooks/useRange.js +18 -9
  38. package/dist/index.cjs +6 -1
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +4 -4
  41. package/dist/interface.cjs +0 -1
  42. package/dist/interface.js +0 -1
  43. package/dist/util.cjs +32 -1
  44. package/dist/util.js +27 -26
  45. package/package.json +18 -10
  46. package/docs/TooltipSlider.tsx +0 -94
  47. package/docs/assets/anim.less +0 -63
  48. package/docs/assets/bootstrap.less +0 -163
  49. package/docs/assets/index.less +0 -337
  50. package/docs/debug.vue +0 -60
  51. package/docs/editable.vue +0 -59
  52. package/docs/handle.vue +0 -45
  53. package/docs/marks.vue +0 -94
  54. package/docs/multiple.vue +0 -54
  55. package/docs/range.vue +0 -211
  56. package/docs/slider.stories.vue +0 -45
  57. package/docs/sliderDemo.vue +0 -267
  58. package/docs/vertical.vue +0 -122
  59. package/src/Handles/Handle.tsx +0 -223
  60. package/src/Handles/index.tsx +0 -124
  61. package/src/Marks/Mark.tsx +0 -40
  62. package/src/Marks/index.tsx +0 -40
  63. package/src/Slider.tsx +0 -593
  64. package/src/Steps/Dot.tsx +0 -40
  65. package/src/Steps/index.tsx +0 -54
  66. package/src/Tracks/Track.tsx +0 -89
  67. package/src/Tracks/index.tsx +0 -92
  68. package/src/context.ts +0 -65
  69. package/src/hooks/useDrag.ts +0 -243
  70. package/src/hooks/useOffset.ts +0 -264
  71. package/src/hooks/useRange.ts +0 -24
  72. package/src/index.ts +0 -8
  73. package/src/interface.ts +0 -17
  74. package/src/util.ts +0 -41
  75. package/vite.config.ts +0 -18
  76. package/vitest.config.ts +0 -11
@@ -1 +1,108 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("../util.cjs"),p=require("./Handle.cjs"),M=e.defineComponent({name:"Handles",props:{prefixCls:{type:String,required:!0},values:{type:Array,required:!0},handleStyle:{type:[Object,Array]},onStartMove:{type:Function,required:!0},onOffsetChange:{type:Function,required:!0},onFocus:{type:Function},onBlur:{type:Function},onDelete:{type:Function,required:!0},handleRender:Function,activeHandleRender:Function,draggingIndex:{type:Number,default:-1},draggingDelete:{type:Boolean,default:!1},onChangeComplete:Function},emits:["focus"],slots:Object,setup(v,{emit:y,expose:F}){const u=e.ref(),o=e.ref(!1),a=e.ref(-1),l=n=>{a.value=n,o.value=!0},h=(n,t)=>{l(t),y("focus",n)},m=(n,t)=>{l(t)};return F({focus:()=>u.value?.focus(),hideHelp:()=>{o.value=!1}}),()=>{const{prefixCls:n,onStartMove:t,onOffsetChange:q,values:s,handleRender:H,activeHandleRender:d,draggingIndex:i,draggingDelete:c,onFocus:x,handleStyle:C,...S}=v,g={prefixCls:n,onStartMove:t,onOffsetChange:q,render:H,onFocus:h,onMouseenter:m,...S};return e.createVNode(e.Fragment,null,[s?.map((b,r)=>{const f=i===r;return e.createVNode(p.default,e.mergeProps({ref:u.value,dragging:f,draggingDelete:f&&c,style:I.getIndex(C,r),key:r,value:b,valueIndex:r},g),null)}),d&&o.value&&e.createVNode(p.default,e.mergeProps({key:"a11y"},g,{value:s[a.value],valueIndex:1,dragging:i!==-1,draggingDelete:c,render:d,style:{pointerEvents:"none"},"aria-hidden":!0}),null)])}}});exports.default=M;
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;
@@ -1,5 +1,13 @@
1
1
  import { CSSProperties, PropType, SlotsType } from 'vue';
2
2
  import { OnStartMove } from '../interface';
3
+ export interface RenderProps {
4
+ index: number | null;
5
+ prefixCls: string;
6
+ value: number;
7
+ dragging: boolean;
8
+ draggingDelete: boolean;
9
+ node: any;
10
+ }
3
11
  export interface HandlesRef {
4
12
  focus: (index: number) => void;
5
13
  hideHelp: VoidFunction;
@@ -34,8 +42,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
34
42
  type: PropType<(index: number) => void>;
35
43
  required: true;
36
44
  };
37
- handleRender: FunctionConstructor;
38
- activeHandleRender: FunctionConstructor;
45
+ handleRender: {
46
+ type: PropType<(props: RenderProps) => any>;
47
+ };
48
+ activeHandleRender: {
49
+ type: PropType<(props: RenderProps) => any>;
50
+ };
39
51
  draggingIndex: {
40
52
  type: NumberConstructor;
41
53
  default: number;
@@ -75,8 +87,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
75
87
  type: PropType<(index: number) => void>;
76
88
  required: true;
77
89
  };
78
- handleRender: FunctionConstructor;
79
- activeHandleRender: FunctionConstructor;
90
+ handleRender: {
91
+ type: PropType<(props: RenderProps) => any>;
92
+ };
93
+ activeHandleRender: {
94
+ type: PropType<(props: RenderProps) => any>;
95
+ };
80
96
  draggingIndex: {
81
97
  type: NumberConstructor;
82
98
  default: number;
@@ -1,117 +1,106 @@
1
- import { defineComponent as S, ref as o, createVNode as a, Fragment as b, mergeProps as v } from "vue";
2
- import { getIndex as M } from "../util.js";
3
- import y from "./Handle.js";
4
- const k = /* @__PURE__ */ S({
5
- name: "Handles",
6
- props: {
7
- prefixCls: {
8
- type: String,
9
- required: !0
10
- },
11
- values: {
12
- type: Array,
13
- required: !0
14
- },
15
- handleStyle: {
16
- type: [Object, Array]
17
- },
18
- onStartMove: {
19
- type: Function,
20
- required: !0
21
- },
22
- onOffsetChange: {
23
- type: Function,
24
- required: !0
25
- },
26
- onFocus: {
27
- type: Function
28
- },
29
- onBlur: {
30
- type: Function
31
- },
32
- onDelete: {
33
- type: Function,
34
- required: !0
35
- },
36
- handleRender: Function,
37
- activeHandleRender: Function,
38
- draggingIndex: {
39
- type: Number,
40
- default: -1
41
- },
42
- draggingDelete: {
43
- type: Boolean,
44
- default: !1
45
- },
46
- onChangeComplete: Function
47
- },
48
- emits: ["focus"],
49
- slots: Object,
50
- setup(m, {
51
- emit: F,
52
- expose: h
53
- }) {
54
- const l = o(), r = o(!1), u = o(-1), s = (e) => {
55
- u.value = e, r.value = !0;
56
- }, H = (e, n) => {
57
- s(n), F("focus", e);
58
- }, C = (e, n) => {
59
- s(n);
60
- };
61
- return h({
62
- focus: () => l.value?.focus(),
63
- hideHelp: () => {
64
- r.value = !1;
65
- }
66
- }), () => {
67
- const {
68
- prefixCls: e,
69
- onStartMove: n,
70
- onOffsetChange: x,
71
- values: d,
72
- handleRender: I,
73
- activeHandleRender: i,
74
- draggingIndex: c,
75
- draggingDelete: g,
76
- onFocus: O,
77
- handleStyle: q,
78
- ...D
79
- } = m, p = {
80
- prefixCls: e,
81
- onStartMove: n,
82
- onOffsetChange: x,
83
- render: I,
84
- onFocus: H,
85
- onMouseenter: C,
86
- ...D
87
- };
88
- return a(b, null, [d?.map((R, t) => {
89
- const f = c === t;
90
- return a(y, v({
91
- ref: l.value,
92
- dragging: f,
93
- draggingDelete: f && g,
94
- style: M(q, t),
95
- key: t,
96
- value: R,
97
- valueIndex: t
98
- }, p), null);
99
- }), i && r.value && a(y, v({
100
- key: "a11y"
101
- }, p, {
102
- value: d[u.value],
103
- valueIndex: 1,
104
- dragging: c !== -1,
105
- draggingDelete: g,
106
- render: i,
107
- style: {
108
- pointerEvents: "none"
109
- },
110
- "aria-hidden": !0
111
- }), null)]);
112
- };
113
- }
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
+ }
114
105
  });
115
- export {
116
- k as default
117
- };
106
+ export { Handles_default as default };
@@ -1 +1,51 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const x=require("vue"),y=require("classnames"),f=require("../context.cjs"),g=require("../util.cjs"),q=(n,{attrs:o,slots:l,emit:c})=>{const{prefixCls:i,value:e}=n,{min:s,max:u,direction:r,includedStart:a,includedEnd:d,included:v}=f.useInjectSlider(),t=`${i}-text`,p=g.getDirectionStyle(r.value,e,s.value,u.value);return x.createVNode("span",{class:y(t,{[`${t}-active`]:v&&a<=e&&e<=d}),style:{...p,...o.style},onMousedown:S=>{S.stopPropagation()},onClick:()=>{c("click",e)}},[l.default?.()])};exports.default=q;
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;
@@ -1,9 +1,9 @@
1
- import { CSSProperties, FunctionalComponent } from 'vue';
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: FunctionalComponent<MarkProps>;
8
+ declare const Mark: import('vue').DefineSetupFnComponent<MarkProps, {}, {}, MarkProps & {}, import('vue').PublicProps>;
9
9
  export default Mark;
@@ -1,39 +1,48 @@
1
- import { createVNode as v } from "vue";
2
- import x from "classnames";
3
- import { useInjectSlider as y } from "../context.js";
4
- import { getDirectionStyle as S } from "../util.js";
5
- const $ = (o, {
6
- attrs: i,
7
- slots: l,
8
- emit: n
9
- }) => {
10
- const {
11
- prefixCls: r,
12
- value: t
13
- } = o, {
14
- min: c,
15
- max: s,
16
- direction: a,
17
- includedStart: d,
18
- includedEnd: u,
19
- included: m
20
- } = y(), e = `${r}-text`, p = S(a.value, t, c.value, s.value);
21
- return v("span", {
22
- class: x(e, {
23
- [`${e}-active`]: m && d <= t && t <= u
24
- }),
25
- style: {
26
- ...p,
27
- ...i.style
28
- },
29
- onMousedown: (f) => {
30
- f.stopPropagation();
31
- },
32
- onClick: () => {
33
- n("click", t);
34
- }
35
- }, [l.default?.()]);
36
- };
37
- export {
38
- $ as default
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 };
@@ -1 +1,39 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),u=require("./Mark.cjs"),d=(l,{emit:o,slots:a})=>{const{prefixCls:c,marks:r=[]}=l,t=`${c}-mark`;return r.length?i.createVNode("div",{class:t},[r.map(({value:e,style:n,label:s})=>i.createVNode(u.default,{key:e,prefixCls:t,style:n,value:e,onClick:()=>o("click",e)},{default:()=>[a.mark?.({point:e,label:s})||s]}))]):null};exports.default=d;
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;
@@ -1,4 +1,4 @@
1
- import { CSSProperties, FunctionalComponent } from 'vue';
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: FunctionalComponent<MarksProps>;
14
+ declare const Marks: import('vue').DefineSetupFnComponent<MarksProps, {}, {}, MarksProps & {}, import('vue').PublicProps>;
15
15
  export default Marks;
@@ -1,32 +1,36 @@
1
- import { createVNode as o } from "vue";
2
- import c from "./Mark.js";
3
- const p = (i, {
4
- emit: a,
5
- slots: k
6
- }) => {
7
- const {
8
- prefixCls: m,
9
- marks: t = []
10
- } = i, s = `${m}-mark`;
11
- return t.length ? o("div", {
12
- class: s
13
- }, [t.map(({
14
- value: r,
15
- style: n,
16
- label: e
17
- }) => o(c, {
18
- key: r,
19
- prefixCls: s,
20
- style: n,
21
- value: r,
22
- onClick: () => a("click", r)
23
- }, {
24
- default: () => [k.mark?.({
25
- point: r,
26
- label: e
27
- }) || e]
28
- }))]) : null;
29
- };
30
- export {
31
- p as default
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 };