mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 20:18:08 +00:00
# Pull Request Template ## Description This PR fixes styles issues with the select in profile settings and toggles the Hotkeys button. ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## How Has This Been Tested? ### Screenshots **Select** | Before | After (Dark Mode) | After (Light Mode) | | ------------- | ------------- | ------------- | | <img width="162" alt="image" src="https://github.com/user-attachments/assets/6d4ebd45-d233-413e-aca8-7f4db5d6c8a2" /> <img width="699" alt="image" src="https://github.com/user-attachments/assets/62c2ca85-479f-4252-a4fc-ffd5a570cff0" /> | <img width="162" alt="image" src="https://github.com/user-attachments/assets/7c9780ea-8ab6-429e-82e3-6fb554141bc0" /> <img width="699" alt="image" src="https://github.com/user-attachments/assets/726d7a0a-bfbc-4bdc-aedc-a874146230d8" /> | <img width="162" alt="image" src="https://github.com/user-attachments/assets/f3022b5f-6ae2-48d6-a2c9-9961f4295b81" /> <img width="699" alt="image" src="https://github.com/user-attachments/assets/fa6515c1-35df-4f6f-9096-e7893bffe683" /> | **Toggle Hotkeys** | Before | After (Dark Mode) | After (Light Mode) | | ------------- | ------------- | ------------- | | <img width="783" alt="image" src="https://github.com/user-attachments/assets/5628fa6a-9692-44f4-bc45-6e5de44588c7" /> | <img width="783" alt="image" src="https://github.com/user-attachments/assets/14529e80-fd9c-46cd-9ad8-aab041781238" /> | <img width="783" alt="image" src="https://github.com/user-attachments/assets/dfe2cbec-8d05-443d-89a2-0e674fffa518" /> | ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules
95 lines
2.0 KiB
Vue
95 lines
2.0 KiB
Vue
<script>
|
|
import WithLabel from './WithLabel.vue';
|
|
export default {
|
|
components: {
|
|
WithLabel,
|
|
},
|
|
props: {
|
|
id: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
options: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
placeholder: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
icon: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
label: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
modelValue: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
hasError: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
errorMessage: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
},
|
|
emits: ['update:modelValue'],
|
|
methods: {
|
|
onInput(e) {
|
|
this.$emit('update:modelValue', e.target.value);
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<WithLabel
|
|
:label="label"
|
|
:icon="icon"
|
|
:name="name"
|
|
:has-error="hasError"
|
|
:error-message="errorMessage"
|
|
>
|
|
<select
|
|
:id="id"
|
|
:selected="modelValue"
|
|
:name="name"
|
|
:class="{
|
|
'text-n-slate-9': !modelValue,
|
|
'text-n-slate-12': modelValue,
|
|
'pl-9': icon,
|
|
}"
|
|
class="block w-full px-3 py-2 pr-6 mb-0 border-0 shadow-sm appearance-none rounded-xl select-caret leading-6"
|
|
@input="onInput"
|
|
>
|
|
<option value="" disabled selected class="hidden">
|
|
{{ placeholder }}
|
|
</option>
|
|
<slot>
|
|
<option v-for="opt in options" :key="opt.value" :value="opt.value">
|
|
{{ opt.label }}
|
|
</option>
|
|
</slot>
|
|
</select>
|
|
</WithLabel>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.select-caret {
|
|
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' width='32' height='24' viewBox='0 0 32 24'><polygon points='0,0 32,0 16,24' style='fill: rgb%28110, 111, 115%29'></polygon></svg>");
|
|
background-origin: content-box;
|
|
background-position: right -1rem center;
|
|
background-repeat: no-repeat;
|
|
background-size: 9px 6px;
|
|
}
|
|
</style>
|