sprintify-ui 0.6.84 → 0.6.86

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 (41) hide show
  1. package/dist/sprintify-ui.es.js +179 -176
  2. package/dist/types/components/BaseAutocomplete.vue.d.ts +7 -7
  3. package/dist/types/components/BaseAutocompleteDrawer.vue.d.ts +1 -1
  4. package/dist/types/components/BaseAutocompleteFetch.vue.d.ts +5 -5
  5. package/dist/types/components/BaseBelongsTo.vue.d.ts +4 -4
  6. package/dist/types/components/BaseBelongsToFetch.vue.d.ts +5 -5
  7. package/dist/types/components/BaseButtonGroup.vue.d.ts +11 -11
  8. package/dist/types/components/BaseColor.vue.d.ts +6 -6
  9. package/dist/types/components/BaseDropdownAutocomplete.vue.d.ts +7 -7
  10. package/dist/types/components/BaseHasMany.vue.d.ts +5 -5
  11. package/dist/types/components/BaseRadioGroup.vue.d.ts +3 -3
  12. package/dist/types/components/BaseSelect.vue.d.ts +4 -4
  13. package/dist/types/components/BaseTagAutocomplete.vue.d.ts +6 -6
  14. package/dist/types/components/BaseTagAutocompleteFetch.vue.d.ts +4 -4
  15. package/dist/types/composables/hasOptions.d.ts +2 -2
  16. package/dist/types/types/Media.d.ts +1 -1
  17. package/dist/types/types/Notification.d.ts +1 -1
  18. package/dist/types/types/UploadedFile.d.ts +1 -1
  19. package/dist/types/types/User.d.ts +1 -1
  20. package/dist/types/types/index.d.ts +2 -2
  21. package/dist/types/utils/sizes.d.ts +2 -1
  22. package/package.json +1 -1
  23. package/src/components/BaseAutocomplete.vue +5 -5
  24. package/src/components/BaseAutocompleteFetch.vue +4 -4
  25. package/src/components/BaseBelongsTo.vue +3 -3
  26. package/src/components/BaseBelongsToFetch.vue +4 -4
  27. package/src/components/BaseButtonGroup.vue +5 -5
  28. package/src/components/BaseColor.vue +4 -4
  29. package/src/components/BaseDropdownAutocomplete.vue +5 -5
  30. package/src/components/BaseHasMany.vue +4 -4
  31. package/src/components/BaseRadioGroup.vue +2 -2
  32. package/src/components/BaseSelect.vue +2 -2
  33. package/src/components/BaseTagAutocomplete.vue +3 -3
  34. package/src/components/BaseTagAutocompleteFetch.vue +3 -3
  35. package/src/composables/hasOptions.ts +3 -3
  36. package/src/types/Media.ts +1 -1
  37. package/src/types/Notification.ts +1 -1
  38. package/src/types/UploadedFile.ts +1 -1
  39. package/src/types/User.ts +1 -1
  40. package/src/types/index.ts +2 -2
  41. package/src/utils/sizes.ts +3 -1
@@ -45,7 +45,7 @@
45
45
  <script lang="ts" setup>
46
46
  import { PropType } from 'vue';
47
47
  import BaseAutocomplete from './BaseAutocomplete.vue';
48
- import { Option, SelectConfiguration } from '@/types';
48
+ import { RawOption, SelectConfiguration } from '@/types';
49
49
  import { Size } from '@/utils/sizes';
50
50
 
