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.
Files changed (26) hide show
  1. package/dist/sprintify-ui.es.js +8010 -7924
  2. package/dist/types/src/components/BaseAutocomplete.vue.d.ts +32 -10
  3. package/dist/types/src/components/BaseAutocompleteDropdown.vue.d.ts +88 -0
  4. package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +20 -5
  5. package/dist/types/src/components/BaseBelongsTo.vue.d.ts +18 -3
  6. package/dist/types/src/components/BaseDatePicker.vue.d.ts +1 -1
  7. package/dist/types/src/components/BaseHasMany.vue.d.ts +17 -0
  8. package/dist/types/src/components/BaseLoadingCover.vue.d.ts +1 -1
  9. package/dist/types/src/components/BaseSwitch.vue.d.ts +1 -1
  10. package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +66 -6
  11. package/dist/types/src/components/BaseTagAutocompleteFetch.vue.d.ts +19 -2
  12. package/dist/types/src/composables/clickOutside.d.ts +1 -1
  13. package/dist/types/src/index.d.ts +2 -0
  14. package/package.json +10 -10
  15. package/src/components/BaseAutocomplete.vue +53 -183
  16. package/src/components/BaseAutocompleteDropdown.vue +344 -0
  17. package/src/components/BaseAutocompleteFetch.vue +8 -3
  18. package/src/components/BaseDropdown.vue +2 -2
  19. package/src/components/BaseModalSide.stories.js +1 -3
  20. package/src/components/BaseModalSide.vue +5 -5
  21. package/src/components/BaseTagAutocomplete.stories.js +46 -1
  22. package/src/components/BaseTagAutocomplete.vue +184 -253
  23. package/src/components/BaseTagAutocompleteFetch.stories.js +4 -4
  24. package/src/components/BaseTagAutocompleteFetch.vue +10 -5
  25. package/src/composables/clickOutside.ts +4 -2
  26. 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) {
@@ -137,8 +137,8 @@ function deactivate() {
137
137
 
138
138
  useClickOutside(
139
139
  dropdown,
140
- (outside: boolean) => {
141
- if (outside && showDropdown.value) {
140
+ () => {
141
+ if (showDropdown.value) {
142
142
  close();
143
143
  }
144
144
  },
@@ -5,9 +5,7 @@ import BaseAvatar from './BaseAvatar.vue';
5
5
  export default {
6
6
  title: 'Components/BaseModalSide',
7
7
  component: BaseModalSide,
8
- args: {
9
- position: 'bottom-right',
10
- },
8
+ args: {},
11
9
  };
12
10
 
13
11
  const Template = (args) => ({
@@ -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() {