sprintify-ui 0.0.131 → 0.0.133

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 (35) hide show
  1. package/dist/sprintify-ui.es.js +7398 -7385
  2. package/dist/style.css +2 -2
  3. package/dist/types/src/components/BaseDataIterator.vue.d.ts +17 -5
  4. package/dist/types/src/components/BaseDataTable.vue.d.ts +7 -1
  5. package/dist/types/src/components/BaseDataTableToggleColumns.vue.d.ts +84 -4
  6. package/dist/types/src/components/BaseForm.vue.d.ts +4 -4
  7. package/dist/types/src/components/BaseLayoutNotificationItemContent.vue.d.ts +15 -21
  8. package/dist/types/src/components/BaseTable.vue.d.ts +21 -1
  9. package/dist/types/src/components/BaseTableColumn.vue.d.ts +3 -3
  10. package/package.json +1 -1
  11. package/src/components/BaseAppDialogs.vue +1 -2
  12. package/src/components/BaseAutocomplete.vue +5 -7
  13. package/src/components/BaseAutocompleteDrawer.vue +2 -2
  14. package/src/components/BaseAutocompleteFetch.vue +3 -5
  15. package/src/components/BaseBelongsTo.vue +3 -3
  16. package/src/components/BaseCard.vue +1 -2
  17. package/src/components/BaseDataIterator.vue +33 -13
  18. package/src/components/BaseDataTable.vue +31 -16
  19. package/src/components/BaseDatePicker.vue +2 -2
  20. package/src/components/BaseDescriptionListItem.vue +1 -2
  21. package/src/components/BaseDialog.vue +2 -2
  22. package/src/components/BaseDisplayRelativeTime.vue +2 -4
  23. package/src/components/BaseDropdownAutocomplete.vue +3 -3
  24. package/src/components/BaseForm.vue +3 -3
  25. package/src/components/BaseHasMany.vue +3 -3
  26. package/src/components/BaseLayoutNotificationItemContent.vue +14 -45
  27. package/src/components/BaseLayoutSidebarConfigurable.stories.js +2 -1
  28. package/src/components/BasePagination.vue +3 -4
  29. package/src/components/BaseReadMore.vue +2 -2
  30. package/src/components/BaseRichText.vue +2 -2
  31. package/src/components/BaseSelect.vue +2 -2
  32. package/src/components/BaseTable.vue +8 -8
  33. package/src/components/BaseTagAutocomplete.vue +5 -7
  34. package/src/components/BaseTagAutocompleteFetch.vue +5 -5
  35. package/src/components/BaseTextareaAutoresize.vue +1 -2
@@ -51,7 +51,7 @@
51
51
  <script lang="ts" setup>
52
52
  import { config } from '@/index';
53
53
  import { debounce, throttle } from 'lodash';
54
- import { PropType, Ref } from 'vue';
54
+ import { PropType } from 'vue';
55
55
  import { Option, SelectConfiguration } from '@/types';
56
56
  import BaseAutocomplete from './BaseAutocomplete.vue';
57
57
 
@@ -153,11 +153,9 @@ const firstSearch = ref(false);
153
153
  const reachedEnd = ref(false);
154
154
  const keywords = ref('');
155
155
  const page = ref(1);
156
- const options = ref([]) as Ref<Option[]>;
156
+ const options = ref<Option[]>([]);
157
157
 
158
- const autocomplete = ref(null) as Ref<InstanceType<
159
- typeof BaseAutocomplete
160
- > | null>;
158
+ const autocomplete = ref<InstanceType<typeof BaseAutocomplete> | null>(null);
161
159
 
