9bc75225fe
* Add more actions * Complete sidebar store integration * Complete portal list store integration * Fixed the specs * Added missing specs * Add comment * Code cleanup * Fixed all the spec issues * Add portal and article API specs * Add category name in article list * Add more locales * Code beautification * Exclude locale from codeclimate ci * feat: Category store integration * chore: Minor fixes * chore: API call fixes * chore: Minor fixes * chore: Minor fixes * chore: Adds the ability for get articles based on categories * chore: minor fixes * chore: Minor fixes * chore: fixes specs and minor improvements * chore: Review fixes * chore: Minor fixes * chore: Review fixes * chore: Review fixes * chore: Spacing fixes * Code cleanup Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
76 lines
1.3 KiB
Vue
76 lines
1.3 KiB
Vue
<template>
|
|
<label class="input-container">
|
|
<span v-if="label">{{ label }}</span>
|
|
<input
|
|
:value="value"
|
|
:type="type"
|
|
:placeholder="placeholder"
|
|
:readonly="readonly"
|
|
:style="styles"
|
|
@input="onChange"
|
|
@blur="onBlur"
|
|
/>
|
|
<p v-if="helpText" class="help-text">{{ helpText }}</p>
|
|
<span v-if="error" class="message">
|
|
{{ error }}
|
|
</span>
|
|
</label>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
label: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
value: {
|
|
type: [String, Number],
|
|
default: '',
|
|
},
|
|
type: {
|
|
type: String,
|
|
default: 'text',
|
|
},
|
|
placeholder: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
helpText: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
error: {
|
|
type: String,
|
|
default: '',
|
|
},
|
|
readonly: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
styles: {
|
|
type: Object,
|
|
default: () => {},
|
|
},
|
|
},
|
|
methods: {
|
|
onChange(e) {
|
|
this.$emit('input', e.target.value);
|
|
},
|
|
onBlur(e) {
|
|
this.$emit('blur', e.target.value);
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
<style scoped lang="scss">
|
|
.help-text {
|
|
margin-top: var(--space-micro);
|
|
font-size: var(--font-size-mini);
|
|
color: var(--s-600);
|
|
font-style: normal;
|
|
}
|
|
.message {
|
|
margin-top: 0 !important;
|
|
}
|
|
</style>
|