sprintify-ui 0.6.59 → 0.6.60
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 +29 -18
- package/dist/types/src/components/BaseTableCell.vue.d.ts +5 -5
- package/dist/types/src/components/BaseTableHeader.vue.d.ts +2 -2
- package/dist/types/src/components/BaseTableRow.vue.d.ts +10 -0
- package/package.json +1 -1
- package/src/components/BaseTable.stories.js +41 -1
- package/src/components/BaseTableCell.vue +21 -5
- package/src/components/BaseTableHeader.vue +1 -1
- package/src/components/BaseTableRow.vue +17 -1
package/dist/sprintify-ui.es.js
CHANGED
|
@@ -44279,7 +44279,7 @@ const v5 = ["align", "colspan"], y5 = /* @__PURE__ */ be({
|
|
|
44279
44279
|
to: { default: void 0 },
|
|
44280
44280
|
target: { default: void 0 },
|
|
44281
44281
|
title: { default: void 0 },
|
|
44282
|
-
align: { default:
|
|
44282
|
+
align: { default: "left" },
|
|
44283
44283
|
colspan: { default: void 0 },
|
|
44284
44284
|
class: { type: [Array, String, null, Number, Boolean], default: void 0 }
|
|
44285
44285
|
},
|
|
@@ -44288,24 +44288,26 @@ const v5 = ["align", "colspan"], y5 = /* @__PURE__ */ be({
|
|
|
44288
44288
|
if (!i)
|
|
44289
44289
|
throw new Error("BaseTableCell must be used within a BaseTableRow.");
|
|
44290
44290
|
const o = L(() => r !== void 0), a = L(() => {
|
|
44291
|
-
var
|
|
44291
|
+
var h, g;
|
|
44292
44292
|
return {
|
|
44293
|
-
spacing: (
|
|
44294
|
-
flush: (
|
|
44293
|
+
spacing: (h = e == null ? void 0 : e.value) == null ? void 0 : h.spacing,
|
|
44294
|
+
flush: (g = e == null ? void 0 : e.value) == null ? void 0 : g.flush,
|
|
44295
44295
|
head: o.value
|
|
44296
44296
|
};
|
|
44297
44297
|
}), l = L(() => wa(Gt(i.value), t)), s = L(() => l.value.href ? "a" : l.value.to ? "router-link" : "div"), d = L(() => {
|
|
44298
|
-
const
|
|
44298
|
+
const h = Ab(a.value), g = c.value ? "cursor-pointer" : "", m = p.value ? "group-hover/row:bg-slate-50" : "", v = f.value ? "hover:bg-slate-50" : "";
|
|
44299
44299
|
return kt(
|
|
44300
|
-
|
|
44301
|
-
|
|
44300
|
+
h,
|
|
44301
|
+
g,
|
|
44302
|
+
m,
|
|
44303
|
+
v,
|
|
44302
44304
|
t.class
|
|
44303
44305
|
);
|
|
44304
|
-
});
|
|
44305
|
-
return (
|
|
44306
|
-
class: "p-0 border-b border-slate-200",
|
|
44307
|
-
align:
|
|
44308
|
-
colspan:
|
|
44306
|
+
}), c = L(() => l.value.href || l.value.to), p = L(() => !f.value && c.value), f = L(() => t.href || t.to);
|
|
44307
|
+
return (h, g) => (B(), K("td", {
|
|
44308
|
+
class: "p-0 border-b border-slate-200 group-last/row:border-b-0",
|
|
44309
|
+
align: h.align,
|
|
44310
|
+
colspan: h.colspan
|
|
44309
44311
|
}, [
|
|
44310
44312
|
(B(), De(In(C(s)), {
|
|
44311
44313
|
class: de(C(d)),
|
|
@@ -44315,7 +44317,7 @@ const v5 = ["align", "colspan"], y5 = /* @__PURE__ */ be({
|
|
|
44315
44317
|
target: C(l).target
|
|
44316
44318
|
}, {
|
|
44317
44319
|
default: ge(() => [
|
|
44318
|
-
Ne(
|
|
44320
|
+
Ne(h.$slots, "default")
|
|
44319
44321
|
]),
|
|
44320
44322
|
_: 3
|
|
44321
44323
|
}, 8, ["class", "to", "href", "title", "target"]))
|
|
@@ -44339,7 +44341,7 @@ const v5 = ["align", "colspan"], y5 = /* @__PURE__ */ be({
|
|
|
44339
44341
|
__name: "BaseTableHeader",
|
|
44340
44342
|
props: {
|
|
44341
44343
|
class: { type: [Array, String, null, Number, Boolean], default: void 0 },
|
|
44342
|
-
align: { default:
|
|
44344
|
+
align: { default: "left" },
|
|
44343
44345
|
colspan: { default: void 0 }
|
|
44344
44346
|
},
|
|
44345
44347
|
setup(n) {
|
|
@@ -44374,20 +44376,29 @@ const v5 = ["align", "colspan"], y5 = /* @__PURE__ */ be({
|
|
|
44374
44376
|
], 8, w5));
|
|
44375
44377
|
}
|
|
44376
44378
|
}), E5 = /* @__PURE__ */ be({
|
|
44379
|
+
inheritAttrs: !1,
|
|
44377
44380
|
__name: "BaseTableRow",
|
|
44378
44381
|
props: {
|
|
44379
44382
|
href: { default: void 0 },
|
|
44380
44383
|
to: { default: void 0 },
|
|
44381
44384
|
target: { default: void 0 },
|
|
44382
|
-
title: { default: void 0 }
|
|
44385
|
+
title: { default: void 0 },
|
|
44386
|
+
class: { type: [Array, String, null, Number, Boolean], default: void 0 }
|
|
44383
44387
|
},
|
|
44384
44388
|
setup(n) {
|
|
44385
44389
|
const t = n;
|
|
44386
44390
|
if (!pt("BaseTable"))
|
|
44387
44391
|
throw new Error("baseTable must be used within a BaseTable.");
|
|
44388
|
-
|
|
44389
|
-
|
|
44390
|
-
|
|
44392
|
+
mt("BaseTableRow", L(() => t));
|
|
44393
|
+
const r = L(() => kt(
|
|
44394
|
+
"group/row",
|
|
44395
|
+
t.class
|
|
44396
|
+
));
|
|
44397
|
+
return (i, o) => (B(), K("tr", {
|
|
44398
|
+
class: de(C(r))
|
|
44399
|
+
}, [
|
|
44400
|
+
Ne(i.$slots, "default")
|
|
44401
|
+
], 2));
|
|
44391
44402
|
}
|
|
44392
44403
|
}), S5 = { class: "base-tabs relative" }, _5 = /* @__PURE__ */ j("div", { class: "absolute bottom-0 left-0 h-px w-full bg-slate-300" }, null, -1), k5 = { class: "flex text-center" }, A5 = /* @__PURE__ */ be({
|
|
44393
44404
|
__name: "BaseTabs",
|
|
@@ -23,10 +23,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
23
23
|
};
|
|
24
24
|
align: {
|
|
25
25
|
type: import("vue").PropType<"left" | "right" | "center">;
|
|
26
|
-
default:
|
|
26
|
+
default: string;
|
|
27
27
|
};
|
|
28
28
|
colspan: {
|
|
29
|
-
type: import("vue").PropType<number>;
|
|
29
|
+
type: import("vue").PropType<string | number>;
|
|
30
30
|
default: undefined;
|
|
31
31
|
};
|
|
32
32
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
@@ -52,10 +52,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
52
52
|
};
|
|
53
53
|
align: {
|
|
54
54
|
type: import("vue").PropType<"left" | "right" | "center">;
|
|
55
|
-
default:
|
|
55
|
+
default: string;
|
|
56
56
|
};
|
|
57
57
|
colspan: {
|
|
58
|
-
type: import("vue").PropType<number>;
|
|
58
|
+
type: import("vue").PropType<string | number>;
|
|
59
59
|
default: undefined;
|
|
60
60
|
};
|
|
61
61
|
}>>, {
|
|
@@ -65,7 +65,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
65
65
|
target: "_blank" | "_self" | "_parent" | "_top";
|
|
66
66
|
href: string;
|
|
67
67
|
align: "left" | "right" | "center";
|
|
68
|
-
colspan: number;
|
|
68
|
+
colspan: string | number;
|
|
69
69
|
}, {}>, {
|
|
70
70
|
default?(_: {}): any;
|
|
71
71
|
}>;
|
|
@@ -6,7 +6,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
6
6
|
};
|
|
7
7
|
align: {
|
|
8
8
|
type: import("vue").PropType<"left" | "right" | "center">;
|
|
9
|
-
default:
|
|
9
|
+
default: string;
|
|
10
10
|
};
|
|
11
11
|
colspan: {
|
|
12
12
|
type: import("vue").PropType<number>;
|
|
@@ -19,7 +19,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
19
19
|
};
|
|
20
20
|
align: {
|
|
21
21
|
type: import("vue").PropType<"left" | "right" | "center">;
|
|
22
|
-
default:
|
|
22
|
+
default: string;
|
|
23
23
|
};
|
|
24
24
|
colspan: {
|
|
25
25
|
type: import("vue").PropType<number>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { ClassNameValue } from 'tailwind-merge';
|
|
1
2
|
import { RouteLocationRaw } from 'vue-router';
|
|
2
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
4
|
+
class: {
|
|
5
|
+
type: import("vue").PropType<string | false | 0 | ClassNameValue[] | null>;
|
|
6
|
+
default: undefined;
|
|
7
|
+
};
|
|
3
8
|
title: {
|
|
4
9
|
type: import("vue").PropType<string>;
|
|
5
10
|
default: undefined;
|
|
@@ -17,6 +22,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
17
22
|
default: undefined;
|
|
18
23
|
};
|
|
19
24
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
class: {
|
|
26
|
+
type: import("vue").PropType<string | false | 0 | ClassNameValue[] | null>;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
20
29
|
title: {
|
|
21
30
|
type: import("vue").PropType<string>;
|
|
22
31
|
default: undefined;
|
|
@@ -34,6 +43,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
34
43
|
default: undefined;
|
|
35
44
|
};
|
|
36
45
|
}>>, {
|
|
46
|
+
class: string | false | 0 | ClassNameValue[] | null;
|
|
37
47
|
title: string;
|
|
38
48
|
to: RouteLocationRaw;
|
|
39
49
|
target: "_blank" | "_self" | "_parent" | "_top";
|
package/package.json
CHANGED
|
@@ -105,4 +105,44 @@ const TemplateRouterLink = (args) => ({
|
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
export const RouterLink = TemplateRouterLink.bind({});
|
|
108
|
-
RouterLink.args = {};
|
|
108
|
+
RouterLink.args = {};
|
|
109
|
+
|
|
110
|
+
const TemplateCellClick = (args) => ({
|
|
111
|
+
components: components,
|
|
112
|
+
setup() {
|
|
113
|
+
return { args, options };
|
|
114
|
+
},
|
|
115
|
+
template: `
|
|
116
|
+
<div class="p-6">
|
|
117
|
+
|
|
118
|
+
<p class="mb-3">
|
|
119
|
+
Only the first cell is clickable
|
|
120
|
+
</p>
|
|
121
|
+
|
|
122
|
+
<BaseTable class="" v-bind="args">
|
|
123
|
+
${headTemplate}
|
|
124
|
+
<BaseTableBody>
|
|
125
|
+
<BaseTableRow
|
|
126
|
+
v-for="option in options"
|
|
127
|
+
:key="option.value"
|
|
128
|
+
>
|
|
129
|
+
<BaseTableCell class="font-medium" href="https://google.com">
|
|
130
|
+
{{ option.label }}
|
|
131
|
+
</BaseTableCell>
|
|
132
|
+
<BaseTableCell>
|
|
133
|
+
<BaseBadge class="font-mono">
|
|
134
|
+
{{ option.value ?? 'N/A' }}
|
|
135
|
+
</BaseBadge>
|
|
136
|
+
</BaseTableCell>
|
|
137
|
+
<BaseTableCell>
|
|
138
|
+
{{ option.type ?? 'N/A' }}
|
|
139
|
+
</BaseTableCell>
|
|
140
|
+
</BaseTableRow>
|
|
141
|
+
</BaseTableBody>
|
|
142
|
+
</BaseTable>
|
|
143
|
+
</div>
|
|
144
|
+
`,
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export const CellClick = TemplateCellClick.bind({});
|
|
148
|
+
CellClick.args = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<td
|
|
3
|
-
class="p-0 border-b border-slate-200"
|
|
3
|
+
class="p-0 border-b border-slate-200 group-last/row:border-b-0"
|
|
4
4
|
:align="align"
|
|
5
5
|
:colspan="colspan"
|
|
6
6
|
>
|
|
@@ -45,14 +45,14 @@ const props = withDefaults(defineProps<{
|
|
|
45
45
|
target?: '_blank' | '_self' | '_parent' | '_top',
|
|
46
46
|
title?: string,
|
|
47
47
|
align?: 'left' | 'center' | 'right',
|
|
48
|
-
colspan?: number,
|
|
48
|
+
colspan?: number | string,
|
|
49
49
|
class?: ClassNameValue,
|
|
50
50
|
}>(), {
|
|
51
51
|
href: undefined,
|
|
52
52
|
to: undefined,
|
|
53
53
|
target: undefined,
|
|
54
54
|
title: undefined,
|
|
55
|
-
align:
|
|
55
|
+
align: 'left',
|
|
56
56
|
colspan: undefined,
|
|
57
57
|
class: undefined,
|
|
58
58
|
});
|
|
@@ -83,13 +83,29 @@ const componentName = computed(() => {
|
|
|
83
83
|
|
|
84
84
|
const classes = computed(() => {
|
|
85
85
|
const base = cellClasses(cellConfig.value);
|
|
86
|
-
const click =
|
|
86
|
+
const click = clickable.value ? 'cursor-pointer' : '';
|
|
87
|
+
const clickRow = clickableRow.value ? 'group-hover/row:bg-slate-50' : '';
|
|
88
|
+
const clickCell = clickableCell.value ? 'hover:bg-slate-50' : '';
|
|
87
89
|
|
|
88
90
|
return twMerge(
|
|
89
91
|
base,
|
|
90
92
|
click,
|
|
93
|
+
clickRow,
|
|
94
|
+
clickCell,
|
|
91
95
|
props.class,
|
|
92
96
|
);
|
|
93
|
-
})
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const clickable = computed(() => {
|
|
100
|
+
return propsInternal.value.href || propsInternal.value.to;
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const clickableRow = computed(() => {
|
|
104
|
+
return !clickableCell.value && clickable.value;
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const clickableCell = computed(() => {
|
|
108
|
+
return props.href || props.to;
|
|
109
|
+
});
|
|
94
110
|
|
|
95
111
|
</script>
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<tr>
|
|
2
|
+
<tr :class="classes">
|
|
3
3
|
<slot />
|
|
4
4
|
</tr>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script lang="ts" setup>
|
|
8
|
+
import { ClassNameValue, twMerge } from 'tailwind-merge';
|
|
8
9
|
import { RouteLocationRaw } from 'vue-router';
|
|
9
10
|
|
|
11
|
+
defineOptions({
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
});
|
|
14
|
+
|
|
10
15
|
const baseTable = inject('BaseTable');
|
|
11
16
|
|
|
12
17
|
if (!baseTable) {
|
|
@@ -18,13 +23,24 @@ const props = withDefaults(defineProps<{
|
|
|
18
23
|
to?: RouteLocationRaw,
|
|
19
24
|
target?: '_blank' | '_self' | '_parent' | '_top',
|
|
20
25
|
title?: string,
|
|
26
|
+
class?: ClassNameValue,
|
|
21
27
|
}>(), {
|
|
22
28
|
href: undefined,
|
|
23
29
|
to: undefined,
|
|
24
30
|
target: undefined,
|
|
25
31
|
title: undefined,
|
|
32
|
+
class: undefined,
|
|
26
33
|
});
|
|
27
34
|
|
|
28
35
|
provide('BaseTableRow', computed(() => props));
|
|
29
36
|
|
|
37
|
+
const classes = computed(() => {
|
|
38
|
+
const base = 'group/row';
|
|
39
|
+
|
|
40
|
+
return twMerge(
|
|
41
|
+
base,
|
|
42
|
+
props.class,
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
30
46
|
</script>
|