wcz-layout 9.6.6 → 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AggregatedCell-BtKC5-m6.mjs +497 -0
- package/dist/AggregatedCell-BtKC5-m6.mjs.map +1 -0
- package/dist/Approval-C-hF4jbT.mjs.map +1 -1
- package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
- package/dist/Email-BzQQkbe9.mjs.map +1 -1
- package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
- package/dist/LayoutTable-4DLs-NI-.d.mts +752 -0
- package/dist/{QueryClientParam-Cbb0MIKg.d.mts → QueryClientParam-JcH0mJWl.d.mts} +2 -2
- package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -1
- package/dist/{User-1gKoYJvW.d.mts → User-D4__w1I1.d.mts} +4 -2
- package/dist/approval-DFExxyAJ.mjs +84 -0
- package/dist/approval-DFExxyAJ.mjs.map +1 -0
- package/dist/auth.d.mts +21 -11
- package/dist/auth.mjs +43 -26
- package/dist/auth.mjs.map +1 -1
- package/dist/components.d.mts +22 -30
- package/dist/components.mjs +792 -145
- package/dist/components.mjs.map +1 -1
- package/dist/createApi-CLYWCzR2.mjs +27 -0
- package/dist/createApi-CLYWCzR2.mjs.map +1 -0
- package/dist/data/client.d.mts +703 -1152
- package/dist/data/client.mjs +4 -3
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.d.mts +3 -3
- package/dist/data/server.mjs +4 -2
- package/dist/data/server.mjs.map +1 -1
- package/dist/{file-BTFDDalH.mjs → file-CZwQfvTU.mjs} +8 -27
- package/dist/file-CZwQfvTU.mjs.map +1 -0
- package/dist/{file-CuvAmdJW.mjs → file-aSQto2rw.mjs} +7 -9
- package/dist/file-aSQto2rw.mjs.map +1 -0
- package/dist/hooks.d.mts +7 -46
- package/dist/hooks.mjs +2578 -239
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +29 -9
- package/dist/index.mjs +1257 -499
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.d.mts +20 -19
- package/dist/middleware.mjs +47 -2
- package/dist/middleware.mjs.map +1 -1
- package/dist/models.d.mts +17 -10
- package/dist/models.mjs.map +1 -1
- package/dist/{peoplesoft-D4w8d4s1.d.mts → peoplesoft-BY_75WTS.d.mts} +3 -2
- package/dist/{peoplesoft-DGdM1bws.mjs → peoplesoft-CQnc01Hc.mjs} +24 -81
- package/dist/peoplesoft-CQnc01Hc.mjs.map +1 -0
- package/dist/providers-Dbl95AxR.mjs +74 -0
- package/dist/providers-Dbl95AxR.mjs.map +1 -0
- package/dist/tokens-D8CVIFTb.mjs +143 -0
- package/dist/tokens-D8CVIFTb.mjs.map +1 -0
- package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
- package/dist/{utils-DjdexspV.mjs → utils-KaM5VMTJ.mjs} +64 -42
- package/dist/utils-KaM5VMTJ.mjs.map +1 -0
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/vite.d.mts +1 -2
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/package.json +128 -127
- package/skills/client-db/SKILL.md +104 -96
- package/skills/db-schema/SKILL.md +46 -33
- package/skills/dialogs/SKILL.md +21 -27
- package/skills/forms/SKILL.md +60 -39
- package/skills/general/SKILL.md +125 -94
- package/skills/general/references/exports.md +106 -0
- package/skills/migrations/SKILL.md +57 -0
- package/skills/migrations/versions/migrate-v9-to-v10.md +581 -0
- package/skills/routing/SKILL.md +50 -60
- package/skills/server-functions/SKILL.md +36 -56
- package/skills/services/SKILL.md +34 -31
- package/skills/services/docs/approval.md +2 -2
- package/skills/services/docs/peoplesoft.md +1 -1
- package/skills/start/SKILL.md +51 -47
- package/skills/start/steps/01-git-setup.md +0 -1
- package/skills/start/steps/04-wicop-setup.md +105 -80
- package/skills/start/steps/05-database-setup.md +13 -5
- package/skills/start/steps/06-entra-setup.md +96 -98
- package/skills/start/steps/07-vault-setup.md +57 -24
- package/skills/table/SKILL.md +275 -0
- package/skills/unslop/SKILL.md +80 -0
- package/dist/NotificationContext-CgwUOeW0.mjs +0 -7
- package/dist/NotificationContext-CgwUOeW0.mjs.map +0 -1
- package/dist/authMiddleware-DPly0b_T.mjs +0 -48
- package/dist/authMiddleware-DPly0b_T.mjs.map +0 -1
- package/dist/entra-CJSyeQsx.mjs +0 -109
- package/dist/entra-CJSyeQsx.mjs.map +0 -1
- package/dist/file-BTFDDalH.mjs.map +0 -1
- package/dist/file-CuvAmdJW.mjs.map +0 -1
- package/dist/msalServer-DLwA7_ta.mjs +0 -30
- package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
- package/dist/peoplesoft-DGdM1bws.mjs.map +0 -1
- package/dist/useDialogs-BUzVrTSP.mjs +0 -248
- package/dist/useDialogs-BUzVrTSP.mjs.map +0 -1
- package/dist/user-Dzv0N9fj.d.mts +0 -16
- package/dist/utils-DjdexspV.mjs.map +0 -1
- package/skills/data-grid/SKILL.md +0 -142
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: data-grid
|
|
3
|
-
description: "Use when: building or configuring MUI X DataGrid tables."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Rules
|
|
7
|
-
|
|
8
|
-
- Wrap DataGrid in `Fullscreen` when it is the only content on the page.
|
|
9
|
-
- Type columns as `Array<GridColDef<RowType>>` with the row interface.
|
|
10
|
-
- Use translation for all `headerName` values.
|
|
11
|
-
- Use `rows`, `columns`, `showToolbar`, `loading`, `ignoreDiacritics`, `cellSelection`, and `disableRowSelectionOnClick` on grids.
|
|
12
|
-
- For enums use `type: "singleSelect"` with `{ value, label }` options array used from enumObject.
|
|
13
|
-
- For editable columns, pair `editable: true` with `renderHeader: EditableColumnHeader`.
|
|
14
|
-
- Use `EditableColumnHeader`, and router button/grid action components from `wcz-layout/components` when they fit.
|
|
15
|
-
- Always apply a `valueFormatter` for columns with type `dateTime` or `date`.
|
|
16
|
-
|
|
17
|
-
## File Placement
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
@mui/x-data-grid-premium — GridColDef, DataGridPremium
|
|
21
|
-
src/db-collections/ - TanStack DB collections to get data
|
|
22
|
-
@tanstack/react-db - useLiveQuery, useLiveSuspenseQuery
|
|
23
|
-
src/server/actions/ - server functions and enums
|
|
24
|
-
wcz-layout/components - EditableColumnHeader, Fullscreen
|
|
25
|
-
wcz-layout/hooks - useTranslation
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Examples
|
|
29
|
-
|
|
30
|
-
```tsx
|
|
31
|
-
// src/routes/<feature>s/index.tsx
|
|
32
|
-
const { t } = useTranslation();
|
|
33
|
-
const { confirm, alert } = useDialogs();
|
|
34
|
-
const navigate = useNavigate();
|
|
35
|
-
const [cellSelectionModel, setCellSelectionModel] = useState<GridCellSelectionModel>({});
|
|
36
|
-
|
|
37
|
-
const { data, isLoading } = useLiveQuery((q) =>
|
|
38
|
-
q.from({ feature: featureCollection }).orderBy(({ feature }) => feature.name, "asc"),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
const columns: Array<GridColDef<Feature>> = [
|
|
42
|
-
{
|
|
43
|
-
field: "name",
|
|
44
|
-
headerName: t("Feature.Name"),
|
|
45
|
-
width: 200,
|
|
46
|
-
editable: true,
|
|
47
|
-
renderHeader: EditableColumnHeader,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
field: "status",
|
|
51
|
-
headerName: t("Feature.Status"),
|
|
52
|
-
width: 200,
|
|
53
|
-
type: "singleSelect",
|
|
54
|
-
valueOptions: featureStatusEnum.enumValues.map((status) => ({
|
|
55
|
-
value: status,
|
|
56
|
-
label: t(`FeatureStatus.${status}`),
|
|
57
|
-
})),
|
|
58
|
-
},
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
const handleOnDelete = createOptimisticAction<Array<string>>({
|
|
62
|
-
onMutate: (ids) => {
|
|
63
|
-
ids.forEach((id) => {
|
|
64
|
-
featureCollection.delete(id);
|
|
65
|
-
});
|
|
66
|
-
},
|
|
67
|
-
mutationFn: async (ids) => {
|
|
68
|
-
deleteFeatures({ data: ids });
|
|
69
|
-
await featureCollection.utils.refetch();
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
<Fullscreen>
|
|
75
|
-
<DataGridPremium
|
|
76
|
-
rows={data}
|
|
77
|
-
columns={columns}
|
|
78
|
-
showToolbar
|
|
79
|
-
loading={isLoading}
|
|
80
|
-
ignoreDiacritics
|
|
81
|
-
onRowDoubleClick={({ row }) => navigate({ to: "/features/$id", params: { id: row.id } })}
|
|
82
|
-
cellSelection
|
|
83
|
-
disableRowSelectionOnClick
|
|
84
|
-
cellSelectionModel={cellSelectionModel}
|
|
85
|
-
onCellSelectionModelChange={(newModel) => setCellSelectionModel(newModel)}
|
|
86
|
-
slots={{ toolbar: DataGridToolbar }}
|
|
87
|
-
slotProps={{
|
|
88
|
-
toolbar: {
|
|
89
|
-
title: t("Feature.Features"),
|
|
90
|
-
actions: [
|
|
91
|
-
<Tooltip key="create" title={t("Create")}>
|
|
92
|
-
<RouterIconButton to="/features/create">
|
|
93
|
-
<Add fontSize="small" />
|
|
94
|
-
</RouterIconButton>
|
|
95
|
-
</Tooltip>,
|
|
96
|
-
Object.keys(cellSelectionModel).length === 1 && (
|
|
97
|
-
<Tooltip key="edit" title={t("Edit")}>
|
|
98
|
-
<RouterIconButton
|
|
99
|
-
to="/features/edit/$id"
|
|
100
|
-
params={{ id: Object.keys(cellSelectionModel)[0].toString() }}
|
|
101
|
-
>
|
|
102
|
-
<Edit fontSize="small" />
|
|
103
|
-
</RouterIconButton>
|
|
104
|
-
</Tooltip>
|
|
105
|
-
),
|
|
106
|
-
Object.keys(cellSelectionModel).length > 0 && (
|
|
107
|
-
<Tooltip key="delete" title={t("Delete")}>
|
|
108
|
-
<IconButton
|
|
109
|
-
onClick={async () => {
|
|
110
|
-
const confirmed = await confirm(
|
|
111
|
-
t("DeleteConfirmation", { count: Object.keys(cellSelectionModel).length }),
|
|
112
|
-
);
|
|
113
|
-
if (confirmed) {
|
|
114
|
-
try {
|
|
115
|
-
const transaction = handleOnDelete(
|
|
116
|
-
Object.keys(cellSelectionModel).map((id) => id.toString()),
|
|
117
|
-
);
|
|
118
|
-
await transaction.isPersisted.promise;
|
|
119
|
-
setCellSelectionModel({});
|
|
120
|
-
} catch (error) {
|
|
121
|
-
if (error instanceof Error) await alert(error.message);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}}
|
|
125
|
-
>
|
|
126
|
-
<Badge
|
|
127
|
-
badgeContent={Object.keys(cellSelectionModel).length}
|
|
128
|
-
invisible={Object.keys(cellSelectionModel).length <= 1}
|
|
129
|
-
color="error"
|
|
130
|
-
>
|
|
131
|
-
<Delete fontSize="small" />
|
|
132
|
-
</Badge>
|
|
133
|
-
</IconButton>
|
|
134
|
-
</Tooltip>
|
|
135
|
-
),
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
}}
|
|
139
|
-
/>
|
|
140
|
-
</Fullscreen>
|
|
141
|
-
);
|
|
142
|
-
```
|