@passui/tanstack 0.2.4 → 0.2.6
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 +3 -42
- package/dist/types/src/auth-shell/auth-shell.d.ts +5 -0
- package/dist/types/src/document/compose-viewport.d.ts +20 -0
- package/dist/types/src/form-fields/fields.d.ts +24 -0
- package/dist/types/src/form-fields/index.d.ts +2 -0
- package/dist/types/src/form-fields/selection.d.ts +21 -0
- package/dist/types/src/form-fields/submit.d.ts +3 -0
- package/dist/types/src/forms/contexts.d.ts +1 -0
- package/dist/types/src/forms/elements/form-alert.d.ts +6 -0
- package/dist/types/src/forms/elements/submit.d.ts +1 -0
- package/dist/types/src/forms/fields/avatar-picker.d.ts +30 -0
- package/dist/types/src/forms/fields/avatar.d.ts +30 -0
- package/dist/types/src/forms/fields/checkbox.d.ts +1 -0
- package/dist/types/src/forms/fields/index.d.ts +21 -0
- package/dist/types/src/forms/fields/input.d.ts +1 -0
- package/dist/types/src/forms/fields/multiselect.d.ts +1 -0
- package/dist/types/src/forms/fields/otp.d.ts +1 -0
- package/dist/types/src/forms/fields/radio-card.d.ts +1 -0
- package/dist/types/src/forms/fields/switch.d.ts +1 -0
- package/dist/types/src/forms/fields/textarea.d.ts +1 -0
- package/dist/types/src/forms/index.d.ts +41 -0
- package/dist/types/src/mutation/index.d.ts +1 -0
- package/dist/types/src/mutation/use-app-mutation.d.ts +22 -0
- package/dist/types/src/route-boundary/default-boundary.d.ts +2 -0
- package/dist/types/src/route-boundary/default-loader.d.ts +6 -0
- package/dist/types/src/route-boundary/index.d.ts +3 -0
- package/dist/types/src/route-boundary/not-founder.d.ts +4 -0
- package/dist/types/src/settings/setting-list.d.ts +51 -0
- package/dist/types/src/shared/index.d.ts +2 -0
- package/dist/types/src/shared/optimistic.d.ts +3 -0
- package/dist/types/src/shared/table.d.ts +11 -0
- package/dist/types/src/{solid/tables → tables}/columns.d.ts +1 -2
- package/dist/types/src/tables/data-table.d.ts +76 -0
- package/dist/types/src/tables/filter-row.d.ts +9 -0
- package/dist/types/src/{solid/tables → tables}/index.d.ts +0 -1
- package/dist/types/src/tables/pagination.d.ts +8 -0
- package/dist/types/src/tables/utils.d.ts +1 -0
- package/package.json +8 -93
- package/src/document/compose-viewport.tsx +4 -20
- package/src/form-fields/fields.tsx +17 -62
- package/src/form-fields/selection.tsx +12 -52
- package/src/form-fields/submit.tsx +1 -6
- package/src/forms/contexts.ts +2 -6
- package/src/forms/elements/form-alert.tsx +2 -11
- package/src/forms/fields/avatar-picker.tsx +39 -119
- package/src/forms/fields/avatar.tsx +13 -43
- package/src/forms/fields/index.ts +1 -4
- package/src/forms/index.ts +1 -5
- package/src/mutation/use-app-mutation.ts +32 -88
- package/src/route-boundary/default-boundary.tsx +4 -19
- package/src/route-boundary/default-loader.tsx +14 -10
- package/src/route-boundary/not-founder.tsx +3 -14
- package/src/settings/setting-list.tsx +10 -41
- package/src/shared/optimistic.ts +15 -3
- package/src/shared/table.ts +6 -24
- package/src/tables/columns.tsx +4 -13
- package/src/tables/data-table.tsx +130 -225
- package/src/tables/filter-row.tsx +19 -83
- package/src/tables/pagination.tsx +4 -12
- package/dist/client/chunks/form-fields-DlWu70u5.js +0 -630
- package/dist/client/src/solid/auth-shell/index.js +0 -15
- package/dist/client/src/solid/document/index.js +0 -51
- package/dist/client/src/solid/form-fields/index.js +0 -1
- package/dist/client/src/solid/forms/index.js +0 -33
- package/dist/client/src/solid/mutation/index.js +0 -46
- package/dist/client/src/solid/route-boundary/index.js +0 -73
- package/dist/client/src/solid/settings/index.js +0 -173
- package/dist/client/src/solid/tables/index.js +0 -500
- package/dist/server/src/solid/auth-shell/index.js +0 -15
- package/dist/server/src/solid/document/index.js +0 -55
- package/dist/server/src/solid/form-fields/index.js +0 -598
- package/dist/server/src/solid/forms/index.js +0 -33
- package/dist/server/src/solid/mutation/index.js +0 -46
- package/dist/server/src/solid/route-boundary/index.js +0 -73
- package/dist/server/src/solid/settings/index.js +0 -169
- package/dist/server/src/solid/tables/index.js +0 -480
- package/dist/types/src/solid/auth-shell/auth-shell.d.ts +0 -4
- package/dist/types/src/solid/document/compose-viewport.d.ts +0 -14
- package/dist/types/src/solid/form-fields/avatar.d.ts +0 -26
- package/dist/types/src/solid/form-fields/fields.d.ts +0 -45
- package/dist/types/src/solid/form-fields/index.d.ts +0 -3
- package/dist/types/src/solid/form-fields/submit.d.ts +0 -3
- package/dist/types/src/solid/forms/contexts.d.ts +0 -1
- package/dist/types/src/solid/forms/form-alert.d.ts +0 -6
- package/dist/types/src/solid/forms/index.d.ts +0 -43
- package/dist/types/src/solid/mutation/index.d.ts +0 -1
- package/dist/types/src/solid/mutation/use-app-mutation.d.ts +0 -22
- package/dist/types/src/solid/route-boundary/boundaries.d.ts +0 -8
- package/dist/types/src/solid/route-boundary/index.d.ts +0 -1
- package/dist/types/src/solid/settings/setting-list.d.ts +0 -37
- package/dist/types/src/solid/tables/data-table.d.ts +0 -58
- package/dist/types/src/solid/tables/filter-row.d.ts +0 -9
- package/dist/types/src/solid/tables/pagination.d.ts +0 -7
- package/src/solid/auth-shell/auth-shell.tsx +0 -16
- package/src/solid/auth-shell/index.ts +0 -1
- package/src/solid/document/compose-viewport.tsx +0 -69
- package/src/solid/document/index.ts +0 -1
- package/src/solid/form-fields/avatar.tsx +0 -370
- package/src/solid/form-fields/fields.tsx +0 -336
- package/src/solid/form-fields/index.ts +0 -3
- package/src/solid/form-fields/submit.tsx +0 -31
- package/src/solid/forms/contexts.ts +0 -7
- package/src/solid/forms/form-alert.tsx +0 -19
- package/src/solid/forms/index.ts +0 -32
- package/src/solid/mutation/index.ts +0 -5
- package/src/solid/mutation/use-app-mutation.ts +0 -171
- package/src/solid/route-boundary/boundaries.tsx +0 -104
- package/src/solid/route-boundary/index.ts +0 -1
- package/src/solid/settings/index.ts +0 -1
- package/src/solid/settings/setting-list.tsx +0 -185
- package/src/solid/styles.css +0 -2
- package/src/solid/tables/columns.tsx +0 -40
- package/src/solid/tables/data-table.tsx +0 -448
- package/src/solid/tables/filter-row.tsx +0 -161
- package/src/solid/tables/index.ts +0 -4
- package/src/solid/tables/pagination.tsx +0 -78
- /package/dist/types/src/{solid/auth-shell → auth-shell}/index.d.ts +0 -0
- /package/dist/types/src/{solid/document → document}/index.d.ts +0 -0
- /package/dist/types/src/{solid/settings → settings}/index.d.ts +0 -0
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey } from "solid-js/web";
|
|
2
|
-
import { For, Show, createEffect, createMemo, createSignal, onCleanup } from "solid-js";
|
|
3
|
-
import { Toggle } from "@passui/solid/toggle";
|
|
4
|
-
import { Button, Picker, SearchField, Toggle as Toggle$1 } from "@passui/solid";
|
|
5
|
-
import { FlexRender, columnFilteringFeature, columnVisibilityFeature, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, createTable, filterFn_arrIncludes, filterFn_arrIncludesSome, filterFn_equals, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, globalFilteringFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_datetime, sortFn_text, tableFeatures } from "@tanstack/solid-table";
|
|
6
|
-
import { Table, TableBody, TableCell, TableFooter, TableHead, TableHeader, TableRow } from "@passui/solid/table";
|
|
7
|
-
//#region src/solid/tables/pagination.tsx
|
|
8
|
-
var _tmpl$$2 = [
|
|
9
|
-
"<div",
|
|
10
|
-
" class=\"flex flex-wrap items-center gap-2\"><p class=\"text-footnote text-label-secondary\">Page <!--$-->",
|
|
11
|
-
"<!--/--> of <!--$-->",
|
|
12
|
-
"<!--/--></p><!--$-->",
|
|
13
|
-
"<!--/--><!--$-->",
|
|
14
|
-
"<!--/--><!--$-->",
|
|
15
|
-
"<!--/--><!--$-->",
|
|
16
|
-
"<!--/--><!--$-->",
|
|
17
|
-
"<!--/--></div>"
|
|
18
|
-
];
|
|
19
|
-
function DataTablePagination(props) {
|
|
20
|
-
return ssr(_tmpl$$2, ssrHydrationKey(), props.table.getPageCount() ? escape(props.table.atoms.pagination.get()?.pageIndex ?? 0) + 1 : 0, escape(props.table.getPageCount()), escape(createComponent(Button, {
|
|
21
|
-
size: "sm",
|
|
22
|
-
variant: "ghost",
|
|
23
|
-
get disabled() {
|
|
24
|
-
return !props.table.getCanPreviousPage();
|
|
25
|
-
},
|
|
26
|
-
onClick: () => props.table.setPageIndex(0),
|
|
27
|
-
children: "First"
|
|
28
|
-
})), escape(createComponent(Button, {
|
|
29
|
-
size: "sm",
|
|
30
|
-
variant: "ghost",
|
|
31
|
-
get disabled() {
|
|
32
|
-
return !props.table.getCanPreviousPage();
|
|
33
|
-
},
|
|
34
|
-
onClick: () => props.table.previousPage(),
|
|
35
|
-
children: "Previous"
|
|
36
|
-
})), escape(createComponent(Button, {
|
|
37
|
-
size: "sm",
|
|
38
|
-
variant: "ghost",
|
|
39
|
-
get disabled() {
|
|
40
|
-
return !props.table.getCanNextPage();
|
|
41
|
-
},
|
|
42
|
-
onClick: () => props.table.nextPage(),
|
|
43
|
-
children: "Next"
|
|
44
|
-
})), escape(createComponent(Button, {
|
|
45
|
-
size: "sm",
|
|
46
|
-
variant: "ghost",
|
|
47
|
-
get disabled() {
|
|
48
|
-
return !props.table.getCanNextPage();
|
|
49
|
-
},
|
|
50
|
-
onClick: () => props.table.setPageIndex(props.table.getPageCount() - 1),
|
|
51
|
-
children: "Last"
|
|
52
|
-
})), escape(createComponent(Picker, {
|
|
53
|
-
label: "Rows per page",
|
|
54
|
-
get value() {
|
|
55
|
-
return String(props.table.atoms.pagination.get()?.pageSize ?? 10);
|
|
56
|
-
},
|
|
57
|
-
onChange: (value) => props.table.setPageSize(Number(value)),
|
|
58
|
-
get options() {
|
|
59
|
-
return (props.pageSizeOptions ?? [
|
|
60
|
-
10,
|
|
61
|
-
20,
|
|
62
|
-
30,
|
|
63
|
-
50
|
|
64
|
-
]).map((size) => ({
|
|
65
|
-
value: String(size),
|
|
66
|
-
label: String(size)
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
})));
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/solid/tables/filter-row.tsx
|
|
73
|
-
/** @jsxImportSource solid-js */
|
|
74
|
-
var _tmpl$$1 = [
|
|
75
|
-
"<input",
|
|
76
|
-
" type=\"date\" aria-label=\"",
|
|
77
|
-
"\"",
|
|
78
|
-
">"
|
|
79
|
-
];
|
|
80
|
-
var _tmpl$2$1 = [
|
|
81
|
-
"<div",
|
|
82
|
-
" class=\"flex flex-wrap items-center gap-3\"><span class=\"text-footnote\">",
|
|
83
|
-
"</span><!--$-->",
|
|
84
|
-
"<!--/--><!--$-->",
|
|
85
|
-
"<!--/--></div>"
|
|
86
|
-
];
|
|
87
|
-
var _tmpl$3$1 = ["<input", " class=\"rounded-lg border border-separator px-3 py-2\">"];
|
|
88
|
-
function FilterRow(props) {
|
|
89
|
-
const values = createMemo(() => {
|
|
90
|
-
if (props.skip.includes(props.column.id)) return [];
|
|
91
|
-
const values = props.data.flatMap((row) => {
|
|
92
|
-
const value = row[props.column.id];
|
|
93
|
-
return props.isArrayColumn && Array.isArray(value) ? value : [value];
|
|
94
|
-
}).filter((value) => value !== null && value !== void 0 && value !== "" && typeof value !== "object");
|
|
95
|
-
const unique = [...new Set(values.map(String))];
|
|
96
|
-
return unique.length >= 2 && unique.length <= (props.isArrayColumn ? 20 : 12) ? unique : [];
|
|
97
|
-
});
|
|
98
|
-
const label = () => typeof props.column.columnDef.header === "string" ? props.column.columnDef.header : props.column.id;
|
|
99
|
-
const range = () => props.column.getFilterValue() ?? [];
|
|
100
|
-
return ssr(_tmpl$2$1, ssrHydrationKey(), escape(label()), escape(createComponent(Show, {
|
|
101
|
-
get when() {
|
|
102
|
-
return props.isDateColumn;
|
|
103
|
-
},
|
|
104
|
-
get fallback() {
|
|
105
|
-
return createComponent(Show, {
|
|
106
|
-
get when() {
|
|
107
|
-
return values().length;
|
|
108
|
-
},
|
|
109
|
-
get fallback() {
|
|
110
|
-
return ssr(_tmpl$3$1, ssrHydrationKey() + ssrAttribute("aria-label", escape(label(), true), false) + ssrAttribute("value", escape(String(props.column.getFilterValue() ?? ""), true), false));
|
|
111
|
-
},
|
|
112
|
-
get children() {
|
|
113
|
-
return createComponent(For, {
|
|
114
|
-
get each() {
|
|
115
|
-
return values();
|
|
116
|
-
},
|
|
117
|
-
children: (value) => createComponent(Toggle$1, {
|
|
118
|
-
style: "checkbox",
|
|
119
|
-
label: value,
|
|
120
|
-
get checked() {
|
|
121
|
-
return (props.column.getFilterValue() ?? []).includes(value);
|
|
122
|
-
},
|
|
123
|
-
onChange: (checked) => props.column.setFilterValue((previous) => {
|
|
124
|
-
const next = checked ? [...previous ?? [], value] : (previous ?? []).filter((item) => item !== value);
|
|
125
|
-
return next.length ? next : void 0;
|
|
126
|
-
})
|
|
127
|
-
})
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
get children() {
|
|
133
|
-
return [ssr(_tmpl$$1, ssrHydrationKey(), `${escape(label(), true)} from`, ssrAttribute("value", escape(range()[0] ?? "", true), false)), ssr(_tmpl$$1, ssrHydrationKey(), `${escape(label(), true)} to`, ssrAttribute("value", escape(range()[1] ?? "", true), false))];
|
|
134
|
-
}
|
|
135
|
-
})), escape(createComponent(Show, {
|
|
136
|
-
get when() {
|
|
137
|
-
return props.column.getFilterValue() !== void 0;
|
|
138
|
-
},
|
|
139
|
-
get children() {
|
|
140
|
-
return createComponent(Button, {
|
|
141
|
-
size: "sm",
|
|
142
|
-
variant: "ghost",
|
|
143
|
-
onClick: () => props.column.setFilterValue(void 0),
|
|
144
|
-
children: "Clear"
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
})));
|
|
148
|
-
}
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region src/solid/tables/data-table.tsx
|
|
151
|
-
/** @jsxImportSource solid-js */
|
|
152
|
-
var _tmpl$ = [
|
|
153
|
-
"<div",
|
|
154
|
-
" class=\"flex flex-wrap gap-3\">",
|
|
155
|
-
"</div>"
|
|
156
|
-
];
|
|
157
|
-
var _tmpl$2 = [
|
|
158
|
-
"<div",
|
|
159
|
-
" class=\"flex flex-col gap-3\">",
|
|
160
|
-
"</div>"
|
|
161
|
-
];
|
|
162
|
-
var _tmpl$3 = [
|
|
163
|
-
"<div",
|
|
164
|
-
" class=\"flex items-center gap-3 rounded-full bg-fill p-2\"><span><!--$-->",
|
|
165
|
-
"<!--/--> selected</span><!--$-->",
|
|
166
|
-
"<!--/--><!--$-->",
|
|
167
|
-
"<!--/--></div>"
|
|
168
|
-
];
|
|
169
|
-
var _tmpl$4 = [
|
|
170
|
-
"<div",
|
|
171
|
-
" class=\"flex w-full flex-col gap-4\"",
|
|
172
|
-
"><div class=\"flex flex-wrap items-center gap-2\"><!--$-->",
|
|
173
|
-
"<!--/--><!--$-->",
|
|
174
|
-
"<!--/--><!--$-->",
|
|
175
|
-
"<!--/--></div><!--$-->",
|
|
176
|
-
"<!--/--><!--$-->",
|
|
177
|
-
"<!--/--><!--$-->",
|
|
178
|
-
"<!--/--><!--$-->",
|
|
179
|
-
"<!--/--><!--$-->",
|
|
180
|
-
"<!--/--></div>"
|
|
181
|
-
];
|
|
182
|
-
var _tmpl$5 = [
|
|
183
|
-
"<button",
|
|
184
|
-
" type=\"button\" class=\"flex items-center gap-1\"><!--$-->",
|
|
185
|
-
"<!--/--><span aria-hidden=\"true\">",
|
|
186
|
-
"</span></button>"
|
|
187
|
-
];
|
|
188
|
-
var baseTableFeatures = tableFeatures({
|
|
189
|
-
globalFilteringFeature,
|
|
190
|
-
columnFilteringFeature,
|
|
191
|
-
rowSortingFeature,
|
|
192
|
-
rowPaginationFeature,
|
|
193
|
-
columnVisibilityFeature,
|
|
194
|
-
rowSelectionFeature,
|
|
195
|
-
filteredRowModel: createFilteredRowModel(),
|
|
196
|
-
sortedRowModel: createSortedRowModel(),
|
|
197
|
-
paginatedRowModel: createPaginatedRowModel(),
|
|
198
|
-
filterFns: {
|
|
199
|
-
includesString: filterFn_includesString,
|
|
200
|
-
inNumberRange: filterFn_inNumberRange,
|
|
201
|
-
equals: filterFn_equals,
|
|
202
|
-
arrIncludes: filterFn_arrIncludes,
|
|
203
|
-
arrIncludesSome: filterFn_arrIncludesSome,
|
|
204
|
-
inDateRange: filterFn_inDateRange
|
|
205
|
-
},
|
|
206
|
-
sortFns: {
|
|
207
|
-
text: sortFn_text,
|
|
208
|
-
alphanumeric: sortFn_alphanumeric,
|
|
209
|
-
datetime: sortFn_datetime
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
function DataTable(props) {
|
|
213
|
-
const [search, setSearch] = createSignal(""), [columnsOpen, setColumnsOpen] = createSignal(false), [filtersOpen, setFiltersOpen] = createSignal(false);
|
|
214
|
-
const columns = createMemo(() => props.columns.map((column) => column.filterFn || !("accessorKey" in column) ? column : {
|
|
215
|
-
...column,
|
|
216
|
-
filterFn: props.data.some((row) => Array.isArray(row[String(column.accessorKey)])) ? "arrIncludesSome" : column.meta?.filterVariant === "date" ? "inDateRange" : "includesString"
|
|
217
|
-
}));
|
|
218
|
-
const table = createTable({
|
|
219
|
-
features: baseTableFeatures,
|
|
220
|
-
get data() {
|
|
221
|
-
return props.data;
|
|
222
|
-
},
|
|
223
|
-
get columns() {
|
|
224
|
-
return columns();
|
|
225
|
-
},
|
|
226
|
-
getRowId: props.getRowId,
|
|
227
|
-
initialState: {
|
|
228
|
-
columnVisibility: props.initialColumnVisibility ?? {},
|
|
229
|
-
pagination: {
|
|
230
|
-
pageIndex: 0,
|
|
231
|
-
pageSize: props.pageSizeOptions?.[0] ?? 10
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
createEffect(() => {
|
|
236
|
-
const value = search();
|
|
237
|
-
const timer = setTimeout(() => table.setGlobalFilter(value), 200);
|
|
238
|
-
onCleanup(() => clearTimeout(timer));
|
|
239
|
-
});
|
|
240
|
-
const selected = () => table.getSelectedRowModel().rows.map((row) => row.original);
|
|
241
|
-
createEffect(() => {
|
|
242
|
-
const rows = selected();
|
|
243
|
-
props.onSelectedRowsChange?.(rows);
|
|
244
|
-
});
|
|
245
|
-
const clear = () => table.resetRowSelection();
|
|
246
|
-
const rows = () => props.pagination === false ? table.getPrePaginatedRowModel().rows : table.getRowModel().rows;
|
|
247
|
-
return ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("aria-busy", escape(props.isLoading, true), false), escape(createComponent(SearchField, {
|
|
248
|
-
get ["aria-label"]() {
|
|
249
|
-
return props.searchPlaceholder ?? "Search";
|
|
250
|
-
},
|
|
251
|
-
get placeholder() {
|
|
252
|
-
return props.searchPlaceholder ?? "Search…";
|
|
253
|
-
},
|
|
254
|
-
get value() {
|
|
255
|
-
return search();
|
|
256
|
-
},
|
|
257
|
-
onInput: (event) => setSearch(event.currentTarget.value)
|
|
258
|
-
})), escape(createComponent(Button, {
|
|
259
|
-
size: "sm",
|
|
260
|
-
variant: "secondary",
|
|
261
|
-
get ["aria-expanded"]() {
|
|
262
|
-
return columnsOpen();
|
|
263
|
-
},
|
|
264
|
-
onClick: () => setColumnsOpen((value) => !value),
|
|
265
|
-
children: "Columns"
|
|
266
|
-
})), escape(createComponent(Button, {
|
|
267
|
-
size: "sm",
|
|
268
|
-
variant: "secondary",
|
|
269
|
-
get ["aria-expanded"]() {
|
|
270
|
-
return filtersOpen();
|
|
271
|
-
},
|
|
272
|
-
onClick: () => setFiltersOpen((value) => !value),
|
|
273
|
-
children: "Filters"
|
|
274
|
-
})), escape(createComponent(Show, {
|
|
275
|
-
get when() {
|
|
276
|
-
return columnsOpen();
|
|
277
|
-
},
|
|
278
|
-
get children() {
|
|
279
|
-
return ssr(_tmpl$, ssrHydrationKey(), escape(createComponent(For, {
|
|
280
|
-
get each() {
|
|
281
|
-
return table.getAllLeafColumns().filter((column) => column.getCanHide());
|
|
282
|
-
},
|
|
283
|
-
children: (column) => createComponent(Toggle$1, {
|
|
284
|
-
style: "checkbox",
|
|
285
|
-
get label() {
|
|
286
|
-
return memo(() => typeof column.columnDef.header === "string")() ? column.columnDef.header : column.id;
|
|
287
|
-
},
|
|
288
|
-
get checked() {
|
|
289
|
-
return column.getIsVisible();
|
|
290
|
-
},
|
|
291
|
-
onChange: (visible) => column.toggleVisibility(visible)
|
|
292
|
-
})
|
|
293
|
-
})));
|
|
294
|
-
}
|
|
295
|
-
})), escape(createComponent(Show, {
|
|
296
|
-
get when() {
|
|
297
|
-
return filtersOpen();
|
|
298
|
-
},
|
|
299
|
-
get children() {
|
|
300
|
-
return ssr(_tmpl$2, ssrHydrationKey(), escape(createComponent(For, {
|
|
301
|
-
get each() {
|
|
302
|
-
return table.getAllLeafColumns().filter((column) => column.getCanFilter());
|
|
303
|
-
},
|
|
304
|
-
children: (column) => createComponent(FilterRow, {
|
|
305
|
-
column,
|
|
306
|
-
get data() {
|
|
307
|
-
return props.data;
|
|
308
|
-
},
|
|
309
|
-
skip: [],
|
|
310
|
-
get isArrayColumn() {
|
|
311
|
-
return props.data.some((row) => Array.isArray(row[column.id]));
|
|
312
|
-
},
|
|
313
|
-
get isDateColumn() {
|
|
314
|
-
return column.columnDef.meta?.filterVariant === "date";
|
|
315
|
-
}
|
|
316
|
-
})
|
|
317
|
-
})));
|
|
318
|
-
}
|
|
319
|
-
})), escape(createComponent(Show, {
|
|
320
|
-
get when() {
|
|
321
|
-
return memo(() => !!props.bulkActions)() && selected().length;
|
|
322
|
-
},
|
|
323
|
-
get children() {
|
|
324
|
-
return ssr(_tmpl$3, ssrHydrationKey(), escape(selected().length), escape(props.bulkActions?.(selected(), clear)), escape(createComponent(Button, {
|
|
325
|
-
size: "sm",
|
|
326
|
-
variant: "ghost",
|
|
327
|
-
onClick: clear,
|
|
328
|
-
children: "Clear"
|
|
329
|
-
})));
|
|
330
|
-
}
|
|
331
|
-
})), escape(createComponent(Table, {
|
|
332
|
-
get ["aria-label"]() {
|
|
333
|
-
return props["aria-label"];
|
|
334
|
-
},
|
|
335
|
-
get children() {
|
|
336
|
-
return [
|
|
337
|
-
createComponent(TableHeader, { get children() {
|
|
338
|
-
return createComponent(For, {
|
|
339
|
-
get each() {
|
|
340
|
-
return table.getHeaderGroups();
|
|
341
|
-
},
|
|
342
|
-
children: (group) => createComponent(TableRow, { get children() {
|
|
343
|
-
return createComponent(For, {
|
|
344
|
-
get each() {
|
|
345
|
-
return group.headers;
|
|
346
|
-
},
|
|
347
|
-
children: (header) => createComponent(TableHead, {
|
|
348
|
-
get ["aria-sort"]() {
|
|
349
|
-
return memo(() => header.column.getIsSorted() === "asc")() ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : void 0;
|
|
350
|
-
},
|
|
351
|
-
get children() {
|
|
352
|
-
return createComponent(Show, {
|
|
353
|
-
get when() {
|
|
354
|
-
return !header.isPlaceholder;
|
|
355
|
-
},
|
|
356
|
-
get children() {
|
|
357
|
-
return createComponent(Show, {
|
|
358
|
-
get when() {
|
|
359
|
-
return header.column.getCanSort();
|
|
360
|
-
},
|
|
361
|
-
get fallback() {
|
|
362
|
-
return createComponent(FlexRender, { header });
|
|
363
|
-
},
|
|
364
|
-
get children() {
|
|
365
|
-
return ssr(_tmpl$5, ssrHydrationKey(), escape(createComponent(FlexRender, { header })), header.column.getIsSorted() === "asc" ? "↑" : header.column.getIsSorted() === "desc" ? "↓" : "↕");
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
})
|
|
372
|
-
});
|
|
373
|
-
} })
|
|
374
|
-
});
|
|
375
|
-
} }),
|
|
376
|
-
createComponent(TableBody, { get children() {
|
|
377
|
-
return createComponent(Show, {
|
|
378
|
-
get when() {
|
|
379
|
-
return rows().length;
|
|
380
|
-
},
|
|
381
|
-
get fallback() {
|
|
382
|
-
return createComponent(TableRow, { get children() {
|
|
383
|
-
return createComponent(TableCell, {
|
|
384
|
-
get colSpan() {
|
|
385
|
-
return table.getVisibleLeafColumns().length;
|
|
386
|
-
},
|
|
387
|
-
"class": "h-24 text-center",
|
|
388
|
-
get children() {
|
|
389
|
-
return props.emptyMessage ?? "No results.";
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
} });
|
|
393
|
-
},
|
|
394
|
-
get children() {
|
|
395
|
-
return createComponent(For, {
|
|
396
|
-
get each() {
|
|
397
|
-
return rows();
|
|
398
|
-
},
|
|
399
|
-
children: (row) => createComponent(TableRow, {
|
|
400
|
-
get ["data-state"]() {
|
|
401
|
-
return row.getIsSelected() ? "selected" : void 0;
|
|
402
|
-
},
|
|
403
|
-
onClick: (event) => {
|
|
404
|
-
if (event.target.closest("button, input, a")) return;
|
|
405
|
-
if (props.onSelectedRowsChange) row.toggleSelected();
|
|
406
|
-
else props.onRowClick?.(row.original);
|
|
407
|
-
},
|
|
408
|
-
get children() {
|
|
409
|
-
return createComponent(For, {
|
|
410
|
-
get each() {
|
|
411
|
-
return row.getVisibleCells();
|
|
412
|
-
},
|
|
413
|
-
children: (cell) => createComponent(TableCell, { get children() {
|
|
414
|
-
return createComponent(FlexRender, { cell });
|
|
415
|
-
} })
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
})
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
});
|
|
422
|
-
} }),
|
|
423
|
-
createComponent(Show, {
|
|
424
|
-
get when() {
|
|
425
|
-
return props.footer;
|
|
426
|
-
},
|
|
427
|
-
get children() {
|
|
428
|
-
return createComponent(TableFooter, { get children() {
|
|
429
|
-
return props.footer?.(table.getVisibleLeafColumns().length);
|
|
430
|
-
} });
|
|
431
|
-
}
|
|
432
|
-
})
|
|
433
|
-
];
|
|
434
|
-
}
|
|
435
|
-
})), escape(createComponent(Show, {
|
|
436
|
-
get when() {
|
|
437
|
-
return props.pagination !== false;
|
|
438
|
-
},
|
|
439
|
-
get children() {
|
|
440
|
-
return createComponent(DataTablePagination, {
|
|
441
|
-
table,
|
|
442
|
-
get pageSizeOptions() {
|
|
443
|
-
return props.pageSizeOptions;
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
}
|
|
447
|
-
})));
|
|
448
|
-
}
|
|
449
|
-
//#endregion
|
|
450
|
-
//#region src/solid/tables/columns.tsx
|
|
451
|
-
function selectColumn() {
|
|
452
|
-
return {
|
|
453
|
-
id: "select",
|
|
454
|
-
enableColumnFilter: false,
|
|
455
|
-
enableGlobalFilter: false,
|
|
456
|
-
header: ({ table }) => createComponent(Toggle, {
|
|
457
|
-
style: "checkbox",
|
|
458
|
-
labelHidden: true,
|
|
459
|
-
get checked() {
|
|
460
|
-
return table.getIsAllPageRowsSelected();
|
|
461
|
-
},
|
|
462
|
-
get mixed() {
|
|
463
|
-
return memo(() => !!table.getIsSomePageRowsSelected())() && !table.getIsAllPageRowsSelected();
|
|
464
|
-
},
|
|
465
|
-
onChange: (checked) => table.toggleAllPageRowsSelected(checked),
|
|
466
|
-
label: "Select all"
|
|
467
|
-
}),
|
|
468
|
-
cell: ({ row }) => createComponent(Toggle, {
|
|
469
|
-
style: "checkbox",
|
|
470
|
-
labelHidden: true,
|
|
471
|
-
get checked() {
|
|
472
|
-
return row.getIsSelected();
|
|
473
|
-
},
|
|
474
|
-
onChange: (checked) => row.toggleSelected(checked),
|
|
475
|
-
label: "Select row"
|
|
476
|
-
})
|
|
477
|
-
};
|
|
478
|
-
}
|
|
479
|
-
//#endregion
|
|
480
|
-
export { DataTable, DataTablePagination, FilterRow, baseTableFeatures, selectColumn };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource solid-js */
|
|
2
|
-
import { type JSX } from "solid-js";
|
|
3
|
-
declare function Window(props: JSX.HTMLAttributes<HTMLBodyElement> & {
|
|
4
|
-
after?: JSX.Element;
|
|
5
|
-
before?: JSX.Element;
|
|
6
|
-
className?: string;
|
|
7
|
-
}): JSX.Element;
|
|
8
|
-
export declare const ComposeViewport: ((props: JSX.IntrinsicElements["html"] & {
|
|
9
|
-
className?: string;
|
|
10
|
-
head?: JSX.Element;
|
|
11
|
-
}) => JSX.Element) & {
|
|
12
|
-
Window: typeof Window;
|
|
13
|
-
};
|
|
14
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource solid-js */
|
|
2
|
-
import { type JSX } from "solid-js";
|
|
3
|
-
export type FieldAvatarValue = File | null | false;
|
|
4
|
-
export type FieldAvatarLabels = {
|
|
5
|
-
edit: string;
|
|
6
|
-
remove: string;
|
|
7
|
-
confirmHint: string;
|
|
8
|
-
save: string;
|
|
9
|
-
cancel: string;
|
|
10
|
-
photo: string;
|
|
11
|
-
photoDescription: string;
|
|
12
|
-
choosePhoto: string;
|
|
13
|
-
takePhoto: string;
|
|
14
|
-
capture: string;
|
|
15
|
-
monogram: string;
|
|
16
|
-
removePhoto: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function FieldAvatar(props: {
|
|
19
|
-
compact?: boolean;
|
|
20
|
-
existingImage?: string | null;
|
|
21
|
-
label: string;
|
|
22
|
-
accept?: string;
|
|
23
|
-
clearable?: boolean;
|
|
24
|
-
caption?: JSX.Element;
|
|
25
|
-
labels?: Partial<FieldAvatarLabels>;
|
|
26
|
-
}): JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource solid-js */
|
|
2
|
-
import { type JSX } from "solid-js";
|
|
3
|
-
import { type TextFieldProps } from "@passui/solid/text-field";
|
|
4
|
-
export declare const PeachFieldLabels: import("solid-js").Context<{
|
|
5
|
-
show: string;
|
|
6
|
-
hide: string;
|
|
7
|
-
} | undefined>;
|
|
8
|
-
export declare function FieldInput(props: Omit<TextFieldProps, "value" | "onInput" | "onBlur" | "name">): JSX.Element;
|
|
9
|
-
export declare function FieldCheckbox(props: {
|
|
10
|
-
label: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
}): JSX.Element;
|
|
13
|
-
export declare function FieldSwitch(props: {
|
|
14
|
-
label: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
}): JSX.Element;
|
|
18
|
-
export declare function FieldTextarea(props: Omit<JSX.TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "onInput" | "onBlur"> & {
|
|
19
|
-
label: string;
|
|
20
|
-
icon?: JSX.Element;
|
|
21
|
-
}): JSX.Element;
|
|
22
|
-
export declare function FieldOtp(props: {
|
|
23
|
-
label: string;
|
|
24
|
-
maxLength?: number;
|
|
25
|
-
onComplete?: (value: string) => void;
|
|
26
|
-
}): JSX.Element;
|
|
27
|
-
export type FieldOption = {
|
|
28
|
-
label: string;
|
|
29
|
-
value: string;
|
|
30
|
-
description?: string;
|
|
31
|
-
icon?: JSX.Element;
|
|
32
|
-
disabled?: boolean;
|
|
33
|
-
};
|
|
34
|
-
export declare function FieldRadioCard(props: {
|
|
35
|
-
label: string;
|
|
36
|
-
description?: string;
|
|
37
|
-
options: FieldOption[];
|
|
38
|
-
disabled?: boolean;
|
|
39
|
-
columns?: 1 | 2;
|
|
40
|
-
}): JSX.Element;
|
|
41
|
-
export declare function FieldMultiselect(props: {
|
|
42
|
-
label: string;
|
|
43
|
-
description?: string;
|
|
44
|
-
options: FieldOption[];
|
|
45
|
-
}): JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const fieldContext: import("solid-js").Context<import("solid-js").Accessor<import("@tanstack/solid-form").AnyFieldApi>>, formContext: import("solid-js").Context<import("@tanstack/solid-form").AnyFormApi>, useFieldContext: <TData>() => import("solid-js").Accessor<import("@tanstack/solid-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>>, useFormContext: () => import("@tanstack/solid-form").SolidFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { FieldInput, FieldCheckbox, FieldTextarea, FieldSwitch, FieldOtp, FieldRadioCard, FieldMultiselect } from "../form-fields/fields";
|
|
2
|
-
import { FieldAvatar } from "../form-fields/avatar";
|
|
3
|
-
import { Submit } from "../form-fields/submit";
|
|
4
|
-
export declare const useAppForm: <TFormData, TOnMount extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TSubmitMeta>(props: import("solid-js").Accessor<import("@tanstack/solid-form").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>>) => import("@tanstack/solid-form").AppFieldExtendedSolidFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
5
|
-
readonly input: typeof FieldInput;
|
|
6
|
-
readonly avatar: typeof FieldAvatar;
|
|
7
|
-
readonly checkbox: typeof FieldCheckbox;
|
|
8
|
-
readonly textarea: typeof FieldTextarea;
|
|
9
|
-
readonly switch: typeof FieldSwitch;
|
|
10
|
-
readonly otp: typeof FieldOtp;
|
|
11
|
-
readonly radioCard: typeof FieldRadioCard;
|
|
12
|
-
readonly multiselect: typeof FieldMultiselect;
|
|
13
|
-
}, {
|
|
14
|
-
readonly submit: typeof Submit;
|
|
15
|
-
}>, withForm: <TFormData, TOnMount extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnChange extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnChangeAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnBlur extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnBlurAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnSubmit extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnSubmitAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnDynamic extends undefined | import("@tanstack/solid-form").FormValidateOrFn<TFormData>, TOnDynamicAsync extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TOnServer extends undefined | import("@tanstack/solid-form").FormAsyncValidateOrFn<TFormData>, TSubmitMeta, TRenderProps extends Record<string, unknown> = {}>({ render, props, }: import("@tanstack/solid-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
16
|
-
readonly input: typeof FieldInput;
|
|
17
|
-
readonly avatar: typeof FieldAvatar;
|
|
18
|
-
readonly checkbox: typeof FieldCheckbox;
|
|
19
|
-
readonly textarea: typeof FieldTextarea;
|
|
20
|
-
readonly switch: typeof FieldSwitch;
|
|
21
|
-
readonly otp: typeof FieldOtp;
|
|
22
|
-
readonly radioCard: typeof FieldRadioCard;
|
|
23
|
-
readonly multiselect: typeof FieldMultiselect;
|
|
24
|
-
}, {
|
|
25
|
-
readonly submit: typeof Submit;
|
|
26
|
-
}, TRenderProps>) => (props: import("solid-js").ParentProps<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
27
|
-
form: import("@tanstack/solid-form").AppFieldExtendedSolidFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/solid-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
28
|
-
readonly input: typeof FieldInput;
|
|
29
|
-
readonly avatar: typeof FieldAvatar;
|
|
30
|
-
readonly checkbox: typeof FieldCheckbox;
|
|
31
|
-
readonly textarea: typeof FieldTextarea;
|
|
32
|
-
readonly switch: typeof FieldSwitch;
|
|
33
|
-
readonly otp: typeof FieldOtp;
|
|
34
|
-
readonly radioCard: typeof FieldRadioCard;
|
|
35
|
-
readonly multiselect: typeof FieldMultiselect;
|
|
36
|
-
}, {
|
|
37
|
-
readonly submit: typeof Submit;
|
|
38
|
-
}>;
|
|
39
|
-
}>) => import("solid-js").JSXElement;
|
|
40
|
-
export { useAppForm as createAppForm };
|
|
41
|
-
export { useStore, useSelector } from "@tanstack/solid-form";
|
|
42
|
-
export * from "../form-fields";
|
|
43
|
-
export * from "./form-alert";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { useAppMutation, useAppMutation as createAppMutation, shouldRestoreOptimisticSnapshot, } from "./use-app-mutation";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { QueryKey, MutationOptions } from "@tanstack/solid-query";
|
|
2
|
-
type OptimisticUpdate<TOptimisticData, TVariables> = {
|
|
3
|
-
queryKey: QueryKey;
|
|
4
|
-
/** Applied to the cache immediately, before the mutation resolves. Rolled back if it errors. */
|
|
5
|
-
updater: (old: TOptimisticData | undefined, variables: TVariables) => TOptimisticData;
|
|
6
|
-
};
|
|
7
|
-
type MutationContext<TOptimisticData> = {
|
|
8
|
-
previous: TOptimisticData | undefined;
|
|
9
|
-
next: TOptimisticData;
|
|
10
|
-
} | undefined;
|
|
11
|
-
export { shouldRestoreOptimisticSnapshot } from "../../shared/optimistic";
|
|
12
|
-
type AppMutationOptions<TData, TVariables, TOptimisticData> = Omit<MutationOptions<TData, Error, TVariables, MutationContext<TOptimisticData>>, "onSuccess" | "onError" | "onMutate" | "onSettled"> & {
|
|
13
|
-
/** Query keys to invalidate once the mutation settles, win or lose. */
|
|
14
|
-
invalidates?: QueryKey[];
|
|
15
|
-
optimisticUpdate?: OptimisticUpdate<TOptimisticData, TVariables>;
|
|
16
|
-
successMessage?: string | ((data: NoInfer<TData>, variables: NoInfer<TVariables>) => string);
|
|
17
|
-
successDescription?: string | ((data: NoInfer<TData>, variables: NoInfer<TVariables>) => string | undefined);
|
|
18
|
-
errorMessage?: string;
|
|
19
|
-
onSuccess?: (data: NoInfer<TData>, variables: NoInfer<TVariables>) => void;
|
|
20
|
-
onError?: (error: Error, variables: NoInfer<TVariables>) => void;
|
|
21
|
-
};
|
|
22
|
-
export declare function useAppMutation<TData, TVariables = void, TOptimisticData = unknown>(getOptions: () => AppMutationOptions<TData, TVariables, TOptimisticData>): import("@tanstack/solid-query").UseMutationResult<TData, Error, TVariables, MutationContext<TOptimisticData>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** @jsxImportSource solid-js */
|
|
2
|
-
import { type JSX } from "solid-js";
|
|
3
|
-
import { type ErrorComponentProps } from "@tanstack/solid-router";
|
|
4
|
-
export declare function DefaultLoader(): JSX.Element;
|
|
5
|
-
export declare function DefaultBoundary(props: ErrorComponentProps): JSX.Element;
|
|
6
|
-
export declare function NotFound(props: {
|
|
7
|
-
children?: JSX.Element;
|
|
8
|
-
}): JSX.Element;
|