vueless 0.0.532 → 0.0.534

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 (51) hide show
  1. package/package.json +1 -1
  2. package/types.ts +12 -0
  3. package/ui.data-table/UTable.vue +16 -7
  4. package/ui.data-table/UTableRow.vue +0 -2
  5. package/ui.data-table/utilTable.ts +5 -1
  6. package/ui.image-avatar/UAvatar.vue +51 -115
  7. package/ui.image-avatar/storybook/Docs.mdx +2 -2
  8. package/ui.image-avatar/storybook/{stories.js → stories.ts} +13 -5
  9. package/ui.image-avatar/types.ts +71 -0
  10. package/ui.image-avatar/useAttrs.ts +18 -0
  11. package/ui.image-icon/UIcon.vue +28 -113
  12. package/ui.image-icon/storybook/Docs.mdx +1 -1
  13. package/ui.image-icon/storybook/{stories.js → stories.ts} +13 -5
  14. package/ui.image-icon/types.ts +83 -0
  15. package/ui.image-icon/useAttrs.ts +18 -0
  16. package/ui.navigation-pagination/UPagination.vue +141 -262
  17. package/ui.navigation-pagination/storybook/Docs.mdx +2 -2
  18. package/ui.navigation-pagination/storybook/{stories.js → stories.ts} +11 -4
  19. package/ui.navigation-pagination/types.ts +85 -0
  20. package/ui.navigation-pagination/{useAttrs.js → useAttrs.ts} +5 -2
  21. package/ui.navigation-progress/StepperProgress.vue +26 -47
  22. package/ui.navigation-progress/UProgress.vue +60 -118
  23. package/ui.navigation-progress/{config.js → config.ts} +1 -0
  24. package/ui.navigation-progress/storybook/Docs.mdx +2 -2
  25. package/ui.navigation-progress/storybook/{stories.js → stories.ts} +19 -7
  26. package/ui.navigation-progress/types.ts +93 -0
  27. package/ui.navigation-progress/{useAttrs.js → useAttrs.ts} +6 -3
  28. package/ui.navigation-tab/UTab.vue +18 -54
  29. package/ui.navigation-tab/storybook/Docs.mdx +2 -2
  30. package/ui.navigation-tab/storybook/{stories.js → stories.ts} +10 -5
  31. package/ui.navigation-tab/types.ts +30 -0
  32. package/ui.navigation-tab/{useAttrs.js → useAttrs.ts} +15 -3
  33. package/ui.navigation-tabs/UTabs.vue +29 -78
  34. package/ui.navigation-tabs/storybook/Docs.mdx +2 -2
  35. package/ui.navigation-tabs/storybook/{stories.js → stories.ts} +13 -5
  36. package/ui.navigation-tabs/types.ts +37 -0
  37. package/ui.navigation-tabs/useAttrs.ts +18 -0
  38. package/web-types.json +146 -77
  39. package/ui.image-avatar/useAttrs.js +0 -15
  40. package/ui.image-icon/useAttrs.js +0 -15
  41. package/ui.navigation-tabs/useAttrs.js +0 -15
  42. /package/ui.image-avatar/{config.js → config.ts} +0 -0
  43. /package/ui.image-avatar/{constants.js → constants.ts} +0 -0
  44. /package/ui.image-icon/{constants.js → constants.ts} +0 -0
  45. /package/ui.navigation-pagination/{config.js → config.ts} +0 -0
  46. /package/ui.navigation-pagination/{constants.js → constants.ts} +0 -0
  47. /package/ui.navigation-progress/{constants.js → constants.ts} +0 -0
  48. /package/ui.navigation-tab/{config.js → config.ts} +0 -0
  49. /package/ui.navigation-tab/{constants.js → constants.ts} +0 -0
  50. /package/ui.navigation-tabs/{config.js → config.ts} +0 -0
  51. /package/ui.navigation-tabs/{constants.js → constants.ts} +0 -0
@@ -3,6 +3,14 @@ import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybo
3
3
  import UIcon from "../../ui.image-icon/UIcon.vue";
4
4
  import URow from "../../ui.container-row/URow.vue";
5
5
 
