sprintify-ui 0.8.2 → 0.8.3
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.
- package/dist/sprintify-ui.es.js +2506 -2511
- package/dist/types/components/BaseDataIteratorSectionColumns.vue.d.ts +4 -4
- package/dist/types/components/BaseDataTableTemplate.vue.d.ts +1 -1
- package/dist/types/components/BaseTableCell.vue.d.ts +1 -1
- package/dist/types/components/BaseTableColumn.vue.d.ts +3 -25
- package/dist/types/components/BaseTableHeader.vue.d.ts +1 -1
- package/dist/types/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/BaseDataTable.stories.js +13 -0
- package/src/components/BaseDataTableTemplate.vue +10 -7
- package/src/components/BaseTableColumn.vue +1 -11
- package/src/types/index.ts +1 -1
|
@@ -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
|
-
|
|
223
|
+
align: "right" | "left" | "center";
|
|
224
224
|
searchable: boolean;
|
|
225
225
|
sortable: boolean;
|
|
226
226
|
ignoreRowInteractions: boolean;
|
|
@@ -370,7 +370,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
370
370
|
meta: Record<string, any> | undefined;
|
|
371
371
|
newKey: string;
|
|
372
372
|
numeric: boolean;
|
|
373
|
-
|
|
373
|
+
align: "right" | "left" | "center";
|
|
374
374
|
searchable: boolean;
|
|
375
375
|
sortable: boolean;
|
|
376
376
|
ignoreRowInteractions: boolean;
|
|
@@ -628,7 +628,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
628
628
|
meta: Record<string, any> | undefined;
|
|
629
629
|
newKey: string;
|
|
630
630
|
numeric: boolean;
|
|
631
|
-
|
|
631
|
+
align: "right" | "left" | "center";
|
|
632
632
|
searchable: boolean;
|
|
633
633
|
sortable: boolean;
|
|
634
634
|
ignoreRowInteractions: boolean;
|
|
@@ -778,7 +778,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
778
778
|
meta: Record<string, any> | undefined;
|
|
779
779
|
newKey: string;
|
|
780
780
|
numeric: boolean;
|
|
781
|
-
|
|
781
|
+
align: "right" | "left" | "center";
|
|
782
782
|
searchable: boolean;
|
|
783
783
|
sortable: boolean;
|
|
784
784
|
ignoreRowInteractions: boolean;
|
|
@@ -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
|
-
|
|
93
|
+
align: "right" | "left" | "center";
|
|
94
94
|
searchable: boolean;
|
|
95
95
|
sortable: boolean;
|
|
96
96
|
ignoreRowInteractions: boolean;
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -78,7 +78,7 @@ export interface BaseTableColumnData {
|
|
|
78
78
|
meta: undefined | Record<string, any>;
|
|
79
79
|
newKey: string;
|
|
80
80
|
numeric: boolean;
|
|
81
|
-
|
|
81
|
+
align: 'left' | 'center' | 'right';
|
|
82
82
|
searchable: boolean;
|
|
83
83
|
sortable: boolean;
|
|
84
84
|
ignoreRowInteractions: boolean;
|
package/package.json
CHANGED
|
@@ -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':
|
|
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
|
-
|
|
112
|
-
:
|
|
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
|
/>
|
|
@@ -39,7 +39,7 @@ export default defineComponent({
|
|
|
39
39
|
default: false,
|
|
40
40
|
type: Boolean,
|
|
41
41
|
},
|
|
42
|
-
|
|
42
|
+
align: {
|
|
43
43
|
default: 'left',
|
|
44
44
|
type: String as PropType<'left' | 'center' | 'right'>,
|
|
45
45
|
},
|
|
@@ -87,16 +87,6 @@ export default defineComponent({
|
|
|
87
87
|
default: undefined,
|
|
88
88
|
type: Function as PropType<(row: CollectionItem, index: number, column: BaseTableColumnData, colIndex: number, event: MouseEvent) => void>,
|
|
89
89
|
},
|
|
90
|
-
/** Adds native attributes to th :th-attrs="(column)" => ({})" */
|
|
91
|
-
thAttrs: {
|
|
92
|
-
type: Function,
|
|
93
|
-
default: () => ({}),
|
|
94
|
-
},
|
|
95
|
-
/** Adds native attributes to td :td-attrs="(row, column)" => ({})" */
|
|
96
|
-
tdAttrs: {
|
|
97
|
-
type: Function,
|
|
98
|
-
default: () => ({}),
|
|
99
|
-
},
|
|
100
90
|
},
|
|
101
91
|
setup() {
|
|
102
92
|
const nextSequence = inject('nextSequence') as any;
|
package/src/types/index.ts
CHANGED
|
@@ -105,7 +105,7 @@ export interface BaseTableColumnData {
|
|
|
105
105
|
meta: undefined | Record<string, any>;
|
|
106
106
|
newKey: string;
|
|
107
107
|
numeric: boolean;
|
|
108
|
-
|
|
108
|
+
align: 'left' | 'center' | 'right';
|
|
109
109
|
searchable: boolean;
|
|
110
110
|
sortable: boolean;
|
|
111
111
|
ignoreRowInteractions: boolean;
|