sprintify-ui 0.1.9 → 0.1.10
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
CHANGED
|
@@ -16663,19 +16663,27 @@ const ub = { class: "absolute inset-0 flex h-full w-full items-center justify-ce
|
|
|
16663
16663
|
__name: "BaseHeader",
|
|
16664
16664
|
props: {
|
|
16665
16665
|
title: null,
|
|
16666
|
-
subtitle:
|
|
16667
|
-
attributes:
|
|
16668
|
-
actions:
|
|
16669
|
-
badge:
|
|
16670
|
-
layout:
|
|
16671
|
-
breadcrumbs:
|
|
16666
|
+
subtitle: { default: void 0 },
|
|
16667
|
+
attributes: { default: void 0 },
|
|
16668
|
+
actions: { default: void 0 },
|
|
16669
|
+
badge: { default: void 0 },
|
|
16670
|
+
layout: { default: "default" },
|
|
16671
|
+
breadcrumbs: { default: void 0 }
|
|
16672
16672
|
},
|
|
16673
16673
|
setup(t) {
|
|
16674
|
-
const r = t, e = W(
|
|
16675
|
-
|
|
16676
|
-
|
|
16677
|
-
|
|
16678
|
-
),
|
|
16674
|
+
const r = t, e = W(() => {
|
|
16675
|
+
var u, f;
|
|
16676
|
+
if (r.actions)
|
|
16677
|
+
return ((u = r.actions) == null ? void 0 : u.length) === 1 ? 0 : (f = r.actions) == null ? void 0 : f.findIndex((d) => d.color == "primary");
|
|
16678
|
+
}), n = W(() => {
|
|
16679
|
+
if (!r.actions)
|
|
16680
|
+
return;
|
|
16681
|
+
const u = e.value;
|
|
16682
|
+
return u ? r.actions[u] : null;
|
|
16683
|
+
}), i = W(() => {
|
|
16684
|
+
var u;
|
|
16685
|
+
return r.actions ? (u = r.actions) == null ? void 0 : u.filter((f, d) => d !== e.value) : [];
|
|
16686
|
+
}), a = se(null), l = se(800);
|
|
16679
16687
|
Er(a, () => {
|
|
16680
16688
|
var u;
|
|
16681
16689
|
l.value = ((u = a.value) == null ? void 0 : u.clientWidth) ?? 800;
|
|
@@ -1,35 +1,63 @@
|
|
|
1
1
|
import { ActionItem, Breadcrumb } from '@/types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
title: string;
|
|
4
4
|
subtitle?: string | undefined;
|
|
5
5
|
attributes?: {
|
|
6
6
|
icon: string;
|
|
7
7
|
label: string;
|
|
8
8
|
}[] | undefined;
|
|
9
|
-
actions
|
|
10
|
-
badge
|
|
9
|
+
actions?: ActionItem[] | undefined;
|
|
10
|
+
badge?: {
|
|
11
11
|
icon: string;
|
|
12
12
|
label: string;
|
|
13
13
|
color: string;
|
|
14
|
-
};
|
|
15
|
-
layout
|
|
14
|
+
} | undefined;
|
|
15
|
+
layout?: "default" | "compact" | undefined;
|
|
16
16
|
breadcrumbs?: Breadcrumb[] | undefined;
|
|
17
|
-
}>, {
|
|
17
|
+
}>, {
|
|
18
|
+
subtitle: undefined;
|
|
19
|
+
attributes: undefined;
|
|
20
|
+
actions: undefined;
|
|
21
|
+
badge: undefined;
|
|
22
|
+
layout: string;
|
|
23
|
+
breadcrumbs: undefined;
|
|
24
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
18
25
|
title: string;
|
|
19
26
|
subtitle?: string | undefined;
|
|
20
27
|
attributes?: {
|
|
21
28
|
icon: string;
|
|
22
29
|
label: string;
|
|
23
30
|
}[] | undefined;
|
|
31
|
+
actions?: ActionItem[] | undefined;
|
|
32
|
+
badge?: {
|
|
33
|
+
icon: string;
|
|
34
|
+
label: string;
|
|
35
|
+
color: string;
|
|
36
|
+
} | undefined;
|
|
37
|
+
layout?: "default" | "compact" | undefined;
|
|
38
|
+
breadcrumbs?: Breadcrumb[] | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
subtitle: undefined;
|
|
41
|
+
attributes: undefined;
|
|
42
|
+
actions: undefined;
|
|
43
|
+
badge: undefined;
|
|
44
|
+
layout: string;
|
|
45
|
+
breadcrumbs: undefined;
|
|
46
|
+
}>>>, {
|
|
47
|
+
attributes: {
|
|
48
|
+
icon: string;
|
|
49
|
+
label: string;
|
|
50
|
+
}[];
|
|
24
51
|
actions: ActionItem[];
|
|
52
|
+
breadcrumbs: Breadcrumb[];
|
|
53
|
+
layout: 'default' | 'compact';
|
|
54
|
+
subtitle: string;
|
|
25
55
|
badge: {
|
|
26
56
|
icon: string;
|
|
27
57
|
label: string;
|
|
28
58
|
color: string;
|
|
29
59
|
};
|
|
30
|
-
|
|
31
|
-
breadcrumbs?: Breadcrumb[] | undefined;
|
|
32
|
-
}>>>, {}>;
|
|
60
|
+
}>;
|
|
33
61
|
export default _default;
|
|
34
62
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
63
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -40,3 +68,8 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
40
68
|
required: true;
|
|
41
69
|
};
|
|
42
70
|
};
|
|
71
|
+
type __VLS_WithDefaults<P, D> = {
|
|
72
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
|
|
73
|
+
default: D[K];
|
|
74
|
+
} : P[K];
|
|
75
|
+
};
|
package/package.json
CHANGED
|
@@ -110,25 +110,56 @@ import BaseActionItemButton from './BaseActionItemButton.vue';
|
|
|
110
110
|
import BaseBadge from './BaseBadge.vue';
|
|
111
111
|
import BaseMenu from './BaseMenu.vue';
|
|
112
112
|
|
|
113
|
-
const props =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
const props = withDefaults(
|
|
114
|
+
defineProps<{
|
|
115
|
+
title: string;
|
|
116
|
+
subtitle?: string;
|
|
117
|
+
attributes?: { icon: string; label: string }[];
|
|
118
|
+
actions?: ActionItem[];
|
|
119
|
+
badge?: { icon: string; label: string; color: string };
|
|
120
|
+
layout?: 'default' | 'compact';
|
|
121
|
+
breadcrumbs?: Breadcrumb[];
|
|
122
|
+
}>(),
|
|
123
|
+
{
|
|
124
|
+
subtitle: undefined,
|
|
125
|
+
attributes: undefined,
|
|
126
|
+
actions: undefined,
|
|
127
|
+
badge: undefined,
|
|
128
|
+
layout: 'default',
|
|
129
|
+
breadcrumbs: undefined,
|
|
130
|
+
}
|
|
125
131
|
);
|
|
126
132
|
|
|
127
|
-
const
|
|
133
|
+
const primaryActionIndex = computed(() => {
|
|
134
|
+
if (!props.actions) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
if (props.actions?.length === 1) {
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
return props.actions?.findIndex((a) => a.color == 'primary');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const primaryAction = computed(() => {
|
|
144
|
+
if (!props.actions) {
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
128
147
|
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
)
|
|
148
|
+
const index = primaryActionIndex.value;
|
|
149
|
+
|
|
150
|
+
if (index) {
|
|
151
|
+
return props.actions[index];
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return null;
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const secondaryActions = computed(() => {
|
|
158
|
+
if (!props.actions) {
|
|
159
|
+
return [];
|
|
160
|
+
}
|
|
161
|
+
return props.actions?.filter((a, i) => i !== primaryActionIndex.value);
|
|
162
|
+
});
|
|
132
163
|
|
|
133
164
|
const baseHeaderRef = ref<HTMLElement | null>(null);
|
|
134
165
|
|