sprintify-ui 0.0.10 → 0.0.12

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 (103) hide show
  1. package/dist/sprintify-ui.es.js +5174 -6624
  2. package/dist/style.css +1 -1
  3. package/dist/tailwindcss/index.js +23 -0
  4. package/dist/types/src/components/BaseAutocomplete.vue.d.ts +0 -1
  5. package/dist/types/src/components/BaseAutocompleteFetch.vue.d.ts +0 -1
  6. package/dist/types/src/components/BaseBelongsTo.vue.d.ts +13 -3
  7. package/dist/types/src/components/BaseCharacterCounter.vue.d.ts +143 -0
  8. package/dist/types/src/components/BaseDataTable.vue.d.ts +95 -64
  9. package/dist/types/src/components/BaseDialog.vue.d.ts +8 -8
  10. package/dist/types/src/components/BaseFilePicker.vue.d.ts +3 -3
  11. package/dist/types/src/components/BaseInput.vue.d.ts +39 -5
  12. package/dist/types/src/components/BaseLoadingCover.vue.d.ts +84 -12
  13. package/dist/types/src/components/BaseMenuItem.vue.d.ts +4 -4
  14. package/dist/types/src/components/BaseModalCenter.vue.d.ts +8 -8
  15. package/dist/types/src/components/BaseModalSide.vue.d.ts +8 -8
  16. package/dist/types/src/components/BaseNavbarItemContent.vue.d.ts +4 -4
  17. package/dist/types/src/components/BasePagination.vue.d.ts +105 -13
  18. package/dist/types/src/components/BasePaginationSimple.vue.d.ts +2 -2
  19. package/dist/types/src/components/BaseSelect.vue.d.ts +130 -26
  20. package/dist/types/src/components/BaseSwitch.vue.d.ts +15 -8
  21. package/dist/types/src/components/BaseTabItem.vue.d.ts +26 -4
  22. package/dist/types/src/components/BaseTableColumn.vue.d.ts +4 -4
  23. package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +175 -21
  24. package/dist/types/src/components/index.d.ts +24 -1
  25. package/dist/types/src/index.d.ts +4 -0
  26. package/dist/types/src/svg/BaseEmptyState.vue.d.ts +2 -0
  27. package/dist/types/src/{components/BaseSpinner.vue.d.ts → svg/BaseSpinnerLarge.vue.d.ts} +0 -0
  28. package/dist/types/src/svg/BaseSpinnerSmall.vue.d.ts +44 -0
  29. package/dist/types/src/types/types.d.ts +1 -1
  30. package/package.json +4 -2
  31. package/src/components/BaseAutocomplete.stories.js +7 -4
  32. package/src/components/BaseAutocomplete.vue +44 -15
  33. package/src/components/BaseAutocompleteFetch.stories.js +6 -3
  34. package/src/components/BaseAutocompleteFetch.vue +8 -3
  35. package/src/components/BaseBelongsTo.stories.js +9 -4
  36. package/src/components/BaseBelongsTo.vue +1 -0
  37. package/src/components/BaseCard.vue +1 -1
  38. package/src/components/BaseCharacterCounter.stories.js +30 -0
  39. package/src/components/BaseCharacterCounter.vue +60 -0
  40. package/src/components/BaseDataIterator.stories.js +102 -3
  41. package/src/components/BaseDataIterator.vue +75 -49
  42. package/src/components/BaseDataTable.stories.js +149 -2
  43. package/src/components/BaseDataTable.vue +34 -28
  44. package/src/components/BaseDataTableToggleColumns.vue +1 -1
  45. package/src/components/BaseDateSelect.vue +6 -2
  46. package/src/components/BaseDescriptionListItem.vue +40 -4
  47. package/src/components/BaseDialog.stories.js +51 -0
  48. package/src/components/BaseDialog.vue +13 -7
  49. package/src/components/BaseFilePicker.stories.js +51 -0
  50. package/src/components/BaseFilePicker.vue +6 -6
  51. package/src/components/BaseFileUploader.stories.js +80 -0
  52. package/src/components/BaseFileUploader.vue +16 -3
  53. package/src/components/BaseInput.stories.js +46 -0
  54. package/src/components/BaseInput.vue +10 -2
  55. package/src/components/BaseInputLabel.stories.js +31 -0
  56. package/src/components/BaseInputLabel.vue +1 -1
  57. package/src/components/BaseLoadingCover.stories.js +55 -0
  58. package/src/components/BaseLoadingCover.vue +27 -17
  59. package/src/components/BaseMenu.stories.js +125 -0
  60. package/src/components/BaseModalCenter.stories.js +61 -0
  61. package/src/components/BaseModalCenter.vue +2 -2
  62. package/src/components/BaseModalSide.stories.js +55 -0
  63. package/src/components/BaseModalSide.vue +2 -2
  64. package/src/components/BaseNavbar.stories.js +150 -0
  65. package/src/components/BaseNavbar.vue +3 -0
  66. package/src/components/BaseNavbarItem.vue +1 -0
  67. package/src/components/BaseNavbarItemContent.vue +3 -0
  68. package/src/components/BasePagination.stories.js +32 -0
  69. package/src/components/BasePagination.vue +126 -40
  70. package/src/components/BasePaginationSimple.vue +3 -3
  71. package/src/components/BasePanel.stories.js +56 -0
  72. package/src/components/BasePassword.stories.js +36 -0
  73. package/src/components/BasePassword.vue +11 -5
  74. package/src/components/BaseProcessRing.stories.js +27 -0
  75. package/src/components/BaseReadMore.stories.js +30 -0
  76. package/src/components/BaseReadMore.vue +1 -1
  77. package/src/components/BaseSelect.stories.js +67 -0
  78. package/src/components/BaseSelect.vue +144 -44
  79. package/src/components/BaseSideNavigation.stories.js +55 -0
  80. package/src/components/BaseSideNavigation.vue +7 -2
  81. package/src/components/BaseSideNavigationItem.vue +11 -3
  82. package/src/components/BaseSkeleton.stories.js +36 -0
  83. package/src/components/BaseSwitch.stories.js +101 -0
  84. package/src/components/BaseSwitch.vue +90 -12
  85. package/src/components/BaseSystemAlert.stories.js +63 -0
  86. package/src/components/BaseTabItem.vue +19 -6
  87. package/src/components/BaseTable.vue +42 -29
  88. package/src/components/BaseTableColumn.vue +2 -2
  89. package/src/components/BaseTabs.stories.js +54 -0
  90. package/src/components/BaseTabs.vue +3 -3
  91. package/src/components/BaseTextarea.stories.js +35 -0
  92. package/src/components/BaseTextarea.vue +1 -1
  93. package/src/components/BaseTextareaAutoresize.stories.js +49 -0
  94. package/src/components/BaseTextareaAutoresize.vue +83 -87
  95. package/src/components/index.ts +46 -0
  96. package/src/lang/en.json +1 -0
  97. package/src/lang/fr.json +1 -0
  98. package/src/svg/BaseEmptyState.vue +34 -0
  99. package/src/{components/BaseSpinner.vue → svg/BaseSpinnerLarge.vue} +0 -0
  100. package/src/svg/BaseSpinnerSmall.vue +9 -0
  101. package/src/types/types.ts +1 -1
  102. package/dist/types/src/components/BaseWordCount.vue.d.ts +0 -31
  103. package/src/components/BaseWordCount.vue +0 -36
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div>
3
+ <div
4
+ v-if="max && (!min || length >= min)"
5
+ :class="{
6
+ 'text-red-600': length > max,
7
+ }"
8
+ >
9
+ {{ length }}/{{ max }}
10
+ </div>
11
+ <div v-else-if="min && length < min" class="text-red-600">
12
+ {{ $t('sui.min_x_characters', { x: min }) }} ({{ length }}/{{ min }})
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script lang="ts" setup>
18
+ import { trim } from 'lodash';
19
+
20
+ const props = defineProps({
21
+ text: {
22
+ required: true,
23
+ type: String,
24
+ },
25
+ min: {
26
+ default: undefined,
27
+ type: Number,
28
+ },
29
+ max: {
30
+ default: undefined,
31
+ type: Number,
32
+ },
33
+ trim: {
34
+ default: true,
35
+ type: Boolean,
36
+ },
37
+ removeDoubleSpaces: {
38
+ default: true,
39
+ type: Boolean,
40
+ },
41
+ });
42
+
43
+ const trimmedText = computed(() => {
44
+ let text = props.text;
45
+
46
+ if (props.trim) {
47
+ text = trim(props.text);
48
+ }
49
+
50
+ if (props.removeDoubleSpaces) {
51
+ text = text.replace(/ +(?= )/g, '');
52
+ }
53
+
54
+ return text;
55
+ });
56
+
57
+ const length = computed(() => {
58
+ return trimmedText.value.length;
59
+ });
60
+ </script>
@@ -1,4 +1,5 @@
1
1
  import BaseDataIterator from './BaseDataIterator.vue';
