Files
mixtape/zero.Web/App/Components/Forms/property.vue
T

106 lines
1.7 KiB
Vue
Raw Normal View History

2020-03-27 01:17:22 +01:00
<template>
<div class="ui-property" :class="{'is-vertical': vertical }">
<label v-if="label" class="ui-property-label" for="">
2020-04-08 15:16:05 +02:00
<span v-localize="label"></span>
2020-03-27 01:17:22 +01:00
<strong class="ui-property-required" v-if="required">*</strong>
2020-04-08 15:16:05 +02:00
<small v-if="description" v-localize="description"></small>
2020-03-27 01:17:22 +01:00
</label>
<div class="ui-property-content">
<slot></slot>
</div>
<ui-error :field="field" />
2020-03-27 01:17:22 +01:00
</div>
</template>
<script>
export default {
name: 'uiProperty',
props: {
field: String,
2020-03-27 01:17:22 +01:00
label: String,
description: String,
required: Boolean,
vertical: Boolean
},
mounted ()
{
},
methods: {
}
}
</script>
2020-04-09 13:06:15 +02:00
<style lang="scss">
2020-03-27 01:17:22 +01:00
@import 'Sass/Core/settings';
.ui-property
{
position: relative;
display: flex;
2020-03-30 17:11:56 +02:00
& + .ui-property
{
padding-top: 25px;
margin-top: 25px;
2020-04-08 15:16:05 +02:00
/*border-top: 1px solid var(--color-line);*/
2020-03-30 17:11:56 +02:00
}
2020-03-27 01:17:22 +01:00
}
.ui-property.is-vertical
{
flex-direction: column;
.ui-property-label
{
width: 100%;
}
.ui-property-content
{
margin-top: 5px;
}
}
.ui-property-label
{
display: block;
color: var(--color-text);
width: 240px;
padding-right: 2rem;
margin-bottom: 5px;
font-size: $font-size;
line-height: 1.5;
2020-04-03 18:03:36 +02:00
font-weight: 700;
2020-03-27 01:17:22 +01:00
}
.ui-property-label small
{
display: block;
padding-top: 5px;
font-size: $font-size-s;
font-weight: 400;
line-height: 1.5;
text-decoration: none;
2020-04-08 15:16:05 +02:00
color: var(--color-fg-light);
2020-03-27 01:17:22 +01:00
}
.ui-property-required
{
color: var(--color-negative);
2020-04-08 15:16:05 +02:00
margin-left: 0.2em;
2020-03-27 01:17:22 +01:00
}
.ui-property-content
{
flex: 1;
2020-04-08 15:16:05 +02:00
max-width: 800px;
2020-03-27 01:17:22 +01:00
}
</style>