wcz-layout 9.7.0 → 10.1.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-C7nAQyMO.mjs +510 -0
- package/dist/AggregatedCell-C7nAQyMO.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-BkrjgpW_.d.mts +758 -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-BYryxFOW.mjs +84 -0
- package/dist/approval-BYryxFOW.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 +813 -140
- package/dist/components.mjs.map +1 -1
- package/dist/createApi-DGJJ4I_R.mjs +27 -0
- package/dist/createApi-DGJJ4I_R.mjs.map +1 -0
- package/dist/data/client.d.mts +690 -1176
- 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-DimNsRly.mjs → file-C14fhUeg.mjs} +6 -7
- package/dist/file-C14fhUeg.mjs.map +1 -0
- package/dist/{file-BWcNzq55.mjs → file-C5BOj1q8.mjs} +5 -24
- package/dist/file-C5BOj1q8.mjs.map +1 -0
- package/dist/hooks.d.mts +7 -46
- package/dist/hooks.mjs +2587 -239
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +28 -9
- package/dist/index.mjs +1248 -500
- 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-CskGsqd6.d.mts → peoplesoft-BY_75WTS.d.mts} +2 -2
- package/dist/{peoplesoft-DTPGpN2h.mjs → peoplesoft-BkJMCcHb.mjs} +24 -81
- package/dist/peoplesoft-BkJMCcHb.mjs.map +1 -0
- package/dist/providers-DrairEO2.mjs +74 -0
- package/dist/providers-DrairEO2.mjs.map +1 -0
- package/dist/tokens-BLRreL1j.mjs +143 -0
- package/dist/tokens-BLRreL1j.mjs.map +1 -0
- package/dist/{utils-DjdexspV.mjs → utils-BUpDoqme.mjs} +73 -51
- package/dist/utils-BUpDoqme.mjs.map +1 -0
- package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
- 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 +130 -128
- 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 +122 -94
- package/skills/general/references/exports.md +106 -0
- package/skills/migrations/SKILL.md +53 -2
- package/skills/migrations/versions/migrate-v9-to-v10.md +582 -0
- package/skills/routing/SKILL.md +50 -60
- package/skills/server-functions/SKILL.md +36 -56
- package/skills/services/SKILL.md +7 -4
- package/skills/services/docs/approval.md +2 -2
- package/skills/services/docs/peoplesoft.md +114 -110
- package/skills/start/SKILL.md +9 -5
- package/skills/start/steps/05-database-setup.md +52 -52
- package/skills/start/steps/06-entra-setup.md +1 -1
- package/skills/start/steps/07-vault-setup.md +5 -12
- package/skills/table/SKILL.md +263 -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-BWcNzq55.mjs.map +0 -1
- package/dist/file-DimNsRly.mjs.map +0 -1
- package/dist/msalServer-DLwA7_ta.mjs +0 -30
- package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
- package/dist/peoplesoft-DTPGpN2h.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
- package/skills/migrations/versions/migrate-v9-to-v10.tsx +0 -9
|
@@ -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
|
-
```
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// please search for every useNotification
|
|
2
|
-
// this hook is deprecated, I need you to turn them into some beautiful, stunning animation instead of just snackbar.Please place the animation into separate component for each use.
|
|
3
|
-
// success - animation
|
|
4
|
-
// error - alert dialog
|
|
5
|
-
// warning, info - you decide per use-case
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// install tanstack-table, virtual, hotkeys
|
|
9
|
-
// delete x-data-grid-premium
|