2
+ import BaseSelect from './BaseSelect.vue';
2
3
  import BaseCard from './BaseCard.vue';
3
4
  import BaseCardRow from './BaseCardRow.vue';
4
5
  import BaseLoadingCover from './BaseLoadingCover.vue';
@@ -43,16 +44,67 @@ const template = `
43
44
 
44
45
  <BaseLoadingCover
45
46
  v-show="loading"
46
- backdropClass="bg-slate-100 bg-opacity-50"
47
+ size="lg"
48
+ backdropClass="bg-white bg-opacity-50"
47
49
  >
48
50
  </BaseLoadingCover>
49
51
  </div>
50
52
  </template>
53
+
54
+ <template #filters="{ query, updateQueryValue }">
55
+ <div class="space-y-3">
56
+ <div>
57
+ <p class="mb-1 text-sm">
58
+ Type
59
+ </p>
60
+ <BaseSelect
61
+ :model-value="query.type ?? null"
62
+ class="w-full rounded border-slate-300"
63
+ placeholder="-"
64
+ @update:model-value="updateQueryValue('type', $event)"
65
+ >
66
+ <option value="video">
67
+ Video
68
+ </option>
69
+ <option value="article">
70
+ Article
71
+ </option>
72
+ </BaseSelect>
73
+ </div>
74
+ <div>
75
+ <p class="mb-1 text-sm">
76
+ Access Level
77
+ </p>
78
+ <BaseSelect
79
+ :model-value="query.access_level ?? null"
80
+ class="w-full rounded border-slate-300"
81
+ placeholder="-"
82
+ @update:model-value="updateQueryValue('access_level', $event)"
83
+ >
84
+ <option value="public">
85
+ Public
86
+ </option>
87
+ <option value="member">
88
+ Member
89
+ </option>
90
+ <option value="vip">
91
+ VIP
92
+ </option>
93
+ </BaseSelect>
94
+ </div>
95
+ </div>
96
+ </template>
51
97
  </BaseDataIterator>
52
98
  `;
