fluentui-svelte 0.2.0 → 0.3.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/dist/components/auto-suggest-box/auto-suggest-box.svelte +68 -56
- package/dist/components/auto-suggest-box/docs/llms.md +46 -14
- package/dist/components/auto-suggest-box/option.svelte +2 -1
- package/dist/components/avatar/docs/llms.md +20 -14
- package/dist/components/badge/docs/llms.md +29 -16
- package/dist/components/button/button.svelte +11 -5
- package/dist/components/button/docs/llms.md +33 -24
- package/dist/components/calendar-date-picker/docs/llms.md +17 -7
- package/dist/components/calendar-view/calendar-view-header.svelte +2 -2
- package/dist/components/calendar-view/calendar-view-header.svelte.d.ts +2 -17
- package/dist/components/calendar-view/calendar-view-months.svelte +1 -1
- package/dist/components/calendar-view/calendar-view-years.svelte +1 -1
- package/dist/components/calendar-view/calendar-view.svelte +66 -52
- package/dist/components/calendar-view/docs/llms.md +42 -30
- package/dist/components/card/docs/llms.md +54 -34
- package/dist/components/checkbox/docs/llms.md +18 -12
- package/dist/components/date-picker/docs/llms.md +25 -15
- package/dist/components/dialog/dialog-surface.svelte +8 -8
- package/dist/components/dialog/dialog.svelte +41 -39
- package/dist/components/dialog/docs/llms.md +59 -34
- package/dist/components/divider/docs/llms.md +14 -9
- package/dist/components/dropdown/docs/llms.md +34 -15
- package/dist/components/dropdown/dropdown.svelte +4 -2
- package/dist/components/dropdown-select/docs/llms.md +28 -14
- package/dist/components/expander/docs/llms.md +19 -12
- package/dist/components/flyout/docs/llms.md +17 -11
- package/dist/components/hyperlink/docs/llms.md +11 -7
- package/dist/components/info-bar/docs/llms.md +15 -9
- package/dist/components/label/docs/llms.md +15 -11
- package/dist/components/list-view/docs/llms.md +34 -24
- package/dist/components/list-view/list-view-item.svelte +10 -4
- package/dist/components/list-view/list-view.svelte +68 -63
- package/dist/components/menu/context-menu-trigger.svelte +45 -40
- package/dist/components/menu/docs/llms.md +63 -34
- package/dist/components/menu/menu-item-checkbox.svelte +3 -1
- package/dist/components/menu/menu-item-radio.svelte +3 -1
- package/dist/components/menu/menu-item-switch.svelte +3 -1
- package/dist/components/menu/menu-item.svelte +5 -1
- package/dist/components/menu/menu-popover.svelte +21 -10
- package/dist/components/menu/menu-trigger.svelte +22 -9
- package/dist/components/menu/menu.svelte +98 -87
- package/dist/components/number-box/docs/llms.md +10 -6
- package/dist/components/persona/docs/llms.md +19 -14
- package/dist/components/progress-bar/docs/llms.md +18 -10
- package/dist/components/progress-ring/docs/llms.md +19 -12
- package/dist/components/radio-button/docs/llms.md +13 -8
- package/dist/components/skeleton/docs/llms.md +13 -8
- package/dist/components/slider/docs/llms.md +33 -21
- package/dist/components/slider/slider.svelte +13 -11
- package/dist/components/table/docs/llms.md +531 -0
- package/dist/components/table/table-body.svelte +31 -0
- package/dist/components/table/table-body.svelte.d.ts +25 -0
- package/dist/components/table/table-cell-actions.svelte +48 -0
- package/dist/components/table/table-cell-actions.svelte.d.ts +17 -0
- package/dist/components/table/table-cell-layout.svelte +88 -0
- package/dist/components/table/table-cell-layout.svelte.d.ts +14 -0
- package/dist/components/table/table-cell.svelte +74 -0
- package/dist/components/table/table-cell.svelte.d.ts +25 -0
- package/dist/components/table/table-header-cell.svelte +257 -0
- package/dist/components/table/table-header-cell.svelte.d.ts +25 -0
- package/dist/components/table/table-header.svelte +28 -0
- package/dist/components/table/table-header.svelte.d.ts +25 -0
- package/dist/components/table/table-row.svelte +57 -0
- package/dist/components/table/table-row.svelte.d.ts +25 -0
- package/dist/components/table/table-selection-cell.svelte +89 -0
- package/dist/components/table/table-selection-cell.svelte.d.ts +25 -0
- package/dist/components/table/table.svelte +189 -0
- package/dist/components/table/table.svelte.d.ts +49 -0
- package/dist/components/table/table.svelte.js +138 -0
- package/dist/components/table/types.d.ts +287 -0
- package/dist/components/table/types.js +1 -0
- package/dist/components/text-box/docs/llms.md +23 -17
- package/dist/components/textarea/docs/llms.md +16 -7
- package/dist/components/time-picker/docs/llms.md +20 -10
- package/dist/components/toggle-switch/docs/llms.md +13 -9
- package/dist/components/tooltip/docs/llms.md +24 -10
- package/dist/components/tree-view/docs/llms.md +53 -35
- package/dist/components/tree-view/tree-view-item-content.svelte +1 -1
- package/dist/components/tree-view/tree-view-item.svelte +3 -3
- package/dist/components/tree-view/tree-view.svelte +89 -93
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11 -0
- package/dist/providers/fluentui-svelte/fluentui-svelte.svelte +15 -15
- package/package.json +1 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import type { FSContext } from '../../internal/index.js';
|
|
2
|
+
import type { PolymorphicProps } from '../../types/index.js';
|
|
3
|
+
import type { Component, Snippet } from 'svelte';
|
|
4
|
+
import type { CheckboxProps } from '../checkbox/types.ts';
|
|
5
|
+
import type { RadioButtonProps } from '../radio-button/types.ts';
|
|
6
|
+
export type TableSize = 'extra-small' | 'small' | 'medium';
|
|
7
|
+
export type CellFocusMode = 'cell' | 'group' | 'none';
|
|
8
|
+
export type TableRowAppearance = 'none' | 'brand' | 'neutral';
|
|
9
|
+
export type SortDirection = 'ascending' | 'descending';
|
|
10
|
+
export type SelectionType = 'checkbox' | 'radio';
|
|
11
|
+
export type TableDOM = {
|
|
12
|
+
table: HTMLTableElement;
|
|
13
|
+
thead: HTMLTableSectionElement;
|
|
14
|
+
tbody: HTMLTableSectionElement;
|
|
15
|
+
tr: HTMLTableRowElement;
|
|
16
|
+
th: HTMLTableCellElement;
|
|
17
|
+
td: HTMLTableCellElement;
|
|
18
|
+
div: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
/** @propsmith TableProps */
|
|
21
|
+
export type TableProps<Tag extends 'table' | 'div' = 'table'> = {
|
|
22
|
+
/** The HTML element to render the table as. Defaults to a `div` when `noNativeElements` is set.
|
|
23
|
+
* @type 'table' | 'div'
|
|
24
|
+
* @default 'table'
|
|
25
|
+
*/
|
|
26
|
+
as?: Tag;
|
|
27
|
+
/** The DOM reference of the table element.
|
|
28
|
+
* @type HTMLTableElement | HTMLDivElement
|
|
29
|
+
* @bindable
|
|
30
|
+
*/
|
|
31
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
32
|
+
/** Affects the sizes of all table subcomponents.
|
|
33
|
+
* @default 'medium'
|
|
34
|
+
*/
|
|
35
|
+
size?: TableSize;
|
|
36
|
+
/** Renders every table part as a `div` instead of a semantic table element. The layout switches
|
|
37
|
+
* from `display: table` to `display: flex`, which virtualization and sticky headers need.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
noNativeElements?: boolean;
|
|
41
|
+
/** Turns every header cell into a sort button. Individual cells can still opt in on their own.
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
sortable?: boolean;
|
|
45
|
+
/** Drops the line that separates one row from the next.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
noRowBorders?: boolean;
|
|
49
|
+
/** Moves the focus between cells with the arrow keys, through a single tab stop. It also
|
|
50
|
+
* switches the table over to the `role="grid"` pattern, which that navigation requires.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
enableTabspot?: boolean;
|
|
54
|
+
/** Lets the arrow keys reach rows a windowed list has not rendered. Only read when
|
|
55
|
+
* `enableTabspot` is set, and the rows need an `aria-rowindex` for it to find them again.
|
|
56
|
+
* @type TableVirtualizer
|
|
57
|
+
*/
|
|
58
|
+
virtualizer?: TableVirtualizer;
|
|
59
|
+
/** Gives every header cell a handle that drags its column wider or narrower. It also pins the
|
|
60
|
+
* table to a fixed layout, so a column keeps the width it was given.
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
resizableColumns?: boolean;
|
|
64
|
+
/** The width of each column in pixels, by column position. Columns left out keep their own size.
|
|
65
|
+
* @bindable
|
|
66
|
+
*/
|
|
67
|
+
columnWidths?: number[];
|
|
68
|
+
/** Per column limits, by column position.
|
|
69
|
+
* @type ColumnSizing[]
|
|
70
|
+
*/
|
|
71
|
+
columnSizing?: ColumnSizing[];
|
|
72
|
+
/** Called whenever a column is dragged or nudged to a new width.
|
|
73
|
+
* @type (e: Event, data: { index: number; width: number }) => void
|
|
74
|
+
*/
|
|
75
|
+
onColumnResize?: (e: Event, data: {
|
|
76
|
+
index: number;
|
|
77
|
+
width: number;
|
|
78
|
+
}) => void;
|
|
79
|
+
} & PolymorphicProps<Tag>;
|
|
80
|
+
export type ColumnSizing = {
|
|
81
|
+
/** Narrowest the column may be dragged, in pixels.
|
|
82
|
+
* @default 40
|
|
83
|
+
*/
|
|
84
|
+
minWidth?: number;
|
|
85
|
+
/** Width the column starts at, in pixels. Without it the browser sizes the column. */
|
|
86
|
+
defaultWidth?: number;
|
|
87
|
+
};
|
|
88
|
+
export type TableVirtualizer = {
|
|
89
|
+
/** Total number of real rows, the whole data set rather than the rendered window. */
|
|
90
|
+
size: number;
|
|
91
|
+
/** Scroll so the row at `index` renders. May be async. */
|
|
92
|
+
scrollToIndex?: (index: number) => void | Promise<void>;
|
|
93
|
+
};
|
|
94
|
+
/** @propsmith TableHeaderProps */
|
|
95
|
+
export type TableHeaderProps<Tag extends 'thead' | 'div' = 'thead'> = {
|
|
96
|
+
/** The HTML element to render the header as. Inherited from the table by default.
|
|
97
|
+
* @type 'thead' | 'div'
|
|
98
|
+
* @default 'thead'
|
|
99
|
+
*/
|
|
100
|
+
as?: Tag;
|
|
101
|
+
/** The DOM reference of the header element.
|
|
102
|
+
* @type HTMLTableSectionElement | HTMLDivElement
|
|
103
|
+
* @bindable
|
|
104
|
+
*/
|
|
105
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
106
|
+
} & PolymorphicProps<Tag>;
|
|
107
|
+
/** @propsmith TableHeaderCellProps */
|
|
108
|
+
export type TableHeaderCellProps<Tag extends 'th' | 'div' = 'th'> = {
|
|
109
|
+
/** The HTML element to render the header cell as. Inherited from the table by default.
|
|
110
|
+
* @type 'th' | 'div'
|
|
111
|
+
* @default 'th'
|
|
112
|
+
*/
|
|
113
|
+
as?: Tag;
|
|
114
|
+
/** The DOM reference of the header cell element.
|
|
115
|
+
* @type HTMLTableCellElement | HTMLDivElement
|
|
116
|
+
* @bindable
|
|
117
|
+
*/
|
|
118
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
119
|
+
/** Whether the column is sortable. Inherited from the table by default. */
|
|
120
|
+
sortable?: boolean;
|
|
121
|
+
/** The direction the column is currently sorted in. Also sets `aria-sort`. */
|
|
122
|
+
sortDirection?: SortDirection;
|
|
123
|
+
/** The indicator rendered next to the label of a sortable column.
|
|
124
|
+
* @type Snippet | Component
|
|
125
|
+
*/
|
|
126
|
+
sortIcon?: Snippet<[{
|
|
127
|
+
class: string;
|
|
128
|
+
}]> | Component<{
|
|
129
|
+
class: string;
|
|
130
|
+
}>;
|
|
131
|
+
/** Content placed after the label, outside the sort button.
|
|
132
|
+
* @type Snippet | Component
|
|
133
|
+
*/
|
|
134
|
+
aside?: Snippet<[{
|
|
135
|
+
class: string;
|
|
136
|
+
}]> | Component<{
|
|
137
|
+
class: string;
|
|
138
|
+
}>;
|
|
139
|
+
/** How the arrow keys treat the cell. `'group'` holds the focusable content of the cell out of
|
|
140
|
+
* the tab order until `Enter` steps in, and `Escape` steps back out. `'none'` skips the cell
|
|
141
|
+
* altogether. Only read when the table sets `enableTabspot`. A resizable header cell defaults to
|
|
142
|
+
* `'group'`, so the arrows reach its handle instead of leaving the column behind.
|
|
143
|
+
* @default 'cell'
|
|
144
|
+
*/
|
|
145
|
+
focusMode?: CellFocusMode;
|
|
146
|
+
/** Whether the column can be resized. Inherited from the table by default. */
|
|
147
|
+
resizable?: boolean;
|
|
148
|
+
/** The accessible name of the resize handle. Give it a translated, and ideally per column, string
|
|
149
|
+
* — the attributes of the cell reach the cell, never the handle inside it.
|
|
150
|
+
* @default 'Resize column'
|
|
151
|
+
*/
|
|
152
|
+
resizeLabel?: string;
|
|
153
|
+
} & PolymorphicProps<Tag>;
|
|
154
|
+
/** @propsmith TableBodyProps */
|
|
155
|
+
export type TableBodyProps<Tag extends 'tbody' | 'div' = 'tbody'> = {
|
|
156
|
+
/** The HTML element to render the body as. Inherited from the table by default.
|
|
157
|
+
* @type 'tbody' | 'div'
|
|
158
|
+
* @default 'tbody'
|
|
159
|
+
*/
|
|
160
|
+
as?: Tag;
|
|
161
|
+
/** The DOM reference of the body element.
|
|
162
|
+
* @type HTMLTableSectionElement | HTMLDivElement
|
|
163
|
+
* @bindable
|
|
164
|
+
*/
|
|
165
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
166
|
+
} & PolymorphicProps<Tag>;
|
|
167
|
+
/** @propsmith TableRowProps */
|
|
168
|
+
export type TableRowProps<Tag extends 'tr' | 'div' = 'tr'> = {
|
|
169
|
+
/** The HTML element to render the row as. Inherited from the table by default.
|
|
170
|
+
* @type 'tr' | 'div'
|
|
171
|
+
* @default 'tr'
|
|
172
|
+
*/
|
|
173
|
+
as?: Tag;
|
|
174
|
+
/** The DOM reference of the row element.
|
|
175
|
+
* @type HTMLTableRowElement | HTMLDivElement
|
|
176
|
+
* @bindable
|
|
177
|
+
*/
|
|
178
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
179
|
+
/** How the row is filled. Intended to mark a selected row.
|
|
180
|
+
* @default 'none'
|
|
181
|
+
*/
|
|
182
|
+
appearance?: TableRowAppearance;
|
|
183
|
+
} & PolymorphicProps<Tag>;
|
|
184
|
+
/** @propsmith TableCellProps */
|
|
185
|
+
export type TableCellProps<Tag extends 'td' | 'div' = 'td'> = {
|
|
186
|
+
/** The HTML element to render the cell as. Inherited from the table by default.
|
|
187
|
+
* @type 'td' | 'div'
|
|
188
|
+
* @default 'td'
|
|
189
|
+
*/
|
|
190
|
+
as?: Tag;
|
|
191
|
+
/** The DOM reference of the cell element.
|
|
192
|
+
* @type HTMLTableCellElement | HTMLDivElement
|
|
193
|
+
* @bindable
|
|
194
|
+
*/
|
|
195
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
196
|
+
/** How the arrow keys treat the cell. `'group'` holds the focusable content of the cell out of
|
|
197
|
+
* the tab order until `Enter` steps in, and `Escape` steps back out. `'none'` skips the cell
|
|
198
|
+
* altogether. Only read when the table sets `enableTabspot`.
|
|
199
|
+
* @default 'cell'
|
|
200
|
+
*/
|
|
201
|
+
focusMode?: CellFocusMode;
|
|
202
|
+
} & PolymorphicProps<Tag>;
|
|
203
|
+
/** @propsmith TableSelectionCellProps */
|
|
204
|
+
export type TableSelectionCellProps<Tag extends 'td' | 'div' = 'td'> = {
|
|
205
|
+
/** The HTML element to render the cell as. Inherited from the table by default.
|
|
206
|
+
* @type 'td' | 'div'
|
|
207
|
+
* @default 'td'
|
|
208
|
+
*/
|
|
209
|
+
as?: Tag;
|
|
210
|
+
/** The DOM reference of the cell element.
|
|
211
|
+
* @type HTMLTableCellElement | HTMLDivElement
|
|
212
|
+
* @bindable
|
|
213
|
+
*/
|
|
214
|
+
ref?: TableDOM[Tag] | HTMLDivElement;
|
|
215
|
+
/** A table can have two kinds of selection modes.
|
|
216
|
+
* @default 'checkbox'
|
|
217
|
+
*/
|
|
218
|
+
type?: SelectionType;
|
|
219
|
+
/** Whether the row is selected. `'mixed'` renders the indeterminate state.
|
|
220
|
+
* @type boolean | 'mixed'
|
|
221
|
+
* @default false
|
|
222
|
+
*/
|
|
223
|
+
checked?: boolean | 'mixed';
|
|
224
|
+
/** Only shows the indicator when it is checked, or the row is hovered or focused.
|
|
225
|
+
* @default false
|
|
226
|
+
*/
|
|
227
|
+
subtle?: boolean;
|
|
228
|
+
/** Hides the indicator while it keeps taking up the same space.
|
|
229
|
+
* @default false
|
|
230
|
+
*/
|
|
231
|
+
invisible?: boolean;
|
|
232
|
+
/** The props to spread on the checkbox rendered when `type` is `'checkbox'`.
|
|
233
|
+
* @type CheckboxProps
|
|
234
|
+
*/
|
|
235
|
+
checkboxIndicator?: Omit<CheckboxProps<'div'>, 'wrapperAs' | 'checked' | 'indeterminate' | 'children'>;
|
|
236
|
+
/** The props to spread on the radio button rendered when `type` is `'radio'`.
|
|
237
|
+
* @type RadioButtonProps
|
|
238
|
+
*/
|
|
239
|
+
radioIndicator?: Omit<RadioButtonProps, 'checked' | 'group'>;
|
|
240
|
+
} & PolymorphicProps<Tag>;
|
|
241
|
+
/** @propsmith TableCellLayoutProps */
|
|
242
|
+
export type TableCellLayoutProps = {
|
|
243
|
+
/** The DOM reference of the layout element.
|
|
244
|
+
* @bindable
|
|
245
|
+
*/
|
|
246
|
+
ref?: HTMLDivElement;
|
|
247
|
+
/** An icon, an avatar or any other visual element placed before the main content.
|
|
248
|
+
* @type Snippet | Component
|
|
249
|
+
*/
|
|
250
|
+
media?: Snippet<[{
|
|
251
|
+
class: string;
|
|
252
|
+
}]> | Component<{
|
|
253
|
+
class: string;
|
|
254
|
+
}>;
|
|
255
|
+
/** A second line of text that describes or complements the main content. */
|
|
256
|
+
description?: string;
|
|
257
|
+
/** Emphasizes the cell by enlarging the media and bolding the main content. */
|
|
258
|
+
appearance?: 'primary';
|
|
259
|
+
/** Clips the content with an ellipsis instead of letting it wrap. */
|
|
260
|
+
truncate?: boolean;
|
|
261
|
+
} & PolymorphicProps<'div'>;
|
|
262
|
+
/** @propsmith TableCellActionsProps */
|
|
263
|
+
export type TableCellActionsProps = {
|
|
264
|
+
/** The DOM reference of the actions element.
|
|
265
|
+
* @bindable
|
|
266
|
+
*/
|
|
267
|
+
ref?: HTMLDivElement;
|
|
268
|
+
/** Keeps the actions on screen instead of waiting for the row to be hovered or focused. */
|
|
269
|
+
visible?: boolean;
|
|
270
|
+
} & PolymorphicProps<'div'>;
|
|
271
|
+
export type TableContextConfig = {
|
|
272
|
+
size: TableSize;
|
|
273
|
+
noNativeElements: boolean;
|
|
274
|
+
sortable: boolean;
|
|
275
|
+
enableTabspot: boolean;
|
|
276
|
+
resizableColumns: boolean;
|
|
277
|
+
};
|
|
278
|
+
export type TableContextState = {
|
|
279
|
+
columnWidths: number[];
|
|
280
|
+
};
|
|
281
|
+
export type TableContextMethods = {
|
|
282
|
+
/** The width a column should render at, or `undefined` to let the browser decide. */
|
|
283
|
+
getColumnWidth: (index: number) => number | undefined;
|
|
284
|
+
/** Records a new width for a column, clamped to the minimum it was given. */
|
|
285
|
+
resizeColumn: (e: Event, index: number, width: number) => void;
|
|
286
|
+
};
|
|
287
|
+
export type TableContext = FSContext<TableContextConfig, TableContextState, null, TableContextMethods>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -67,20 +67,26 @@ The `onClear` event is triggered when the input is cleared, allowing you to hand
|
|
|
67
67
|
|
|
68
68
|
## Component Props
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
70
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
71
|
+
<!-- props:TextBoxProps -->
|
|
72
|
+
|
|
73
|
+
| Name | Type | Default | Description |
|
|
74
|
+
| ------------------------------------ | ---------------------------------------------------------------------- | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
75
|
+
| `type` | [`TextBoxTypes`](https://fluentui-svelte.dev/docs/types/#textboxtypes) | `'text'` | The type of the input element. |
|
|
76
|
+
| `value` _bindable_ | `string` | `number` | | The current value of the input. |
|
|
77
|
+
| `wrapperRef` _bindable_ | `HTMLDivElement` | | The DOM reference of the wrapper element. |
|
|
78
|
+
| `ref` _bindable_ | `HTMLInputElement` | | The DOM reference of the input element. |
|
|
79
|
+
| `placeholder` | `string` | `'Fluent TextBox'` | The placeholder text for the input. |
|
|
80
|
+
| `hideActionButtons` | `boolean` | | Whether to hide the extra action buttons in the input. |
|
|
81
|
+
| `justify` | `boolean` | | Make the input fill the full width of the container. |
|
|
82
|
+
| `contentBefore` | `string` | `Snippet` | `Component` | | Content rendered before the input, inside the wrapper. |
|
|
83
|
+
| `contentAfter` | `string` | `Snippet` | `Component` | | Content rendered after the input, inside the wrapper. |
|
|
84
|
+
| `size` | `'small'` | `'medium'` | `'large'` | `'medium'` | The size of the input element. |
|
|
85
|
+
| `textChanged` | `(e: InputEvent, text: string) => void` | | Occurs when content changes in the text box. |
|
|
86
|
+
| `querySubmitted` | `(e: MouseEvent` | `KeyboardEvent, query: string) => void` | | The QuerySubmitted event occurs when: 1. The input type is 'search'. 2. While the focus is in the text box, press Enter or click the query icon. |
|
|
87
|
+
| `onClear` | `(e: MouseEvent) => void` | | Occurs when the clear button is clicked. |
|
|
88
|
+
| `children` | `Snippet` | | The children elements to render inside the input. |
|
|
89
|
+
| `wrapperAttributes` | `HTMLAttributes` | | The attributes to apply to the wrapper element. |
|
|
90
|
+
| `HTMLInputAttributes` without `size` | | | |
|
|
91
|
+
|
|
92
|
+
<!-- /props:TextBoxProps -->
|
|
@@ -46,10 +46,19 @@ The `onChange` event is triggered whenever the content of the textarea changes.
|
|
|
46
46
|
|
|
47
47
|
## Component Props
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
| `
|
|
55
|
-
|
|
|
49
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
50
|
+
<!-- props:TextAreaProps -->
|
|
51
|
+
|
|
52
|
+
| Name | Type | Default | Description |
|
|
53
|
+
| -------------------------------- | ------------------------------------------------------------------ | ------------ | ------------------------------------------------ |
|
|
54
|
+
| `value` _bindable_ | `string` | `''` | The current value of the textarea. |
|
|
55
|
+
| `ref` _bindable_ | `HTMLElement` | | The DOM reference of the textarea element. |
|
|
56
|
+
| `placeholder` | `string` | | The placeholder text for the textarea. |
|
|
57
|
+
| `resize` | `'none'` | `'both'` | `'horizontal'` | `'vertical'` | `'vertical'` | Configures the resize behavior of the textarea. |
|
|
58
|
+
| `onChange` | `(e: Event) => void` | | Callback function for the change event. |
|
|
59
|
+
| `disabled` | `boolean` | `false` | Disables the user interaction. |
|
|
60
|
+
| `wrapperAttributes` | `HTMLAttributes` | | The attributes to spread on the wrapper element. |
|
|
61
|
+
| `wrapperRef` _bindable_ | `HTMLDivElement` | | The DOM reference of the wrapper element. |
|
|
62
|
+
| `SvelteHTMLElements['textarea']` | | | |
|
|
63
|
+
|
|
64
|
+
<!-- /props:TextAreaProps -->
|
|
@@ -35,13 +35,23 @@ Use `hideHours`, `hideMinutes`, or `hideSeconds` to hide individual columns. By
|
|
|
35
35
|
|
|
36
36
|
## Component Props
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
| `
|
|
38
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
39
|
+
<!-- props:TimePickerProps -->
|
|
40
|
+
|
|
41
|
+
| Name | Type | Default | Description |
|
|
42
|
+
| ----------------------------- | --------------------- | ----------------- | --------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `value` _bindable_ | `string` | `''` | Selected time as 24h `HH:mm` or `HH:mm:ss` (matches `<input type="time">`). |
|
|
44
|
+
| `format` | `12` | `24` | `24` | Clock format: `24` (00-23) or `12` (01-12 with an AM/PM column). |
|
|
45
|
+
| `open` _bindable_ | `boolean` | `false` | Controls the open state of the picker. |
|
|
46
|
+
| `hideHours` | `boolean` | `false` | Removes the hour column. |
|
|
47
|
+
| `hideMinutes` | `boolean` | `false` | Removes the minute column. |
|
|
48
|
+
| `hideSeconds` | `boolean` | `false` | Removes the second column. |
|
|
49
|
+
| `element` _bindable_ | `HTMLButtonElement` | | The DOM reference of the trigger button. |
|
|
50
|
+
| `wrapperRef` _bindable_ | `HTMLDivElement` | | The DOM reference of the element wrapping the trigger and its input. |
|
|
51
|
+
| `wrapperAttributes` | `HTMLAttributes` | | The attributes to spread on the wrapper element. |
|
|
52
|
+
| `inputElement` _bindable_ | `HTMLInputElement` | | The DOM reference of the underlying input element. |
|
|
53
|
+
| `inputProps` | `HTMLInputAttributes` | | HTML attributes for the underlying input element. Give it a `name` to submit the value with a form. |
|
|
54
|
+
| `popupLabel` | `string` | `'Choose a time'` | The accessible name of the popup, which is announced as a dialog. |
|
|
55
|
+
| Element Attributes (`button`) | | | |
|
|
56
|
+
|
|
57
|
+
<!-- /props:TimePickerProps -->
|
|
@@ -28,12 +28,16 @@ A toggle switch can be labeled, checked, or disabled.
|
|
|
28
28
|
|
|
29
29
|
## Component Props
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `
|
|
39
|
-
|
|
|
31
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
32
|
+
<!-- props:ToggleSwitchProps -->
|
|
33
|
+
|
|
34
|
+
| Name | Type | Default | Description |
|
|
35
|
+
| ----------------------------- | --------------------- | ------- | ---------------------------------------------------------- |
|
|
36
|
+
| `checked` _bindable_ | `boolean` | | Whether the switch is on. |
|
|
37
|
+
| `ref` _bindable_ | `HTMLInputElement` | | The DOM reference of the input element. |
|
|
38
|
+
| `label` | `string` | | The label displayed next to the input element. |
|
|
39
|
+
| `labelAttributes` | `HTMLLabelAttributes` | | The attributes to spread on the label wrapping the switch. |
|
|
40
|
+
| `labelElement` | `HTMLLabelElement` | | The DOM reference of the label element. |
|
|
41
|
+
| `SvelteHTMLElements['input']` | | | |
|
|
42
|
+
|
|
43
|
+
<!-- /props:ToggleSwitchProps -->
|
|
@@ -62,13 +62,27 @@ The relationship prop allows you to specify the relationship between the tooltip
|
|
|
62
62
|
|
|
63
63
|
## Component Props
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
|
69
|
-
|
|
|
70
|
-
| `
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
|
|
|
65
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
66
|
+
<!-- props:TooltipProps -->
|
|
67
|
+
|
|
68
|
+
| Name | Type | Default | Description |
|
|
69
|
+
| --------------------------------------------------- | -------------------------------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------- |
|
|
70
|
+
| `content` | `string` | `Snippet` | `Component` | `'I am a tooltip'` | The content to display in the tooltip. |
|
|
71
|
+
| `class` | `string` | | The class to apply to the tooltip. |
|
|
72
|
+
| `ref` _bindable_ | `HTMLElement` | | The DOM reference of the tooltip element. |
|
|
73
|
+
| `target` | `HTMLElement` | | The element the tooltip is anchored to. Falls back to the rendered children. |
|
|
74
|
+
| `open` _bindable_ | `boolean` | `false` | Controls the open state of the tooltip. |
|
|
75
|
+
| `withArrow` | `boolean` | `false` | Whether the tooltip has an arrow pointing at its target. |
|
|
76
|
+
| `positionConfig` | `ComputePositionConfig` | | The position configuration handed over to floating-ui. |
|
|
77
|
+
| `openDelay` | `number` | `100` | The delay in milliseconds before the tooltip is shown. |
|
|
78
|
+
| `hideDelay` | `number` | `300` | The delay in milliseconds before the tooltip is hidden. |
|
|
79
|
+
| `onVisibleChange` | `(visible: boolean) => void` | | Callback function that is called when the visibility of the tooltip changes. |
|
|
80
|
+
| `relationship` | `'label'` | `'description'` | `'inaccessible'` | `'label'` | The relationship of the tooltip to its target, which decides how it is announced. |
|
|
81
|
+
| `placement` | `Placement` | | Where the tooltip is placed relative to its target. |
|
|
82
|
+
| `id` | `string` | | The id of the tooltip element, referenced by the target. Falls back to a generated id. |
|
|
83
|
+
| `preventClose` _bindable_ | `boolean` | `false` | Keeps the tooltip open until it is closed by hand. |
|
|
84
|
+
| `animationFrame` | `boolean` | `false` | Repositions the tooltip on every animation frame, for a target that keeps moving. |
|
|
85
|
+
| `children` | `Snippet` | | The target of the tooltip. It receives the ARIA attributes and the attachment to spread on your element. |
|
|
86
|
+
| `HTMLAttributes<HTMLDivElement>` without `children` | | | |
|
|
87
|
+
|
|
88
|
+
<!-- /props:TooltipProps -->
|
|
@@ -74,44 +74,62 @@ Use the bindable `openItems` and `checkedItems` props on the root `TreeView` to
|
|
|
74
74
|
|
|
75
75
|
## Component Props (TreeView)
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
85
|
-
| `onOpenChange`
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
77
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
78
|
+
<!-- props:TreeViewProps -->
|
|
79
|
+
|
|
80
|
+
| Name | Type | Default | Description |
|
|
81
|
+
| --------------------------------------------------- | -------------------------------------------- | ------------ | ------------------------------------------------------------------------------------ |
|
|
82
|
+
| `ref` _bindable_ | `HTMLUListElement` | | The DOM reference of the tree element. |
|
|
83
|
+
| `size` | `'small'` | `'medium'` | `'large'` | `'medium'` | The size of every item in the tree. |
|
|
84
|
+
| `navigationMode` | `'tree'` | `'treegrid'` | `'tree'` | Whether the tree takes a single tab stop, or every row is reachable on its own. |
|
|
85
|
+
| `onOpenChange` | `(e: Event, openItems: string[]) => void` | | Called whenever a branch opens or closes. |
|
|
86
|
+
| `selectionMode` | `'single'` | `'multiple'` | `'multiple'` | How many items can be checked at a time. |
|
|
87
|
+
| `onCheckedChange` | `(e: Event, checkedItems: string[]) => void` | | Called whenever an item is checked or unchecked. |
|
|
88
|
+
| `virtualizer` | `TreeViewVirtualizer` | | Bridge to a windowing library. Only the rendered slice of items lives in the DOM. |
|
|
89
|
+
| `openItems` _bindable_ | `string[]` | `SvelteSet<string>` | | The ids of the open branches. A `SvelteSet` is required when a `virtualizer` is set. |
|
|
90
|
+
| `checkedItems` _bindable_ | `string[]` | `SvelteSet<string>` | | The ids of the checked items. A `SvelteSet` is required when a `virtualizer` is set. |
|
|
91
|
+
| `children` | `Snippet` | | The items of the tree. |
|
|
92
|
+
| `TreeViewVirtualProps` | `TreeViewStaticProps` | | | |
|
|
93
|
+
| Element Attributes (`ul`) | | | |
|
|
94
|
+
|
|
95
|
+
<!-- /props:TreeViewProps -->
|
|
89
96
|
|
|
90
97
|
## Component Props (TreeViewItem)
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
|
96
|
-
|
|
|
97
|
-
| `
|
|
98
|
-
| `
|
|
99
|
-
| `
|
|
100
|
-
| `
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
104
|
-
| `
|
|
105
|
-
| `
|
|
99
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
100
|
+
<!-- props:TreeViewItemProps -->
|
|
101
|
+
|
|
102
|
+
| Name | Type | Default | Description |
|
|
103
|
+
| ------------------------- | ------------------------------------------------------------ | -------- | -------------------------------------------------------------------------------------- |
|
|
104
|
+
| `id` | `string` | | The id of the item, used by the tree to track its state. Falls back to a generated id. |
|
|
105
|
+
| `type` | `'item'` | `'branch'` | `'item'` | Whether the item holds children, and can therefore be opened. |
|
|
106
|
+
| `ref` | `HTMLLIElement` | | The DOM reference of the item element. |
|
|
107
|
+
| `value` | `string` | `number` | `id` | The value reported by the tree events. Falls back to the id of the item. |
|
|
108
|
+
| `text` | `string` | | The label of the item, used by the type-ahead navigation. |
|
|
109
|
+
| `open` | `boolean` | | Whether the branch is open. |
|
|
110
|
+
| `checked` | `boolean` | | Whether the item is checked. |
|
|
111
|
+
| `indeterminate` | `boolean` | | Renders the checkbox in its mixed state, when only some children are checked. |
|
|
112
|
+
| `disabled` | `boolean` | | Disables the user interaction. |
|
|
113
|
+
| `index` | `number` | | The real index of the item in the data set. Required when the tree is virtualized. |
|
|
114
|
+
| `onOpenChange` | `(e: Event, data: { id: string; open: boolean }) => void` | | Called when this branch opens or closes. |
|
|
115
|
+
| `onCheckedChange` | `(e: Event, data: { id: string; checked: boolean }) => void` | | Called when this item is checked or unchecked. |
|
|
116
|
+
| Element Attributes (`li`) | | | |
|
|
117
|
+
|
|
118
|
+
<!-- /props:TreeViewItemProps -->
|
|
106
119
|
|
|
107
120
|
## Component Props (TreeViewItemContent)
|
|
108
121
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
| `
|
|
115
|
-
| `
|
|
116
|
-
| `
|
|
117
|
-
| `
|
|
122
|
+
<!-- DO NOT EDIT THIS SECTION (propsmith generated) -->
|
|
123
|
+
<!-- props:TreeViewItemLayoutProps -->
|
|
124
|
+
|
|
125
|
+
| Name | Type | Default | Description |
|
|
126
|
+
| -------------------------- | ---------------------------- | ------- | --------------------------------------------------------------------- |
|
|
127
|
+
| `ref` | `HTMLDivElement` | | The DOM reference of the layout element. |
|
|
128
|
+
| `expandIcon` | `Snippet` | `Component` | | Custom icon for the control that opens a branch. |
|
|
129
|
+
| `iconBefore` | `Snippet` | `Component` | | Content rendered before the label. |
|
|
130
|
+
| `iconAfter` | `Snippet` | `Component` | | Content rendered after the label. |
|
|
131
|
+
| `aside` | `Snippet` | `Component` | | Content pinned to the end of the row. |
|
|
132
|
+
| `actions` | `Snippet` | `Component` | | Content pinned to the end of the row, revealed on hover and on focus. |
|
|
133
|
+
| Element Attributes (`div`) | | | |
|
|
134
|
+
|
|
135
|
+
<!-- /props:TreeViewItemLayoutProps -->
|