Update main.ts and style.css

This commit is contained in:
Dede Fuji Abdul 2024-03-05 20:59:59 +07:00
parent 415f1c8deb
commit 28424a4ffa
3 changed files with 145 additions and 90 deletions

View File

@ -1675,6 +1675,30 @@ body {
min-height: 100vh;
}
.min-h-\[56px\] {
min-height: 56px;
}
.min-h-\[40px\] {
min-height: 40px;
}
.min-h-\[36px\] {
min-height: 36px;
}
.min-h-\[24px\] {
min-height: 24px;
}
.min-h-\[28px\] {
min-height: 28px;
}
.min-h-\[32px\] {
min-height: 32px;
}
.w-0 {
width: 0px;
}
@ -2839,6 +2863,11 @@ body {
background-color: rgb(204 204 0 / var(--tw-bg-opacity));
}
.\!bg-gray-200 {
--tw-bg-opacity: 1 !important;
background-color: rgb(229 231 235 / var(--tw-bg-opacity)) !important;
}
.bg-opacity-100 {
--tw-bg-opacity: 1;
}
@ -3245,6 +3274,10 @@ body {
padding-top: 1.25rem;
}
.pl-0 {
padding-left: 0px;
}
.text-left {
text-align: left;
}
@ -3792,6 +3825,12 @@ body {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-none {
--tw-shadow: 0 0 #0000;
--tw-shadow-colored: 0 0 #0000;
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-gray-50 {
--tw-shadow-color: #f9fafb;
--tw-shadow: var(--tw-shadow-colored);
@ -4565,11 +4604,6 @@ body {
--tw-ring-color: rgb(204 204 0 / var(--tw-ring-opacity));
}
.focus\:ring-red-50:focus {
--tw-ring-opacity: 1;
--tw-ring-color: rgb(255 229 229 / var(--tw-ring-opacity));
}
.focus\:ring-opacity-10:focus {
--tw-ring-opacity: 0.1;
}

View File

@ -1,20 +1,21 @@
<script setup lang="ts">
import { type PropType } from 'vue'
import Multiselect from '@vueform/multiselect'
import { ref } from 'vue';
import { TagsInput } from '@flavorly/vanilla-components';
// import Multiselect from '@vueform/multiselect';
interface Tags {
id: number
value: string,
label: string
}
defineProps({
const props = defineProps({
placeholder: {
type: String,
default: ''
},
tags: {
type: Array as PropType<Tags[]>,
type: Array as () => Tags[],
required: true
},
useLabel: {
@ -26,18 +27,22 @@ defineProps({
default: ''
}
})
const allowed = ref(props.tags.map((tag) => tag.label))
const tags = ref<string[]>([])
const updateTags = (value: string[]) => {
tags.value = value
}
</script>
<template>
<div class="flex flex-col">
<Multiselect
mode="tags"
:placeholder="placeholder"
:close-on-select="false"
:searchable="true"
:create-option="true"
:options="tags"
:classes="{
<TagsInput v-model="tags" :placeholder="tags.length == 0 ? placeholder : props.label" :allowed-options="allowed"
valueAttribute="id" textAttribute="label" :enabled="false" @update:modelValue="updateTags" />
<!-- <Multiselect mode="tags" :placeholder="placeholder" :close-on-select="false" :searchable="true"
:create-option="true" :options="props.tags" :classes="{
container:
'relative py-[5px] mx-auto w-full flex items-center justify-end cursor-pointer rounded-lg bg-gray-200 text-left text-base leading-snug outline-none',
containerDisabled: 'cursor-default bg-gray-50',
@ -109,7 +114,6 @@ defineProps({
'bg-transparent absolute left-0 right-0 -bottom-px w-full h-px border-0 p-0 appearance-none outline-none text-transparent',
assist: 'absolute -m-px w-px h-px overflow-hidden',
spacer: 'box-content'
}"
/>
}" /> -->
</div>
</template>

View File

@ -24,6 +24,23 @@ app.use(
searchInput: 'rich-select-search-input',
selectedHighlightedOption: 'rich-select-selected-highlighted-option'
}
},
TagsInput: {
fixedClasses: {
input: 'appearance-none py-0 ring-0 border-0 outline-none focus:ring-0 focus:outline-none focus:shadow-none shadow-none w-full bg-transparent text-gray-800 text-base',
inputWrapper: 'inline-flex flex-grow bg-transparent',
tagsWrapper: 'flex flex-wrap overflow-hidden -my-2 py-1 px-1 w-full text-xs',
tagDeleteButtonIcon: 'w-3 h-3',
tagLabel: 'px-3 text-xs',
},
classes: {
input: 'min-h-[32px]',
inputWrapper: '',
tagsWrapper: '',
tagDeleteButtonIcon: '',
tagLabel: '',
trigger: 'bg-gray-200 rounded-lg mb-2 mt-2',
},
}
})
)