@redseed/redseed-ui-vue3 2.10.5 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -29,9 +29,10 @@ function clicked() {
|
|
|
29
29
|
}
|
|
30
30
|
</script>
|
|
31
31
|
<template>
|
|
32
|
-
<div :class="cardClass"
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
<div :class="cardClass">
|
|
33
|
+
<div class="rsui-card__action-layer"
|
|
34
|
+
v-on="clickable ? { click: clicked } : {}"
|
|
35
|
+
></div>
|
|
35
36
|
<div v-if="$slots.image"
|
|
36
37
|
class="rsui-card__image"
|
|
37
38
|
>
|
|
@@ -78,7 +79,7 @@ function clicked() {
|
|
|
78
79
|
</template>
|
|
79
80
|
<style lang="scss" scoped>
|
|
80
81
|
.rsui-card {
|
|
81
|
-
@apply flex flex-col;
|
|
82
|
+
@apply relative flex flex-col;
|
|
82
83
|
@apply select-none transition duration-200;
|
|
83
84
|
@apply rounded-lg bg-white shadow-full-light;
|
|
84
85
|
&--hoverable {
|
|
@@ -87,11 +88,14 @@ function clicked() {
|
|
|
87
88
|
&--clickable {
|
|
88
89
|
@apply cursor-pointer;
|
|
89
90
|
}
|
|
91
|
+
&__action-layer {
|
|
92
|
+
@apply absolute inset-0 bg-transparent transition;
|
|
93
|
+
}
|
|
90
94
|
&__image {
|
|
91
95
|
@apply rounded-t-lg overflow-hidden;
|
|
92
96
|
}
|
|
93
97
|
&__content {
|
|
94
|
-
@apply min-h-14 p-3 flex-1;
|
|
98
|
+
@apply min-h-14 p-3 flex-1 relative pointer-events-none;
|
|
95
99
|
&-top {
|
|
96
100
|
@apply flex justify-between space-x-2 pb-2;
|
|
97
101
|
&--action {
|
|
@@ -101,14 +105,17 @@ function clicked() {
|
|
|
101
105
|
}
|
|
102
106
|
&__title {
|
|
103
107
|
@apply max-h-12 text-lg font-semibold leading-6 line-clamp-2;
|
|
108
|
+
&-action {
|
|
109
|
+
@apply pointer-events-auto;
|
|
110
|
+
}
|
|
104
111
|
}
|
|
105
112
|
&__meta {
|
|
106
113
|
@apply grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-2 mt-4;
|
|
107
114
|
}
|
|
108
115
|
&__actions {
|
|
109
|
-
@apply p-3;
|
|
116
|
+
@apply relative p-3 pointer-events-none;
|
|
110
117
|
& > * {
|
|
111
|
-
@apply mr-2 mb-2;
|
|
118
|
+
@apply mr-2 mb-2 pointer-events-auto;
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
121
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import FormFieldSlot from './FormFieldSlot.vue'
|
|
4
|
+
import { useTextareaAutosize } from '@vueuse/core'
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const emit = defineEmits(['input', 'select'])
|
|
11
|
+
|
|
12
|
+
const { textarea, input } = useTextareaAutosize({ styleProp: 'minHeight' })
|
|
13
|
+
|
|
14
|
+
const model = defineModel()
|
|
15
|
+
|
|
16
|
+
function onInput(event) {
|
|
17
|
+
model.value = input.value
|
|
18
|
+
emit('input', event)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function onSelect(event) {
|
|
22
|
+
emit('select', event)
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
<template>
|
|
26
|
+
<FormFieldSlot
|
|
27
|
+
:id="$attrs.id"
|
|
28
|
+
:class="[$attrs.class, 'rsui-form-field-textarea']"
|
|
29
|
+
:required="$attrs.required"
|
|
30
|
+
:compact="$attrs.compact"
|
|
31
|
+
>
|
|
32
|
+
<template #label v-if="$slots.label">
|
|
33
|
+
<slot name="label"></slot>
|
|
34
|
+
</template>
|
|
35
|
+
<textarea ref="textarea"
|
|
36
|
+
v-model="input"
|
|
37
|
+
:id="$attrs.id"
|
|
38
|
+
:name="$attrs.name"
|
|
39
|
+
:placeholder="$attrs.placeholder"
|
|
40
|
+
:disabled="$attrs.disabled"
|
|
41
|
+
:required="$attrs.required"
|
|
42
|
+
:rows="$attrs.rows"
|
|
43
|
+
@input="onInput"
|
|
44
|
+
@select="onSelect"
|
|
45
|
+
></textarea>
|
|
46
|
+
|
|
47
|
+
<template #help v-if="$slots.help">
|
|
48
|
+
<slot name="help"></slot>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<template #error v-if="$slots.error">
|
|
52
|
+
<slot name="error"></slot>
|
|
53
|
+
</template>
|
|
54
|
+
</FormFieldSlot>
|
|
55
|
+
</template>
|
|
56
|
+
<style lang="scss" scoped>
|
|
57
|
+
.rsui-form-field-textarea {
|
|
58
|
+
@apply relative;
|
|
59
|
+
|
|
60
|
+
textarea {
|
|
61
|
+
@apply w-full border rounded-md ring-0 text-base transition resize-none;
|
|
62
|
+
@apply py-3 px-4 outline-none focus:outline-none;
|
|
63
|
+
@apply text-rsui-default bg-white placeholder-rsui-light border-rsui-grey-200;
|
|
64
|
+
@apply focus:ring focus:ring-highlight focus:border-highlight;
|
|
65
|
+
@apply invalid:border-danger invalid:ring-0;
|
|
66
|
+
@apply disabled:text-rsui-light disabled:bg-rsui-grey-200 disabled:ring-0;
|
|
67
|
+
-ms-overflow-style: none;
|
|
68
|
+
scrollbar-width: none;
|
|
69
|
+
&::-webkit-scrollbar {
|
|
70
|
+
display: none;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -8,6 +8,7 @@ import FormFieldSearch from './FormFieldSearch.vue'
|
|
|
8
8
|
import FormFieldSelect from './FormFieldSelect.vue'
|
|
9
9
|
import FormFieldSlot from './FormFieldSlot.vue'
|
|
10
10
|
import FormFieldText from './FormFieldText.vue'
|
|
11
|
+
import FormFieldTextarea from './FormFieldTextarea.vue'
|
|
11
12
|
import FormFieldTextSuffix from './FormFieldTextSuffix.vue'
|
|
12
13
|
|
|
13
14
|
export {
|
|
@@ -21,5 +22,6 @@ export {
|
|
|
21
22
|
FormFieldSelect,
|
|
22
23
|
FormFieldSlot,
|
|
23
24
|
FormFieldText,
|
|
25
|
+
FormFieldTextarea,
|
|
24
26
|
FormFieldTextSuffix,
|
|
25
27
|
}
|