sprintify-ui 0.0.10 → 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 +5174 -6624
- package/dist/style.css +1 -1
- package/dist/tailwindcss/index.js +23 -0
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +0 -1
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +0 -1
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +13 -3
- package/dist/types/src/components/BaseCharacterCounter.vue.d.ts +143 -0
- package/dist/types/src/components/BaseDataTable.vue.d.ts +95 -64
- package/dist/types/src/components/BaseDialog.vue.d.ts +8 -8
- package/dist/types/src/components/BaseFilePicker.vue.d.ts +3 -3
- package/dist/types/src/components/BaseInput.vue.d.ts +39 -5
- package/dist/types/src/components/BaseLoadingCover.vue.d.ts +84 -12
- package/dist/types/src/components/BaseMenuItem.vue.d.ts +4 -4
- 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/BaseNavbarItemContent.vue.d.ts +4 -4
- 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/BaseTableColumn.vue.d.ts +4 -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/dist/types/src/svg/BaseEmptyState.vue.d.ts +2 -0
- package/dist/types/src/{components/BaseSpinner.vue.d.ts → svg/BaseSpinnerLarge.vue.d.ts} +0 -0
- package/dist/types/src/svg/BaseSpinnerSmall.vue.d.ts +44 -0
- package/dist/types/src/types/types.d.ts +1 -1
- package/package.json +4 -2
- package/src/components/BaseAutocomplete.stories.js +7 -4
- package/src/components/BaseAutocomplete.vue +44 -15
- package/src/components/BaseAutocompleteFetch.stories.js +6 -3
- package/src/components/BaseAutocompleteFetch.vue +8 -3
- package/src/components/BaseBelongsTo.stories.js +9 -4
- package/src/components/BaseBelongsTo.vue +1 -0
- package/src/components/BaseCard.vue +1 -1
- package/src/components/BaseCharacterCounter.stories.js +30 -0
- package/src/components/BaseCharacterCounter.vue +60 -0
- package/src/components/BaseDataIterator.stories.js +102 -3
- package/src/components/BaseDataIterator.vue +75 -49
- package/src/components/BaseDataTable.stories.js +149 -2
- package/src/components/BaseDataTable.vue +34 -28
- package/src/components/BaseDataTableToggleColumns.vue +1 -1
- package/src/components/BaseDateSelect.vue +6 -2
- package/src/components/BaseDescriptionListItem.vue +40 -4
- package/src/components/BaseDialog.stories.js +51 -0
- package/src/components/BaseDialog.vue +13 -7
- package/src/components/BaseFilePicker.stories.js +51 -0
- package/src/components/BaseFilePicker.vue +6 -6
- package/src/components/BaseFileUploader.stories.js +80 -0
- package/src/components/BaseFileUploader.vue +16 -3
- 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 +27 -17
- 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/BaseTable.vue +42 -29
- package/src/components/BaseTableColumn.vue +2 -2
- 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/src/svg/BaseEmptyState.vue +34 -0
- package/src/{components/BaseSpinner.vue → svg/BaseSpinnerLarge.vue} +0 -0
- package/src/svg/BaseSpinnerSmall.vue +9 -0
- package/src/types/types.ts +1 -1
- package/dist/types/src/components/BaseWordCount.vue.d.ts +0 -31
- package/src/components/BaseWordCount.vue +0 -36
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<div class="flex flex-col">
|
|
8
8
|
<div
|
|
9
|
-
class="
|
|
9
|
+
class="overflow-x-auto overflow-y-auto"
|
|
10
10
|
:style="{ maxHeight: maxHeight ? maxHeight + 'px' : undefined }"
|
|
11
11
|
>
|
|
12
12
|
<div class="inline-block min-w-full align-middle">
|
|
@@ -17,17 +17,19 @@
|
|
|
17
17
|
<th v-if="showDetailRowIcon" class="th" />
|
|
18
18
|
<th
|
|
19
19
|
v-if="checkable && checkboxPosition === 'left'"
|
|
20
|
-
class="th pl-3"
|
|
20
|
+
class="th py-0 pl-3"
|
|
21
21
|
align="left"
|
|
22
22
|
>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<div class="flex items-center">
|
|
24
|
+
<input
|
|
25
|
+
type="checkbox"
|
|
26
|
+
autocomplete="off"
|
|
27
|
+
:checked="isAllChecked"
|
|
28
|
+
:disabled="isAllUncheckable"
|
|
29
|
+
:class="checkboxStyle"
|
|
30
|
+
@change="checkAll"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
31
33
|
</th>
|
|
32
34
|
<th
|
|
33
35
|
v-for="(column, index) in visibleColumns"
|
|
@@ -166,14 +168,16 @@
|
|
|
166
168
|
class="pl-3"
|
|
167
169
|
:class="borderBottomClasses(index, row)"
|
|
168
170
|
>
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
<div class="flex items-center">
|
|
172
|
+
<input
|
|
173
|
+
type="checkbox"
|
|
174
|
+
autocomplete="off"
|
|
175
|
+
:disabled="!isRowCheckable(row)"
|
|
176
|
+
:checked="isRowChecked(row)"
|
|
177
|
+
:class="checkboxStyle"
|
|
178
|
+
@click="checkRow(row, index, $event as MouseEvent)"
|
|
179
|
+
/>
|
|
180
|
+
</div>
|
|
177
181
|
</td>
|
|
178
182
|
|
|
179
183
|
<SlotComponent
|
|
@@ -239,12 +243,25 @@
|
|
|
239
243
|
</table>
|
|
240
244
|
|
|
241
245
|
<slot name="loading">
|
|
242
|
-
<
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
<Transition
|
|
247
|
+
enter-active-class="transition ease-out duration-200"
|
|
248
|
+
enter-from-class="opacity-0"
|
|
249
|
+
enter-to-class="opacity-100"
|
|
250
|
+
leave-active-class="transition ease-in duration-200"
|
|
251
|
+
leave-from-class="opacity-100"
|
|
252
|
+
leave-to-class="opacity-0"
|
|
253
|
+
>
|
|
254
|
+
<div
|
|
255
|
+
v-if="loading"
|
|
256
|
+
class="absolute inset-0 flex h-full w-full items-start justify-center"
|
|
257
|
+
>
|
|
258
|
+
<div class="absolute h-full w-full bg-white bg-opacity-60" />
|
|
259
|
+
|
|
260
|
+
<div class="pt-20">
|
|
261
|
+
<BaseSpinnerLarge class="h-10 w-10 text-blue-500" />
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
</Transition>
|
|
248
265
|
</slot>
|
|
249
266
|
</div>
|
|
250
267
|
</div>
|
|
@@ -266,8 +283,8 @@ import { BaseTableColumn, MenuItemInterface, Row } from '@/types/types';
|
|
|
266
283
|
import SlotComponent from './SlotComponent';
|
|
267
284
|
import { useResizeObserver } from '@vueuse/core';
|
|
268
285
|
import { debounce, isArray } from 'lodash';
|
|
269
|
-
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
270
286
|
import BaseMenu from './BaseMenu.vue';
|
|
287
|
+
import BaseSpinnerLarge from '../svg/BaseSpinnerLarge.vue';
|
|
271
288
|
|
|
272
289
|
const checkboxStyle =
|
|
273
290
|
'disabled:bg-slate-100 disabled:border-slate-300 disabled:cursor-not-allowed border-slate-400 rounded';
|
|
@@ -406,10 +423,6 @@ const visibleColumns = computed(() => {
|
|
|
406
423
|
return false;
|
|
407
424
|
}
|
|
408
425
|
|
|
409
|
-
if (column.alwaysVisible) {
|
|
410
|
-
return true;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
426
|
if (!isArray(props.visibleColumns)) {
|
|
414
427
|
return true;
|
|
415
428
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import BaseTabs from './BaseTabs.vue';
|
|
2
|
+
import BaseTabItem from './BaseTabItem.vue';
|
|
3
|
+
import BaseContainer from './BaseContainer.vue';
|
|
4
|
+
import BaseCard from './BaseCard.vue';
|
|
5
|
+
import BaseCardRow from './BaseCardRow.vue';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Layout/BaseTabs',
|
|
9
|
+
component: BaseTabs,
|
|
10
|
+
args: {},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => ({
|
|
14
|
+
components: {
|
|
15
|
+
BaseTabs,
|
|
16
|
+
BaseTabItem,
|
|
17
|
+
BaseContainer,
|
|
18
|
+
BaseCard,
|
|
19
|
+
BaseCardRow,
|
|
20
|
+
},
|
|
21
|
+
setup() {
|
|
22
|
+
return { args };
|
|
23
|
+
},
|
|
24
|
+
template: `
|
|
25
|
+
<div class="bg-slate-100 py-10">
|
|
26
|
+
<BaseContainer>
|
|
27
|
+
<BaseTabs v-bind="args">
|
|
28
|
+
<BaseTabItem to="/">
|
|
29
|
+
Home
|
|
30
|
+
</BaseTabItem>
|
|
31
|
+
<BaseTabItem to="/setup">
|
|
32
|
+
Setup
|
|
33
|
+
</BaseTabItem>
|
|
34
|
+
<BaseTabItem to="/settings">
|
|
35
|
+
Settings
|
|
36
|
+
</BaseTabItem>
|
|
37
|
+
<BaseTabItem to="/misc">
|
|
38
|
+
Miscellaneous
|
|
39
|
+
</BaseTabItem>
|
|
40
|
+
</BaseTabs>
|
|
41
|
+
<div class="mt-10">
|
|
42
|
+
<BaseCard>
|
|
43
|
+
<BaseCardRow>
|
|
44
|
+
{{ $route.path }}
|
|
45
|
+
</BaseCardRow>
|
|
46
|
+
</BaseCard>
|
|
47
|
+
</div>
|
|
48
|
+
</BaseContainer>
|
|
49
|
+
</div>
|
|
50
|
+
`,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const Demo = Template.bind({});
|
|
54
|
+
Demo.args = {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative">
|
|
3
|
-
<div class="absolute bottom-0 left-0 h-
|
|
4
|
-
<div class="overflow-x-auto overflow-y-hidden">
|
|
5
|
-
<ul class="flex space-x-
|
|
3
|
+
<div class="absolute bottom-0 left-0 h-px w-full bg-slate-300" />
|
|
4
|
+
<div class="relative overflow-x-auto overflow-y-hidden">
|
|
5
|
+
<ul class="flex space-x-4 text-center">
|
|
6
6
|
<slot />
|
|
7
7
|
</ul>
|
|
8
8
|
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import BaseTextarea from './BaseTextarea.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form/BaseTextarea',
|
|
5
|
+
component: BaseTextarea,
|
|
6
|
+
args: {
|
|
7
|
+
name: 'bio',
|
|
8
|
+
required: true,
|
|
9
|
+
placeholder: 'Describe your complete life in 4 sentences...',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Template = (args) => ({
|
|
14
|
+
components: {
|
|
15
|
+
BaseTextarea,
|
|
16
|
+
},
|
|
17
|
+
setup() {
|
|
18
|
+
const value = ref('');
|
|
19
|
+
return { args, value };
|
|
20
|
+
},
|
|
21
|
+
template: `
|
|
22
|
+
<form @submit.prevent="" class="border-none">
|
|
23
|
+
<BaseTextarea v-model="value" v-bind="args" class="w-full"></BaseTextarea>
|
|
24
|
+
</form>
|
|
25
|
+
`,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const Demo = Template.bind({});
|
|
29
|
+
Demo.args = {};
|
|
30
|
+
|
|
31
|
+
export const Disabled = Template.bind({});
|
|
32
|
+
Disabled.args = {
|
|
33
|
+
modelValue: 'Lorem ipsum...',
|
|
34
|
+
disabled: true,
|
|
35
|
+
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:disabled="disabled"
|
|
8
8
|
:required="required"
|
|
9
9
|
:rows="rows"
|
|
10
|
-
class="mb-0 block rounded"
|
|
10
|
+
class="mb-0 block rounded border-slate-300 disabled:cursor-not-allowed disabled:text-slate-300"
|
|
11
11
|
@input="$emit('update:modelValue', transformInputValue($event))"
|
|
12
12
|
/>
|
|
13
13
|
</template>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import BaseTextareaAutoresize from './BaseTextareaAutoresize.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form/BaseTextareaAutoresize',
|
|
5
|
+
component: BaseTextareaAutoresize,
|
|
6
|
+
args: {
|
|
7
|
+
name: 'bio',
|
|
8
|
+
placeholder: 'Describe your complete life in 4 sentences...',
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Template = (args) => ({
|
|
13
|
+
components: {
|
|
14
|
+
BaseTextareaAutoresize,
|
|
15
|
+
},
|
|
16
|
+
setup() {
|
|
17
|
+
function onSubmit() {
|
|
18
|
+
alert('submit');
|
|
19
|
+
}
|
|
20
|
+
const value = ref('');
|
|
21
|
+
return { args, value, onSubmit };
|
|
22
|
+
},
|
|
23
|
+
template: `
|
|
24
|
+
<form @submit.prevent="onSubmit" class="border-none">
|
|
25
|
+
<BaseTextareaAutoresize
|
|
26
|
+
v-model="value"
|
|
27
|
+
v-bind="args"
|
|
28
|
+
class="w-full"
|
|
29
|
+
@submit="onSubmit"
|
|
30
|
+
></BaseTextareaAutoresize>
|
|
31
|
+
</form>
|
|
32
|
+
|
|
33
|
+
<pre class="mt-4 bg-slate-800 font-light text-xs p-3 rounded whitespace-pre-wrap text-white">{{ {value} }}</pre>
|
|
34
|
+
`,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const Demo = Template.bind({});
|
|
38
|
+
Demo.args = {};
|
|
39
|
+
|
|
40
|
+
export const SubmitOnEnter = Template.bind({});
|
|
41
|
+
SubmitOnEnter.args = {
|
|
42
|
+
submitOnEnter: true,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Disabled = Template.bind({});
|
|
46
|
+
Disabled.args = {
|
|
47
|
+
modelValue: 'Lorem ipsum...',
|
|
48
|
+
disabled: true,
|
|
49
|
+
};
|
|
@@ -1,117 +1,113 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
ref="wrapper"
|
|
4
|
+
class="wrapper grid"
|
|
5
|
+
:style="{ maxHeight: maxHeight + 'px' }"
|
|
6
|
+
>
|
|
3
7
|
<textarea
|
|
4
8
|
:value="modelValue"
|
|
5
9
|
:name="name"
|
|
6
10
|
:placeholder="placeholder"
|
|
11
|
+
:disabled="disabled"
|
|
12
|
+
class="resize-none"
|
|
13
|
+
:class="BASE_TEXTAREA_CLASSES"
|
|
14
|
+
:style="{ maxHeight: maxHeight + 'px', gridArea: BASE_GRID_AREA }"
|
|
7
15
|
rows="1"
|
|
8
|
-
class="focus:outline-none focus:ring-0"
|
|
9
16
|
@input="onInput"
|
|
10
17
|
@keyup="onKeyUp"
|
|
11
18
|
@keydown="onKeyDown"
|
|
12
19
|
@focus="onFocus"
|
|
13
20
|
/>
|
|
21
|
+
<div
|
|
22
|
+
class="invisible whitespace-pre-wrap"
|
|
23
|
+
:class="BASE_TEXTAREA_CLASSES"
|
|
24
|
+
:style="{
|
|
25
|
+
content: DIV_CONTENT,
|
|
26
|
+
maxHeight: maxHeight + 'px',
|
|
27
|
+
gridArea: BASE_GRID_AREA,
|
|
28
|
+
}"
|
|
29
|
+
>
|
|
30
|
+
{{ modelValue }} {{ ' ' }}
|
|
31
|
+
</div>
|
|
14
32
|
</div>
|
|
15
33
|
</template>
|
|
16
34
|
|
|
17
|
-
<script lang="ts">
|
|
18
|
-
|
|
19
|
-
import { defineComponent, inject } from 'vue';
|
|
35
|
+
<script lang="ts" setup>
|
|
36
|
+
import { Ref } from 'vue';
|
|
20
37
|
|
|
21
|
-
const
|
|
38
|
+
const BASE_TEXTAREA_CLASSES =
|
|
39
|
+
'py-2 px-3 font-normal text-base disabled:cursor-not-allowed disabled:text-slate-300 font-sans rounded leading-normal tracking-normal border border-slate-300';
|
|
40
|
+
|
|
41
|
+
const BASE_GRID_AREA = '1 / 1 / 2 / 2';
|
|
22
42
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
default: '',
|
|
31
|
-
type: String,
|
|
32
|
-
},
|
|
33
|
-
name: {
|
|
34
|
-
required: true,
|
|
35
|
-
type: String,
|
|
36
|
-
},
|
|
43
|
+
/* Note the weird space! Needed to prevent jumpy behavior */
|
|
44
|
+
const DIV_CONTENT = "attr(data-replicated-value) ' '";
|
|
45
|
+
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
modelValue: {
|
|
48
|
+
default: '',
|
|
49
|
+
type: String,
|
|
37
50
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
mobile,
|
|
43
|
-
};
|
|
51
|
+
placeholder: {
|
|
52
|
+
default: '',
|
|
53
|
+
type: String,
|
|
44
54
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
55
|
+
name: {
|
|
56
|
+
required: true,
|
|
57
|
+
type: String,
|
|
49
58
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (keys['Enter'] && !keys['Shift'] && !this.mobile) {
|
|
66
|
-
this.$emit('submit');
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
onKeyUp(event: any) {
|
|
71
|
-
delete keys[event.key];
|
|
72
|
-
},
|
|
73
|
-
onFocus(event: any) {
|
|
74
|
-
this.$emit('focus', event);
|
|
75
|
-
},
|
|
59
|
+
maxHeight: {
|
|
60
|
+
default: 100,
|
|
61
|
+
type: Number,
|
|
62
|
+
},
|
|
63
|
+
/**
|
|
64
|
+
* Setting this to true will trigger the 'submit' event while pressing Enter.
|
|
65
|
+
* Users will be able to add a line break while pressing Shift + Enter.
|
|
66
|
+
*/
|
|
67
|
+
submitOnEnter: {
|
|
68
|
+
default: false,
|
|
69
|
+
type: Boolean,
|
|
70
|
+
},
|
|
71
|
+
disabled: {
|
|
72
|
+
default: false,
|
|
73
|
+
type: Boolean,
|
|
76
74
|
},
|
|
77
75
|
});
|
|
78
|
-
</script>
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
.wrapper {
|
|
82
|
-
/* easy way to plop the elements on top of each other and have them both sized based on the tallest one's height */
|
|
83
|
-
display: grid;
|
|
84
|
-
}
|
|
85
|
-
.wrapper::after {
|
|
86
|
-
/* Note the weird space! Needed to prevent jumpy behavior */
|
|
87
|
-
content: attr(data-replicated-value) ' ';
|
|
77
|
+
const emit = defineEmits(['update:modelValue', 'submit', 'focus', 'input']);
|
|
88
78
|
|
|
89
|
-
|
|
90
|
-
white-space: pre-wrap;
|
|
79
|
+
const wrapper = ref(null) as Ref<null | HTMLDivElement>;
|
|
91
80
|
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
const keys = {} as { [key: string]: boolean };
|
|
82
|
+
|
|
83
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
84
|
+
function onInput(e: any) {
|
|
85
|
+
const value = e.target.value ?? '';
|
|
86
|
+
emit('update:modelValue', value);
|
|
87
|
+
emit('input', e);
|
|
94
88
|
}
|
|
95
|
-
.wrapper > textarea {
|
|
96
|
-
/* You could leave this, but after a user resizes, then it ruins the auto sizing */
|
|
97
|
-
resize: none;
|
|
98
89
|
|
|
99
|
-
|
|
100
|
-
|
|
90
|
+
function onKeyDown(event: KeyboardEvent) {
|
|
91
|
+
keys[event.key] = true;
|
|
92
|
+
|
|
93
|
+
if (keys['Enter'] && !keys['Shift'] && props.submitOnEnter) {
|
|
94
|
+
// If submit triggers alert, Enter wont be delete from keys,
|
|
95
|
+
// manually remove it here
|
|
96
|
+
delete keys['Enter'];
|
|
97
|
+
|
|
98
|
+
// Submit event to listen to
|
|
99
|
+
emit('submit');
|
|
100
|
+
|
|
101
|
+
// Prevent adding an EOL the the textarea
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
}
|
|
101
104
|
}
|
|
102
|
-
.wrapper > textarea,
|
|
103
|
-
.wrapper::after {
|
|
104
|
-
/* Identical styling required!! */
|
|
105
|
-
padding: 0.5rem;
|
|
106
|
-
font: inherit;
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
@apply bg-slate-100;
|
|
112
|
-
@apply rounded-lg;
|
|
106
|
+
function onKeyUp(event: KeyboardEvent) {
|
|
107
|
+
delete keys[event.key];
|
|
108
|
+
}
|
|
113
109
|
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
function onFocus(event: FocusEvent) {
|
|
111
|
+
emit('focus', event);
|
|
116
112
|
}
|
|
117
|
-
</
|
|
113
|
+
</script>
|
package/src/components/index.ts
CHANGED
|
@@ -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
56
|
|
|
@@ -59,9 +82,32 @@ export {
|
|
|
59
82
|
BaseFilePicker,
|
|
60
83
|
BaseFileUploader,
|
|
61
84
|
BaseIcon,
|
|
85
|
+
BaseInput,
|
|
86
|
+
BaseInputLabel,
|
|
62
87
|
BaseLoadingCover,
|
|
63
88
|
BaseMenu,
|
|
64
89
|
BaseMenuItem,
|
|
90
|
+
BaseModalCenter,
|
|
91
|
+
BaseModalSide,
|
|
92
|
+
BaseNavbar,
|
|
93
|
+
BaseNavbarItem,
|
|
94
|
+
BaseNavbarItemContent,
|
|
95
|
+
BasePagination,
|
|
96
|
+
BasePanel,
|
|
97
|
+
BasePassword,
|
|
98
|
+
BaseProcessRing,
|
|
99
|
+
BaseReadMore,
|
|
100
|
+
BaseSelect,
|
|
101
|
+
BaseSideNavigation,
|
|
102
|
+
BaseSideNavigationItem,
|
|
103
|
+
BaseSkeleton,
|
|
104
|
+
BaseSwitch,
|
|
105
|
+
BaseSystemAlert,
|
|
106
|
+
BaseTextarea,
|
|
107
|
+
BaseTextareaAutoresize,
|
|
108
|
+
BaseCharacterCounter,
|
|
109
|
+
BaseTabs,
|
|
110
|
+
BaseTabItem,
|
|
65
111
|
BaseTable,
|
|
66
112
|
BaseTableColumn,
|
|
67
113
|
};
|
package/src/lang/en.json
CHANGED
package/src/lang/fr.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path
|
|
4
|
+
class="text-slate-100"
|
|
5
|
+
d="M75 150C116.421 150 150 116.421 150 75C150 33.5786 116.421 0 75 0C33.5786 0 0 33.5786 0 75C0 116.421 33.5786 150 75 150Z"
|
|
6
|
+
fill="currentColor"
|
|
7
|
+
/>
|
|
8
|
+
<path
|
|
9
|
+
class="text-white"
|
|
10
|
+
d="M120 150H30V53C34.242 52.9952 38.3089 51.308 41.3084 48.3085C44.308 45.3089 45.9952 41.242 46 37H104C103.996 39.1014 104.408 41.1828 105.213 43.1238C106.018 45.0648 107.2 46.8268 108.691 48.308C110.172 49.7991 111.934 50.9816 113.875 51.787C115.817 52.5924 117.898 53.0047 120 53V150Z"
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
class="text-slate-300"
|
|
15
|
+
d="M75 102C88.2548 102 99 91.2548 99 78C99 64.7452 88.2548 54 75 54C61.7452 54 51 64.7452 51 78C51 91.2548 61.7452 102 75 102Z"
|
|
16
|
+
fill="currentColor"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
class="text-white"
|
|
20
|
+
d="M83.4853 89.3138L75 80.8286L66.5147 89.3138L63.6863 86.4854L72.1716 78.0001L63.6863 69.5148L66.5147 66.6864L75 75.1717L83.4853 66.6864L86.3137 69.5148L77.8284 78.0001L86.3137 86.4854L83.4853 89.3138Z"
|
|
21
|
+
fill="currentColor"
|
|
22
|
+
/>
|
|
23
|
+
<path
|
|
24
|
+
class="text-slate-200"
|
|
25
|
+
d="M88 108H62C60.3431 108 59 109.343 59 111C59 112.657 60.3431 114 62 114H88C89.6569 114 91 112.657 91 111C91 109.343 89.6569 108 88 108Z"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
/>
|
|
28
|
+
<path
|
|
29
|
+
class="text-slate-200"
|
|
30
|
+
d="M97 120H53C51.3431 120 50 121.343 50 123C50 124.657 51.3431 126 53 126H97C98.6569 126 100 124.657 100 123C100 121.343 98.6569 120 97 120Z"
|
|
31
|
+
fill="currentColor"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
</template>
|
|
File without changes
|
package/src/types/types.ts
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
text: {
|
|
3
|
-
required: true;
|
|
4
|
-
type: StringConstructor;
|
|
5
|
-
};
|
|
6
|
-
min: {
|
|
7
|
-
default: undefined;
|
|
8
|
-
type: NumberConstructor;
|
|
9
|
-
};
|
|
10
|
-
max: {
|
|
11
|
-
default: undefined;
|
|
12
|
-
type: NumberConstructor;
|
|
13
|
-
};
|
|
14
|
-
}, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
-
text: {
|
|
16
|
-
required: true;
|
|
17
|
-
type: StringConstructor;
|
|
18
|
-
};
|
|
19
|
-
min: {
|
|
20
|
-
default: undefined;
|
|
21
|
-
type: NumberConstructor;
|
|
22
|
-
};
|
|
23
|
-
max: {
|
|
24
|
-
default: undefined;
|
|
25
|
-
type: NumberConstructor;
|
|
26
|
-
};
|
|
27
|
-
}>>, {
|
|
28
|
-
max: number;
|
|
29
|
-
min: number;
|
|
30
|
-
}>;
|
|
31
|
-
export default _default;
|