@thl-ui/vue 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +58 -2
- package/dist/components/basic.d.ts +397 -0
- package/dist/components/basic.js +303 -0
- package/dist/components/basic.js.map +1 -0
- package/dist/components/data.d.ts +690 -0
- package/dist/components/data.js +911 -0
- package/dist/components/data.js.map +1 -0
- package/dist/components/form.d.ts +764 -0
- package/dist/components/form.js +1212 -0
- package/dist/components/form.js.map +1 -0
- package/dist/components/layout.d.ts +219 -0
- package/dist/components/layout.js +480 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/nav.d.ts +295 -0
- package/dist/components/nav.js +398 -0
- package/dist/components/nav.js.map +1 -0
- package/dist/components/overlay.d.ts +303 -0
- package/dist/components/overlay.js +437 -0
- package/dist/components/overlay.js.map +1 -0
- package/dist/components/util.d.ts +26 -0
- package/dist/components/util.js +35 -0
- package/dist/components/util.js.map +1 -0
- package/dist/context.d.ts +47 -0
- package/dist/context.js +81 -0
- package/dist/context.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +128 -0
- package/dist/index.js.map +1 -0
- package/package.json +56 -4
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { TabsItem, BreadcrumbItem, StepItem, TimelineItem } from '@thl-ui/core';
|
|
3
|
+
export declare const ThlTabs: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
4
|
+
items: {
|
|
5
|
+
type: PropType<TabsItem[]>;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
modelValue: StringConstructor;
|
|
9
|
+
variant: StringConstructor;
|
|
10
|
+
justified: BooleanConstructor;
|
|
11
|
+
keepMounted: BooleanConstructor;
|
|
12
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
15
|
+
items: {
|
|
16
|
+
type: PropType<TabsItem[]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
modelValue: StringConstructor;
|
|
20
|
+
variant: StringConstructor;
|
|
21
|
+
justified: BooleanConstructor;
|
|
22
|
+
keepMounted: BooleanConstructor;
|
|
23
|
+
}>> & Readonly<{
|
|
24
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
25
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
justified: boolean;
|
|
28
|
+
keepMounted: boolean;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
export declare const ThlBreadcrumb: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
31
|
+
items: {
|
|
32
|
+
type: PropType<BreadcrumbItem[]>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
38
|
+
items: {
|
|
39
|
+
type: PropType<BreadcrumbItem[]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
43
|
+
export declare const ThlPagination: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
44
|
+
page: {
|
|
45
|
+
type: NumberConstructor;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
total: {
|
|
49
|
+
type: NumberConstructor;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
pageSize: {
|
|
53
|
+
type: NumberConstructor;
|
|
54
|
+
default: number;
|
|
55
|
+
};
|
|
56
|
+
maxPages: NumberConstructor;
|
|
57
|
+
size: StringConstructor;
|
|
58
|
+
showTotal: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: undefined;
|
|
61
|
+
};
|
|
62
|
+
showFirstLast: BooleanConstructor;
|
|
63
|
+
split: BooleanConstructor;
|
|
64
|
+
rounded: BooleanConstructor;
|
|
65
|
+
pageSizes: PropType<number[]>;
|
|
66
|
+
ariaLabel: StringConstructor;
|
|
67
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
68
|
+
[key: string]: any;
|
|
69
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("change" | "update:page" | "update:pageSize")[], "change" | "update:page" | "update:pageSize", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
70
|
+
page: {
|
|
71
|
+
type: NumberConstructor;
|
|
72
|
+
required: true;
|
|
73
|
+
};
|
|
74
|
+
total: {
|
|
75
|
+
type: NumberConstructor;
|
|
76
|
+
required: true;
|
|
77
|
+
};
|
|
78
|
+
pageSize: {
|
|
79
|
+
type: NumberConstructor;
|
|
80
|
+
default: number;
|
|
81
|
+
};
|
|
82
|
+
maxPages: NumberConstructor;
|
|
83
|
+
size: StringConstructor;
|
|
84
|
+
showTotal: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: undefined;
|
|
87
|
+
};
|
|
88
|
+
showFirstLast: BooleanConstructor;
|
|
89
|
+
split: BooleanConstructor;
|
|
90
|
+
rounded: BooleanConstructor;
|
|
91
|
+
pageSizes: PropType<number[]>;
|
|
92
|
+
ariaLabel: StringConstructor;
|
|
93
|
+
}>> & Readonly<{
|
|
94
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
95
|
+
"onUpdate:page"?: ((...args: any[]) => any) | undefined;
|
|
96
|
+
"onUpdate:pageSize"?: ((...args: any[]) => any) | undefined;
|
|
97
|
+
}>, {
|
|
98
|
+
rounded: boolean;
|
|
99
|
+
split: boolean;
|
|
100
|
+
showFirstLast: boolean;
|
|
101
|
+
pageSize: number;
|
|
102
|
+
showTotal: boolean;
|
|
103
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
104
|
+
export declare const ThlSteps: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
105
|
+
items: {
|
|
106
|
+
type: PropType<StepItem[]>;
|
|
107
|
+
required: true;
|
|
108
|
+
};
|
|
109
|
+
current: {
|
|
110
|
+
type: NumberConstructor;
|
|
111
|
+
default: number;
|
|
112
|
+
};
|
|
113
|
+
variant: {
|
|
114
|
+
type: PropType<string>;
|
|
115
|
+
default: string;
|
|
116
|
+
};
|
|
117
|
+
clickable: BooleanConstructor;
|
|
118
|
+
vertical: BooleanConstructor;
|
|
119
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
120
|
+
[key: string]: any;
|
|
121
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "update:current"[], "update:current", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
122
|
+
items: {
|
|
123
|
+
type: PropType<StepItem[]>;
|
|
124
|
+
required: true;
|
|
125
|
+
};
|
|
126
|
+
current: {
|
|
127
|
+
type: NumberConstructor;
|
|
128
|
+
default: number;
|
|
129
|
+
};
|
|
130
|
+
variant: {
|
|
131
|
+
type: PropType<string>;
|
|
132
|
+
default: string;
|
|
133
|
+
};
|
|
134
|
+
clickable: BooleanConstructor;
|
|
135
|
+
vertical: BooleanConstructor;
|
|
136
|
+
}>> & Readonly<{
|
|
137
|
+
"onUpdate:current"?: ((...args: any[]) => any) | undefined;
|
|
138
|
+
}>, {
|
|
139
|
+
vertical: boolean;
|
|
140
|
+
variant: string;
|
|
141
|
+
clickable: boolean;
|
|
142
|
+
current: number;
|
|
143
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
144
|
+
export declare const ThlTimeline: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
145
|
+
items: {
|
|
146
|
+
type: PropType<TimelineItem[]>;
|
|
147
|
+
required: true;
|
|
148
|
+
};
|
|
149
|
+
variant: {
|
|
150
|
+
type: PropType<"left" | "alternate">;
|
|
151
|
+
default: "left" | "alternate";
|
|
152
|
+
};
|
|
153
|
+
headingLevel: {
|
|
154
|
+
type: PropType<2 | 3 | 4 | 5 | 6>;
|
|
155
|
+
default: number;
|
|
156
|
+
};
|
|
157
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
158
|
+
[key: string]: any;
|
|
159
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
160
|
+
items: {
|
|
161
|
+
type: PropType<TimelineItem[]>;
|
|
162
|
+
required: true;
|
|
163
|
+
};
|
|
164
|
+
variant: {
|
|
165
|
+
type: PropType<"left" | "alternate">;
|
|
166
|
+
default: "left" | "alternate";
|
|
167
|
+
};
|
|
168
|
+
headingLevel: {
|
|
169
|
+
type: PropType<2 | 3 | 4 | 5 | 6>;
|
|
170
|
+
default: number;
|
|
171
|
+
};
|
|
172
|
+
}>> & Readonly<{}>, {
|
|
173
|
+
variant: "left" | "alternate";
|
|
174
|
+
headingLevel: 2 | 3 | 4 | 5 | 6;
|
|
175
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
176
|
+
export declare const ThlActivityFeed: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
177
|
+
items: {
|
|
178
|
+
type: PropType<Array<{
|
|
179
|
+
avatar?: string;
|
|
180
|
+
icon?: string;
|
|
181
|
+
title: string;
|
|
182
|
+
time?: string;
|
|
183
|
+
content?: string;
|
|
184
|
+
color?: string;
|
|
185
|
+
}>>;
|
|
186
|
+
required: true;
|
|
187
|
+
};
|
|
188
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
189
|
+
[key: string]: any;
|
|
190
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
191
|
+
items: {
|
|
192
|
+
type: PropType<Array<{
|
|
193
|
+
avatar?: string;
|
|
194
|
+
icon?: string;
|
|
195
|
+
title: string;
|
|
196
|
+
time?: string;
|
|
197
|
+
content?: string;
|
|
198
|
+
color?: string;
|
|
199
|
+
}>>;
|
|
200
|
+
required: true;
|
|
201
|
+
};
|
|
202
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
203
|
+
export declare const ThlHorizontalTimeline: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
204
|
+
items: {
|
|
205
|
+
type: PropType<Array<{
|
|
206
|
+
date: string;
|
|
207
|
+
title: string;
|
|
208
|
+
content?: string;
|
|
209
|
+
}>>;
|
|
210
|
+
required: true;
|
|
211
|
+
};
|
|
212
|
+
headingLevel: {
|
|
213
|
+
type: PropType<2 | 3 | 4 | 5 | 6>;
|
|
214
|
+
default: number;
|
|
215
|
+
};
|
|
216
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
217
|
+
[key: string]: any;
|
|
218
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
219
|
+
items: {
|
|
220
|
+
type: PropType<Array<{
|
|
221
|
+
date: string;
|
|
222
|
+
title: string;
|
|
223
|
+
content?: string;
|
|
224
|
+
}>>;
|
|
225
|
+
required: true;
|
|
226
|
+
};
|
|
227
|
+
headingLevel: {
|
|
228
|
+
type: PropType<2 | 3 | 4 | 5 | 6>;
|
|
229
|
+
default: number;
|
|
230
|
+
};
|
|
231
|
+
}>> & Readonly<{}>, {
|
|
232
|
+
headingLevel: 2 | 3 | 4 | 5 | 6;
|
|
233
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
234
|
+
export declare const ThlCarousel: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
235
|
+
slides: {
|
|
236
|
+
type: PropType<Array<{
|
|
237
|
+
image?: string;
|
|
238
|
+
caption?: string;
|
|
239
|
+
alt?: string;
|
|
240
|
+
}>>;
|
|
241
|
+
required: true;
|
|
242
|
+
};
|
|
243
|
+
interval: {
|
|
244
|
+
type: NumberConstructor;
|
|
245
|
+
default: number;
|
|
246
|
+
};
|
|
247
|
+
fade: BooleanConstructor;
|
|
248
|
+
arrows: {
|
|
249
|
+
type: BooleanConstructor;
|
|
250
|
+
default: boolean;
|
|
251
|
+
};
|
|
252
|
+
dots: {
|
|
253
|
+
type: BooleanConstructor;
|
|
254
|
+
default: boolean;
|
|
255
|
+
};
|
|
256
|
+
height: {
|
|
257
|
+
type: PropType<string | number>;
|
|
258
|
+
required: false;
|
|
259
|
+
};
|
|
260
|
+
ariaLabel: StringConstructor;
|
|
261
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
262
|
+
[key: string]: any;
|
|
263
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
264
|
+
slides: {
|
|
265
|
+
type: PropType<Array<{
|
|
266
|
+
image?: string;
|
|
267
|
+
caption?: string;
|
|
268
|
+
alt?: string;
|
|
269
|
+
}>>;
|
|
270
|
+
required: true;
|
|
271
|
+
};
|
|
272
|
+
interval: {
|
|
273
|
+
type: NumberConstructor;
|
|
274
|
+
default: number;
|
|
275
|
+
};
|
|
276
|
+
fade: BooleanConstructor;
|
|
277
|
+
arrows: {
|
|
278
|
+
type: BooleanConstructor;
|
|
279
|
+
default: boolean;
|
|
280
|
+
};
|
|
281
|
+
dots: {
|
|
282
|
+
type: BooleanConstructor;
|
|
283
|
+
default: boolean;
|
|
284
|
+
};
|
|
285
|
+
height: {
|
|
286
|
+
type: PropType<string | number>;
|
|
287
|
+
required: false;
|
|
288
|
+
};
|
|
289
|
+
ariaLabel: StringConstructor;
|
|
290
|
+
}>> & Readonly<{}>, {
|
|
291
|
+
fade: boolean;
|
|
292
|
+
interval: number;
|
|
293
|
+
arrows: boolean;
|
|
294
|
+
dots: boolean;
|
|
295
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { defineComponent as m, h as a, watch as z, onMounted as B, onBeforeUnmount as w, ref as S } from "vue";
|
|
2
|
+
import { bem as b, cx as p, createCarousel as q, paginate as A, uid as L, createTabs as N } from "@thl-ui/core";
|
|
3
|
+
import { usePrefix as g, useI18n as T, useStore as x, useDefaults as $ } from "../context.js";
|
|
4
|
+
import { icon as v, any as F, str as C } from "./util.js";
|
|
5
|
+
import { ThlBadge as P } from "./basic.js";
|
|
6
|
+
const I = /* @__PURE__ */ m({
|
|
7
|
+
name: "ThlTabs",
|
|
8
|
+
props: { items: { type: Array, required: !0 }, modelValue: String, variant: String, justified: Boolean, keepMounted: Boolean },
|
|
9
|
+
emits: ["update:modelValue", "change"],
|
|
10
|
+
setup(e, { slots: r, emit: c }) {
|
|
11
|
+
const t = g(), l = $("Tabs", e), i = L("tabs"), s = N({
|
|
12
|
+
items: e.items,
|
|
13
|
+
active: e.modelValue,
|
|
14
|
+
onChange: (n) => {
|
|
15
|
+
c("update:modelValue", n), c("change", n);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
z(
|
|
19
|
+
() => e.items,
|
|
20
|
+
(n) => s.setItems(n)
|
|
21
|
+
), z(
|
|
22
|
+
() => e.modelValue,
|
|
23
|
+
(n) => {
|
|
24
|
+
n !== void 0 && n !== s.active() && s.state.set(n);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
const o = x(s.state), d = S();
|
|
28
|
+
return () => {
|
|
29
|
+
const n = b("tabs", t.value), y = l.value.variant, k = y === "vertical";
|
|
30
|
+
return a("div", { class: n({ [y ?? "default"]: !!y && y !== "default", justified: e.justified }) }, [
|
|
31
|
+
a(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
ref: d,
|
|
35
|
+
role: "tablist",
|
|
36
|
+
"aria-orientation": k ? "vertical" : "horizontal",
|
|
37
|
+
class: n("list"),
|
|
38
|
+
onKeydown: (u) => {
|
|
39
|
+
s.onKeyDown(u, k ? "vertical" : "horizontal") && requestAnimationFrame(() => d.value?.querySelector('[aria-selected="true"]')?.focus());
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
e.items.map((u) => {
|
|
43
|
+
const f = s.ids(i, u.key), h = u.key === o.value;
|
|
44
|
+
return a(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
key: u.key,
|
|
48
|
+
id: f.tab,
|
|
49
|
+
role: "tab",
|
|
50
|
+
type: "button",
|
|
51
|
+
"aria-selected": h,
|
|
52
|
+
"aria-controls": f.panel,
|
|
53
|
+
tabindex: h ? 0 : -1,
|
|
54
|
+
disabled: u.disabled,
|
|
55
|
+
class: p(n("tab"), { "is-active": h }),
|
|
56
|
+
onClick: () => s.select(u.key)
|
|
57
|
+
},
|
|
58
|
+
[
|
|
59
|
+
v(u.icon),
|
|
60
|
+
r[`tab-${u.key}`] ? r[`tab-${u.key}`]() : u.label,
|
|
61
|
+
u.badge !== void 0 ? a(P, { color: "danger" }, () => u.badge) : null
|
|
62
|
+
]
|
|
63
|
+
);
|
|
64
|
+
})
|
|
65
|
+
),
|
|
66
|
+
...e.items.map((u) => {
|
|
67
|
+
const f = s.ids(i, u.key), h = u.key === o.value;
|
|
68
|
+
return !h && !e.keepMounted ? null : a(
|
|
69
|
+
"div",
|
|
70
|
+
{ key: u.key, id: f.panel, role: "tabpanel", "aria-labelledby": f.tab, hidden: !h, tabindex: 0, class: n("panel") },
|
|
71
|
+
r[u.key]?.() ?? r.default?.({ key: u.key })
|
|
72
|
+
);
|
|
73
|
+
})
|
|
74
|
+
]);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}), K = /* @__PURE__ */ m({
|
|
78
|
+
name: "ThlBreadcrumb",
|
|
79
|
+
props: { items: { type: Array, required: !0 } },
|
|
80
|
+
setup(e, { slots: r }) {
|
|
81
|
+
const c = g();
|
|
82
|
+
return () => {
|
|
83
|
+
const t = b("breadcrumb", c.value);
|
|
84
|
+
return a(
|
|
85
|
+
"nav",
|
|
86
|
+
{ "aria-label": "breadcrumb" },
|
|
87
|
+
a(
|
|
88
|
+
"ol",
|
|
89
|
+
{ class: t() },
|
|
90
|
+
e.items.map((l, i) => {
|
|
91
|
+
const s = i === e.items.length - 1, o = [v(l.icon), l.label];
|
|
92
|
+
return a(
|
|
93
|
+
"li",
|
|
94
|
+
{ key: i, class: p(t("item"), { "is-active": s }), "aria-current": s ? "page" : void 0 },
|
|
95
|
+
!s && l.href ? r.link ? r.link({ item: l }) : a("a", { href: l.href }, o) : o
|
|
96
|
+
);
|
|
97
|
+
})
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}), U = /* @__PURE__ */ m({
|
|
103
|
+
name: "ThlPagination",
|
|
104
|
+
props: {
|
|
105
|
+
page: { type: Number, required: !0 },
|
|
106
|
+
total: { type: Number, required: !0 },
|
|
107
|
+
pageSize: { type: Number, default: 10 },
|
|
108
|
+
maxPages: Number,
|
|
109
|
+
size: String,
|
|
110
|
+
showTotal: { type: Boolean, default: void 0 },
|
|
111
|
+
showFirstLast: Boolean,
|
|
112
|
+
split: Boolean,
|
|
113
|
+
rounded: Boolean,
|
|
114
|
+
pageSizes: Array,
|
|
115
|
+
ariaLabel: String
|
|
116
|
+
},
|
|
117
|
+
emits: ["update:page", "update:pageSize", "change"],
|
|
118
|
+
setup(e, { emit: r }) {
|
|
119
|
+
const c = g(), { t } = T(), l = $("Pagination", e), i = (s) => {
|
|
120
|
+
r("update:page", s), r("change", s);
|
|
121
|
+
};
|
|
122
|
+
return () => {
|
|
123
|
+
const s = A({ page: e.page, total: e.total, pageSize: e.pageSize, maxPages: l.value.maxPages }), o = b("pagination", c.value), d = (n, y, k, u) => a("li", a("button", { type: "button", class: o("item"), disabled: k, onClick: () => i(y), "aria-label": u }, n));
|
|
124
|
+
return a("nav", { "aria-label": e.ariaLabel ?? t("pagination.goto"), class: `${c.value}-flex` }, [
|
|
125
|
+
l.value.showTotal ? a("span", { class: o("total") }, t("pagination.total", { count: e.total })) : null,
|
|
126
|
+
a("ul", { class: o({ split: e.split, rounded: e.rounded, size: e.size && e.size !== "md" ? e.size : void 0 }) }, [
|
|
127
|
+
e.showFirstLast ? d(v("chevrons-left"), 1, !s.hasPrev, t("pagination.first")) : null,
|
|
128
|
+
d(v("chevron-left"), s.page - 1, !s.hasPrev, t("pagination.prev")),
|
|
129
|
+
...s.items.map(
|
|
130
|
+
(n) => n.type === "ellipsis" ? a("li", { key: n.key }, a("span", { class: o("item", { ellipsis: !0 }) }, "…")) : a(
|
|
131
|
+
"li",
|
|
132
|
+
{ key: n.page },
|
|
133
|
+
a(
|
|
134
|
+
"button",
|
|
135
|
+
{
|
|
136
|
+
type: "button",
|
|
137
|
+
class: p(o("item"), { "is-active": n.active }),
|
|
138
|
+
"aria-current": n.active ? "page" : void 0,
|
|
139
|
+
onClick: () => i(n.page),
|
|
140
|
+
"aria-label": t("pagination.page", { page: n.page })
|
|
141
|
+
},
|
|
142
|
+
n.page
|
|
143
|
+
)
|
|
144
|
+
)
|
|
145
|
+
),
|
|
146
|
+
d(v("chevron-right"), s.page + 1, !s.hasNext, t("pagination.next")),
|
|
147
|
+
e.showFirstLast ? d(v("chevrons-right"), s.pageCount, !s.hasNext, t("pagination.last")) : null
|
|
148
|
+
]),
|
|
149
|
+
e.pageSizes ? a(
|
|
150
|
+
"select",
|
|
151
|
+
{
|
|
152
|
+
class: p(`${c.value}-input`, `${c.value}-input--size-sm`, o("size")),
|
|
153
|
+
style: { width: "auto" },
|
|
154
|
+
value: e.pageSize,
|
|
155
|
+
"aria-label": t("pagination.pageSize", { size: e.pageSize }),
|
|
156
|
+
onChange: (n) => r("update:pageSize", Number(n.target.value))
|
|
157
|
+
},
|
|
158
|
+
e.pageSizes.map((n) => a("option", { value: n }, t("pagination.pageSize", { size: n })))
|
|
159
|
+
) : null
|
|
160
|
+
]);
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}), X = /* @__PURE__ */ m({
|
|
164
|
+
name: "ThlSteps",
|
|
165
|
+
props: {
|
|
166
|
+
items: { type: Array, required: !0 },
|
|
167
|
+
current: { type: Number, default: 0 },
|
|
168
|
+
variant: C("default"),
|
|
169
|
+
clickable: Boolean,
|
|
170
|
+
vertical: Boolean
|
|
171
|
+
},
|
|
172
|
+
emits: ["update:current"],
|
|
173
|
+
setup(e, { emit: r }) {
|
|
174
|
+
const c = g(), { t } = T();
|
|
175
|
+
return () => {
|
|
176
|
+
const l = b("steps", c.value);
|
|
177
|
+
return a(
|
|
178
|
+
"ol",
|
|
179
|
+
{ class: l({ [e.variant]: e.variant !== "default", vertical: e.vertical }) },
|
|
180
|
+
e.items.map((i, s) => {
|
|
181
|
+
const o = s < e.current ? "done" : s === e.current ? "active" : "pending";
|
|
182
|
+
return a(
|
|
183
|
+
"li",
|
|
184
|
+
{ key: s, style: { display: "contents" } },
|
|
185
|
+
a(
|
|
186
|
+
e.clickable ? "button" : "div",
|
|
187
|
+
{
|
|
188
|
+
type: e.clickable ? "button" : void 0,
|
|
189
|
+
onClick: e.clickable ? () => r("update:current", s) : void 0,
|
|
190
|
+
"aria-current": o === "active" ? "step" : void 0,
|
|
191
|
+
class: p(l("item"), `is-${o}`, { "is-clickable": e.clickable })
|
|
192
|
+
},
|
|
193
|
+
[
|
|
194
|
+
a("span", { class: l("number") }, o === "done" ? v(i.icon ?? "check") : i.icon ? v(i.icon) : String(s + 1)),
|
|
195
|
+
a("span", [
|
|
196
|
+
a("span", { class: l("title"), style: { display: "block" } }, i.title),
|
|
197
|
+
i.description ? a("span", { class: l("desc") }, i.description) : null,
|
|
198
|
+
a("span", { class: `${c.value}-sr-only` }, o === "done" ? t("steps.completed") : t("steps.step", { n: s + 1 }))
|
|
199
|
+
])
|
|
200
|
+
]
|
|
201
|
+
)
|
|
202
|
+
);
|
|
203
|
+
})
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
}), _ = /* @__PURE__ */ m({
|
|
208
|
+
name: "ThlTimeline",
|
|
209
|
+
props: {
|
|
210
|
+
items: { type: Array, required: !0 },
|
|
211
|
+
variant: C("alternate"),
|
|
212
|
+
headingLevel: { type: Number, default: 3 }
|
|
213
|
+
},
|
|
214
|
+
setup(e, { slots: r }) {
|
|
215
|
+
const c = g();
|
|
216
|
+
return () => {
|
|
217
|
+
const t = b("timeline", c.value);
|
|
218
|
+
return a(
|
|
219
|
+
"ul",
|
|
220
|
+
{ class: t({ left: e.variant === "left" }) },
|
|
221
|
+
e.items.map(
|
|
222
|
+
(l, i) => a("li", { key: i, class: t("item", { inverted: e.variant === "alternate" && i % 2 === 1 }) }, [
|
|
223
|
+
a("div", { class: t("badge", { [l.color ?? "inverse"]: !0 }) }, l.image ? a("img", { src: l.image, alt: "" }) : v(l.icon)),
|
|
224
|
+
a("div", { class: t("panel") }, [
|
|
225
|
+
a(`h${e.headingLevel}`, { class: t("title") }, l.title),
|
|
226
|
+
l.time ? a("small", { class: t("time") }, [v("clock"), " ", l.time]) : null,
|
|
227
|
+
r.item ? r.item({ item: l, index: i }) : a("div", l.content)
|
|
228
|
+
])
|
|
229
|
+
])
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
}), E = /* @__PURE__ */ m({
|
|
235
|
+
name: "ThlActivityFeed",
|
|
236
|
+
props: {
|
|
237
|
+
items: {
|
|
238
|
+
type: Array,
|
|
239
|
+
required: !0
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
setup(e) {
|
|
243
|
+
const r = g();
|
|
244
|
+
return () => {
|
|
245
|
+
const c = b("activity-feed", r.value);
|
|
246
|
+
return a(
|
|
247
|
+
"div",
|
|
248
|
+
{ class: c() },
|
|
249
|
+
e.items.map(
|
|
250
|
+
(t, l) => a("div", { key: l, class: c("item") }, [
|
|
251
|
+
a(
|
|
252
|
+
"div",
|
|
253
|
+
{ class: c("left"), style: t.color ? { background: `var(--${r.value}-color-${t.color})` } : void 0 },
|
|
254
|
+
t.avatar ? a("img", { src: t.avatar, alt: "" }) : v(t.icon)
|
|
255
|
+
),
|
|
256
|
+
a("div", { class: c("right") }, [
|
|
257
|
+
a("div", [a("strong", t.title), t.time ? a("span", { class: c("time") }, t.time) : null]),
|
|
258
|
+
a("div", t.content)
|
|
259
|
+
])
|
|
260
|
+
])
|
|
261
|
+
)
|
|
262
|
+
);
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
}), G = /* @__PURE__ */ m({
|
|
266
|
+
name: "ThlHorizontalTimeline",
|
|
267
|
+
props: {
|
|
268
|
+
items: { type: Array, required: !0 },
|
|
269
|
+
headingLevel: { type: Number, default: 3 }
|
|
270
|
+
},
|
|
271
|
+
setup(e) {
|
|
272
|
+
const r = g(), { t: c } = T(), t = S(0);
|
|
273
|
+
return () => {
|
|
274
|
+
const l = b("htimeline", r.value), i = e.items[t.value];
|
|
275
|
+
return a("div", { class: l() }, [
|
|
276
|
+
a(
|
|
277
|
+
"div",
|
|
278
|
+
{ class: l("track"), role: "tablist" },
|
|
279
|
+
e.items.map(
|
|
280
|
+
(s, o) => a(
|
|
281
|
+
"button",
|
|
282
|
+
{
|
|
283
|
+
key: o,
|
|
284
|
+
type: "button",
|
|
285
|
+
role: "tab",
|
|
286
|
+
"aria-selected": o === t.value,
|
|
287
|
+
class: p(l("dot"), { "is-active": o === t.value, "is-done": o < t.value }),
|
|
288
|
+
onClick: () => t.value = o
|
|
289
|
+
},
|
|
290
|
+
s.date
|
|
291
|
+
)
|
|
292
|
+
)
|
|
293
|
+
),
|
|
294
|
+
a("div", { class: l("content"), role: "tabpanel" }, [a(`h${e.headingLevel}`, i?.title), a("div", i?.content)]),
|
|
295
|
+
a("div", { class: l("nav") }, [
|
|
296
|
+
a(
|
|
297
|
+
"button",
|
|
298
|
+
{ type: "button", class: `${r.value}-btn ${r.value}-btn--size-sm`, disabled: t.value === 0, onClick: () => t.value-- },
|
|
299
|
+
c("common.previous")
|
|
300
|
+
),
|
|
301
|
+
a(
|
|
302
|
+
"button",
|
|
303
|
+
{ type: "button", class: `${r.value}-btn ${r.value}-btn--size-sm`, disabled: t.value === e.items.length - 1, onClick: () => t.value++ },
|
|
304
|
+
c("common.next")
|
|
305
|
+
)
|
|
306
|
+
])
|
|
307
|
+
]);
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
}), J = /* @__PURE__ */ m({
|
|
311
|
+
name: "ThlCarousel",
|
|
312
|
+
props: {
|
|
313
|
+
slides: { type: Array, required: !0 },
|
|
314
|
+
interval: { type: Number, default: 5e3 },
|
|
315
|
+
fade: Boolean,
|
|
316
|
+
arrows: { type: Boolean, default: !0 },
|
|
317
|
+
dots: { type: Boolean, default: !0 },
|
|
318
|
+
height: F(),
|
|
319
|
+
ariaLabel: String
|
|
320
|
+
},
|
|
321
|
+
setup(e, { slots: r }) {
|
|
322
|
+
const c = g(), { t } = T(), l = q({ count: e.slides.length, interval: e.interval, loop: !0 });
|
|
323
|
+
z(
|
|
324
|
+
() => e.slides.length,
|
|
325
|
+
(s) => l.setCount(s)
|
|
326
|
+
), B(l.play), w(l.destroy);
|
|
327
|
+
const i = x(l.state);
|
|
328
|
+
return () => {
|
|
329
|
+
const s = b("carousel", c.value), o = typeof e.height == "number" ? `${e.height}px` : e.height;
|
|
330
|
+
return a(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
class: s({ fade: e.fade }),
|
|
334
|
+
role: "region",
|
|
335
|
+
"aria-roledescription": "carousel",
|
|
336
|
+
"aria-label": e.ariaLabel ?? `${t("common.carousel")} (${e.slides.length})`,
|
|
337
|
+
onMouseenter: l.pause,
|
|
338
|
+
onMouseleave: l.play,
|
|
339
|
+
onFocusin: l.pause,
|
|
340
|
+
onFocusout: l.play
|
|
341
|
+
},
|
|
342
|
+
[
|
|
343
|
+
a(
|
|
344
|
+
"div",
|
|
345
|
+
{ class: s("track"), style: e.fade ? void 0 : { transform: `translateX(-${i.value * 100}%)` } },
|
|
346
|
+
e.slides.map(
|
|
347
|
+
(d, n) => a(
|
|
348
|
+
"div",
|
|
349
|
+
{
|
|
350
|
+
key: n,
|
|
351
|
+
class: p(s("slide"), { "is-active": n === i.value }),
|
|
352
|
+
role: "group",
|
|
353
|
+
"aria-roledescription": "slide",
|
|
354
|
+
"aria-hidden": n !== i.value,
|
|
355
|
+
style: { height: o }
|
|
356
|
+
},
|
|
357
|
+
[
|
|
358
|
+
d.image ? a("img", { src: d.image, alt: d.alt ?? "", style: o ? { height: "100%", objectFit: "cover" } : void 0 }) : null,
|
|
359
|
+
r.slide?.({ slide: d, index: n }),
|
|
360
|
+
d.caption ? a("div", { class: s("caption") }, d.caption) : null
|
|
361
|
+
]
|
|
362
|
+
)
|
|
363
|
+
)
|
|
364
|
+
),
|
|
365
|
+
e.arrows && e.slides.length > 1 ? [
|
|
366
|
+
a("button", { type: "button", class: s("arrow", { prev: !0 }), onClick: l.prev, "aria-label": t("common.previous") }, v("chevron-left")),
|
|
367
|
+
a("button", { type: "button", class: s("arrow", { next: !0 }), onClick: l.next, "aria-label": t("common.next") }, v("chevron-right"))
|
|
368
|
+
] : null,
|
|
369
|
+
e.dots && e.slides.length > 1 ? a(
|
|
370
|
+
"div",
|
|
371
|
+
{ class: s("dots") },
|
|
372
|
+
e.slides.map(
|
|
373
|
+
(d, n) => a("button", {
|
|
374
|
+
key: n,
|
|
375
|
+
type: "button",
|
|
376
|
+
class: p({ "is-active": n === i.value }),
|
|
377
|
+
onClick: () => l.goTo(n),
|
|
378
|
+
"aria-label": String(n + 1),
|
|
379
|
+
"aria-current": n === i.value
|
|
380
|
+
})
|
|
381
|
+
)
|
|
382
|
+
) : null
|
|
383
|
+
]
|
|
384
|
+
);
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
export {
|
|
389
|
+
E as ThlActivityFeed,
|
|
390
|
+
K as ThlBreadcrumb,
|
|
391
|
+
J as ThlCarousel,
|
|
392
|
+
G as ThlHorizontalTimeline,
|
|
393
|
+
U as ThlPagination,
|
|
394
|
+
X as ThlSteps,
|
|
395
|
+
I as ThlTabs,
|
|
396
|
+
_ as ThlTimeline
|
|
397
|
+
};
|
|
398
|
+
//# sourceMappingURL=nav.js.map
|