6
+ import type { Meta, StoryFn } from "@storybook/vue3";
7
+ import type { UIconProps } from "../types.ts";
8
+
9
+ interface UIconArgs extends UIconProps {
10
+ slotTemplate?: string;
11
+ enum: "color" | "size" | "variant";
12
+ }
13
+
6
14
  /**
7
15
  * The `UIcon` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.image-icon)
8
16
  */
@@ -16,9 +24,9 @@ export default {
16
24
  argTypes: {
17
25
  ...getArgTypes(UIcon.__name),
18
26
  },
19
- };
27
+ } as Meta;
20
28
 
21
- const DefaultTemplate = (args) => ({
29
+ const DefaultTemplate: StoryFn<UIconArgs> = (args: UIconArgs) => ({
22
30
  components: { UIcon },
23
31
  setup() {
24
32
  const slots = getSlotNames(UIcon.__name);
@@ -27,17 +35,17 @@ const DefaultTemplate = (args) => ({
27
35
  },
28
36
  template: `
29
37
  <UIcon v-bind="args">
30
- ${args.slotTemplate || getSlotsFragment()}
38
+ ${args.slotTemplate || getSlotsFragment("")}
31
39
  </UIcon>
32
40
  `,
33
41
  });
34
42
 
35
- const EnumVariantTemplate = (args, { argTypes }) => ({
43
+ const EnumVariantTemplate: StoryFn<UIconArgs> = (args: UIconArgs, { argTypes }) => ({
36
44
  components: { UIcon, URow },
37
45
  setup() {
38
46
  return {
39
47
  args,
40
- options: argTypes[args.enum].options,
48
+ options: argTypes?.[args.enum]?.options,
41
49
  };
42
50
  },
43
51
  template: `
@@ -0,0 +1,83 @@
1
+ import defaultConfig from "./config.ts";
2
+
3
+ export type Config = Partial<typeof defaultConfig>;
4
+
5
+ export interface UIconProps {
6
+ /**
7
+ * Icon name.
8
+ */
9
+ name?: string;
10
+
11
+ /**
12
+ * Icon source (svg as a vue component).
13
+ */
14
+ src?: object;
15
+
16
+ /**
17
+ * Icon color.
18
+ */
19
+ color?:
20
+ | "brand"
21
+ | "grayscale"
22
+ | "gray"
23
+ | "red"
24
+ | "orange"
25
+ | "amber"
26
+ | "yellow"
27
+ | "lime"
28
+ | "green"
29
+ | "emerald"
30
+ | "teal"
31
+ | "cyan"
32
+ | "sky"
33
+ | "blue"
34
+ | "indigo"
35
+ | "violet"
36
+ | "purple"
37
+ | "fuchsia"
38
+ | "pink"
39
+ | "rose"
40
+ | "black"
41
+ | "white";
42
+
43
+ /**
44
+ * Icon size.
45
+ */
46
+ size?: "4xs" | "3xs" | "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl";
47
+
48
+ /**
49
+ * Icon variant.
50
+ */
51
+ variant?: "light" | "default" | "dark";
52
+
53
+ /**
54
+ * Make the icon interactive (cursor pointer, etc.).
55
+ */
56
+ interactive?: boolean;
57
+
58
+ /**
59
+ * Add tooltip text on hover.
60
+ */
61
+ tooltip?: string;
62
+
63
+ /**
64
+ * Tooltip settings.
65
+ * [See all settings here](https://kabbouchi.github.io/vue-tippy/4.0/features/placement.html).
66
+ */
67
+ tooltipSettings?: object;
68
+
69
+ /**
70
+ * Mark that Icon used inside Vueless components (used to get icons from vueless library).
71
+ */
72
+ internal?: boolean;
73
+
74
+ /**
75
+ * Component config object.
76
+ */
77
+ config?: Partial<typeof defaultConfig>;
78
+
79
+ /**
80
+ * Data-test attribute for automated testing.
81
+ */
82
+ dataTest?: string;
83
+ }
@@ -0,0 +1,18 @@
1
+ import useUI from "../composables/useUI.ts";
2
+
3
+ import defaultConfig from "./config.ts";
4
+
5
+ import type { UseAttrs } from "../types.ts";
6
+ import type { UIconProps, Config } from "./types.ts";
7
+
8
+ export default function useAttrs(props: UIconProps): UseAttrs<Config> {
9
+ const { config, getKeysAttrs, hasSlotContent } = useUI<Config>(defaultConfig, () => props.config);
10
+
11
+ const keysAttrs = getKeysAttrs();
12
+
13
+ return {
14
+ config,
15
+ ...keysAttrs,
16
+ hasSlotContent,
17
+ };
18
+ }
@@ -1,3 +1,144 @@
1
+ <script lang="ts" setup>
2
+ import { computed } from "vue";
3
+ import { range } from "lodash-es";
4
+
5
+ import UButton from "../ui.button/UButton.vue";
6
+ import UIcon from "../ui.image-icon/UIcon.vue";
7
+ import { getDefault } from "../utils/ui.ts";
8
+
9
+ import defaultConfig from "./config.ts";
10
+ import { UPagination } from "./constants.ts";
11
+ import useAttrs from "./useAttrs.ts";
12
+
13
+ import type { UPaginationProps } from "./types.ts";
14
+
15
+ defineOptions({ inheritAttrs: false });
16
+
17
+ const props = withDefaults(defineProps<UPaginationProps>(), {
18
+ perPage: getDefault<UPaginationProps>(defaultConfig, UPagination).perPage,
19
+ limit: getDefault<UPaginationProps>(defaultConfig, UPagination).limit,
20
+ variant: getDefault<UPaginationProps>(defaultConfig, UPagination).variant,
21
+ size: getDefault<UPaginationProps>(defaultConfig, UPagination).size,
22
+ disabled: getDefault<UPaginationProps>(defaultConfig, UPagination).disabled,
23
+ ellipsis: getDefault<UPaginationProps>(defaultConfig, UPagination).ellipsis,
24
+ showFirst: getDefault<UPaginationProps>(defaultConfig, UPagination).showFirst,
25
+ showLast: getDefault<UPaginationProps>(defaultConfig, UPagination).showLast,
26
+ dataTest: "",
27
+ });
28
+
29
+ const emit = defineEmits([
30
+ /**
31
+ * Triggers when current page changes.
32
+ * @property {number} value
33
+ */
34
+ "change",
35
+
36
+ /**
37
+ * Triggers when current page changes.
38
+ * @property {number} value
39
+ */
40
+ "update:modelValue",
41
+ ]);
42
+
43
+ const {
44
+ config,
45
+ paginationAttrs,
46
+ firstButtonAttrs,
47
+ lastButtonAttrs,
48
+ prevButtonAttrs,
49
+ nextButtonAttrs,
50
+ activeButtonAttrs,
51
+ inactiveButtonAttrs,
52
+ lastIconAttrs,
53
+ firstIconAttrs,
54
+ prevIconAttrs,
55
+ nextIconAttrs,
56
+ } = useAttrs(props);
57
+
58
+ const currentPage = computed({
59
+ get: () => props.modelValue,
60
+ set: (value) => {
61
+ emit("update:modelValue", value);
62
+ emit("change", value);
63
+ },
64
+ });
65
+
66
+ const buttonSize = computed(() => {
67
+ const sizes = {
68
+ sm: "xs",
69
+ md: "sm",
70
+ lg: "md",
71
+ };
72
+
73
+ return sizes[props.size];
74
+ });
75
+
76
+ const iconSize = computed(() => {
77
+ const sizes = {
78
+ sm: "xs",
79
+ md: "sm",
80
+ lg: "md",
81
+ };
82
+
83
+ return sizes[props.size];
84
+ });
85
+
86
+ const totalPages = computed(() => {
87
+ return props.perPage > 0 ? Math.ceil(props.total / props.perPage) : 0;
88
+ });
89
+
90
+ const pageButtons = computed(() => {
91
+ const from1 = Number(currentPage.value) - Math.round(props.limit / 2) + 1;
92
+ const from2 = totalPages.value + 1 - props.limit;
93
+
94
+ const from = Math.max(Math.min(from1, from2), 1);
95
+ const to = Math.min(from + props.limit - 1, totalPages.value);
96
+
97
+ return range(from, to + 1).map((page) => {
98
+ if (props.ellipsis && page === from && from > 1) {
99
+ return { number: -Infinity };
100
+ }
101
+
102
+ if (props.ellipsis && page === to && to < totalPages.value) {
103
+ return { number: Infinity };
104
+ }
105
+
106
+ return { number: page, isActive: page === currentPage.value };
107
+ });
108
+ });
109
+
110
+ const prevIsDisabled = computed(() => {
111
+ return props.disabled || currentPage.value === null || currentPage.value <= 1;
112
+ });
113
+
114
+ const nextIsDisabled = computed(() => {
115
+ return props.disabled || currentPage.value === null || currentPage.value >= totalPages.value;
116
+ });
117
+
118
+ function selectPage(page: number) {
119
+ currentPage.value = page;
120
+ }
121
+
122
+ function goToPrevPage() {
123
+ currentPage.value = currentPage.value === null ? 1 : Math.max(currentPage.value - 1, 1);
124
+ }
125
+
126
+ function goToNextPage() {
127
+ currentPage.value =
128
+ currentPage.value === null
129
+ ? totalPages.value
130
+ : Math.min(currentPage.value + 1, totalPages.value);
131
+ }
132
+
133
+ function goToFirstPage() {
134
+ currentPage.value = 1;
135
+ }
136
+
137
+ function goToLastPage() {
138
+ currentPage.value = totalPages.value;
139
+ }
140
+ </script>
141
+
1
142
  <template>
2
143
  <div v-bind="paginationAttrs">
3
144
  <UButton
@@ -134,265 +275,3 @@
134
275
  </UButton>
135
276
  </div>
136
277
  </template>
137
-
138
- <script setup>
139
- import { computed } from "vue";
140
- import { range } from "lodash-es";
141
-
142
- import UButton from "../ui.button/UButton.vue";
143
- import UIcon from "../ui.image-icon/UIcon.vue";
144
- import { getDefault } from "../utils/ui.ts";
145
-
146
- import defaultConfig from "./config.js";
147
- import { UPagination } from "./constants.js";
148
- import useAttrs from "./useAttrs.js";
149
-
150
- defineOptions({ inheritAttrs: false });
151
-
152
- const props = defineProps({
153
- /**
154
- * Current page number.
155
- */
156
- modelValue: {
157
- type: Number,
158
- default: null,
159
- },
160
-
161
- /**
162
- * Number of items per page.
163
- */
164
- perPage: {
165
- type: Number,
166
- default: getDefault(defaultConfig, UPagination).perPage,
167
- validator: (value) => value > 0,
168
- },
169
-
170
- /**
171
- * Total number of items.
172
- */
173
- total: {
174
- type: Number,
175
- default: 0,
176
- validator: (value) => value >= 0,
177
- },
178
-
179
- /**
180
- * Limit of visible pages.
181
- */
182
- limit: {
183
- type: Number,
184
- default: getDefault(defaultConfig, UPagination).limit,
185
- validator: (value) => value >= 0,
186
- },
187
-
188
- /**
189
- * Pagination variant.
190
- * @values primary, secondary, thirdary
191
- */
192
- variant: {
193
- type: String,
194
- default: getDefault(defaultConfig, UPagination).variant,
195
- },
196
-
197
- /**
198
- * Pagination size.
199
- * @values sm, md, lg
200
- */
201
- size: {
202
- type: String,
203
- default: getDefault(defaultConfig, UPagination).size,
204
- },
205
-
206
- /**
207
- * First button label.
208
- */
209
- firstLabel: {
210
- type: String,
211
- default: "",
212
- },
213
-
214
- /**
215
- * Prev button label.
216
- */
217
- prevLabel: {
218
- type: String,
219
- default: "",
220
- },
221
-
222
- /**
223
- * Next button label.
224
- */
225
- nextLabel: {
226
- type: String,
227
- default: "",
228
- },
229
-
230
- /**
231
- * Last button label.
232
- */
233
- lastLabel: {
234
- type: String,
235
- default: "",
236
- },
237
-
238
- /**
239
- * Disable navigation buttons.
240
- */
241
- disabled: {
242
- type: Boolean,
243
- default: getDefault(defaultConfig, UPagination).disabled,
244
- },
245
-
246
- /**
247
- * Show ellipsis.
248
- */
249
- ellipsis: {
250
- type: Boolean,
251
- default: getDefault(defaultConfig, UPagination).ellipsis,
252
- },
253
-
254
- /**
255
- * Show the first control.
256
- */
257
- showFirst: {
258
- type: Boolean,
259
- default: getDefault(defaultConfig, UPagination).showLast,
260
- },
261
-
262
- /**
263
- * Show the last control.
264
- */
265
- showLast: {
266
- type: Boolean,
267
- default: getDefault(defaultConfig, UPagination).showLast,
268
- },
269
-
270
- /**
271
- * Component config object.
272
- */
273
- config: {
274
- type: Object,
275
- default: () => ({}),
276
- },
277
-
278
- /**
279
- * Data-test attribute for automated testing.
280
- */
281
- dataTest: {
282
- type: String,
283
- default: "",
284
- },
285
- });
286
-
287
- const emit = defineEmits([
288
- /**
289
- * Triggers when current page changes.
290
- * @property {number} value
291
- */
292
- "change",
293
-
294
- /**
295
- * Triggers when current page changes.
296
- * @property {number} value
297
- */
298
- "update:modelValue",
299
- ]);
300
-
301
- const {
302
- config,
303
- paginationAttrs,
304
- firstButtonAttrs,
305
- lastButtonAttrs,
306
- prevButtonAttrs,
307
- nextButtonAttrs,
308
- activeButtonAttrs,
309
- inactiveButtonAttrs,
310
- lastIconAttrs,
311
- firstIconAttrs,
312
- prevIconAttrs,
313
- nextIconAttrs,
314
- } = useAttrs(props);
315
-
316
- const currentPage = computed({
317
- get: () => props.modelValue,
318
- set: (value) => {
319
- emit("update:modelValue", value);
320
- emit("change", value);
321
- },
322
- });
323
-
324
- const buttonSize = computed(() => {
325
- const sizes = {
326
- sm: "xs",
327
- md: "sm",
328
- lg: "md",
329
- };
330
-
331
- return sizes[props.size];
332
- });
333
-
334
- const iconSize = computed(() => {
335
- const sizes = {
336
- sm: "xs",
337
- md: "sm",
338
- lg: "md",
339
- };
340
-
341
- return sizes[props.size];
342
- });
343
-
344
- const totalPages = computed(() => {
345
- return props.perPage > 0 ? Math.ceil(props.total / props.perPage) : 0;
346
- });
347
-
348
- const pageButtons = computed(() => {
349
- const from1 = Number(currentPage.value) - Math.round(props.limit / 2) + 1;
350
- const from2 = totalPages.value + 1 - props.limit;
351
-
352
- const from = Math.max(Math.min(from1, from2), 1);
353
- const to = Math.min(from + props.limit - 1, totalPages.value);
354
-
355
- return range(from, to + 1).map((page) => {
356
- if (props.ellipsis && page === from && from > 1) {
357
- return { number: -Infinity };
358
- }
359
-
360
- if (props.ellipsis && page === to && to < totalPages.value) {
361
- return { number: Infinity };
362
- }
363
-
364
- return { number: page, isActive: page === currentPage.value };
365
- });
366
- });
367
-
368
- const prevIsDisabled = computed(() => {
369
- return props.disabled || currentPage.value === null || currentPage.value <= 1;
370
- });
371
-
372
- const nextIsDisabled = computed(() => {
373
- return props.disabled || currentPage.value === null || currentPage.value >= totalPages.value;
374
- });
375
-
376
- function selectPage(page) {
377
- currentPage.value = page;
378
- }
379
-
380
- function goToPrevPage() {
381
- currentPage.value = currentPage.value === null ? 1 : Math.max(currentPage.value - 1, 1);
382
- }
383
-
384
- function goToNextPage() {
385
- currentPage.value =
386
- currentPage.value === null
387
- ? totalPages.value
388
- : Math.min(currentPage.value + 1, totalPages.value);
389
- }
390
-
391
- function goToFirstPage() {
392
- currentPage.value = 1;
393
- }
394
-
395
- function goToLastPage() {
396
- currentPage.value = totalPages.value;
397
- }
398
- </script>
@@ -1,8 +1,8 @@
1
1
  import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
2
2
  import { getSource } from "../../utils/storybook.ts";
3
3
 
4
- import * as stories from "./stories.js";
5
- import defaultConfig from "../config.js?raw"
4
+ import * as stories from "./stories.ts";
5
+ import defaultConfig from "../config.ts?raw"
6
6
 
7
7
  <Meta of={stories} />
8
8
  <Title of={stories} />
@@ -2,6 +2,13 @@ import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybo
2
2
 
3
3
  import UPagination from "../../ui.navigation-pagination/UPagination.vue";
4
4
 
5
+ import type { Meta, StoryFn } from "@storybook/vue3";
6
+ import type { UPaginationProps } from "../types.ts";
7
+
8
+ interface UPaginationArgs extends UPaginationProps {
9
+ slotTemplate?: string;
10
+ }
11
+
5
12
  /**
6
13
  * The `UPagination` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.navigation-pagination)
7
14
  */
@@ -16,9 +23,9 @@ export default {
16
23
  argTypes: {
17
24
  ...getArgTypes(UPagination.__name),
18
25
  },
19
- };
26
+ } as Meta;
20
27
 
21
- const DefaultTemplate = (args) => ({
28
+ const DefaultTemplate: StoryFn<UPaginationArgs> = (args: UPaginationArgs) => ({
22
29
  components: { UPagination },
23
30
  setup() {
24
31
  const slots = getSlotNames(UPagination.__name);
@@ -27,7 +34,7 @@ const DefaultTemplate = (args) => ({
27
34
  },
28
35
  template: `
29
36
  <UPagination v-bind="args" v-model="args.modelValue">
30
- ${args.slotTemplate || getSlotsFragment()}
37
+ ${args.slotTemplate || getSlotsFragment("")}
31
38
  </UPagination>
32
39
  `,
33
40
  });
@@ -42,7 +49,7 @@ export const Limit = DefaultTemplate.bind({});
42
49
  Limit.args = { limit: 3 };
43
50
 
44
51
  export const HideEllipsis = DefaultTemplate.bind({});
45
- HideEllipsis.args = { ellipses: false };
52
+ HideEllipsis.args = { ellipsis: false };
46
53
 
47
54
  export const Disabled = DefaultTemplate.bind({});
48
55
  Disabled.args = { disabled: true };
@@ -0,0 +1,85 @@
1
+ import defaultConfig from "./config.ts";
2
+
3
+ export type Config = Partial<typeof defaultConfig>;
4
+
5
+ export interface UPaginationProps {
6
+ /**
7
+ * Current page number.
8
+ */
9
+ modelValue?: number;
10
+
11
+ /**
12
+ * Number of items per page.
13
+ */
14
+ perPage?: number;
15
+
16
+ /**
17
+ * Total number of items.
18
+ */
19
+ total?: number;
20
+
21
+ /**
22
+ * Limit of visible pages.
23
+ */
24
+ limit?: number;
25
+
26
+ /**
27
+ * Pagination variant.
28
+ */
29
+ variant?: "primary" | "secondary" | "thirdary";
30
+
31
+ /**
32
+ * Pagination size.
33
+ */
34
+ size?: "sm" | "md" | "lg";
35
+
36
+ /**
37
+ * First button label.
38
+ */
39
+ firstLabel?: string;
40
+
41
+ /**
42
+ * Prev button label.
43
+ */
44
+ prevLabel?: string;
45
+
46
+ /**
47
+ * Next button label.
48
+ */
49
+ nextLabel?: string;
50
+
51
+ /**
52
+ * Last button label.
53
+ */
54
+ lastLabel?: string;
55
+
56
+ /**
57
+ * Disable navigation buttons.
58
+ */
59
+ disabled?: boolean;
60
+
61
+ /**
62
+ * Show ellipsis.
63
+ */
64
+ ellipsis?: boolean;
65
+
66
+ /**
67
+ * Show the first control.
68
+ */
69
+ showFirst?: boolean;
70
+
71
+ /**
72
+ * Show the last control.
73
+ */
74
+ showLast?: boolean;
75
+
76
+ /**
77
+ * Component config object.
78
+ */
79
+ config?: Partial<typeof defaultConfig>;
80
+
81
+ /**
82
+ * Data-test attribute for automated testing.
83
+ */
84
+ dataTest?: string;
85
+ }
@@ -3,8 +3,11 @@ import useUI from "../composables/useUI.ts";
3
3
 
4
4
  import defaultConfig from "./config.js";
5
5
 
6
- export default function useAttrs(props) {
7
- const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
6
+ import type { UseAttrs } from "../types.ts";
7
+ import type { UPaginationProps, Config } from "./types.ts";
8
+
9
+ export default function useAttrs(props: UPaginationProps): UseAttrs<Config> {
10
+ const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI<Config>(
8
11
  defaultConfig,
9
12
  () => props.config,
10
13
  );