mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-10-31 19:17:48 +00:00 
			
		
		
		
	 3a693947b5
			
		
	
	3a693947b5
	
	
	
		
			
			This PR adds RTL support to the web widget for improved right-to-left language compatibility, updates colors, and cleans up code. Fixes https://linear.app/chatwoot/issue/CW-4089/rtl-issues-on-widget https://github.com/chatwoot/chatwoot/issues/9791 Other PR: https://github.com/chatwoot/chatwoot/pull/11016
		
			
				
	
	
		
			56 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <script>
 | |
| import { mapGetters } from 'vuex';
 | |
| 
 | |
| export default {
 | |
|   components: {},
 | |
|   props: {
 | |
|     action: {
 | |
|       type: Object,
 | |
|       default: () => {},
 | |
|     },
 | |
|     isSelected: {
 | |
|       type: Boolean,
 | |
|       default: false,
 | |
|     },
 | |
|   },
 | |
|   emits: ['optionSelect'],
 | |
|   computed: {
 | |
|     ...mapGetters({
 | |
|       widgetColor: 'appConfig/getWidgetColor',
 | |
|     }),
 | |
|   },
 | |
|   methods: {
 | |
|     onClick() {
 | |
|       this.$emit('optionSelect', this.action);
 | |
|     },
 | |
|   },
 | |
| };
 | |
| </script>
 | |
| 
 | |
| <template>
 | |
|   <li
 | |
|     class="option"
 | |
|     :class="{ 'is-selected': isSelected }"
 | |
|     :style="{ borderColor: widgetColor }"
 | |
|   >
 | |
|     <button class="option-button button" @click="onClick">
 | |
|       <span :style="{ color: widgetColor }">{{ action.title }}</span>
 | |
|     </button>
 | |
|   </li>
 | |
| </template>
 | |
| 
 | |
| <style scoped lang="scss">
 | |
| .option {
 | |
|   @apply rounded-[5rem] border border-solid border-n-brand ltr:float-left rtl:float-right m-1 max-w-full;
 | |
| 
 | |
|   .option-button {
 | |
|     @apply bg-transparent border-0 cursor-pointer h-auto leading-normal ltr:text-left rtl:text-right whitespace-normal rounded-[2rem] min-h-[2.5rem];
 | |
| 
 | |
|     span {
 | |
|       display: inline-block;
 | |
|       vertical-align: middle;
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </style>
 |