@gtkx/react 0.12.1 → 0.13.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/README.md +1 -1
- package/dist/generated/jsx.d.ts +32 -18
- package/dist/host-config.js +3 -3
- package/dist/jsx.d.ts +524 -366
- package/dist/jsx.js +401 -353
- package/dist/nodes/action-row-child.d.ts +4 -11
- package/dist/nodes/action-row-child.js +10 -66
- package/dist/nodes/action-row.js +21 -4
- package/dist/nodes/application.js +22 -3
- package/dist/nodes/autowrapped.js +13 -3
- package/dist/nodes/calendar-mark.d.ts +15 -0
- package/dist/nodes/calendar-mark.js +29 -0
- package/dist/nodes/calendar.d.ts +1 -0
- package/dist/nodes/calendar.js +70 -0
- package/dist/nodes/column-view-column.d.ts +1 -0
- package/dist/nodes/column-view-column.js +4 -0
- package/dist/nodes/column-view.js +24 -7
- package/dist/nodes/expander-row-child.d.ts +15 -0
- package/dist/nodes/expander-row-child.js +20 -0
- package/dist/nodes/expander-row.d.ts +1 -0
- package/dist/nodes/expander-row.js +54 -0
- package/dist/nodes/fixed-child.js +10 -8
- package/dist/nodes/grid-child.js +10 -8
- package/dist/nodes/index.d.ts +12 -0
- package/dist/nodes/index.js +12 -0
- package/dist/nodes/internal/list-item-renderer.d.ts +3 -0
- package/dist/nodes/internal/list-item-renderer.js +25 -9
- package/dist/nodes/internal/list-store.js +2 -2
- package/dist/nodes/internal/tree-list-item-renderer.d.ts +8 -0
- package/dist/nodes/internal/tree-list-item-renderer.js +68 -24
- package/dist/nodes/internal/tree-store.js +3 -4
- package/dist/nodes/level-bar-offset.d.ts +13 -0
- package/dist/nodes/level-bar-offset.js +35 -0
- package/dist/nodes/level-bar.d.ts +1 -0
- package/dist/nodes/level-bar.js +82 -0
- package/dist/nodes/list-view.js +14 -7
- package/dist/nodes/menu.js +4 -4
- package/dist/nodes/models/list.d.ts +2 -1
- package/dist/nodes/models/list.js +21 -12
- package/dist/nodes/models/menu.d.ts +1 -0
- package/dist/nodes/models/menu.js +24 -17
- package/dist/nodes/models/tree-list.d.ts +2 -1
- package/dist/nodes/models/tree-list.js +43 -24
- package/dist/nodes/navigation-page.d.ts +16 -0
- package/dist/nodes/navigation-page.js +58 -0
- package/dist/nodes/navigation-view.d.ts +1 -0
- package/dist/nodes/navigation-view.js +105 -0
- package/dist/nodes/notebook-page-tab.js +1 -1
- package/dist/nodes/notebook-page.js +3 -2
- package/dist/nodes/notebook.js +3 -3
- package/dist/nodes/overlay-child.js +29 -14
- package/dist/nodes/pack-child.d.ts +4 -11
- package/dist/nodes/pack-child.js +10 -66
- package/dist/nodes/pack.js +21 -4
- package/dist/nodes/popover-menu.js +15 -12
- package/dist/nodes/scale-mark.d.ts +17 -0
- package/dist/nodes/scale-mark.js +38 -0
- package/dist/nodes/scale.d.ts +1 -0
- package/dist/nodes/scale.js +70 -0
- package/dist/nodes/simple-list-view.js +3 -3
- package/dist/nodes/slot.js +2 -2
- package/dist/nodes/stack-page.js +7 -7
- package/dist/nodes/stack.js +5 -5
- package/dist/nodes/toggle-group.d.ts +1 -0
- package/dist/nodes/toggle-group.js +48 -0
- package/dist/nodes/toggle.d.ts +15 -0
- package/dist/nodes/toggle.js +70 -0
- package/dist/nodes/toolbar-child.js +18 -16
- package/dist/nodes/tree-list-view.js +16 -7
- package/dist/nodes/virtual-child.d.ts +18 -0
- package/dist/nodes/virtual-child.js +62 -0
- package/dist/nodes/widget.js +22 -8
- package/dist/nodes/window.d.ts +22 -0
- package/dist/nodes/window.js +11 -2
- package/dist/render.d.ts +3 -5
- package/dist/render.js +3 -5
- package/dist/scheduler.d.ts +13 -1
- package/dist/scheduler.js +26 -6
- package/dist/types.d.ts +25 -0
- package/package.json +3 -3
package/dist/jsx.js
CHANGED
|
@@ -1,369 +1,417 @@
|
|
|
1
1
|
import { createElement } from "react";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* GTKX-specific intrinsic elements and components.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @typeParam W - The widget type containing the slot
|
|
9
|
-
*
|
|
10
|
-
* @param props.for - The widget component type (used for type inference)
|
|
11
|
-
* @param props.id - The slot identifier (type-checked against available slots)
|
|
12
|
-
* @param props.children - Content to place in the slot
|
|
5
|
+
* This namespace provides React components for GTK layout, lists, menus, and slots
|
|
6
|
+
* that are specific to GTKX (not direct GTK widget bindings).
|
|
13
7
|
*
|
|
14
8
|
* @example
|
|
15
9
|
* ```tsx
|
|
10
|
+
* import { x, GtkHeaderBar, GtkDropDown } from "@gtkx/react";
|
|
11
|
+
*
|
|
16
12
|
* <GtkHeaderBar>
|
|
17
|
-
* <Slot for={GtkHeaderBar} id="titleWidget">
|
|
13
|
+
* <x.Slot for={GtkHeaderBar} id="titleWidget">
|
|
18
14
|
* <GtkLabel label="App Title" />
|
|
19
|
-
* </Slot>
|
|
15
|
+
* </x.Slot>
|
|
20
16
|
* </GtkHeaderBar>
|
|
21
|
-
* ```
|
|
22
|
-
*
|
|
23
|
-
* @internal
|
|
24
|
-
*/
|
|
25
|
-
export function Slot(props) {
|
|
26
|
-
return createElement("Slot", { id: props.id }, props.children);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Element type for pages within a GtkStack or AdwViewStack.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* <GtkStack>
|
|
34
|
-
* <StackPage name="page1" title="First Page">
|
|
35
|
-
* <GtkLabel label="Content 1" />
|
|
36
|
-
* </StackPage>
|
|
37
|
-
* <StackPage name="page2" title="Second Page">
|
|
38
|
-
* <GtkLabel label="Content 2" />
|
|
39
|
-
* </StackPage>
|
|
40
|
-
* </GtkStack>
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export const StackPage = "StackPage";
|
|
44
|
-
/**
|
|
45
|
-
* Element type for positioning children within a GtkGrid.
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```tsx
|
|
49
|
-
* <GtkGrid>
|
|
50
|
-
* <GridChild column={0} row={0}>
|
|
51
|
-
* <GtkLabel label="Top Left" />
|
|
52
|
-
* </GridChild>
|
|
53
|
-
* <GridChild column={1} row={0} columnSpan={2}>
|
|
54
|
-
* <GtkLabel label="Spans 2 columns" />
|
|
55
|
-
* </GridChild>
|
|
56
|
-
* </GtkGrid>
|
|
57
|
-
* ```
|
|
58
|
-
*/
|
|
59
|
-
export const GridChild = "GridChild";
|
|
60
|
-
/**
|
|
61
|
-
* Element type for positioning children within a GtkFixed.
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* ```tsx
|
|
65
|
-
* <GtkFixed>
|
|
66
|
-
* <FixedChild x={20} y={30}>
|
|
67
|
-
* <GtkLabel label="Positioned at (20, 30)" />
|
|
68
|
-
* </FixedChild>
|
|
69
|
-
* <FixedChild x={100} y={50}>
|
|
70
|
-
* <GtkButton label="At (100, 50)" />
|
|
71
|
-
* </FixedChild>
|
|
72
|
-
* </GtkFixed>
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export const FixedChild = "FixedChild";
|
|
76
|
-
/**
|
|
77
|
-
* Element types for pages within a GtkNotebook (tabbed interface).
|
|
78
|
-
*
|
|
79
|
-
* @example Simple text tabs
|
|
80
|
-
* ```tsx
|
|
81
|
-
* <GtkNotebook>
|
|
82
|
-
* <Notebook.Page label="Tab 1">
|
|
83
|
-
* <GtkLabel label="Content 1" />
|
|
84
|
-
* </Notebook.Page>
|
|
85
|
-
* <Notebook.Page label="Tab 2">
|
|
86
|
-
* <GtkLabel label="Content 2" />
|
|
87
|
-
* </Notebook.Page>
|
|
88
|
-
* </GtkNotebook>
|
|
89
|
-
* ```
|
|
90
17
|
*
|
|
91
|
-
* @example Custom tab widgets
|
|
92
|
-
* ```tsx
|
|
93
|
-
* <GtkNotebook>
|
|
94
|
-
* <Notebook.Page>
|
|
95
|
-
* <Notebook.PageTab>
|
|
96
|
-
* <GtkBox orientation={Gtk.Orientation.HORIZONTAL}>
|
|
97
|
-
* <GtkImage iconName="folder-symbolic" />
|
|
98
|
-
* <GtkLabel label="Files" />
|
|
99
|
-
* </GtkBox>
|
|
100
|
-
* </Notebook.PageTab>
|
|
101
|
-
* <GtkLabel label="Content" />
|
|
102
|
-
* </Notebook.Page>
|
|
103
|
-
* </GtkNotebook>
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
export const Notebook = {
|
|
107
|
-
/** A page within the notebook */
|
|
108
|
-
Page: "Notebook.Page",
|
|
109
|
-
/** Custom widget for the page tab label */
|
|
110
|
-
PageTab: "Notebook.PageTab",
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Element type for items in a ListView or GridView.
|
|
114
|
-
*
|
|
115
|
-
* @example
|
|
116
|
-
* ```tsx
|
|
117
|
-
* <ListView renderItem={(item) => <GtkLabel label={item.name} />}>
|
|
118
|
-
* <ListItem id="1" value={{ name: "Item 1" }} />
|
|
119
|
-
* <ListItem id="2" value={{ name: "Item 2" }} />
|
|
120
|
-
* </ListView>
|
|
121
|
-
* ```
|
|
122
|
-
*/
|
|
123
|
-
export const ListItem = "ListItem";
|
|
124
|
-
/**
|
|
125
|
-
* Component for defining columns in a ColumnView (table widget).
|
|
126
|
-
*
|
|
127
|
-
* @typeParam T - The type of row data
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* ```tsx
|
|
131
|
-
* <GtkColumnView>
|
|
132
|
-
* <ColumnViewColumn
|
|
133
|
-
* id="name"
|
|
134
|
-
* title="Name"
|
|
135
|
-
* expand
|
|
136
|
-
* renderCell={(item) => <GtkLabel label={item?.name ?? ""} />}
|
|
137
|
-
* />
|
|
138
|
-
* <ColumnViewColumn
|
|
139
|
-
* id="status"
|
|
140
|
-
* title="Status"
|
|
141
|
-
* renderCell={(item) => <GtkLabel label={item?.status ?? ""} />}
|
|
142
|
-
* />
|
|
143
|
-
* </GtkColumnView>
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
* @internal
|
|
147
|
-
*/
|
|
148
|
-
export function ColumnViewColumn(props) {
|
|
149
|
-
return createElement("ColumnViewColumn", props);
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Virtualized list component with custom item rendering.
|
|
153
|
-
*
|
|
154
|
-
* Efficiently renders large lists by only creating widgets for visible items.
|
|
155
|
-
*
|
|
156
|
-
* @typeParam T - The type of items in the list
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```tsx
|
|
160
|
-
* const items = [{ id: "1", name: "Apple" }, { id: "2", name: "Banana" }];
|
|
161
|
-
*
|
|
162
|
-
* <ListView renderItem={(item) => <GtkLabel label={item?.name ?? ""} />}>
|
|
163
|
-
* {items.map((item) => (
|
|
164
|
-
* <ListItem key={item.id} id={item.id} value={item} />
|
|
165
|
-
* ))}
|
|
166
|
-
* </ListView>
|
|
167
|
-
* ```
|
|
168
|
-
*
|
|
169
|
-
* @internal
|
|
170
|
-
*/
|
|
171
|
-
export function ListView(props) {
|
|
172
|
-
return createElement("GtkListView", props);
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Virtualized grid component with custom item rendering.
|
|
176
|
-
*
|
|
177
|
-
* Efficiently renders large grids by only creating widgets for visible items.
|
|
178
|
-
*
|
|
179
|
-
* @typeParam T - The type of items in the grid
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* ```tsx
|
|
183
|
-
* <GridView renderItem={(item) => <GtkImage iconName={item?.icon ?? ""} />}>
|
|
184
|
-
* {icons.map((icon) => (
|
|
185
|
-
* <ListItem key={icon.id} id={icon.id} value={icon} />
|
|
186
|
-
* ))}
|
|
187
|
-
* </GridView>
|
|
188
|
-
* ```
|
|
189
|
-
*
|
|
190
|
-
* @internal
|
|
191
|
-
*/
|
|
192
|
-
export function GridView(props) {
|
|
193
|
-
return createElement("GtkGridView", props);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Tree list component with hierarchical data and expand/collapse support.
|
|
197
|
-
*
|
|
198
|
-
* Renders a tree structure with expandable/collapsible rows using GTK's TreeListModel.
|
|
199
|
-
* Items are defined declaratively by nesting TreeListItem components.
|
|
200
|
-
*
|
|
201
|
-
* @typeParam T - The type of items in the tree
|
|
202
|
-
*
|
|
203
|
-
* @example
|
|
204
|
-
* ```tsx
|
|
205
|
-
* interface Category { name: string; }
|
|
206
|
-
* interface Setting { key: string; value: string; }
|
|
207
|
-
*
|
|
208
|
-
* <TreeListView<Category | Setting>
|
|
209
|
-
* renderItem={(item, row) => (
|
|
210
|
-
* <GtkLabel label={'name' in item ? item.name : item.key} />
|
|
211
|
-
* )}
|
|
212
|
-
* >
|
|
213
|
-
* {categories.map(cat => (
|
|
214
|
-
* <TreeListItem key={cat.name} id={cat.name} value={cat}>
|
|
215
|
-
* {cat.settings?.map(setting => (
|
|
216
|
-
* <TreeListItem key={setting.key} id={setting.key} value={setting} />
|
|
217
|
-
* ))}
|
|
218
|
-
* </TreeListItem>
|
|
219
|
-
* ))}
|
|
220
|
-
* </TreeListView>
|
|
221
|
-
* ```
|
|
222
|
-
*
|
|
223
|
-
* @internal
|
|
224
|
-
*/
|
|
225
|
-
export function TreeListView(props) {
|
|
226
|
-
return createElement("TreeListView", props);
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Element type for items in a TreeListView.
|
|
230
|
-
*
|
|
231
|
-
* Nesting TreeListItem components defines the tree hierarchy.
|
|
232
|
-
*
|
|
233
|
-
* @example
|
|
234
|
-
* ```tsx
|
|
235
|
-
* <TreeListView renderItem={(item) => <GtkLabel label={item.name} />}>
|
|
236
|
-
* <TreeListItem id="parent" value={{ name: "Parent" }}>
|
|
237
|
-
* <TreeListItem id="child1" value={{ name: "Child 1" }} />
|
|
238
|
-
* <TreeListItem id="child2" value={{ name: "Child 2" }} />
|
|
239
|
-
* </TreeListItem>
|
|
240
|
-
* </TreeListView>
|
|
241
|
-
* ```
|
|
242
|
-
*/
|
|
243
|
-
export const TreeListItem = "TreeListItem";
|
|
244
|
-
/**
|
|
245
|
-
* Element type for simple string-based list items.
|
|
246
|
-
*
|
|
247
|
-
* Use when list items only need string values without complex data.
|
|
248
|
-
*
|
|
249
|
-
* @example
|
|
250
|
-
* ```tsx
|
|
251
18
|
* <GtkDropDown>
|
|
252
|
-
* <SimpleListItem id="opt1" value="Option 1" />
|
|
253
|
-
* <SimpleListItem id="opt2" value="Option 2" />
|
|
19
|
+
* <x.SimpleListItem id="opt1" value="Option 1" />
|
|
20
|
+
* <x.SimpleListItem id="opt2" value="Option 2" />
|
|
254
21
|
* </GtkDropDown>
|
|
255
22
|
* ```
|
|
256
23
|
*/
|
|
257
|
-
export const
|
|
258
|
-
/**
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
24
|
+
export const x = {
|
|
25
|
+
/**
|
|
26
|
+
* Type-safe slot component for placing children in named widget slots.
|
|
27
|
+
*
|
|
28
|
+
* GTK widgets often have named slots for specific child positions (e.g., titleWidget,
|
|
29
|
+
* startWidget). This component provides type-safe access to those slots.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <GtkHeaderBar>
|
|
34
|
+
* <x.Slot for={GtkHeaderBar} id="titleWidget">
|
|
35
|
+
* <GtkLabel label="App Title" />
|
|
36
|
+
* </x.Slot>
|
|
37
|
+
* </GtkHeaderBar>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
Slot(props) {
|
|
41
|
+
return createElement("Slot", { id: props.id }, props.children);
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Element type for pages within a GtkStack or AdwViewStack.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <GtkStack page="page1">
|
|
49
|
+
* <x.StackPage id="page1" title="First Page">
|
|
50
|
+
* <GtkLabel label="Content 1" />
|
|
51
|
+
* </x.StackPage>
|
|
52
|
+
* </GtkStack>
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
StackPage: "StackPage",
|
|
56
|
+
/**
|
|
57
|
+
* Element type for positioning children within a GtkGrid.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <GtkGrid>
|
|
62
|
+
* <x.GridChild column={0} row={0}>
|
|
63
|
+
* <GtkLabel label="Top Left" />
|
|
64
|
+
* </x.GridChild>
|
|
65
|
+
* </GtkGrid>
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
GridChild: "GridChild",
|
|
69
|
+
/**
|
|
70
|
+
* Element type for positioning children within a GtkFixed.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```tsx
|
|
74
|
+
* <GtkFixed>
|
|
75
|
+
* <x.FixedChild x={20} y={30}>
|
|
76
|
+
* <GtkLabel label="Positioned at (20, 30)" />
|
|
77
|
+
* </x.FixedChild>
|
|
78
|
+
* </GtkFixed>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
FixedChild: "FixedChild",
|
|
82
|
+
/**
|
|
83
|
+
* Element type for a page within a GtkNotebook (tabbed interface).
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```tsx
|
|
87
|
+
* <GtkNotebook>
|
|
88
|
+
* <x.NotebookPage label="Tab 1">
|
|
89
|
+
* <GtkLabel label="Content 1" />
|
|
90
|
+
* </x.NotebookPage>
|
|
91
|
+
* </GtkNotebook>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
NotebookPage: "NotebookPage",
|
|
95
|
+
/**
|
|
96
|
+
* Element type for a custom widget as the page tab label.
|
|
97
|
+
*/
|
|
98
|
+
NotebookPageTab: "NotebookPageTab",
|
|
99
|
+
/**
|
|
100
|
+
* Element type for items in a ListView or GridView.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```tsx
|
|
104
|
+
* <x.ListView renderItem={(item) => <GtkLabel label={item.name} />}>
|
|
105
|
+
* <x.ListItem id="1" value={{ name: "Item 1" }} />
|
|
106
|
+
* </x.ListView>
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
ListItem: "ListItem",
|
|
110
|
+
/**
|
|
111
|
+
* Element type for items in a TreeListView.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <x.TreeListView renderItem={(item) => <GtkLabel label={item.name} />}>
|
|
116
|
+
* <x.TreeListItem id="parent" value={{ name: "Parent" }}>
|
|
117
|
+
* <x.TreeListItem id="child" value={{ name: "Child" }} />
|
|
118
|
+
* </x.TreeListItem>
|
|
119
|
+
* </x.TreeListView>
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
TreeListItem: "TreeListItem",
|
|
123
|
+
/**
|
|
124
|
+
* Element type for simple string-based list items.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* <GtkDropDown>
|
|
129
|
+
* <x.SimpleListItem id="opt1" value="Option 1" />
|
|
130
|
+
* </GtkDropDown>
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
SimpleListItem: "SimpleListItem",
|
|
134
|
+
/**
|
|
135
|
+
* Component for defining columns in a ColumnView (table widget).
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```tsx
|
|
139
|
+
* <GtkColumnView>
|
|
140
|
+
* <x.ColumnViewColumn
|
|
141
|
+
* id="name"
|
|
142
|
+
* title="Name"
|
|
143
|
+
* expand
|
|
144
|
+
* renderCell={(item) => <GtkLabel label={item?.name ?? ""} />}
|
|
145
|
+
* />
|
|
146
|
+
* </GtkColumnView>
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
ColumnViewColumn(props) {
|
|
150
|
+
return createElement("ColumnViewColumn", props);
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Virtualized list component with custom item rendering.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```tsx
|
|
157
|
+
* <x.ListView renderItem={(item) => <GtkLabel label={item?.name ?? ""} />}>
|
|
158
|
+
* <x.ListItem id="1" value={{ name: "Apple" }} />
|
|
159
|
+
* </x.ListView>
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
ListView(props) {
|
|
163
|
+
return createElement("GtkListView", props);
|
|
164
|
+
},
|
|
165
|
+
/**
|
|
166
|
+
* Virtualized grid component with custom item rendering.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```tsx
|
|
170
|
+
* <x.GridView renderItem={(item) => <GtkImage iconName={item?.icon ?? ""} />}>
|
|
171
|
+
* <x.ListItem id="1" value={{ icon: "folder" }} />
|
|
172
|
+
* </x.GridView>
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
GridView(props) {
|
|
176
|
+
return createElement("GtkGridView", props);
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* Tree list component with hierarchical data and expand/collapse support.
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```tsx
|
|
183
|
+
* <x.TreeListView renderItem={(item, row) => <GtkLabel label={item.name} />}>
|
|
184
|
+
* <x.TreeListItem id="root" value={{ name: "Root" }}>
|
|
185
|
+
* <x.TreeListItem id="child" value={{ name: "Child" }} />
|
|
186
|
+
* </x.TreeListItem>
|
|
187
|
+
* </x.TreeListView>
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
TreeListView(props) {
|
|
191
|
+
return createElement("TreeListView", props);
|
|
192
|
+
},
|
|
193
|
+
/**
|
|
194
|
+
* Place child as a prefix (left side) of AdwActionRow, AdwEntryRow, or AdwExpanderRow.
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* ```tsx
|
|
198
|
+
* <AdwActionRow title="Setting">
|
|
199
|
+
* <x.ActionRowPrefix>
|
|
200
|
+
* <GtkCheckButton />
|
|
201
|
+
* </x.ActionRowPrefix>
|
|
202
|
+
* </AdwActionRow>
|
|
203
|
+
* ```
|
|
204
|
+
*/
|
|
205
|
+
ActionRowPrefix: "ActionRowPrefix",
|
|
206
|
+
/**
|
|
207
|
+
* Place child as a suffix (right side) of AdwActionRow, AdwEntryRow, or AdwExpanderRow.
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```tsx
|
|
211
|
+
* <AdwActionRow title="Setting">
|
|
212
|
+
* <x.ActionRowSuffix>
|
|
213
|
+
* <GtkButton iconName="go-next-symbolic" />
|
|
214
|
+
* </x.ActionRowSuffix>
|
|
215
|
+
* </AdwActionRow>
|
|
216
|
+
* ```
|
|
217
|
+
*/
|
|
218
|
+
ActionRowSuffix: "ActionRowSuffix",
|
|
219
|
+
/**
|
|
220
|
+
* Place child at the start (left in LTR) of HeaderBar or ActionBar.
|
|
221
|
+
*
|
|
222
|
+
* @example
|
|
223
|
+
* ```tsx
|
|
224
|
+
* <GtkHeaderBar>
|
|
225
|
+
* <x.PackStart>
|
|
226
|
+
* <GtkButton label="Back" />
|
|
227
|
+
* </x.PackStart>
|
|
228
|
+
* </GtkHeaderBar>
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
PackStart: "PackStart",
|
|
232
|
+
/**
|
|
233
|
+
* Place child at the end (right in LTR) of HeaderBar or ActionBar.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```tsx
|
|
237
|
+
* <GtkHeaderBar>
|
|
238
|
+
* <x.PackEnd>
|
|
239
|
+
* <GtkMenuButton />
|
|
240
|
+
* </x.PackEnd>
|
|
241
|
+
* </GtkHeaderBar>
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
PackEnd: "PackEnd",
|
|
245
|
+
/**
|
|
246
|
+
* Place toolbar at the top of AdwToolbarView.
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```tsx
|
|
250
|
+
* <AdwToolbarView>
|
|
251
|
+
* <x.ToolbarTop>
|
|
252
|
+
* <AdwHeaderBar />
|
|
253
|
+
* </x.ToolbarTop>
|
|
254
|
+
* </AdwToolbarView>
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
ToolbarTop: "ToolbarTop",
|
|
258
|
+
/**
|
|
259
|
+
* Place toolbar at the bottom of AdwToolbarView.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```tsx
|
|
263
|
+
* <AdwToolbarView>
|
|
264
|
+
* <x.ToolbarBottom>
|
|
265
|
+
* <GtkActionBar />
|
|
266
|
+
* </x.ToolbarBottom>
|
|
267
|
+
* </AdwToolbarView>
|
|
268
|
+
* ```
|
|
269
|
+
*/
|
|
270
|
+
ToolbarBottom: "ToolbarBottom",
|
|
271
|
+
/**
|
|
272
|
+
* Element type for overlay children positioned above the main content.
|
|
273
|
+
*
|
|
274
|
+
* @example
|
|
275
|
+
* ```tsx
|
|
276
|
+
* <GtkOverlay>
|
|
277
|
+
* <GtkImage file="background.png" />
|
|
278
|
+
* <x.OverlayChild>
|
|
279
|
+
* <GtkLabel label="Overlaid text" />
|
|
280
|
+
* </x.OverlayChild>
|
|
281
|
+
* </GtkOverlay>
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
OverlayChild: "OverlayChild",
|
|
285
|
+
/**
|
|
286
|
+
* A clickable menu item with action.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```tsx
|
|
290
|
+
* <GtkMenuButton>
|
|
291
|
+
* <x.MenuItem id="open" label="Open" onActivate={handleOpen} />
|
|
292
|
+
* </GtkMenuButton>
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
MenuItem: "MenuItem",
|
|
296
|
+
/**
|
|
297
|
+
* A section grouping related menu items.
|
|
298
|
+
*
|
|
299
|
+
* @example
|
|
300
|
+
* ```tsx
|
|
301
|
+
* <GtkMenuButton>
|
|
302
|
+
* <x.MenuSection label="File">
|
|
303
|
+
* <x.MenuItem id="open" label="Open" onActivate={handleOpen} />
|
|
304
|
+
* </x.MenuSection>
|
|
305
|
+
* </GtkMenuButton>
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
MenuSection: "MenuSection",
|
|
309
|
+
/**
|
|
310
|
+
* A submenu containing nested items.
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* ```tsx
|
|
314
|
+
* <GtkMenuButton>
|
|
315
|
+
* <x.MenuSubmenu label="Export">
|
|
316
|
+
* <x.MenuItem id="pdf" label="As PDF" onActivate={exportPdf} />
|
|
317
|
+
* </x.MenuSubmenu>
|
|
318
|
+
* </GtkMenuButton>
|
|
319
|
+
* ```
|
|
320
|
+
*/
|
|
321
|
+
MenuSubmenu: "MenuSubmenu",
|
|
322
|
+
/**
|
|
323
|
+
* A mark to display on a GtkScale slider.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```tsx
|
|
327
|
+
* <GtkScale>
|
|
328
|
+
* <x.ScaleMark value={0} label="Min" />
|
|
329
|
+
* <x.ScaleMark value={50} />
|
|
330
|
+
* <x.ScaleMark value={100} label="Max" />
|
|
331
|
+
* </GtkScale>
|
|
332
|
+
* ```
|
|
333
|
+
*/
|
|
334
|
+
ScaleMark: "ScaleMark",
|
|
335
|
+
/**
|
|
336
|
+
* A day mark on a GtkCalendar.
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* ```tsx
|
|
340
|
+
* <GtkCalendar>
|
|
341
|
+
* <x.CalendarMark day={15} />
|
|
342
|
+
* <x.CalendarMark day={20} />
|
|
343
|
+
* <x.CalendarMark day={25} />
|
|
344
|
+
* </GtkCalendar>
|
|
345
|
+
* ```
|
|
346
|
+
*/
|
|
347
|
+
CalendarMark: "CalendarMark",
|
|
348
|
+
/**
|
|
349
|
+
* An offset threshold for a GtkLevelBar.
|
|
350
|
+
*
|
|
351
|
+
* @example
|
|
352
|
+
* ```tsx
|
|
353
|
+
* <GtkLevelBar>
|
|
354
|
+
* <x.LevelBarOffset id="low" value={0.25} />
|
|
355
|
+
* <x.LevelBarOffset id="high" value={0.75} />
|
|
356
|
+
* <x.LevelBarOffset id="full" value={1.0} />
|
|
357
|
+
* </GtkLevelBar>
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
LevelBarOffset: "LevelBarOffset",
|
|
361
|
+
/**
|
|
362
|
+
* A toggle button for an AdwToggleGroup.
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```tsx
|
|
366
|
+
* <AdwToggleGroup>
|
|
367
|
+
* <x.Toggle id="list" iconName="view-list-symbolic" />
|
|
368
|
+
* <x.Toggle id="grid" iconName="view-grid-symbolic" />
|
|
369
|
+
* </AdwToggleGroup>
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
Toggle: "Toggle",
|
|
373
|
+
/**
|
|
374
|
+
* Nested rows container for AdwExpanderRow.
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* ```tsx
|
|
378
|
+
* <AdwExpanderRow title="Settings">
|
|
379
|
+
* <ExpanderRow.Row>
|
|
380
|
+
* <AdwActionRow title="Option 1" />
|
|
381
|
+
* <AdwActionRow title="Option 2" />
|
|
382
|
+
* </ExpanderRow.Row>
|
|
383
|
+
* </AdwExpanderRow>
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
ExpanderRowRow: "ExpanderRowRow",
|
|
387
|
+
/**
|
|
388
|
+
* Action widget container for AdwExpanderRow header.
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```tsx
|
|
392
|
+
* <AdwExpanderRow title="Group">
|
|
393
|
+
* <ExpanderRow.Action>
|
|
394
|
+
* <GtkButton iconName="emblem-system-symbolic" />
|
|
395
|
+
* </ExpanderRow.Action>
|
|
396
|
+
* </AdwExpanderRow>
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
ExpanderRowAction: "ExpanderRowAction",
|
|
400
|
+
/**
|
|
401
|
+
* A page within an AdwNavigationView.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```tsx
|
|
405
|
+
* <AdwNavigationView history={["home"]}>
|
|
406
|
+
* <x.NavigationPage id="home" title="Home">
|
|
407
|
+
* <GtkLabel label="Welcome!" />
|
|
408
|
+
* </x.NavigationPage>
|
|
409
|
+
* <x.NavigationPage id="settings" title="Settings">
|
|
410
|
+
* <GtkLabel label="Settings page" />
|
|
411
|
+
* </x.NavigationPage>
|
|
412
|
+
* </AdwNavigationView>
|
|
413
|
+
* ```
|
|
414
|
+
*/
|
|
415
|
+
NavigationPage: "NavigationPage",
|
|
368
416
|
};
|
|
369
417
|
export * from "./generated/jsx.js";
|