WIP Исправлены inputs в SectionAddress

This commit is contained in:
Daria Golova
2022-12-30 17:07:40 +03:00
parent 9fe57eda5e
commit bda481cfe5
5 changed files with 125 additions and 80 deletions

View File

@@ -1,23 +1,29 @@
<template lang="pug">
.base-select(
@click="invertOpen",
:class="{'open': open && !disable, 'border-none': borderNone}",
ref="select"
)
.placeholder(
:class="{'value-color': value || placeholderOpacity, ...textClass}",
:style="{'color': !disable || '#9ca3af', 'opacity': 1}"
) {{ value || placeholder }}
.flex.items-center
.select-form-separator.cursor-pointer.mr-4(v-if="separator")
span.icon-down-arrow.open-icon(:class="{'open': open && !disable }")
base-menu(v-if="open")
.items-container(
@click="open = false",
v-click-outside="leaveSelect",
:class="textClass"
)
.item(v-for="item in items", :key="item.id" @click="clickItem(item.label)") {{ item.label }}
.flex.flex-col.gap-y-2
.font-semibold.opacity-40(
v-if="label",
:class="labelClass"
) {{ label }}
.base-select(
@click="invertOpen",
:class="{'open': open && !disable, 'border-none': borderNone}",
:style="{'background-color': disable && 'var(--bg-disable-grey-color)'}"
ref="select"
)
.placeholder(
:class="{'value-color': value || placeholderOpacity, ...textClass}",
:style="{'color': !disable || '#9ca3af', 'opacity': 1}"
) {{ value || placeholder }}
.flex.items-center
.select-form-separator.cursor-pointer.mr-4(v-if="separator")
span.icon-down-arrow.open-icon(:class="{'open': open && !disable }")
base-menu(v-if="open")
.items-container(
@click="open = false",
v-click-outside="leaveSelect",
:class="textClass"
)
.item(v-for="item in items", :key="item.id" @click="clickItem(item.label)") {{ item.label }}
</template>
<script>
@@ -37,6 +43,8 @@ export default {
placeholderOpacity: Boolean,
disable: Boolean,
textStyle: String,
labelStyle: String,
label: String,
},
emits: ["update:modelValue"],
data() {
@@ -62,6 +70,15 @@ export default {
"text-base": true,
};
},
labelClass() {
return this.labelStyle
? {
[this.labelStyle]: true,
}
: {
"text-sm": true,
};
},
},
methods: {
clickItem(id) {
@@ -80,6 +97,7 @@ export default {
<style scoped lang="sass">
.base-select
width: 100%
height: 40px
border: 1.5px solid #D3D4DC
border-radius: 4px
padding: 9px 16px