51
51
  const props = defineProps({
@@ -57,7 +57,7 @@ const props = defineProps({
57
57
  },
58
58
  options: {
59
59
  required: true,
60
- type: Array as PropType<Option[]>,
60
+ type: Array as PropType<RawOption[]>,
61
61
  },
62
62
  primaryKey: {
63
63
  default: 'id',
@@ -135,7 +135,7 @@ const model = computed(() => {
135
135
  : null;
136
136
  });
137
137
 
138
- function onUpdate(newModel: Option | null) {
138
+ function onUpdate(newModel: RawOption | null) {
139
139
  if (!newModel) {
140
140
  emit('update:modelValue', null, null);
141
141
  } else {
@@ -47,7 +47,7 @@ import { PropType } from 'vue';
47
47
  import { AxiosResponse } from 'axios';
48
48
  import { config } from '@/index';
49
49
  import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
50
- import { Option, SelectConfiguration } from '@/types';
50
+ import { RawOption, SelectConfiguration } from '@/types';
51
51
  import { Size } from '@/utils/sizes';
52
52
  import { debounce, isObject } from 'lodash';
53
53
 
@@ -92,7 +92,7 @@ const props = defineProps({
92
92
  },
93
93
  currentModel: {
94
94
  default: undefined,
95
- type: [Object, null, undefined] as PropType<Option | null | undefined>,
95
+ type: [Object, null, undefined] as PropType<RawOption | null | undefined>,
96
96
  },
97
97
  hasError: {
98
98
  default: false,
@@ -144,7 +144,7 @@ const autocompleteFetch = ref<InstanceType<
144
144
  typeof BaseAutocompleteFetch
145
145
  > | null>(null);
146
146
 
147
- const model = ref<Option | null>(null);
147
+ const model = ref<RawOption | null>(null);
148
148
  const ensureModelIsFilledDebounced = debounce(ensureModelIsFilled, 100);
149
149
 
150
150
  watch(
@@ -159,7 +159,7 @@ watch(
159
159
 
160
160
  ensureModelIsFilledDebounced();
161
161
 
162
- function onUpdate(newModel: Option | null) {
162
+ function onUpdate(newModel: RawOption | null) {
163
163
  if (!newModel) {
164
164
  model.value = null;
165
165
  emit('update:modelValue', null, null);
@@ -27,7 +27,7 @@
27
27
 
28
28
  <script lang="ts" setup>
29
29
  import { PropType, computed } from 'vue';
30
- import { NormalizedOption, Option } from '@/types';
30
+ import { NormalizedOption, RawOption } from '@/types';
31
31
  import { cloneDeep, isArray } from 'lodash';
32
32
  import { useHasOptions } from '@/composables/hasOptions';
33
33
  import { useField } from '@/composables/field';
@@ -43,7 +43,7 @@ const props = defineProps({
43
43
  modelValue: {
44
44
  default: undefined,
45
45
  type: [Object, Array, null, undefined] as PropType<
46
- Option[] | Option | null | undefined
46
+ RawOption[] | RawOption | null | undefined
47
47
  >,
48
48
  },
49
49
  class: {
@@ -67,10 +67,10 @@ const props = defineProps({
67
67
  type: String as PropType<'button' | 'submit'>,
68
68
  },
69
69
  buttonColor: {
70
- default(option: Option, selected: boolean) {
70
+ default(option: RawOption, selected: boolean) {
71
71
  return selected ? 'primary' : ''
72
72
  },
73
- type: Function as PropType<(option: Option, selected: boolean) => string>,
73
+ type: Function as PropType<(option: RawOption, selected: boolean) => string>,
74
74
  },
75
75
  twButton: {
76
76
  default: '',
@@ -82,7 +82,7 @@ const props = defineProps({
82
82
  },
83
83
  options: {
84
84
  required: true,
85
- type: Array as PropType<Option[]>,
85
+ type: Array as PropType<RawOption[]>,
86
86
  },
87
87
  labelKey: {
88
88
  required: true,
@@ -35,7 +35,7 @@ import { PropType } from 'vue';
35
35
  import { BaseButtonGroup } from '.';
36
36
  import { isArray } from 'lodash';
37
37
  import { useField } from '@/composables/field';
38
- import { Option } from '@/types';
38
+ import { RawOption } from '@/types';
39
39
  import { palette } from '@/utils/colors';
40
40
  import { getContrast } from 'color2k';
41
41
  import { Size } from '@/utils/sizes';
@@ -70,10 +70,10 @@ const props = defineProps({
70
70
  },
71
71
  },
72
72
  buttonColor: {
73
- default(option: Option, selected: boolean) {
73
+ default(option: RawOption, selected: boolean) {
74
74
  return option.value;
75
75
  },
76
- type: Function as PropType<(option: Option, selected: boolean) => string>,
76
+ type: Function as PropType<(option: RawOption, selected: boolean) => string>,
77
77
  },
78
78
  multiple: {
79
79
  default: false,
@@ -126,7 +126,7 @@ const { emitUpdate } = useField({
126
126
  emit: emit,
127
127
  });
128
128
 
129
- function transformModelValue(payload: Option | Option[] | null) {
129
+ function transformModelValue(payload: RawOption | RawOption[] | null) {
130
130
  if (props.multiple) {
131
131
  let newModalValue = [] as string[];
132
132
 
@@ -61,7 +61,7 @@
61
61
  <script lang="ts" setup>
62
62
  import { isArray } from 'lodash';
63
63
  import { PropType } from 'vue';
64
- import { Option, SelectConfiguration } from '@/types';
64
+ import { RawOption, SelectConfiguration } from '@/types';
65
65
  import BaseDropdown from './BaseDropdown.vue';
66
66
  import BaseAutocomplete from './BaseAutocomplete.vue';
67
67
  import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
@@ -72,7 +72,7 @@ import { Placement } from '@floating-ui/vue';
72
72
  const props = defineProps({
73
73
  modelValue: {
74
74
  type: [Array, Object, null, undefined] as PropType<
75
- Option[] | Option | null | undefined
75
+ RawOption[] | RawOption | null | undefined
76
76
  >,
77
77
  default: undefined,
78
78
  },
@@ -85,7 +85,7 @@ const props = defineProps({
85
85
  default: undefined,
86
86
  },
87
87
  options: {
88
- type: Array as PropType<Option[] | undefined>,
88
+ type: Array as PropType<RawOption[] | undefined>,
89
89
  default: undefined,
90
90
  },
91
91
  labelKey: {
@@ -174,7 +174,7 @@ watch(
174
174
  );
175
175
 
176
176
  function onUpdate(
177
- value: Option | Option[] | null | undefined,
177
+ value: RawOption | RawOption[] | null | undefined,
178
178
  close: () => void
179
179
  ) {
180
180
  newValue.value = getNewValue(value);
@@ -186,7 +186,7 @@ function onUpdate(
186
186
  }
187
187
  }
188
188
 
189
- function getNewValue(value: Option | Option[] | null | undefined) {
189
+ function getNewValue(value: RawOption | RawOption[] | null | undefined) {
190
190
  if (isArray(value)) {
191
191
  return value;
192
192
  }
@@ -45,7 +45,7 @@
45
45
 
46
46
  <script lang="ts" setup>
47
47
  import { debounce } from 'lodash';
48
- import { Option } from '@/types';
48
+ import { RawOption } from '@/types';
49
49
  import { config } from '@/index';
50
50
  import { PropType } from 'vue';
51
51
  import BaseTagAutocompleteFetch from './BaseTagAutocompleteFetch.vue';
@@ -97,7 +97,7 @@ const props = defineProps({
97
97
  default() {
98
98
  return undefined;
99
99
  },
100
- type: Array as PropType<Option[] | undefined>,
100
+ type: Array as PropType<RawOption[] | undefined>,
101
101
  },
102
102
  hasError: {
103
103
  default: false,
@@ -113,7 +113,7 @@ const tagAutocompleteFetch = ref<InstanceType<
113
113
  typeof BaseTagAutocompleteFetch
114
114
  > | null>(null);
115
115
 
116
- const models = ref<Option[]>([]);
116
+ const models = ref<RawOption[]>([]);
117
117
  const ensureModelIsFilledDebounced = debounce(() => ensureModelsAreFilled(), 100);
118
118
 
119
119
  watch(
@@ -130,7 +130,7 @@ watch(
130
130
 
131
131
  ensureModelIsFilledDebounced();
132
132
 
133
- function onUpdate(newModels: Option[]) {
133
+ function onUpdate(newModels: RawOption[]) {
134
134
  models.value = newModels;
135
135
  emit(
136
136
  'update:modelValue',
@@ -36,7 +36,7 @@
36
36
 
37
37
  <script lang="ts" setup>
38
38
  import { PropType } from 'vue';
39
- import { NormalizedOption, Option, OptionValue } from '@/types';
39
+ import { NormalizedOption, RawOption, OptionValue } from '@/types';
40
40
  import { useField } from '@/composables/field';
41
41
  import { uniqueId } from 'lodash';
42
42
 
@@ -61,7 +61,7 @@ const props = defineProps({
61
61
  },
62
62
  options: {
63
63
  required: true,
64
- type: Array as PropType<Option[]>,
64
+ type: Array as PropType<RawOption[]>,
65
65
  },
66
66
  labelKey: {
67
67
  required: true,
@@ -41,7 +41,7 @@
41
41
  import { PropType } from 'vue';
42
42
  import { get, isArray } from 'lodash';
43
43
  import { useField } from '@/composables/field';
44
- import { NormalizedOption, OptionValue, Option } from '@/types';
44
+ import { NormalizedOption, OptionValue, RawOption } from '@/types';
45
45
  import { t } from '@/i18n';
46
46
  import { twMerge } from 'tailwind-merge';
47
47
  import { Size, sizes } from '@/utils/sizes';
@@ -90,7 +90,7 @@ const props = defineProps({
90
90
  },
91
91
  options: {
92
92
  default: undefined,
93
- type: Array as PropType<Option[]>,
93
+ type: Array as PropType<RawOption[]>,
94
94
  },
95
95
  labelKey: {
96
96
  default: undefined,
@@ -92,7 +92,7 @@
92
92
  <script lang="ts" setup>
93
93
  import { cloneDeep, get } from 'lodash';
94
94
  import { PropType, ComputedRef } from 'vue';
95
- import { NormalizedOption, Option } from '@/types';
95
+ import { NormalizedOption, RawOption } from '@/types';
96
96
  import { useHasOptions } from '@/composables/hasOptions';
97
97
  import { useField } from '@/composables/field';
98
98
  import { useClickOutside } from '@/composables/clickOutside';
@@ -107,11 +107,11 @@ const notifications = useNotificationsStore();
107
107
  const props = defineProps({
108
108
  modelValue: {
109
109
  required: true,
110
- type: [Array, null] as PropType<Option[] | null>,
110
+ type: [Array, null] as PropType<RawOption[] | null>,
111
111
  },
112
112
  options: {
113
113
  required: true,
114
- type: Array as PropType<Option[]>,
114
+ type: Array as PropType<RawOption[]>,
115
115
  },
116
116
  labelKey: {
117
117
  required: true,
@@ -63,7 +63,7 @@ import { config } from '@/index';
63
63
  import { PropType } from 'vue';
64
64
  import {
65
65
  Collection,
66
- Option,
66
+ RawOption,
67
67
  PaginatedCollection,
68
68
  ResourceCollection,
69
69
  } from '@/types';
@@ -74,7 +74,7 @@ import { t } from '@/i18n';
74
74
  const props = defineProps({
75
75
  modelValue: {
76
76
  required: true,
77
- type: Array as PropType<Option[]>,
77
+ type: Array as PropType<RawOption[]>,
78
78
  },
79
79
  url: {
80
80
  required: true,
@@ -131,7 +131,7 @@ const fetching = ref(false);
131
131
  const firstSearch = ref(false);
132
132
  const keywords = ref('');
133
133
  const page = ref(1);
134
- const options = ref<Option[]>([]);
134
+ const options = ref<RawOption[]>([]);
135
135
 
136
136
  const data = ref<null | ResourceCollection | PaginatedCollection | Collection>(
137
137
  null
@@ -1,10 +1,10 @@
1
1
  import { Ref } from 'vue';
2
- import { NormalizedOption, Option } from '@/types';
2
+ import { NormalizedOption, RawOption } from '@/types';
3
3
  import { isArray, isObject } from 'lodash';
4
4
 
5
5
  export function useHasOptions(
6
- modelValue: Ref<Option[] | Option | null | undefined>,
7
- options: Ref<Option[]>,
6
+ modelValue: Ref<RawOption[] | RawOption | null | undefined>,
7
+ options: Ref<RawOption[]>,
8
8
  labelKey: Ref<string>,
9
9
  valueKey: Ref<string>,
10
10
  multiple: Ref<boolean> = ref(false)
@@ -7,4 +7,4 @@ interface Media {
7
7
  url: string;
8
8
  }
9
9
 
10
- export { Media };
10
+ export type { Media };
@@ -8,4 +8,4 @@ interface Notification {
8
8
  created_at?: string;
9
9
  }
10
10
 
11
- export { Notification };
11
+ export type { Notification };
@@ -8,4 +8,4 @@ interface UploadedFile {
8
8
  data_url?: string;
9
9
  }
10
10
 
11
- export { UploadedFile };
11
+ export type { UploadedFile };
package/src/types/User.ts CHANGED
@@ -4,4 +4,4 @@ interface User {
4
4
  avatar_url?: string;
5
5
  }
6
6
 
7
- export { User };
7
+ export type { User };
@@ -34,10 +34,10 @@ export interface DataTableQuery extends Record<string, any> {
34
34
 
35
35
  export type OptionValue = string | number | null;
36
36
 
37
- export type Option = Record<string, any>;
37
+ export type RawOption = Record<string, any>;
38
38
 
39
39
  export type NormalizedOption = {
40
- option: Option;
40
+ option: RawOption;
41
41
  value: OptionValue;
42
42
  label: string;
43
43
  };
@@ -18,4 +18,6 @@ const sizes = {
18
18
 
19
19
  type Size = keyof typeof sizes;
20
20
 
21
- export { sizes, Size }
21
+ export { sizes };
22
+
23
+ export type { Size };