sprintify-ui 0.1.18 → 0.2.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/README.md +1 -2
- package/dist/sprintify-ui.es.js +15696 -13336
- package/dist/style.css +1 -1
- package/dist/types/src/components/BaseActionItem.vue.d.ts +3 -3
- package/dist/types/src/components/BaseActionItemButton.vue.d.ts +9 -6
- package/dist/types/src/components/BaseAddressForm.vue.d.ts +17 -27
- package/dist/types/src/components/BaseAlert.vue.d.ts +1 -1
- package/dist/types/src/components/BaseApp.vue.d.ts +2 -2
- package/dist/types/src/components/BaseAppDialogs.vue.d.ts +1 -1
- package/dist/types/src/components/BaseAppNotifications.vue.d.ts +1 -1
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +33 -28
- package/dist/types/src/components/BaseAutocompleteDrawer.vue.d.ts +12 -11
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +12 -15
- package/dist/types/src/components/BaseAvatar.vue.d.ts +1 -1
- package/dist/types/src/components/BaseAvatarGroup.vue.d.ts +1 -1
- package/dist/types/src/components/BaseBadge.vue.d.ts +9 -6
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +12 -15
- package/dist/types/src/components/BaseBoolean.vue.d.ts +3 -3
- package/dist/types/src/components/BaseBreadcrumbs.vue.d.ts +1 -1
- package/dist/types/src/components/BaseButton.vue.d.ts +1 -1
- package/dist/types/src/components/BaseButtonGroup.vue.d.ts +13 -13
- package/dist/types/src/components/BaseCard.vue.d.ts +2 -2
- package/dist/types/src/components/BaseCardRow.vue.d.ts +1 -1
- package/dist/types/src/components/BaseCharacterCounter.vue.d.ts +1 -1
- package/dist/types/src/components/BaseClickOutside.vue.d.ts +2 -2
- package/dist/types/src/components/BaseClipboard.vue.d.ts +2 -2
- package/dist/types/src/components/BaseColor.vue.d.ts +2 -2
- package/dist/types/src/components/BaseContainer.vue.d.ts +1 -1
- package/dist/types/src/components/BaseCounter.vue.d.ts +1 -1
- package/dist/types/src/components/BaseCropper.vue.d.ts +21 -19
- package/dist/types/src/components/BaseCropperModal.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDataIterator.vue.d.ts +9 -9
- package/dist/types/src/components/BaseDataIteratorSectionBox.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDataIteratorSectionButton.vue.d.ts +1 -1
- package/dist/types/src/components/BaseDataIteratorSectionColumns.vue.d.ts +141 -169
- package/dist/types/src/components/BaseDataIteratorSectionModal.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDataTable.vue.d.ts +15 -13
- package/dist/types/src/components/BaseDataTableRowAction.vue.d.ts +1 -1
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +9 -6
- package/dist/types/src/components/BaseDateSelect.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDescriptionList.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDescriptionListItem.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDialog.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDisplayRelativeTime.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDraggable.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDropdown.vue.d.ts +13 -10
- package/dist/types/src/components/BaseDropdownAutocomplete.vue.d.ts +7 -7
- package/dist/types/src/components/BaseField.vue.d.ts +3 -3
- package/dist/types/src/components/BaseFieldI18n.vue.d.ts +9 -12
- package/dist/types/src/components/BaseFilePicker.vue.d.ts +13 -10
- package/dist/types/src/components/BaseFilePickerCrop.vue.d.ts +13 -10
- package/dist/types/src/components/BaseFileUploader.vue.d.ts +40 -13
- package/dist/types/src/components/BaseForm.vue.d.ts +24 -21
- package/dist/types/src/components/BaseHasMany.vue.d.ts +13 -16
- package/dist/types/src/components/BaseHeader.vue.d.ts +7 -4
- package/dist/types/src/components/BaseIconPicker.vue.d.ts +6 -3
- package/dist/types/src/components/BaseInput.vue.d.ts +5 -5
- package/dist/types/src/components/BaseInputError.vue.d.ts +2 -2
- package/dist/types/src/components/BaseInputLabel.vue.d.ts +1 -1
- package/dist/types/src/components/BaseInputPercent.vue.d.ts +4 -4
- package/dist/types/src/components/BaseLayoutNotificationDropdown.vue.d.ts +1 -1
- package/dist/types/src/components/BaseLayoutNotificationItem.vue.d.ts +1 -1
- package/dist/types/src/components/BaseLayoutNotificationItemContent.vue.d.ts +1 -1
- package/dist/types/src/components/BaseLayoutSidebar.vue.d.ts +4 -4
- package/dist/types/src/components/BaseLayoutSidebarConfigurable.vue.d.ts +3 -3
- package/dist/types/src/components/BaseLayoutStacked.vue.d.ts +4 -4
- package/dist/types/src/components/BaseLayoutStackedConfigurable.vue.d.ts +2 -2
- package/dist/types/src/components/BaseLoadingCover.vue.d.ts +8 -8
- package/dist/types/src/components/BaseMediaGallery.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaGalleryItem.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaItem.vue.d.ts +1 -1
- package/dist/types/src/components/BaseMediaLibrary.vue.d.ts +26 -8
- package/dist/types/src/components/BaseMediaList.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaListItem.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaPictures.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaPicturesItem.vue.d.ts +2 -2
- package/dist/types/src/components/BaseMediaPreview.vue.d.ts +1 -1
- package/dist/types/src/components/BaseMenu.vue.d.ts +19 -19
- package/dist/types/src/components/BaseMenuItem.vue.d.ts +2 -2
- package/dist/types/src/components/BaseModalCenter.vue.d.ts +13 -12
- package/dist/types/src/components/BaseModalSide.vue.d.ts +13 -12
- package/dist/types/src/components/BaseNavbar.vue.d.ts +10 -7
- package/dist/types/src/components/BaseNavbarItem.vue.d.ts +1 -1
- package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +1 -1
- package/dist/types/src/components/BaseNavbarSideItem.vue.d.ts +1 -1
- package/dist/types/src/components/BaseNavbarSideItemContent.vue.d.ts +1 -1
- package/dist/types/src/components/BaseNumber.vue.d.ts +4 -4
- package/dist/types/src/components/BasePagination.vue.d.ts +1 -1
- package/dist/types/src/components/BasePanel.vue.d.ts +1 -1
- package/dist/types/src/components/BasePassword.vue.d.ts +3 -3
- package/dist/types/src/components/BaseProgressCircle.vue.d.ts +1 -1
- package/dist/types/src/components/BaseRadioGroup.vue.d.ts +7 -7
- package/dist/types/src/components/BaseReadMore.vue.d.ts +2 -2
- package/dist/types/src/components/BaseRichText.vue.d.ts +6 -6
- package/dist/types/src/components/BaseSelect.vue.d.ts +8 -7
- package/dist/types/src/components/BaseShortcut.vue.d.ts +1 -1
- package/dist/types/src/components/BaseSideNavigation.vue.d.ts +8 -5
- package/dist/types/src/components/BaseSideNavigationItem.vue.d.ts +9 -6
- package/dist/types/src/components/BaseSkeleton.vue.d.ts +8 -7
- package/dist/types/src/components/BaseStatistic.vue.d.ts +1 -1
- package/dist/types/src/components/BaseStepper.vue.d.ts +1 -1
- package/dist/types/src/components/BaseStepperItem.vue.d.ts +1 -1
- package/dist/types/src/components/BaseSwitch.vue.d.ts +3 -3
- package/dist/types/src/components/BaseSystemAlert.vue.d.ts +5 -5
- package/dist/types/src/components/BaseTabItem.vue.d.ts +9 -6
- package/dist/types/src/components/BaseTable.vue.d.ts +6 -6
- package/dist/types/src/components/BaseTableColumn.vue.d.ts +2 -2
- package/dist/types/src/components/BaseTabs.vue.d.ts +8 -5
- package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +39 -34
- package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +12 -15
- package/dist/types/src/components/BaseTextarea.vue.d.ts +3 -3
- package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +13 -3
- package/dist/types/src/components/BaseTimeline.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTimelineItem.vue.d.ts +1 -1
- package/dist/types/src/components/SlotComponent.d.ts +1 -1
- package/dist/types/src/svg/BaseEmptyState.vue.d.ts +1 -1
- package/dist/types/src/svg/BaseSpinnerLarge.vue.d.ts +1 -1
- package/dist/types/src/svg/BaseSpinnerSmall.vue.d.ts +1 -1
- package/package.json +4 -5
- package/src/components/BaseAutocomplete.vue +3 -3
- package/src/components/BaseAutocompleteDrawer.vue +2 -2
- package/src/components/BaseButtonGroup.stories.js +5 -4
- package/src/components/BaseButtonGroup.vue +5 -5
- package/src/components/BaseColor.vue +3 -3
- package/src/components/BaseDataIterator.vue +1 -1
- package/src/components/BaseDataTable.stories.js +1 -1
- package/src/components/BaseDataTable.vue +1 -1
- package/src/components/BaseDropdownAutocomplete.vue +5 -3
- package/src/components/BaseFilePicker.vue +3 -3
- package/src/components/BaseFilePickerCrop.stories.js +3 -3
- package/src/components/BaseFilePickerCrop.vue +3 -3
- package/src/components/BaseFileUploader.stories.js +3 -3
- package/src/components/BaseFileUploader.vue +4 -4
- package/src/components/BaseForm.vue +5 -4
- package/src/components/BaseLayoutNotificationDropdown.vue +1 -1
- package/src/components/BaseLayoutStackedConfigurable.vue +1 -1
- package/src/components/BaseLoadingCover.stories.js +2 -2
- package/src/components/BaseLoadingCover.vue +14 -7
- package/src/components/BaseMediaLibrary.vue +1 -1
- package/src/components/BaseMenu.vue +20 -12
- package/src/components/BaseModalCenter.vue +13 -7
- package/src/components/BaseModalSide.vue +12 -6
- package/src/components/BaseNavbar.stories.js +1 -1
- package/src/components/BaseRadioGroup.vue +2 -2
- package/src/components/BaseSkeleton.vue +21 -5
- package/src/components/BaseTagAutocomplete.stories.js +1 -1
- package/src/components/BaseTagAutocomplete.vue +6 -5
- package/src/components/BaseTextarea.vue +2 -2
- package/src/components/BaseTextareaAutoresize.stories.js +30 -1
- package/src/components/BaseTextareaAutoresize.vue +19 -13
|
@@ -32,8 +32,12 @@
|
|
|
32
32
|
>
|
|
33
33
|
<div
|
|
34
34
|
v-if="modelValue"
|
|
35
|
-
:class="
|
|
36
|
-
|
|
35
|
+
:class="
|
|
36
|
+
twMerge(
|
|
37
|
+
'fixed inset-0 bg-slate-900 bg-opacity-70 transition-opacity',
|
|
38
|
+
twBackdrop
|
|
39
|
+
)
|
|
40
|
+
"
|
|
37
41
|
@click="
|
|
38
42
|
closeOnOutsideClick
|
|
39
43
|
? modal.close()
|
|
@@ -70,7 +74,7 @@
|
|
|
70
74
|
|
|
71
75
|
<button
|
|
72
76
|
v-if="showCloseButton"
|
|
73
|
-
class="right fixed
|
|
77
|
+
class="right fixed right-2 top-2 flex h-16 w-16 items-center justify-center rounded-full hover:bg-black hover:bg-opacity-20"
|
|
74
78
|
type="button"
|
|
75
79
|
@click="modal.close()"
|
|
76
80
|
>
|
|
@@ -84,6 +88,8 @@
|
|
|
84
88
|
|
|
85
89
|
<script lang="ts" setup>
|
|
86
90
|
import { useModal } from '@/composables/modal';
|
|
91
|
+
import { PropType } from 'vue';
|
|
92
|
+
import { twMerge } from 'tailwind-merge';
|
|
87
93
|
|
|
88
94
|
const props = defineProps({
|
|
89
95
|
modelValue: {
|
|
@@ -94,10 +100,6 @@ const props = defineProps({
|
|
|
94
100
|
default: 'center',
|
|
95
101
|
type: String,
|
|
96
102
|
},
|
|
97
|
-
backdropClass: {
|
|
98
|
-
default: 'bg-opacity-70 bg-slate-900',
|
|
99
|
-
type: String,
|
|
100
|
-
},
|
|
101
103
|
closeOnOutsideClick: {
|
|
102
104
|
default: true,
|
|
103
105
|
type: Boolean,
|
|
@@ -114,6 +116,10 @@ const props = defineProps({
|
|
|
114
116
|
default: false,
|
|
115
117
|
type: Boolean,
|
|
116
118
|
},
|
|
119
|
+
twBackdrop: {
|
|
120
|
+
default: '',
|
|
121
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
122
|
+
},
|
|
117
123
|
});
|
|
118
124
|
|
|
119
125
|
const emit = defineEmits(['update:modelValue']);
|
|
@@ -23,8 +23,12 @@
|
|
|
23
23
|
>
|
|
24
24
|
<div
|
|
25
25
|
v-show="modelValue"
|
|
26
|
-
:class="
|
|
27
|
-
|
|
26
|
+
:class="
|
|
27
|
+
twMerge(
|
|
28
|
+
'fixed inset-0 bg-slate-900 bg-opacity-70 transition-opacity',
|
|
29
|
+
twBackdrop
|
|
30
|
+
)
|
|
31
|
+
"
|
|
28
32
|
@click="
|
|
29
33
|
closeOnOutsideClick
|
|
30
34
|
? modal.close()
|
|
@@ -75,6 +79,8 @@
|
|
|
75
79
|
</template>
|
|
76
80
|
|
|
77
81
|
<script lang="ts" setup>
|
|
82
|
+
import { PropType } from 'vue';
|
|
83
|
+
import { twMerge } from 'tailwind-merge';
|
|
78
84
|
import { useModal } from '@/composables/modal';
|
|
79
85
|
import { useBreakpoints } from '@/composables/breakpoints';
|
|
80
86
|
|
|
@@ -87,10 +93,6 @@ const props = defineProps({
|
|
|
87
93
|
default: '32rem',
|
|
88
94
|
type: String,
|
|
89
95
|
},
|
|
90
|
-
backdropClass: {
|
|
91
|
-
default: 'bg-opacity-70 bg-slate-900',
|
|
92
|
-
type: String,
|
|
93
|
-
},
|
|
94
96
|
closeOnOutsideClick: {
|
|
95
97
|
default: true,
|
|
96
98
|
type: Boolean,
|
|
@@ -99,6 +101,10 @@ const props = defineProps({
|
|
|
99
101
|
default: false,
|
|
100
102
|
type: Boolean,
|
|
101
103
|
},
|
|
104
|
+
twBackdrop: {
|
|
105
|
+
default: '',
|
|
106
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
107
|
+
},
|
|
102
108
|
});
|
|
103
109
|
|
|
104
110
|
const emit = defineEmits(['update:modelValue']);
|
|
@@ -99,7 +99,7 @@ const Template = (args) => ({
|
|
|
99
99
|
|
|
100
100
|
<div class="hidden md:ml-6 md:flex md:items-center">
|
|
101
101
|
<!-- Profile dropdown -->
|
|
102
|
-
<BaseMenu menu
|
|
102
|
+
<BaseMenu tw-menu="w-52" :items="userMenu">
|
|
103
103
|
<template #button="{ open }">
|
|
104
104
|
<div
|
|
105
105
|
class="flex rounded-full"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
:required="requiredInternal"
|
|
19
19
|
:disabled="disabled"
|
|
20
20
|
:value="option.value"
|
|
21
|
-
:class="
|
|
21
|
+
:class="twInput"
|
|
22
22
|
@input="emitUpdate(option.value)"
|
|
23
23
|
/>
|
|
24
24
|
|
|
@@ -72,7 +72,7 @@ const props = defineProps({
|
|
|
72
72
|
default: 'flex space-x-2',
|
|
73
73
|
type: String,
|
|
74
74
|
},
|
|
75
|
-
|
|
75
|
+
twInput: {
|
|
76
76
|
default: 'mt-0.5 border-slate-300',
|
|
77
77
|
type: String,
|
|
78
78
|
},
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
:class="
|
|
4
|
+
twMerge(
|
|
5
|
+
'relative isolate overflow-hidden rounded bg-slate-200',
|
|
6
|
+
props.class
|
|
7
|
+
)
|
|
8
|
+
"
|
|
9
|
+
>
|
|
3
10
|
<div
|
|
4
11
|
class="absolute inset-0 -translate-x-full animate-shimmer border-t border-white/80 bg-gradient-to-r from-transparent via-white/80 to-transparent"
|
|
5
12
|
:style="{
|
|
@@ -10,15 +17,24 @@
|
|
|
10
17
|
</div>
|
|
11
18
|
</template>
|
|
12
19
|
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
export default {
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
};
|
|
24
|
+
</script>
|
|
25
|
+
|
|
13
26
|
<script lang="ts" setup>
|
|
14
|
-
|
|
27
|
+
import { PropType } from 'vue';
|
|
28
|
+
import { twMerge } from 'tailwind-merge';
|
|
29
|
+
|
|
30
|
+
const props = defineProps({
|
|
15
31
|
delay: {
|
|
16
32
|
default: '0s',
|
|
17
33
|
type: String,
|
|
18
34
|
},
|
|
19
|
-
|
|
20
|
-
default: '
|
|
21
|
-
type: String,
|
|
35
|
+
class: {
|
|
36
|
+
default: '',
|
|
37
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
22
38
|
},
|
|
23
39
|
});
|
|
24
40
|
</script>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
wrapperClass,
|
|
8
8
|
]"
|
|
9
9
|
>
|
|
10
|
-
<div :class="
|
|
10
|
+
<div :class="twMerge('-m-0.5 flex flex-wrap', twContainer)">
|
|
11
11
|
<slot
|
|
12
12
|
name="items"
|
|
13
13
|
:items="normalizedModelValue"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
:size="size"
|
|
77
77
|
:loading="loading"
|
|
78
78
|
:loading-bottom="loadingBottom"
|
|
79
|
-
:drawer
|
|
79
|
+
:tw-drawer="inline ? 'pt-1' : 'p-1'"
|
|
80
80
|
:keywords="keywords"
|
|
81
81
|
@select="onSelect"
|
|
82
82
|
@scroll-bottom="emit('scrollBottom')"
|
|
@@ -105,6 +105,7 @@ import { useField } from '@/composables/field';
|
|
|
105
105
|
import { useClickOutside } from '@/composables/clickOutside';
|
|
106
106
|
import { useNotificationsStore } from '@/stores/notifications';
|
|
107
107
|
import BaseAutocompleteDrawer from './BaseAutocompleteDrawer.vue';
|
|
108
|
+
import { twMerge } from 'tailwind-merge';
|
|
108
109
|
import { t } from '@/i18n';
|
|
109
110
|
|
|
110
111
|
const notifications = useNotificationsStore();
|
|
@@ -175,9 +176,9 @@ const props = defineProps({
|
|
|
175
176
|
default: 'focus',
|
|
176
177
|
type: String as PropType<'focus' | 'always'>,
|
|
177
178
|
},
|
|
178
|
-
|
|
179
|
-
default: '
|
|
180
|
-
type: String,
|
|
179
|
+
twContainer: {
|
|
180
|
+
default: '',
|
|
181
|
+
type: [String, Array] as PropType<string|string[]>,
|
|
181
182
|
},
|
|
182
183
|
});
|
|
183
184
|
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
:required="requiredInternal"
|
|
9
9
|
:rows="rows"
|
|
10
10
|
:class="[hasErrorInternal ? 'border-red-500' : 'border-slate-300']"
|
|
11
|
-
class="
|
|
11
|
+
class="mb-0 block rounded disabled:cursor-not-allowed disabled:text-slate-300"
|
|
12
12
|
@input="emitUpdate(transformInputValue($event))"
|
|
13
13
|
/>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script lang="ts" setup>
|
|
17
17
|
import { useField } from '@/composables/field';
|
|
18
|
-
import { get, isString
|
|
18
|
+
import { get, isString } from 'lodash';
|
|
19
19
|
import { PropType } from 'vue';
|
|
20
20
|
|
|
21
21
|
const props = defineProps({
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
title: 'Form/BaseTextareaAutoresize',
|
|
7
7
|
component: BaseTextareaAutoresize,
|
|
8
8
|
args: {
|
|
9
|
-
name: '
|
|
9
|
+
name: 'name',
|
|
10
10
|
placeholder: 'Describe your complete life in 4 sentences...',
|
|
11
11
|
},
|
|
12
12
|
};
|
|
@@ -51,6 +51,35 @@ Disabled.args = {
|
|
|
51
51
|
disabled: true,
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
const TemplateTWTextarea = (args) => ({
|
|
55
|
+
components: {
|
|
56
|
+
BaseTextareaAutoresize,
|
|
57
|
+
ShowValue,
|
|
58
|
+
},
|
|
59
|
+
setup() {
|
|
60
|
+
function onSubmit() {
|
|
61
|
+
alert('submit');
|
|
62
|
+
}
|
|
63
|
+
const value = ref(null);
|
|
64
|
+
return { args, value, onSubmit };
|
|
65
|
+
},
|
|
66
|
+
template: `
|
|
67
|
+
<form @submit.prevent="onSubmit" class="border-none">
|
|
68
|
+
<BaseTextareaAutoresize
|
|
69
|
+
v-model="value"
|
|
70
|
+
v-bind="args"
|
|
71
|
+
class="w-full shadow rounded"
|
|
72
|
+
tw-textarea="p-5 bg-slate-100 text-slate-700 focus:ring-blue-200 focus:ring-4 text-sm"
|
|
73
|
+
@submit="onSubmit"
|
|
74
|
+
></BaseTextareaAutoresize>
|
|
75
|
+
</form>
|
|
76
|
+
|
|
77
|
+
<ShowValue :value="value" />
|
|
78
|
+
`,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export const TWTextarea = TemplateTWTextarea.bind({});
|
|
82
|
+
|
|
54
83
|
export const Field = createFieldStory({
|
|
55
84
|
component: BaseTextareaAutoresize,
|
|
56
85
|
componentName: 'BaseTextareaAutoresize',
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="wrapper"
|
|
4
|
-
class="wrapper grid"
|
|
5
|
-
:style="{ maxHeight: maxHeight + 'px' }"
|
|
6
|
-
>
|
|
2
|
+
<div ref="wrapper" class="grid" :style="{ maxHeight: maxHeight + 'px' }">
|
|
7
3
|
<textarea
|
|
8
4
|
:value="modelValue"
|
|
9
5
|
:name="nameInternal"
|
|
@@ -11,10 +7,7 @@
|
|
|
11
7
|
:disabled="disabled"
|
|
12
8
|
:required="requiredInternal"
|
|
13
9
|
class="resize-none"
|
|
14
|
-
:class="
|
|
15
|
-
BASE_TEXTAREA_CLASSES,
|
|
16
|
-
hasErrorInternal ? 'border-red-500' : 'border-slate-300',
|
|
17
|
-
]"
|
|
10
|
+
:class="textareaClasses"
|
|
18
11
|
:style="{ maxHeight: maxHeight + 'px', gridArea: BASE_GRID_AREA }"
|
|
19
12
|
:rows="rows"
|
|
20
13
|
@input="onInput"
|
|
@@ -24,10 +17,7 @@
|
|
|
24
17
|
/>
|
|
25
18
|
<div
|
|
26
19
|
class="invisible whitespace-pre-wrap"
|
|
27
|
-
:class="
|
|
28
|
-
BASE_TEXTAREA_CLASSES,
|
|
29
|
-
hasErrorInternal ? 'border-red-500' : 'border-slate-300',
|
|
30
|
-
]"
|
|
20
|
+
:class="textareaClasses"
|
|
31
21
|
:style="{
|
|
32
22
|
content: DIV_CONTENT,
|
|
33
23
|
maxHeight: maxHeight + 'px',
|
|
@@ -41,6 +31,8 @@
|
|
|
41
31
|
|
|
42
32
|
<script lang="ts" setup>
|
|
43
33
|
import { useField } from '@/composables/field';
|
|
34
|
+
import { twMerge } from 'tailwind-merge';
|
|
35
|
+
import { PropType } from 'vue';
|
|
44
36
|
|
|
45
37
|
const BASE_TEXTAREA_CLASSES =
|
|
46
38
|
'py-2 px-3 font-normal text-base disabled:cursor-not-allowed disabled:text-slate-300 font-sans rounded leading-normal tracking-normal border';
|
|
@@ -91,6 +83,10 @@ const props = defineProps({
|
|
|
91
83
|
default: false,
|
|
92
84
|
type: Boolean,
|
|
93
85
|
},
|
|
86
|
+
twTextarea: {
|
|
87
|
+
default: '',
|
|
88
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
89
|
+
},
|
|
94
90
|
});
|
|
95
91
|
|
|
96
92
|
const emit = defineEmits(['update:modelValue', 'submit', 'focus', 'input']);
|
|
@@ -137,4 +133,14 @@ function onKeyUp(event: KeyboardEvent) {
|
|
|
137
133
|
function onFocus(event: FocusEvent) {
|
|
138
134
|
emit('focus', event);
|
|
139
135
|
}
|
|
136
|
+
|
|
137
|
+
const textareaClasses = computed(() => {
|
|
138
|
+
return twMerge(
|
|
139
|
+
[
|
|
140
|
+
BASE_TEXTAREA_CLASSES,
|
|
141
|
+
hasErrorInternal.value ? 'border-red-500' : 'border-slate-300',
|
|
142
|
+
]
|
|
143
|
+
//props.twTextarea
|
|
144
|
+
);
|
|
145
|
+
});
|
|
140
146
|
</script>
|