@coreui/vue-pro 5.7.0 → 5.8.0

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 (70) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/components/date-picker/CDatePicker.d.ts +19 -0
  3. package/dist/cjs/components/date-picker/CDatePicker.js +9 -0
  4. package/dist/cjs/components/date-picker/CDatePicker.js.map +1 -1
  5. package/dist/cjs/components/date-range-picker/CDateRangePicker.d.ts +19 -0
  6. package/dist/cjs/components/date-range-picker/CDateRangePicker.js +26 -1
  7. package/dist/cjs/components/date-range-picker/CDateRangePicker.js.map +1 -1
  8. package/dist/cjs/components/index.d.ts +1 -0
  9. package/dist/cjs/components/index.js +28 -24
  10. package/dist/cjs/components/index.js.map +1 -1
  11. package/dist/cjs/components/picker/CPicker.d.ts +19 -0
  12. package/dist/cjs/components/picker/CPicker.js +32 -7
  13. package/dist/cjs/components/picker/CPicker.js.map +1 -1
  14. package/dist/cjs/components/range-slider/CRangeSlider.d.ts +241 -0
  15. package/dist/cjs/components/range-slider/CRangeSlider.js +311 -0
  16. package/dist/cjs/components/range-slider/CRangeSlider.js.map +1 -0
  17. package/dist/cjs/components/range-slider/index.d.ts +6 -0
  18. package/dist/cjs/components/range-slider/index.js +13 -0
  19. package/dist/cjs/components/range-slider/index.js.map +1 -0
  20. package/dist/cjs/components/range-slider/types.d.ts +11 -0
  21. package/dist/cjs/components/range-slider/utils.d.ts +38 -0
  22. package/dist/cjs/components/range-slider/utils.js +172 -0
  23. package/dist/cjs/components/range-slider/utils.js.map +1 -0
  24. package/dist/cjs/components/sidebar/CSidebar.js +0 -1
  25. package/dist/cjs/components/sidebar/CSidebar.js.map +1 -1
  26. package/dist/cjs/components/time-picker/CTimePicker.d.ts +19 -0
  27. package/dist/cjs/components/time-picker/CTimePicker.js +26 -1
  28. package/dist/cjs/components/time-picker/CTimePicker.js.map +1 -1
  29. package/dist/cjs/index.js +34 -30
  30. package/dist/cjs/index.js.map +1 -1
  31. package/dist/esm/components/date-picker/CDatePicker.d.ts +19 -0
  32. package/dist/esm/components/date-picker/CDatePicker.js +9 -0
  33. package/dist/esm/components/date-picker/CDatePicker.js.map +1 -1
  34. package/dist/esm/components/date-range-picker/CDateRangePicker.d.ts +19 -0
  35. package/dist/esm/components/date-range-picker/CDateRangePicker.js +26 -1
  36. package/dist/esm/components/date-range-picker/CDateRangePicker.js.map +1 -1
  37. package/dist/esm/components/index.d.ts +1 -0
  38. package/dist/esm/components/index.js +2 -0
  39. package/dist/esm/components/index.js.map +1 -1
  40. package/dist/esm/components/picker/CPicker.d.ts +19 -0
  41. package/dist/esm/components/picker/CPicker.js +32 -7
  42. package/dist/esm/components/picker/CPicker.js.map +1 -1
  43. package/dist/esm/components/range-slider/CRangeSlider.d.ts +241 -0
  44. package/dist/esm/components/range-slider/CRangeSlider.js +309 -0
  45. package/dist/esm/components/range-slider/CRangeSlider.js.map +1 -0
  46. package/dist/esm/components/range-slider/index.d.ts +6 -0
  47. package/dist/esm/components/range-slider/index.js +10 -0
  48. package/dist/esm/components/range-slider/index.js.map +1 -0
  49. package/dist/esm/components/range-slider/types.d.ts +11 -0
  50. package/dist/esm/components/range-slider/utils.d.ts +38 -0
  51. package/dist/esm/components/range-slider/utils.js +157 -0
  52. package/dist/esm/components/range-slider/utils.js.map +1 -0
  53. package/dist/esm/components/sidebar/CSidebar.js +0 -1
  54. package/dist/esm/components/sidebar/CSidebar.js.map +1 -1
  55. package/dist/esm/components/time-picker/CTimePicker.d.ts +19 -0
  56. package/dist/esm/components/time-picker/CTimePicker.js +26 -1
  57. package/dist/esm/components/time-picker/CTimePicker.js.map +1 -1
  58. package/dist/esm/index.js +2 -0
  59. package/dist/esm/index.js.map +1 -1
  60. package/package.json +3 -3
  61. package/src/components/date-picker/CDatePicker.ts +9 -0
  62. package/src/components/date-range-picker/CDateRangePicker.ts +26 -2
  63. package/src/components/index.ts +1 -0
  64. package/src/components/picker/CPicker.ts +43 -7
  65. package/src/components/range-slider/CRangeSlider.ts +420 -0
  66. package/src/components/range-slider/index.ts +10 -0
  67. package/src/components/range-slider/types.ts +16 -0
  68. package/src/components/range-slider/utils.ts +241 -0
  69. package/src/components/sidebar/CSidebar.ts +0 -1
  70. package/src/components/time-picker/CTimePicker.ts +26 -1
