grafana/public/sass/components/_switch.scss

140 lines
2.5 KiB
SCSS
Raw Normal View History

2016-03-21 05:07:37 -05:00
/* ============================================================
2016-03-21 07:37:56 -05:00
SWITCH 3 - YES NO
2016-03-21 05:07:37 -05:00
============================================================ */
2017-12-19 09:22:41 -06:00
gf-form-switch[disabled] {
2018-11-19 10:41:48 -06:00
.gf-form-switch,
.gf-form-switch-container {
cursor: default;
pointer-events: none !important;
2018-11-19 10:41:48 -06:00
.gf-form-label {
color: $text-color-weak;
}
}
2016-03-21 05:07:37 -05:00
}
2018-11-14 15:29:09 -06:00
2019-02-19 04:17:40 -06:00
.gf-form-switch-container-react {
display: flex;
Graph: Add data links feature (click on graph) (#17267) * WIP: initial panel links editor * WIP: Added dashboard migration to new panel drilldown link schema * Make link_srv interpolate new variables * Fix failing tests * Drilldown: Add context menu to graph viz (#17284) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Move graph context menu controller to separate file * Drilldown: datapoint variables interpolation (#17328) * Add simple context menu for adding graph annotations and showing drilldown links * Close graph context menu when user start scrolling * Move context menu component to grafana/ui * Make graph context menu appear on click, use cmd/ctrl click for quick annotations * Add util for absolute time range transformation * Add series name and datapoint timestamp interpolation * Rename drilldown link variables tot snake case, use const values instead of strings in tests * Bring LinkSrv.getPanelLinkAnchorInfo for compatibility reasons and add deprecation warning * Rename seriesLabel to seriesName * Drilldown: use separate editors for panel and series links (#17355) * Use correct target ini context menu links * Rename PanelLinksEditor to DrilldownLinksEditor and mote it to grafana/ui * Expose DrilldownLinksEditor as an angular directive * Enable visualization specifix drilldown links * Props interfaces rename * Drilldown: Add variables suggestion and syntax highlighting for drilldown link editor (#17391) * Add variables suggestion in drilldown link editor * Enable prism * Fix backspace not working * Move slate value helpers to grafana/ui * Add syntax higlighting for links input * Rename drilldown link components to data links * Add template variabe suggestions * Bugfix * Fix regexp not working in Firefox * Display correct links in panel header corner * bugfix * bugfix * Bugfix * Context menu UI tweaks * Use data link terminology instead of drilldown * DataLinks: changed autocomplete syntax * Use singular form for data link * Use the same syntax higlighting for built-in and template variables in data links editor * UI improvements to context menu * UI review tweaks * Tweak layout of data link editor * Fix vertical spacing * Remove data link header in context menu * Remove pointer cursor from series label in context menu * Fix variable selection on click * DataLinks: migrations for old links * Update docs about data links * Use value time instead of time range when interpolating datapoint timestamp * Remove not used util * Update docs * Moved icon a bit more down * Interpolate value ts only when using __value_time variable * Bring href property back to LinkModel * Add any type annotations * Fix TS error on slate's Value type * minor changes
2019-06-25 04:38:51 -05:00
flex-shrink: 0;
2019-02-19 04:17:40 -06:00
}
.gf-form-switch-container {
display: flex;
2018-11-19 10:41:48 -06:00
cursor: pointer;
margin-right: $space-xs;
}
2018-11-14 15:29:09 -06:00
.gf-form-switch {
2018-12-25 13:18:38 -06:00
display: flex;
2018-11-14 15:29:09 -06:00
position: relative;
width: 56px;
height: $input-height;
background: $switch-bg;
2018-11-16 14:45:19 -06:00
border: 1px solid $input-border-color;
2018-11-19 10:41:48 -06:00
border-radius: $input-border-radius;
align-items: center;
justify-content: center;
2018-11-14 15:29:09 -06:00
input {
opacity: 0;
width: 0;
height: 0;
}
&--transparent {
background: transparent;
border: 0;
width: 40px;
}
2018-11-14 15:29:09 -06:00
}
/* The slider */
.gf-form-switch__slider {
background: $switch-slider-off-bg;
border-radius: 8px;
height: 16px;
width: 32px;
display: block;
position: relative;
2018-11-14 15:29:09 -06:00
&::before {
position: absolute;
content: '';
height: 12px;
width: 12px;
left: 2px;
top: 2px;
background: $switch-slider-color;
2018-11-14 15:29:09 -06:00
transition: 0.4s;
border-radius: 50%;
box-shadow: $switch-slider-shadow;
2018-11-14 15:29:09 -06:00
}
}
input:checked + .gf-form-switch__slider {
background: $switch-slider-on-bg;
2018-11-14 15:29:09 -06:00
}
input:checked + .gf-form-switch__slider::before {
transform: translateX(16px);
2018-11-14 15:29:09 -06:00
}
2018-11-20 02:39:56 -06:00
.gf-form-checkbox {
position: relative;
2018-12-25 13:18:38 -06:00
display: flex;
2018-11-20 02:39:56 -06:00
width: 50px;
height: $input-height;
2018-11-20 02:39:56 -06:00
background: $switch-bg;
border: 1px solid $input-border-color;
border-left: none;
border-radius: $input-border-radius;
align-items: center;
justify-content: center;
2018-11-20 02:39:56 -06:00
input {
opacity: 0;
width: 0;
height: 0;
appearance: none;
2018-11-20 02:39:56 -06:00
}
&--transparent {
background: transparent;
border: none;
2018-12-14 09:48:13 -06:00
width: 23px;
2018-11-20 02:39:56 -06:00
height: auto;
position: relative;
2018-12-14 09:48:13 -06:00
padding-left: 8px;
2018-11-20 02:39:56 -06:00
}
&--table-cell {
width: 20px;
2018-11-20 02:39:56 -06:00
background: transparent;
height: auto;
border: none;
position: relative;
top: -5px;
}
}
.gf-form-switch__checkbox {
height: 16px;
width: 16px;
border-radius: 3px;
border: $checkbox-border;
background: $checkbox-bg;
display: flex;
align-items: center;
justify-content: center;
}
2018-11-19 10:41:48 -06:00
input:checked + .gf-form-switch__checkbox::before {
font-family: 'FontAwesome';
content: '\f00c';
color: $checkbox-color;
}
input:checked + .gf-form-switch__checkbox {
background: $checkbox-checked-bg;
border: none;
}