53
99
 
54
100
  const Template = (args) => ({
55
- components: { BaseDataIterator, BaseCard, BaseCardRow, BaseLoadingCover },
101
+ components: {
102
+ BaseDataIterator,
103
+ BaseCard,
104
+ BaseCardRow,
105
+ BaseLoadingCover,
106
+ BaseSelect,
107
+ },
56
108
  setup() {
57
109
  return { args };
58
110
  },
@@ -83,7 +135,54 @@ Demo.args = {
83
135
  ],
84
136
  };
85
137
 
86
- export const Simple = Template.bind({});
138
+ const SimpleTemplate = (args) => ({
139
+ components: {
140
+ BaseDataIterator,
141
+ BaseCard,
142
+ BaseCardRow,
143
+ BaseLoadingCover,
144
+ },
145
+ setup() {
146
+ return { args };
147
+ },
148
+ template: `
149
+ <BaseDataIterator v-bind="args">
150
+ <template #default="{ items, loading }">
151
+ <div class="relative">
152
+ <div class="space-y-1.5">
153
+ <a
154
+ v-for="item in items"
155
+ :key="item.id"
156
+ :href="item.website_url"
157
+ target="_blank"
158
+ class="block group"
159
+ >
160
+ <BaseCard class="group-hover:bg-slate-100">
161
+ <BaseCardRow size="sm">
162
+ <div class="font-medium text-slate-900">
163
+ {{ item.title }}
164
+ </div>
165
+ <p class="text-xs leading-tight text-slate-500">
166
+ {{ item.subtitle }}
167
+ </p>
168
+ </BaseCardRow>
169
+ </BaseCard>
170
+ </a>
171
+ </div>
172
+
173
+ <BaseLoadingCover
174
+ v-show="loading"
175
+ size="lg"
176
+ backdropClass="bg-white bg-opacity-50"
177
+ >
178
+ </BaseLoadingCover>
179
+ </div>
180
+ </template>
181
+ </BaseDataIterator>
182
+ `,
183
+ });
184
+
185
+ export const Simple = SimpleTemplate.bind({});
87
186
  Simple.args = {
88
187
  searchable: false,
89
188
  actions: [],
@@ -6,14 +6,17 @@
6
6
  'grid-cols-[1fr_300px]': hasSidebar,
7
7
  }"
8
8
  >
9
- <div class="col-span-2 min-w-0 lg:col-span-1">
9
+ <div
10
+ class="min-w-0"
11
+ :class="{ 'col-span-1': !mobileLayout, 'col-span-2': mobileLayout }"
12
+ >
10
13
  <!-- Header -->
11
- <div class="mb-4 flex space-x-2 empty:mb-0">
14
+ <div class="flex mb-4 space-x-2 empty:mb-0">
12
15
  <!-- Search bar -->
13
16
  <div v-if="searchable" class="grow">
14
17
  <div class="relative h-11">
15
18
  <div
16
- class="pointer-events-none absolute top-0 left-0 flex h-full items-center justify-center pl-2.5"
19
+ class="flex pointer-events-none absolute top-0 left-0 h-full items-center justify-center pl-2.5"
17
20
  >
18
21
  <BaseIcon
19
22
  class="h-6 w-6 text-slate-400"
@@ -30,7 +33,7 @@
30
33
  />
31
34
  <div
32
35
  v-if="searchQuery"
33
- class="absolute top-0 right-0 flex h-full items-center justify-center p-1"
36
+ class="flex absolute top-0 right-0 h-full items-center justify-center p-1"
34
37
  >
35
38
  <button
36
39
  type="button"
@@ -52,15 +55,15 @@
52
55
  <!-- Filters (mobile) -->
53
56
  <button
54
57
  v-if="mobileLayout && hasFilters"
55
- class="btn flex h-11 items-center justify-center py-1 text-base"
58
+ class="flex btn h-11 items-center justify-center py-1 text-base shadow-sm"
56
59
  type="button"
57
60
  @click="showFilters = true"
58
61
  >
59
62
  <BaseIcon
60
- class="mr-2 h-6 w-6 text-slate-500"
63
+ class="h-6 w-6 text-slate-500 xs:mr-2"
61
64
  icon="heroicons:adjustments-horizontal-solid"
62
65
  />
63
- <span>{{ $t('sui.filters') }}</span>
66
+ <span class="hidden xs:block">{{ $t('sui.filters') }}</span>
64
67
  </button>
65
68
 
66
69
  <!-- Menu -->
@@ -96,42 +99,36 @@
96
99
 
97
100
  <!-- Pagination -->
98
101
 
102
+ <div class="mt-5">
103
+ <p class="text-center text-xs text-slate-400 sm:text-right">
104
+ {{
105
+ (paginationMetadata.current_page - 1) *
106
+ paginationMetadata.per_page +
107
+ 1
108
+ }}
109
+ -
110
+ {{
111
+ $t('sui.pagination_detail', {
112
+ page: Math.min(
113
+ paginationMetadata.current_page * paginationMetadata.per_page,
114
+ paginationMetadata.total
115
+ ),
116
+ total: paginationMetadata.total,
117
+ })
118
+ }}
119
+ </p>
120
+ </div>
121
+
99
122
  <div class="mt-4">
100
- <div
101
- class="flex flex-wrap xs:flex-nowrap xs:items-center xs:justify-between"
102
- >
103
- <div class="flex items-center space-x-3">
104
- <BasePaginationSimple
105
- :model-value="page"
106
- :last-page="lastPage"
107
- @model-value:update="onPageChange"
108
- />
109
- <div>
110
- <p class="text-sm text-slate-600">
111
- {{
112
- (paginationMetadata.current_page - 1) *
113
- paginationMetadata.per_page +
114
- 1
115
- }}
116
- -
117
- {{
118
- $t('sui.pagination_detail', {
119
- page: Math.min(
120
- paginationMetadata.current_page *
121
- paginationMetadata.per_page,
122
- paginationMetadata.total
123
- ),
124
- total: paginationMetadata.total,
125
- })
126
- }}
127
- </p>
128
- </div>
129
- </div>
130
- </div>
123
+ <BasePagination
124
+ :model-value="page"
125
+ :last-page="lastPage"
126
+ @update:model-value="onPageChange"
127
+ />
131
128
  </div>
132
129
  </div>
133
130
 
134
- <div v-if="!mobileLayout && hasSidebar">
131
+ <div v-if="!mobileLayout" ref="sidebar">
135
132
  <slot
136
133
  name="sidebarTop"
137
134
  :pagination-metadata="paginationMetadata"
@@ -201,7 +198,6 @@ const DEFAULT_QUERY = {
201
198
  import { cloneDeep, debounce, isArray, merge, set } from 'lodash';
202
199
  import hash from 'object-hash';
203
200
  import { ComputedRef, PropType, Ref } from 'vue';
204
- import { useBreakpoints } from '@/composables/breakpoints';
205
201
  import {
206
202
  Collection,
207
203
  DataTableQuery,
@@ -214,9 +210,10 @@ import {
214
210
  import BaseMenu from './BaseMenu.vue';
215
211
  import BaseCard from './BaseCard.vue';
216
212
  import BaseCardRow from './BaseCardRow.vue';
217
- import BasePaginationSimple from './BasePaginationSimple.vue';
213
+ import BasePagination from './BasePagination.vue';
218
214
  import BaseModalSide from './BaseModalSide.vue';
219
215
  import { config } from '@/index';
216
+ import { useMutationObserver, useResizeObserver } from '@vueuse/core';
220
217
 
221
218
  const props = defineProps({
222
219
  /**
@@ -299,7 +296,10 @@ const route = useRoute();
299
296
  const router = useRouter();
300
297
  const routeName = route.name;
301
298
 
302
- const breakpoints = useBreakpoints();
299
+ const width = ref(800);
300
+ useResizeObserver(dataIteratorNode, () => {
301
+ width.value = dataIteratorNode.value?.clientWidth ?? 800;
302
+ });
303
303
 
304
304
  /** Data table state */
305
305
 
@@ -315,7 +315,7 @@ const query = ref(cloneDeep(props.defaultQuery)) as Ref<DataTableQuery>;
315
315
  const slots = useSlots();
316
316
 
317
317
  const mobileLayout = computed(() => {
318
- return breakpoints.smaller('lg').value;
318
+ return width.value < 1024;
319
319
  });
320
320
 
321
321
  const hasFilters = computed((): boolean => {
@@ -323,14 +323,40 @@ const hasFilters = computed((): boolean => {
323
323
  return numberOfFilterSlots !== undefined;
324
324
  });
325
325
 
326
- const hasSidebar = computed(() => {
327
- return (
328
- hasFilters.value ||
329
- slots.sidebarTop !== undefined ||
330
- slots.sidebarBottom !== undefined
331
- );
326
+ /*
327
+ |--------------------------------------------------------------------------
328
+ | Has sidebar observer
329
+ |--------------------------------------------------------------------------
330
+ */
331
+
332
+ const hasSidebar = ref(false);
333
+ const sidebar = ref(null) as Ref<null | HTMLElement>;
334
+
335
+ function checkIfSidebarIsEmpty() {
336
+ hasSidebar.value = (sidebar?.value?.childElementCount ?? 0) > 0;
337
+ }
338
+
339
+ const checkIfSidebarIsEmptyDebounce = debounce(checkIfSidebarIsEmpty, 100);
340
+
341
+ useMutationObserver(sidebar, checkIfSidebarIsEmptyDebounce, {
342
+ attributes: false,
343
+ childList: true,
344
+ });
345
+
346
+ onMounted(() => {
347
+ checkIfSidebarIsEmpty();
332
348
  });
333
349
 
350
+ watch(
351
+ () => mobileLayout.value,
352
+ () => {
353
+ // After the sidebar appears...
354
+ nextTick(() => {
355
+ checkIfSidebarIsEmpty();
356
+ });
357
+ }
358
+ );
359
+
334
360
  /*
335
361
  |--------------------------------------------------------------------------
336
362
  | Query params
@@ -1,6 +1,10 @@
1
1
  import BaseDataTable from './BaseDataTable.vue';
2
2
  import BaseTableColumn from './BaseTableColumn.vue';
3
3
  import BaseBoolean from './BaseBoolean.vue';
4
+ import BaseSelect from './BaseSelect.vue';
5
+ import BaseBadge from './BaseBadge.vue';
6
+ import BaseAppNotifications from './BaseAppNotifications.vue';
7
+ import BaseAppDialogs from './BaseAppDialogs.vue';
4
8
 
5
9
  export default {
6
10
  title: 'Data/BaseDataTable',
@@ -23,6 +27,7 @@ const template = `
23
27
  label="Titre"
24
28
  sortable
25
29
  field="title->en"
30
+ :toggle="false"
26
31
  >
27
32
  <div class="max-w-sm">
28
33
  <div class="font-medium text-slate-900">
@@ -53,11 +58,84 @@ const template = `
53
58
  {{ Math.round(row.votes_avg_score) }} / 5
54
59
  </div>
55
60
  </BaseTableColumn>
61
+
62
+ <BaseTableColumn
63
+ v-slot="{ row }"
64
+ label="Access level"
65
+ field="access_level"
66
+ sortable
67
+ optional
68
+ >
69
+ <BaseBadge>
70
+ {{ row.access_level }}
71
+ </BaseBadge>
72
+ </BaseTableColumn>
73
+
74
+ <template #detail="{ row }">
75
+ <div class="p-4 text-sm">
76
+ <p>ID : {{ row.id }}</p>
77
+ <p>Created at : {{ row.created_at }}</p>
78
+ </div>
79
+ </template>
80
+
81
+ <template #filters="{ query, updateQueryValue }">
82
+ <div class="space-y-3">
83
+ <div>
84
+ <p class="mb-1 text-sm">
85
+ Type
86
+ </p>
87
+ <BaseSelect
88
+ :model-value="query.type ?? null"
89
+ class="w-full rounded border-slate-300"
90
+ placeholder="-"
91
+ @update:model-value="updateQueryValue('type', $event)"
92
+ >
93
+ <option value="video">
94
+ Video
95
+ </option>
96
+ <option value="article">
97
+ Article
98
+ </option>
99
+ </BaseSelect>
100
+ </div>
101
+ <div>
102
+ <p class="mb-1 text-sm">
103
+ Access Level
104
+ </p>
105
+ <BaseSelect
106
+ :model-value="query.access_level ?? null"
107
+ class="w-full rounded border-slate-300"
108
+ placeholder="-"
109
+ @update:model-value="updateQueryValue('access_level', $event)"
110
+ >
111
+ <option value="public">
112
+ Public
113
+ </option>
114
+ <option value="member">
115
+ Member
116
+ </option>
117
+ <option value="vip">
118
+ VIP
119
+ </option>
120
+ </BaseSelect>
121
+ </div>
122
+ </div>
123
+ </template>
56
124
  </BaseDataTable>
125
+ <BaseAppNotifications></BaseAppNotifications>
126
+ <BaseAppDialogs></BaseAppDialogs>
57
127
  `;
58
128
 
59
129
  const Template = (args) => ({
60
- components: { BaseDataTable, BaseTableColumn, BaseBoolean },
130
+ components: {
131
+ BaseDataTable,
132
+ BaseTableColumn,
133
+ BaseBoolean,
134
+ BaseSelect,
135
+ BaseBadge,
136
+ BaseAppNotifications,
137
+ BaseAppDialogs,
138
+ },
61
139
  setup() {
62
140
  return { args };
63
141
  },
@@ -86,10 +164,79 @@ Demo.args = {
86
164
  color: 'danger',
87
165
  },
88
166
  ],
167
+ checkable: true,
168
+ checkableActions: [
169
+ {
170
+ label: 'Delete all',
171
+ action: () => {
172
+ alert('delete!');
173
+ },
174
+ },
175
+ ],
176
+ detailed: true,
177
+ maxHeight: 400,
178
+ editUrl() {
179
+ return '/';
180
+ },
181
+ deleteUrl() {
182
+ return '/';
183
+ },
89
184
  };
90
185
 
91
- export const Simple = Template.bind({});
186
+ const SimpleTemplate = (args) => ({
187
+ components: {
188
+ BaseDataTable,
189
+ BaseTableColumn,
190
+ BaseBoolean,
191
+ },
192
+ setup() {
193
+ return { args };
194
+ },
195
+ template: `
196
+ <BaseDataTable v-bind="args">
197
+ <BaseTableColumn
198
+ v-slot="{ row }"
199
+ label="Titre"
200
+ sortable
201
+ field="title->en"
202
+ :toggle="false"
203
+ >
204
+ <div class="max-w-sm">
205
+ <div class="font-medium text-slate-900">
206
+ {{ row.title }}
207
+ </div>
208
+ <p class="text-xs leading-tight text-slate-500">
209
+ {{ row.subtitle }}
210
+ </p>
211
+ </div>
212
+ </BaseTableColumn>
213
+
214
+ <BaseTableColumn
215
+ v-slot="{ row }"
216
+ label="VIP"
217
+ field="access_level"
218
+ sortable
219
+ >
220
+ <BaseBoolean :model-value="row.access_level == 'vip'" />
221
+ </BaseTableColumn>
222
+
223
+ <BaseTableColumn
224
+ v-slot="{ row }"
225
+ label="Vote"
226
+ field="votes_avg_score"
227
+ sortable
228
+ >
229
+ <div class="">
230
+ {{ Math.round(row.votes_avg_score) }} / 5
231
+ </div>
232
+ </BaseTableColumn>
233
+ </BaseDataTable>
234
+ `,
235
+ });
236
+
237
+ export const Simple = SimpleTemplate.bind({});
92
238
  Simple.args = {
93
239
  searchable: false,
240
+ toggleable: false,
94
241
  actions: [],
95
242
  };