@gtkx/components 0.21.0 → 1.0.0-rc.2
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 +373 -0
- package/README.md +173 -0
- package/dist/adw/index.d.ts +3 -0
- package/dist/adw/index.d.ts.map +1 -0
- package/dist/adw/index.js +2 -0
- package/dist/adw/index.js.map +1 -0
- package/dist/adw/toast.d.ts +10 -0
- package/dist/adw/toast.d.ts.map +1 -0
- package/dist/adw/toast.js +51 -0
- package/dist/adw/toast.js.map +1 -0
- package/dist/adw/types.d.ts +28 -0
- package/dist/adw/types.d.ts.map +1 -0
- package/dist/adw/types.js +2 -0
- package/dist/adw/types.js.map +1 -0
- package/dist/column-view.d.ts +6 -14
- package/dist/column-view.d.ts.map +1 -1
- package/dist/column-view.js +98 -100
- package/dist/column-view.js.map +1 -1
- package/dist/drop-down.d.ts +8 -37
- package/dist/drop-down.d.ts.map +1 -1
- package/dist/drop-down.js +109 -118
- package/dist/drop-down.js.map +1 -1
- package/dist/grid-view.d.ts +4 -11
- package/dist/grid-view.d.ts.map +1 -1
- package/dist/grid-view.js +25 -19
- package/dist/grid-view.js.map +1 -1
- package/dist/index.d.ts +6 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -14
- package/dist/index.js.map +1 -1
- package/dist/internal/cells.d.ts +50 -0
- package/dist/internal/cells.d.ts.map +1 -0
- package/dist/internal/cells.js +185 -0
- package/dist/internal/cells.js.map +1 -0
- package/dist/internal/collection-index.d.ts +21 -0
- package/dist/internal/collection-index.d.ts.map +1 -0
- package/dist/internal/collection-index.js +106 -0
- package/dist/internal/collection-index.js.map +1 -0
- package/dist/internal/collection-model.d.ts +12 -0
- package/dist/internal/collection-model.d.ts.map +1 -0
- package/dist/internal/collection-model.js +164 -0
- package/dist/internal/collection-model.js.map +1 -0
- package/dist/internal/collection.d.ts +18 -0
- package/dist/internal/collection.d.ts.map +1 -0
- package/dist/internal/collection.js +64 -0
- package/dist/internal/collection.js.map +1 -0
- package/dist/internal/expansion.d.ts +9 -0
- package/dist/internal/expansion.d.ts.map +1 -0
- package/dist/internal/expansion.js +75 -0
- package/dist/internal/expansion.js.map +1 -0
- package/dist/internal/selection.d.ts +12 -0
- package/dist/internal/selection.d.ts.map +1 -0
- package/dist/internal/selection.js +99 -0
- package/dist/internal/selection.js.map +1 -0
- package/dist/internal/use-collection.d.ts +18 -0
- package/dist/internal/use-collection.d.ts.map +1 -0
- package/dist/internal/use-collection.js +42 -0
- package/dist/internal/use-collection.js.map +1 -0
- package/dist/internal/use-widget-ref.d.ts +4 -0
- package/dist/internal/use-widget-ref.d.ts.map +1 -0
- package/dist/internal/use-widget-ref.js +8 -0
- package/dist/internal/use-widget-ref.js.map +1 -0
- package/dist/list-view.d.ts +4 -11
- package/dist/list-view.d.ts.map +1 -1
- package/dist/list-view.js +32 -28
- package/dist/list-view.js.map +1 -1
- package/dist/size-group.d.ts +12 -0
- package/dist/size-group.d.ts.map +1 -0
- package/dist/size-group.js +41 -0
- package/dist/size-group.js.map +1 -0
- package/dist/types.d.ts +104 -161
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +62 -52
- package/src/adw/index.ts +2 -0
- package/src/adw/toast.tsx +74 -0
- package/src/adw/types.ts +32 -0
- package/src/column-view.tsx +184 -184
- package/src/drop-down.tsx +173 -227
- package/src/grid-view.tsx +29 -65
- package/src/index.ts +16 -25
- package/src/internal/cells.tsx +345 -0
- package/src/internal/collection-index.ts +168 -0
- package/src/internal/collection-model.ts +246 -0
- package/src/internal/collection.ts +104 -0
- package/src/internal/expansion.ts +123 -0
- package/src/internal/selection.tsx +159 -0
- package/src/internal/use-collection.tsx +70 -0
- package/src/internal/use-widget-ref.ts +11 -0
- package/src/list-view.tsx +45 -78
- package/src/size-group.tsx +77 -0
- package/src/types.ts +171 -191
- package/dist/collection-view.d.ts +0 -30
- package/dist/collection-view.d.ts.map +0 -1
- package/dist/collection-view.js +0 -52
- package/dist/collection-view.js.map +0 -1
- package/dist/column-view-column.d.ts +0 -17
- package/dist/column-view-column.d.ts.map +0 -1
- package/dist/column-view-column.js +0 -51
- package/dist/column-view-column.js.map +0 -1
- package/dist/constraint-layout-apply.d.ts +0 -6
- package/dist/constraint-layout-apply.d.ts.map +0 -1
- package/dist/constraint-layout-apply.js +0 -107
- package/dist/constraint-layout-apply.js.map +0 -1
- package/dist/constraint-layout.d.ts +0 -13
- package/dist/constraint-layout.d.ts.map +0 -1
- package/dist/constraint-layout.js +0 -85
- package/dist/constraint-layout.js.map +0 -1
- package/dist/contexts/column-view-context.d.ts +0 -17
- package/dist/contexts/column-view-context.d.ts.map +0 -1
- package/dist/contexts/column-view-context.js +0 -10
- package/dist/contexts/column-view-context.js.map +0 -1
- package/dist/hooks/use-drop-down-selection.d.ts +0 -15
- package/dist/hooks/use-drop-down-selection.d.ts.map +0 -1
- package/dist/hooks/use-drop-down-selection.js +0 -35
- package/dist/hooks/use-drop-down-selection.js.map +0 -1
- package/dist/hooks/use-header-menu.d.ts +0 -4
- package/dist/hooks/use-header-menu.d.ts.map +0 -1
- package/dist/hooks/use-header-menu.js +0 -32
- package/dist/hooks/use-header-menu.js.map +0 -1
- package/dist/hooks/use-list-model.d.ts +0 -20
- package/dist/hooks/use-list-model.d.ts.map +0 -1
- package/dist/hooks/use-list-model.js +0 -70
- package/dist/hooks/use-list-model.js.map +0 -1
- package/dist/hooks/use-model-installation.d.ts +0 -9
- package/dist/hooks/use-model-installation.d.ts.map +0 -1
- package/dist/hooks/use-model-installation.js +0 -20
- package/dist/hooks/use-model-installation.js.map +0 -1
- package/dist/hooks/use-realized-slots.d.ts +0 -20
- package/dist/hooks/use-realized-slots.d.ts.map +0 -1
- package/dist/hooks/use-realized-slots.js +0 -66
- package/dist/hooks/use-realized-slots.js.map +0 -1
- package/dist/hooks/use-selection-model.d.ts +0 -12
- package/dist/hooks/use-selection-model.d.ts.map +0 -1
- package/dist/hooks/use-selection-model.js +0 -111
- package/dist/hooks/use-selection-model.js.map +0 -1
- package/dist/hooks/use-sort-handler.d.ts +0 -12
- package/dist/hooks/use-sort-handler.d.ts.map +0 -1
- package/dist/hooks/use-sort-handler.js +0 -87
- package/dist/hooks/use-sort-handler.js.map +0 -1
- package/dist/list-portal-host.d.ts +0 -11
- package/dist/list-portal-host.d.ts.map +0 -1
- package/dist/list-portal-host.js +0 -8
- package/dist/list-portal-host.js.map +0 -1
- package/dist/list-slot.d.ts +0 -14
- package/dist/list-slot.d.ts.map +0 -1
- package/dist/list-slot.js +0 -29
- package/dist/list-slot.js.map +0 -1
- package/dist/menu-items.d.ts +0 -5
- package/dist/menu-items.d.ts.map +0 -1
- package/dist/menu-items.js +0 -48
- package/dist/menu-items.js.map +0 -1
- package/dist/menu.d.ts +0 -18
- package/dist/menu.d.ts.map +0 -1
- package/dist/menu.js +0 -26
- package/dist/menu.js.map +0 -1
- package/dist/utils/item-resolver.d.ts +0 -28
- package/dist/utils/item-resolver.d.ts.map +0 -1
- package/dist/utils/item-resolver.js +0 -111
- package/dist/utils/item-resolver.js.map +0 -1
- package/dist/utils/list-item-flatten.d.ts +0 -32
- package/dist/utils/list-item-flatten.d.ts.map +0 -1
- package/dist/utils/list-item-flatten.js +0 -88
- package/dist/utils/list-item-flatten.js.map +0 -1
- package/dist/utils/position-only-model.d.ts +0 -10
- package/dist/utils/position-only-model.d.ts.map +0 -1
- package/dist/utils/position-only-model.js +0 -83
- package/dist/utils/position-only-model.js.map +0 -1
- package/dist/utils/realized-slot-store.d.ts +0 -30
- package/dist/utils/realized-slot-store.d.ts.map +0 -1
- package/dist/utils/realized-slot-store.js +0 -103
- package/dist/utils/realized-slot-store.js.map +0 -1
- package/src/collection-view.tsx +0 -125
- package/src/column-view-column.tsx +0 -73
- package/src/constraint-layout-apply.ts +0 -121
- package/src/constraint-layout.tsx +0 -130
- package/src/contexts/column-view-context.ts +0 -28
- package/src/hooks/use-drop-down-selection.ts +0 -53
- package/src/hooks/use-header-menu.ts +0 -33
- package/src/hooks/use-list-model.ts +0 -145
- package/src/hooks/use-model-installation.ts +0 -25
- package/src/hooks/use-realized-slots.ts +0 -93
- package/src/hooks/use-selection-model.ts +0 -121
- package/src/hooks/use-sort-handler.ts +0 -102
- package/src/list-portal-host.tsx +0 -27
- package/src/list-slot.tsx +0 -56
- package/src/menu-items.ts +0 -48
- package/src/menu.tsx +0 -34
- package/src/utils/item-resolver.ts +0 -143
- package/src/utils/list-item-flatten.ts +0 -113
- package/src/utils/position-only-model.ts +0 -115
- package/src/utils/realized-slot-store.ts +0 -126
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/adw/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD;;;GAGG;AACH,KAAK,YAAY,GAAG,GAAG,CAAC,qBAAqB,GAAG,IAAI,CAAC,aAAa,EAAE,iBAAiB,GAAG,aAAa,CAAC,CAAC;AAEvG,+EAA+E;AAC/E,KAAK,eAAe,GAAG;IACnB,oEAAoE;IACpE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,KAAK,GAAG,CAAC,KAAK,CAAC;IAC5C,wFAAwF;IACxF,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,2FAA2F;AAC3F,KAAK,sBAAsB,GAAG;IAC1B,sDAAsD;IACtD,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AAEF,uCAAuC;AACvC,KAAK,kBAAkB,GAAG;IACtB,sEAAsE;IACtE,UAAU,EAAE,SAAS,CAAC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC/C,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACpC,CAAC;AAEF,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,eAAe,EAAE,KAAK,sBAAsB,EAAE,KAAK,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/adw/types.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAiG,CAAC","sourcesContent":["import type * as Adw from \"@gtkx/gi/adw\";\nimport type { AdwToastProps } from \"@gtkx/jsx/adw\";\nimport type { ReactNode, RefObject } from \"react\";\n\n/**\n * Describes a toast raised through {@link useToast}: the construct-time properties of an\n * `Adw.Toast` plus its `button-clicked` and `dismissed` handlers.\n */\ntype ToastOptions = Adw.ToastConstructorProps & Pick<AdwToastProps, \"onButtonClicked\" | \"onDismissed\">;\n\n/** Imperative controls for individual toasts, returned by {@link useToast}. */\ntype ToastController = {\n /** Builds a toast, shows it through the overlay, and returns it. */\n show: (options?: ToastOptions) => Adw.Toast;\n /** Dismisses a single toast, typically one returned by {@link ToastController.show}. */\n dismiss: (toast: Adw.Toast) => void;\n};\n\n/** Imperative controls for the overlay as a whole, returned by {@link useToastOverlay}. */\ntype ToastOverlayController = {\n /** Dismisses the shown toast and every queued one. */\n dismissAll: () => void;\n};\n\n/** Props for {@link ToastProvider}. */\ntype ToastProviderProps = {\n /** Ref also given to the `AdwToastOverlay` the toasts appear over. */\n overlayRef: RefObject<Adw.ToastOverlay | null>;\n children?: ReactNode | undefined;\n};\n\nexport { type ToastOptions, type ToastController, type ToastOverlayController, type ToastProviderProps };\n"]}
|
package/dist/column-view.d.ts
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import type { ReactNode } from "react";
|
|
3
2
|
import type { ColumnViewProps } from "./types.js";
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* as {@link ColumnViewColumn} children.
|
|
4
|
+
* Renders a Gtk.ColumnView from declarative items or sections and a columns array,
|
|
5
|
+
* with controlled selection, expansion, and sorting, per-column header menus, and
|
|
6
|
+
* section header rendering.
|
|
9
7
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* A `GtkColumnView` driven by a declarative `items` model with optional
|
|
13
|
-
* controlled selection, controlled sorting, and section headers. Columns are
|
|
14
|
-
* declared as {@link ColumnViewColumn} children. Supplying an external `model`
|
|
15
|
-
* switches to the uncontrolled form.
|
|
16
|
-
*/
|
|
17
|
-
export declare const ColumnView: <T = unknown, S = unknown>(props: ColumnViewComponentProps<T, S>) => ReactNode;
|
|
8
|
+
declare function ColumnView<T = unknown, S = unknown>(props: ColumnViewProps<T, S>): ReactNode;
|
|
9
|
+
export { ColumnView };
|
|
18
10
|
//# sourceMappingURL=column-view.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-view.d.ts","sourceRoot":"","sources":["../src/column-view.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"column-view.d.ts","sourceRoot":"","sources":["../src/column-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,YAAY,CAAC;AAiK1D;;;;GAIG;AACH,iBAAS,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,SAAS,CA6BrF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/column-view.js
CHANGED
|
@@ -1,108 +1,106 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
import * as Gtk from "@gtkx/gi/gtk";
|
|
3
|
+
import { GtkColumnView, GtkColumnViewColumn, GtkCustomSorter, GtkSignalListItemFactory } from "@gtkx/jsx/gtk";
|
|
4
|
+
import { useProperty, useSignal } from "@gtkx/react";
|
|
5
|
+
import { omit } from "@gtkx/utils";
|
|
6
|
+
import { useLayoutEffect, useRef } from "react";
|
|
7
|
+
import { HeaderPortals, ItemPortals, useHeaderCells, useItemCells } from "./internal/cells.js";
|
|
8
|
+
import { useCollection } from "./internal/use-collection.js";
|
|
9
|
+
import { useWidgetRef } from "./internal/use-widget-ref.js";
|
|
10
|
+
const COLUMN_VIEW_PROPS = [
|
|
11
|
+
"items",
|
|
12
|
+
"sections",
|
|
13
|
+
"renderHeader",
|
|
14
|
+
"columns",
|
|
15
|
+
"selectedIds",
|
|
16
|
+
"onSelectionChanged",
|
|
17
|
+
"selectionMode",
|
|
18
|
+
"expandedIds",
|
|
19
|
+
"onExpandedChange",
|
|
20
|
+
"sortColumn",
|
|
21
|
+
"sortOrder",
|
|
22
|
+
"onSortChanged",
|
|
23
|
+
"estimatedItemHeight",
|
|
24
|
+
"children",
|
|
25
|
+
"ref",
|
|
26
|
+
];
|
|
27
|
+
const columnById = (view, id) => {
|
|
28
|
+
const columns = view.getColumns();
|
|
29
|
+
for (let index = 0; index < columns.getNItems(); index++) {
|
|
30
|
+
const column = columns.getItem(index);
|
|
31
|
+
if (column instanceof Gtk.ColumnViewColumn && column.getId() === id) {
|
|
32
|
+
return column;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
15
36
|
};
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const unregister = useCallback((id) => {
|
|
26
|
-
setRegistrations((current) => {
|
|
27
|
-
if (!current.has(id))
|
|
28
|
-
return current;
|
|
29
|
-
const next = new Map(current);
|
|
30
|
-
next.delete(id);
|
|
31
|
-
return next;
|
|
32
|
-
});
|
|
33
|
-
}, []);
|
|
34
|
-
const columns = useMemo(() => [...registrations.values()], [registrations]);
|
|
35
|
-
return { columns, register, unregister };
|
|
37
|
+
const getSortTarget = (view, sortColumn) => {
|
|
38
|
+
if (view === null || sortColumn === undefined) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (sortColumn === null) {
|
|
42
|
+
return { view, column: null };
|
|
43
|
+
}
|
|
44
|
+
const column = columnById(view, sortColumn);
|
|
45
|
+
return column === null ? null : { view, column };
|
|
36
46
|
};
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
onSortChanged: props.onSortChanged,
|
|
66
|
-
columns: registry.columns,
|
|
47
|
+
const applySort = (sorting, view, column, order) => {
|
|
48
|
+
sorting.current = true;
|
|
49
|
+
try {
|
|
50
|
+
view.sortByColumn(column, order ?? Gtk.SortType.ASCENDING);
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
sorting.current = false;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const emitSortChanged = (sorter, sorting, sort) => {
|
|
57
|
+
if (sorter === null || sorting.current) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
sort.onSortChanged?.(sorter.getPrimarySortColumn()?.getId() ?? null, sorter.getPrimarySortOrder());
|
|
61
|
+
};
|
|
62
|
+
const syncSort = (sorting, view, sortColumn, sortOrder) => {
|
|
63
|
+
const target = getSortTarget(view, sortColumn);
|
|
64
|
+
if (target === null) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
applySort(sorting, target.view, target.column, sortOrder);
|
|
68
|
+
};
|
|
69
|
+
const useColumnSorting = (view, sort, columns) => {
|
|
70
|
+
const sorting = useRef(false);
|
|
71
|
+
const sorter = useProperty(view, "sorter");
|
|
72
|
+
const columnSorter = sorter instanceof Gtk.ColumnViewSorter ? sorter : null;
|
|
73
|
+
useSignal(columnSorter, "changed", () => {
|
|
74
|
+
emitSortChanged(columnSorter, sorting, sort);
|
|
67
75
|
});
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
headerResolver: listModel.headerResolver,
|
|
78
|
-
headerStore: headers.store,
|
|
79
|
-
useHeader,
|
|
80
|
-
contextValue,
|
|
81
|
-
};
|
|
76
|
+
const { sortColumn, sortOrder } = sort;
|
|
77
|
+
useLayoutEffect(() => {
|
|
78
|
+
syncSort(sorting, view, sortColumn, sortOrder);
|
|
79
|
+
}, [view, sortColumn, sortOrder, columns]);
|
|
80
|
+
};
|
|
81
|
+
const ColumnCells = ({ column, collection, expandedIds, size }) => {
|
|
82
|
+
const cells = useItemCells(size);
|
|
83
|
+
const rest = omit(column, ["id", "renderCell", "sortable"]);
|
|
84
|
+
return (_jsxs(_Fragment, { children: [_jsx(GtkColumnViewColumn, { id: column.id, factory: _jsx(GtkSignalListItemFactory, { ...cells.handlers }), sorter: column.sortable === true ? _jsx(GtkCustomSorter, {}) : null, ...rest }), _jsx(ItemPortals, { store: cells, render: column.renderCell, collection: collection, expandedIds: expandedIds })] }));
|
|
82
85
|
};
|
|
86
|
+
const ColumnList = ({ columns, collection, expandedIds, size }) => columns.map((column) => (_jsx(ColumnCells, { column: column, collection: collection, expandedIds: expandedIds, size: size }, column.id)));
|
|
83
87
|
/**
|
|
84
|
-
*
|
|
85
|
-
* controlled selection,
|
|
86
|
-
*
|
|
87
|
-
* switches to the uncontrolled form.
|
|
88
|
+
* Renders a Gtk.ColumnView from declarative items or sections and a columns array,
|
|
89
|
+
* with controlled selection, expansion, and sorting, per-column header menus, and
|
|
90
|
+
* section header rendering.
|
|
88
91
|
*/
|
|
89
|
-
|
|
90
|
-
const {
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
estimatedRowHeight,
|
|
104
|
-
}, registry);
|
|
105
|
-
const intrinsic = createElement(GtkColumnView, { ...intrinsicProps, ref: wiring.setRef }, _jsx(ColumnViewContext.Provider, { value: wiring.contextValue, children: children }));
|
|
106
|
-
return (_jsxs(_Fragment, { children: [intrinsic, wiring.useHeader ? (_jsx(ListPortalHost, { store: wiring.headerStore, resolver: wiring.headerResolver, render: headerRenderer(renderHeader) })) : null] }));
|
|
107
|
-
};
|
|
92
|
+
function ColumnView(props) {
|
|
93
|
+
const { renderHeader, columns, expandedIds, sortColumn, sortOrder, onSortChanged, estimatedItemHeight, ref } = props;
|
|
94
|
+
const rest = omit(props, COLUMN_VIEW_PROPS);
|
|
95
|
+
const [view, refCallback] = useWidgetRef(ref);
|
|
96
|
+
const size = { width: -1, height: estimatedItemHeight ?? -1 };
|
|
97
|
+
const { collection, selection } = useCollection(props);
|
|
98
|
+
const headerCells = useHeaderCells(size);
|
|
99
|
+
const columnList = columns;
|
|
100
|
+
useColumnSorting(view, { sortColumn, sortOrder, onSortChanged }, columnList);
|
|
101
|
+
return (_jsxs(_Fragment, { children: [_jsx(GtkColumnView, { ref: refCallback, model: selection, ...(renderHeader != null && {
|
|
102
|
+
headerFactory: _jsx(GtkSignalListItemFactory, { ...headerCells.handlers }),
|
|
103
|
+
}), ...rest, children: _jsx(ColumnList, { columns: columnList, collection: collection, expandedIds: expandedIds, size: size }) }), renderHeader != null && (_jsx(HeaderPortals, { store: headerCells, render: renderHeader, collection: collection }))] }));
|
|
104
|
+
}
|
|
105
|
+
export { ColumnView };
|
|
108
106
|
//# sourceMappingURL=column-view.js.map
|
package/dist/column-view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-view.js","sourceRoot":"","sources":["../src/column-view.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAA2B,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,aAAa,EAA4B,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxG,OAAO,EAEH,iBAAiB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAuB,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD,MAAM,oBAAoB,GAAmC;IACzD,OAAO,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC;IAC9D,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC;CACvD,CAAC;AAQF,MAAM,iBAAiB,GAAG,GAAmB,EAAE;IAC3C,MAAM,CAAC,aAAa,EAAE,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AE,UAAU,GAAI,CACtF,IACF,CACN,CAAC;AACN,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport * as Gtk from \"@gtkx/gi/gtk\";\nimport { GtkColumnView, GtkColumnViewColumn, GtkCustomSorter, GtkSignalListItemFactory } from \"@gtkx/jsx/gtk\";\nimport { useProperty, useSignal } from \"@gtkx/react\";\nimport { omit } from \"@gtkx/utils\";\nimport { useLayoutEffect, useRef } from \"react\";\nimport type { CellSize } from \"./internal/cells.js\";\nimport type { Collection } from \"./internal/collection.js\";\nimport type { Column, ColumnViewProps } from \"./types.js\";\nimport { HeaderPortals, ItemPortals, useHeaderCells, useItemCells } from \"./internal/cells.js\";\nimport { useCollection } from \"./internal/use-collection.js\";\nimport { useWidgetRef } from \"./internal/use-widget-ref.js\";\n\ntype SortProps = {\n sortColumn?: string | null | undefined;\n sortOrder?: Gtk.SortType | null | undefined;\n onSortChanged?: ((column: string | null, order: Gtk.SortType) => void) | null | undefined;\n};\n\ntype SortTarget = { view: Gtk.ColumnView; column: Gtk.ColumnViewColumn | null };\n\ntype ColumnCellsProps = {\n column: Column<never>;\n collection: Collection;\n expandedIds: string[] | null | undefined;\n size: CellSize;\n};\n\ntype ColumnListProps = Omit<ColumnCellsProps, \"column\"> & {\n columns: Column<never>[];\n};\n\nconst COLUMN_VIEW_PROPS = [\n \"items\",\n \"sections\",\n \"renderHeader\",\n \"columns\",\n \"selectedIds\",\n \"onSelectionChanged\",\n \"selectionMode\",\n \"expandedIds\",\n \"onExpandedChange\",\n \"sortColumn\",\n \"sortOrder\",\n \"onSortChanged\",\n \"estimatedItemHeight\",\n \"children\",\n \"ref\",\n] as const satisfies (keyof ColumnViewProps)[];\n\nconst columnById = (view: Gtk.ColumnView, id: string): Gtk.ColumnViewColumn | null => {\n const columns = view.getColumns();\n\n for (let index = 0; index < columns.getNItems(); index++) {\n const column = columns.getItem(index);\n\n if (column instanceof Gtk.ColumnViewColumn && column.getId() === id) {\n return column;\n }\n }\n\n return null;\n};\n\nconst getSortTarget = (view: Gtk.ColumnView | null, sortColumn: string | null | undefined): SortTarget | null => {\n if (view === null || sortColumn === undefined) {\n return null;\n }\n\n if (sortColumn === null) {\n return { view, column: null };\n }\n\n const column = columnById(view, sortColumn);\n\n return column === null ? null : { view, column };\n};\n\nconst applySort = (\n sorting: { current: boolean },\n view: Gtk.ColumnView,\n column: Gtk.ColumnViewColumn | null,\n order: Gtk.SortType | null | undefined,\n): void => {\n sorting.current = true;\n\n try {\n view.sortByColumn(column, order ?? Gtk.SortType.ASCENDING);\n } finally {\n sorting.current = false;\n }\n};\n\nconst emitSortChanged = (\n sorter: Gtk.ColumnViewSorter | null,\n sorting: { current: boolean },\n sort: SortProps,\n): void => {\n if (sorter === null || sorting.current) {\n return;\n }\n\n sort.onSortChanged?.(sorter.getPrimarySortColumn()?.getId() ?? null, sorter.getPrimarySortOrder());\n};\n\nconst syncSort = (\n sorting: { current: boolean },\n view: Gtk.ColumnView | null,\n sortColumn: string | null | undefined,\n sortOrder: Gtk.SortType | null | undefined,\n): void => {\n const target = getSortTarget(view, sortColumn);\n\n if (target === null) {\n return;\n }\n\n applySort(sorting, target.view, target.column, sortOrder);\n};\n\nconst useColumnSorting = (view: Gtk.ColumnView | null, sort: SortProps, columns: Column<never>[]): void => {\n const sorting = useRef(false);\n const sorter = useProperty(view, \"sorter\");\n const columnSorter = sorter instanceof Gtk.ColumnViewSorter ? sorter : null;\n\n useSignal(columnSorter, \"changed\", (): void => {\n emitSortChanged(columnSorter, sorting, sort);\n });\n\n const { sortColumn, sortOrder } = sort;\n\n useLayoutEffect(() => {\n syncSort(sorting, view, sortColumn, sortOrder);\n }, [view, sortColumn, sortOrder, columns]);\n};\n\nconst ColumnCells = ({ column, collection, expandedIds, size }: ColumnCellsProps): ReactNode => {\n const cells = useItemCells(size);\n const rest = omit(column, [\"id\", \"renderCell\", \"sortable\"]);\n\n return (\n <>\n <GtkColumnViewColumn\n id={column.id}\n factory={<GtkSignalListItemFactory {...cells.handlers} />}\n sorter={column.sortable === true ? <GtkCustomSorter /> : null}\n {...rest}\n />\n <ItemPortals\n store={cells}\n render={column.renderCell}\n collection={collection}\n expandedIds={expandedIds}\n />\n </>\n );\n};\n\nconst ColumnList = ({ columns, collection, expandedIds, size }: ColumnListProps): ReactNode =>\n columns.map((column) => (\n <ColumnCells\n key={column.id}\n column={column}\n collection={collection}\n expandedIds={expandedIds}\n size={size}\n />\n ));\n\n/**\n * Renders a Gtk.ColumnView from declarative items or sections and a columns array,\n * with controlled selection, expansion, and sorting, per-column header menus, and\n * section header rendering.\n */\nfunction ColumnView<T = unknown, S = unknown>(props: ColumnViewProps<T, S>): ReactNode {\n const { renderHeader, columns, expandedIds, sortColumn, sortOrder, onSortChanged, estimatedItemHeight, ref } =\n props;\n\n const rest = omit(props, COLUMN_VIEW_PROPS);\n const [view, refCallback] = useWidgetRef<Gtk.ColumnView>(ref);\n const size = { width: -1, height: estimatedItemHeight ?? -1 };\n const { collection, selection } = useCollection(props);\n const headerCells = useHeaderCells(size);\n const columnList = columns as Column<never>[];\n useColumnSorting(view, { sortColumn, sortOrder, onSortChanged }, columnList);\n\n return (\n <>\n <GtkColumnView\n ref={refCallback}\n model={selection}\n {...(renderHeader != null && {\n headerFactory: <GtkSignalListItemFactory {...headerCells.handlers} />,\n })}\n {...rest}\n >\n <ColumnList columns={columnList} collection={collection} expandedIds={expandedIds} size={size} />\n </GtkColumnView>\n {renderHeader != null && (\n <HeaderPortals store={headerCells} render={renderHeader} collection={collection} />\n )}\n </>\n );\n}\n\nexport { ColumnView };\n"]}
|
package/dist/drop-down.d.ts
CHANGED
|
@@ -1,41 +1,12 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import
|
|
3
|
-
import { type AdwComboRowProps } from "@gtkx/jsx/adw";
|
|
4
|
-
import { type GtkDropDownProps } from "@gtkx/jsx/gtk";
|
|
5
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import type { ElementType, ReactNode } from "react";
|
|
2
|
+
import { GtkDropDown } from "@gtkx/jsx/gtk";
|
|
6
3
|
import type { DropDownProps } from "./types.js";
|
|
7
|
-
|
|
8
|
-
getSelected(): number;
|
|
9
|
-
setSelected(position: number): void;
|
|
10
|
-
setModel(model: Gio.ListModel | null): void;
|
|
11
|
-
setFactory(factory: Gtk.ListItemFactory | null): void;
|
|
12
|
-
setListFactory(factory: Gtk.ListItemFactory | null): void;
|
|
13
|
-
setHeaderFactory(factory: Gtk.ListItemFactory | null): void;
|
|
14
|
-
}
|
|
4
|
+
type DropDownComponent = <T = unknown, S = unknown, C extends ElementType = typeof GtkDropDown>(props: DropDownProps<T, S, C>) => ReactNode;
|
|
15
5
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
6
|
+
* Renders a drop-down backed by a collection model, with customizable renderers for the
|
|
7
|
+
* collapsed display, popup rows, and popup section headers, and controlled selection.
|
|
8
|
+
* The backing widget defaults to GtkDropDown and is swappable through `component`.
|
|
19
9
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
* Props for the {@link ComboRow} component: the raw `AdwComboRow` element
|
|
23
|
-
* surface with its factory/model wiring replaced by the declarative
|
|
24
|
-
* {@link DropDownProps} API.
|
|
25
|
-
*/
|
|
26
|
-
export type ComboRowComponentProps<T = unknown, S = unknown> = Omit<AdwComboRowProps, keyof DropDownProps<T, S>> & DropDownProps<T, S>;
|
|
27
|
-
/**
|
|
28
|
-
* A `GtkDropDown` driven by a declarative `items` model with a controlled
|
|
29
|
-
* `selectedId` and per-slot renderers for the selected face, the popup list,
|
|
30
|
-
* and section headers. Supplying an external `model` switches to the
|
|
31
|
-
* uncontrolled form.
|
|
32
|
-
*/
|
|
33
|
-
export declare const DropDown: <T = unknown, S = unknown>(props: DropDownComponentProps<T, S>) => ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* An `AdwComboRow` driven by a declarative `items` model with a controlled
|
|
36
|
-
* `selectedId` and per-slot renderers for the selected face, the popup list,
|
|
37
|
-
* and section headers. Supplying an external `model` switches to the
|
|
38
|
-
* uncontrolled form.
|
|
39
|
-
*/
|
|
40
|
-
export declare const ComboRow: <T = unknown, S = unknown>(props: ComboRowComponentProps<T, S>) => ReactNode;
|
|
10
|
+
declare const DropDown: DropDownComponent;
|
|
11
|
+
export { DropDown };
|
|
41
12
|
//# sourceMappingURL=drop-down.d.ts.map
|
package/dist/drop-down.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drop-down.d.ts","sourceRoot":"","sources":["../src/drop-down.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"drop-down.d.ts","sourceRoot":"","sources":["../src/drop-down.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,WAAW,EAAsC,MAAM,eAAe,CAAC;AAKhF,OAAO,KAAK,EAAE,aAAa,EAAgC,MAAM,YAAY,CAAC;AAwB9E,KAAK,iBAAiB,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,SAAS,WAAW,GAAG,OAAO,WAAW,EAC1F,KAAK,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC5B,SAAS,CAAC;AAcf;;;;GAIG;AACH,QAAA,MAAM,QAAQ,EAAE,iBAAqD,CAAC;AAwJtE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/drop-down.js
CHANGED
|
@@ -1,129 +1,120 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
import { GtkDropDown, GtkLabel, GtkSignalListItemFactory } from "@gtkx/jsx/gtk";
|
|
3
|
+
import { useSignal } from "@gtkx/react";
|
|
4
|
+
import { omit } from "@gtkx/utils";
|
|
5
|
+
import { useEffectEvent, useLayoutEffect, useRef } from "react";
|
|
6
|
+
import { HeaderPortals, ItemPortals, useHeaderCells, useItemCells } from "./internal/cells.js";
|
|
7
|
+
import { useCollectionData } from "./internal/use-collection.js";
|
|
8
|
+
import { useWidgetRef } from "./internal/use-widget-ref.js";
|
|
9
|
+
const DROP_DOWN_PROPS = [
|
|
10
|
+
"component",
|
|
11
|
+
"items",
|
|
12
|
+
"sections",
|
|
13
|
+
"selectedId",
|
|
14
|
+
"onSelectionChanged",
|
|
15
|
+
"renderItem",
|
|
16
|
+
"renderListItem",
|
|
17
|
+
"renderHeader",
|
|
18
|
+
"ref",
|
|
19
|
+
];
|
|
20
|
+
/**
|
|
21
|
+
* Renders a drop-down backed by a collection model, with customizable renderers for the
|
|
22
|
+
* collapsed display, popup rows, and popup section headers, and controlled selection.
|
|
23
|
+
* The backing widget defaults to GtkDropDown and is swappable through `component`.
|
|
24
|
+
*/
|
|
25
|
+
const DropDown = DropDownImpl;
|
|
26
|
+
const describeValue = (value) => {
|
|
27
|
+
if (typeof value === "string") {
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
return JSON.stringify(value);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return String(value);
|
|
35
|
+
}
|
|
18
36
|
};
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
const defaultItemContent = (value) => value == null ? null : _jsx(GtkLabel, { children: describeValue(value) });
|
|
38
|
+
const defaultRenderItem = ({ item }) => defaultItemContent(item);
|
|
39
|
+
const faceRenderer = (props) => props.renderItem ?? defaultRenderItem;
|
|
40
|
+
const listRenderer = (props) => props.renderListItem ?? props.renderItem ?? defaultRenderItem;
|
|
41
|
+
const resolvePosition = (widget, collection, selectedId) => {
|
|
42
|
+
const requested = selectedId == null ? -1 : collection.positionFor(selectedId);
|
|
43
|
+
return requested >= 0 ? requested : widget.getSelected();
|
|
22
44
|
};
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
45
|
+
const updateKnownSelection = (tracker, effectiveId, selectedId) => {
|
|
46
|
+
const { known, onSelectionChanged } = tracker;
|
|
47
|
+
const expectedId = selectedId ?? known.current;
|
|
48
|
+
const isNew = effectiveId !== known.current;
|
|
49
|
+
known.current = effectiveId;
|
|
50
|
+
if (expectedId !== null && effectiveId !== expectedId && isNew) {
|
|
51
|
+
onSelectionChanged?.(effectiveId);
|
|
52
|
+
}
|
|
27
53
|
};
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
54
|
+
const reportKnownSelection = (tracker, id) => {
|
|
55
|
+
const { known, onSelectionChanged } = tracker;
|
|
56
|
+
if (id === null || id === known.current) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
known.current = id;
|
|
60
|
+
onSelectionChanged?.(id);
|
|
32
61
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
62
|
+
const reportSelectedNotify = (options, tracker, applying) => {
|
|
63
|
+
const { widget, collection } = options;
|
|
64
|
+
if (widget === null || applying.current) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
reportKnownSelection(tracker, collection.idAt(widget.getSelected()));
|
|
37
68
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
69
|
+
const applySelectedPosition = (widget, position, applying) => {
|
|
70
|
+
applying.current = true;
|
|
71
|
+
try {
|
|
72
|
+
widget.selected = position;
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
applying.current = false;
|
|
76
|
+
}
|
|
42
77
|
};
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, []);
|
|
56
|
-
const [, setRef] = useForwardedRef(props.ref, captureWidget);
|
|
57
|
-
const externalModel = props.model;
|
|
58
|
-
const listModel = useListModel(externalModel === undefined ? { items: props.items ?? undefined } : { model: externalModel });
|
|
59
|
-
const useHeader = externalModel === undefined && typeof props.renderHeader === "function";
|
|
60
|
-
const face = useRealizedSlots({ target: widgetRef, binding: itemFactoryBinding });
|
|
61
|
-
const popup = useRealizedSlots({ target: widgetRef, binding: listFactoryBinding });
|
|
62
|
-
const header = useRealizedSlots({
|
|
63
|
-
target: useHeader ? widgetRef : null,
|
|
64
|
-
binding: headerFactoryBinding,
|
|
78
|
+
const useDropDownSelection = (options) => {
|
|
79
|
+
const { widget, collection, applying } = options;
|
|
80
|
+
const { selectedId } = options.props;
|
|
81
|
+
const known = useRef(null);
|
|
82
|
+
const syncKnownSelection = useEffectEvent((position) => {
|
|
83
|
+
const effectiveId = collection.idAt(position);
|
|
84
|
+
if (effectiveId === null) {
|
|
85
|
+
known.current = null;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const { onSelectionChanged } = options.props;
|
|
89
|
+
updateKnownSelection({ known, onSelectionChanged }, effectiveId, selectedId);
|
|
65
90
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
91
|
+
useLayoutEffect(() => {
|
|
92
|
+
if (widget === null) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const position = resolvePosition(widget, collection, selectedId);
|
|
96
|
+
applySelectedPosition(widget, position, applying);
|
|
97
|
+
syncKnownSelection(position);
|
|
98
|
+
}, [widget, collection, selectedId, applying]);
|
|
99
|
+
useSignal(widget, "notify::selected", () => {
|
|
100
|
+
reportSelectedNotify(options, { known, onSelectionChanged: options.props.onSelectionChanged }, applying);
|
|
72
101
|
});
|
|
73
|
-
const controlledPosition = props.selectedId === undefined || props.selectedId === null
|
|
74
|
-
? -1
|
|
75
|
-
: listModel.resolver.positionOf(props.selectedId);
|
|
76
|
-
const facePosition = controlledPosition >= 0 ? controlledPosition : selectedPosition < 0 ? 0 : selectedPosition;
|
|
77
|
-
return {
|
|
78
|
-
setRef,
|
|
79
|
-
resolver: listModel.resolver,
|
|
80
|
-
faceResolver: createFaceResolver(listModel.resolver, facePosition),
|
|
81
|
-
headerResolver: listModel.headerResolver,
|
|
82
|
-
faceStore: face.store,
|
|
83
|
-
popupStore: popup.store,
|
|
84
|
-
headerStore: header.store,
|
|
85
|
-
useHeader,
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
const DropDownImpl = (props) => {
|
|
89
|
-
const { setRef, resolver, faceResolver, headerResolver, faceStore, popupStore, headerStore, useHeader } = useDropDownWiring(props);
|
|
90
|
-
const intrinsic = createElement(props.element, { ...props.intrinsicProps, ref: setRef });
|
|
91
|
-
return (_jsxs(_Fragment, { children: [intrinsic, _jsx(ListPortalHost, { store: faceStore, resolver: faceResolver, render: toItemRenderer(props.renderItem) }), _jsx(ListPortalHost, { store: popupStore, resolver: resolver, render: toPopupRenderer(props.renderListItem, props.renderItem) }), useHeader ? (_jsx(ListPortalHost, { store: headerStore, resolver: headerResolver, render: toHeaderRenderer(props.renderHeader) })) : null] }));
|
|
92
|
-
};
|
|
93
|
-
const extractDropDownProps = (props) => {
|
|
94
|
-
const { ref, items, model, renderItem, renderListItem, renderHeader, selectedId, onSelectionChanged, ...intrinsicProps } = props;
|
|
95
|
-
return {
|
|
96
|
-
impl: {
|
|
97
|
-
ref,
|
|
98
|
-
items: items,
|
|
99
|
-
model: model,
|
|
100
|
-
renderItem: renderItem,
|
|
101
|
-
renderListItem: renderListItem,
|
|
102
|
-
renderHeader: renderHeader,
|
|
103
|
-
selectedId: selectedId,
|
|
104
|
-
onSelectionChanged: onSelectionChanged,
|
|
105
|
-
},
|
|
106
|
-
intrinsicProps: intrinsicProps,
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* A `GtkDropDown` driven by a declarative `items` model with a controlled
|
|
111
|
-
* `selectedId` and per-slot renderers for the selected face, the popup list,
|
|
112
|
-
* and section headers. Supplying an external `model` switches to the
|
|
113
|
-
* uncontrolled form.
|
|
114
|
-
*/
|
|
115
|
-
export const DropDown = (props) => {
|
|
116
|
-
const { impl, intrinsicProps } = extractDropDownProps(props);
|
|
117
|
-
return _jsx(DropDownImpl, { element: GtkDropDown, intrinsicProps: intrinsicProps, ...impl });
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* An `AdwComboRow` driven by a declarative `items` model with a controlled
|
|
121
|
-
* `selectedId` and per-slot renderers for the selected face, the popup list,
|
|
122
|
-
* and section headers. Supplying an external `model` switches to the
|
|
123
|
-
* uncontrolled form.
|
|
124
|
-
*/
|
|
125
|
-
export const ComboRow = (props) => {
|
|
126
|
-
const { impl, intrinsicProps } = extractDropDownProps(props);
|
|
127
|
-
return _jsx(DropDownImpl, { element: AdwComboRow, intrinsicProps: intrinsicProps, ...impl });
|
|
128
102
|
};
|
|
103
|
+
function DropDownImpl(props) {
|
|
104
|
+
const { component, items, sections, renderListItem, renderHeader, ref } = props;
|
|
105
|
+
const rest = omit(props, DROP_DOWN_PROPS);
|
|
106
|
+
const [widget, refCallback] = useWidgetRef(ref);
|
|
107
|
+
const applying = useRef(false);
|
|
108
|
+
const collection = useCollectionData({ items, sections, applying });
|
|
109
|
+
const faceCells = useItemCells({ width: -1, height: -1 });
|
|
110
|
+
const listCells = useItemCells({ width: -1, height: -1 });
|
|
111
|
+
const headerCells = useHeaderCells({ width: -1, height: -1 });
|
|
112
|
+
useDropDownSelection({ widget, collection, applying, props });
|
|
113
|
+
const Component = component ?? GtkDropDown;
|
|
114
|
+
const hasHeader = typeof renderHeader === "function";
|
|
115
|
+
return (_jsxs(_Fragment, { children: [_jsx(Component, { ref: refCallback, model: collection.model, factory: _jsx(GtkSignalListItemFactory, { ...faceCells.handlers }), ...(renderListItem != null && {
|
|
116
|
+
listFactory: _jsx(GtkSignalListItemFactory, { ...listCells.handlers }),
|
|
117
|
+
}), ...(hasHeader && { headerFactory: _jsx(GtkSignalListItemFactory, { ...headerCells.handlers }) }), ...rest }), _jsx(ItemPortals, { store: faceCells, render: faceRenderer(props), collection: collection }), renderListItem != null && (_jsx(ItemPortals, { store: listCells, render: listRenderer(props), collection: collection })), hasHeader && _jsx(HeaderPortals, { store: headerCells, render: renderHeader, collection: collection })] }));
|
|
118
|
+
}
|
|
119
|
+
export { DropDown };
|
|
129
120
|
//# sourceMappingURL=drop-down.js.map
|