AmButtonGroup.vue
100 lines
| 1 | <template> |
| 2 | <div class="am-button-group" :class="{ 'am-rtl': isRtl }"> |
| 3 | <slot></slot> |
| 4 | </div> |
| 5 | </template> |
| 6 | |
| 7 | <script setup> |
| 8 | // * import from Vue |
| 9 | import { computed } from 'vue' |
| 10 | |
| 11 | let isRtl = computed(() => { |
| 12 | if (document) { |
| 13 | return document.documentElement.dir === 'rtl' |
| 14 | } |
| 15 | |
| 16 | return false |
| 17 | }) |
| 18 | </script> |
| 19 | |
| 20 | <script> |
| 21 | export default { |
| 22 | name: 'AmButtonGroup', |
| 23 | } |
| 24 | </script> |
| 25 | |
| 26 | <style lang="scss"> |
| 27 | @mixin am-button-group-block { |
| 28 | .am-button-group { |
| 29 | display: flex; |
| 30 | flex-direction: row; |
| 31 | flex-wrap: nowrap; |
| 32 | |
| 33 | &.am-rtl { |
| 34 | flex-direction: row-reverse; |
| 35 | } |
| 36 | |
| 37 | & > .am-button { |
| 38 | box-shadow: none; |
| 39 | |
| 40 | &:first-child { |
| 41 | border-top-right-radius: 0; |
| 42 | border-bottom-right-radius: 0; |
| 43 | } |
| 44 | |
| 45 | &:last-child { |
| 46 | border-top-left-radius: 0; |
| 47 | border-bottom-left-radius: 0; |
| 48 | } |
| 49 | |
| 50 | &:not(:last-child) { |
| 51 | margin-right: -1px; |
| 52 | } |
| 53 | |
| 54 | &:first-child:last-child { |
| 55 | border-radius: var(--am-rad-inp); |
| 56 | } |
| 57 | |
| 58 | &:not(:first-child):not(:last-child) { |
| 59 | border-radius: 0; |
| 60 | } |
| 61 | |
| 62 | // Type - filled / plain / text |
| 63 | &--filled { |
| 64 | &:not(.is-disabled) { |
| 65 | &:focus:not(:active) { |
| 66 | border-color: var(--am-c-btn-first-darken30); |
| 67 | box-shadow: none; |
| 68 | } |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | &--plain { |
| 73 | &:not(.is-disabled) { |
| 74 | &:focus:not(:active) { |
| 75 | border-color: var(--am-c-btn-first); |
| 76 | box-shadow: none; |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | &--text { |
| 82 | &:not(.is-disabled) { |
| 83 | &:focus:not(:active) { |
| 84 | box-shadow: none; |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | .amelia-v2-booking #amelia-container { |
| 93 | @include am-button-group-block; |
| 94 | } |
| 95 | |
| 96 | #amelia-app-backend-new { |
| 97 | @include am-button-group-block; |
| 98 | } |
| 99 | </style> |
| 100 |