Skip to content

Commit a7b08a4

Browse files
committed
Atoms - Slicer - Add optional vertical handles style for minimap variant
1 parent 8910ce0 commit a7b08a4

File tree

1 file changed

+35
-6
lines changed

1 file changed

+35
-6
lines changed

src/atoms/Slicer.vue

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,10 @@ const props = defineProps({
105105
enableSelectionDrag: {
106106
type: Boolean,
107107
default: true
108+
},
109+
verticalHandles: {
110+
type: Boolean,
111+
default: false,
108112
}
109113
});
110114
@@ -559,7 +563,7 @@ defineExpose({
559563
ref="rangeStart"
560564
:key="`range-min${inputStep}`"
561565
type="range"
562-
class="range-left range-handle"
566+
:class="{'range-left': true, 'range-handle': true, 'range-minimap': hasMinimap && verticalHandles }"
563567
:min="min"
564568
:max="max"
565569
v-model="startValue"
@@ -572,7 +576,7 @@ defineExpose({
572576
v-if="enableRangeHandles"
573577
ref="rangeEnd"
574578
type="range"
575-
class="range-right range-handle"
579+
:class="{'range-right': true, 'range-handle': true, 'range-minimap': hasMinimap && verticalHandles }"
576580
:min="min"
577581
:max="max"
578582
v-model="endValue"
@@ -598,7 +602,6 @@ defineExpose({
598602
pointer-events: none;
599603
position: absolute;
600604
top: -33px;
601-
left: 0;
602605
svg{
603606
position: absolute;
604607
top: 0;
@@ -617,14 +620,19 @@ input[type="range"] {
617620
z-index: 3;
618621
}
619622
623+
input[type="range"].range-minimap {
624+
width: calc(100%);
625+
left: 0;
626+
}
627+
620628
input[type="range"]::-webkit-slider-thumb {
621629
-webkit-appearance: none;
622630
pointer-events: auto;
623631
width: 20px;
624632
height: 20px;
625633
background-color: v-bind(slicerColor);
626634
border-radius: 50%;
627-
cursor: pointer;
635+
cursor: ew-resize;
628636
position: relative;
629637
z-index: 2;
630638
outline: 2px solid v-bind(borderColor);
@@ -636,13 +644,23 @@ input[type="range"]::-webkit-slider-thumb {
636644
}
637645
}
638646
647+
input[type="range"].range-minimap::-webkit-slider-thumb {
648+
width: 6px;
649+
height: 50px;
650+
border-radius: 0px;
651+
margin-top: -36px;
652+
border-right: 1px solid v-bind(selectColor);
653+
border-left: 1px solid v-bind(selectColor);
654+
cursor:ew-resize;
655+
}
656+
639657
input[type="range"]::-moz-range-thumb {
640658
pointer-events: auto;
641659
width: 20px;
642660
height: 20px;
643661
background-color: v-bind(slicerColor);
644662
border-radius: 50%;
645-
cursor: pointer;
663+
cursor: ew-resize;
646664
position: relative;
647665
z-index: 2;
648666
outline: 2px solid v-bind(borderColor);
@@ -654,13 +672,24 @@ input[type="range"]::-moz-range-thumb {
654672
}
655673
}
656674
675+
input[type="range"].range-minimap::-moz-range-thumb {
676+
width: 6px;
677+
height: 50px;
678+
border-radius: 0px;
679+
border-right: 1px solid v-bind(selectColor);
680+
border-left: 1px solid v-bind(selectColor);
681+
cursor: ew-resize;
682+
transform: translateY(-20px);
683+
pointer-events: auto;
684+
}
685+
657686
input[type="range"]::-ms-thumb {
658687
pointer-events: auto;
659688
width: 20px;
660689
height: 20px;
661690
background-color: v-bind(slicerColor);
662691
border-radius: 50%;
663-
cursor: pointer;
692+
cursor: ew-resize;
664693
position: relative;
665694
z-index: 2;
666695
outline: 2px solid v-bind(borderColor);

0 commit comments

Comments
 (0)