sprintify-ui 0.0.103 → 0.0.104
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 +8252 -8040
- package/dist/style.css +1 -1
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +23 -3
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +21 -3
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +21 -3
- package/dist/types/src/components/BaseDropdown.vue.d.ts +9 -0
- package/dist/types/src/components/BaseDropdownAutocomplete.vue.d.ts +123 -0
- package/dist/types/src/components/BaseTable.vue.d.ts +2 -2
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/BaseAutocomplete.stories.js +6 -0
- package/src/components/BaseAutocomplete.vue +65 -15
- package/src/components/BaseAutocompleteDropdown.vue +2 -2
- package/src/components/BaseAutocompleteFetch.stories.js +6 -0
- package/src/components/BaseAutocompleteFetch.vue +29 -3
- package/src/components/BaseBelongsTo.stories.js +6 -0
- package/src/components/BaseBelongsTo.vue +12 -2
- package/src/components/BaseButtonGroup.vue +1 -1
- package/src/components/BaseColor.vue +3 -3
- package/src/components/BaseDropdown.stories.js +1 -1
- package/src/components/BaseDropdown.vue +15 -9
- package/src/components/BaseDropdownAutocomplete.stories.js +178 -0
- package/src/components/BaseDropdownAutocomplete.vue +225 -0
- package/src/components/BaseRadioGroup.vue +4 -1
- package/src/components/BaseTable.vue +1 -1
- package/src/components/BaseTagAutocomplete.vue +4 -4
- package/src/components/index.ts +2 -0
- package/src/types/index.ts +1 -1
- package/dist/types/src/components/BaseFormField.d.ts +0 -81
- package/dist/types/src/components/BaseLocaleForm.vue.d.ts +0 -439
- package/dist/types/src/components/BaseNumberForm.vue.d.ts +0 -401
- package/dist/types/src/components/BasePasswordForm.vue.d.ts +0 -384
- package/dist/types/src/components/BaseTextareaForm.vue.d.ts +0 -413
- package/src/components/BaseFormField.ts +0 -117
- package/src/components/BaseLocaleForm.vue +0 -142
- package/src/components/BaseNumberForm.vue +0 -67
- package/src/components/BasePasswordForm.vue +0 -59
- package/src/components/BaseTextareaForm.vue +0 -101
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<BaseInputLabel
|
|
4
|
-
v-if="labelValue"
|
|
5
|
-
:label="labelValue"
|
|
6
|
-
:required="required"
|
|
7
|
-
/>
|
|
8
|
-
<input
|
|
9
|
-
:value="modelValue"
|
|
10
|
-
type="number"
|
|
11
|
-
:name="name"
|
|
12
|
-
:min="min"
|
|
13
|
-
:max="max"
|
|
14
|
-
:step="step"
|
|
15
|
-
:disabled="disabled"
|
|
16
|
-
@input="inputListener(transformInputValue($event))"
|
|
17
|
-
/>
|
|
18
|
-
<BaseInputError v-if="hasError()" class="mt-1">
|
|
19
|
-
{{ errorMessage() }}
|
|
20
|
-
</BaseInputError>
|
|
21
|
-
</div>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script lang="ts">
|
|
25
|
-
import { get, isNumber } from 'lodash';
|
|
26
|
-
import { defineComponent } from 'vue';
|
|
27
|
-
import BaseFormField from './BaseFormField';
|
|
28
|
-
import BaseInputError from './BaseInputError.vue';
|
|
29
|
-
import BaseInputLabel from './BaseInputLabel.vue';
|
|
30
|
-
|
|
31
|
-
export default defineComponent({
|
|
32
|
-
components: { BaseInputLabel, BaseInputError },
|
|
33
|
-
extends: BaseFormField,
|
|
34
|
-
props: {
|
|
35
|
-
modelValue: {
|
|
36
|
-
required: true,
|
|
37
|
-
validator: (value) => {
|
|
38
|
-
return isNumber(value) || value === null;
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
step: {
|
|
42
|
-
default: 1,
|
|
43
|
-
type: Number,
|
|
44
|
-
},
|
|
45
|
-
min: {
|
|
46
|
-
type: Number,
|
|
47
|
-
default: undefined,
|
|
48
|
-
},
|
|
49
|
-
max: {
|
|
50
|
-
type: Number,
|
|
51
|
-
default: undefined,
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
methods: {
|
|
55
|
-
transformInputValue(event: Event | null): number | null {
|
|
56
|
-
if (event === null) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
const value = get(event, 'target.value', null);
|
|
60
|
-
if (!isNumber(value)) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
return value as number;
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
});
|
|
67
|
-
</script>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<BaseInputLabel
|
|
4
|
-
v-if="labelValue"
|
|
5
|
-
:label="labelValue"
|
|
6
|
-
:required="required"
|
|
7
|
-
/>
|
|
8
|
-
|
|
9
|
-
<BasePassword
|
|
10
|
-
ref="input"
|
|
11
|
-
:model-value="modelValue"
|
|
12
|
-
:name="name"
|
|
13
|
-
:disabled="disabled"
|
|
14
|
-
:placeholder="placeholder"
|
|
15
|
-
:required="required"
|
|
16
|
-
class="rounded"
|
|
17
|
-
:class="[
|
|
18
|
-
{
|
|
19
|
-
'border-red-600': hasError(),
|
|
20
|
-
'border-slate-300': !hasError(),
|
|
21
|
-
},
|
|
22
|
-
inputClass,
|
|
23
|
-
]"
|
|
24
|
-
@update:model-value="onInput"
|
|
25
|
-
/>
|
|
26
|
-
|
|
27
|
-
<BaseInputError v-if="hasError()" class="mt-1">
|
|
28
|
-
{{ errorMessage() }}
|
|
29
|
-
</BaseInputError>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script lang="ts">
|
|
34
|
-
import { defineComponent, PropType } from 'vue';
|
|
35
|
-
import BaseFormField from './BaseFormField';
|
|
36
|
-
import BaseInputError from './BaseInputError.vue';
|
|
37
|
-
import BaseInputLabel from './BaseInputLabel.vue';
|
|
38
|
-
import BasePassword from './BasePassword.vue';
|
|
39
|
-
|
|
40
|
-
export default defineComponent({
|
|
41
|
-
components: { BaseInputLabel, BasePassword, BaseInputError },
|
|
42
|
-
extends: BaseFormField,
|
|
43
|
-
props: {
|
|
44
|
-
modelValue: {
|
|
45
|
-
required: true,
|
|
46
|
-
type: [String, null] as PropType<string | null>,
|
|
47
|
-
},
|
|
48
|
-
inputClass: {
|
|
49
|
-
default: undefined,
|
|
50
|
-
type: String,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
methods: {
|
|
54
|
-
onInput(value: string | null) {
|
|
55
|
-
this.inputListener(value);
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
</script>
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<BaseInputLabel
|
|
4
|
-
v-if="labelValue"
|
|
5
|
-
:label="labelValue"
|
|
6
|
-
:required="required"
|
|
7
|
-
/>
|
|
8
|
-
<BaseTextarea
|
|
9
|
-
:model-value="normalizedModelValue"
|
|
10
|
-
:type="type"
|
|
11
|
-
:name="name"
|
|
12
|
-
:placeholder="placeholder"
|
|
13
|
-
:disabled="disabled"
|
|
14
|
-
:required="required"
|
|
15
|
-
:rows="rows"
|
|
16
|
-
:class="[
|
|
17
|
-
{
|
|
18
|
-
'border-red-600': hasError(),
|
|
19
|
-
'border-slate-300': !hasError(),
|
|
20
|
-
},
|
|
21
|
-
]"
|
|
22
|
-
@update:model-value="inputListener($event)"
|
|
23
|
-
/>
|
|
24
|
-
<div class="mt-1 flex flex-wrap sm:space-x-3">
|
|
25
|
-
<BaseInputError v-if="hasError()" class="order-2 grow sm:order-1">
|
|
26
|
-
{{ errorMessage() }}
|
|
27
|
-
</BaseInputError>
|
|
28
|
-
<div
|
|
29
|
-
class="order-1 w-full grow text-left sm:order-2 sm:w-auto sm:text-right"
|
|
30
|
-
>
|
|
31
|
-
<BaseCharacterCounter
|
|
32
|
-
:text="normalizedModelValue"
|
|
33
|
-
:min="min"
|
|
34
|
-
:max="max"
|
|
35
|
-
/>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
</template>
|
|
40
|
-
|
|
41
|
-
<script lang="ts">
|
|
42
|
-
import { defineComponent, PropType } from 'vue';
|
|
43
|
-
import BaseFormField from './BaseFormField';
|
|
44
|
-
import { get, isString, trim } from 'lodash';
|
|
45
|
-
import BaseTextarea from './BaseTextarea.vue';
|
|
46
|
-
import BaseInputLabel from './BaseInputLabel.vue';
|
|
47
|
-
import BaseCharacterCounter from './BaseCharacterCounter.vue';
|
|
48
|
-
import BaseInputError from './BaseInputError.vue';
|
|
49
|
-
|
|
50
|
-
export default defineComponent({
|
|
51
|
-
components: {
|
|
52
|
-
BaseTextarea,
|
|
53
|
-
BaseInputLabel,
|
|
54
|
-
BaseCharacterCounter,
|
|
55
|
-
BaseInputError,
|
|
56
|
-
},
|
|
57
|
-
extends: BaseFormField,
|
|
58
|
-
props: {
|
|
59
|
-
modelValue: {
|
|
60
|
-
required: true,
|
|
61
|
-
type: [String, null] as PropType<string | null>,
|
|
62
|
-
},
|
|
63
|
-
type: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: 'text',
|
|
66
|
-
},
|
|
67
|
-
rows: {
|
|
68
|
-
default: 3,
|
|
69
|
-
type: Number,
|
|
70
|
-
},
|
|
71
|
-
min: {
|
|
72
|
-
default: undefined,
|
|
73
|
-
type: Number,
|
|
74
|
-
},
|
|
75
|
-
max: {
|
|
76
|
-
default: undefined,
|
|
77
|
-
type: Number,
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
computed: {
|
|
81
|
-
normalizedModelValue(): string {
|
|
82
|
-
if (isString(this.modelValue)) {
|
|
83
|
-
return this.modelValue;
|
|
84
|
-
}
|
|
85
|
-
return '';
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
methods: {
|
|
89
|
-
transformInputValue(event: Event | null): string | null {
|
|
90
|
-
if (event === null) {
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
const value = get(event, 'target.value', null);
|
|
94
|
-
if (!isString(value)) {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
return trim(value as string);
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
});
|
|
101
|
-
</script>
|