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