@headless-adminapp/app 0.0.10-alpha.0 → 0.0.14-alpha.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/dataform → dataform}/hooks/index.d.ts +1 -0
- package/{dist/dataform → dataform}/hooks/index.js +1 -0
- package/{dist/dataform → dataform}/utils/index.d.ts +8 -4
- package/form/index.d.ts +1 -0
- package/{dist/mutable → mutable}/index.d.ts +1 -1
- package/package.json +8 -16
- package/dist/form/index.d.ts +0 -1
- package/src/app/context.ts +0 -11
- package/src/app/hooks/index.ts +0 -1
- package/src/app/hooks/useAppContext.ts +0 -13
- package/src/app/index.ts +0 -2
- package/src/appearance/context.ts +0 -13
- package/src/appearance/hooks/index.ts +0 -1
- package/src/appearance/hooks/useAppearanceContext.ts +0 -13
- package/src/appearance/index.ts +0 -6
- package/src/auth/AuthProvider.tsx +0 -118
- package/src/auth/context.ts +0 -41
- package/src/auth/hooks/index.ts +0 -2
- package/src/auth/hooks/useAuthSession.ts +0 -17
- package/src/auth/hooks/useLogout.ts +0 -23
- package/src/auth/index.ts +0 -4
- package/src/auth/types.ts +0 -17
- package/src/builders/CommandBuilder.ts +0 -777
- package/src/builders/SchemaExperienceBuilder.ts +0 -488
- package/src/builders/index.ts +0 -5
- package/src/command/hooks/index.ts +0 -2
- package/src/command/hooks/useBaseCommandHandlerContext.ts +0 -51
- package/src/command/hooks/useCommands.ts +0 -26
- package/src/command/index.ts +0 -2
- package/src/command/types.ts +0 -116
- package/src/command/utils/index.ts +0 -142
- package/src/components/ScrollView/index.tsx +0 -26
- package/src/dataform/DataFormProvider/DataResolver.tsx +0 -186
- package/src/dataform/DataFormProvider/InitialValueResolver.tsx +0 -55
- package/src/dataform/DataFormProvider/ReadonlyInfoResolver.tsx +0 -35
- package/src/dataform/DataFormProvider/index.tsx +0 -102
- package/src/dataform/context.ts +0 -53
- package/src/dataform/hooks/index.ts +0 -11
- package/src/dataform/hooks/useFormInstance.ts +0 -6
- package/src/dataform/hooks/useFormIsDirty.ts +0 -7
- package/src/dataform/hooks/useFormIsReadonly.ts +0 -11
- package/src/dataform/hooks/useFormNotifications.ts +0 -46
- package/src/dataform/hooks/useFormRecord.ts +0 -7
- package/src/dataform/hooks/useFormSave.ts +0 -147
- package/src/dataform/hooks/useFormSchema.ts +0 -13
- package/src/dataform/hooks/useLoadFormGridPage.ts +0 -97
- package/src/dataform/hooks/useMainFormCommands.ts +0 -65
- package/src/dataform/hooks/useRecordId.ts +0 -6
- package/src/dataform/hooks/useRecordTitle.ts +0 -22
- package/src/dataform/hooks/useSelectedForm.ts +0 -14
- package/src/dataform/index.ts +0 -4
- package/src/dataform/utils/index.ts +0 -582
- package/src/datagrid/DataGridProvider/DataResolver.tsx +0 -281
- package/src/datagrid/DataGridProvider/index.tsx +0 -134
- package/src/datagrid/DataGridProvider/transformViewColumns.ts +0 -54
- package/src/datagrid/DataGridProvider/utils.ts +0 -89
- package/src/datagrid/column-filter/constants.ts +0 -493
- package/src/datagrid/column-filter/index.ts +0 -3
- package/src/datagrid/column-filter/types.ts +0 -68
- package/src/datagrid/column-filter/utils.ts +0 -19
- package/src/datagrid/context.ts +0 -66
- package/src/datagrid/hooks/index.ts +0 -20
- package/src/datagrid/hooks/useChangeView.ts +0 -18
- package/src/datagrid/hooks/useGridColumnFilter.ts +0 -28
- package/src/datagrid/hooks/useGridColumns.ts +0 -13
- package/src/datagrid/hooks/useGridCommands.ts +0 -21
- package/src/datagrid/hooks/useGridData.ts +0 -8
- package/src/datagrid/hooks/useGridDataState.ts +0 -8
- package/src/datagrid/hooks/useGridExtraFilter.ts +0 -6
- package/src/datagrid/hooks/useGridOptions.ts +0 -3
- package/src/datagrid/hooks/useGridPagination.ts +0 -3
- package/src/datagrid/hooks/useGridRefresh.ts +0 -19
- package/src/datagrid/hooks/useGridSchema.ts +0 -13
- package/src/datagrid/hooks/useGridSelection.ts +0 -28
- package/src/datagrid/hooks/useGridSorting.ts +0 -23
- package/src/datagrid/hooks/useGridViewLookupData.ts +0 -10
- package/src/datagrid/hooks/useLoadMainGridPage.ts +0 -90
- package/src/datagrid/hooks/useMainGridCommands.ts +0 -255
- package/src/datagrid/hooks/useMaxRecords.ts +0 -6
- package/src/datagrid/hooks/useSearchText.ts +0 -22
- package/src/datagrid/hooks/useSelectedView.ts +0 -14
- package/src/datagrid/hooks/useSubGridCommands.ts +0 -104
- package/src/datagrid/index.ts +0 -14
- package/src/dialog/DialogProvider.tsx +0 -20
- package/src/dialog/context.ts +0 -14
- package/src/dialog/hooks/index.ts +0 -8
- package/src/dialog/hooks/useCloseDialog.ts +0 -36
- package/src/dialog/hooks/useDialogItem.ts +0 -8
- package/src/dialog/hooks/useDialogItems.ts +0 -6
- package/src/dialog/hooks/useOpenAlertDialog.ts +0 -30
- package/src/dialog/hooks/useOpenConfirmDialog.ts +0 -45
- package/src/dialog/hooks/useOpenDialog.ts +0 -39
- package/src/dialog/hooks/useOpenErrorDialog.ts +0 -26
- package/src/dialog/hooks/useOpenPromptDialog.ts +0 -46
- package/src/dialog/index.ts +0 -7
- package/src/form/FormValidationStringContext.ts +0 -30
- package/src/form/index.ts +0 -6
- package/src/hooks/index.ts +0 -5
- package/src/hooks/useDebouncedValue.ts +0 -38
- package/src/hooks/useElementLayout.ts +0 -49
- package/src/hooks/useIsMobile.ts +0 -21
- package/src/hooks/useStorageState.ts +0 -36
- package/src/hooks/useSystemColorScheme.ts +0 -38
- package/src/index.css +0 -4
- package/src/insights/context.ts +0 -5
- package/src/insights/hooks/index.ts +0 -14
- package/src/insights/index.ts +0 -2
- package/src/locale/context.ts +0 -7
- package/src/locale/index.ts +0 -3
- package/src/locale/types.ts +0 -3
- package/src/locale/useLocale.ts +0 -13
- package/src/metadata/MetadataProvider.tsx +0 -51
- package/src/metadata/context.ts +0 -15
- package/src/metadata/hooks/index.ts +0 -8
- package/src/metadata/hooks/useAppStore.ts +0 -6
- package/src/metadata/hooks/useExperienceStore.ts +0 -6
- package/src/metadata/hooks/useExperienceView.ts +0 -36
- package/src/metadata/hooks/useExperienceViewCommands.ts +0 -20
- package/src/metadata/hooks/useExperienceViewLookup.ts +0 -33
- package/src/metadata/hooks/useExperienceViewSubgridCommands.ts +0 -20
- package/src/metadata/hooks/useMetadata.ts +0 -44
- package/src/metadata/hooks/useSchema.ts +0 -11
- package/src/metadata/index.ts +0 -3
- package/src/mutable/context.ts +0 -71
- package/src/mutable/index.ts +0 -10
- package/src/mutable/state.ts +0 -13
- package/src/mutable/type.ts +0 -9
- package/src/mutable/utils.ts +0 -80
- package/src/navigation/hooks/useOpenForm.ts +0 -34
- package/src/progress-indicator/ProgressIndicatorProvider.tsx +0 -77
- package/src/progress-indicator/context.ts +0 -12
- package/src/progress-indicator/hooks/index.ts +0 -1
- package/src/progress-indicator/hooks/useProgressIndicator.ts +0 -15
- package/src/progress-indicator/index.ts +0 -6
- package/src/providers/PageEntityFormProvider/index.tsx +0 -34
- package/src/providers/PageEntityViewProvider/index.tsx +0 -39
- package/src/recordset/RecordSetProvider.tsx +0 -55
- package/src/recordset/context.ts +0 -12
- package/src/recordset/hooks/index.ts +0 -3
- package/src/recordset/hooks/useRecordSetResult.ts +0 -94
- package/src/recordset/hooks/useRecordSetSetter.ts +0 -21
- package/src/recordset/hooks/useRecordSetVisibility.ts +0 -24
- package/src/recordset/index.ts +0 -3
- package/src/route/RouteProvider.tsx +0 -76
- package/src/route/context.ts +0 -39
- package/src/route/hooks/index.ts +0 -5
- package/src/route/hooks/useBasePath.ts +0 -7
- package/src/route/hooks/usePathname.ts +0 -7
- package/src/route/hooks/useRouteResolver.ts +0 -7
- package/src/route/hooks/useRouter.ts +0 -7
- package/src/route/hooks/useSearchParams.ts +0 -7
- package/src/route/index.ts +0 -2
- package/src/route/types.ts +0 -1
- package/src/store/ClientAppStore.ts +0 -20
- package/src/store/ComponentStore.tsx +0 -22
- package/src/store/EventManager.ts +0 -33
- package/src/store/SchemaExperienceStore.ts +0 -374
- package/src/store/index.ts +0 -4
- package/src/toast-notification/ToastNotificationProvider.tsx +0 -23
- package/src/toast-notification/context.ts +0 -17
- package/src/toast-notification/hooks/index.ts +0 -3
- package/src/toast-notification/hooks/useCloseToastNotification.ts +0 -36
- package/src/toast-notification/hooks/useOpenToastNotification.ts +0 -38
- package/src/toast-notification/hooks/useToastNotificationItems.ts +0 -6
- package/src/toast-notification/index.ts +0 -7
- package/src/transport/InMemoryDataService/index.ts +0 -157
- package/src/transport/RestDataService/index.ts +0 -151
- package/src/transport/context.ts +0 -6
- package/src/transport/hooks/index.ts +0 -1
- package/src/transport/hooks/useDataService.ts +0 -13
- package/src/transport/index.ts +0 -2
- package/src/utils/calculateColumnWidths.ts +0 -72
- package/src/utils/index.ts +0 -1
- package/src/widget/context.ts +0 -5
- package/src/widget/hooks/index.ts +0 -11
- package/src/widget/index.ts +0 -1
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
- /package/{dist/app → app}/context.d.ts +0 -0
- /package/{dist/app → app}/context.js +0 -0
- /package/{dist/app → app}/hooks/index.d.ts +0 -0
- /package/{dist/app → app}/hooks/index.js +0 -0
- /package/{dist/app → app}/hooks/useAppContext.d.ts +0 -0
- /package/{dist/app → app}/hooks/useAppContext.js +0 -0
- /package/{dist/app → app}/index.d.ts +0 -0
- /package/{dist/app → app}/index.js +0 -0
- /package/{dist/appearance → appearance}/context.d.ts +0 -0
- /package/{dist/appearance → appearance}/context.js +0 -0
- /package/{dist/appearance → appearance}/hooks/index.d.ts +0 -0
- /package/{dist/appearance → appearance}/hooks/index.js +0 -0
- /package/{dist/appearance → appearance}/hooks/useAppearanceContext.d.ts +0 -0
- /package/{dist/appearance → appearance}/hooks/useAppearanceContext.js +0 -0
- /package/{dist/appearance → appearance}/index.d.ts +0 -0
- /package/{dist/appearance → appearance}/index.js +0 -0
- /package/{dist/auth → auth}/AuthProvider.d.ts +0 -0
- /package/{dist/auth → auth}/AuthProvider.js +0 -0
- /package/{dist/auth → auth}/context.d.ts +0 -0
- /package/{dist/auth → auth}/context.js +0 -0
- /package/{dist/auth → auth}/hooks/index.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/index.js +0 -0
- /package/{dist/auth → auth}/hooks/useAuthSession.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/useAuthSession.js +0 -0
- /package/{dist/auth → auth}/hooks/useLogout.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/useLogout.js +0 -0
- /package/{dist/auth → auth}/index.d.ts +0 -0
- /package/{dist/auth → auth}/index.js +0 -0
- /package/{dist/auth → auth}/types.d.ts +0 -0
- /package/{dist/auth → auth}/types.js +0 -0
- /package/{dist/builders → builders}/CommandBuilder.d.ts +0 -0
- /package/{dist/builders → builders}/CommandBuilder.js +0 -0
- /package/{dist/builders → builders}/SchemaExperienceBuilder.d.ts +0 -0
- /package/{dist/builders → builders}/SchemaExperienceBuilder.js +0 -0
- /package/{dist/builders → builders}/index.d.ts +0 -0
- /package/{dist/builders → builders}/index.js +0 -0
- /package/{dist/command → command}/hooks/index.d.ts +0 -0
- /package/{dist/command → command}/hooks/index.js +0 -0
- /package/{dist/command → command}/hooks/useBaseCommandHandlerContext.d.ts +0 -0
- /package/{dist/command → command}/hooks/useBaseCommandHandlerContext.js +0 -0
- /package/{dist/command → command}/hooks/useCommands.d.ts +0 -0
- /package/{dist/command → command}/hooks/useCommands.js +0 -0
- /package/{dist/command → command}/index.d.ts +0 -0
- /package/{dist/command → command}/index.js +0 -0
- /package/{dist/command → command}/types.d.ts +0 -0
- /package/{dist/command → command}/types.js +0 -0
- /package/{dist/command → command}/utils/index.d.ts +0 -0
- /package/{dist/command → command}/utils/index.js +0 -0
- /package/{dist/components → components}/ScrollView/index.d.ts +0 -0
- /package/{dist/components → components}/ScrollView/index.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/DataResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/DataResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/InitialValueResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/InitialValueResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/ReadonlyInfoResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/ReadonlyInfoResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/index.js +0 -0
- /package/{dist/dataform → dataform}/context.d.ts +0 -0
- /package/{dist/dataform → dataform}/context.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormInstance.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormInstance.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsDirty.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsDirty.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsReadonly.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsReadonly.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormNotifications.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormNotifications.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormRecord.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormRecord.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSave.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSave.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSchema.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSchema.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useLoadFormGridPage.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useLoadFormGridPage.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useMainFormCommands.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useMainFormCommands.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordId.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordId.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordTitle.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordTitle.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useSelectedForm.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useSelectedForm.js +0 -0
- /package/{dist/dataform → dataform}/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/index.js +0 -0
- /package/{dist/dataform → dataform}/utils/index.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/DataResolver.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/DataResolver.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/index.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/transformViewColumns.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/transformViewColumns.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/utils.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/utils.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/constants.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/constants.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/index.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/types.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/types.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/utils.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/utils.js +0 -0
- /package/{dist/datagrid → datagrid}/context.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/context.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/index.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useChangeView.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useChangeView.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumnFilter.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumnFilter.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumns.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumns.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridData.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridData.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridDataState.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridDataState.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridExtraFilter.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridExtraFilter.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridOptions.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridOptions.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridPagination.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridPagination.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridRefresh.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridRefresh.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSchema.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSchema.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSelection.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSelection.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSorting.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSorting.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridViewLookupData.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridViewLookupData.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useLoadMainGridPage.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useLoadMainGridPage.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMainGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMainGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMaxRecords.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMaxRecords.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSearchText.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSearchText.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSelectedView.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSelectedView.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSubGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSubGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/index.js +0 -0
- /package/{dist/dialog → dialog}/DialogProvider.d.ts +0 -0
- /package/{dist/dialog → dialog}/DialogProvider.js +0 -0
- /package/{dist/dialog → dialog}/context.d.ts +0 -0
- /package/{dist/dialog → dialog}/context.js +0 -0
- /package/{dist/dialog → dialog}/hooks/index.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/index.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useCloseDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useCloseDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItem.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItem.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItems.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItems.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenAlertDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenAlertDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenConfirmDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenConfirmDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenErrorDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenErrorDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenPromptDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenPromptDialog.js +0 -0
- /package/{dist/dialog → dialog}/index.d.ts +0 -0
- /package/{dist/dialog → dialog}/index.js +0 -0
- /package/{dist/form → form}/FormValidationStringContext.d.ts +0 -0
- /package/{dist/form → form}/FormValidationStringContext.js +0 -0
- /package/{dist/form → form}/index.js +0 -0
- /package/{dist/hooks → hooks}/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/index.js +0 -0
- /package/{dist/hooks → hooks}/useDebouncedValue.d.ts +0 -0
- /package/{dist/hooks → hooks}/useDebouncedValue.js +0 -0
- /package/{dist/hooks → hooks}/useElementLayout.d.ts +0 -0
- /package/{dist/hooks → hooks}/useElementLayout.js +0 -0
- /package/{dist/hooks → hooks}/useIsMobile.d.ts +0 -0
- /package/{dist/hooks → hooks}/useIsMobile.js +0 -0
- /package/{dist/hooks → hooks}/useStorageState.d.ts +0 -0
- /package/{dist/hooks → hooks}/useStorageState.js +0 -0
- /package/{dist/hooks → hooks}/useSystemColorScheme.d.ts +0 -0
- /package/{dist/hooks → hooks}/useSystemColorScheme.js +0 -0
- /package/{dist/insights → insights}/context.d.ts +0 -0
- /package/{dist/insights → insights}/context.js +0 -0
- /package/{dist/insights → insights}/hooks/index.d.ts +0 -0
- /package/{dist/insights → insights}/hooks/index.js +0 -0
- /package/{dist/insights → insights}/index.d.ts +0 -0
- /package/{dist/insights → insights}/index.js +0 -0
- /package/{dist/locale → locale}/context.d.ts +0 -0
- /package/{dist/locale → locale}/context.js +0 -0
- /package/{dist/locale → locale}/index.d.ts +0 -0
- /package/{dist/locale → locale}/index.js +0 -0
- /package/{dist/locale → locale}/types.d.ts +0 -0
- /package/{dist/locale → locale}/types.js +0 -0
- /package/{dist/locale → locale}/useLocale.d.ts +0 -0
- /package/{dist/locale → locale}/useLocale.js +0 -0
- /package/{dist/metadata → metadata}/MetadataProvider.d.ts +0 -0
- /package/{dist/metadata → metadata}/MetadataProvider.js +0 -0
- /package/{dist/metadata → metadata}/context.d.ts +0 -0
- /package/{dist/metadata → metadata}/context.js +0 -0
- /package/{dist/metadata → metadata}/hooks/index.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/index.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useAppStore.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useAppStore.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceStore.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceStore.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceView.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceView.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewCommands.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewCommands.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewLookup.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewLookup.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewSubgridCommands.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewSubgridCommands.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useMetadata.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useMetadata.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useSchema.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useSchema.js +0 -0
- /package/{dist/metadata → metadata}/index.d.ts +0 -0
- /package/{dist/metadata → metadata}/index.js +0 -0
- /package/{dist/mutable → mutable}/context.d.ts +0 -0
- /package/{dist/mutable → mutable}/context.js +0 -0
- /package/{dist/mutable → mutable}/index.js +0 -0
- /package/{dist/mutable → mutable}/state.d.ts +0 -0
- /package/{dist/mutable → mutable}/state.js +0 -0
- /package/{dist/mutable → mutable}/type.d.ts +0 -0
- /package/{dist/mutable → mutable}/type.js +0 -0
- /package/{dist/mutable → mutable}/utils.d.ts +0 -0
- /package/{dist/mutable → mutable}/utils.js +0 -0
- /package/{dist/navigation → navigation}/hooks/useOpenForm.d.ts +0 -0
- /package/{dist/navigation → navigation}/hooks/useOpenForm.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/ProgressIndicatorProvider.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/ProgressIndicatorProvider.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/context.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/context.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/index.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/index.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/useProgressIndicator.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/useProgressIndicator.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/index.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/index.js +0 -0
- /package/{dist/providers → providers}/PageEntityFormProvider/index.d.ts +0 -0
- /package/{dist/providers → providers}/PageEntityFormProvider/index.js +0 -0
- /package/{dist/providers → providers}/PageEntityViewProvider/index.d.ts +0 -0
- /package/{dist/providers → providers}/PageEntityViewProvider/index.js +0 -0
- /package/{dist/recordset → recordset}/RecordSetProvider.d.ts +0 -0
- /package/{dist/recordset → recordset}/RecordSetProvider.js +0 -0
- /package/{dist/recordset → recordset}/context.d.ts +0 -0
- /package/{dist/recordset → recordset}/context.js +0 -0
- /package/{dist/recordset → recordset}/hooks/index.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/index.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetResult.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetResult.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetSetter.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetSetter.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetVisibility.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetVisibility.js +0 -0
- /package/{dist/recordset → recordset}/index.d.ts +0 -0
- /package/{dist/recordset → recordset}/index.js +0 -0
- /package/{dist/route → route}/RouteProvider.d.ts +0 -0
- /package/{dist/route → route}/RouteProvider.js +0 -0
- /package/{dist/route → route}/context.d.ts +0 -0
- /package/{dist/route → route}/context.js +0 -0
- /package/{dist/route → route}/hooks/index.d.ts +0 -0
- /package/{dist/route → route}/hooks/index.js +0 -0
- /package/{dist/route → route}/hooks/useBasePath.d.ts +0 -0
- /package/{dist/route → route}/hooks/useBasePath.js +0 -0
- /package/{dist/route → route}/hooks/usePathname.d.ts +0 -0
- /package/{dist/route → route}/hooks/usePathname.js +0 -0
- /package/{dist/route → route}/hooks/useRouteResolver.d.ts +0 -0
- /package/{dist/route → route}/hooks/useRouteResolver.js +0 -0
- /package/{dist/route → route}/hooks/useRouter.d.ts +0 -0
- /package/{dist/route → route}/hooks/useRouter.js +0 -0
- /package/{dist/route → route}/hooks/useSearchParams.d.ts +0 -0
- /package/{dist/route → route}/hooks/useSearchParams.js +0 -0
- /package/{dist/route → route}/index.d.ts +0 -0
- /package/{dist/route → route}/index.js +0 -0
- /package/{dist/route → route}/types.d.ts +0 -0
- /package/{dist/route → route}/types.js +0 -0
- /package/{dist/store → store}/ClientAppStore.d.ts +0 -0
- /package/{dist/store → store}/ClientAppStore.js +0 -0
- /package/{dist/store → store}/ComponentStore.d.ts +0 -0
- /package/{dist/store → store}/ComponentStore.js +0 -0
- /package/{dist/store → store}/EventManager.d.ts +0 -0
- /package/{dist/store → store}/EventManager.js +0 -0
- /package/{dist/store → store}/SchemaExperienceStore.d.ts +0 -0
- /package/{dist/store → store}/SchemaExperienceStore.js +0 -0
- /package/{dist/store → store}/index.d.ts +0 -0
- /package/{dist/store → store}/index.js +0 -0
- /package/{dist/toast-notification → toast-notification}/ToastNotificationProvider.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/ToastNotificationProvider.js +0 -0
- /package/{dist/toast-notification → toast-notification}/context.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/context.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/index.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/index.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useCloseToastNotification.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useCloseToastNotification.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useOpenToastNotification.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useOpenToastNotification.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useToastNotificationItems.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useToastNotificationItems.js +0 -0
- /package/{dist/toast-notification → toast-notification}/index.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/index.js +0 -0
- /package/{dist/transport → transport}/InMemoryDataService/index.d.ts +0 -0
- /package/{dist/transport → transport}/InMemoryDataService/index.js +0 -0
- /package/{dist/transport → transport}/RestDataService/index.d.ts +0 -0
- /package/{dist/transport → transport}/RestDataService/index.js +0 -0
- /package/{dist/transport → transport}/context.d.ts +0 -0
- /package/{dist/transport → transport}/context.js +0 -0
- /package/{dist/transport → transport}/hooks/index.d.ts +0 -0
- /package/{dist/transport → transport}/hooks/index.js +0 -0
- /package/{dist/transport → transport}/hooks/useDataService.d.ts +0 -0
- /package/{dist/transport → transport}/hooks/useDataService.js +0 -0
- /package/{dist/transport → transport}/index.d.ts +0 -0
- /package/{dist/transport → transport}/index.js +0 -0
- /package/{dist/utils → utils}/calculateColumnWidths.d.ts +0 -0
- /package/{dist/utils → utils}/calculateColumnWidths.js +0 -0
- /package/{dist/utils → utils}/index.d.ts +0 -0
- /package/{dist/utils → utils}/index.js +0 -0
- /package/{dist/widget → widget}/context.d.ts +0 -0
- /package/{dist/widget → widget}/context.js +0 -0
- /package/{dist/widget → widget}/hooks/index.d.ts +0 -0
- /package/{dist/widget → widget}/hooks/index.js +0 -0
- /package/{dist/widget → widget}/index.d.ts +0 -0
- /package/{dist/widget → widget}/index.js +0 -0
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AsyncForm,
|
|
3
|
-
AsyncQuickCreateForm,
|
|
4
|
-
EntityMainFormCommandItemExperience,
|
|
5
|
-
Form,
|
|
6
|
-
FormExperience,
|
|
7
|
-
QuickCreateForm,
|
|
8
|
-
} from '@headless-adminapp/core/experience/form';
|
|
9
|
-
import { SchemaExperience } from '@headless-adminapp/core/experience/schema';
|
|
10
|
-
import {
|
|
11
|
-
AsyncView,
|
|
12
|
-
EntityMainGridCommandItemExperience,
|
|
13
|
-
SubGridCommandItemExperience,
|
|
14
|
-
View,
|
|
15
|
-
ViewExperience,
|
|
16
|
-
} from '@headless-adminapp/core/experience/view';
|
|
17
|
-
import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
18
|
-
import { Localized } from '@headless-adminapp/core/types';
|
|
19
|
-
|
|
20
|
-
abstract class BaseSchemaExperienceBuilder<S extends SchemaAttributes> {
|
|
21
|
-
protected views: View<S>[] = [];
|
|
22
|
-
protected forms: Form<S>[] = [];
|
|
23
|
-
protected lookups: View<S>[] = [];
|
|
24
|
-
protected quickCreateForms: QuickCreateForm<S>[] = [];
|
|
25
|
-
|
|
26
|
-
protected defaultViewId: string | null = null;
|
|
27
|
-
protected defaultFormId: string | null = null;
|
|
28
|
-
protected defaultLookupId: string | null = null;
|
|
29
|
-
protected defaultQuickCreateFormId: string | null = null;
|
|
30
|
-
protected locked: boolean = false;
|
|
31
|
-
|
|
32
|
-
constructor(protected readonly logicalName: string) {}
|
|
33
|
-
|
|
34
|
-
public reset() {
|
|
35
|
-
this.views = [];
|
|
36
|
-
this.forms = [];
|
|
37
|
-
this.lookups = [];
|
|
38
|
-
this.quickCreateForms = [];
|
|
39
|
-
this.defaultViewId = null;
|
|
40
|
-
this.defaultFormId = null;
|
|
41
|
-
this.defaultLookupId = null;
|
|
42
|
-
this.defaultQuickCreateFormId = null;
|
|
43
|
-
this.locked = false;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
protected baseBuild() {
|
|
48
|
-
if (!this.defaultViewId) {
|
|
49
|
-
throw new Error('Default view is required');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (!this.defaultFormId) {
|
|
53
|
-
throw new Error('Default form is required');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (!this.defaultLookupId) {
|
|
57
|
-
throw new Error('Default lookup is required');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (!this.views.find((v) => v.id === this.defaultViewId)) {
|
|
61
|
-
throw new Error('Default view not found');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (!this.forms.find((f) => f.id === this.defaultFormId)) {
|
|
65
|
-
throw new Error('Default form not found');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (!this.lookups.find((l) => l.id === this.defaultLookupId)) {
|
|
69
|
-
throw new Error('Default lookup not found');
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
this.defaultQuickCreateFormId &&
|
|
74
|
-
!this.quickCreateForms.find((f) => f.id === this.defaultQuickCreateFormId)
|
|
75
|
-
) {
|
|
76
|
-
throw new Error('Default quick create form not found');
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
logicalName: this.logicalName,
|
|
81
|
-
defaultFormId: this.defaultFormId,
|
|
82
|
-
defaultViewId: this.defaultViewId,
|
|
83
|
-
views: this.views,
|
|
84
|
-
forms: this.forms,
|
|
85
|
-
defaultLookupId: this.defaultLookupId,
|
|
86
|
-
lookups: this.lookups,
|
|
87
|
-
defaultQuickCreateFormId: this.defaultQuickCreateFormId,
|
|
88
|
-
quickCreateForms: this.quickCreateForms,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// public createView(view: Omit<View<S>, 'logicalName'>): View<S> {
|
|
93
|
-
// return {
|
|
94
|
-
// logicalName: this.logicalName,
|
|
95
|
-
// ...view,
|
|
96
|
-
// };
|
|
97
|
-
// }
|
|
98
|
-
|
|
99
|
-
public defineFormExperience(
|
|
100
|
-
formExperience: FormExperience<S>
|
|
101
|
-
): FormExperience<S> {
|
|
102
|
-
return formExperience;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// public defineForm(form: BaseForm<S>): Form<S> {
|
|
106
|
-
// return {
|
|
107
|
-
// logicalName: this.logicalName,
|
|
108
|
-
// ...form,
|
|
109
|
-
// };
|
|
110
|
-
// }
|
|
111
|
-
|
|
112
|
-
// public registerView(view: Omit<View<S>, 'logicalName'>): this {
|
|
113
|
-
// this.views.push(this.createView(view));
|
|
114
|
-
// return this;
|
|
115
|
-
// }
|
|
116
|
-
|
|
117
|
-
// public registerForm(form: BaseForm<S>): this {
|
|
118
|
-
// console.log('registerForm', form);
|
|
119
|
-
// if (this.forms.find((f) => f.id === form.id)) {
|
|
120
|
-
// throw new Error(
|
|
121
|
-
// `Form with id '${form.id}' already exists for entity '${this.logicalName}'`
|
|
122
|
-
// );
|
|
123
|
-
// }
|
|
124
|
-
|
|
125
|
-
// this.forms.push({
|
|
126
|
-
// logicalName: this.logicalName,
|
|
127
|
-
// ...form,
|
|
128
|
-
// });
|
|
129
|
-
// return this;
|
|
130
|
-
// }
|
|
131
|
-
|
|
132
|
-
// public registerLookup(lookup: Omit<ViewLookup<S>, 'logicalName'>): this {
|
|
133
|
-
// this.lookups.push({
|
|
134
|
-
// logicalName: this.logicalName,
|
|
135
|
-
// ...lookup,
|
|
136
|
-
// });
|
|
137
|
-
// return this;
|
|
138
|
-
// }
|
|
139
|
-
|
|
140
|
-
// public setDefaultViewId(defaultViewId: string): this {
|
|
141
|
-
// this.defaultViewId = defaultViewId;
|
|
142
|
-
// return this;
|
|
143
|
-
// }
|
|
144
|
-
|
|
145
|
-
// public setDefaultFormId(defaultFormId: string): this {
|
|
146
|
-
// this.defaultFormId = defaultFormId;
|
|
147
|
-
// return this;
|
|
148
|
-
// }
|
|
149
|
-
|
|
150
|
-
// public setDefaultLookupId(defaultLookupId: string): this {
|
|
151
|
-
// this.defaultLookupId = defaultLookupId;
|
|
152
|
-
// return this;
|
|
153
|
-
// }
|
|
154
|
-
|
|
155
|
-
// public setDefaultQuickCreateFormId(defaultQuickCreateFormId: string): this {
|
|
156
|
-
// this.defaultQuickCreateFormId = defaultQuickCreateFormId;
|
|
157
|
-
// return this;
|
|
158
|
-
// }
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface SchemaExperienceBuilderDefaults {
|
|
162
|
-
formCommands?: EntityMainFormCommandItemExperience[][];
|
|
163
|
-
viewCommands?: EntityMainGridCommandItemExperience[][];
|
|
164
|
-
subgridCommands?: SubGridCommandItemExperience[][];
|
|
165
|
-
localizedViewNames?: Record<string, string>; // `All {label}` // key is locale
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
interface SchemaExperienceBuilderOptions {
|
|
169
|
-
// localization: {
|
|
170
|
-
// defaultViewName: Record<string, (pluralName: string) => string>; // key is locale
|
|
171
|
-
// };
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export class SchemaExperienceBuilder<
|
|
175
|
-
S extends SchemaAttributes = SchemaAttributes
|
|
176
|
-
> extends BaseSchemaExperienceBuilder<S> {
|
|
177
|
-
constructor(
|
|
178
|
-
private schema: Schema<S>,
|
|
179
|
-
private defaults?: SchemaExperienceBuilderDefaults,
|
|
180
|
-
private options?: SchemaExperienceBuilderOptions
|
|
181
|
-
) {
|
|
182
|
-
super(schema.logicalName);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
public defineViewExperience(
|
|
186
|
-
viewExperience: Pick<ViewExperience<S>, 'filter' | 'defaultSorting'> & {
|
|
187
|
-
card?: ViewExperience<S>['card'];
|
|
188
|
-
grid?: ViewExperience<S>['grid'];
|
|
189
|
-
}
|
|
190
|
-
): ViewExperience<S> {
|
|
191
|
-
const cardView = viewExperience.card ?? this.defineDefaultViewCard();
|
|
192
|
-
const gridView = viewExperience.grid ?? this.defineDefaultViewGrid();
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
...viewExperience,
|
|
196
|
-
grid: gridView,
|
|
197
|
-
card: cardView,
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
public defineDefaultViewGrid(): ViewExperience<S>['grid'] {
|
|
202
|
-
const columns = [] as ViewExperience<S>['grid']['columns'];
|
|
203
|
-
|
|
204
|
-
columns.push({
|
|
205
|
-
name: this.schema.primaryAttribute,
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
if (this.schema.createdAtAttribute) {
|
|
209
|
-
columns.push({
|
|
210
|
-
name: this.schema.createdAtAttribute,
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (this.schema.updatedAtAttribute) {
|
|
215
|
-
columns.push({
|
|
216
|
-
name: this.schema.updatedAtAttribute,
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
return {
|
|
221
|
-
columns,
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
public defineDefaultViewCard(): ViewExperience<S>['card'] {
|
|
226
|
-
return {
|
|
227
|
-
primaryColumn: this.schema.primaryAttribute,
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
public defineDefaultViewExperience(): ViewExperience<S> {
|
|
232
|
-
let defaultSorting: ViewExperience<S>['defaultSorting'] = undefined;
|
|
233
|
-
|
|
234
|
-
if (this.schema.updatedAtAttribute) {
|
|
235
|
-
defaultSorting = [
|
|
236
|
-
{
|
|
237
|
-
field: this.schema.updatedAtAttribute,
|
|
238
|
-
order: 'desc',
|
|
239
|
-
},
|
|
240
|
-
];
|
|
241
|
-
} else if (this.schema.createdAtAttribute) {
|
|
242
|
-
defaultSorting = [
|
|
243
|
-
{
|
|
244
|
-
field: this.schema.createdAtAttribute,
|
|
245
|
-
order: 'desc',
|
|
246
|
-
},
|
|
247
|
-
];
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
return {
|
|
251
|
-
defaultSorting: defaultSorting,
|
|
252
|
-
grid: this.defineDefaultViewGrid(),
|
|
253
|
-
card: this.defineDefaultViewCard(),
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
public defineDefaultFormExperience(): FormExperience<S> {
|
|
258
|
-
return {
|
|
259
|
-
headerControls: [],
|
|
260
|
-
tabs: [
|
|
261
|
-
{
|
|
262
|
-
name: 'general',
|
|
263
|
-
label: 'General',
|
|
264
|
-
columnCount: 1,
|
|
265
|
-
tabColumns: [
|
|
266
|
-
{
|
|
267
|
-
sections: [
|
|
268
|
-
{
|
|
269
|
-
name: 'general',
|
|
270
|
-
label: 'General',
|
|
271
|
-
controls: [
|
|
272
|
-
{
|
|
273
|
-
type: 'standard',
|
|
274
|
-
attributeName: this.schema.primaryAttribute,
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
},
|
|
278
|
-
],
|
|
279
|
-
},
|
|
280
|
-
],
|
|
281
|
-
},
|
|
282
|
-
],
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
private getLocalizedViewNames(): Localized<string> {
|
|
287
|
-
const langugesSet = new Set<string>();
|
|
288
|
-
|
|
289
|
-
this.schema.localizedPluralLabels &&
|
|
290
|
-
Object.keys(this.schema.localizedPluralLabels).forEach((key) =>
|
|
291
|
-
langugesSet.add(key)
|
|
292
|
-
);
|
|
293
|
-
|
|
294
|
-
this.defaults?.localizedViewNames &&
|
|
295
|
-
Object.keys(this.defaults.localizedViewNames).forEach((key) =>
|
|
296
|
-
langugesSet.add(key)
|
|
297
|
-
);
|
|
298
|
-
|
|
299
|
-
const localizedLabels = Array.from(langugesSet).reduce((acc, key) => {
|
|
300
|
-
const localizedPluralName =
|
|
301
|
-
this.schema.localizedPluralLabels?.[key]?.toLowerCase() ??
|
|
302
|
-
this.schema.pluralLabel.toLowerCase();
|
|
303
|
-
const localizedPlaceholder =
|
|
304
|
-
this.defaults?.localizedViewNames?.[key] ?? `All {label}`;
|
|
305
|
-
|
|
306
|
-
const localeName = localizedPlaceholder.replace(
|
|
307
|
-
'{label}',
|
|
308
|
-
localizedPluralName
|
|
309
|
-
);
|
|
310
|
-
|
|
311
|
-
acc[key] = localeName;
|
|
312
|
-
return acc;
|
|
313
|
-
}, {} as Record<string, string>);
|
|
314
|
-
|
|
315
|
-
return localizedLabels;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
private resolveDefaultId<T extends { id: string }>(
|
|
319
|
-
data: T[],
|
|
320
|
-
defaultId: string | undefined | null
|
|
321
|
-
): string {
|
|
322
|
-
if (data.length === 0) {
|
|
323
|
-
throw new Error('No items found');
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
if (!defaultId) {
|
|
327
|
-
return data[0].id;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
if (!data.find((x) => x.id === defaultId)) {
|
|
331
|
-
return data[0].id;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return defaultId;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
public defineExperience(
|
|
338
|
-
experience: Omit<
|
|
339
|
-
SchemaExperience<S>,
|
|
340
|
-
| 'logicalName'
|
|
341
|
-
| 'forms'
|
|
342
|
-
| 'views'
|
|
343
|
-
| 'lookups'
|
|
344
|
-
| 'defaultViewId'
|
|
345
|
-
| 'defaultFormId'
|
|
346
|
-
| 'defaultLookupId'
|
|
347
|
-
| 'defaultAssociatedViewId'
|
|
348
|
-
| 'quickCreateForms'
|
|
349
|
-
| 'viewCommands'
|
|
350
|
-
| 'subgridCommands'
|
|
351
|
-
| 'formCommands'
|
|
352
|
-
| 'associatedViews'
|
|
353
|
-
> & {
|
|
354
|
-
forms?: Omit<AsyncForm<S>, 'logicalName'>[];
|
|
355
|
-
views?: Omit<AsyncView<S>, 'logicalName'>[];
|
|
356
|
-
lookups?: Omit<AsyncView<S>, 'logicalName'>[];
|
|
357
|
-
associatedViews?: Omit<AsyncView<S>, 'logicalName'>[];
|
|
358
|
-
quickCreateForms?: Omit<AsyncQuickCreateForm<S>, 'logicalName'>[];
|
|
359
|
-
defaultViewId?: string;
|
|
360
|
-
defaultFormId?: string;
|
|
361
|
-
defaultLookupId?: string;
|
|
362
|
-
defaultAssociatedViewId?: string;
|
|
363
|
-
viewCommands?: SchemaExperience<S>['viewCommands'];
|
|
364
|
-
subgridCommands?: SchemaExperience<S>['subgridCommands'];
|
|
365
|
-
formCommands?: SchemaExperience<S>['formCommands'];
|
|
366
|
-
}
|
|
367
|
-
): SchemaExperience<S> {
|
|
368
|
-
// if (!experience.defaultFormId) {
|
|
369
|
-
// throw new Error('Default form is required');
|
|
370
|
-
// }
|
|
371
|
-
|
|
372
|
-
// console.log('experience', experience);
|
|
373
|
-
|
|
374
|
-
let lookups = experience.lookups;
|
|
375
|
-
let views = experience.views;
|
|
376
|
-
let forms = experience.forms;
|
|
377
|
-
let associatedViews = experience.associatedViews;
|
|
378
|
-
|
|
379
|
-
if (!lookups?.length) {
|
|
380
|
-
lookups = [
|
|
381
|
-
{
|
|
382
|
-
id: 'default',
|
|
383
|
-
name: 'Default',
|
|
384
|
-
experience: this.defineViewExperience({}),
|
|
385
|
-
},
|
|
386
|
-
];
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
if (!views?.length) {
|
|
390
|
-
views = [
|
|
391
|
-
{
|
|
392
|
-
id: 'default',
|
|
393
|
-
name: `All ${this.schema.pluralLabel.toLowerCase()}`,
|
|
394
|
-
experience: this.defineDefaultViewExperience(),
|
|
395
|
-
localizedNames: this.getLocalizedViewNames(),
|
|
396
|
-
},
|
|
397
|
-
];
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
if (!associatedViews?.length) {
|
|
401
|
-
associatedViews = [
|
|
402
|
-
{
|
|
403
|
-
id: 'default',
|
|
404
|
-
name: `All ${this.schema.pluralLabel.toLowerCase()}`,
|
|
405
|
-
experience: this.defineDefaultViewExperience(),
|
|
406
|
-
localizedNames: this.getLocalizedViewNames(),
|
|
407
|
-
},
|
|
408
|
-
];
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
if (!forms?.length) {
|
|
412
|
-
forms = [
|
|
413
|
-
{
|
|
414
|
-
id: 'default',
|
|
415
|
-
name: 'Default',
|
|
416
|
-
experience: this.defineDefaultFormExperience(),
|
|
417
|
-
},
|
|
418
|
-
];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
const defaultViewId = this.resolveDefaultId(
|
|
422
|
-
views,
|
|
423
|
-
experience.defaultViewId
|
|
424
|
-
);
|
|
425
|
-
const defaultFormId = this.resolveDefaultId(
|
|
426
|
-
forms,
|
|
427
|
-
experience.defaultFormId
|
|
428
|
-
);
|
|
429
|
-
const defaultLookupId = this.resolveDefaultId(
|
|
430
|
-
lookups,
|
|
431
|
-
experience.defaultLookupId
|
|
432
|
-
);
|
|
433
|
-
const defaultAssociatedViewId = this.resolveDefaultId(
|
|
434
|
-
associatedViews,
|
|
435
|
-
experience.defaultAssociatedViewId
|
|
436
|
-
);
|
|
437
|
-
|
|
438
|
-
let defaultQuickCreateFormId = null;
|
|
439
|
-
|
|
440
|
-
if (experience.quickCreateForms?.length) {
|
|
441
|
-
defaultQuickCreateFormId = this.resolveDefaultId(
|
|
442
|
-
experience.quickCreateForms ?? [],
|
|
443
|
-
experience.defaultQuickCreateFormId
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
return {
|
|
448
|
-
logicalName: this.logicalName,
|
|
449
|
-
icon: experience.icon,
|
|
450
|
-
defaultQuickCreateFormId: defaultQuickCreateFormId,
|
|
451
|
-
defaultFormId,
|
|
452
|
-
defaultViewId,
|
|
453
|
-
defaultLookupId,
|
|
454
|
-
defaultAssociatedViewId,
|
|
455
|
-
quickCreateForms:
|
|
456
|
-
experience.quickCreateForms?.map((x) => ({
|
|
457
|
-
...x,
|
|
458
|
-
logicalName: this.logicalName,
|
|
459
|
-
})) ?? [],
|
|
460
|
-
views:
|
|
461
|
-
views.map((x) => ({
|
|
462
|
-
...x,
|
|
463
|
-
logicalName: this.logicalName,
|
|
464
|
-
})) ?? [],
|
|
465
|
-
forms:
|
|
466
|
-
forms.map((x) => ({
|
|
467
|
-
...x,
|
|
468
|
-
logicalName: this.logicalName,
|
|
469
|
-
})) ?? [],
|
|
470
|
-
lookups:
|
|
471
|
-
lookups.map((x) => ({
|
|
472
|
-
...x,
|
|
473
|
-
logicalName: this.logicalName,
|
|
474
|
-
})) ?? [],
|
|
475
|
-
associatedViews:
|
|
476
|
-
associatedViews.map((x) => ({
|
|
477
|
-
...x,
|
|
478
|
-
logicalName: this.logicalName,
|
|
479
|
-
})) ?? [],
|
|
480
|
-
formCommands:
|
|
481
|
-
experience.formCommands ?? this.defaults?.formCommands ?? [],
|
|
482
|
-
subgridCommands:
|
|
483
|
-
experience.subgridCommands ?? this.defaults?.subgridCommands ?? [],
|
|
484
|
-
viewCommands:
|
|
485
|
-
experience.viewCommands ?? this.defaults?.viewCommands ?? [],
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
|
-
}
|
package/src/builders/index.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { CommandContextBase } from '@headless-adminapp/core/experience/command';
|
|
2
|
-
import { useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
useOpenAlertDialog,
|
|
6
|
-
useOpenConfirmDialog,
|
|
7
|
-
useOpenErrorDialog,
|
|
8
|
-
useOpenPromptDialog,
|
|
9
|
-
} from '../../dialog/hooks';
|
|
10
|
-
import { useLocale } from '../../locale';
|
|
11
|
-
import { useMetadata } from '../../metadata/hooks';
|
|
12
|
-
import { useProgressIndicator } from '../../progress-indicator/hooks';
|
|
13
|
-
import { useOpenToastNotification } from '../../toast-notification/hooks/useOpenToastNotification';
|
|
14
|
-
import { useDataService } from '../../transport';
|
|
15
|
-
import { UtilityContextState } from '../types';
|
|
16
|
-
|
|
17
|
-
export function useUtility(): UtilityContextState {
|
|
18
|
-
const { hideProgressIndicator, showProgressIndicator } =
|
|
19
|
-
useProgressIndicator();
|
|
20
|
-
const openAlertDialog = useOpenAlertDialog();
|
|
21
|
-
const openConfirmDialog = useOpenConfirmDialog();
|
|
22
|
-
const openErrorDialog = useOpenErrorDialog();
|
|
23
|
-
const openPromptDialog = useOpenPromptDialog();
|
|
24
|
-
const openToastNotification = useOpenToastNotification();
|
|
25
|
-
|
|
26
|
-
return {
|
|
27
|
-
hideProgressIndicator,
|
|
28
|
-
showProgressIndicator,
|
|
29
|
-
openAlertDialog,
|
|
30
|
-
openConfirmDialog,
|
|
31
|
-
openErrorDialog,
|
|
32
|
-
openPromptDialog,
|
|
33
|
-
showNotification: openToastNotification,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function useBaseCommandHandlerContext(): CommandContextBase {
|
|
38
|
-
const dataService = useDataService();
|
|
39
|
-
const queryClient = useQueryClient();
|
|
40
|
-
const stores = useMetadata();
|
|
41
|
-
const utility = useUtility();
|
|
42
|
-
const [locale] = useLocale();
|
|
43
|
-
|
|
44
|
-
return {
|
|
45
|
-
dataService,
|
|
46
|
-
queryClient,
|
|
47
|
-
utility,
|
|
48
|
-
stores,
|
|
49
|
-
locale,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
|
|
2
|
-
import { useMemo, useRef } from 'react';
|
|
3
|
-
|
|
4
|
-
import { CommandItemExperienceSelector, CommandItemState } from '../types';
|
|
5
|
-
import { transformCommadnGroups } from '../utils';
|
|
6
|
-
|
|
7
|
-
/***
|
|
8
|
-
* @description Transforms the command configuration into a format that can be used by the CommandBar component
|
|
9
|
-
* and apply the necessary conditions to the commands (disabled, hidden, etc.)
|
|
10
|
-
*/
|
|
11
|
-
export function useCommands<HandlerContext>(
|
|
12
|
-
commands: CommandItemExperience<HandlerContext>[][],
|
|
13
|
-
handlerContext: HandlerContext,
|
|
14
|
-
selector?: CommandItemExperienceSelector<HandlerContext>
|
|
15
|
-
): CommandItemState[][] {
|
|
16
|
-
const selectorRef = useRef(selector);
|
|
17
|
-
selectorRef.current = selector;
|
|
18
|
-
|
|
19
|
-
return useMemo(() => {
|
|
20
|
-
return transformCommadnGroups(
|
|
21
|
-
commands,
|
|
22
|
-
handlerContext,
|
|
23
|
-
selectorRef.current
|
|
24
|
-
);
|
|
25
|
-
}, [commands, handlerContext]);
|
|
26
|
-
}
|
package/src/command/index.ts
DELETED
package/src/command/types.ts
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
|
|
2
|
-
import {
|
|
3
|
-
ConfirmDialogOptions,
|
|
4
|
-
PromptDialogOptions,
|
|
5
|
-
} from '@headless-adminapp/core/experience/dialog';
|
|
6
|
-
import {
|
|
7
|
-
InferredSchemaType,
|
|
8
|
-
SchemaAttributes,
|
|
9
|
-
} from '@headless-adminapp/core/schema';
|
|
10
|
-
import {
|
|
11
|
-
ArrayGroupWithAtLeastOne,
|
|
12
|
-
Localized,
|
|
13
|
-
} from '@headless-adminapp/core/types';
|
|
14
|
-
import { Icon } from '@headless-adminapp/icons';
|
|
15
|
-
|
|
16
|
-
interface ConfirmResult {
|
|
17
|
-
confirmed: boolean;
|
|
18
|
-
}
|
|
19
|
-
export interface UtilityContextState {
|
|
20
|
-
showProgressIndicator: (message?: string) => void;
|
|
21
|
-
hideProgressIndicator: () => void;
|
|
22
|
-
openAlertDialog(options: {
|
|
23
|
-
text: string;
|
|
24
|
-
title?: string;
|
|
25
|
-
confirmButtonLabel?: string;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
openConfirmDialog(
|
|
28
|
-
options: Omit<
|
|
29
|
-
ConfirmDialogOptions,
|
|
30
|
-
'type' | 'onConfirm' | 'onDismiss' | 'onCancel'
|
|
31
|
-
>
|
|
32
|
-
): Promise<ConfirmResult | null>;
|
|
33
|
-
openErrorDialog(options: {
|
|
34
|
-
text: string;
|
|
35
|
-
title?: string;
|
|
36
|
-
confirmButtonLabel?: string;
|
|
37
|
-
}): void;
|
|
38
|
-
openPromptDialog: <SA extends SchemaAttributes = SchemaAttributes>(
|
|
39
|
-
options: Omit<
|
|
40
|
-
PromptDialogOptions<SA>,
|
|
41
|
-
'type' | 'onConfirm' | 'onClose' | 'onCancel'
|
|
42
|
-
>
|
|
43
|
-
) => Promise<InferredSchemaType<SA> | null>;
|
|
44
|
-
showNotification: (options: {
|
|
45
|
-
text: string;
|
|
46
|
-
title?: string;
|
|
47
|
-
actions?: { text: string; onClick: () => void }[];
|
|
48
|
-
type?: 'info' | 'success' | 'warning' | 'error';
|
|
49
|
-
}) => void;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface BaseCommandState {
|
|
53
|
-
Icon: Icon;
|
|
54
|
-
iconPosition?: 'before' | 'after';
|
|
55
|
-
danger?: boolean;
|
|
56
|
-
hidden?: boolean;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface ActionableCommandState {
|
|
60
|
-
onClick?: () => void;
|
|
61
|
-
disabled?: boolean;
|
|
62
|
-
hidden?: boolean;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface IconButtonCommandState
|
|
66
|
-
extends BaseCommandState,
|
|
67
|
-
ActionableCommandState {
|
|
68
|
-
type: 'icon';
|
|
69
|
-
isQuickAction?: boolean;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ButtonCommandState
|
|
73
|
-
extends BaseCommandState,
|
|
74
|
-
ActionableCommandState {
|
|
75
|
-
type: 'button';
|
|
76
|
-
text: string;
|
|
77
|
-
isQuickAction?: boolean;
|
|
78
|
-
isContextMenu?: boolean; // Keep visible for right click context menu
|
|
79
|
-
localizedTexts?: Localized<string>;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface LabelCommandState extends BaseCommandState {
|
|
83
|
-
type: 'label';
|
|
84
|
-
text: string;
|
|
85
|
-
localizedTexts?: Localized<string>;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface MenuItemCommandState
|
|
89
|
-
extends BaseCommandState,
|
|
90
|
-
ActionableCommandState {
|
|
91
|
-
text: string;
|
|
92
|
-
localizedTexts?: Localized<string>;
|
|
93
|
-
items?: ArrayGroupWithAtLeastOne<MenuItemCommandState>;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface MenuComandState
|
|
97
|
-
extends BaseCommandState,
|
|
98
|
-
ActionableCommandState {
|
|
99
|
-
type: 'menu';
|
|
100
|
-
text: string;
|
|
101
|
-
localizedTexts?: Localized<string>;
|
|
102
|
-
isContextMenu?: boolean; // Keep visible for right click context menu
|
|
103
|
-
items: ArrayGroupWithAtLeastOne<MenuItemCommandState>;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export type CommandItemState =
|
|
107
|
-
| IconButtonCommandState
|
|
108
|
-
| ButtonCommandState
|
|
109
|
-
| MenuComandState
|
|
110
|
-
| LabelCommandState;
|
|
111
|
-
|
|
112
|
-
export type Selector<T> = (value: T) => boolean;
|
|
113
|
-
|
|
114
|
-
export type CommandItemExperienceSelector<Context> = Selector<
|
|
115
|
-
CommandItemExperience<Context>
|
|
116
|
-
>;
|