Skip to content

Commit 639a20d

Browse files
feat: add disabled state to option swapper
1 parent 3e7d43b commit 639a20d

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

frontend/express/public/javascripts/countly/vue/components/content.js

+5
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@
516516
template: CV.T('/javascripts/countly/vue/templates/UI/option-swapper.html'),
517517

518518
props: {
519+
disabled: {
520+
default: false,
521+
type: Boolean
522+
},
523+
519524
highlightOnSelect: {
520525
default: true,
521526
type: Boolean

frontend/express/public/javascripts/countly/vue/templates/UI/option-swapper.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
<!-- :style="{'width': width + 'px'}" -->
2-
<div class="cly-option-swapper">
1+
<div
2+
class="cly-option-swapper"
3+
:class="{
4+
'cly-option-swapper--disabled': disabled
5+
}"
6+
>
37
<div
48
v-for="(option, index) in options"
59
:key="`cly-option-swapper-option-${index}`"
610
v-tooltip="option.tooltip"
711
class="cly-option-swapper__option"
812
:class="{
913
'cly-option-swapper__option--active': option.value === selectedOption,
10-
'cly-option-swapper__option--disabled': option.disabled,
14+
'cly-option-swapper__option--disabled': option.disabled || disabled,
1115
'cly-option-swapper__option--first': index === 0,
1216
'cly-option-swapper__option--last': index === (options.length - 1),
1317
'cly-option-swapper__option--no-highlight': !highlightOnSelect

frontend/express/public/stylesheets/vue/clyvue.scss

+6
Original file line numberDiff line numberDiff line change
@@ -4804,6 +4804,12 @@
48044804
background: #F6F6F6;
48054805
}
48064806
}
4807+
4808+
// .cly-option-swapper--disabled
4809+
&--disabled {
4810+
cursor: not-allowed;
4811+
opacity: 0.5;
4812+
}
48074813
}
48084814

48094815
.cly-list-drawer {

0 commit comments

Comments
 (0)