adrema/resources/js/components/form/Textarea.vue

105 lines
2.7 KiB
Vue
Raw Normal View History

2021-04-10 19:45:11 +02:00
<template>
<label class="flex flex-col relative">
2023-03-06 23:00:46 +01:00
<span
v-if="label && !inset"
class="font-semibold text-gray-400"
:class="{
'text-xs': size == 'sm',
'text-sm': size === null,
}"
>{{ label }}<span v-show="required" class="text-red-800">&nbsp;*</span></span
>
<span
v-if="label && inset"
class="absolute top-0 left-0 -mt-2 px-1 ml-3 inset-bg font-semibold text-gray-700"
:class="{
'text-xs': size == 'sm',
'text-sm': size === null,
}"
>{{ label }}<span v-show="required" class="text-red-800">&nbsp;*</span></span
>
<textarea
v-text="value"
@input="trigger"
:placeholder="placeholder"
class="h-full outline-none bg-gray-700 border-gray-600 border-solid"
:rows="rows"
2021-04-10 19:45:11 +02:00
:class="{
2021-04-11 17:37:26 +02:00
'rounded-lg text-sm border-2 p-2 text-gray-300': size === null,
2023-03-06 23:00:46 +01:00
'rounded-lg py-2 px-2 text-xs border-2 text-gray-300': size == 'sm',
2021-04-10 19:45:11 +02:00
}"
></textarea>
<div v-if="hint" v-tooltip="hint" class="absolute right-0 top-0 mr-2 mt-2">
Update to vue 3 Squashed commit of the following: commit a91f51113b9680a0dd343aa8ab9b7bfaf6e8833b Author: Philipp Lang <privat@zoomyboy.de> Date: Thu Jul 6 13:55:42 2023 +0200 change toast position commit d99771122067d125404181580374e4497fa356b4 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 18:26:15 2023 +0200 Add tooltips commit c65efb92592a46b63d738a39c2205787bf8fc37a Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 18:01:20 2023 +0200 Add prettier commit fc0ecd6a6b93d867a498960d3c7613b087b3147e Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 17:57:56 2023 +0200 Fix toolbar button tooltip commit 4c2b2463ff9ab90a0f96a0909d5773c845962b38 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 17:39:38 2023 +0200 Fixed maildispatcher index button commit 33e46bb38880d16d236f6e4673d0a2efd58a3bff Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 17:37:40 2023 +0200 Fix mailgateway form commit ffb0a0ba120c447f162ea592cf87ec6ad51b4391 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 17:34:30 2023 +0200 Fix filter for Maildispatcher commit 64548178c0d65c5b69eee59cdafcf38d0d053a21 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 17:13:11 2023 +0200 Add back button to initialize commit 401d138e647e049058ee2821af7ee9e30d7786ec Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:42:21 2023 +0200 Fix settings success message commit 1e09006f5b73696e1fc0272dcb3112ea84392d2d Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:38:00 2023 +0200 Fix save button in Settings commit ad21a2a3bf28a61472c469fe64a704737bc54d69 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:32:11 2023 +0200 Fix event name commit cb7df3f5acc774b864a688a9e61cba9ac481fa7c Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:29:58 2023 +0200 Fix event name commit 46c52237de412397f88f4948a5617fb42fe7d142 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:27:17 2023 +0200 Fixed hasFlash messages commit 37b9e724cde5af7458be9847550334e62345e15b Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:27:00 2023 +0200 Fix pagination reload event commit a9be327a59680ff11d5f76356f64523fa06fd300 Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:26:37 2023 +0200 Remove console log commit 39119c5be593074018cac883af45104f87a7640a Author: philipp lang <philipp@aweos.de> Date: Sun Jul 2 00:04:52 2023 +0200 Fix notification component in InstallLayout commit a867053cd1283ce5fed0139e2ab66de804d7657a Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 03:08:20 2023 +0200 Remove console log commit 637338ad3456232892966e2d43fd3587e739f10e Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 03:07:23 2023 +0200 Fix: import toasted commit d190f814a23584f2f1de500e49e3b137eb8f4cfc Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 03:07:05 2023 +0200 Update hasFlash toast commit 6cd96ef5eafbbb3db8c0d21869bf3c91557d758c Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 03:06:38 2023 +0200 Add toast notification on axios error commit 1ba3d221e7e5fa2fd19d3d316de45c3daa6bedf8 Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 01:34:40 2023 +0200 Fix save button in activity VForm commit 8089f8f0834a6dc64b959f2574e9fddcaa2724a8 Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 01:32:03 2023 +0200 Lint commit cba4f25d317eba277baf527e61d4a810bbe03107 Author: philipp lang <philipp@aweos.de> Date: Sat Jul 1 01:31:15 2023 +0200 Fix import for subactivity form commit 83bbf9c4c44aea7ff33869e8ae27b86dba59985f Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 15:44:33 2023 +0200 Drop leaflet map commit f8d1fe08fa146ae8c637873add8901a2f6e5b0b2 Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 15:29:51 2023 +0200 fix toolbar commit 44c48ec02b0a27e6296d5107fb53c99ad846aeb3 Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 14:28:49 2023 +0200 install new inertia middleware commit b9b9cde58918d40e530afa8786e54a0f9eba2b73 Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 13:49:33 2023 +0200 Update save button commit 8c1e9b143a2349bf33e934a21a039c8966d8e143 Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 13:40:06 2023 +0200 fix select commit 46b6418f84e9bfc4ec5ce1ab9e6b02669fe7227d Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 13:09:08 2023 +0200 update select commit ea274669fded1fb905c89cd20b62f672b8f7b57a Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 13:07:22 2023 +0200 fix switch commit 048f9f1324c5c54f13d45f0a819855bb8274df6f Author: Philipp Lang <privat@zoomyboy.de> Date: Fri Jun 30 12:15:38 2023 +0200 fix components commit e4700e06aaa912d519d0313e2f2e76288e12dd9b Author: Philipp Lang <privat@zoomyboy.de> Date: Thu Jun 22 16:34:44 2023 +0200 vue3 update commit 2b196f2bd285e843ca86cd624f0dadbefe759786 Author: Philipp Lang <privat@zoomyboy.de> Date: Thu Jun 22 13:08:55 2023 +0200 Add page title commit 30dfc5dca25b95ff5f25b976ae66c1ff350b0ebe Author: Philipp Lang <privat@zoomyboy.de> Date: Thu Jun 22 12:59:47 2023 +0200 Fix map commit 43f7d335f32691f1b02dcbbd4d01943dd4b7c752 Author: Philipp Lang <privat@zoomyboy.de> Date: Thu Jun 22 12:58:33 2023 +0200 Update inertia
2023-07-06 13:56:19 +02:00
<ui-sprite src="info-button" class="w-5 h-5 text-indigo-200"></ui-sprite>
2021-04-10 19:45:11 +02:00
</div>
</label>
</template>
<script>
export default {
2023-03-06 23:00:46 +01:00
data: function () {
2021-04-10 19:45:11 +02:00
return {
2023-03-06 23:00:46 +01:00
focus: false,
2021-04-10 19:45:11 +02:00
};
},
props: {
required: {
type: Boolean,
2023-03-06 23:00:46 +01:00
default: false,
2021-04-10 19:45:11 +02:00
},
inset: {
default: false,
2023-03-06 23:00:46 +01:00
type: Boolean,
2021-04-10 19:45:11 +02:00
},
size: {
2023-03-06 23:00:46 +01:00
default: null,
2021-04-10 19:45:11 +02:00
},
rows: {
2023-03-06 23:00:46 +01:00
default: function () {
2021-04-10 19:45:11 +02:00
return 4;
2023-03-06 23:00:46 +01:00
},
2021-04-10 19:45:11 +02:00
},
id: {
2023-03-06 23:00:46 +01:00
required: true,
2021-04-10 19:45:11 +02:00
},
hint: {
2023-03-06 23:00:46 +01:00
default: null,
2021-04-10 19:45:11 +02:00
},
value: {
2023-03-06 23:00:46 +01:00
default: undefined,
2021-04-10 19:45:11 +02:00
},
mask: {
2023-03-06 23:00:46 +01:00
default: undefined,
2021-04-10 19:45:11 +02:00
},
label: {
2023-03-06 23:00:46 +01:00
default: false,
2021-04-10 19:45:11 +02:00
},
type: {
required: false,
2023-03-06 23:00:46 +01:00
default: function () {
return 'text';
},
2021-04-10 19:45:11 +02:00
},
placeholder: {
2023-03-06 23:00:46 +01:00
default: '',
},
2021-04-10 19:45:11 +02:00
},
methods: {
trigger(v) {
this.$emit('input', v.target.value);
2023-03-06 23:00:46 +01:00
},
2021-04-10 19:45:11 +02:00
},
created() {
if (typeof this.value === 'undefined') {
this.$emit('input', '');
}
2023-03-06 23:00:46 +01:00
},
2021-04-10 19:45:11 +02:00
};
</script>
<style scope>
.inset-bg {
background: linear-gradient(to bottom, hsl(247.5, 66.7%, 97.6%) 0%, hsl(247.5, 66.7%, 97.6%) 41%, hsl(0deg 0% 100%) 41%, hsl(180deg 0% 100%) 100%);
}
</style>