sprintify-ui 0.0.11 → 0.0.12
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/dist/sprintify-ui.es.js +4906 -3570
- package/dist/style.css +1 -1
- package/dist/types/src/components/BaseCharacterCounter.vue.d.ts +143 -0
- package/dist/types/src/components/BaseInput.vue.d.ts +39 -5
- package/dist/types/src/components/BaseLoadingCover.vue.d.ts +72 -0
- package/dist/types/src/components/BaseModalCenter.vue.d.ts +8 -8
- package/dist/types/src/components/BaseModalSide.vue.d.ts +8 -8
- package/dist/types/src/components/BasePagination.vue.d.ts +105 -13
- package/dist/types/src/components/BasePaginationSimple.vue.d.ts +2 -2
- package/dist/types/src/components/BaseSelect.vue.d.ts +130 -26
- package/dist/types/src/components/BaseSwitch.vue.d.ts +15 -8
- package/dist/types/src/components/BaseTabItem.vue.d.ts +26 -4
- package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +175 -21
- package/dist/types/src/components/index.d.ts +24 -1
- package/dist/types/src/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/components/BaseCharacterCounter.stories.js +30 -0
- package/src/components/BaseCharacterCounter.vue +60 -0
- package/src/components/BaseDataIterator.stories.js +2 -2
- package/src/components/BaseDataIterator.vue +32 -38
- package/src/components/BaseDataTable.stories.js +2 -2
- package/src/components/BaseFileUploader.vue +4 -0
- package/src/components/BaseInput.stories.js +46 -0
- package/src/components/BaseInput.vue +10 -2
- package/src/components/BaseInputLabel.stories.js +31 -0
- package/src/components/BaseInputLabel.vue +1 -1
- package/src/components/BaseLoadingCover.stories.js +55 -0
- package/src/components/BaseLoadingCover.vue +19 -1
- package/src/components/BaseMenu.stories.js +125 -0
- package/src/components/BaseModalCenter.stories.js +61 -0
- package/src/components/BaseModalCenter.vue +2 -2
- package/src/components/BaseModalSide.stories.js +55 -0
- package/src/components/BaseModalSide.vue +2 -2
- package/src/components/BaseNavbar.stories.js +150 -0
- package/src/components/BaseNavbar.vue +3 -0
- package/src/components/BaseNavbarItem.vue +1 -0
- package/src/components/BaseNavbarItemContent.vue +3 -0
- package/src/components/BasePagination.stories.js +32 -0
- package/src/components/BasePagination.vue +126 -40
- package/src/components/BasePaginationSimple.vue +3 -3
- package/src/components/BasePanel.stories.js +56 -0
- package/src/components/BasePassword.stories.js +36 -0
- package/src/components/BasePassword.vue +11 -5
- package/src/components/BaseProcessRing.stories.js +27 -0
- package/src/components/BaseReadMore.stories.js +30 -0
- package/src/components/BaseReadMore.vue +1 -1
- package/src/components/BaseSelect.stories.js +67 -0
- package/src/components/BaseSelect.vue +144 -44
- package/src/components/BaseSideNavigation.stories.js +55 -0
- package/src/components/BaseSideNavigation.vue +7 -2
- package/src/components/BaseSideNavigationItem.vue +11 -3
- package/src/components/BaseSkeleton.stories.js +36 -0
- package/src/components/BaseSwitch.stories.js +101 -0
- package/src/components/BaseSwitch.vue +90 -12
- package/src/components/BaseSystemAlert.stories.js +63 -0
- package/src/components/BaseTabItem.vue +19 -6
- package/src/components/BaseTabs.stories.js +54 -0
- package/src/components/BaseTabs.vue +3 -3
- package/src/components/BaseTextarea.stories.js +35 -0
- package/src/components/BaseTextarea.vue +1 -1
- package/src/components/BaseTextareaAutoresize.stories.js +49 -0
- package/src/components/BaseTextareaAutoresize.vue +83 -87
- package/src/components/index.ts +46 -0
- package/src/lang/en.json +1 -0
- package/src/lang/fr.json +1 -0
- package/dist/types/src/components/BaseWordCount.vue.d.ts +0 -31
- package/src/components/BaseWordCount.vue +0 -36
|
@@ -25,9 +25,32 @@ import BaseDialog from './BaseDialog.vue';
|
|
|
25
25
|
import BaseFilePicker from './BaseFilePicker.vue';
|
|
26
26
|
import BaseFileUploader from './BaseFileUploader.vue';
|
|
27
27
|
import { Icon as BaseIcon } from '@iconify/vue';
|
|
28
|
+
import BaseInput from './BaseInput.vue';
|
|
29
|
+
import BaseInputLabel from './BaseInputLabel.vue';
|
|
28
30
|
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
29
31
|
import BaseMenu from './BaseMenu.vue';
|
|
30
32
|
import BaseMenuItem from './BaseMenuItem.vue';
|
|
33
|
+
import BaseModalCenter from './BaseModalCenter.vue';
|
|
34
|
+
import BaseModalSide from './BaseModalSide.vue';
|
|
35
|
+
import BaseNavbar from './BaseNavbar.vue';
|
|
36
|
+
import BaseNavbarItem from './BaseNavbarItem.vue';
|
|
37
|
+
import BaseNavbarItemContent from './BaseNavbarItemContent.vue';
|
|
38
|
+
import BasePagination from './BasePagination.vue';
|
|
39
|
+
import BasePanel from './BasePanel.vue';
|
|
40
|
+
import BasePassword from './BasePassword.vue';
|
|
41
|
+
import BaseProcessRing from './BaseProcessRing.vue';
|
|
42
|
+
import BaseReadMore from './BaseReadMore.vue';
|
|
43
|
+
import BaseSelect from './BaseSelect.vue';
|
|
44
|
+
import BaseSideNavigation from './BaseSideNavigation.vue';
|
|
45
|
+
import BaseSideNavigationItem from './BaseSideNavigationItem.vue';
|
|
46
|
+
import BaseSkeleton from './BaseSkeleton.vue';
|
|
47
|
+
import BaseSwitch from './BaseSwitch.vue';
|
|
48
|
+
import BaseSystemAlert from './BaseSystemAlert.vue';
|
|
49
|
+
import BaseTextarea from './BaseTextarea.vue';
|
|
50
|
+
import BaseTextareaAutoresize from './BaseTextareaAutoresize.vue';
|
|
51
|
+
import BaseCharacterCounter from './BaseCharacterCounter.vue';
|
|
52
|
+
import BaseTabs from './BaseTabs.vue';
|
|
53
|
+
import BaseTabItem from './BaseTabItem.vue';
|
|
31
54
|
import BaseTable from './BaseTable.vue';
|
|
32
55
|
import BaseTableColumn from './BaseTableColumn.vue';
|
|
33
|
-
export { BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseCard, BaseCardRow, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseFilePicker, BaseFileUploader, BaseIcon, BaseLoadingCover, BaseMenu, BaseMenuItem, BaseTable, BaseTableColumn, };
|
|
56
|
+
export { BaseAlert, BaseApp, BaseAppDialogs, BaseAppNotifications, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseBadge, BaseBelongsTo, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseCard, BaseCardRow, BaseClipboard, BaseContainer, BaseCounter, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseFilePicker, BaseFileUploader, BaseIcon, BaseInput, BaseInputLabel, BaseLoadingCover, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BasePagination, BasePanel, BasePassword, BaseProcessRing, BaseReadMore, BaseSelect, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseSwitch, BaseSystemAlert, BaseTextarea, BaseTextareaAutoresize, BaseCharacterCounter, BaseTabs, BaseTabItem, BaseTable, BaseTableColumn, };
|
|
@@ -30,6 +30,7 @@ declare const messages: {
|
|
|
30
30
|
month: string;
|
|
31
31
|
next: string;
|
|
32
32
|
next_month: string;
|
|
33
|
+
none: string;
|
|
33
34
|
nothing_found: string;
|
|
34
35
|
or: string;
|
|
35
36
|
pagination_detail: string;
|
|
@@ -87,6 +88,7 @@ declare const messages: {
|
|
|
87
88
|
month: string;
|
|
88
89
|
next: string;
|
|
89
90
|
next_month: string;
|
|
91
|
+
none: string;
|
|
90
92
|
nothing_found: string;
|
|
91
93
|
or: string;
|
|
92
94
|
pagination_detail: string;
|
|
@@ -155,6 +157,7 @@ declare const config: {
|
|
|
155
157
|
month: string;
|
|
156
158
|
next: string;
|
|
157
159
|
next_month: string;
|
|
160
|
+
none: string;
|
|
158
161
|
nothing_found: string;
|
|
159
162
|
or: string;
|
|
160
163
|
pagination_detail: string;
|
|
@@ -212,6 +215,7 @@ declare const config: {
|
|
|
212
215
|
month: string;
|
|
213
216
|
next: string;
|
|
214
217
|
next_month: string;
|
|
218
|
+
none: string;
|
|
215
219
|
nothing_found: string;
|
|
216
220
|
or: string;
|
|
217
221
|
pagination_detail: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import BaseCharacterCounter from './BaseCharacterCounter.vue';
|
|
2
|
+
import BaseInput from './BaseInput.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/BaseCharacterCounter',
|
|
6
|
+
component: BaseCharacterCounter,
|
|
7
|
+
args: {
|
|
8
|
+
text: 'Test',
|
|
9
|
+
max: 100,
|
|
10
|
+
min: 10,
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = (args) => ({
|
|
15
|
+
components: {
|
|
16
|
+
BaseCharacterCounter,
|
|
17
|
+
BaseInput,
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
const text = ref('bla bla');
|
|
21
|
+
return { args, text };
|
|
22
|
+
},
|
|
23
|
+
template: `
|
|
24
|
+
<BaseInput v-model="text" name="test" class="w-full mb-1"></BaseInput>
|
|
25
|
+
<BaseCharacterCounter v-bind="args" :text="text" class="text-xs text-slate-500"></BaseCharacterCounter>
|
|
26
|
+
`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Demo = Template.bind({});
|
|
30
|
+
Demo.args = {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div
|
|
4
|
+
v-if="max && (!min || length >= min)"
|
|
5
|
+
:class="{
|
|
6
|
+
'text-red-600': length > max,
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
{{ length }}/{{ max }}
|
|
10
|
+
</div>
|
|
11
|
+
<div v-else-if="min && length < min" class="text-red-600">
|
|
12
|
+
{{ $t('sui.min_x_characters', { x: min }) }} ({{ length }}/{{ min }})
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { trim } from 'lodash';
|
|
19
|
+
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
text: {
|
|
22
|
+
required: true,
|
|
23
|
+
type: String,
|
|
24
|
+
},
|
|
25
|
+
min: {
|
|
26
|
+
default: undefined,
|
|
27
|
+
type: Number,
|
|
28
|
+
},
|
|
29
|
+
max: {
|
|
30
|
+
default: undefined,
|
|
31
|
+
type: Number,
|
|
32
|
+
},
|
|
33
|
+
trim: {
|
|
34
|
+
default: true,
|
|
35
|
+
type: Boolean,
|
|
36
|
+
},
|
|
37
|
+
removeDoubleSpaces: {
|
|
38
|
+
default: true,
|
|
39
|
+
type: Boolean,
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const trimmedText = computed(() => {
|
|
44
|
+
let text = props.text;
|
|
45
|
+
|
|
46
|
+
if (props.trim) {
|
|
47
|
+
text = trim(props.text);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (props.removeDoubleSpaces) {
|
|
51
|
+
text = text.replace(/ +(?= )/g, '');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return text;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const length = computed(() => {
|
|
58
|
+
return trimmedText.value.length;
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
@@ -60,9 +60,9 @@ const template = `
|
|
|
60
60
|
<BaseSelect
|
|
61
61
|
:model-value="query.type ?? null"
|
|
62
62
|
class="w-full rounded border-slate-300"
|
|
63
|
+
placeholder="-"
|
|
63
64
|
@update:model-value="updateQueryValue('type', $event)"
|
|
64
65
|
>
|
|
65
|
-
<option value="">-</option>
|
|
66
66
|
<option value="video">
|
|
67
67
|
Video
|
|
68
68
|
</option>
|
|
@@ -78,9 +78,9 @@ const template = `
|
|
|
78
78
|
<BaseSelect
|
|
79
79
|
:model-value="query.access_level ?? null"
|
|
80
80
|
class="w-full rounded border-slate-300"
|
|
81
|
+
placeholder="-"
|
|
81
82
|
@update:model-value="updateQueryValue('access_level', $event)"
|
|
82
83
|
>
|
|
83
|
-
<option value="">-</option>
|
|
84
84
|
<option value="public">
|
|
85
85
|
Public
|
|
86
86
|
</option>
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
:class="{ 'col-span-1': !mobileLayout, 'col-span-2': mobileLayout }"
|
|
12
12
|
>
|
|
13
13
|
<!-- Header -->
|
|
14
|
-
<div class="mb-4
|
|
14
|
+
<div class="flex mb-4 space-x-2 empty:mb-0">
|
|
15
15
|
<!-- Search bar -->
|
|
16
16
|
<div v-if="searchable" class="grow">
|
|
17
17
|
<div class="relative h-11">
|
|
18
18
|
<div
|
|
19
|
-
class="pointer-events-none absolute top-0 left-0
|
|
19
|
+
class="flex pointer-events-none absolute top-0 left-0 h-full items-center justify-center pl-2.5"
|
|
20
20
|
>
|
|
21
21
|
<BaseIcon
|
|
22
22
|
class="h-6 w-6 text-slate-400"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
/>
|
|
34
34
|
<div
|
|
35
35
|
v-if="searchQuery"
|
|
36
|
-
class="absolute top-0 right-0
|
|
36
|
+
class="flex absolute top-0 right-0 h-full items-center justify-center p-1"
|
|
37
37
|
>
|
|
38
38
|
<button
|
|
39
39
|
type="button"
|
|
@@ -55,15 +55,15 @@
|
|
|
55
55
|
<!-- Filters (mobile) -->
|
|
56
56
|
<button
|
|
57
57
|
v-if="mobileLayout && hasFilters"
|
|
58
|
-
class="btn
|
|
58
|
+
class="flex btn h-11 items-center justify-center py-1 text-base shadow-sm"
|
|
59
59
|
type="button"
|
|
60
60
|
@click="showFilters = true"
|
|
61
61
|
>
|
|
62
62
|
<BaseIcon
|
|
63
|
-
class="
|
|
63
|
+
class="h-6 w-6 text-slate-500 xs:mr-2"
|
|
64
64
|
icon="heroicons:adjustments-horizontal-solid"
|
|
65
65
|
/>
|
|
66
|
-
<span>{{ $t('sui.filters') }}</span>
|
|
66
|
+
<span class="hidden xs:block">{{ $t('sui.filters') }}</span>
|
|
67
67
|
</button>
|
|
68
68
|
|
|
69
69
|
<!-- Menu -->
|
|
@@ -99,38 +99,32 @@
|
|
|
99
99
|
|
|
100
100
|
<!-- Pagination -->
|
|
101
101
|
|
|
102
|
+
<div class="mt-5">
|
|
103
|
+
<p class="text-center text-xs text-slate-400 sm:text-right">
|
|
104
|
+
{{
|
|
105
|
+
(paginationMetadata.current_page - 1) *
|
|
106
|
+
paginationMetadata.per_page +
|
|
107
|
+
1
|
|
108
|
+
}}
|
|
109
|
+
-
|
|
110
|
+
{{
|
|
111
|
+
$t('sui.pagination_detail', {
|
|
112
|
+
page: Math.min(
|
|
113
|
+
paginationMetadata.current_page * paginationMetadata.per_page,
|
|
114
|
+
paginationMetadata.total
|
|
115
|
+
),
|
|
116
|
+
total: paginationMetadata.total,
|
|
117
|
+
})
|
|
118
|
+
}}
|
|
119
|
+
</p>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
102
122
|
<div class="mt-4">
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
:model-value="page"
|
|
109
|
-
:last-page="lastPage"
|
|
110
|
-
@model-value:update="onPageChange"
|
|
111
|
-
/>
|
|
112
|
-
<div>
|
|
113
|
-
<p class="text-sm text-slate-600">
|
|
114
|
-
{{
|
|
115
|
-
(paginationMetadata.current_page - 1) *
|
|
116
|
-
paginationMetadata.per_page +
|
|
117
|
-
1
|
|
118
|
-
}}
|
|
119
|
-
-
|
|
120
|
-
{{
|
|
121
|
-
$t('sui.pagination_detail', {
|
|
122
|
-
page: Math.min(
|
|
123
|
-
paginationMetadata.current_page *
|
|
124
|
-
paginationMetadata.per_page,
|
|
125
|
-
paginationMetadata.total
|
|
126
|
-
),
|
|
127
|
-
total: paginationMetadata.total,
|
|
128
|
-
})
|
|
129
|
-
}}
|
|
130
|
-
</p>
|
|
131
|
-
</div>
|
|
132
|
-
</div>
|
|
133
|
-
</div>
|
|
123
|
+
<BasePagination
|
|
124
|
+
:model-value="page"
|
|
125
|
+
:last-page="lastPage"
|
|
126
|
+
@update:model-value="onPageChange"
|
|
127
|
+
/>
|
|
134
128
|
</div>
|
|
135
129
|
</div>
|
|
136
130
|
|
|
@@ -216,7 +210,7 @@ import {
|
|
|
216
210
|
import BaseMenu from './BaseMenu.vue';
|
|
217
211
|
import BaseCard from './BaseCard.vue';
|
|
218
212
|
import BaseCardRow from './BaseCardRow.vue';
|
|
219
|
-
import
|
|
213
|
+
import BasePagination from './BasePagination.vue';
|
|
220
214
|
import BaseModalSide from './BaseModalSide.vue';
|
|
221
215
|
import { config } from '@/index';
|
|
222
216
|
import { useMutationObserver, useResizeObserver } from '@vueuse/core';
|
|
@@ -87,9 +87,9 @@ const template = `
|
|
|
87
87
|
<BaseSelect
|
|
88
88
|
:model-value="query.type ?? null"
|
|
89
89
|
class="w-full rounded border-slate-300"
|
|
90
|
+
placeholder="-"
|
|
90
91
|
@update:model-value="updateQueryValue('type', $event)"
|
|
91
92
|
>
|
|
92
|
-
<option value="">-</option>
|
|
93
93
|
<option value="video">
|
|
94
94
|
Video
|
|
95
95
|
</option>
|
|
@@ -105,9 +105,9 @@ const template = `
|
|
|
105
105
|
<BaseSelect
|
|
106
106
|
:model-value="query.access_level ?? null"
|
|
107
107
|
class="w-full rounded border-slate-300"
|
|
108
|
+
placeholder="-"
|
|
108
109
|
@update:model-value="updateQueryValue('access_level', $event)"
|
|
109
110
|
>
|
|
110
|
-
<option value="">-</option>
|
|
111
111
|
<option value="public">
|
|
112
112
|
Public
|
|
113
113
|
</option>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import BaseInput from './BaseInput.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form/BaseInput',
|
|
5
|
+
component: BaseInput,
|
|
6
|
+
args: {
|
|
7
|
+
required: true,
|
|
8
|
+
type: 'text',
|
|
9
|
+
name: 'name',
|
|
10
|
+
class: 'w-full',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = (args) => ({
|
|
15
|
+
components: {
|
|
16
|
+
BaseInput,
|
|
17
|
+
},
|
|
18
|
+
setup() {
|
|
19
|
+
const value = ref('');
|
|
20
|
+
return { args, value };
|
|
21
|
+
},
|
|
22
|
+
template: `
|
|
23
|
+
<form @submit.prevent="" class="border-none">
|
|
24
|
+
<BaseInput v-model="value" v-bind="args"></BaseInput>
|
|
25
|
+
</form>
|
|
26
|
+
`,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const Demo = Template.bind({});
|
|
30
|
+
Demo.args = {
|
|
31
|
+
placeholder: 'Enter your name',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const Number = Template.bind({});
|
|
35
|
+
Number.args = {
|
|
36
|
+
type: 'number',
|
|
37
|
+
step: 0.1,
|
|
38
|
+
placeholder: 'Enter a number',
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const Disabled = Template.bind({});
|
|
42
|
+
Disabled.args = {
|
|
43
|
+
modelValue: 'Disabled input!',
|
|
44
|
+
disabled: true,
|
|
45
|
+
placeholder: 'Enter your name',
|
|
46
|
+
};
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
:value="modelValue"
|
|
5
5
|
:type="type"
|
|
6
6
|
:name="name"
|
|
7
|
+
:step="step"
|
|
7
8
|
:disabled="disabled"
|
|
8
9
|
:placeholder="placeholder"
|
|
9
10
|
:required="required"
|
|
10
|
-
class="rounded"
|
|
11
|
+
class="rounded border-slate-300 disabled:cursor-not-allowed disabled:text-slate-300"
|
|
11
12
|
:autocomplete="autocomplete ? 'on' : 'off'"
|
|
12
13
|
@keydown.enter="onEnter"
|
|
13
14
|
@input="$emit('update:modelValue', transformInputValue($event))"
|
|
@@ -20,17 +21,24 @@ import { PropType } from 'vue';
|
|
|
20
21
|
|
|
21
22
|
const props = defineProps({
|
|
22
23
|
modelValue: {
|
|
23
|
-
|
|
24
|
+
default: '',
|
|
24
25
|
type: [String, Number, null] as PropType<string | number | null>,
|
|
25
26
|
},
|
|
26
27
|
type: {
|
|
27
28
|
type: String,
|
|
28
29
|
default: 'text',
|
|
29
30
|
},
|
|
31
|
+
step: {
|
|
32
|
+
default: undefined,
|
|
33
|
+
type: Number,
|
|
34
|
+
},
|
|
30
35
|
autocomplete: {
|
|
31
36
|
default: true,
|
|
32
37
|
type: Boolean,
|
|
33
38
|
},
|
|
39
|
+
/**
|
|
40
|
+
* Prevents submit when pressing 'Enter' while the input is focused.
|
|
41
|
+
*/
|
|
34
42
|
preventSubmit: {
|
|
35
43
|
default: false,
|
|
36
44
|
type: Boolean,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import BaseInputLabel from './BaseInputLabel.vue';
|
|
2
|
+
import BaseInput from './BaseInput.vue';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Form/BaseInputLabel',
|
|
6
|
+
component: BaseInputLabel,
|
|
7
|
+
args: {
|
|
8
|
+
required: true,
|
|
9
|
+
label: 'First Name',
|
|
10
|
+
class: 'text-slate-600 block text-sm',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Template = (args) => ({
|
|
15
|
+
components: {
|
|
16
|
+
BaseInputLabel,
|
|
17
|
+
BaseInput,
|
|
18
|
+
},
|
|
19
|
+
setup() {
|
|
20
|
+
return { args };
|
|
21
|
+
},
|
|
22
|
+
template: `
|
|
23
|
+
<form @submit.prevent="">
|
|
24
|
+
<BaseInputLabel v-bind="args"></BaseInputLabel>
|
|
25
|
+
<BaseInput required name="name" placeholder="Enter your first name"></BaseInput>
|
|
26
|
+
</form>
|
|
27
|
+
`,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export const Demo = Template.bind({});
|
|
31
|
+
Demo.args = {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/BaseLoadingCover',
|
|
5
|
+
component: BaseLoadingCover,
|
|
6
|
+
args: {
|
|
7
|
+
delay: 0,
|
|
8
|
+
modelValue: true,
|
|
9
|
+
size: 'sm',
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
size: {
|
|
13
|
+
control: { type: 'select' },
|
|
14
|
+
options: ['sm', 'lg'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const Template = (args) => ({
|
|
20
|
+
components: {
|
|
21
|
+
BaseLoadingCover,
|
|
22
|
+
},
|
|
23
|
+
setup() {
|
|
24
|
+
return { args };
|
|
25
|
+
},
|
|
26
|
+
template: `
|
|
27
|
+
<div class="relative bg-slate-100 p-6 py-10">
|
|
28
|
+
<p class="text-center text-slate-700">Non dolor consectetur et occaecat.</p>
|
|
29
|
+
<BaseLoadingCover v-bind="args" />
|
|
30
|
+
</div>
|
|
31
|
+
`,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const Demo = Template.bind({});
|
|
35
|
+
Demo.args = {};
|
|
36
|
+
|
|
37
|
+
export const SmallSpinner = Template.bind({});
|
|
38
|
+
SmallSpinner.args = {
|
|
39
|
+
size: 'sm',
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const LargeSpinner = Template.bind({});
|
|
43
|
+
LargeSpinner.args = {
|
|
44
|
+
size: 'lg',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const SpinnerCustomClass = Template.bind({});
|
|
48
|
+
SpinnerCustomClass.args = {
|
|
49
|
+
iconClass: 'text-red-500 w-10 h-10',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const BackdropCustomClass = Template.bind({});
|
|
53
|
+
BackdropCustomClass.args = {
|
|
54
|
+
backdropClass: 'bg-slate-100 opacity-50',
|
|
55
|
+
};
|
|
@@ -25,28 +25,46 @@ import BaseSpinnerSmall from '../svg/BaseSpinnerSmall.vue';
|
|
|
25
25
|
import BaseSpinnerLarge from '../svg/BaseSpinnerLarge.vue';
|
|
26
26
|
|
|
27
27
|
const props = defineProps({
|
|
28
|
+
/**
|
|
29
|
+
* Show/Hide the loading cover
|
|
30
|
+
*/
|
|
28
31
|
modelValue: {
|
|
29
32
|
default: true,
|
|
30
33
|
type: Boolean,
|
|
31
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* Classes added to the backdrop
|
|
37
|
+
*/
|
|
32
38
|
backdropClass: {
|
|
33
39
|
default: 'bg-white',
|
|
34
40
|
type: String,
|
|
35
41
|
},
|
|
42
|
+
/**
|
|
43
|
+
* Classes added to the spinner icon
|
|
44
|
+
*/
|
|
36
45
|
iconClass: {
|
|
37
46
|
default: 'text-blue-500 w-10 h-10',
|
|
38
47
|
type: String,
|
|
39
48
|
},
|
|
49
|
+
/**
|
|
50
|
+
* Change the type of spinner. 'sm' for a small spinner. 'lg' for a large spinner.
|
|
51
|
+
*/
|
|
40
52
|
size: {
|
|
41
53
|
default: 'sm',
|
|
42
54
|
type: String as PropType<'sm' | 'lg'>,
|
|
43
55
|
},
|
|
56
|
+
/**
|
|
57
|
+
* Transition duration class.
|
|
58
|
+
*/
|
|
44
59
|
duration: {
|
|
45
60
|
default: 'duration-300',
|
|
46
61
|
type: String,
|
|
47
62
|
},
|
|
63
|
+
/**
|
|
64
|
+
* Delay before showing the loading cover. This delay is used to avoid unnecessary showing the spinner for a fraction of second when the loading time is too short.
|
|
65
|
+
*/
|
|
48
66
|
delay: {
|
|
49
|
-
default:
|
|
67
|
+
default: 0,
|
|
50
68
|
type: Number,
|
|
51
69
|
},
|
|
52
70
|
});
|