@yoyaflow/yoya-ui 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 +198 -0
- package/README.zh-CN.md +199 -0
- package/dist/echarts.min.js +45 -0
- package/dist/yoya-ui.umd.js +35 -0
- package/dist/yoya.core.js +1674 -0
- package/dist/yoya.echart.js +636 -0
- package/dist/yoya.ssr.js +491 -0
- package/dist/yoya.ui.css +2010 -0
- package/dist/yoya.ui.js +11899 -0
- package/package.json +94 -0
- package/types/actions.d.ts +166 -0
- package/types/async.d.ts +58 -0
- package/types/chart.d.ts +40 -0
- package/types/core.d.ts +495 -0
- package/types/css.d.ts +5 -0
- package/types/data-display.d.ts +518 -0
- package/types/effects.d.ts +40 -0
- package/types/feedback.d.ts +119 -0
- package/types/form.d.ts +486 -0
- package/types/html.d.ts +288 -0
- package/types/i18n.d.ts +56 -0
- package/types/index.d.ts +4 -0
- package/types/layout.d.ts +429 -0
- package/types/navigation.d.ts +275 -0
- package/types/router.d.ts +123 -0
- package/types/ssr.d.ts +81 -0
- package/types/svg.d.ts +158 -0
- package/types/theme.d.ts +40 -0
- package/types/yoya.core.d.ts +7 -0
- package/types/yoya.echart.d.ts +4 -0
- package/types/yoya.ssr.d.ts +4 -0
- package/types/yoya.ui.d.ts +19 -0
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ChildInput,
|
|
3
|
+
ElementFactory,
|
|
4
|
+
ElementOptions,
|
|
5
|
+
SetupCallback,
|
|
6
|
+
SetupInput,
|
|
7
|
+
StyleValue
|
|
8
|
+
} from './core.js';
|
|
9
|
+
import type { HtmlElementNode } from './html.js';
|
|
10
|
+
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Layout option types
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
16
|
+
export type FlexWrap = boolean | 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
17
|
+
export type Length = string | number;
|
|
18
|
+
|
|
19
|
+
export interface FlexOptions {
|
|
20
|
+
align?: string;
|
|
21
|
+
direction?: FlexDirection;
|
|
22
|
+
wrap?: FlexWrap;
|
|
23
|
+
gap?: Length;
|
|
24
|
+
justify?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface GridOptions {
|
|
28
|
+
gap?: Length;
|
|
29
|
+
autoFlow?: string;
|
|
30
|
+
areas?: string;
|
|
31
|
+
columns?: number | string;
|
|
32
|
+
rows?: number | string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ContainerOptions {
|
|
36
|
+
maxWidth?: Length;
|
|
37
|
+
padding?: Length;
|
|
38
|
+
paddingInline?: Length;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface SpacerOptions {
|
|
42
|
+
size?: Length;
|
|
43
|
+
orientation?: 'horizontal' | 'vertical';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface DividerOptions {
|
|
47
|
+
orientation?: 'horizontal' | 'vertical';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ColProps {
|
|
51
|
+
span?: number;
|
|
52
|
+
offset?: number;
|
|
53
|
+
push?: number;
|
|
54
|
+
pull?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ColBreakpoint = number | ColProps;
|
|
58
|
+
|
|
59
|
+
export interface ColOptions extends ColProps {
|
|
60
|
+
gutter?: Length;
|
|
61
|
+
xs?: ColBreakpoint;
|
|
62
|
+
sm?: ColBreakpoint;
|
|
63
|
+
md?: ColBreakpoint;
|
|
64
|
+
lg?: ColBreakpoint;
|
|
65
|
+
xl?: ColBreakpoint;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface RowOptions {
|
|
69
|
+
gutter?: Length;
|
|
70
|
+
align?: string;
|
|
71
|
+
justify?: string;
|
|
72
|
+
wrap?: FlexWrap;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ResponsiveGridBreakpoint {
|
|
76
|
+
minWidth: number | string;
|
|
77
|
+
columns: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ResponsiveGridOptions {
|
|
81
|
+
gap?: Length;
|
|
82
|
+
minColumnWidth?: Length;
|
|
83
|
+
breakpoints?: ResponsiveGridBreakpoint[] | Record<string, number>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface VBodyOptions {
|
|
87
|
+
background?: string;
|
|
88
|
+
maxWidth?: Length;
|
|
89
|
+
padding?: Length;
|
|
90
|
+
gap?: Length;
|
|
91
|
+
minHeight?: Length;
|
|
92
|
+
content?: ChildInput;
|
|
93
|
+
children?: ChildInput;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface ContainerLayoutOptions {
|
|
97
|
+
direction?: FlexDirection;
|
|
98
|
+
gap?: Length;
|
|
99
|
+
viewport?: boolean;
|
|
100
|
+
fill?: boolean;
|
|
101
|
+
scrollable?: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface MobileLayoutOptions {
|
|
105
|
+
align?: string;
|
|
106
|
+
wrap?: FlexWrap;
|
|
107
|
+
justify?: string;
|
|
108
|
+
direction?: FlexDirection;
|
|
109
|
+
mobileDirection?: FlexDirection;
|
|
110
|
+
gap?: Length;
|
|
111
|
+
mobileGap?: Length;
|
|
112
|
+
breakpoint?: number;
|
|
113
|
+
asideWidth?: Length;
|
|
114
|
+
drawer?: boolean;
|
|
115
|
+
viewport?: boolean;
|
|
116
|
+
safeArea?: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface RegionOptions {
|
|
120
|
+
height?: Length;
|
|
121
|
+
width?: Length;
|
|
122
|
+
size?: Length;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export type SplitPanelDirection = 'horizontal' | 'vertical';
|
|
126
|
+
|
|
127
|
+
/** Split panel with a draggable divider. */
|
|
128
|
+
export class VSplitPanel extends HtmlElementNode {
|
|
129
|
+
direction(): SplitPanelDirection;
|
|
130
|
+
direction(value: SplitPanelDirection): VSplitPanel;
|
|
131
|
+
size(): string;
|
|
132
|
+
size(value: Length): VSplitPanel;
|
|
133
|
+
minSize(): number;
|
|
134
|
+
minSize(value: number): VSplitPanel;
|
|
135
|
+
reset(): VSplitPanel;
|
|
136
|
+
first(setup: ChildInput | SetupCallback<HtmlElementNode>): VSplitPanel;
|
|
137
|
+
second(setup: ChildInput | SetupCallback<HtmlElementNode>): VSplitPanel;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// ---------------------------------------------------------------------------
|
|
141
|
+
// Layout node interfaces
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
|
|
144
|
+
/** 24-column row container with gutter/justify/align/wrap helpers. */
|
|
145
|
+
export interface VRow extends HtmlElementNode {
|
|
146
|
+
gutter(): Length | null;
|
|
147
|
+
gutter(value: Length): VRow;
|
|
148
|
+
justify(): StyleValue | undefined;
|
|
149
|
+
justify(value: string): VRow;
|
|
150
|
+
align(): StyleValue | undefined;
|
|
151
|
+
align(value: string): VRow;
|
|
152
|
+
wrap(): StyleValue | undefined;
|
|
153
|
+
wrap(value: FlexWrap | null): VRow;
|
|
154
|
+
child(...children: ChildInput[]): this;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** Responsive 24-column cell: span/offset/push/pull with breakpoints. */
|
|
158
|
+
export interface VCol extends HtmlElementNode {
|
|
159
|
+
refresh(): VCol;
|
|
160
|
+
span(): number;
|
|
161
|
+
span(value: number): VCol;
|
|
162
|
+
offset(): number;
|
|
163
|
+
offset(value: number): VCol;
|
|
164
|
+
push(): number;
|
|
165
|
+
push(value: number): VCol;
|
|
166
|
+
pull(): number;
|
|
167
|
+
pull(value: number): VCol;
|
|
168
|
+
gutter(): Length | null;
|
|
169
|
+
gutter(value: Length): VCol;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Responsive grid that swaps column counts at breakpoints. */
|
|
173
|
+
export interface ResponsiveGrid extends HtmlElementNode {
|
|
174
|
+
refresh(): ResponsiveGrid;
|
|
175
|
+
minColumnWidth(): string;
|
|
176
|
+
minColumnWidth(value: Length): ResponsiveGrid;
|
|
177
|
+
breakpoints(): ResponsiveGridBreakpoint[];
|
|
178
|
+
breakpoints(value: ResponsiveGridBreakpoint[] | Record<string, number>): ResponsiveGrid;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** Page body shell with themed defaults and a content slot. */
|
|
182
|
+
export interface VBody extends HtmlElementNode {
|
|
183
|
+
background(): StyleValue | undefined;
|
|
184
|
+
background(value: string): VBody;
|
|
185
|
+
maxWidth(): StyleValue | undefined;
|
|
186
|
+
maxWidth(value: Length): VBody;
|
|
187
|
+
padding(): StyleValue | undefined;
|
|
188
|
+
padding(value: Length): VBody;
|
|
189
|
+
gap(): StyleValue | undefined;
|
|
190
|
+
gap(value: Length): VBody;
|
|
191
|
+
minHeight(): StyleValue | undefined;
|
|
192
|
+
minHeight(value: Length): VBody;
|
|
193
|
+
content(): HtmlElementNode;
|
|
194
|
+
content(value: ChildInput | SetupCallback<HtmlElementNode>): VBody;
|
|
195
|
+
child(...children: ChildInput[]): this;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Flex container with viewport/fill/scrollable/direction helpers. */
|
|
199
|
+
export interface VContainer extends HtmlElementNode {
|
|
200
|
+
viewport(): boolean;
|
|
201
|
+
viewport(value?: boolean): VContainer;
|
|
202
|
+
fill(): boolean;
|
|
203
|
+
fill(value?: boolean): VContainer;
|
|
204
|
+
scrollable(): boolean;
|
|
205
|
+
scrollable(value?: boolean): VContainer;
|
|
206
|
+
direction(): FlexDirection;
|
|
207
|
+
direction(value: FlexDirection): VContainer;
|
|
208
|
+
child(...children: ChildInput[]): this;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/** Responsive layout shell with an aside drawer for small screens. */
|
|
212
|
+
export interface MobileLayout extends HtmlElementNode {
|
|
213
|
+
refresh(): MobileLayout;
|
|
214
|
+
breakpoint(): number;
|
|
215
|
+
breakpoint(value: number): MobileLayout;
|
|
216
|
+
direction(): FlexDirection;
|
|
217
|
+
direction(desktop: FlexDirection, mobile?: FlexDirection): MobileLayout;
|
|
218
|
+
mobileDirection(): FlexDirection;
|
|
219
|
+
mobileDirection(value: FlexDirection): MobileLayout;
|
|
220
|
+
gap(): Length;
|
|
221
|
+
gap(desktop: Length, mobile?: Length): MobileLayout;
|
|
222
|
+
mobileGap(): Length;
|
|
223
|
+
mobileGap(value: Length): MobileLayout;
|
|
224
|
+
asideWidth(): Length;
|
|
225
|
+
asideWidth(value: Length): MobileLayout;
|
|
226
|
+
viewport(): boolean;
|
|
227
|
+
viewport(value?: boolean): MobileLayout;
|
|
228
|
+
safeArea(): boolean;
|
|
229
|
+
safeArea(value?: boolean): MobileLayout;
|
|
230
|
+
drawer(): boolean;
|
|
231
|
+
drawer(value?: boolean): MobileLayout;
|
|
232
|
+
asideOpen(): boolean;
|
|
233
|
+
asideOpen(value: boolean): MobileLayout;
|
|
234
|
+
openAside(): MobileLayout;
|
|
235
|
+
closeAside(): MobileLayout;
|
|
236
|
+
toggleAside(): MobileLayout;
|
|
237
|
+
mobile(): boolean;
|
|
238
|
+
child(...children: ChildInput[]): this;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** Sticky header/footer region. */
|
|
242
|
+
export interface VHeader extends HtmlElementNode {
|
|
243
|
+
sticky(): boolean;
|
|
244
|
+
sticky(value?: boolean): VHeader;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Scrollable aside region. */
|
|
248
|
+
export interface VAside extends HtmlElementNode {
|
|
249
|
+
scrollable(): boolean;
|
|
250
|
+
scrollable(value?: boolean): VAside;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Main scrollable region. */
|
|
254
|
+
export interface VMain extends HtmlElementNode {
|
|
255
|
+
scrollable(): boolean;
|
|
256
|
+
scrollable(value?: boolean): VMain;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Sticky footer region. */
|
|
260
|
+
export interface VFooter extends HtmlElementNode {
|
|
261
|
+
sticky(): boolean;
|
|
262
|
+
sticky(value?: boolean): VFooter;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** Spacer with optional size and orientation. */
|
|
266
|
+
export interface Spacer extends HtmlElementNode {
|
|
267
|
+
size?: Length;
|
|
268
|
+
orientation?: 'horizontal' | 'vertical';
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Divider separator. */
|
|
272
|
+
export interface Divider extends HtmlElementNode {
|
|
273
|
+
orientation?: 'horizontal' | 'vertical';
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// ---------------------------------------------------------------------------
|
|
277
|
+
// Factories
|
|
278
|
+
// ---------------------------------------------------------------------------
|
|
279
|
+
|
|
280
|
+
export interface LayoutFactory<N extends HtmlElementNode, O> extends ElementFactory<N> {
|
|
281
|
+
(options: O, callback?: SetupCallback<N>): N;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/** Flex container (display: flex). */
|
|
285
|
+
export const flex: LayoutFactory<HtmlElementNode, FlexOptions>;
|
|
286
|
+
/** Column flex stack. */
|
|
287
|
+
export const stack: LayoutFactory<HtmlElementNode, FlexOptions>;
|
|
288
|
+
/** Vertical stack (alias of stack). */
|
|
289
|
+
export const vstack: LayoutFactory<HtmlElementNode, FlexOptions>;
|
|
290
|
+
/** Horizontal stack. */
|
|
291
|
+
export const hstack: LayoutFactory<HtmlElementNode, FlexOptions>;
|
|
292
|
+
/** Centered flex container. */
|
|
293
|
+
export const center: LayoutFactory<HtmlElementNode, FlexOptions>;
|
|
294
|
+
|
|
295
|
+
/** CSS grid container. */
|
|
296
|
+
export const grid: LayoutFactory<HtmlElementNode, GridOptions>;
|
|
297
|
+
/** Responsive grid with breakpoints. */
|
|
298
|
+
export const responsiveGrid: LayoutFactory<ResponsiveGrid, ResponsiveGridOptions>;
|
|
299
|
+
|
|
300
|
+
/** 24-column row container. */
|
|
301
|
+
export const vRow: LayoutFactory<VRow, RowOptions>;
|
|
302
|
+
/** 24-column cell with responsive breakpoints. */
|
|
303
|
+
export const vCol: LayoutFactory<VCol, ColOptions>;
|
|
304
|
+
|
|
305
|
+
/** Page body shell with themed surface defaults. */
|
|
306
|
+
export const vBody: LayoutFactory<VBody, VBodyOptions>;
|
|
307
|
+
/** Creates a vBody page and optionally binds it to a target. */
|
|
308
|
+
export function createVBodyPage(
|
|
309
|
+
setup?: SetupInput<VBody> | null,
|
|
310
|
+
target?: string | ParentNode
|
|
311
|
+
): VBody;
|
|
312
|
+
|
|
313
|
+
/** Max-width centered container. */
|
|
314
|
+
export const container: LayoutFactory<HtmlElementNode, ContainerOptions>;
|
|
315
|
+
/** Flex container with viewport/fill/scrollable helpers. */
|
|
316
|
+
export const vContainer: LayoutFactory<VContainer, ContainerLayoutOptions>;
|
|
317
|
+
|
|
318
|
+
/** Responsive desktop/mobile layout with aside drawer. */
|
|
319
|
+
export const mobileLayout: LayoutFactory<MobileLayout, MobileLayoutOptions>;
|
|
320
|
+
/** Alias of mobileLayout. */
|
|
321
|
+
export const vMobileLayout: typeof mobileLayout;
|
|
322
|
+
|
|
323
|
+
/** Header region with sticky support. */
|
|
324
|
+
export const vHeader: LayoutFactory<VHeader, RegionOptions>;
|
|
325
|
+
/** Aside region with scrollable support. */
|
|
326
|
+
export const vAside: LayoutFactory<VAside, RegionOptions>;
|
|
327
|
+
/** Main region with scrollable support. */
|
|
328
|
+
export const vMain: LayoutFactory<VMain, RegionOptions>;
|
|
329
|
+
/** Footer region with sticky support. */
|
|
330
|
+
export const vFooter: LayoutFactory<VFooter, RegionOptions>;
|
|
331
|
+
|
|
332
|
+
/** Flexible spacer. */
|
|
333
|
+
export const spacer: LayoutFactory<Spacer, SpacerOptions>;
|
|
334
|
+
/** Divider separator. */
|
|
335
|
+
export const divider: LayoutFactory<Divider, DividerOptions>;
|
|
336
|
+
|
|
337
|
+
/** Split panel with a draggable divider. */
|
|
338
|
+
export const vSplitPanel: ElementFactory<VSplitPanel> & {
|
|
339
|
+
(first?: SetupInput<VSplitPanel> | null, callback?: SetupCallback<VSplitPanel>): VSplitPanel;
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
// ---------------------------------------------------------------------------
|
|
343
|
+
// Theme shell
|
|
344
|
+
// ---------------------------------------------------------------------------
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Themed generic container: background, border, radius and text color driven
|
|
348
|
+
* by --yoya-* tokens, with scroll and background-opacity control.
|
|
349
|
+
*/
|
|
350
|
+
export class VThemeShell extends HtmlElementNode {
|
|
351
|
+
/** Virtual mode renders the shell's styles onto its single child instead of its own DOM node. */
|
|
352
|
+
virtual(next?: boolean): VThemeShell;
|
|
353
|
+
background(): StyleValue | undefined;
|
|
354
|
+
background(value: string | null): VThemeShell;
|
|
355
|
+
backgroundOpacity(alpha: number | string): VThemeShell;
|
|
356
|
+
radius(): StyleValue | undefined;
|
|
357
|
+
radius(value: string | number | null): VThemeShell;
|
|
358
|
+
border(): StyleValue | undefined;
|
|
359
|
+
border(value: string | null): VThemeShell;
|
|
360
|
+
borderColor(): StyleValue | undefined;
|
|
361
|
+
borderColor(value: string | null): VThemeShell;
|
|
362
|
+
scrollable(next?: boolean): VThemeShell;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/** Creates a themed shell container. */
|
|
366
|
+
export const vThemeShell: ElementFactory<VThemeShell>;
|
|
367
|
+
|
|
368
|
+
/** Parent-shortcut surface merged onto HtmlElementNode. */
|
|
369
|
+
export interface LayoutParentShortcuts {
|
|
370
|
+
flex(
|
|
371
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
372
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
373
|
+
): HtmlElementNode;
|
|
374
|
+
stack(
|
|
375
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
376
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
377
|
+
): HtmlElementNode;
|
|
378
|
+
vstack(
|
|
379
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
380
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
381
|
+
): HtmlElementNode;
|
|
382
|
+
hstack(
|
|
383
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
384
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
385
|
+
): HtmlElementNode;
|
|
386
|
+
center(
|
|
387
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
388
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
389
|
+
): HtmlElementNode;
|
|
390
|
+
grid(
|
|
391
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
392
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
393
|
+
): HtmlElementNode;
|
|
394
|
+
responsiveGrid(
|
|
395
|
+
first?: SetupInput<ResponsiveGrid> | null,
|
|
396
|
+
callback?: SetupCallback<ResponsiveGrid>
|
|
397
|
+
): ResponsiveGrid;
|
|
398
|
+
vRow(first?: SetupInput<VRow> | null, callback?: SetupCallback<VRow>): VRow;
|
|
399
|
+
vCol(first?: SetupInput<VCol> | null, callback?: SetupCallback<VCol>): VCol;
|
|
400
|
+
vBody(first?: SetupInput<VBody> | null, callback?: SetupCallback<VBody>): VBody;
|
|
401
|
+
container(
|
|
402
|
+
first?: SetupInput<HtmlElementNode> | null,
|
|
403
|
+
callback?: SetupCallback<HtmlElementNode>
|
|
404
|
+
): HtmlElementNode;
|
|
405
|
+
vContainer(
|
|
406
|
+
first?: SetupInput<VContainer> | null,
|
|
407
|
+
callback?: SetupCallback<VContainer>
|
|
408
|
+
): VContainer;
|
|
409
|
+
mobileLayout(
|
|
410
|
+
first?: SetupInput<MobileLayout> | null,
|
|
411
|
+
callback?: SetupCallback<MobileLayout>
|
|
412
|
+
): MobileLayout;
|
|
413
|
+
vMobileLayout(
|
|
414
|
+
first?: SetupInput<MobileLayout> | null,
|
|
415
|
+
callback?: SetupCallback<MobileLayout>
|
|
416
|
+
): MobileLayout;
|
|
417
|
+
vHeader(first?: SetupInput<VHeader> | null, callback?: SetupCallback<VHeader>): VHeader;
|
|
418
|
+
vAside(first?: SetupInput<VAside> | null, callback?: SetupCallback<VAside>): VAside;
|
|
419
|
+
vMain(first?: SetupInput<VMain> | null, callback?: SetupCallback<VMain>): VMain;
|
|
420
|
+
vFooter(first?: SetupInput<VFooter> | null, callback?: SetupCallback<VFooter>): VFooter;
|
|
421
|
+
spacer(first?: SetupInput<Spacer> | null, callback?: SetupCallback<Spacer>): Spacer;
|
|
422
|
+
divider(first?: SetupInput<Divider> | null, callback?: SetupCallback<Divider>): Divider;
|
|
423
|
+
vSplitPanel(
|
|
424
|
+
first?: SetupInput<VSplitPanel> | null,
|
|
425
|
+
callback?: SetupCallback<VSplitPanel>
|
|
426
|
+
): VSplitPanel;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
export type { ElementOptions, SetupInput };
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ChildInput,
|
|
3
|
+
ElementFactory,
|
|
4
|
+
ElementOptions,
|
|
5
|
+
SetupCallback,
|
|
6
|
+
SetupInput
|
|
7
|
+
} from './core.js';
|
|
8
|
+
import type { HtmlElementNode } from './html.js';
|
|
9
|
+
|
|
10
|
+
export type MenuOrientation = 'vertical' | 'horizontal';
|
|
11
|
+
export type StepStatus = 'process' | 'finish' | 'error';
|
|
12
|
+
export type StepDirection = 'horizontal' | 'vertical';
|
|
13
|
+
export type StepSize = 'small' | 'default';
|
|
14
|
+
export type TabsOrientation = 'horizontal' | 'vertical';
|
|
15
|
+
export type TabsVariant = 'line' | 'card' | 'pills';
|
|
16
|
+
export type TabsSize = 'default' | 'large' | 'small';
|
|
17
|
+
|
|
18
|
+
/** Anchor navigation with scroll tracking. */
|
|
19
|
+
export class VAnchor extends HtmlElementNode {
|
|
20
|
+
ariaLabel(content: ChildInput): VAnchor;
|
|
21
|
+
offset(): number;
|
|
22
|
+
offset(value: number): VAnchor;
|
|
23
|
+
target(): string;
|
|
24
|
+
target(value: string | Element): VAnchor;
|
|
25
|
+
items(value: Array<string | VAnchorItem | AnchorItemOptions>): VAnchor;
|
|
26
|
+
child(...children: ChildInput[]): this;
|
|
27
|
+
active(): string;
|
|
28
|
+
active(value: string): VAnchor;
|
|
29
|
+
activeHref(): string;
|
|
30
|
+
activeHref(value: string): VAnchor;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface AnchorItemOptions {
|
|
34
|
+
title?: ChildInput;
|
|
35
|
+
href?: string;
|
|
36
|
+
children?: Array<string | VAnchorItem | AnchorItemOptions>;
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export class VAnchorItem extends HtmlElementNode {
|
|
41
|
+
title(content?: ChildInput): this;
|
|
42
|
+
text(content?: ChildInput): this;
|
|
43
|
+
label(content?: ChildInput): this;
|
|
44
|
+
href(value: string): VAnchorItem;
|
|
45
|
+
nested(setup: SetupInput<HtmlElementNode>): VAnchorItem;
|
|
46
|
+
subItems(setup: SetupInput<HtmlElementNode>): VAnchorItem;
|
|
47
|
+
active(value?: boolean): VAnchorItem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Breadcrumb navigation. */
|
|
51
|
+
export class VBreadcrumb extends HtmlElementNode {
|
|
52
|
+
ariaLabel(content: ChildInput): VBreadcrumb;
|
|
53
|
+
separator(content: ChildInput): VBreadcrumb;
|
|
54
|
+
items(value: Array<string | VBreadcrumbItem | BreadcrumbItemOptions>): VBreadcrumb;
|
|
55
|
+
child(...children: ChildInput[]): this;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface BreadcrumbItemOptions {
|
|
59
|
+
label?: ChildInput;
|
|
60
|
+
href?: string;
|
|
61
|
+
active?: boolean;
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export class VBreadcrumbItem extends HtmlElementNode {
|
|
66
|
+
label(content?: ChildInput): this;
|
|
67
|
+
text(content?: ChildInput): this;
|
|
68
|
+
content(content: ChildInput): VBreadcrumbItem;
|
|
69
|
+
href(value: string): VBreadcrumbItem;
|
|
70
|
+
to(value: string): VBreadcrumbItem;
|
|
71
|
+
active(value?: boolean): VBreadcrumbItem;
|
|
72
|
+
current(value?: boolean): VBreadcrumbItem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Menu container with keyboard navigation. */
|
|
76
|
+
export class VMenu extends HtmlElementNode {
|
|
77
|
+
orientation(): MenuOrientation;
|
|
78
|
+
orientation(value?: MenuOrientation): VMenu;
|
|
79
|
+
child(...children: ChildInput[]): this;
|
|
80
|
+
horizontal(): VMenu;
|
|
81
|
+
vertical(): VMenu;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Menu group label. */
|
|
85
|
+
export class VMenuDivider extends HtmlElementNode {}
|
|
86
|
+
|
|
87
|
+
/** Menu item with label/icon/shortcut/state helpers. */
|
|
88
|
+
export class VMenuItem extends HtmlElementNode {
|
|
89
|
+
text(content?: ChildInput): this;
|
|
90
|
+
label(content?: ChildInput): this;
|
|
91
|
+
content(content: ChildInput): VMenuItem;
|
|
92
|
+
icon(content: ChildInput): VMenuItem;
|
|
93
|
+
shortcut(content: ChildInput): VMenuItem;
|
|
94
|
+
active(value?: boolean): VMenuItem;
|
|
95
|
+
danger(value?: boolean): VMenuItem;
|
|
96
|
+
disabled(value?: boolean): VMenuItem;
|
|
97
|
+
hoverable(value?: boolean): VMenuItem;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Menu group with an optional label. */
|
|
101
|
+
export class VMenuGroup extends HtmlElementNode {
|
|
102
|
+
label(content?: ChildInput): this;
|
|
103
|
+
title(content?: ChildInput): this;
|
|
104
|
+
child(...children: ChildInput[]): this;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Collapsible sub-menu. */
|
|
108
|
+
export class VSubMenu extends HtmlElementNode {
|
|
109
|
+
trigger(): HtmlElementNode;
|
|
110
|
+
trigger(setup: SetupInput<HtmlElementNode>): VSubMenu;
|
|
111
|
+
label(content?: ChildInput): this;
|
|
112
|
+
text(content?: ChildInput): this;
|
|
113
|
+
menuContent(): HtmlElementNode;
|
|
114
|
+
menuContent(setup: SetupInput<HtmlElementNode>): VSubMenu;
|
|
115
|
+
inline(value?: boolean): VSubMenu;
|
|
116
|
+
disabled(value?: boolean): VSubMenu;
|
|
117
|
+
open(value?: boolean): VSubMenu;
|
|
118
|
+
close(): VSubMenu;
|
|
119
|
+
toggle(): VSubMenu;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Collapsible sidebar shell. */
|
|
123
|
+
export class VSidebar extends HtmlElementNode {
|
|
124
|
+
title(content?: ChildInput): this;
|
|
125
|
+
ariaLabel(content: ChildInput): VSidebar;
|
|
126
|
+
menuContent(): HtmlElementNode;
|
|
127
|
+
menuContent(setup: SetupInput<HtmlElementNode>): VSidebar;
|
|
128
|
+
collapsed(value?: boolean): VSidebar;
|
|
129
|
+
toggle(): VSidebar;
|
|
130
|
+
responsive(query?: string): VSidebar;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Top navigation bar. */
|
|
134
|
+
export class VNavbar extends HtmlElementNode {
|
|
135
|
+
ariaLabel(content: ChildInput): VNavbar;
|
|
136
|
+
sticky(value?: boolean): VNavbar;
|
|
137
|
+
title(content?: ChildInput): this;
|
|
138
|
+
subtitle(content: ChildInput): VNavbar;
|
|
139
|
+
brand(setup: SetupInput<HtmlElementNode>): VNavbar;
|
|
140
|
+
menuContent(setup: SetupInput<HtmlElementNode>): VNavbar;
|
|
141
|
+
actions(setup: SetupInput<HtmlElementNode>): VNavbar;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface StepItemOptions {
|
|
145
|
+
title?: ChildInput;
|
|
146
|
+
description?: ChildInput;
|
|
147
|
+
icon?: ChildInput;
|
|
148
|
+
status?: StepStatus;
|
|
149
|
+
[key: string]: any;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Step indicator. */
|
|
153
|
+
export class VStep extends HtmlElementNode {
|
|
154
|
+
title(content?: ChildInput): this;
|
|
155
|
+
text(content?: ChildInput): this;
|
|
156
|
+
description(content: ChildInput): VStep;
|
|
157
|
+
desc(content: ChildInput): VStep;
|
|
158
|
+
icon(content: ChildInput): VStep;
|
|
159
|
+
status(): StepStatus | null;
|
|
160
|
+
status(value: StepStatus | null): VStep;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Step progress list. */
|
|
164
|
+
export class VSteps extends HtmlElementNode {
|
|
165
|
+
current(): number;
|
|
166
|
+
current(value: number): VSteps;
|
|
167
|
+
status(): StepStatus;
|
|
168
|
+
status(value: StepStatus): VSteps;
|
|
169
|
+
direction(): StepDirection;
|
|
170
|
+
direction(value: StepDirection): VSteps;
|
|
171
|
+
size(): StepSize;
|
|
172
|
+
size(value: StepSize): VSteps;
|
|
173
|
+
items(value: Array<string | VStep | StepItemOptions>): VSteps;
|
|
174
|
+
next(): VSteps;
|
|
175
|
+
prev(): VSteps;
|
|
176
|
+
child(...children: ChildInput[]): this;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface TabItemOptions {
|
|
180
|
+
key?: string;
|
|
181
|
+
label?: ChildInput;
|
|
182
|
+
content?: ChildInput | SetupCallback<HtmlElementNode>;
|
|
183
|
+
disabled?: boolean;
|
|
184
|
+
[key: string]: any;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Single tab. */
|
|
188
|
+
export class VTab extends HtmlElementNode {
|
|
189
|
+
key(): string;
|
|
190
|
+
key(value: string): VTab;
|
|
191
|
+
value(): unknown;
|
|
192
|
+
value(value: unknown): VTab;
|
|
193
|
+
label(content?: ChildInput): this;
|
|
194
|
+
text(content?: ChildInput): this;
|
|
195
|
+
title(content?: ChildInput): this;
|
|
196
|
+
icon(content: ChildInput): VTab;
|
|
197
|
+
content(setup: ChildInput | SetupCallback<HtmlElementNode>): VTab;
|
|
198
|
+
disabled(value: boolean): VTab;
|
|
199
|
+
active(value: boolean): VTab;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** Tab group with selection state. */
|
|
203
|
+
export class VTabs extends HtmlElementNode {
|
|
204
|
+
children(): HtmlElementNode[];
|
|
205
|
+
items(value: Array<string | VTab | TabItemOptions>): VTabs;
|
|
206
|
+
child(...children: ChildInput[]): this;
|
|
207
|
+
active(): string | number;
|
|
208
|
+
active(value: string | number): VTabs;
|
|
209
|
+
activeIndex(): number;
|
|
210
|
+
activeIndex(value: number): VTabs;
|
|
211
|
+
ariaLabel(content: ChildInput): VTabs;
|
|
212
|
+
orientation(): TabsOrientation;
|
|
213
|
+
orientation(value: TabsOrientation): VTabs;
|
|
214
|
+
variant(): TabsVariant;
|
|
215
|
+
variant(value: TabsVariant): VTabs;
|
|
216
|
+
size(): TabsSize;
|
|
217
|
+
size(value: TabsSize): VTabs;
|
|
218
|
+
change(): ((key: string | number, index: number) => void) | null;
|
|
219
|
+
change(handler: ((key: string | number, index: number) => void) | null): VTabs;
|
|
220
|
+
onChange(handler: ((key: string | number, index: number) => void) | null): VTabs;
|
|
221
|
+
next(): VTabs;
|
|
222
|
+
prev(): VTabs;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const vAnchor: ElementFactory<VAnchor>;
|
|
226
|
+
export const vAnchorItem: ElementFactory<VAnchorItem>;
|
|
227
|
+
export const vBreadcrumb: ElementFactory<VBreadcrumb>;
|
|
228
|
+
export const vBreadcrumbItem: ElementFactory<VBreadcrumbItem>;
|
|
229
|
+
export const vMenu: ElementFactory<VMenu>;
|
|
230
|
+
export const vMenuDivider: ElementFactory<VMenuDivider>;
|
|
231
|
+
export const vMenuGroup: ElementFactory<VMenuGroup>;
|
|
232
|
+
export const vMenuItem: ElementFactory<VMenuItem>;
|
|
233
|
+
export const vNavbar: ElementFactory<VNavbar>;
|
|
234
|
+
export const vSidebar: ElementFactory<VSidebar>;
|
|
235
|
+
export const vStep: ElementFactory<VStep>;
|
|
236
|
+
export const vSteps: ElementFactory<VSteps>;
|
|
237
|
+
export const vSubMenu: ElementFactory<VSubMenu>;
|
|
238
|
+
export const vTab: ElementFactory<VTab>;
|
|
239
|
+
export const vTabs: ElementFactory<VTabs>;
|
|
240
|
+
|
|
241
|
+
/** Parent-shortcut surface merged onto HtmlElementNode. */
|
|
242
|
+
export interface NavigationParentShortcuts {
|
|
243
|
+
vAnchor(first?: SetupInput<VAnchor> | null, callback?: SetupCallback<VAnchor>): VAnchor;
|
|
244
|
+
vAnchorItem(
|
|
245
|
+
first?: SetupInput<VAnchorItem> | null,
|
|
246
|
+
callback?: SetupCallback<VAnchorItem>
|
|
247
|
+
): VAnchorItem;
|
|
248
|
+
vBreadcrumb(
|
|
249
|
+
first?: SetupInput<VBreadcrumb> | null,
|
|
250
|
+
callback?: SetupCallback<VBreadcrumb>
|
|
251
|
+
): VBreadcrumb;
|
|
252
|
+
vBreadcrumbItem(
|
|
253
|
+
first?: SetupInput<VBreadcrumbItem> | null,
|
|
254
|
+
callback?: SetupCallback<VBreadcrumbItem>
|
|
255
|
+
): VBreadcrumbItem;
|
|
256
|
+
vMenu(first?: SetupInput<VMenu> | null, callback?: SetupCallback<VMenu>): VMenu;
|
|
257
|
+
vMenuDivider(
|
|
258
|
+
first?: SetupInput<VMenuDivider> | null,
|
|
259
|
+
callback?: SetupCallback<VMenuDivider>
|
|
260
|
+
): VMenuDivider;
|
|
261
|
+
vMenuGroup(
|
|
262
|
+
first?: SetupInput<VMenuGroup> | null,
|
|
263
|
+
callback?: SetupCallback<VMenuGroup>
|
|
264
|
+
): VMenuGroup;
|
|
265
|
+
vMenuItem(first?: SetupInput<VMenuItem> | null, callback?: SetupCallback<VMenuItem>): VMenuItem;
|
|
266
|
+
vNavbar(first?: SetupInput<VNavbar> | null, callback?: SetupCallback<VNavbar>): VNavbar;
|
|
267
|
+
vSidebar(first?: SetupInput<VSidebar> | null, callback?: SetupCallback<VSidebar>): VSidebar;
|
|
268
|
+
vStep(first?: SetupInput<VStep> | null, callback?: SetupCallback<VStep>): VStep;
|
|
269
|
+
vSteps(first?: SetupInput<VSteps> | null, callback?: SetupCallback<VSteps>): VSteps;
|
|
270
|
+
vSubMenu(first?: SetupInput<VSubMenu> | null, callback?: SetupCallback<VSubMenu>): VSubMenu;
|
|
271
|
+
vTab(first?: SetupInput<VTab> | null, callback?: SetupCallback<VTab>): VTab;
|
|
272
|
+
vTabs(first?: SetupInput<VTabs> | null, callback?: SetupCallback<VTabs>): VTabs;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
export type { ElementOptions };
|