@passui/tanstack 0.1.2 → 0.2.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 +56 -32
- package/package.json +112 -12
- package/src/mutation/use-app-mutation.ts +2 -6
- package/src/shared/index.ts +2 -0
- package/src/shared/optimistic.ts +7 -0
- package/src/shared/table.ts +30 -0
- package/src/solid/auth-shell/auth-shell.tsx +20 -0
- package/src/solid/auth-shell/index.ts +1 -0
- package/src/solid/document/compose-viewport.tsx +69 -0
- package/src/solid/document/index.ts +1 -0
- package/src/solid/form-fields/avatar.tsx +370 -0
- package/src/solid/form-fields/fields.tsx +336 -0
- package/src/solid/form-fields/index.ts +3 -0
- package/src/solid/form-fields/submit.tsx +31 -0
- package/src/solid/forms/contexts.ts +7 -0
- package/src/solid/forms/form-alert.tsx +19 -0
- package/src/solid/forms/index.ts +32 -0
- package/src/solid/mutation/index.ts +5 -0
- package/src/solid/mutation/use-app-mutation.ts +171 -0
- package/src/solid/route-boundary/boundaries.tsx +104 -0
- package/src/solid/route-boundary/index.ts +1 -0
- package/src/solid/settings/index.ts +1 -0
- package/src/solid/settings/setting-list.tsx +185 -0
- package/src/solid/styles.css +2 -0
- package/src/solid/tables/columns.tsx +40 -0
- package/src/solid/tables/data-table.tsx +448 -0
- package/src/solid/tables/filter-row.tsx +161 -0
- package/src/solid/tables/index.ts +4 -0
- package/src/solid/tables/pagination.tsx +78 -0
- package/src/tables/utils.ts +5 -35
package/src/tables/utils.ts
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
data: TData[],
|
|
7
|
-
colId: string
|
|
8
|
-
): boolean {
|
|
9
|
-
return data.some((row) =>
|
|
10
|
-
Array.isArray((row as Record<string, unknown>)[colId])
|
|
11
|
-
)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export function columnIdOf<TData extends RowData>(
|
|
15
|
-
col: DataTableColumnDef<TData>
|
|
16
|
-
): string | undefined {
|
|
17
|
-
if ("id" in col && col.id) return col.id
|
|
18
|
-
if (
|
|
19
|
-
"accessorKey" in col &&
|
|
20
|
-
typeof col.accessorKey === "string"
|
|
21
|
-
)
|
|
22
|
-
return col.accessorKey
|
|
23
|
-
return undefined
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function getColumnLabel(column: {
|
|
27
|
-
columnDef: { header?: unknown }
|
|
28
|
-
id: string
|
|
29
|
-
}) {
|
|
30
|
-
const header = column.columnDef.header
|
|
31
|
-
if (typeof header === "string") return header
|
|
32
|
-
return column.id
|
|
33
|
-
.replace(/([A-Z])/g, " $1")
|
|
34
|
-
.replace(/^./, (s) => s.toUpperCase())
|
|
35
|
-
}
|
|
1
|
+
export {
|
|
2
|
+
isArrayValuedColumn,
|
|
3
|
+
getColumnLabel,
|
|
4
|
+
columnIdOf,
|
|
5
|
+
} from "../shared/table"
|