@weni/unnnic-system 2.0.13 → 2.0.14

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.
@@ -0,0 +1,103 @@
1
+ import UnnnicTableNext from '../components/TableNext/TableNext.vue';
2
+ import UnnnicButton from '../components/Button/Button.vue';
3
+
4
+ export default {
5
+ title: 'example/TableNext',
6
+ component: UnnnicTableNext,
7
+ argTypes: {},
8
+ render: (args) => ({
9
+ components: {
10
+ UnnnicTableNext,
11
+ },
12
+ setup() {
13
+ return { args };
14
+ },
15
+ data() {
16
+ return {
17
+ pagination: 1,
18
+ table: {
19
+ headers: [
20
+ {
21
+ content: 'ID',
22
+ },
23
+ {
24
+ content: 'Name',
25
+ },
26
+ {
27
+ content: 'Age',
28
+ },
29
+ {
30
+ content: 'Country',
31
+ },
32
+ {
33
+ content: 'Add with friend',
34
+ },
35
+ ],
36
+ rows: [],
37
+ },
38
+ };
39
+ },
40
+ template: `
41
+ <UnnnicTableNext
42
+ v-bind="args"
43
+ :headers="table.headers"
44
+ :rows="args.rows || table.rows"
45
+ v-model:pagination="pagination"
46
+ :paginationTotal="125"
47
+ />
48
+ `,
49
+ }),
50
+ };
51
+ const addButton = {
52
+ component: UnnnicButton,
53
+ props: {
54
+ text: 'Add',
55
+ type: 'tertiary',
56
+ iconLeft: 'add',
57
+ size: 'small',
58
+ },
59
+ events: {
60
+ click: (event) => {
61
+ event.preventDefault();
62
+ // eslint-disable-next-line no-alert
63
+ console.log('click');
64
+ },
65
+ },
66
+ };
67
+
68
+ export const Default = {
69
+ args: {
70
+ rows: [
71
+ {
72
+ content: ['1', 'Alice', '30', 'USA', addButton],
73
+ link: {
74
+ url: 'https://weni.ai/',
75
+ target: '_blank',
76
+ },
77
+ },
78
+ {
79
+ content: ['2', 'Bob', '25', 'Canada', addButton],
80
+ link: {
81
+ url: 'https://weni.ai/',
82
+ },
83
+ },
84
+ {
85
+ content: ['3', 'Charlie', '35', 'UK', addButton],
86
+ },
87
+ {
88
+ content: ['4', 'Diana', '28', 'Australia', addButton],
89
+ },
90
+ {
91
+ content: ['5', 'Ethan', '22', 'New Zealand', addButton],
92
+ },
93
+ ],
94
+ },
95
+ };
96
+
97
+ export const WithoutResults = { args: {} };
98
+
99
+ export const Loading = {
100
+ args: {
101
+ isLoading: true,
102
+ },
103
+ };