sprintify-ui 0.8.2 → 0.8.4

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,86 @@
1
+ declare function toggle(): void;
2
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<{
3
+ defaultOpen?: boolean | undefined;
4
+ icon?: string | undefined;
5
+ iconPosition?: "right" | "left" | undefined;
6
+ isOpenIconClass?: string | undefined;
7
+ isCloseIconClass?: string | undefined;
8
+ twIcon?: string | string[] | null | undefined;
9
+ twHeader?: string | string[] | null | undefined;
10
+ twTitle?: string | string[] | null | undefined;
11
+ twContent?: string | string[] | null | undefined;
12
+ }>, {
13
+ defaultOpen: boolean;
14
+ icon: string;
15
+ iconPosition: string;
16
+ twIcon: null;
17
+ twHeader: null;
18
+ twTitle: null;
19
+ twContent: null;
20
+ isOpenIconClass: string;
21
+ isCloseIconClass: string;
22
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<{
23
+ defaultOpen?: boolean | undefined;
24
+ icon?: string | undefined;
25
+ iconPosition?: "right" | "left" | undefined;
26
+ isOpenIconClass?: string | undefined;
27
+ isCloseIconClass?: string | undefined;
28
+ twIcon?: string | string[] | null | undefined;
29
+ twHeader?: string | string[] | null | undefined;
30
+ twTitle?: string | string[] | null | undefined;
31
+ twContent?: string | string[] | null | undefined;
32
+ }>, {
33
+ defaultOpen: boolean;
34
+ icon: string;
35
+ iconPosition: string;
36
+ twIcon: null;
37
+ twHeader: null;
38
+ twTitle: null;
39
+ twContent: null;
40
+ isOpenIconClass: string;
41
+ isCloseIconClass: string;
42
+ }>>>, {
43
+ icon: string;
44
+ iconPosition: "right" | "left";
45
+ defaultOpen: boolean;
46
+ isOpenIconClass: string;
47
+ isCloseIconClass: string;
48
+ twIcon: string | string[] | null;
49
+ twHeader: string | string[] | null;
50
+ twTitle: string | string[] | null;
51
+ twContent: string | string[] | null;
52
+ }, {}>, {
53
+ header?(_: {
54
+ open: boolean;
55
+ toggle: typeof toggle;
56
+ }): any;
57
+ title?(_: {
58
+ open: boolean;
59
+ }): any;
60
+ content?(_: {
61
+ open: boolean;
62
+ }): any;
63
+ }>;
64
+ export default _default;
65
+ type __VLS_WithDefaults<P, D> = {
66
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
67
+ default: D[K];
68
+ }> : P[K];
69
+ };
70
+ type __VLS_Prettify<T> = {
71
+ [K in keyof T]: T[K];
72
+ } & {};
73
+ type __VLS_WithTemplateSlots<T, S> = T & {
74
+ new (): {
75
+ $slots: S;
76
+ };
77
+ };
78
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
79
+ type __VLS_TypePropsToOption<T> = {
80
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
81
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
82
+ } : {
83
+ type: import('vue').PropType<T[K]>;
84
+ required: true;
85
+ };
86
+ };
@@ -220,7 +220,7 @@ declare const _default: import("vue").DefineComponent<{
220
220
  meta: Record<string, any> | undefined;
221
221
  newKey: string;
222
222
  numeric: boolean;
223
- position: "right" | "left";
223
+ align: "right" | "left" | "center";
224
224
  searchable: boolean;
225
225
  sortable: boolean;
226
226
  ignoreRowInteractions: boolean;
@@ -235,8 +235,6 @@ declare const _default: import("vue").DefineComponent<{
235
235
  style: {
236
236
  width: number | undefined;
237
237
  };
238
- thAttrs: (column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
239
- tdAttrs: (row: import("@/index.js").Row, column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
240
238
  }[]>;
241
239
  uncheckAll: () => void;
242
240
  scrollTop: () => void;
@@ -370,7 +368,7 @@ declare const _default: import("vue").DefineComponent<{
370
368
  meta: Record<string, any> | undefined;
371
369
  newKey: string;
372
370
  numeric: boolean;
373
- position: "right" | "left";
371
+ align: "right" | "left" | "center";
374
372
  searchable: boolean;
375
373
  sortable: boolean;
376
374
  ignoreRowInteractions: boolean;
@@ -385,8 +383,6 @@ declare const _default: import("vue").DefineComponent<{
385
383
  style: {
386
384
  width: number | undefined;
387
385
  };
388
- thAttrs: (column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
389
- tdAttrs: (row: import("@/index.js").Row, column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
390
386
  }[]>;
391
387
  uncheckAll: () => void;
392
388
  scrollTop: () => void;
@@ -628,7 +624,7 @@ declare const _default: import("vue").DefineComponent<{
628
624
  meta: Record<string, any> | undefined;
629
625
  newKey: string;
630
626
  numeric: boolean;
631
- position: "right" | "left";
627
+ align: "right" | "left" | "center";
632
628
  searchable: boolean;
633
629
  sortable: boolean;
634
630
  ignoreRowInteractions: boolean;
@@ -643,8 +639,6 @@ declare const _default: import("vue").DefineComponent<{
643
639
  style: {
644
640
  width: number | undefined;
645
641
  };
646
- thAttrs: (column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
647
- tdAttrs: (row: import("@/index.js").Row, column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
648
642
  }[]>;
649
643
  uncheckAll: () => void;
650
644
  scrollTop: () => void;
@@ -778,7 +772,7 @@ declare const _default: import("vue").DefineComponent<{
778
772
  meta: Record<string, any> | undefined;
779
773
  newKey: string;
780
774
  numeric: boolean;
781
- position: "right" | "left";
775
+ align: "right" | "left" | "center";
782
776
  searchable: boolean;
783
777
  sortable: boolean;
784
778
  ignoreRowInteractions: boolean;
@@ -793,8 +787,6 @@ declare const _default: import("vue").DefineComponent<{
793
787
  style: {
794
788
  width: number | undefined;
795
789
  };
796
- thAttrs: (column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
797
- tdAttrs: (row: import("@/index.js").Row, column: import("@/index.js").BaseTableColumnData) => Record<string, any>;
798
790
  }[]>;
799
791
  uncheckAll: () => void;
800
792
  scrollTop: () => void;
@@ -90,7 +90,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
90
90
  meta: Record<string, any> | undefined;
91
91
  newKey: string;
92
92
  numeric: boolean;
93
- position: "right" | "left";
93
+ align: "right" | "left" | "center";
94
94
  searchable: boolean;
95
95
  sortable: boolean;
96
96
  ignoreRowInteractions: boolean;
@@ -105,8 +105,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
105
105
  style: {
106
106
  width: number | undefined;
107
107
  };
108
- thAttrs: (column: BaseTableColumnData) => Record<string, any>;
109
- tdAttrs: (row: Row, column: BaseTableColumnData) => Record<string, any>;
110
108
  }[]>;
111
109
  uncheckAll: typeof uncheckAll;
112
110
  scrollTop: () => void;
@@ -88,8 +88,8 @@ declare const _default: import("vue").DefineComponent<{
88
88
  }>>, {
89
89
  modelValue: boolean;
90
90
  size: "sm" | "lg";
91
- twBackdrop: string;
92
91
  twIcon: string;
92
+ twBackdrop: string;
93
93
  duration: string;
94
94
  delay: number;
95
95
  }, {}>;
@@ -51,10 +51,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
51
51
  title: string;
52
52
  to: RouteLocationRaw;
53
53
  href: string;
54
+ align: "right" | "left" | "center";
54
55
  ignoreRowInteractions: boolean;
55
56
  target: "_blank" | "_self" | "_parent" | "_top";
56
57
  style: string | false | import("vue").CSSProperties | StyleValue[] | null;
57
- align: "right" | "left" | "center";
58
58
  colspan: string | number;
59
59
  }, {}>, {
60
60
  default?(_: {
@@ -34,7 +34,7 @@ declare const _default: import("vue").DefineComponent<{
34
34
  default: boolean;
35
35
  type: BooleanConstructor;
36
36
  };
37
- position: {
37
+ align: {
38
38
  default: string;
39
39
  type: PropType<"right" | "left" | "center">;
40
40
  };
@@ -82,16 +82,6 @@ declare const _default: import("vue").DefineComponent<{
82
82
  default: undefined;
83
83
  type: PropType<(row: CollectionItem, index: number, column: BaseTableColumnData, colIndex: number, event: MouseEvent) => void>;
84
84
  };
85
- /** Adds native attributes to th :th-attrs="(column)" => ({})" */
86
- thAttrs: {
87
- type: FunctionConstructor;
88
- default: () => {};
89
- };
90
- /** Adds native attributes to td :td-attrs="(row, column)" => ({})" */
91
- tdAttrs: {
92
- type: FunctionConstructor;
93
- default: () => {};
94
- };
95
85
  }, {
96
86
  nextSequence: any;
97
87
  addColumn: any;
@@ -136,7 +126,7 @@ declare const _default: import("vue").DefineComponent<{
136
126
  default: boolean;
137
127
  type: BooleanConstructor;
138
128
  };
139
- position: {
129
+ align: {
140
130
  default: string;
141
131
  type: PropType<"right" | "left" | "center">;
142
132
  };
@@ -184,16 +174,6 @@ declare const _default: import("vue").DefineComponent<{
184
174
  default: undefined;
185
175
  type: PropType<(row: CollectionItem, index: number, column: BaseTableColumnData, colIndex: number, event: MouseEvent) => void>;
186
176
  };
187
- /** Adds native attributes to th :th-attrs="(column)" => ({})" */
188
- thAttrs: {
189
- type: FunctionConstructor;
190
- default: () => {};
191
- };
192
- /** Adds native attributes to td :td-attrs="(row, column)" => ({})" */
193
- tdAttrs: {
194
- type: FunctionConstructor;
195
- default: () => {};
196
- };
197
177
  }>>, {
198
178
  class: string | unknown[] | Record<string, any>;
199
179
  onClick: (row: CollectionItem, index: number, column: BaseTableColumnData, colIndex: number, event: MouseEvent) => void;
@@ -207,7 +187,7 @@ declare const _default: import("vue").DefineComponent<{
207
187
  customKey: string | number;
208
188
  padding: string;
209
189
  numeric: boolean;
210
- position: "right" | "left" | "center";
190
+ align: "right" | "left" | "center";
211
191
  sortable: boolean;
212
192
  ignoreRowInteractions: boolean;
213
193
  toggle: boolean;
@@ -215,7 +195,5 @@ declare const _default: import("vue").DefineComponent<{
215
195
  customSort: Function;
216
196
  customSearch: Function;
217
197
  target: "_blank" | "_self" | "_parent" | "_top";
218
- thAttrs: Function;
219
- tdAttrs: Function;
220
198
  }, {}>;
221
199
  export default _default;
@@ -26,8 +26,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
26
26
  onClick?: ((...args: any[]) => any) | undefined;
27
27
  }, {
28
28
  class: string | false | 0 | ClassNameValue[] | null;
29
- style: string | false | import("vue").CSSProperties | StyleValue[] | null;
30
29
  align: "right" | "left" | "center";
30
+ style: string | false | import("vue").CSSProperties | StyleValue[] | null;
31
31
  colspan: number;
32
32
  }, {}>, {
33
33
  default?(_: {}): any;
@@ -20,6 +20,7 @@ import BaseCardRow from './BaseCardRow.vue';
20
20
  import BaseCharacterCounter from './BaseCharacterCounter.vue';
21
21
  import BaseClipboard from './BaseClipboard.vue';
22
22
  import BaseCalendar from './BaseCalendar.vue';
23
+ import BaseCollapse from './BaseCollapse.vue';
23
24
  import BaseColor from './BaseColor.vue';
24
25
  import BaseContainer from './BaseContainer.vue';
25
26
  import BaseCounter from './BaseCounter.vue';
@@ -102,4 +103,4 @@ import BaseLayoutStacked from './BaseLayoutStacked.vue';
102
103
  import BaseLayoutStackedConfigurable from './BaseLayoutStackedConfigurable.vue';
103
104
  import BaseLayoutSidebar from './BaseLayoutSidebar.vue';
104
105
  import BaseLayoutSidebarConfigurable from './BaseLayoutSidebarConfigurable.vue';
105
- export { BaseActionItem, BaseAddressForm, BaseAlert, BaseApp, BaseAppDialogs, BaseAppSnackbars, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseAvatarGroup, BaseBadge, BaseBelongsTo, BaseBelongsToFetch, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseCalendar, BaseColor, BaseContainer, BaseCounter, BaseCropper, BaseCropperModal, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseTimePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseDisplayRelativeTime, BaseDropdown, BaseDropdownAutocomplete, BaseEmptyState, BaseField, BaseFieldI18n, BaseFilePicker, BaseFilePickerCrop, BaseFileUploader, BaseForm, BaseGantt, BaseHasMany, BaseHeader, BaseIcon, BaseIconPicker, BaseInput, BaseInputLabel, BaseInputPercent, BaseJsonReader, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BaseNavbarSideItem, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseRichText, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseStepper, BaseStepperItem, BaseSwitch, BaseSystemAlert, BaseTable, BaseTableBody, BaseTableCell, BaseTableHead, BaseTableHeader, BaseTableRow, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseTooltip, BaseUniqueCode, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
106
+ export { BaseActionItem, BaseAddressForm, BaseAlert, BaseApp, BaseAppDialogs, BaseAppSnackbars, BaseAutocomplete, BaseAutocompleteFetch, BaseAvatar, BaseAvatarGroup, BaseBadge, BaseBelongsTo, BaseBelongsToFetch, BaseBoolean, BaseBreadcrumbs, BaseButton, BaseButtonGroup, BaseCard, BaseCardRow, BaseCharacterCounter, BaseClipboard, BaseCalendar, BaseCollapse, BaseColor, BaseContainer, BaseCounter, BaseCropper, BaseCropperModal, BaseDataIterator, BaseDataTable, BaseDatePicker, BaseDateSelect, BaseDescriptionList, BaseDescriptionListItem, BaseDialog, BaseDisplayRelativeTime, BaseDropdown, BaseDropdownAutocomplete, BaseEmptyState, BaseField, BaseFieldI18n, BaseFilePicker, BaseFilePickerCrop, BaseFileUploader, BaseForm, BaseGantt, BaseHasMany, BaseHeader, BaseIcon, BaseIconPicker, BaseInput, BaseInputLabel, BaseInputPercent, BaseJsonReader, BaseLoadingCover, BaseMediaItem, BaseMediaLibrary, BaseMediaPreview, BaseMenu, BaseMenuItem, BaseModalCenter, BaseModalSide, BaseNavbar, BaseNavbarItem, BaseNavbarItemContent, BaseNavbarSideItem, BasePagination, BasePanel, BasePassword, BaseProgressCircle, BaseRadioGroup, BaseReadMore, BaseRichText, BaseSelect, BaseShortcut, BaseSideNavigation, BaseSideNavigationItem, BaseSkeleton, BaseStatistic, BaseStepper, BaseStepperItem, BaseSwitch, BaseSystemAlert, BaseTable, BaseTableBody, BaseTableCell, BaseTableHead, BaseTableHeader, BaseTableRow, BaseTabs, BaseTabItem, BaseTagAutocomplete, BaseTagAutocompleteFetch, BaseTableColumn, BaseTextarea, BaseTextareaAutoresize, BaseTimeline, BaseTimelineItem, BaseTimePicker, BaseTooltip, BaseUniqueCode, BaseLayoutStacked, BaseLayoutStackedConfigurable, BaseLayoutSidebar, BaseLayoutSidebarConfigurable, };
@@ -78,7 +78,7 @@ export interface BaseTableColumnData {
78
78
  meta: undefined | Record<string, any>;
79
79
  newKey: string;
80
80
  numeric: boolean;
81
- position: 'left' | 'right';
81
+ align: 'left' | 'center' | 'right';
82
82
  searchable: boolean;
83
83
  sortable: boolean;
84
84
  ignoreRowInteractions: boolean;
@@ -93,8 +93,6 @@ export interface BaseTableColumnData {
93
93
  style: {
94
94
  width: undefined | number;
95
95
  };
96
- thAttrs: (column: BaseTableColumnData) => Record<string, any>;
97
- tdAttrs: (row: Row, column: BaseTableColumnData) => Record<string, any>;
98
96
  }
99
97
  /**
100
98
  * System alert
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.2",
3
+ "version": "0.8.4",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -0,0 +1,169 @@
1
+ import { method } from 'lodash';
2
+ import BaseCollapse from './BaseCollapse.vue';
3
+
4
+ export default {
5
+ title: 'Components/BaseCollapse',
6
+ component: BaseCollapse,
7
+ args: {},
8
+ argTypes: {
9
+ defaultOpen: {
10
+ control: { type: 'boolean' },
11
+ },
12
+ icon: {
13
+ control: { type: 'text' },
14
+ },
15
+ isOpenIconClass: {
16
+ control: { type: 'text' },
17
+ },
18
+ isCloseIconClass: {
19
+ control: { type: 'text' },
20
+ },
21
+ twIcon: {
22
+ control: { type: 'text' },
23
+ },
24
+ twHeader: {
25
+ control: { type: 'text' },
26
+ },
27
+ twContent: {
28
+ control: { type: 'text' },
29
+ },
30
+ twTitle: {
31
+ control: { type: 'text' },
32
+ },
33
+ iconPosition: {
34
+ control: { type: 'select' },
35
+ options: ['left', 'right'],
36
+ },
37
+ },
38
+ };
39
+
40
+ const Template = (args) => ({
41
+ components: { BaseCollapse },
42
+ setup() {
43
+ return { args };
44
+ },
45
+ template: `
46
+ <BaseCollapse v-bind="args" class="mb-1">
47
+ <template #title>
48
+ <h6 class="font-semibold"> Qu'est-ce que le Lorem Ipsum? </h6>
49
+ </template>
50
+ <template #content={isOpen}>
51
+ <p class="p-3">
52
+ Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
53
+ </p>
54
+ </template>
55
+ </BaseCollapse>
56
+
57
+ <BaseCollapse v-bind="args" class="mb-1">
58
+ <template #title>
59
+ <h6 class="font-semibold"> Qu'est-ce que le Lorem Ipsum? </h6>
60
+ </template>
61
+ <template #content>
62
+ <p class="p-3">
63
+ Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
64
+ </p>
65
+ </template>
66
+ </BaseCollapse>
67
+
68
+ <BaseCollapse v-bind="args" class="mb-1">
69
+ <template #title>
70
+ <h6 class="font-semibold"> Qu'est-ce que le Lorem Ipsum? </h6>
71
+ </template>
72
+ <template #content>
73
+ <p class="p-3">
74
+ Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
75
+ </p>
76
+ </template>
77
+ </BaseCollapse>
78
+
79
+ `,
80
+ });
81
+
82
+ export const Demo = Template.bind({});
83
+ Demo.args = {
84
+ defaultOpen: false,
85
+ };
86
+
87
+
88
+ const CustomHeaderTemplate = (args) => ({
89
+ components: { BaseCollapse },
90
+ setup() {
91
+ return { args };
92
+ },
93
+ method: {
94
+ toggle() {
95
+ this.defaultOpen = !this.defaultOpen;
96
+ },
97
+ },
98
+ template: `
99
+
100
+ <BaseCollapse v-bind="args" class="mb-3">
101
+ <template #header={toggle}>
102
+ <h6 class="cursor-pointer hover:text-slate-400" @click="toggle()"> Qu'est-ce que le Lorem Ipsum? </h6>
103
+ </template>
104
+ <template #content>
105
+ <p class="p-3">
106
+ Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
107
+ </p>
108
+ </template>
109
+ </BaseCollapse>
110
+
111
+ <BaseCollapse v-bind="args" class="mb-3">
112
+ <template #header={toggle}>
113
+ <h6 class="cursor-pointer hover:text-slate-400" @click="toggle()"> Qu'est-ce que le Lorem Ipsum? </h6>
114
+ </template>
115
+ <template #content>
116
+ <p class="p-3">
117
+ Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
118
+ </p>
119
+ </template>
120
+ </BaseCollapse>
121
+
122
+ <BaseCollapse v-bind="args" class="mb-3">
123
+ <template #header={toggle}>
124
+ <h6 class="cursor-pointer hover:text-slate-400" @click="toggle()"> Qu'est-ce que le Lorem Ipsum? </h6>
125
+ </template>
126
+ <template #content>
127
+ <p class="p-3">
128
+ Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen de polices de texte.
129
+ </p>
130
+ </template>
131
+ </BaseCollapse>
132
+
133
+ `,
134
+ argTypes: {
135
+ defaultOpen: {
136
+ control: { type: 'boolean' },
137
+ },
138
+ icon: {
139
+ control: { type: 'text' },
140
+ },
141
+ isOpenIconClass: {
142
+ control: { type: 'text' },
143
+ },
144
+ isCloseIconClass: {
145
+ control: { type: 'text' },
146
+ },
147
+ twIcon: {
148
+ control: { type: 'text' },
149
+ },
150
+ twHeader: {
151
+ control: { type: 'text' },
152
+ },
153
+ twContent: {
154
+ control: { type: 'text' },
155
+ },
156
+ twTitle: {
157
+ control: { type: 'text' },
158
+ },
159
+ iconPosition: {
160
+ control: { type: 'select' },
161
+ options: ['left', 'right'],
162
+ },
163
+ }
164
+ });
165
+ export const CustomHeader = CustomHeaderTemplate.bind({});
166
+
167
+ CustomHeader.args = {
168
+ defaultOpen: false,
169
+ };
@@ -0,0 +1,98 @@
1
+ <template>
2
+ <div>
3
+ <div>
4
+ <slot
5
+ name="header"
6
+ :open="isOpen"
7
+ :toggle="toggle"
8
+ >
9
+ <button
10
+ :class="headerClass"
11
+ type="button"
12
+ @click="toggle()"
13
+ >
14
+ <BaseIcon
15
+ v-if="iconPosition === 'left'"
16
+ :class="internalIconClass"
17
+ :icon="icon"
18
+ />
19
+
20
+ <div :class="internalTitleClass">
21
+ <slot
22
+ name="title"
23
+ :open="isOpen"
24
+ />
25
+ </div>
26
+ <BaseIcon
27
+ v-if="iconPosition === 'right'"
28
+ :class="internalIconClass"
29
+ :icon="icon"
30
+ />
31
+ </button>
32
+ </slot>
33
+ </div>
34
+
35
+ <div
36
+ v-show="isOpen"
37
+ :class="internalContentClass"
38
+ >
39
+ <slot
40
+ name="content"
41
+ :open="isOpen"
42
+ />
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <script lang="ts" setup>
48
+
49
+ import { twMerge } from 'tailwind-merge';
50
+
51
+ const internalIconClass = computed(() => {
52
+ const base = "w-6 h-6 flex items-center justify-center transition duration-300 ease-in-out transform cursor-pointer";
53
+
54
+ return twMerge(base, props.twIcon, isOpen.value ? props.isOpenIconClass : props.isCloseIconClass,);
55
+ });
56
+
57
+ const headerClass = computed(() => {
58
+ return twMerge('flex items-center w-full space-x-1', props.twHeader);
59
+ });
60
+
61
+ const internalContentClass = computed(() => {
62
+ return twMerge('transition duration-300 ease-in-out transform', props.twContent);
63
+ });
64
+
65
+ const internalTitleClass = computed(() => {
66
+ return twMerge(props.twTitle, '');
67
+ });
68
+
69
+ function toggle() {
70
+ isOpen.value = !isOpen.value;
71
+ }
72
+
73
+
74
+ const props = withDefaults(defineProps<{
75
+ defaultOpen?: boolean;
76
+ icon?: string;
77
+ iconPosition?: 'left' | 'right';
78
+ isOpenIconClass?: string;
79
+ isCloseIconClass?: string;
80
+ twIcon?: string | string[] | null;
81
+ twHeader?: string | string[] | null;
82
+ twTitle?: string | string[] | null;
83
+ twContent?: string | string[] | null;
84
+ }>(), {
85
+ defaultOpen: true,
86
+ icon: 'heroicons:chevron-down-16-solid',
87
+ iconPosition: 'left',
88
+ twIcon: null,
89
+ twHeader: null,
90
+ twTitle: null,
91
+ twContent: null,
92
+ isOpenIconClass: '-rotate-0',
93
+ isCloseIconClass: '-rotate-90',
94
+ });
95
+
96
+ const isOpen = ref(props.defaultOpen as boolean);
97
+
98
+ </script>
@@ -261,6 +261,7 @@ const LocalTemplate = (args) => ({
261
261
  sortable
262
262
  field="label"
263
263
  :toggle="false"
264
+ align="right"
264
265
  >
265
266
  <div class="max-w-sm">
266
267
  <div class="font-medium text-slate-900">
@@ -272,6 +273,17 @@ const LocalTemplate = (args) => ({
272
273
  </div>
273
274
  </BaseTableColumn>
274
275
 
276
+ <BaseTableColumn
277
+ v-slot="{ row }"
278
+ label="Size"
279
+ field="size"
280
+ sortable
281
+ numeric
282
+ align="right"
283
+ >
284
+ <p>{{ row.size }}</p>
285
+ </BaseTableColumn>
286
+
275
287
  <BaseTableColumn
276
288
  v-slot="{ row }"
277
289
  label="Value"
@@ -324,4 +336,5 @@ const localProps = cloneDeep(componentProps);
324
336
  localProps.url = null;
325
337
  localProps.perPage = 4;
326
338
  localProps.rowTo = undefined;
339
+ localProps.maxHeight = undefined;
327
340
  Local.args = localProps;
@@ -1,6 +1,9 @@
1
1
  <template>
2
2
  <div
3
3
  class="relative w-full overflow-hidden"
4
+ :style="{
5
+ minHeight: maxHeight ? maxHeight + 'px' : '200px',
6
+ }"
4
7
  >
5
8
  <div
6
9
  ref="slot"
@@ -23,7 +26,6 @@
23
26
  <BaseTableHeader
24
27
  v-for="(column, index) in visibleColumns"
25
28
  :key="column.newKey + ':' + index + 'header'"
26
- v-bind="column.thAttrs && column.thAttrs(column)"
27
29
  :style="column.style"
28
30
  class="bg-slate-50"
29
31
  >
@@ -52,9 +54,10 @@
52
54
  <button
53
55
  type="button"
54
56
  class="flex gap-1 w-full items-center bg-transparent text-left text-sm font-medium leading-tight text-slate-900"
55
- :class="{
56
- 'cursor-pointer': column.sortable,
57
- }"
57
+ :class="[
58
+ column.sortable ? 'cursor-pointer' : '',
59
+ column.align == 'right' ? 'justify-start flex-row-reverse' : ''
60
+ ]"
58
61
  @click="sort(column, undefined, $event as any)"
59
62
  >
60
63
  <span
@@ -108,8 +111,8 @@
108
111
  <BaseTableCell
109
112
  v-for="(column, columnIndex) in visibleColumns"
110
113
  :key="column.newKey + index + ':' + columnIndex"
111
- v-bind="column.tdAttrs && column.tdAttrs(row, column)"
112
- :class="column.class"
114
+ :class="[column.class, column.numeric ? 'tabular-nums' : '']"
115
+ :align="column.align"
113
116
  :style="column.style"
114
117
  :to="column.to ? column.to(row) : undefined"
115
118
  :href="column.href ? column.href(row) : undefined"
@@ -155,7 +158,7 @@
155
158
  scoped
156
159
  name="default"
157
160
  tag="div"
158
- class="text-sm"
161
+ class="text-sm grow"
159
162
  :data-label="column.label"
160
163
  :props="{ row, column, index, columnIndex, toggleDetails }"
161
164
  />