@@ -0,0 +1,241 @@
1
+ import { PropType, VNode } from 'vue';
2
+ import type { Label } from './types';
3
+ declare const CRangeSlider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ /**
5
+ * Enable or disable clickable labels in the Vue Range Slider.
6
+ * When set to `true`, users can click on labels to adjust the slider's value directly, enhancing interactivity and user experience.
7
+ */
8
+ clickableLabels: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ /**
13
+ * Control the interactive state of the Vue Range Slider with the `disabled` prop.
14
+ * Setting it to `true` will disable all slider functionalities, preventing user interaction and visually indicating a non-interactive state.
15
+ */
16
+ disabled: {
17
+ type: BooleanConstructor;
18
+ default: boolean;
19
+ };
20
+ /**
21
+ * Define the minimum distance between slider handles using the `distance` prop in the Vue Range Slider.
22
+ * This ensures that the handles maintain a specified separation, preventing overlap and maintaining clear value distinctions.
23
+ */
24
+ distance: {
25
+ type: NumberConstructor;
26
+ default: number;
27
+ };
28
+ /**
29
+ * Add descriptive labels to your Vue Range Slider by providing an array of `labels`.
30
+ * These labels enhance the slider's usability by clearly indicating key values and providing contextual information to users.
31
+ */
32
+ labels: {
33
+ type: PropType<Label[]>;
34
+ default: () => never[];
35
+ };
36
+ /**
37
+ * Specify the maximum value for the Vue Range Slider with the `max` prop.
38
+ * This determines the upper limit of the slider's range, enabling precise control over the highest selectable value.
39
+ */
40
+ max: {
41
+ type: NumberConstructor;
42
+ default: number;
43
+ };
44
+ /**
45
+ * Set the minimum value for the Vue Range Slider using the `min` prop.
46
+ * This defines the lower bound of the slider's range, allowing you to control the starting point of user selection.
47
+ */
48
+ min: {
49
+ type: NumberConstructor;
50
+ default: number;
51
+ };
52
+ /**
53
+ * The default name for a value passed using v-model.
54
+ */
55
+ modelValue: PropType<number | number[]>;
56
+ /**
57
+ * Assign a `name` to the Vue Range Slider for form integration.
58
+ * Whether using a single string or an array of strings, this prop ensures that the slider's values are correctly identified when submitting forms.
59
+ */
60
+ name: {
61
+ type: PropType<string | string[]>;
62
+ default: string;
63
+ };
64
+ /**
65
+ * Control the granularity of the Vue Range Slider by setting the `step` prop.
66
+ * This defines the increment intervals between selectable values, allowing for precise adjustments based on your application's requirements.
67
+ */
68
+ step: {
69
+ type: NumberConstructor;
70
+ default: number;
71
+ };
72
+ /**
73
+ * Toggle the visibility of tooltips in the Vue Range Slider with the `tooltips` prop.
74
+ * When enabled, tooltips display the current value of the slider handles, providing real-time feedback to users.
75
+ */
76
+ tooltips: {
77
+ type: BooleanConstructor;
78
+ default: boolean;
79
+ };
80
+ /**
81
+ * Customize the display format of tooltips in the Vue Range Slider using the `tooltipsFormat` function.
82
+ * This allows you to format the tooltip values according to your specific requirements, enhancing the clarity and presentation of information.
83
+ */
84
+ tooltipsFormat: {
85
+ type: PropType<(value: number) => string | VNode>;
86
+ default: null;
87
+ };
88
+ /**
89
+ * Controls the visual representation of the slider's track. When set to `'fill'`, the track is dynamically filled based on the slider's value(s). Setting it to `false` disables the filled track.
90
+ */
91
+ track: {
92
+ type: (StringConstructor | BooleanConstructor)[];
93
+ default: string;
94
+ validator: (value: boolean | string) => value is boolean | "fill";
95
+ };
96
+ /**
97
+ * Set the current value(s) of the Vue Range Slider using the `value` prop.
98
+ * Whether you're using a single value or an array for multi-handle sliders, this prop controls the slider's position and ensures it reflects the desired state.
99
+ */
100
+ value: {
101
+ type: PropType<number | number[]>;
102
+ default: () => number[];
103
+ };
104
+ /**
105
+ * Orient the Vue Range Slider vertically by setting the `vertical` prop to `true`.
106
+ * This changes the slider's layout from horizontal to vertical, providing a different aesthetic and fitting various UI designs.
107
+ */
108
+ vertical: {
109
+ type: BooleanConstructor;
110
+ default: boolean;
111
+ };
112
+ }>, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
113
+ [key: string]: any;
114
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
115
+ /**
116
+ * Enable or disable clickable labels in the Vue Range Slider.
117
+ * When set to `true`, users can click on labels to adjust the slider's value directly, enhancing interactivity and user experience.
118
+ */
119
+ clickableLabels: {
120
+ type: BooleanConstructor;
121
+ default: boolean;
122
+ };
123
+ /**
124
+ * Control the interactive state of the Vue Range Slider with the `disabled` prop.
125
+ * Setting it to `true` will disable all slider functionalities, preventing user interaction and visually indicating a non-interactive state.
126
+ */
127
+ disabled: {
128
+ type: BooleanConstructor;
129
+ default: boolean;
130
+ };
131
+ /**
132
+ * Define the minimum distance between slider handles using the `distance` prop in the Vue Range Slider.
133
+ * This ensures that the handles maintain a specified separation, preventing overlap and maintaining clear value distinctions.
134
+ */
135
+ distance: {
136
+ type: NumberConstructor;
137
+ default: number;
138
+ };
139
+ /**
140
+ * Add descriptive labels to your Vue Range Slider by providing an array of `labels`.
141
+ * These labels enhance the slider's usability by clearly indicating key values and providing contextual information to users.
142
+ */
143
+ labels: {
144
+ type: PropType<Label[]>;
145
+ default: () => never[];
146
+ };
147
+ /**
148
+ * Specify the maximum value for the Vue Range Slider with the `max` prop.
149
+ * This determines the upper limit of the slider's range, enabling precise control over the highest selectable value.
150
+ */
151
+ max: {
152
+ type: NumberConstructor;
153
+ default: number;
154
+ };
155
+ /**
156
+ * Set the minimum value for the Vue Range Slider using the `min` prop.
157
+ * This defines the lower bound of the slider's range, allowing you to control the starting point of user selection.
158
+ */
159
+ min: {
160
+ type: NumberConstructor;
161
+ default: number;
162
+ };
163
+ /**
164
+ * The default name for a value passed using v-model.
165
+ */
166
+ modelValue: PropType<number | number[]>;
167
+ /**
168
+ * Assign a `name` to the Vue Range Slider for form integration.
169
+ * Whether using a single string or an array of strings, this prop ensures that the slider's values are correctly identified when submitting forms.
170
+ */
171
+ name: {
172
+ type: PropType<string | string[]>;
173
+ default: string;
174
+ };
175
+ /**
176
+ * Control the granularity of the Vue Range Slider by setting the `step` prop.
177
+ * This defines the increment intervals between selectable values, allowing for precise adjustments based on your application's requirements.
178
+ */
179
+ step: {
180
+ type: NumberConstructor;
181
+ default: number;
182
+ };
183
+ /**
184
+ * Toggle the visibility of tooltips in the Vue Range Slider with the `tooltips` prop.
185
+ * When enabled, tooltips display the current value of the slider handles, providing real-time feedback to users.
186
+ */
187
+ tooltips: {
188
+ type: BooleanConstructor;
189
+ default: boolean;
190
+ };
191
+ /**
192
+ * Customize the display format of tooltips in the Vue Range Slider using the `tooltipsFormat` function.
193
+ * This allows you to format the tooltip values according to your specific requirements, enhancing the clarity and presentation of information.
194
+ */
195
+ tooltipsFormat: {
196
+ type: PropType<(value: number) => string | VNode>;
197
+ default: null;
198
+ };
199
+ /**
200
+ * Controls the visual representation of the slider's track. When set to `'fill'`, the track is dynamically filled based on the slider's value(s). Setting it to `false` disables the filled track.
201
+ */
202
+ track: {
203
+ type: (StringConstructor | BooleanConstructor)[];
204
+ default: string;
205
+ validator: (value: boolean | string) => value is boolean | "fill";
206
+ };
207
+ /**
208
+ * Set the current value(s) of the Vue Range Slider using the `value` prop.
209
+ * Whether you're using a single value or an array for multi-handle sliders, this prop controls the slider's position and ensures it reflects the desired state.
210
+ */
211
+ value: {
212
+ type: PropType<number | number[]>;
213
+ default: () => number[];
214
+ };
215
+ /**
216
+ * Orient the Vue Range Slider vertically by setting the `vertical` prop to `true`.
217
+ * This changes the slider's layout from horizontal to vertical, providing a different aesthetic and fitting various UI designs.
218
+ */
219
+ vertical: {
220
+ type: BooleanConstructor;
221
+ default: boolean;
222
+ };
223
+ }>> & Readonly<{
224
+ onChange?: ((...args: any[]) => any) | undefined;
225
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
226
+ }>, {
227
+ name: string | string[];
228
+ track: string | boolean;
229
+ value: number | number[];
230
+ disabled: boolean;
231
+ vertical: boolean;
232
+ max: number;
233
+ min: number;
234
+ clickableLabels: boolean;
235
+ distance: number;
236
+ labels: Label[];
237
+ step: number;
238
+ tooltips: boolean;
239
+ tooltipsFormat: (value: number) => string | VNode;
240
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
241
+ export { CRangeSlider };
@@ -0,0 +1,311 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var utils = require('./utils.js');
5
+ var isRTL = require('../../utils/isRTL.js');
6
+
7
+ const CRangeSlider = vue.defineComponent({
8
+ name: 'CRangeSlider',
9
+ props: {
10
+ /**
11
+ * Enable or disable clickable labels in the Vue Range Slider.
12
+ * When set to `true`, users can click on labels to adjust the slider's value directly, enhancing interactivity and user experience.
13
+ */
14
+ clickableLabels: {
15
+ type: Boolean,
16
+ default: true,
17
+ },
18
+ /**
19
+ * Control the interactive state of the Vue Range Slider with the `disabled` prop.
20
+ * Setting it to `true` will disable all slider functionalities, preventing user interaction and visually indicating a non-interactive state.
21
+ */
22
+ disabled: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ /**
27
+ * Define the minimum distance between slider handles using the `distance` prop in the Vue Range Slider.
28
+ * This ensures that the handles maintain a specified separation, preventing overlap and maintaining clear value distinctions.
29
+ */
30
+ distance: {
31
+ type: Number,
32
+ default: 0,
33
+ },
34
+ /**
35
+ * Add descriptive labels to your Vue Range Slider by providing an array of `labels`.
36
+ * These labels enhance the slider's usability by clearly indicating key values and providing contextual information to users.
37
+ */
38
+ labels: {
39
+ type: Array,
40
+ default: () => [],
41
+ },
42
+ /**
43
+ * Specify the maximum value for the Vue Range Slider with the `max` prop.
44
+ * This determines the upper limit of the slider's range, enabling precise control over the highest selectable value.
45
+ */
46
+ max: {
47
+ type: Number,
48
+ default: 100,
49
+ },
50
+ /**
51
+ * Set the minimum value for the Vue Range Slider using the `min` prop.
52
+ * This defines the lower bound of the slider's range, allowing you to control the starting point of user selection.
53
+ */
54
+ min: {
55
+ type: Number,
56
+ default: 0,
57
+ },
58
+ /**
59
+ * The default name for a value passed using v-model.
60
+ */
61
+ modelValue: [Number, Array],
62
+ /**
63
+ * Assign a `name` to the Vue Range Slider for form integration.
64
+ * Whether using a single string or an array of strings, this prop ensures that the slider's values are correctly identified when submitting forms.
65
+ */
66
+ name: {
67
+ type: [String, Array],
68
+ default: '',
69
+ },
70
+ /**
71
+ * Control the granularity of the Vue Range Slider by setting the `step` prop.
72
+ * This defines the increment intervals between selectable values, allowing for precise adjustments based on your application's requirements.
73
+ */
74
+ step: {
75
+ type: Number,
76
+ default: 1,
77
+ },
78
+ /**
79
+ * Toggle the visibility of tooltips in the Vue Range Slider with the `tooltips` prop.
80
+ * When enabled, tooltips display the current value of the slider handles, providing real-time feedback to users.
81
+ */
82
+ tooltips: {
83
+ type: Boolean,
84
+ default: true,
85
+ },
86
+ /**
87
+ * Customize the display format of tooltips in the Vue Range Slider using the `tooltipsFormat` function.
88
+ * This allows you to format the tooltip values according to your specific requirements, enhancing the clarity and presentation of information.
89
+ */
90
+ tooltipsFormat: {
91
+ type: Function,
92
+ default: null,
93
+ },
94
+ /**
95
+ * Controls the visual representation of the slider's track. When set to `'fill'`, the track is dynamically filled based on the slider's value(s). Setting it to `false` disables the filled track.
96
+ */
97
+ track: {
98
+ type: [Boolean, String],
99
+ default: 'fill',
100
+ validator: (value) => {
101
+ return typeof value === 'boolean' || value === 'fill';
102
+ },
103
+ },
104
+ /**
105
+ * Set the current value(s) of the Vue Range Slider using the `value` prop.
106
+ * Whether you're using a single value or an array for multi-handle sliders, this prop controls the slider's position and ensures it reflects the desired state.
107
+ */
108
+ value: {
109
+ type: [Number, Array],
110
+ default: () => [0],
111
+ },
112
+ /**
113
+ * Orient the Vue Range Slider vertically by setting the `vertical` prop to `true`.
114
+ * This changes the slider's layout from horizontal to vertical, providing a different aesthetic and fitting various UI designs.
115
+ */
116
+ vertical: {
117
+ type: Boolean,
118
+ default: false,
119
+ },
120
+ },
121
+ emits: [
122
+ 'change',
123
+ /**
124
+ * Emit the new value whenever there’s a change event.
125
+ */
126
+ 'update:modelValue',
127
+ ],
128
+ setup(props, { emit }) {
129
+ const rangeSliderRef = vue.ref(null);
130
+ const inputsRef = vue.ref([]);
131
+ const labelsContainerRef = vue.ref(null);
132
+ const labelsRef = vue.ref([]);
133
+ const trackRef = vue.ref(null);
134
+ const currentValue = vue.ref(props.modelValue
135
+ ? Array.isArray(props.modelValue)
136
+ ? props.modelValue
137
+ : [props.modelValue]
138
+ : Array.isArray(props.value)
139
+ ? props.value
140
+ : [props.value]);
141
+ const isDragging = vue.ref(false);
142
+ const dragIndex = vue.ref(0);
143
+ const thumbSize = vue.ref();
144
+ vue.watch(() => props.value, (newVal) => {
145
+ currentValue.value = Array.isArray(newVal) ? newVal : [newVal];
146
+ });
147
+ vue.watch(() => props.modelValue, (newVal) => {
148
+ if (newVal !== undefined) {
149
+ currentValue.value = Array.isArray(newVal) ? newVal : [newVal];
150
+ }
151
+ });
152
+ // Adjust labels container size based on labels
153
+ vue.onMounted(() => {
154
+ const maxSize = Math.max(...labelsRef.value.map((label) => props.vertical ? label.offsetWidth : label.offsetHeight));
155
+ if (labelsContainerRef.value) {
156
+ labelsContainerRef.value.style[props.vertical ? 'width' : 'height'] = `${maxSize}px`;
157
+ }
158
+ if (rangeSliderRef.value) {
159
+ thumbSize.value = utils.getThumbSize(rangeSliderRef.value, props.vertical);
160
+ }
161
+ });
162
+ vue.watch(isDragging, (newVal) => {
163
+ if (newVal) {
164
+ window.addEventListener('mousemove', handleMouseMove);
165
+ window.addEventListener('mouseup', handleMouseUp);
166
+ }
167
+ else {
168
+ window.removeEventListener('mousemove', handleMouseMove);
169
+ window.removeEventListener('mouseup', handleMouseUp);
170
+ }
171
+ });
172
+ const updateNearestValue = (value) => {
173
+ const nearestIndex = utils.getNearestValueIndex(value, currentValue.value);
174
+ const newCurrentValue = [...currentValue.value];
175
+ newCurrentValue[nearestIndex] = utils.validateValue(value, currentValue.value, props.distance, nearestIndex);
176
+ setTimeout(() => {
177
+ if (inputsRef.value[nearestIndex]) {
178
+ inputsRef.value[nearestIndex].focus();
179
+ }
180
+ }, 0);
181
+ currentValue.value = newCurrentValue;
182
+ emit('change', newCurrentValue);
183
+ emit('update:modelValue', newCurrentValue);
184
+ };
185
+ const handleInputChange = (event, index) => {
186
+ if (props.disabled)
187
+ return;
188
+ const target = event.target;
189
+ const value = Number(target.value);
190
+ const newCurrentValue = utils.updateValue(value, currentValue.value, props.distance, index);
191
+ currentValue.value = newCurrentValue;
192
+ emit('change', newCurrentValue);
193
+ emit('update:modelValue', newCurrentValue);
194
+ };
195
+ const handleInputsContainerMouseDown = (event) => {
196
+ if (!trackRef.value)
197
+ return;
198
+ const clickValue = utils.calculateClickValue(event, trackRef.value, props.min, props.max, props.step, props.vertical, isRTL.default(rangeSliderRef.value));
199
+ const index = utils.getNearestValueIndex(clickValue, currentValue.value);
200
+ isDragging.value = true;
201
+ dragIndex.value = index;
202
+ updateNearestValue(clickValue);
203
+ };
204
+ const handleLabelClick = (value) => {
205
+ if (!props.clickableLabels || props.disabled)
206
+ return;
207
+ updateNearestValue(value);
208
+ };
209
+ const handleMouseMove = (event) => {
210
+ if (!isDragging.value || !trackRef.value)
211
+ return;
212
+ const moveValue = utils.calculateMoveValue(event, trackRef.value, props.min, props.max, props.step, props.vertical, isRTL.default(rangeSliderRef.value));
213
+ const newCurrentValue = utils.updateValue(moveValue, currentValue.value, props.distance, dragIndex.value);
214
+ currentValue.value = newCurrentValue;
215
+ emit('change', newCurrentValue);
216
+ emit('update:modelValue', newCurrentValue);
217
+ };
218
+ const handleMouseUp = () => {
219
+ isDragging.value = false;
220
+ };
221
+ return () => vue.h('div', {
222
+ class: [
223
+ 'range-slider',
224
+ {
225
+ 'range-slider-vertical': props.vertical,
226
+ disabled: props.disabled,
227
+ },
228
+ ],
229
+ ref: rangeSliderRef,
230
+ }, [
231
+ vue.h('div', {
232
+ class: 'range-slider-inputs-container',
233
+ onMousedown: handleInputsContainerMouseDown,
234
+ }, [
235
+ currentValue.value.map((value, index) => [
236
+ vue.h('input', {
237
+ class: 'range-slider-input',
238
+ type: 'range',
239
+ min: props.min,
240
+ max: props.max,
241
+ step: props.step,
242
+ value: value,
243
+ name: Array.isArray(props.name)
244
+ ? props.name[index]
245
+ : `${props.name || ''}-${index}`,
246
+ role: 'slider',
247
+ 'aria-valuemin': props.min,
248
+ 'aria-valuemax': props.max,
249
+ 'aria-valuenow': value,
250
+ 'aria-orientation': props.vertical ? 'vertical' : 'horizontal',
251
+ disabled: props.disabled,
252
+ onInput: (e) => handleInputChange(e, index),
253
+ ref: (el) => {
254
+ inputsRef.value[index] = el;
255
+ },
256
+ }),
257
+ props.tooltips &&
258
+ vue.h('div', {
259
+ class: 'range-slider-tooltip',
260
+ ...(thumbSize.value && {
261
+ style: utils.calculateTooltipPosition(props.min, props.max, value, thumbSize.value, props.vertical, isRTL.default(rangeSliderRef.value)),
262
+ }),
263
+ }, [
264
+ vue.h('div', { class: 'range-slider-tooltip-inner' }, [
265
+ props.tooltipsFormat ? props.tooltipsFormat(value) : value,
266
+ ]),
267
+ vue.h('div', { class: 'range-slider-tooltip-arrow' }),
268
+ ]),
269
+ ]),
270
+ vue.h('div', {
271
+ class: 'range-slider-track',
272
+ ...(props.track && {
273
+ style: utils.updateGradient(props.min, props.max, currentValue.value, props.vertical),
274
+ }),
275
+ ref: trackRef,
276
+ }),
277
+ ]),
278
+ Array.isArray(props.labels) &&
279
+ props.labels.length > 0 &&
280
+ vue.h('div', {
281
+ class: 'range-slider-labels-container',
282
+ ref: labelsContainerRef,
283
+ }, props.labels.map((label, index) => {
284
+ const labelPosition = utils.calculateLabelPosition(props.min, props.max, props.labels, label, index);
285
+ const labelValue = utils.getLabelValue(props.min, props.max, props.labels, label, index);
286
+ const labelStyle = {
287
+ ...(props.vertical ? { bottom: labelPosition } : { left: labelPosition }),
288
+ ...(typeof label === 'object' && 'style' in label ? label.style : {}),
289
+ };
290
+ return vue.h('div', {
291
+ class: [
292
+ 'range-slider-label',
293
+ {
294
+ clickable: props.clickableLabels,
295
+ },
296
+ typeof label === 'object' && 'className' in label ? label.className : '',
297
+ ],
298
+ style: labelStyle,
299
+ onMousedown: () => handleLabelClick(labelValue),
300
+ key: index,
301
+ ref: (el) => {
302
+ labelsRef.value[index] = el;
303
+ },
304
+ }, typeof label === 'object' && 'label' in label ? label.label : label);
305
+ })),
306
+ ]);
307
+ },
308
+ });
309
+
310
+ exports.CRangeSlider = CRangeSlider;
311
+ //# sourceMappingURL=CRangeSlider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CRangeSlider.js","sources":["../../../../src/components/range-slider/CRangeSlider.ts"],"sourcesContent":[null],"names":["defineComponent","ref","watch","onMounted","getThumbSize","getNearestValueIndex","validateValue","updateValue","calculateClickValue","isRTL","calculateMoveValue","h","calculateTooltipPosition","updateGradient","calculateLabelPosition","getLabelValue"],"mappings":";;;;;;AAmBM,MAAA,YAAY,GAAGA,mBAAe,CAAC;AACnC,IAAA,IAAI,EAAE,cAAc;AACpB,IAAA,KAAK,EAAE;AACL;;;AAGG;AACH,QAAA,eAAe,EAAE;AACf,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,IAAI;AACd,SAAA;AACD;;;AAGG;AACH,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,OAAO;AACb,YAAA,OAAO,EAAE,KAAK;AACf,SAAA;AACD;;;AAGG;AACH,QAAA,QAAQ,EAAE;AACR,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACD;;;AAGG;AACH,QAAA,MAAM,EAAE;AACN,YAAA,IAAI,EAAE,KAA0B;AAChC,YAAA,OAAO,EAAE,MAAM,EAAE;AAClB,SAAA;AACD;;;AAGG;AACH,QAAA,GAAG,EAAE;AACH,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,OAAO,EAAE,GAAG;AACb,S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AAK,CAAC;AAClF,oBAAA,MAAM,UAAU,GAAG;wBACjB,IAAI,KAAK,CAAC,QAAQ,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AACzE,wBAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC;qBACtE;oBAED,OAAOJ,KAAC,CACN,KAAK,EACL;AACE,wBAAA,KAAK,EAAE;4BACL,oBAAoB;AACpB,4BAAA;gCACE,SAAS,EAAE,KAAK,CAAC,eAAe;AACjC,6BAAA;AACD,4BAAA,OAAO,KAAK,KAAK,QAAQ,IAAI,WAAW,IAAI,KAAK,GAAG,KAAK,CAAC,SAAS,GAAG,EAAE;AACzE,yBAAA;AACD,wBAAA,KAAK,EAAE,UAAU;AACjB,wBAAA,WAAW,EAAE,MAAM,gBAAgB,CAAC,UAAU,CAAC;AAC/C,wBAAA,GAAG,EAAE,KAAK;AACV,wBAAA,GAAG,EAAE,CAAC,EAAE,KAAI;AACV,4BAAA,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAoB;yBAC9C;AACF,qBAAA,EACD,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CACpE;AACH,iBAAC,CAAC,CACH;AACJ,SAAA,CACF;KACJ;AACF,CAAA;;;;"}
@@ -0,0 +1,6 @@
1
+ import { App } from 'vue';
2
+ import { CRangeSlider } from './CRangeSlider';
3
+ declare const CRangeSliderPlugin: {
4
+ install: (app: App) => void;
5
+ };
6
+ export { CRangeSliderPlugin, CRangeSlider };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var CRangeSlider = require('./CRangeSlider.js');
4
+
5
+ const CRangeSliderPlugin = {
6
+ install: (app) => {
7
+ app.component(CRangeSlider.CRangeSlider.name, CRangeSlider.CRangeSlider);
8
+ },
9
+ };
10
+
11
+ exports.CRangeSlider = CRangeSlider.CRangeSlider;
12
+ exports.CRangeSliderPlugin = CRangeSliderPlugin;
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/range-slider/index.ts"],"sourcesContent":[null],"names":["CRangeSlider"],"mappings":";;;;AAGA,MAAM,kBAAkB,GAAG;AACzB,IAAA,OAAO,EAAE,CAAC,GAAQ,KAAU;QAC1B,GAAG,CAAC,SAAS,CAACA,yBAAY,CAAC,IAAc,EAAEA,yBAAY,CAAC;KACzD;;;;;;"}
@@ -0,0 +1,11 @@
1
+ import type { VNode } from 'vue';
2
+ export type Label = {
3
+ label: number | string | VNode;
4
+ value: number;
5
+ className?: string | string[] | Record<string, boolean>;
6
+ style?: Record<string, any>;
7
+ } | VNode | string;
8
+ export type ThumbSize = {
9
+ value: number;
10
+ unit: string | null;
11
+ };
@@ -0,0 +1,38 @@
1
+ import type { Label, ThumbSize } from './types';
2
+ export declare const calculateClickValue: (event: MouseEvent, container: HTMLDivElement, min: number, max: number, step: number, vertical: boolean, rtl: boolean) => number;
3
+ export declare const calculateMoveValue: (event: MouseEvent, container: HTMLDivElement, min: number, max: number, step: number, vertical: boolean, rtl: boolean) => number;
4
+ export declare const calculateVerticalPosition: (mouseY: number, rect: DOMRect) => number | "max" | "min";
5
+ export declare const calculateHorizontalPosition: (mouseX: number, rect: DOMRect, rtl: boolean) => number | "max" | "min";
6
+ export declare const calculateLabelPosition: (min: number, max: number, labels: Label[], label: Label, index: number) => string;
7
+ export declare const calculateTooltipPosition: (min: number, max: number, value: number, thumbSize: ThumbSize, vertical: boolean, rtl: boolean) => {
8
+ bottom: string;
9
+ marginBottom: string;
10
+ right?: undefined;
11
+ marginRight?: undefined;
12
+ left?: undefined;
13
+ marginLeft?: undefined;
14
+ } | {
15
+ right: string;
16
+ marginRight: string;
17
+ bottom?: undefined;
18
+ marginBottom?: undefined;
19
+ left?: undefined;
20
+ marginLeft?: undefined;
21
+ } | {
22
+ left: string;
23
+ marginLeft: string;
24
+ bottom?: undefined;
25
+ marginBottom?: undefined;
26
+ right?: undefined;
27
+ marginRight?: undefined;
28
+ };
29
+ export declare const getClickPosition: (event: MouseEvent, container: HTMLDivElement, vertical: boolean, rtl: boolean) => number;
30
+ export declare const getLabelValue: (min: number, max: number, labels: Label[], label: Label, index: number) => number;
31
+ export declare const getNearestValueIndex: (value: number, values: number[]) => number;
32
+ export declare const getThumbSize: (element: HTMLDivElement, vertical: boolean) => ThumbSize | null;
33
+ export declare const roundToStep: (number: number, step: number) => number;
34
+ export declare const updateGradient: (min: number, max: number, values: number[], vertical: boolean) => {
35
+ backgroundImage: string;
36
+ };
37
+ export declare const updateValue: (value: number, values: number[], distance: number, index: number) => number[];
38
+ export declare const validateValue: (value: number, values: number[], distance: number, index: number) => number;