162
160
  const onTyping = (query: string) => {
163
161
  page.value = 1;
@@ -33,7 +33,7 @@
33
33
  </template>
34
34
 
35
35
  <script lang="ts" setup>
36
- import { PropType, Ref } from 'vue';
36
+ import { PropType } from 'vue';
37
37
  import { AxiosResponse } from 'axios';
38
38
  import { config } from '@/index';
39
39
  import BaseAutocompleteFetch from './BaseAutocompleteFetch.vue';
@@ -124,9 +124,9 @@ const http = config.http;
124
124
 
125
125
  const emit = defineEmits(['update:modelValue']);
126
126
 
127
- const autocompleteFetch = ref(null) as Ref<InstanceType<
127
+ const autocompleteFetch = ref<InstanceType<
128
128
  typeof BaseAutocompleteFetch
129
- > | null>;
129
+ > | null>(null);
130
130
 
131
131
  const model = ref(props.currentModel);
132
132
 
@@ -13,7 +13,6 @@
13
13
 
14
14
  <script lang="ts" setup>
15
15
  import { debounce } from 'lodash';
16
- import { Ref } from 'vue';
17
16
 
18
17
  defineProps({
19
18
  clipped: {
@@ -25,7 +24,7 @@ defineProps({
25
24
  // windowWidth should not be equal to width when the card is mounted
26
25
  const windowWidth = ref(1);
27
26
  const width = ref(0);
28
- const card = ref(null) as Ref<HTMLElement | null>;
27
+ const card = ref<HTMLElement | null>(null);
29
28
 
30
29
  onMounted(() => {
31
30
  window.addEventListener('resize', onResizeDebounced);
@@ -137,7 +137,25 @@
137
137
  <div v-if="hasFilters" class="mb-4">
138
138
  <BaseCard>
139
139
  <BaseCardRow size="sm">
140
- <div class="space-y-3">
140
+ <button
141
+ type="button"
142
+ class="flex w-full items-center justify-between"
143
+ @click="showFilterDesktop = !showFilterDesktop"
144
+ >
145
+ <h2 class="font-semibold">
146
+ {{ $t('sui.filters') }}
147
+ </h2>
148
+
149
+ <BaseIcon
150
+ :icon="
151
+ showFilterDesktop
152
+ ? 'heroicons:chevron-down'
153
+ : 'heroicons:chevron-up'
154
+ "
155
+ ></BaseIcon>
156
+ </button>
157
+
158
+ <div v-show="showFilterDesktop" class="mt-4 space-y-3">
141
159
  <slot
142
160
  name="filters"
143
161
  :query="query"
@@ -197,7 +215,7 @@ const DEFAULT_QUERY = {
197
215
  <script lang="ts" setup>
198
216
  import { cloneDeep, debounce, isArray, merge, set } from 'lodash';
199
217
  import hash from 'object-hash';
200
- import { ComputedRef, PropType, Ref } from 'vue';
218
+ import { PropType } from 'vue';
201
219
  import {
202
220
  Collection,
203
221
  DataTableQuery,
@@ -281,8 +299,8 @@ defineEmits([
281
299
  'update:query',
282
300
  ]);
283
301
 
284
- const dataIteratorNode = ref(null) as Ref<null | HTMLElement>;
285
- const searchInput = ref(null) as Ref<null | HTMLInputElement>;
302
+ const dataIteratorNode = ref<null | HTMLElement>(null);
303
+ const searchInput = ref<null | HTMLInputElement>(null);
286
304
 
287
305
  const route = useRoute();
288
306
  const router = useRouter();
@@ -309,7 +327,7 @@ const searchQuery = ref('');
309
327
 
310
328
  let lastUrl = '';
311
329
  let lastQueryHash = '';
312
- const query = ref(cloneDeep(props.defaultQuery)) as Ref<DataTableQuery>;
330
+ const query = ref<DataTableQuery>(cloneDeep(props.defaultQuery));
313
331
  const slots = useSlots();
314
332
 
315
333
  const mobileLayout = computed(() => {
@@ -328,7 +346,7 @@ const hasFilters = computed((): boolean => {
328
346
  */
329
347
 
330
348
  const hasSidebar = ref(false);
331
- const sidebar = ref(null) as Ref<null | HTMLElement>;
349
+ const sidebar = ref<null | HTMLElement>(null);
332
350
 
333
351
  function checkIfSidebarIsEmpty() {
334
352
  hasSidebar.value = (sidebar?.value?.childElementCount ?? 0) > 0;
@@ -355,6 +373,8 @@ watch(
355
373
  }
356
374
  );
357
375
 
376
+ const showFilterDesktop = ref(true);
377
+
358
378
  /*
359
379
  |--------------------------------------------------------------------------
360
380
  | Query params
@@ -420,9 +440,9 @@ function queryHash(query: DataTableQuery): string {
420
440
  |--------------------------------------------------------------------------
421
441
  */
422
442
 
423
- const url = computed(() => {
443
+ const url = computed<string>(() => {
424
444
  return props.url;
425
- }) as ComputedRef<string>;
445
+ });
426
446
 
427
447
  /*
428
448
  |--------------------------------------------------------------------------
@@ -591,9 +611,9 @@ function fetch(force = false, showLoading = true) {
591
611
  |--------------------------------------------------------------------------
592
612
  */
593
613
 
594
- const data = ref(null) as Ref<
595
- null | ResourceCollection | PaginatedCollection | Collection
596
- >;
614
+ const data = ref<null | ResourceCollection | PaginatedCollection | Collection>(
615
+ null
616
+ );
597
617
 
598
618
  const items = computed(() => {
599
619
  if (!data.value) {
@@ -605,7 +625,7 @@ const items = computed(() => {
605
625
  return data.value.data;
606
626
  });
607
627
 
608
- const paginationMetadata = computed(() => {
628
+ const paginationMetadata = computed<PaginationMetadata | null>(() => {
609
629
  const defaultMeta = {
610
630
  current_page: 1,
611
631
  last_page: 1,
@@ -633,7 +653,7 @@ const paginationMetadata = computed(() => {
633
653
  }
634
654
 
635
655
  return null;
636
- }) as ComputedRef<PaginationMetadata | null>;
656
+ });
637
657
 
638
658
  const page = computed((): number => {
639
659
  if (query.value.page && parseInt(query.value.page + '')) {
@@ -138,18 +138,33 @@
138
138
 
139
139
  <template v-if="toggleable" #sidebarBottom>
140
140
  <div class="mb-3">
141
- <h3
142
- class="mb-1 text-xs font-semibold uppercase tracking-wider text-slate-500"
143
- >
144
- {{ $t('sui.columns') }}
145
- </h3>
146
141
  <BaseCard>
147
142
  <BaseCardRow size="sm">
148
- <BaseDataTableToggleColumns
149
- v-model:visibleColumns="visibleColumns"
150
- :table="table"
151
- @update:visible-columns="onUpdateVisibleColumn"
152
- ></BaseDataTableToggleColumns>
143
+ <button
144
+ type="button"
145
+ class="flex w-full items-center justify-between"
146
+ @click="showColumnsDesktop = !showColumnsDesktop"
147
+ >
148
+ <h2 class="font-semibold">
149
+ {{ $t('sui.columns') }}
150
+ </h2>
151
+
152
+ <BaseIcon
153
+ :icon="
154
+ showColumnsDesktop
155
+ ? 'heroicons:chevron-down'
156
+ : 'heroicons:chevron-up'
157
+ "
158
+ ></BaseIcon>
159
+ </button>
160
+
161
+ <div v-show="showColumnsDesktop" class="mt-4">
162
+ <BaseDataTableToggleColumns
163
+ v-model:visibleColumns="visibleColumns"
164
+ :table="table"
165
+ @update:visible-columns="onUpdateVisibleColumn"
166
+ ></BaseDataTableToggleColumns>
167
+ </div>
153
168
  </BaseCardRow>
154
169
  </BaseCard>
155
170
  </div>
@@ -158,7 +173,7 @@
158
173
  </template>
159
174
 
160
175
  <script lang="ts" setup>
161
- import { PropType, Ref } from 'vue';
176
+ import { PropType } from 'vue';
162
177
  import { CollectionItem, DataTableQuery, MenuItemInterface } from '@/types';
163
178
  import { useDialogsStore } from '@/stores/dialogs';
164
179
  import { useNotificationsStore } from '../stores/notifications';
@@ -180,7 +195,7 @@ const http = config.http;
180
195
  const dialogs = useDialogsStore();
181
196
  const notifications = useNotificationsStore();
182
197
 
183
- const table = ref(null) as Ref<null | InstanceType<typeof BaseTable>>;
198
+ const table = ref<null | InstanceType<typeof BaseTable>>(null);
184
199
 
185
200
  const props = defineProps({
186
201
  /**
@@ -343,9 +358,7 @@ const emit = defineEmits([
343
358
  'check',
344
359
  ]);
345
360
 
346
- const dataIterator = ref(null) as Ref<null | InstanceType<
347
- typeof BaseDataIterator
348
- >>;
361
+ const dataIterator = ref<null | InstanceType<typeof BaseDataIterator>>(null);
349
362
 
350
363
  /*
351
364
  |--------------------------------------------------------------------------
@@ -424,7 +437,9 @@ const onDelete = (row: CollectionItem) => {
424
437
  |--------------------------------------------------------------------------
425
438
  */
426
439
 
427
- const visibleColumns = ref([]) as Ref<number[]>;
440
+ const showColumnsDesktop = ref<boolean>(false);
441
+
442
+ const visibleColumns = ref<number[]>([]);
428
443
 
429
444
  // Find visible columns in local storage
430
445
  const VISIBLE_COLUMNS_LOCAL_STORAGE = 'sprintify.visible_columns.';
@@ -37,7 +37,7 @@
37
37
  </template>
38
38
 
39
39
  <script lang="ts" setup>
40
- import { PropType, Ref } from 'vue';
40
+ import { PropType } from 'vue';
41
41
  import Pikaday from 'pikaday';
42
42
  import { capitalize, padStart } from 'lodash';
43
43
  import { DateTime, Info } from 'luxon';
@@ -94,7 +94,7 @@ const { hasErrorInternal, emitUpdate } = useField({
94
94
 
95
95
  const i18n = useI18n();
96
96
 
97
- const datepicker = ref(null) as Ref<HTMLInputElement | null>;
97
+ const datepicker = ref<HTMLInputElement | null>(null);
98
98
 
99
99
  const months = Info.months('long', { locale: i18n.locale.value }).map((m) =>
100
100
  capitalize(m)
@@ -24,12 +24,11 @@
24
24
  <script lang="ts" setup>
25
25
  import { useResizeObserver } from '@vueuse/core';
26
26
  import { debounce } from 'lodash';
27
- import { Ref } from 'vue';
28
27
  import breakpoints from '../../config/breakpoints.json';
29
28
 
30
29
  const DEFAULT_WIDTH = 800;
31
30
 
32
- const item = ref(null) as Ref<HTMLElement | null>;
31
+ const item = ref<HTMLElement | null>(null);
33
32
  const width = ref(DEFAULT_WIDTH);
34
33
 
35
34
  const mobile = computed(() => {
@@ -76,7 +76,7 @@
76
76
  </template>
77
77
 
78
78
  <script lang="ts" setup>
79
- import { PropType, Ref } from 'vue';
79
+ import { PropType } from 'vue';
80
80
  import { Icon as BaseIcon } from '@iconify/vue';
81
81
 
82
82
  defineProps({
@@ -110,7 +110,7 @@ defineProps({
110
110
 
111
111
  defineEmits(['cancel', 'confirm']);
112
112
 
113
- const confirm = ref(null) as Ref<HTMLButtonElement | null>;
113
+ const confirm = ref<HTMLButtonElement | null>(null);
114
114
 
115
115
  onMounted(() => {
116
116
  if (confirm.value) {
@@ -7,9 +7,7 @@
7
7
  :role="showTooltip ? 'tooltip' : undefined"
8
8
  >
9
9
  <slot name="default" :readable-date="readableDate">
10
- <span
11
- class="cursor-pointer rounded-full px-3 py-1 text-xs text-slate-600 hover:bg-slate-50"
12
- >
10
+ <span class="text-xs text-slate-600">
13
11
  {{ readableDate }}
14
12
  </span>
15
13
  </slot>
@@ -26,7 +24,7 @@ const props = defineProps({
26
24
  type: String,
27
25
  },
28
26
  showTooltip: {
29
- default: true,
27
+ default: false,
30
28
  type: Boolean,
31
29
  },
32
30
  tooltipPosition: {
@@ -61,7 +61,7 @@
61
61
 
62
62
  <script lang="ts" setup>
63
63
  import { isArray } from 'lodash';
64
- import { PropType, Ref } from 'vue';
64
+ import { PropType } from 'vue';
65
65
  import { Option, SelectConfiguration } from '@/types';
66
66
  import BaseDropdown from './BaseDropdown.vue';
67
67
  import BaseAutocomplete from './BaseAutocomplete.vue';
@@ -147,9 +147,9 @@ const componentName = computed(() => {
147
147
  console.error('BaseDropdownAutocomplete: options or url is required');
148
148
  });
149
149
 
150
- const autocomplete = ref(null) as Ref<any>;
150
+ const autocomplete = ref<any>(null);
151
151
 
152
- const newValue = ref(null) as Ref<any>;
152
+ const newValue = ref<any>(null);
153
153
 
154
154
  const autocompleteProps = computed(() => {
155
155
  const newProps = {} as any;
@@ -39,7 +39,7 @@
39
39
  </template>
40
40
 
41
41
  <script lang="ts" setup>
42
- import { PropType, Ref } from 'vue';
42
+ import { PropType } from 'vue';
43
43
  import { serialize } from 'object-to-formdata';
44
44
  import { Method, DataFormat } from '@/types';
45
45
  import { AxiosError, AxiosInstance, AxiosResponse } from 'axios';
@@ -110,10 +110,10 @@ const props = defineProps({
110
110
  const i18n = useI18n();
111
111
  const emit = defineEmits(['error', 'success']);
112
112
 
113
- const form = ref(null) as Ref<null | HTMLFormElement>;
113
+ const form = ref<null | HTMLFormElement>(null);
114
114
  const loading = ref(false);
115
115
  const disabled = ref(false);
116
- const errors = ref({}) as Ref<Record<string, string[]>>;
116
+ const errors = ref<Record<string, string[]>>({});
117
117
 
118
118
  const httpClient = computed((): AxiosInstance => {
119
119
  if (props.axiosInstance) {
@@ -29,7 +29,7 @@
29
29
  import { isEqual } from 'lodash';
30
30
  import { Option } from '@/types';
31
31
  import BaseTagAutocompleteFetch from './BaseTagAutocompleteFetch.vue';
32
- import { PropType, Ref } from 'vue';
32
+ import { PropType } from 'vue';
33
33
 
34
34
  const props = defineProps({
35
35
  modelValue: {
@@ -82,9 +82,9 @@ const props = defineProps({
82
82
 
83
83
  const emit = defineEmits(['update:modelValue']);
84
84
 
85
- const tagAutocompleteFetch = ref(null) as Ref<InstanceType<
85
+ const tagAutocompleteFetch = ref<InstanceType<
86
86
  typeof BaseTagAutocompleteFetch
87
- > | null>;
87
+ > | null>(null);
88
88
 
89
89
  const models = ref(props.currentModels);
90
90
 
@@ -4,55 +4,24 @@
4
4
  class="text-sm leading-tight text-slate-800"
5
5
  v-html="notification.text"
6
6
  ></div>
7
- <p v-if="createdAt" class="mt-1 text-xs text-slate-400">
8
- {{ createdAt }}
9
- </p>
7
+ <BaseDisplayRelativeTime
8
+ v-if="notification.created_at"
9
+ v-slot="{ readableDate }"
10
+ :value="notification.created_at"
11
+ >
12
+ <p class="mt-1 text-xs text-slate-400">
13
+ {{ readableDate }}
14
+ </p>
15
+ </BaseDisplayRelativeTime>
10
16
  </div>
11
17
  </template>
12
18
 
13
19
  <script lang="ts" setup>
14
20
  import { Notification } from '@/types/Notification';
15
- import { DateTime } from 'luxon';
16
- import { PropType } from 'vue';
17
- import humanizeDuration from 'humanize-duration';
21
+ import BaseDisplayRelativeTime from './BaseDisplayRelativeTime.vue';
18
22
 
19
- const i18n = useI18n();
20
-
21
- const props = defineProps({
22
- active: {
23
- default: false,
24
- type: Boolean,
25
- },
26
- notification: {
27
- required: true,
28
- type: Object as PropType<Notification>,
29
- },
30
- });
31
-
32
- const now = ref(DateTime.now().toSeconds());
33
-
34
- const intervalId = setInterval(() => {
35
- now.value += 1;
36
- }, 1000);
37
-
38
- const createdAt = computed(() => {
39
- if (props.notification.created_at) {
40
- const nowLuxon = DateTime.fromSeconds(now.value);
41
- const duration = DateTime.fromISO(props.notification.created_at, {
42
- zone: 'utc',
43
- }).diff(nowLuxon).milliseconds;
44
-
45
- const durationHuman = humanizeDuration(duration, {
46
- language: i18n.locale.value,
47
- round: true,
48
- largest: 1,
49
- });
50
-
51
- return i18n.t('sui.x_ago', { duration: durationHuman });
52
- }
53
- });
54
-
55
- onBeforeUnmount(() => {
56
- clearInterval(intervalId);
57
- });
23
+ defineProps<{
24
+ active: boolean;
25
+ notification: Notification;
26
+ }>();
58
27
  </script>
@@ -1,3 +1,4 @@
1
+ import { DateTime } from 'luxon';
1
2
  import BaseContainer from './BaseContainer.vue';
2
3
  import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
3
4
 
@@ -96,7 +97,7 @@ export default {
96
97
  {
97
98
  id: '1',
98
99
  text: 'You have a new message',
99
- created_at: '2022-01-01T00:00:00',
100
+ created_at: DateTime.now().minus({ second: 1 }).toISO(),
100
101
  },
101
102
  {
102
103
  id: '2',
@@ -96,7 +96,6 @@
96
96
  <script lang="ts" setup>
97
97
  import { useResizeObserver } from '@vueuse/core';
98
98
  import { debounce, isNumber, range } from 'lodash';
99
- import { Ref } from 'vue';
100
99
 
101
100
  const props = defineProps({
102
101
  modelValue: {
@@ -116,8 +115,8 @@ const props = defineProps({
116
115
 
117
116
  const emit = defineEmits(['update:model-value']);
118
117
 
119
- const manualPage = ref(null) as Ref<null | string | number>;
120
- const manualPageMobile = ref(props.modelValue) as Ref<null | string | number>;
118
+ const manualPage = ref<null | string | number>(null);
119
+ const manualPageMobile = ref<null | string | number>(props.modelValue);
121
120
 
122
121
  watch(
123
122
  () => props.modelValue,
@@ -140,7 +139,7 @@ function previous() {
140
139
  updateModalValue(props.modelValue - 1);
141
140
  }
142
141
 
143
- const paginationNode = ref(null) as Ref<null | HTMLElement>;
142
+ const paginationNode = ref<null | HTMLElement>(null);
144
143
  const width = ref(800);
145
144
 
146
145
  useResizeObserver(paginationNode, () => {
@@ -20,9 +20,9 @@
20
20
 
21
21
  <script lang="ts" setup>
22
22
  import { useMutationObserver } from '@vueuse/core';
23
- import { Ref, StyleValue } from 'vue';
23
+ import { StyleValue } from 'vue';
24
24
 
25
- const content = ref(null) as Ref<null | HTMLParagraphElement>;
25
+ const content = ref<null | HTMLParagraphElement>(null);
26
26
 
27
27
  const props = defineProps({
28
28
  maxLines: {
@@ -162,10 +162,10 @@ function updateChange(value: string | null): string | null {
162
162
  }
163
163
  }
164
164
  blockquote {
165
- @apply text-base;
165
+ @apply my-5 text-base;
166
166
  }
167
167
  pre {
168
- @apply p-4 text-sm;
168
+ @apply my-5 p-4 text-sm;
169
169
  }
170
170
  }
171
171
  h1,
@@ -27,7 +27,7 @@
27
27
  </template>
28
28
 
29
29
  <script lang="ts" setup>
30
- import { PropType, Ref } from 'vue';
30
+ import { PropType } from 'vue';
31
31
  import { get, isEqual } from 'lodash';
32
32
  import { useMutationObserver } from '@vueuse/core';
33
33
  import { useField } from '@/composables/field';
@@ -64,7 +64,7 @@ const props = defineProps({
64
64
  },
65
65
  });
66
66
 
67
- const select = ref(null) as Ref<HTMLSelectElement | null>;
67
+ const select = ref<HTMLSelectElement | null>(null);
68
68
 
69
69
  const emit = defineEmits(['update:modelValue']);
70
70
 
@@ -278,7 +278,7 @@ export default {
278
278
  </script>
279
279
 
280
280
  <script lang="ts" setup>
281
- import { PropType, ref, Ref } from 'vue';
281
+ import { PropType, ref } from 'vue';
282
282
  import { BaseTableColumn, MenuItemInterface, Row } from '@/types';
283
283
  import SlotComponent from './SlotComponent';
284
284
  import { useResizeObserver } from '@vueuse/core';
@@ -385,16 +385,16 @@ const emit = defineEmits([
385
385
  'cell-click',
386
386
  ]);
387
387
 
388
- const visibleDetailRows = ref([]) as Ref<Row[]>;
389
- const newCheckedRows = ref([...props.checkedRows]) as Ref<Row[]>;
390
- const lastCheckedRowIndex = ref(null) as Ref<number | null>;
391
- const currentSortColumn = ref(null) as Ref<BaseTableColumn | null>;
388
+ const visibleDetailRows = ref<Row[]>([]);
389
+ const newCheckedRows = ref<Row[]>([...props.checkedRows]);
390
+ const lastCheckedRowIndex = ref<number | null>(null);
391
+ const currentSortColumn = ref<BaseTableColumn | null>(null);
392
392
  const isAsc = ref(true);
393
- const defaultSlots = ref([]) as Ref<BaseTableColumn[]>;
393
+ const defaultSlots = ref<BaseTableColumn[]>([]);
394
394
  const sequence = ref(1);
395
395
 
396
- const slot = ref(null) as Ref<HTMLElement | null>;
397
- const thead = ref(null) as Ref<HTMLElement | null>;
396
+ const slot = ref<HTMLElement | null>(null);
397
+ const thead = ref<HTMLElement | null>(null);
398
398
  const theadHeight = ref(0);
399
399
 
400
400
  useResizeObserver(thead, () => setTheadHeightDebounce());
@@ -89,7 +89,7 @@
89
89
 
90
90
  <script lang="ts" setup>
91
91
  import { cloneDeep, get } from 'lodash';
92
- import { PropType, Ref, ComputedRef } from 'vue';
92
+ import { PropType, ComputedRef } from 'vue';
93
93
  import { NormalizedOption, Option } from '@/types';
94
94
  import { useHasOptions } from '@/composables/hasOptions';
95
95
  import { useField } from '@/composables/field';
@@ -190,16 +190,14 @@ const hasOptions = useHasOptions(
190
190
  computed(() => true)
191
191
  );
192
192
 
193
- const drawer = ref(null) as Ref<InstanceType<
194
- typeof BaseAutocompleteDrawer
195
- > | null>;
193
+ const drawer = ref<InstanceType<typeof BaseAutocompleteDrawer> | null>(null);
196
194
 
197
195
  const keywords = ref('');
198
- const autocomplete = ref(null) as Ref<HTMLElement | null>;
199
- const inputElement = ref(null) as Ref<HTMLInputElement | null>;
196
+ const autocomplete = ref<HTMLElement | null>(null);
197
+ const inputElement = ref<HTMLInputElement | null>(null);
200
198
  const shouldFilter = ref(false);
201
199
  const opened = ref(false);
202
- const selectionToDelete = ref(null) as Ref<NormalizedOption | null>;
200
+ const selectionToDelete = ref<NormalizedOption | null>(null);
203
201
 
204
202
  const isSelected = hasOptions.isSelected;
205
203
  const normalizedOptions = hasOptions.normalizedOptions;
@@ -41,7 +41,7 @@
41
41
  <script lang="ts" setup>
42
42
  import { debounce, throttle } from 'lodash';
43
43
  import { config } from '@/index';
44
- import { PropType, Ref } from 'vue';
44
+ import { PropType } from 'vue';
45
45
  import { Option } from '@/types';
46
46
  import BaseTagAutocomplete from './BaseTagAutocomplete.vue';
47
47
 
@@ -90,9 +90,9 @@ const props = defineProps({
90
90
 
91
91
  defineEmits(['update:modelValue', 'typing', 'focus', 'scrollBottom']);
92
92
 
93
- const tagAutocomplete = ref(null) as Ref<InstanceType<
94
- typeof BaseTagAutocomplete
95
- > | null>;
93
+ const tagAutocomplete = ref<InstanceType<typeof BaseTagAutocomplete> | null>(
94
+ null
95
+ );
96
96
 
97
97
  const http = config.http;
98
98
 
@@ -102,7 +102,7 @@ const firstSearch = ref(false);
102
102
  const reachedEnd = ref(false);
103
103
  const keywords = ref('');
104
104
  const page = ref(1);
105
- const options = ref([]) as Ref<Option[]>;
105
+ const options = ref<Option[]>([]);
106
106
 
107
107
  const onTyping = (query: string) => {
108
108
  page.value = 1;
@@ -41,7 +41,6 @@
41
41
 
42
42
  <script lang="ts" setup>
43
43
  import { useField } from '@/composables/field';
44
- import { Ref } from 'vue';
45
44
 
46
45
  const BASE_TEXTAREA_CLASSES =
47
46
  'py-2 px-3 font-normal text-base disabled:cursor-not-allowed disabled:text-slate-300 font-sans rounded leading-normal tracking-normal border';
@@ -104,7 +103,7 @@ const { nameInternal, requiredInternal, hasErrorInternal, emitUpdate } =
104
103
  emit: emit,
105
104
  });
106
105
 
107
- const wrapper = ref(null) as Ref<null | HTMLDivElement>;
106
+ const wrapper = ref<null | HTMLDivElement>(null);
108
107
 
109
108
  const keys = {} as { [key: string]: boolean };
110
109