sprintify-ui 0.0.97 → 0.0.99
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 +8010 -7924
- package/dist/types/src/components/BaseAutocomplete.vue.d.ts +32 -10
- package/dist/types/src/components/BaseAutocompleteDropdown.vue.d.ts +88 -0
- package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +20 -5
- package/dist/types/src/components/BaseBelongsTo.vue.d.ts +18 -3
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +1 -1
- package/dist/types/src/components/BaseHasMany.vue.d.ts +17 -0
- package/dist/types/src/components/BaseLoadingCover.vue.d.ts +1 -1
- package/dist/types/src/components/BaseSwitch.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +66 -6
- package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +19 -2
- package/dist/types/src/composables/clickOutside.d.ts +1 -1
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +10 -10
- package/src/components/BaseAutocomplete.vue +53 -183
- package/src/components/BaseAutocompleteDropdown.vue +344 -0
- package/src/components/BaseAutocompleteFetch.vue +8 -3
- package/src/components/BaseDropdown.vue +2 -2
- package/src/components/BaseModalSide.stories.js +1 -3
- package/src/components/BaseModalSide.vue +5 -5
- package/src/components/BaseTagAutocomplete.stories.js +46 -1
- package/src/components/BaseTagAutocomplete.vue +184 -253
- package/src/components/BaseTagAutocompleteFetch.stories.js +4 -4
- package/src/components/BaseTagAutocompleteFetch.vue +10 -5
- package/src/composables/clickOutside.ts +4 -2
- package/src/index.ts +3 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<BaseAutocomplete
|
|
3
3
|
ref="input"
|
|
4
4
|
:loading="showLoading && page == 1"
|
|
5
|
+
:loading-bottom="showLoading && page > 1"
|
|
5
6
|
:model-value="modelValue"
|
|
6
7
|
:disabled="disabled"
|
|
7
8
|
:name="name"
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
|
|
47
48
|
<script lang="ts" setup>
|
|
48
49
|
import { config } from '@/index';
|
|
49
|
-
import { debounce } from 'lodash';
|
|
50
|
+
import { debounce, throttle } from 'lodash';
|
|
50
51
|
import { PropType, Ref } from 'vue';
|
|
51
52
|
import { Option } from '@/types';
|
|
52
53
|
import BaseAutocomplete from './BaseAutocomplete.vue';
|
|
@@ -161,12 +162,16 @@ const onClear = () => {
|
|
|
161
162
|
emit('clear');
|
|
162
163
|
};
|
|
163
164
|
|
|
164
|
-
const scrollBottom = () => {
|
|
165
|
+
const scrollBottom = throttle(() => {
|
|
166
|
+
if (fetching.value) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
165
170
|
if (!reachedEnd.value) {
|
|
166
171
|
page.value++;
|
|
167
172
|
search();
|
|
168
173
|
}
|
|
169
|
-
};
|
|
174
|
+
}, 500);
|
|
170
175
|
|
|
171
176
|
function search() {
|
|
172
177
|
if (fetching.value) {
|
|
@@ -96,14 +96,14 @@ const props = defineProps({
|
|
|
96
96
|
|
|
97
97
|
const emit = defineEmits(['update:modelValue']);
|
|
98
98
|
|
|
99
|
-
const modal = useModal(
|
|
100
|
-
computed(() => props.modelValue),
|
|
101
|
-
emit
|
|
102
|
-
);
|
|
103
|
-
|
|
104
99
|
const breakpoints = useBreakpoints();
|
|
105
100
|
|
|
106
101
|
const realMaxWidth = computed((): string => {
|
|
107
102
|
return breakpoints.greater('sm').value ? props.maxWidth : '100%';
|
|
108
103
|
});
|
|
104
|
+
|
|
105
|
+
const modal = useModal(
|
|
106
|
+
computed(() => props.modelValue),
|
|
107
|
+
emit
|
|
108
|
+
);
|
|
109
109
|
</script>
|
|
@@ -3,10 +3,25 @@ import BaseTagAutocomplete from './BaseTagAutocomplete.vue';
|
|
|
3
3
|
import ShowValue from '@/../.storybook/components/ShowValue.vue';
|
|
4
4
|
import BaseAppNotifications from './BaseAppNotifications.vue';
|
|
5
5
|
|
|
6
|
+
const sizes = ['xs', 'sm', 'base'];
|
|
7
|
+
|
|
6
8
|
export default {
|
|
7
9
|
title: 'Form/BaseTagAutocomplete',
|
|
8
10
|
component: BaseTagAutocomplete,
|
|
9
|
-
argTypes: {
|
|
11
|
+
argTypes: {
|
|
12
|
+
size: {
|
|
13
|
+
control: {
|
|
14
|
+
type: 'select',
|
|
15
|
+
options: sizes,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
dropdownShow: {
|
|
19
|
+
control: {
|
|
20
|
+
type: 'select',
|
|
21
|
+
options: ['always', 'focus'],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
10
25
|
args: {
|
|
11
26
|
labelKey: 'label',
|
|
12
27
|
valueKey: 'value',
|
|
@@ -30,6 +45,17 @@ const Template = (args) => ({
|
|
|
30
45
|
export const Demo = Template.bind({});
|
|
31
46
|
Demo.args = {};
|
|
32
47
|
|
|
48
|
+
export const AlwaysShowDropdown = Template.bind({});
|
|
49
|
+
AlwaysShowDropdown.args = {
|
|
50
|
+
inline: true,
|
|
51
|
+
dropdownShow: 'always',
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const NoFocus = Template.bind({});
|
|
55
|
+
NoFocus.args = {
|
|
56
|
+
visibleFocus: false,
|
|
57
|
+
};
|
|
58
|
+
|
|
33
59
|
export const Disabled = Template.bind({});
|
|
34
60
|
Disabled.args = {
|
|
35
61
|
options: options,
|
|
@@ -42,6 +68,25 @@ Loading.args = {
|
|
|
42
68
|
loading: true,
|
|
43
69
|
};
|
|
44
70
|
|
|
71
|
+
export const Inline = Template.bind({});
|
|
72
|
+
Inline.args = {
|
|
73
|
+
inline: true,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const Sizes = (args) => ({
|
|
77
|
+
components: { BaseTagAutocomplete },
|
|
78
|
+
setup() {
|
|
79
|
+
const value = ref([]);
|
|
80
|
+
return { args, sizes, value };
|
|
81
|
+
},
|
|
82
|
+
template: `
|
|
83
|
+
<div v-for="size in sizes" class="mb-1">
|
|
84
|
+
<p class="text-xs text-slate-600 leading-tight">{{ size }}</p>
|
|
85
|
+
<BaseTagAutocomplete v-model="value" v-bind="args" :size="size"></BaseTagAutocomplete>
|
|
86
|
+
</div>
|
|
87
|
+
`,
|
|
88
|
+
});
|
|
89
|
+
|
|
45
90
|
export const SlotOption = (args) => ({
|
|
46
91
|
components: { BaseTagAutocomplete, ShowValue, BaseAppNotifications },
|
|
47
92
|
setup() {
|