123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610 |
- /**
- * Should the tabsheet content changes be animated.
- *
- * @group tabsheet
- */
- $v-tabsheet-content-animation-enabled: $v-animations-enabled !default;
-
-
- /**
- * Outputs the global selectors and properties for the TabSheet component - styles which are
- * considered mandatory for the component to work properly.
- *
- * @param {string} $primary-stylename (v-tabsheet) - the primary style name for the selectors
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-global ($primary-stylename: v-tabsheet) {
- .#{$primary-stylename}-hidetabs > .#{$primary-stylename}-tabcontainer,
- .#{$primary-stylename}-spacertd,
- .v-disabled .#{$primary-stylename}-scroller,
- .#{$primary-stylename} .v-disabled .#{$primary-stylename}-caption-close {
- display: none;
- }
-
- .#{$primary-stylename} {
- overflow: visible !important;
- position: relative;
- }
-
- .#{$primary-stylename}-tabcontainer {
- table,
- tbody,
- tr {
- display: inline-block;
- border-spacing: 0;
- border-collapse: collapse;
- vertical-align: top;
- }
-
- td {
- display: inline-block;
- padding: 0;
- }
- }
-
- .#{$primary-stylename}-tabs {
- white-space: nowrap;
- @include box-sizing(border-box);
- }
-
- .#{$primary-stylename}-content {
- position: relative;
-
- > div > .v-scrollable {
- @include valo-panel-adjust-content-margins;
- }
- }
-
- }
-
-
- /**
- * Outputs the selectors and properties for the TabSheet component.
- *
- * @param {string} $primary-stylename (v-tabsheet) - the primary style name for the selectors
- * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet ($primary-stylename: v-tabsheet, $include-additional-styles: contains($v-included-additional-styles, tabsheet)) {
- .#{$primary-stylename} {
- &:not(.v-has-width) {
- width: auto !important;
- }
- }
-
- .#{$primary-stylename}-spacertd {
- display: none !important;
- }
-
- .#{$primary-stylename}-tabcontainer {
- @include valo-tabsheet-tabcontainer-style($primary-stylename);
- }
-
- .#{$primary-stylename}-tabitemcell {
- @include valo-tabsheet-tabitemcell-style($primary-stylename);
- }
-
- .#{$primary-stylename}-scroller {
- @include valo-tabsheet-scroller-style($primary-stylename);
- }
-
-
- @if $v-tabsheet-content-animation-enabled {
- .#{$primary-stylename}-tabsheetpanel > .v-scrollable > .v-widget {
- @include valo-animate-in-fade(300ms);
- }
-
- $spinner-size: round($v-unit-size/2);
- $spinner-size: $spinner-size + $spinner-size % 2;
-
- .#{$primary-stylename}-deco {
- @include valo-spinner($size: $spinner-size);
- display: none;
- position: absolute;
- z-index: 1;
- bottom: 50%;
- margin-bottom: round($v-unit-size/-2) - $spinner-size/2;
- left: 50%;
- margin-left: $spinner-size/-2;
- }
-
- .#{$primary-stylename}-loading .#{$primary-stylename}-deco {
- display: block;
- }
- }
-
-
- @if $include-additional-styles {
- .#{$primary-stylename}-equal-width-tabs {
- @include valo-tabsheet-equal-width-tabs-style($flex: false);
- }
-
- .#{$primary-stylename}-framed {
- @include valo-tabsheet-framed-style;
- }
-
- .#{$primary-stylename}-centered-tabs {
- @include valo-tabsheet-align-tabs-style($align: center);
- }
-
- .#{$primary-stylename}-right-aligned-tabs {
- @include valo-tabsheet-align-tabs-style($align: right);
- }
-
- .#{$primary-stylename}-padded-tabbar {
- @include valo-tabsheet-padded-tabbar-style;
- }
-
- .#{$primary-stylename}-icons-on-top {
- @include valo-tabsheet-icons-on-top-style;
- }
-
- .#{$primary-stylename}-compact-tabbar {
- > .#{$primary-stylename}-tabcontainer-compact-tabbar .v-caption {
- line-height: 1.8;
- }
- }
-
- .#{$primary-stylename}-only-selected-closable {
- @include valo-tabsheet-only-selected-closable-style;
- }
- }
-
- }
-
-
- /**
- * Outputs the styles for the tabcontainer element of a tabsheet.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-tabcontainer-style ($primary-stylename: v-tabsheet) {
- position: relative;
- @include box-sizing(border-box);
-
- &:before {
- content: "";
- position: absolute;
- height: 0;
- // iOS panics with background color, creating black line artifacts
- border-top: max(1px, first-number($v-border)) solid first-color(valo-border($color: $v-app-background-color, $strength: 0.5));
- bottom: 0;
- left: 0;
- right: 0;
- }
-
- .#{$primary-stylename}-tabs {
- position: relative;
- }
- }
-
-
- /**
- * Outputs the styles for the tabitemcell element of a tabsheet.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-tabitemcell-style ($primary-stylename: v-tabsheet) {
- vertical-align: bottom;
-
- .#{$primary-stylename}-tabitem {
- line-height: 0;
- overflow: hidden;
- }
-
- .v-caption {
- margin-left: round($v-unit-size/2);
- padding: 0 round($v-unit-size/10);
- @include box-sizing(border-box);
- cursor: pointer;
- text-align: center;
- line-height: $v-unit-size;
- font-size: round($v-font-size * 0.95);
- font-weight: $v-font-weight;
- color: valo-font-color($v-app-background-color, 0.58);
- width: auto !important;
- overflow: hidden;
- text-overflow: ellipsis;
- border-bottom: max(1px, first-number($v-border))*2 solid transparent;
- position: relative;
-
- @if $v-animations-enabled {
- @include transition(border-bottom 200ms, color 200ms);
- }
-
- .v-captiontext {
- display: inline;
- }
-
- .v-icon + .v-captiontext {
- margin-left: round($v-unit-size/4);
- }
-
- &:hover {
- color: $v-selection-color;
- }
-
- &.v-disabled {
- @include opacity($v-disabled-opacity);
- cursor: default;
- color: inherit !important;
- }
- }
-
- &:first-child .v-caption,
- &[aria-hidden="true"] + td .v-caption {
- margin-left: 0;
- }
-
- &:focus {
- outline: none;
-
- .v-caption {
- color: $v-selection-color;
- }
- }
-
- .#{$primary-stylename}-tabitem-selected .v-caption.v-caption {
- border-bottom-color: $v-selection-color;
- color: $v-selection-color;
- }
-
- .v-caption-closable {
- padding-right: round($v-unit-size/10) + round($v-font-size * 1.1);
- }
-
- &.icons-on-top .v-caption-closable {
- padding-right: round($v-unit-size/10);
- }
-
- .#{$primary-stylename}-caption-close {
- position: absolute;
- right: 0;
- top: 50%;
- margin: round($v-font-size / -2) 0 0;
- font-size: round($v-font-size * 1.1);
- line-height: round($v-font-size * 1.1);
- width: round($v-font-size * 1.1);
- text-align: center;
- border-radius: round($v-border-radius/2);
- color: valo-font-color($v-app-background-color, 0.4);
-
- &:hover {
- background: rgba(#000, .03);
- color: $v-selection-color;
- }
-
- &:active {
- background: $v-selection-color;
- color: valo-font-color($v-selection-color);
- }
- }
- }
-
-
- /**
- * Outputs the styles for the tab scroller element of a tabsheet.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-scroller-style ($primary-stylename: v-tabsheet) {
- $border-color: first-color(valo-border($strength: 0.5));
-
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- padding-left: round($v-unit-size/2);
- @include linear-gradient(to left, $v-background-color 70%, rgba($v-background-color, 0) 100%, $fallback: transparent);
- pointer-events: none;
-
- &:after {
- content: "";
- height: first-number($v-border);
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- display: block;
- @include linear-gradient(to left, $border-color 70%, rgba($border-color, 0) 100%, $fallback: transparent);
- }
-
- .v-ie8 &,
- .v-ie9 & {
- background-color: $v-background-color;
-
- &:after {
- background-color: $border-color;
- }
- }
-
- button {
- @include appearance(none);
- border: none;
- background: transparent;
- font: inherit;
- color: inherit;
- height: 100%;
- margin: 0;
- padding: 0 round($v-unit-size/4);
- outline: none;
- cursor: pointer;
- pointer-events: auto;
- @include opacity(.5);
-
- &:hover {
- @include opacity(1);
- color: $v-selection-color;
- }
-
- &:active {
- @include opacity(.7);
- color: $v-selection-color;
- }
-
- &::-moz-focus-inner {
- padding: 0;
- border: 0
- }
- }
-
- [class*="Next"] {
- padding-left: round($v-unit-size/8);
- &:before {
- @include valo-tabsheet-scroller-next-icon-style;
- }
- }
-
- [class*="Prev"] {
- padding-right: round($v-unit-size/8);
- &:before {
- @include valo-tabsheet-scroller-prev-icon-style;
- }
- }
-
- [class*="disabled"] {
- cursor: default;
- color: inherit !important;
- @include opacity(.1, true);
- }
- }
-
-
- /**
- * Outputs the font icon styles for the previous button element of a tabsheet scroller.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-scroller-prev-icon-style {
- font-family: ValoIcons;
- content: "\f053";
- }
-
-
- /**
- * Outputs the font icon styles for the next button element of a tabsheet scroller.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-scroller-next-icon-style {
- font-family: ValoIcons;
- content: "\f054";
- }
-
-
- /**
- * Outputs the styles for the framed tabsheet style.
- *
- * @param {string} $primary-stylename (v-tabsheet) - The primary style name for the selectors
- * @param {bool} $frame-inactive-tabs (true) - Should inactive tabs be framed as well (the active tab is always framed with this style)
- * @param {bool} $outer-frame (true) - Should the frame contain the whole tabsheet (i.e. tabbar and tab content). If false, works like a "borderless" style.
- * @param {size} $tab-spacing ($v-unit-size/10) - The spacing between tabs
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-framed-style ($primary-stylename: v-tabsheet, $frame-inactive-tabs: true, $outer-frame: true, $tab-spacing: round($v-unit-size/10)) {
- > .#{$primary-stylename}-tabcontainer {
- .v-caption {
- margin-left: $tab-spacing or first-number($v-border) * -1;
- padding: 0 $v-layout-spacing-horizontal;
- background-color: $v-app-background-color;
- border: first-number($v-border) solid transparent;
- line-height: $v-unit-size - first-number($v-border);
- border-radius: $v-border-radius $v-border-radius 0 0;
- font-weight: $v-font-weight + 100;
-
- @if $v-animations-enabled {
- @include transition(background-color 160ms);
- }
-
- &:hover {
- background-color: darken($v-app-background-color, 3%);
- border-bottom-color: first-color(valo-border($color: $v-app-background-color, $strength: 0.5));
- }
-
- &.v-disabled:hover {
- background-color: $v-app-background-color;
- }
- }
-
- .v-caption-closable {
- padding-right: $v-layout-spacing-horizontal + round($v-font-size * 1.1);
- }
-
- .#{$primary-stylename}-caption-close {
- top: round($v-font-size/4);
- right: round($v-font-size/4);
- margin-top: 0;
- }
-
- td:first-child .v-caption,
- [aria-hidden="true"] + td .v-caption {
- margin-left: 0;
- }
-
- @if $frame-inactive-tabs {
- .#{$primary-stylename}-tabitem .v-caption {
- border-color: first-color(valo-border($color: $v-app-background-color, $strength: 0.5));
- }
- }
-
- .#{$primary-stylename}-tabitem-selected .v-caption {
- background: $v-panel-background-color;
- border-color: first-color(valo-border($color: $v-app-background-color, $strength: 0.5));
- border-bottom: none;
- padding-bottom: first-number($v-border);
- }
- }
-
- > .#{$primary-stylename}-content {
- // iOS panics with black line artifacts,
- // moving the background color to an inner element fixes it
- > div {
- background: $v-panel-background-color;
- }
-
- @if $outer-frame {
- border: valo-border($color: $v-app-background-color, $strength: 0.5);
- border-top: none;
- }
- }
-
- &.padded-tabbar {
- > .#{$primary-stylename}-tabcontainer {
- @if $outer-frame {
- border: valo-border($color: $v-app-background-color, $strength: 0.5);
- border-bottom: none;
- }
-
- background: $v-background-color;
- padding-top: round($v-unit-size/6);
- }
- }
-
- &.icons-on-top {
- > .#{$primary-stylename}-tabcontainer .#{$primary-stylename}-tabitem-selected .v-caption {
- padding-bottom: round($v-unit-size/6) + first-number($v-border);
- }
- }
- }
-
-
- /**
- * Outputs the styles for a tabsheet where the tabs are aligned to the position specified by the parameter in the tabbar.
- *
- * @param {string} $primary-stylename (v-tabsheet) - The primary style name for the selectors
- * @param {string} $align (center) - The alignment of the tabs inside the tabbar. Possible values: left, right, center.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-align-tabs-style ($primary-stylename: v-tabsheet, $align: center) {
- > .#{$primary-stylename}-tabcontainer {
- text-align: $align;
- }
- }
-
-
- /**
- * Outputs the styles for a tabsheet where all tabs in the tabbar have equal width and span the entire width of the tabbar.
- *
- * @param {string} $primary-stylename (v-tabsheet) - The primary style name for the selectors
- * @param {bool} $flex (false) - Should the size of the tabs be proportional to their content, i.e. should the available space in the tabbar be distributed to the tabs in relation to their content sizes.
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-equal-width-tabs-style ($primary-stylename: v-tabsheet, $flex: false) {
- > .#{$primary-stylename}-tabcontainer {
- table,
- tbody,
- tr {
- width: 100%;
- }
-
- tr {
- display: table;
- @if $flex == false {
- table-layout: fixed;
- }
- }
-
- td {
- display: table-cell;
- }
-
- .v-caption {
- margin: 0;
- display: block;
- }
- }
- }
-
-
- /**
- * Outputs the styles for a tabsheet where the icons of individual tabs are on top of the tab captions.
- *
- * @param {string} $primary-stylename (v-tabsheet) - The primary style name for the selectors
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-icons-on-top-style ($primary-stylename: v-tabsheet) {
- > .#{$primary-stylename}-tabcontainer {
- .v-caption {
- padding-top: round($v-unit-size/6);
- padding-bottom: round($v-unit-size/6);
- line-height: 1.2;
- }
-
- .v-icon {
- display: block;
-
- + .v-captiontext.v-captiontext {
- margin-left: 0;
- }
- }
-
- .v-caption-closable {
- padding-right: $v-layout-spacing-horizontal;
- }
-
- .#{$primary-stylename}-caption-close {
- top: round($v-font-size/4);
- margin-top: 0;
- }
- }
- }
-
-
- /**
- * Outputs the styles for a tabsheet where only the selected tab has the close button visible.
- * Note that the other tabs can still be closed programmatically.
- *
- * @param {string} $primary-stylename (v-tabsheet) - The primary style name for the selectors
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-only-selected-closable-style ($primary-stylename: v-tabsheet) {
- > .#{$primary-stylename}-tabcontainer .#{$primary-stylename}-caption-close {
- visibility: hidden;
- }
-
- > .#{$primary-stylename}-tabcontainer .#{$primary-stylename}-tabitem-selected .#{$primary-stylename}-caption-close {
- visibility: visible;
- }
- }
-
-
- /**
- * Outputs the styles for a tabsheet where the tabbar has increased padding to separate the tabs
- * inside it from their surrounding container.
- *
- * @param {string} $primary-stylename (v-tabsheet) - The primary style name for the selectors
- *
- * @group tabsheet
- */
- @mixin valo-tabsheet-padded-tabbar-style ($primary-stylename: v-tabsheet) {
- > .#{$primary-stylename}-tabcontainer .#{$primary-stylename}-tabs {
- padding: 0 round($v-unit-size/4);
- }
- }
|