@alepha/ui 0.17.2 → 0.18.1
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/admin/{AdminApiKeys-CF_qOO3u.js → AdminApiKeys-C-6_Q-lH.js} +56 -192
- package/dist/admin/AdminApiKeys-C-6_Q-lH.js.map +1 -0
- package/dist/admin/{AdminAudits-BQno3hZG.js → AdminAudits-Bgbf04hO.js} +25 -61
- package/dist/admin/AdminAudits-Bgbf04hO.js.map +1 -0
- package/dist/admin/{AdminFiles-kvuUaASF.js → AdminFiles-B9a7G3cY.js} +6 -8
- package/dist/admin/AdminFiles-B9a7G3cY.js.map +1 -0
- package/dist/admin/{AdminJobDashboard-CrPxp0W1.js → AdminJobDashboard-DaTwf5OY.js} +55 -186
- package/dist/admin/AdminJobDashboard-DaTwf5OY.js.map +1 -0
- package/dist/admin/{AdminJobExecutions-D-b4Zt7W.js → AdminJobExecutions-B9cek5dl.js} +132 -168
- package/dist/admin/AdminJobExecutions-B9cek5dl.js.map +1 -0
- package/dist/admin/{AdminJobRegistry-CNX5cpDx.js → AdminJobRegistry-DFgV3oqx.js} +60 -83
- package/dist/admin/AdminJobRegistry-DFgV3oqx.js.map +1 -0
- package/dist/admin/AdminLayout-DHsvWxVB.js +70 -0
- package/dist/admin/AdminLayout-DHsvWxVB.js.map +1 -0
- package/dist/admin/{AdminParameters-DCGbpt2c.js → AdminParameters-DHw9ATgl.js} +53 -53
- package/dist/admin/AdminParameters-DHw9ATgl.js.map +1 -0
- package/dist/admin/{AdminSessions-DyhW6RZv.js → AdminSessions-BhGJPI3z.js} +11 -18
- package/dist/admin/AdminSessions-BhGJPI3z.js.map +1 -0
- package/dist/admin/{AdminUserLayout-CrBj4UuI.js → AdminUserLayout-BdC4Te8m.js} +112 -151
- package/dist/admin/AdminUserLayout-BdC4Te8m.js.map +1 -0
- package/dist/admin/AdminUserProfile-DAt23fqY.js +69 -0
- package/dist/admin/AdminUserProfile-DAt23fqY.js.map +1 -0
- package/dist/admin/AdminUserSessions-1uzcx02z.js +109 -0
- package/dist/admin/AdminUserSessions-1uzcx02z.js.map +1 -0
- package/dist/admin/AdminUsers-C85c3eiQ.js +121 -0
- package/dist/admin/AdminUsers-C85c3eiQ.js.map +1 -0
- package/dist/{auth/AuthLayout-CdJcrPs4.js → admin/AuthLayout-DFJvCvzw.js} +3 -3
- package/dist/{auth/AuthLayout-CdJcrPs4.js.map → admin/AuthLayout-DFJvCvzw.js.map} +1 -1
- package/dist/{auth/IconGoogle-Bm18QD2q.js → admin/IconGoogle-CSQLPYwX.js} +1 -1
- package/dist/{auth/IconGoogle-Bm18QD2q.js.map → admin/IconGoogle-CSQLPYwX.js.map} +1 -1
- package/dist/{demo/DemoLogin-DjJ9314c.js → admin/Login-BGheURrg.js} +15 -129
- package/dist/{auth/Login-BS_FYTy0.js.map → admin/Login-BGheURrg.js.map} +1 -1
- package/dist/{auth/Profile-CjDsW378.js → admin/Profile-B-c9pCPf.js} +5 -5
- package/dist/{auth/Profile-CjDsW378.js.map → admin/Profile-B-c9pCPf.js.map} +1 -1
- package/dist/{demo/DemoRegister-DzkJ5M83.js → admin/Register-Cs10l8vX.js} +20 -146
- package/dist/{auth/Register-C5eqzAaD.js.map → admin/Register-Cs10l8vX.js.map} +1 -1
- package/dist/{demo/DemoResetPassword-DWh4_BpQ.js → admin/ResetPassword-BwDdfkGH.js} +20 -82
- package/dist/{auth/ResetPassword-XifinVao.js.map → admin/ResetPassword-BwDdfkGH.js.map} +1 -1
- package/dist/{demo/DemoVerifyEmail-DbU_tCj8.js → admin/VerifyEmail-DfXHAiQl.js} +15 -32
- package/dist/{auth/VerifyEmail-DTgbeJOO.js.map → admin/VerifyEmail-DfXHAiQl.js.map} +1 -1
- package/dist/admin/auth-Dr0Cf8I7.js +319 -0
- package/dist/admin/auth-Dr0Cf8I7.js.map +1 -0
- package/dist/admin/core-2xoLiT0o.js +4031 -0
- package/dist/admin/core-2xoLiT0o.js.map +1 -0
- package/dist/admin/index.d.ts +739 -13
- package/dist/admin/index.d.ts.map +1 -1
- package/dist/admin/index.js +79 -111
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/rolldown-runtime-CjeV3_4I.js +18 -0
- package/dist/auth/AuthLayout-CAE1pX9s.js +22 -0
- package/dist/auth/AuthLayout-CAE1pX9s.js.map +1 -0
- package/dist/auth/{Login-BS_FYTy0.js → Login-Denw_UGy.js} +8 -8
- package/dist/auth/Login-Denw_UGy.js.map +1 -0
- package/dist/auth/Profile-BMX_Ar_s.js +155 -0
- package/dist/auth/Profile-BMX_Ar_s.js.map +1 -0
- package/dist/auth/{Register-C5eqzAaD.js → Register-6hi_cpfF.js} +8 -8
- package/dist/auth/Register-6hi_cpfF.js.map +1 -0
- package/dist/auth/{ResetPassword-XifinVao.js → ResetPassword-CqfTk1FI.js} +6 -6
- package/dist/auth/ResetPassword-CqfTk1FI.js.map +1 -0
- package/dist/auth/{VerifyEmail-DTgbeJOO.js → VerifyEmail-nWiSTMjF.js} +5 -5
- package/dist/auth/VerifyEmail-nWiSTMjF.js.map +1 -0
- package/dist/auth/core-niW0sFLv.js +2264 -0
- package/dist/auth/core-niW0sFLv.js.map +1 -0
- package/dist/auth/index.d.ts +336 -8
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +18 -22
- package/dist/auth/index.js.map +1 -1
- package/dist/core/index.d.ts +1033 -843
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1626 -1354
- package/dist/core/index.js.map +1 -1
- package/dist/demo/AuthLayout-jLa0aKsI.js +22 -0
- package/dist/demo/AuthLayout-jLa0aKsI.js.map +1 -0
- package/dist/demo/DemoButton-BmaWZVwf.js +178 -0
- package/dist/demo/DemoButton-BmaWZVwf.js.map +1 -0
- package/dist/demo/{DemoDataTable-lnBKWBf8.js → DemoDataTable-Z9xyV221.js} +18 -18
- package/dist/demo/DemoDataTable-Z9xyV221.js.map +1 -0
- package/dist/demo/DemoDialog-4ItHLf9t.js +101 -0
- package/dist/demo/DemoDialog-4ItHLf9t.js.map +1 -0
- package/dist/demo/DemoFlex-EtVq8QfX.js +105 -0
- package/dist/demo/DemoFlex-EtVq8QfX.js.map +1 -0
- package/dist/demo/DemoHeading-BS-vGfkI.js +18 -0
- package/dist/demo/DemoHeading-BS-vGfkI.js.map +1 -0
- package/dist/demo/{DemoHome-CUMZsYaH.js → DemoHome-Clbn8AmS.js} +9 -12
- package/dist/demo/DemoHome-Clbn8AmS.js.map +1 -0
- package/dist/demo/DemoJsonViewer-DkIX_ky2.js +109 -0
- package/dist/demo/DemoJsonViewer-DkIX_ky2.js.map +1 -0
- package/dist/demo/DemoLayout-C56xb5EE.js +73 -0
- package/dist/demo/DemoLayout-C56xb5EE.js.map +1 -0
- package/dist/demo/DemoLogin-BZwpicOS.js +128 -0
- package/dist/demo/DemoLogin-BZwpicOS.js.map +1 -0
- package/dist/demo/DemoRegister-C7_qc4MJ.js +140 -0
- package/dist/demo/DemoRegister-C7_qc4MJ.js.map +1 -0
- package/dist/demo/DemoResetPassword-BI1Ct4Dw.js +76 -0
- package/dist/demo/DemoResetPassword-BI1Ct4Dw.js.map +1 -0
- package/dist/demo/{DemoSidebar-C1csnGhX.js → DemoSidebar-CcBo4ltC.js} +6 -9
- package/dist/demo/DemoSidebar-CcBo4ltC.js.map +1 -0
- package/dist/demo/DemoText-CzXuUn3g.js +124 -0
- package/dist/demo/DemoText-CzXuUn3g.js.map +1 -0
- package/dist/demo/DemoToast-BgHDhWrX.js +95 -0
- package/dist/demo/DemoToast-BgHDhWrX.js.map +1 -0
- package/dist/demo/{DemoTypeForm-CWz6fJrJ.js → DemoTypeForm-DDzWoMSV.js} +4 -4
- package/dist/demo/{DemoTypeForm-CWz6fJrJ.js.map → DemoTypeForm-DDzWoMSV.js.map} +1 -1
- package/dist/demo/DemoVerifyEmail-C_Irdnov.js +30 -0
- package/dist/demo/DemoVerifyEmail-C_Irdnov.js.map +1 -0
- package/dist/demo/IconGoogle-CSQLPYwX.js +56 -0
- package/dist/demo/IconGoogle-CSQLPYwX.js.map +1 -0
- package/dist/demo/Login-hSOU3jZc.js +219 -0
- package/dist/demo/Login-hSOU3jZc.js.map +1 -0
- package/dist/demo/Profile-CWqti7FB.js +155 -0
- package/dist/demo/Profile-CWqti7FB.js.map +1 -0
- package/dist/demo/Register-a70LPgs2.js +375 -0
- package/dist/demo/Register-a70LPgs2.js.map +1 -0
- package/dist/demo/ResetPassword-DWN0lzr5.js +286 -0
- package/dist/demo/ResetPassword-DWN0lzr5.js.map +1 -0
- package/dist/demo/Showcase-Dq3MISpd.js +232 -0
- package/dist/demo/Showcase-Dq3MISpd.js.map +1 -0
- package/dist/demo/VerifyEmail-DZWL72K4.js +135 -0
- package/dist/demo/VerifyEmail-DZWL72K4.js.map +1 -0
- package/dist/demo/auth-d6n3xbug.js +257 -0
- package/dist/demo/auth-d6n3xbug.js.map +1 -0
- package/dist/demo/core-RCUw1Q-a.js +4217 -0
- package/dist/demo/core-RCUw1Q-a.js.map +1 -0
- package/dist/demo/index.d.ts +17 -6
- package/dist/demo/index.d.ts.map +1 -1
- package/dist/demo/index.js +92 -24
- package/dist/demo/index.js.map +1 -1
- package/dist/demo/rolldown-runtime-CjeV3_4I.js +18 -0
- package/package.json +16 -20
- package/src/admin/AdminRouter.ts +10 -39
- package/src/admin/components/AdminLayout.tsx +42 -10
- package/src/admin/components/audits/AdminAudits.tsx +10 -64
- package/src/admin/components/files/AdminFiles.tsx +2 -3
- package/src/admin/components/jobs/AdminJobDashboard.tsx +36 -142
- package/src/admin/components/jobs/AdminJobExecutions.tsx +117 -175
- package/src/admin/components/jobs/AdminJobRegistry.tsx +58 -73
- package/src/admin/components/keys/AdminApiKeys.tsx +21 -169
- package/src/admin/components/parameters/AdminParameters.tsx +4 -4
- package/src/admin/components/parameters/ParameterEmptyState.tsx +1 -2
- package/src/admin/components/parameters/ParameterHistory.tsx +3 -3
- package/src/admin/components/parameters/ParameterTree.tsx +2 -8
- package/src/admin/components/parameters/types.ts +3 -3
- package/src/admin/components/sessions/AdminSessions.tsx +8 -16
- package/src/admin/components/users/AdminUserLayout.tsx +113 -150
- package/src/admin/components/users/AdminUserProfile.tsx +50 -0
- package/src/admin/components/users/AdminUserSessions.tsx +106 -126
- package/src/admin/components/users/AdminUsers.tsx +46 -62
- package/src/admin/index.ts +0 -4
- package/src/auth/components/buttons/UserButton.tsx +1 -1
- package/src/auth/index.ts +0 -4
- package/src/core/UiRouter.ts +1 -1
- package/src/core/atoms/alephaSidebarAtom.ts +7 -31
- package/src/core/components/{layout/AlephaMantineProvider.tsx → AlephaMantineProvider.tsx} +3 -4
- package/src/core/components/Flex.tsx +63 -0
- package/src/core/components/Heading.tsx +19 -0
- package/src/core/components/Text.tsx +140 -0
- package/src/core/components/buttons/ActionButton.tsx +12 -1
- package/src/core/components/buttons/BurgerButton.tsx +3 -3
- package/src/core/components/buttons/LanguageButton.tsx +1 -1
- package/src/core/components/buttons/ToggleSidebarButton.tsx +1 -4
- package/src/core/components/data/DetailDrawer.tsx +144 -0
- package/src/core/components/data/DetailList.tsx +64 -0
- package/src/core/components/data/StatCards.tsx +50 -0
- package/src/core/components/layout/AppBar.tsx +11 -10
- package/src/core/components/layout/Breadcrumb.tsx +8 -8
- package/src/core/components/layout/Container.tsx +15 -0
- package/src/core/components/layout/DashboardShell.tsx +23 -238
- package/src/core/components/layout/Omnibar.tsx +1 -2
- package/src/core/components/layout/Sidebar.tsx +103 -71
- package/src/core/components/layout/index.ts +65 -0
- package/src/core/{components/form → form/components}/Control.tsx +32 -14
- package/src/core/{components/form → form/components}/ControlArray.tsx +2 -5
- package/src/core/{components/form → form/components}/ControlDate.tsx +1 -4
- package/src/core/{components/form → form/components}/ControlNumber.tsx +1 -4
- package/src/core/{components/form → form/components}/ControlObject.tsx +1 -4
- package/src/core/{components/form → form/components}/ControlQueryBuilder.tsx +7 -7
- package/src/core/{components/form → form/components}/ControlSelect.tsx +2 -4
- package/src/core/{components/form → form/components}/TypeForm.browser.spec.tsx +22 -64
- package/src/core/{components/form → form/components}/TypeForm.tsx +1 -3
- package/src/core/form/factories/dialogForm.tsx +31 -0
- package/src/core/form/index.ts +23 -0
- package/src/core/{utils → form/utils}/parseInput.ts +2 -4
- package/src/core/index.ts +43 -51
- package/src/core/interfaces/AlephaIntent.ts +6 -0
- package/src/core/interfaces/AlephaTheme.ts +0 -1
- package/src/core/json/factories/dialogJson.tsx +24 -0
- package/src/core/json/index.ts +2 -0
- package/src/core/primitives/$ui.ts +17 -0
- package/src/core/services/DialogService.tsx +1 -48
- package/src/core/styles.css +1 -8
- package/src/core/{components/table → table/components}/ColumnPicker.tsx +2 -3
- package/src/core/{components/table → table/components}/DataTable.tsx +8 -9
- package/src/core/{components/table → table/components}/DataTableFilters.tsx +6 -3
- package/src/core/{components/table → table/components}/DataTableToolbar.tsx +4 -5
- package/src/core/{components/table → table/components}/FilterPicker.tsx +2 -3
- package/src/core/table/index.ts +12 -0
- package/src/core/{components/table → table/interfaces}/types.ts +2 -2
- package/src/demo/DemoRouter.ts +87 -6
- package/src/demo/components/DemoHome.tsx +6 -10
- package/src/demo/components/DemoLayout.tsx +38 -8
- package/src/demo/components/auth/DemoLogin.tsx +1 -1
- package/src/demo/components/auth/DemoRegister.tsx +1 -1
- package/src/demo/components/auth/DemoResetPassword.tsx +1 -1
- package/src/demo/components/auth/DemoVerifyEmail.tsx +1 -1
- package/src/demo/components/core/DemoButton.tsx +160 -0
- package/src/demo/components/core/DemoFlex.tsx +101 -0
- package/src/demo/components/core/DemoHeading.tsx +13 -0
- package/src/demo/components/core/DemoText.tsx +110 -0
- package/src/demo/components/json/DemoJsonViewer.tsx +1 -1
- package/src/demo/components/layout/DemoDialog.tsx +103 -0
- package/src/demo/components/{core → layout}/DemoSidebar.tsx +0 -1
- package/src/demo/components/layout/DemoToast.tsx +96 -0
- package/src/demo/components/shared/MacWindow.tsx +149 -74
- package/src/demo/components/shared/Showcase.tsx +4 -8
- package/src/demo/index.ts +1 -4
- package/src/demo/primitives/$uiDemo.ts +10 -0
- package/dist/admin/AdminApiKeys-CF_qOO3u.js.map +0 -1
- package/dist/admin/AdminAudits-BQno3hZG.js.map +0 -1
- package/dist/admin/AdminFiles-kvuUaASF.js.map +0 -1
- package/dist/admin/AdminJobDashboard-CrPxp0W1.js.map +0 -1
- package/dist/admin/AdminJobExecutions-D-b4Zt7W.js.map +0 -1
- package/dist/admin/AdminJobRegistry-CNX5cpDx.js.map +0 -1
- package/dist/admin/AdminLayout-e-ZP5nWw.js +0 -37
- package/dist/admin/AdminLayout-e-ZP5nWw.js.map +0 -1
- package/dist/admin/AdminParameters-DCGbpt2c.js.map +0 -1
- package/dist/admin/AdminSessions-DyhW6RZv.js.map +0 -1
- package/dist/admin/AdminUserAudits-D1GcREEE.js +0 -177
- package/dist/admin/AdminUserAudits-D1GcREEE.js.map +0 -1
- package/dist/admin/AdminUserCreate-DR8LA0tv.js +0 -104
- package/dist/admin/AdminUserCreate-DR8LA0tv.js.map +0 -1
- package/dist/admin/AdminUserDetails-CDkZNHQD.js +0 -477
- package/dist/admin/AdminUserDetails-CDkZNHQD.js.map +0 -1
- package/dist/admin/AdminUserLayout-CrBj4UuI.js.map +0 -1
- package/dist/admin/AdminUserSessions-srgFHrqy.js +0 -129
- package/dist/admin/AdminUserSessions-srgFHrqy.js.map +0 -1
- package/dist/admin/AdminUserSettings-BFuxl-xT.js +0 -167
- package/dist/admin/AdminUserSettings-BFuxl-xT.js.map +0 -1
- package/dist/admin/AdminUsers-D1pDpiwK.js +0 -118
- package/dist/admin/AdminUsers-D1pDpiwK.js.map +0 -1
- package/dist/demo/DemoDataTable-lnBKWBf8.js.map +0 -1
- package/dist/demo/DemoHome-CUMZsYaH.js.map +0 -1
- package/dist/demo/DemoJsonViewer-_uokbGaW.js +0 -429
- package/dist/demo/DemoJsonViewer-_uokbGaW.js.map +0 -1
- package/dist/demo/DemoLayout-DHVoacE6.js +0 -46
- package/dist/demo/DemoLayout-DHVoacE6.js.map +0 -1
- package/dist/demo/DemoLogin-DjJ9314c.js.map +0 -1
- package/dist/demo/DemoRegister-DzkJ5M83.js.map +0 -1
- package/dist/demo/DemoResetPassword-DWh4_BpQ.js.map +0 -1
- package/dist/demo/DemoSidebar-C1csnGhX.js.map +0 -1
- package/dist/demo/DemoVerifyEmail-DbU_tCj8.js.map +0 -1
- package/dist/demo/Showcase-BzoXNlCn.js +0 -185
- package/dist/demo/Showcase-BzoXNlCn.js.map +0 -1
- package/dist/json/index.d.ts +0 -57
- package/dist/json/index.d.ts.map +0 -1
- package/dist/json/index.js +0 -325
- package/dist/json/index.js.map +0 -1
- package/src/admin/components/users/AdminUserAudits.tsx +0 -184
- package/src/admin/components/users/AdminUserCreate.tsx +0 -85
- package/src/admin/components/users/AdminUserDetails.tsx +0 -431
- package/src/admin/components/users/AdminUserSettings.tsx +0 -171
- package/src/core/components/data/ErrorViewer.tsx +0 -171
- package/src/json/extensions/DialogService.tsx +0 -31
- package/src/json/index.ts +0 -18
- package/src/json/styles.css +0 -1
- /package/dist/{demo → auth}/IconGoogle-Ch1m3Uzl.js +0 -0
- /package/dist/{demo → auth}/IconGoogle-Ch1m3Uzl.js.map +0 -0
- /package/src/{json → core/json}/components/JsonViewer.css +0 -0
- /package/src/{json → core/json}/components/JsonViewer.tsx +0 -0
- /package/src/core/{components/table → table/components}/DataTablePagination.tsx +0 -0
- /package/src/core/{components/table → table/components}/useTableSelection.ts +0 -0
|
@@ -132,21 +132,17 @@ describe("TypeForm", () => {
|
|
|
132
132
|
});
|
|
133
133
|
});
|
|
134
134
|
|
|
135
|
-
describe("Boolean/
|
|
136
|
-
it("should render
|
|
135
|
+
describe("Boolean/Select", () => {
|
|
136
|
+
it("should render select for boolean type by default", async ({
|
|
137
137
|
expect,
|
|
138
138
|
}) => {
|
|
139
|
-
const calls: Array<any> = [];
|
|
140
|
-
|
|
141
139
|
const Form = () => {
|
|
142
140
|
const form = useForm({
|
|
143
141
|
id: "bool-test",
|
|
144
142
|
schema: t.object({
|
|
145
143
|
subscribe: t.boolean(),
|
|
146
144
|
}),
|
|
147
|
-
handler: (
|
|
148
|
-
calls.push(values);
|
|
149
|
-
},
|
|
145
|
+
handler: () => {},
|
|
150
146
|
});
|
|
151
147
|
|
|
152
148
|
return <TypeForm form={form} />;
|
|
@@ -154,67 +150,36 @@ describe("TypeForm", () => {
|
|
|
154
150
|
|
|
155
151
|
await renderWithAlepha(<Form />);
|
|
156
152
|
|
|
157
|
-
//
|
|
158
|
-
const
|
|
159
|
-
expect(
|
|
160
|
-
|
|
161
|
-
// Click to toggle on
|
|
162
|
-
fireEvent.click(switchInput);
|
|
163
|
-
fireEvent.submit(screen.getByText("Submit"));
|
|
164
|
-
|
|
165
|
-
await waitFor(() => expect(calls.length).toBe(1));
|
|
166
|
-
expect(calls[0]).toEqual({ subscribe: true });
|
|
153
|
+
// Boolean renders as Select with Yes/No options by default
|
|
154
|
+
const selectInput = screen.getByTestId("bool-test-subscribe");
|
|
155
|
+
expect(selectInput).toBeDefined();
|
|
156
|
+
expect(selectInput.getAttribute("aria-haspopup")).toBe("listbox");
|
|
167
157
|
});
|
|
168
158
|
|
|
169
|
-
it("should render switch
|
|
159
|
+
it("should render switch only when explicitly requested", async ({
|
|
160
|
+
expect,
|
|
161
|
+
}) => {
|
|
170
162
|
const Form = () => {
|
|
171
163
|
const form = useForm({
|
|
172
|
-
id: "bool-
|
|
164
|
+
id: "bool-switch-test",
|
|
173
165
|
schema: t.object({
|
|
174
166
|
subscribe: t.boolean(),
|
|
175
167
|
}),
|
|
176
168
|
handler: () => {},
|
|
177
169
|
});
|
|
178
170
|
|
|
179
|
-
return
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
// Should not be checked by default (no default value)
|
|
186
|
-
expect((switchInput as HTMLInputElement).checked).toBe(false);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
it("should handle default true value for boolean", async ({ expect }) => {
|
|
190
|
-
const calls: Array<any> = [];
|
|
191
|
-
|
|
192
|
-
const Form = () => {
|
|
193
|
-
const form = useForm({
|
|
194
|
-
id: "bool-default-test",
|
|
195
|
-
schema: t.object({
|
|
196
|
-
enabled: t.boolean({ default: true }),
|
|
197
|
-
}),
|
|
198
|
-
handler: (values) => {
|
|
199
|
-
calls.push(values);
|
|
200
|
-
},
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
return <TypeForm form={form} />;
|
|
171
|
+
return (
|
|
172
|
+
<TypeForm
|
|
173
|
+
form={form}
|
|
174
|
+
fieldControlProps={{ subscribe: { switch: true } }}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
204
177
|
};
|
|
205
178
|
|
|
206
179
|
await renderWithAlepha(<Form />);
|
|
207
180
|
|
|
208
181
|
const switchInput = screen.getByRole("switch");
|
|
209
|
-
|
|
210
|
-
expect((switchInput as HTMLInputElement).checked).toBe(true);
|
|
211
|
-
|
|
212
|
-
// Toggle off
|
|
213
|
-
fireEvent.click(switchInput);
|
|
214
|
-
fireEvent.submit(screen.getByText("Submit"));
|
|
215
|
-
|
|
216
|
-
await waitFor(() => expect(calls.length).toBe(1));
|
|
217
|
-
expect(calls[0]).toEqual({ enabled: false });
|
|
182
|
+
expect(switchInput).toBeDefined();
|
|
218
183
|
});
|
|
219
184
|
});
|
|
220
185
|
|
|
@@ -455,9 +420,10 @@ describe("TypeForm", () => {
|
|
|
455
420
|
const ageInput = screen.getByTestId("combined-test-age");
|
|
456
421
|
expect(ageInput).toBeDefined();
|
|
457
422
|
|
|
458
|
-
// Boolean
|
|
459
|
-
const
|
|
460
|
-
expect(
|
|
423
|
+
// Boolean select (rendered as Select by default, not Switch)
|
|
424
|
+
const activeSelect = screen.getByTestId("combined-test-active");
|
|
425
|
+
expect(activeSelect).toBeDefined();
|
|
426
|
+
expect(activeSelect.getAttribute("aria-haspopup")).toBe("listbox");
|
|
461
427
|
|
|
462
428
|
// Enum select (Mantine uses textbox with aria-haspopup)
|
|
463
429
|
const roleSelect = screen.getByRole("textbox", { name: "Role" });
|
|
@@ -468,9 +434,6 @@ describe("TypeForm", () => {
|
|
|
468
434
|
expect((nameInput as HTMLInputElement).value).toBe("Alice");
|
|
469
435
|
|
|
470
436
|
fireEvent.change(ageInput, { target: { value: "30" } });
|
|
471
|
-
|
|
472
|
-
fireEvent.click(activeSwitch);
|
|
473
|
-
expect((activeSwitch as HTMLInputElement).checked).toBe(true);
|
|
474
437
|
});
|
|
475
438
|
});
|
|
476
439
|
|
|
@@ -481,7 +444,6 @@ describe("TypeForm", () => {
|
|
|
481
444
|
id: "reset-test",
|
|
482
445
|
schema: t.object({
|
|
483
446
|
name: t.text({ default: "default name" }),
|
|
484
|
-
active: t.boolean({ default: false }),
|
|
485
447
|
}),
|
|
486
448
|
handler: () => {},
|
|
487
449
|
});
|
|
@@ -495,16 +457,12 @@ describe("TypeForm", () => {
|
|
|
495
457
|
const nameInput = screen.getByTestId("reset-test-name");
|
|
496
458
|
fireEvent.change(nameInput, { target: { value: "changed" } });
|
|
497
459
|
|
|
498
|
-
const switchInput = screen.getByRole("switch");
|
|
499
|
-
fireEvent.click(switchInput);
|
|
500
|
-
|
|
501
460
|
// Click reset
|
|
502
461
|
fireEvent.click(screen.getByText("Reset"));
|
|
503
462
|
|
|
504
463
|
// Values should be reset
|
|
505
464
|
await waitFor(() => {
|
|
506
465
|
expect((nameInput as HTMLInputElement).value).toBe("default name");
|
|
507
|
-
expect((switchInput as HTMLInputElement).checked).toBe(false);
|
|
508
466
|
});
|
|
509
467
|
});
|
|
510
468
|
});
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
+
import { ActionButton, type ActionSubmitButtonProps } from "@alepha/ui";
|
|
1
2
|
import { Card, Flex, type FlexProps, Grid } from "@mantine/core";
|
|
2
3
|
import type { TObject } from "alepha";
|
|
3
4
|
import type { FormModel } from "alepha/react/form";
|
|
4
5
|
import type { ReactNode } from "react";
|
|
5
|
-
import ActionButton, {
|
|
6
|
-
type ActionSubmitButtonProps,
|
|
7
|
-
} from "../buttons/ActionButton.tsx";
|
|
8
6
|
import Control, { type ControlProps } from "./Control.tsx";
|
|
9
7
|
|
|
10
8
|
export interface TypeFormProps<T extends TObject> {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { BaseDialogOptions } from "@alepha/ui";
|
|
2
|
+
import type { TObject } from "alepha";
|
|
3
|
+
import type { FormModel } from "alepha/react/form";
|
|
4
|
+
import TypeForm, { type TypeFormProps } from "../components/TypeForm.tsx";
|
|
5
|
+
|
|
6
|
+
export interface DialogFormOptions<T extends TObject>
|
|
7
|
+
extends BaseDialogOptions {
|
|
8
|
+
typeFormProps?: Partial<Omit<TypeFormProps<T>, "form">>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates dialog options for a form dialog.
|
|
13
|
+
*
|
|
14
|
+
* @param form - The form model to render.
|
|
15
|
+
* @param options - Additional dialog and TypeForm options.
|
|
16
|
+
*/
|
|
17
|
+
export const dialogForm = <T extends TObject>(
|
|
18
|
+
form: FormModel<T>,
|
|
19
|
+
options?: DialogFormOptions<T>,
|
|
20
|
+
): BaseDialogOptions => ({
|
|
21
|
+
size: "lg",
|
|
22
|
+
title: options?.title || "Form",
|
|
23
|
+
...options,
|
|
24
|
+
content: (
|
|
25
|
+
<TypeForm
|
|
26
|
+
form={form}
|
|
27
|
+
skipSubmitButton={false}
|
|
28
|
+
{...options?.typeFormProps}
|
|
29
|
+
/>
|
|
30
|
+
),
|
|
31
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ControlProps } from "./components/Control.tsx";
|
|
2
|
+
|
|
3
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
export type { ControlProps } from "./components/Control.tsx";
|
|
6
|
+
export { default as Control } from "./components/Control.tsx";
|
|
7
|
+
export { default as ControlArray } from "./components/ControlArray.tsx";
|
|
8
|
+
export { default as ControlDate } from "./components/ControlDate.tsx";
|
|
9
|
+
export { default as ControlNumber } from "./components/ControlNumber.tsx";
|
|
10
|
+
export { default as ControlObject } from "./components/ControlObject.tsx";
|
|
11
|
+
export { default as ControlQueryBuilder } from "./components/ControlQueryBuilder.tsx";
|
|
12
|
+
export { default as ControlSelect } from "./components/ControlSelect.tsx";
|
|
13
|
+
export type { TypeFormProps } from "./components/TypeForm.tsx";
|
|
14
|
+
export { default as TypeForm } from "./components/TypeForm.tsx";
|
|
15
|
+
export { type DialogFormOptions, dialogForm } from "./factories/dialogForm.tsx";
|
|
16
|
+
|
|
17
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
declare module "typebox" {
|
|
20
|
+
interface TSchemaOptions {
|
|
21
|
+
$control?: Omit<ControlProps, "input">;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getDefaultIcon, prettyName, ui } from "@alepha/ui";
|
|
1
2
|
import { type TObject, TypeBoxError } from "alepha";
|
|
2
3
|
import type { BaseInputField } from "alepha/react/form";
|
|
3
4
|
import {
|
|
@@ -6,10 +7,7 @@ import {
|
|
|
6
7
|
type ReactElement,
|
|
7
8
|
type ReactNode,
|
|
8
9
|
} from "react";
|
|
9
|
-
import type { ControlProps } from "../components/
|
|
10
|
-
import { ui } from "../constants/ui.ts";
|
|
11
|
-
import { getDefaultIcon } from "./icons.tsx";
|
|
12
|
-
import { prettyName } from "./string.ts";
|
|
10
|
+
import type { ControlProps } from "../components/Control.tsx";
|
|
13
11
|
|
|
14
12
|
export const parseInput = (
|
|
15
13
|
props: GenericControlProps,
|
package/src/core/index.ts
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $module, type Static } from "alepha";
|
|
2
2
|
import { AlephaReactForm } from "alepha/react/form";
|
|
3
3
|
import { AlephaReactHead } from "alepha/react/head";
|
|
4
4
|
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
5
5
|
import type { ComponentType, ReactNode } from "react";
|
|
6
6
|
import { alephaSidebarAtom } from "./atoms/alephaSidebarAtom.ts";
|
|
7
7
|
import { alephaThemeAtom } from "./atoms/alephaThemeAtom.ts";
|
|
8
|
-
import {
|
|
9
|
-
type AlephaThemeListAtom,
|
|
10
|
-
alephaThemeListAtom,
|
|
11
|
-
} from "./atoms/alephaThemeListAtom.ts";
|
|
12
|
-
import type { ControlProps } from "./components/form/Control.tsx";
|
|
13
8
|
import { ThemeProvider } from "./providers/ThemeProvider.ts";
|
|
14
9
|
import { DialogService } from "./services/DialogService.tsx";
|
|
15
10
|
import { ToastService } from "./services/ToastService.tsx";
|
|
@@ -17,12 +12,13 @@ import { UiRouter } from "./UiRouter.ts";
|
|
|
17
12
|
|
|
18
13
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
19
14
|
|
|
20
|
-
export { Flex, Text } from "@mantine/core";
|
|
21
15
|
export * from "./atoms/alephaSidebarAtom.ts";
|
|
22
16
|
export * from "./atoms/alephaThemeAtom.ts";
|
|
23
17
|
export * from "./atoms/alephaThemeListAtom.ts";
|
|
24
18
|
export * from "./atoms/themes/default.ts";
|
|
25
19
|
export * from "./atoms/themes/midnight.ts";
|
|
20
|
+
export type { AlephaMantineProviderProps } from "./components/AlephaMantineProvider.tsx";
|
|
21
|
+
export { default as AlephaMantineProvider } from "./components/AlephaMantineProvider.tsx";
|
|
26
22
|
export type {
|
|
27
23
|
ActionClickButtonProps,
|
|
28
24
|
ActionCommonProps,
|
|
@@ -38,41 +34,57 @@ export type { ClipboardButtonProps } from "./components/buttons/ClipboardButton.
|
|
|
38
34
|
export { default as ClipboardButton } from "./components/buttons/ClipboardButton.tsx";
|
|
39
35
|
export { default as DarkModeButton } from "./components/buttons/DarkModeButton.tsx";
|
|
40
36
|
export { default as LanguageButton } from "./components/buttons/LanguageButton.tsx";
|
|
37
|
+
export type { OmnibarButtonProps } from "./components/buttons/OmnibarButton.tsx";
|
|
41
38
|
export { default as OmnibarButton } from "./components/buttons/OmnibarButton.tsx";
|
|
42
39
|
export { default as ThemeButton } from "./components/buttons/ThemeButton.tsx";
|
|
43
|
-
export { default as
|
|
40
|
+
export { default as SidebarCollapseButton } from "./components/buttons/ToggleSidebarButton.tsx";
|
|
41
|
+
export type {
|
|
42
|
+
DetailDrawerProps,
|
|
43
|
+
DetailDrawerStatus,
|
|
44
|
+
DetailDrawerTab,
|
|
45
|
+
} from "./components/data/DetailDrawer.tsx";
|
|
46
|
+
export { default as DetailDrawer } from "./components/data/DetailDrawer.tsx";
|
|
47
|
+
export type {
|
|
48
|
+
DetailListItem,
|
|
49
|
+
DetailListProps,
|
|
50
|
+
} from "./components/data/DetailList.tsx";
|
|
51
|
+
export { default as DetailList } from "./components/data/DetailList.tsx";
|
|
52
|
+
export type {
|
|
53
|
+
StatCardItem,
|
|
54
|
+
StatCardsProps,
|
|
55
|
+
} from "./components/data/StatCards.tsx";
|
|
56
|
+
export { default as StatCards } from "./components/data/StatCards.tsx";
|
|
44
57
|
export { default as AlertDialog } from "./components/dialogs/AlertDialog.tsx";
|
|
45
58
|
export { default as ConfirmDialog } from "./components/dialogs/ConfirmDialog.tsx";
|
|
46
59
|
export { default as PromptDialog } from "./components/dialogs/PromptDialog.tsx";
|
|
47
|
-
export {
|
|
48
|
-
export { default as
|
|
49
|
-
export { default as
|
|
50
|
-
export { default as ControlNumber } from "./components/form/ControlNumber.tsx";
|
|
51
|
-
export { default as ControlObject } from "./components/form/ControlObject.tsx";
|
|
52
|
-
export { default as ControlQueryBuilder } from "./components/form/ControlQueryBuilder.tsx";
|
|
53
|
-
export { default as ControlSelect } from "./components/form/ControlSelect.tsx";
|
|
54
|
-
export { default as TypeForm } from "./components/form/TypeForm.tsx";
|
|
55
|
-
export { default as AlephaMantineProvider } from "./components/layout/AlephaMantineProvider.tsx";
|
|
60
|
+
export type { FlexProps } from "./components/Flex.tsx";
|
|
61
|
+
export { default as Flex } from "./components/Flex.tsx";
|
|
62
|
+
export { default as Heading } from "./components/Heading.tsx";
|
|
56
63
|
export type {
|
|
64
|
+
AppBarBack,
|
|
57
65
|
AppBarBurger,
|
|
58
66
|
AppBarDark,
|
|
59
67
|
AppBarDivider,
|
|
60
68
|
AppBarElement,
|
|
61
69
|
AppBarItem,
|
|
62
70
|
AppBarLang,
|
|
71
|
+
AppBarLogo,
|
|
63
72
|
AppBarProps,
|
|
64
73
|
AppBarSearch,
|
|
65
74
|
AppBarSpacer,
|
|
66
75
|
} from "./components/layout/AppBar.tsx";
|
|
67
76
|
export { default as AppBar } from "./components/layout/AppBar.tsx";
|
|
68
77
|
export type { BreadcrumbProps } from "./components/layout/Breadcrumb.tsx";
|
|
69
|
-
export { default as
|
|
78
|
+
export { default as Breadcrumbs } from "./components/layout/Breadcrumb.tsx";
|
|
79
|
+
export type { ContainerProps } from "./components/layout/Container.tsx";
|
|
80
|
+
export { default as Container } from "./components/layout/Container.tsx";
|
|
70
81
|
export {
|
|
71
82
|
type DashboardShellProps,
|
|
72
83
|
type DashboardShellProps as AdminShellProps,
|
|
73
84
|
default as DashboardShell,
|
|
74
85
|
default as AdminShell,
|
|
75
86
|
} from "./components/layout/DashboardShell.tsx";
|
|
87
|
+
export type { OmnibarProps } from "./components/layout/Omnibar.tsx";
|
|
76
88
|
export { default as Omnibar } from "./components/layout/Omnibar.tsx";
|
|
77
89
|
export type {
|
|
78
90
|
SidebarAbstractItem,
|
|
@@ -89,21 +101,20 @@ export type {
|
|
|
89
101
|
SidebarTheme,
|
|
90
102
|
} from "./components/layout/Sidebar.tsx";
|
|
91
103
|
export { Sidebar } from "./components/layout/Sidebar.tsx";
|
|
92
|
-
export {
|
|
93
|
-
export
|
|
94
|
-
CheckboxAction,
|
|
95
|
-
CheckboxActionContext,
|
|
96
|
-
ColumnVisibility,
|
|
97
|
-
DataTableColumn,
|
|
98
|
-
DataTableColumnContext,
|
|
99
|
-
DataTableProps,
|
|
100
|
-
DataTableSubmitContext,
|
|
101
|
-
FilterVisibility,
|
|
102
|
-
MaybePage,
|
|
103
|
-
} from "./components/table/types.ts";
|
|
104
|
+
export type { TextProps } from "./components/Text.tsx";
|
|
105
|
+
export { default as Text } from "./components/Text.tsx";
|
|
104
106
|
export * from "./constants/ui.ts";
|
|
107
|
+
// Form
|
|
108
|
+
export * from "./form/index.ts";
|
|
109
|
+
export * from "./helpers/isComponentType.ts";
|
|
110
|
+
export * from "./helpers/renderIcon.tsx";
|
|
105
111
|
export { useDialog } from "./hooks/useDialog.ts";
|
|
112
|
+
export { useTheme } from "./hooks/useTheme.ts";
|
|
106
113
|
export { useToast } from "./hooks/useToast.ts";
|
|
114
|
+
export * from "./interfaces/AlephaIntent.ts";
|
|
115
|
+
// JSON
|
|
116
|
+
export * from "./json/index.ts";
|
|
117
|
+
export * from "./primitives/$ui.ts";
|
|
107
118
|
export * from "./providers/ThemeProvider.ts";
|
|
108
119
|
export type {
|
|
109
120
|
AlertDialogOptions,
|
|
@@ -116,6 +127,8 @@ export type {
|
|
|
116
127
|
} from "./services/DialogService.tsx";
|
|
117
128
|
export { DialogService } from "./services/DialogService.tsx";
|
|
118
129
|
export { ToastService } from "./services/ToastService.tsx";
|
|
130
|
+
// Table
|
|
131
|
+
export * from "./table/index.ts";
|
|
119
132
|
export * from "./UiRouter.ts";
|
|
120
133
|
export * from "./utils/extractSchemaFields.ts";
|
|
121
134
|
export * from "./utils/icons.tsx";
|
|
@@ -123,12 +136,6 @@ export * from "./utils/string.ts";
|
|
|
123
136
|
|
|
124
137
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
125
138
|
|
|
126
|
-
declare module "typebox" {
|
|
127
|
-
interface TSchemaOptions {
|
|
128
|
-
$control?: Omit<ControlProps, "input">;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
139
|
declare module "alepha" {
|
|
133
140
|
interface State {
|
|
134
141
|
[alephaSidebarAtom.key]?: Static<typeof alephaSidebarAtom.schema>;
|
|
@@ -163,10 +170,6 @@ declare module "alepha/react/router" {
|
|
|
163
170
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
164
171
|
|
|
165
172
|
/**
|
|
166
|
-
* | Stability | Since | Runtime |
|
|
167
|
-
* |-----------|-------|---------|
|
|
168
|
-
* | 2 - beta | 0.12.0 | node, bun, workerd, browser|
|
|
169
|
-
*
|
|
170
173
|
* Core UI components based on Mantine UI v8.
|
|
171
174
|
*
|
|
172
175
|
* **Features:**
|
|
@@ -197,14 +200,3 @@ export const AlephaUI = $module({
|
|
|
197
200
|
alepha.with(ToastService);
|
|
198
201
|
},
|
|
199
202
|
});
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Convenience function to configure and inject the UiRouter.
|
|
203
|
-
*/
|
|
204
|
-
export const $ui = (options: { themes?: AlephaThemeListAtom } = {}) => {
|
|
205
|
-
const { alepha } = $context();
|
|
206
|
-
if (options.themes) {
|
|
207
|
-
alepha.store.set(alephaThemeListAtom, options.themes);
|
|
208
|
-
}
|
|
209
|
-
return alepha.inject(UiRouter); // Inject as singleton ?
|
|
210
|
-
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BaseDialogOptions } from "@alepha/ui";
|
|
2
|
+
import { ui } from "@alepha/ui";
|
|
3
|
+
import { Flex } from "@mantine/core";
|
|
4
|
+
import { JsonViewer } from "../components/JsonViewer.tsx";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates dialog options for a JSON viewer dialog.
|
|
8
|
+
*
|
|
9
|
+
* @param data - The JSON data to display.
|
|
10
|
+
* @param options - Additional dialog options.
|
|
11
|
+
*/
|
|
12
|
+
export const dialogJson = (
|
|
13
|
+
data?: any,
|
|
14
|
+
options?: BaseDialogOptions,
|
|
15
|
+
): BaseDialogOptions => ({
|
|
16
|
+
size: "lg",
|
|
17
|
+
title: options?.title || "Json Viewer",
|
|
18
|
+
...options,
|
|
19
|
+
content: (
|
|
20
|
+
<Flex bdrs={"md"} w={"100%"} flex={1} p={"sm"} bg={ui.colors.surface}>
|
|
21
|
+
<JsonViewer size={"xs"} data={data} />
|
|
22
|
+
</Flex>
|
|
23
|
+
),
|
|
24
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { $context } from "alepha";
|
|
2
|
+
import {
|
|
3
|
+
type AlephaThemeListAtom,
|
|
4
|
+
alephaThemeListAtom,
|
|
5
|
+
} from "../atoms/alephaThemeListAtom.ts";
|
|
6
|
+
import { UiRouter } from "../UiRouter.ts";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Convenience function to configure and inject the UiRouter.
|
|
10
|
+
*/
|
|
11
|
+
export const $ui = (options: { themes?: AlephaThemeListAtom } = {}) => {
|
|
12
|
+
const { alepha } = $context();
|
|
13
|
+
if (options.themes) {
|
|
14
|
+
alepha.store.set(alephaThemeListAtom, options.themes);
|
|
15
|
+
}
|
|
16
|
+
return alepha.inject(UiRouter); // Inject as singleton ?
|
|
17
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ModalProps } from "@mantine/core";
|
|
2
2
|
import { modals } from "@mantine/modals";
|
|
3
3
|
import type { ReactNode } from "react";
|
|
4
|
-
import ErrorViewer from "../components/data/ErrorViewer.tsx";
|
|
5
4
|
import AlertDialog from "../components/dialogs/AlertDialog.tsx";
|
|
6
5
|
import ConfirmDialog from "../components/dialogs/ConfirmDialog.tsx";
|
|
7
6
|
import PromptDialog from "../components/dialogs/PromptDialog.tsx";
|
|
8
|
-
import { ui } from "../constants/ui.ts";
|
|
9
7
|
|
|
10
8
|
// Base interfaces
|
|
11
9
|
export interface BaseDialogOptions extends Partial<ModalProps> {
|
|
@@ -158,49 +156,4 @@ export class DialogService {
|
|
|
158
156
|
modals.closeAll();
|
|
159
157
|
}
|
|
160
158
|
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Show an error viewer dialog
|
|
164
|
-
*/
|
|
165
|
-
public error(
|
|
166
|
-
error: Error | unknown,
|
|
167
|
-
options?: BaseDialogOptions & { showStack?: boolean },
|
|
168
|
-
): void {
|
|
169
|
-
this.open({
|
|
170
|
-
size: "lg",
|
|
171
|
-
title: options?.title || "Error",
|
|
172
|
-
...options,
|
|
173
|
-
content: (
|
|
174
|
-
<Flex bdrs={"md"} w={"100%"} flex={1} p={"sm"} bg={ui.colors.surface}>
|
|
175
|
-
<ErrorViewer
|
|
176
|
-
size={"xs"}
|
|
177
|
-
error={error}
|
|
178
|
-
showStack={options?.showStack ?? true}
|
|
179
|
-
/>
|
|
180
|
-
</Flex>
|
|
181
|
-
),
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Show a form dialog for structured input
|
|
187
|
-
*/
|
|
188
|
-
public form(options?: BaseDialogOptions): Promise<any> {
|
|
189
|
-
// Implementation to be added
|
|
190
|
-
return Promise.resolve(null);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Show a loading/progress dialog with optional progress percentage
|
|
195
|
-
*/
|
|
196
|
-
public loading(options?: BaseDialogOptions & { progress?: number }): void {
|
|
197
|
-
// Implementation to be added
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Show an image viewer/gallery dialog
|
|
202
|
-
*/
|
|
203
|
-
public image(src: string | string[], options?: BaseDialogOptions): void {
|
|
204
|
-
// Implementation to be added
|
|
205
|
-
}
|
|
206
159
|
}
|
package/src/core/styles.css
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@import "@mantine/notifications/styles.css";
|
|
6
6
|
@import "@mantine/charts/styles.css";
|
|
7
7
|
@import "./components/buttons/DarkModeButton.css";
|
|
8
|
+
@import "./json/components/JsonViewer.css";
|
|
8
9
|
|
|
9
10
|
:root {
|
|
10
11
|
--alepha-background-light: var(--mantine-color-gray-1);
|
|
@@ -102,18 +103,10 @@
|
|
|
102
103
|
transition: width 0.2s ease-in-out;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
.alepha-sidebar-navbar[data-resizing="true"] {
|
|
106
|
-
transition: none;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
106
|
.alepha-sidebar-main {
|
|
110
107
|
transition: padding-left 0.2s ease-in-out;
|
|
111
108
|
}
|
|
112
109
|
|
|
113
|
-
.alepha-sidebar-main[data-resizing="true"] {
|
|
114
|
-
transition: none;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
110
|
/* ------------------------------------------------------------------------------------------------------------------ */
|
|
118
111
|
/* Modal Customizations */
|
|
119
112
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import { ActionButton, ui } from "@alepha/ui";
|
|
1
2
|
import { Checkbox, Flex, Popover, ScrollArea, Text } from "@mantine/core";
|
|
2
3
|
import { IconColumns } from "@tabler/icons-react";
|
|
3
4
|
import type { TObject } from "alepha";
|
|
4
5
|
import { useState } from "react";
|
|
5
|
-
import { ui } from "../../constants/ui.ts";
|
|
6
|
-
import ActionButton from "../buttons/ActionButton.tsx";
|
|
7
6
|
import {
|
|
8
7
|
type ColumnVisibility,
|
|
9
8
|
type DataTableColumn,
|
|
10
9
|
DEFAULT_MAX_VISIBLE_COLUMNS,
|
|
11
|
-
} from "
|
|
10
|
+
} from "../interfaces/types.ts";
|
|
12
11
|
|
|
13
12
|
export interface ColumnPickerProps<T extends object, Filters extends TObject> {
|
|
14
13
|
columns: { [key: string]: DataTableColumn<T, Filters> };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActionButton, ui } from "@alepha/ui";
|
|
1
2
|
import {
|
|
2
3
|
Checkbox,
|
|
3
4
|
Drawer,
|
|
@@ -18,21 +19,19 @@ import { DateTimeProvider } from "alepha/datetime";
|
|
|
18
19
|
import { useInject } from "alepha/react";
|
|
19
20
|
import { type FormModel, useForm } from "alepha/react/form";
|
|
20
21
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
21
|
-
import { ui } from "../../constants/ui.ts";
|
|
22
|
-
import ActionButton from "../buttons/ActionButton.tsx";
|
|
23
|
-
import DataTableFilters, {
|
|
24
|
-
type DataTableFiltersProps,
|
|
25
|
-
} from "./DataTableFilters.tsx";
|
|
26
|
-
import DataTablePagination from "./DataTablePagination.tsx";
|
|
27
|
-
import DataTableToolbar from "./DataTableToolbar.tsx";
|
|
28
22
|
import type {
|
|
29
23
|
ColumnVisibility,
|
|
30
24
|
DataTableColumnContext,
|
|
31
25
|
DataTableProps,
|
|
32
26
|
FilterVisibility,
|
|
33
27
|
MaybePage,
|
|
34
|
-
} from "
|
|
35
|
-
import { DEFAULT_MAX_VISIBLE_COLUMNS } from "
|
|
28
|
+
} from "../interfaces/types.ts";
|
|
29
|
+
import { DEFAULT_MAX_VISIBLE_COLUMNS } from "../interfaces/types.ts";
|
|
30
|
+
import DataTableFilters, {
|
|
31
|
+
type DataTableFiltersProps,
|
|
32
|
+
} from "./DataTableFilters.tsx";
|
|
33
|
+
import DataTablePagination from "./DataTablePagination.tsx";
|
|
34
|
+
import DataTableToolbar from "./DataTableToolbar.tsx";
|
|
36
35
|
import { useTableSelection } from "./useTableSelection.ts";
|
|
37
36
|
|
|
38
37
|
type SortDirection = "asc" | "desc" | null;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import { ui } from "@alepha/ui";
|
|
1
2
|
import { Flex } from "@mantine/core";
|
|
2
3
|
import { type TObject, t } from "alepha";
|
|
3
4
|
import type { FormModel } from "alepha/react/form";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
default as TypeForm,
|
|
8
|
+
type TypeFormProps,
|
|
9
|
+
} from "../../form/components/TypeForm.tsx";
|
|
10
|
+
import type { FilterVisibility } from "../interfaces/types.ts";
|
|
8
11
|
|
|
9
12
|
export interface DataTableFiltersProps {
|
|
10
13
|
schema: TObject;
|