@headless-adminapp/app 0.0.12-alpha.0 → 0.0.15-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/package.json +8 -16
- 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 -12
- 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 -594
- 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 -14
- 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/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/index.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.d.ts +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.d.ts +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.d.ts +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,374 +0,0 @@
|
|
|
1
|
-
import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import {
|
|
3
|
-
EntityMainFormCommandItemExperience,
|
|
4
|
-
Form,
|
|
5
|
-
QuickCreateForm,
|
|
6
|
-
} from '@headless-adminapp/core/experience/form';
|
|
7
|
-
import {
|
|
8
|
-
SchemaExperience,
|
|
9
|
-
SchemaExperienceMetadata,
|
|
10
|
-
} from '@headless-adminapp/core/experience/schema';
|
|
11
|
-
import {
|
|
12
|
-
CardView,
|
|
13
|
-
EntityMainGridCommandItemExperience,
|
|
14
|
-
SubGridCommandItemExperience,
|
|
15
|
-
View,
|
|
16
|
-
} from '@headless-adminapp/core/experience/view';
|
|
17
|
-
import {
|
|
18
|
-
Schema,
|
|
19
|
-
SchemaAttributes,
|
|
20
|
-
SchemaMetadata,
|
|
21
|
-
} from '@headless-adminapp/core/schema';
|
|
22
|
-
import {
|
|
23
|
-
ISchemaExperienceStore,
|
|
24
|
-
ISchemaStore,
|
|
25
|
-
} from '@headless-adminapp/core/store';
|
|
26
|
-
|
|
27
|
-
export function getDefaultCardView<
|
|
28
|
-
S extends SchemaAttributes = SchemaAttributes
|
|
29
|
-
>(schema: Schema<S>): CardView<S> {
|
|
30
|
-
return {
|
|
31
|
-
primaryColumn: schema.primaryAttribute,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface SchemaExperienceStoreOptions {
|
|
36
|
-
schemaStore: ISchemaStore;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export class SchemaExperienceStore implements ISchemaExperienceStore {
|
|
40
|
-
private experiences: Record<string, SchemaExperience> = {};
|
|
41
|
-
|
|
42
|
-
public constructor(protected options: SchemaExperienceStoreOptions) {}
|
|
43
|
-
|
|
44
|
-
register<S extends SchemaAttributes = SchemaAttributes>(
|
|
45
|
-
experience: SchemaExperience<S>
|
|
46
|
-
): void {
|
|
47
|
-
for (const view of Object.values(experience.views)) {
|
|
48
|
-
if (!view.id) {
|
|
49
|
-
throw new Error('View id is required');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (!view.name) {
|
|
53
|
-
throw new Error('View name is required');
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (view.logicalName !== experience.logicalName) {
|
|
57
|
-
throw new Error('View logicalName must match experience logicalName');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
this.experiences[experience.logicalName] = experience as SchemaExperience;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public async getExperience<S extends SchemaAttributes = SchemaAttributes>(
|
|
64
|
-
logicalName: string
|
|
65
|
-
): Promise<SchemaExperience<S>> {
|
|
66
|
-
const experience = this.experiences[logicalName];
|
|
67
|
-
|
|
68
|
-
if (!experience) {
|
|
69
|
-
throw new Error(`Experience for ${logicalName} not found`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return experience;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
public async getPublicViewLookup(
|
|
76
|
-
logicalName: string,
|
|
77
|
-
viewIds?: string[]
|
|
78
|
-
): Promise<LocalizedDataLookup[]> {
|
|
79
|
-
const experience = await this.getExperience(logicalName);
|
|
80
|
-
|
|
81
|
-
let views = experience.views;
|
|
82
|
-
|
|
83
|
-
if (viewIds?.length) {
|
|
84
|
-
views = views.filter((view) => viewIds.includes(view.id));
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (!views.length) {
|
|
88
|
-
views = experience.views.filter((x) => x.id === experience.defaultViewId);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return views.map((view) => ({
|
|
92
|
-
id: view.id,
|
|
93
|
-
name: view.name,
|
|
94
|
-
localizedNames: view.localizedNames,
|
|
95
|
-
}));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
public async getAssociatedViewLookup(
|
|
99
|
-
logicalName: string,
|
|
100
|
-
viewIds?: string[]
|
|
101
|
-
): Promise<LocalizedDataLookup[]> {
|
|
102
|
-
const experience = await this.getExperience(logicalName);
|
|
103
|
-
|
|
104
|
-
let associatedViews = experience.associatedViews;
|
|
105
|
-
|
|
106
|
-
if (viewIds?.length) {
|
|
107
|
-
associatedViews = associatedViews.filter((view) =>
|
|
108
|
-
viewIds.includes(view.id)
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (!associatedViews.length) {
|
|
113
|
-
associatedViews = experience.associatedViews.filter(
|
|
114
|
-
(x) => x.id === experience.defaultAssociatedViewId
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
return associatedViews.map((view) => ({
|
|
119
|
-
id: view.id,
|
|
120
|
-
name: view.name,
|
|
121
|
-
localizedNames: view.localizedNames,
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
async getPublicView<S extends SchemaAttributes = SchemaAttributes>(
|
|
126
|
-
logicalName: string,
|
|
127
|
-
viewId?: string,
|
|
128
|
-
viewIds?: string[]
|
|
129
|
-
): Promise<View<S>> {
|
|
130
|
-
const experience = await this.getExperience(logicalName);
|
|
131
|
-
|
|
132
|
-
const availableViewLookup = await this.getPublicViewLookup(
|
|
133
|
-
logicalName,
|
|
134
|
-
viewIds
|
|
135
|
-
);
|
|
136
|
-
|
|
137
|
-
let validViewIds = availableViewLookup.map((x) => x.id);
|
|
138
|
-
|
|
139
|
-
if (!validViewIds.length) {
|
|
140
|
-
validViewIds = [experience.defaultViewId];
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (!viewId) {
|
|
144
|
-
viewId = experience.defaultViewId;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (!validViewIds.includes(viewId)) {
|
|
148
|
-
viewId = validViewIds[0];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
let view = experience.views.find((v) => v.id === viewId);
|
|
152
|
-
|
|
153
|
-
if (!view) {
|
|
154
|
-
throw new Error(`View ${viewId} not found`);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
let viewExperience = view.experience;
|
|
158
|
-
|
|
159
|
-
if (typeof viewExperience === 'function') {
|
|
160
|
-
viewExperience = await viewExperience();
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
if (!viewExperience.card) {
|
|
164
|
-
viewExperience.card = getDefaultCardView(
|
|
165
|
-
this.options.schemaStore.getSchema(logicalName)
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return {
|
|
170
|
-
id: view.id,
|
|
171
|
-
name: view.name,
|
|
172
|
-
logicalName: view.logicalName,
|
|
173
|
-
localizedNames: view.localizedNames,
|
|
174
|
-
experience: viewExperience,
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
async getAssociatedView<S extends SchemaAttributes = SchemaAttributes>(
|
|
179
|
-
logicalName: string,
|
|
180
|
-
viewId?: string,
|
|
181
|
-
viewIds?: string[]
|
|
182
|
-
): Promise<View<S>> {
|
|
183
|
-
const experience = await this.getExperience(logicalName);
|
|
184
|
-
|
|
185
|
-
const availableViewLookup = await this.getAssociatedViewLookup(
|
|
186
|
-
logicalName,
|
|
187
|
-
viewIds
|
|
188
|
-
);
|
|
189
|
-
|
|
190
|
-
let validViewIds = availableViewLookup.map((x) => x.id);
|
|
191
|
-
|
|
192
|
-
if (!validViewIds.length) {
|
|
193
|
-
validViewIds = [experience.defaultViewId];
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (!viewId) {
|
|
197
|
-
viewId = experience.defaultAssociatedViewId;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
if (!validViewIds.includes(viewId)) {
|
|
201
|
-
viewId = validViewIds[0];
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
let view = experience.associatedViews.find((v) => v.id === viewId);
|
|
205
|
-
|
|
206
|
-
if (!view) {
|
|
207
|
-
throw new Error(`View ${viewId} not found`);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
let viewExperience = view.experience;
|
|
211
|
-
|
|
212
|
-
if (typeof viewExperience === 'function') {
|
|
213
|
-
viewExperience = await viewExperience();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (!viewExperience.card) {
|
|
217
|
-
viewExperience.card = getDefaultCardView(
|
|
218
|
-
this.options.schemaStore.getSchema(logicalName)
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return {
|
|
223
|
-
id: view.id,
|
|
224
|
-
name: view.name,
|
|
225
|
-
logicalName: view.logicalName,
|
|
226
|
-
localizedNames: view.localizedNames,
|
|
227
|
-
experience: viewExperience,
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
async getViewLookupV2<S extends SchemaAttributes = SchemaAttributes>(
|
|
232
|
-
logicalName: string,
|
|
233
|
-
viewId?: string
|
|
234
|
-
): Promise<View<S>> {
|
|
235
|
-
const experience = await this.getExperience(logicalName);
|
|
236
|
-
|
|
237
|
-
if (!viewId) {
|
|
238
|
-
viewId = experience.defaultViewId;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
const view = experience.lookups.find((v) => v.id === viewId);
|
|
242
|
-
|
|
243
|
-
if (!view) {
|
|
244
|
-
throw new Error(`Lookup ${viewId} not found`);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
let viewExperience = view.experience;
|
|
248
|
-
|
|
249
|
-
if (typeof viewExperience === 'function') {
|
|
250
|
-
viewExperience = await viewExperience();
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
return {
|
|
254
|
-
id: view.id,
|
|
255
|
-
name: view.name,
|
|
256
|
-
logicalName: view.logicalName,
|
|
257
|
-
experience: viewExperience,
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
async getDefaultViewId(logicalName: string): Promise<string> {
|
|
262
|
-
const experience = await this.getExperience(logicalName);
|
|
263
|
-
|
|
264
|
-
return experience.defaultViewId;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
async getDefaultViewLookupId(logicalName: string): Promise<string> {
|
|
268
|
-
const experience = await this.getExperience(logicalName);
|
|
269
|
-
|
|
270
|
-
return experience.defaultLookupId;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
async getForm<S extends SchemaAttributes = SchemaAttributes>(
|
|
274
|
-
logicalName: string,
|
|
275
|
-
formId: string
|
|
276
|
-
): Promise<Form<S>> {
|
|
277
|
-
const experience = await this.getExperience(logicalName);
|
|
278
|
-
|
|
279
|
-
if (!formId) {
|
|
280
|
-
formId = experience.defaultFormId;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const form = experience.forms.find((f) => f.id === formId);
|
|
284
|
-
|
|
285
|
-
if (!form) {
|
|
286
|
-
throw new Error(`Form ${formId} not found`);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
let formExperience = form.experience;
|
|
290
|
-
|
|
291
|
-
if (typeof formExperience === 'function') {
|
|
292
|
-
formExperience = await formExperience();
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return {
|
|
296
|
-
id: form.id,
|
|
297
|
-
name: form.name,
|
|
298
|
-
logicalName: form.logicalName,
|
|
299
|
-
experience: formExperience,
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
async getQuickCreateForm<S extends SchemaAttributes = SchemaAttributes>(
|
|
304
|
-
logicalName: string,
|
|
305
|
-
formId: string
|
|
306
|
-
): Promise<QuickCreateForm<S>> {
|
|
307
|
-
const experience = await this.getExperience(logicalName);
|
|
308
|
-
|
|
309
|
-
const form = experience.quickCreateForms.find((f) => f.id === formId);
|
|
310
|
-
|
|
311
|
-
if (!form) {
|
|
312
|
-
throw new Error(`Quick create form ${formId} not found`);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
let formExperience = form.experience;
|
|
316
|
-
|
|
317
|
-
if (typeof formExperience === 'function') {
|
|
318
|
-
formExperience = await formExperience();
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
return {
|
|
322
|
-
id: form.id,
|
|
323
|
-
name: form.name,
|
|
324
|
-
logicalName: form.logicalName,
|
|
325
|
-
experience: formExperience,
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
async getViewCommands(
|
|
330
|
-
logicalName: string
|
|
331
|
-
): Promise<EntityMainGridCommandItemExperience[][]> {
|
|
332
|
-
const experience = await this.getExperience(logicalName);
|
|
333
|
-
|
|
334
|
-
return experience.viewCommands;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
async getFormCommands(
|
|
338
|
-
logicalName: string
|
|
339
|
-
): Promise<EntityMainFormCommandItemExperience[][]> {
|
|
340
|
-
const experience = await this.getExperience(logicalName);
|
|
341
|
-
|
|
342
|
-
return experience.formCommands;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
async getSubgridCommands(
|
|
346
|
-
logicalName: string
|
|
347
|
-
): Promise<SubGridCommandItemExperience[][]> {
|
|
348
|
-
const experience = await this.getExperience(logicalName);
|
|
349
|
-
|
|
350
|
-
return experience.subgridCommands;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
getSchemaMetadataList(): SchemaMetadata[] {
|
|
354
|
-
const schemas = this.options.schemaStore.getAllSchema();
|
|
355
|
-
return Object.values(schemas).map((schema) => ({
|
|
356
|
-
logicalName: schema.logicalName,
|
|
357
|
-
label: schema.label,
|
|
358
|
-
pluralLabel: schema.pluralLabel,
|
|
359
|
-
description: schema.description,
|
|
360
|
-
localizedDescriptions: schema.localizedDescriptions,
|
|
361
|
-
localizedLabels: schema.localizedLabels,
|
|
362
|
-
localizedPluralLabels: schema.localizedPluralLabels,
|
|
363
|
-
}));
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
async getExperienceSchemaMetadatList(): Promise<SchemaExperienceMetadata[]> {
|
|
367
|
-
const schemaMetadatas = this.getSchemaMetadataList();
|
|
368
|
-
|
|
369
|
-
return schemaMetadatas.map((schemaMetadata) => ({
|
|
370
|
-
...schemaMetadata,
|
|
371
|
-
icon: this.experiences[schemaMetadata.logicalName]?.icon,
|
|
372
|
-
}));
|
|
373
|
-
}
|
|
374
|
-
}
|
package/src/store/index.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useCreateContextStore } from '../mutable/context';
|
|
4
|
-
import {
|
|
5
|
-
ToastNotificationContext,
|
|
6
|
-
ToastNotificationContextState,
|
|
7
|
-
} from './context';
|
|
8
|
-
|
|
9
|
-
interface ToastNotificationProviderProps {}
|
|
10
|
-
|
|
11
|
-
export const ToastNotificationProvider: FC<
|
|
12
|
-
PropsWithChildren<ToastNotificationProviderProps>
|
|
13
|
-
> = ({ children }) => {
|
|
14
|
-
const contextState = useCreateContextStore<ToastNotificationContextState>({
|
|
15
|
-
items: [],
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<ToastNotificationContext.Provider value={contextState}>
|
|
20
|
-
{children}
|
|
21
|
-
</ToastNotificationContext.Provider>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createContext } from '../mutable/context';
|
|
2
|
-
|
|
3
|
-
export interface ToastNotificationItem {
|
|
4
|
-
id: string;
|
|
5
|
-
isOpen: boolean;
|
|
6
|
-
text: string;
|
|
7
|
-
title?: string;
|
|
8
|
-
actions?: { text: string; onClick: () => void }[];
|
|
9
|
-
type?: 'info' | 'success' | 'warning' | 'error';
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface ToastNotificationContextState {
|
|
13
|
-
items: ToastNotificationItem[];
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const ToastNotificationContext =
|
|
17
|
-
createContext<ToastNotificationContextState>();
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useContextSetValue } from '../../mutable/context';
|
|
4
|
-
import { ToastNotificationContext } from '../context';
|
|
5
|
-
|
|
6
|
-
export function useCloseToastNotification() {
|
|
7
|
-
const setValue = useContextSetValue(ToastNotificationContext);
|
|
8
|
-
|
|
9
|
-
const closeDialog = useCallback(
|
|
10
|
-
(id: string) => {
|
|
11
|
-
setValue((state) => {
|
|
12
|
-
return {
|
|
13
|
-
items: state.items.map((item) => {
|
|
14
|
-
if (item.id === id) {
|
|
15
|
-
return { ...item, isOpen: false };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return item;
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// Simulate a delay to show the dialog closing animation
|
|
24
|
-
setTimeout(() => {
|
|
25
|
-
setValue((state) => {
|
|
26
|
-
return {
|
|
27
|
-
items: state.items.filter((item) => item.id !== id),
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
}, 1000);
|
|
31
|
-
},
|
|
32
|
-
[setValue]
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
return closeDialog;
|
|
36
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'react';
|
|
2
|
-
|
|
3
|
-
import { useContextSetValue } from '../../mutable/context';
|
|
4
|
-
import { ToastNotificationContext, ToastNotificationItem } from '../context';
|
|
5
|
-
import { useCloseToastNotification } from './useCloseToastNotification';
|
|
6
|
-
|
|
7
|
-
function randomId() {
|
|
8
|
-
return Math.random().toString(36).substring(2);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function useOpenToastNotification() {
|
|
12
|
-
const setValue = useContextSetValue(ToastNotificationContext);
|
|
13
|
-
const closeDialog = useCloseToastNotification();
|
|
14
|
-
|
|
15
|
-
const openToastNotification = useCallback(
|
|
16
|
-
(options: Omit<ToastNotificationItem, 'id' | 'isOpen'>) => {
|
|
17
|
-
const id = randomId();
|
|
18
|
-
|
|
19
|
-
setValue((state) => {
|
|
20
|
-
return {
|
|
21
|
-
items: [
|
|
22
|
-
...state.items,
|
|
23
|
-
{
|
|
24
|
-
id,
|
|
25
|
-
isOpen: true,
|
|
26
|
-
...options,
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return { id, close: () => closeDialog(id) };
|
|
33
|
-
},
|
|
34
|
-
[setValue, closeDialog]
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return openToastNotification;
|
|
38
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import type { Id } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import {
|
|
3
|
-
InferredSchemaType,
|
|
4
|
-
Schema,
|
|
5
|
-
SchemaAttributes,
|
|
6
|
-
} from '@headless-adminapp/core/schema';
|
|
7
|
-
import {
|
|
8
|
-
AggregateAttribute,
|
|
9
|
-
CreateRecordResult,
|
|
10
|
-
Data,
|
|
11
|
-
IDataService,
|
|
12
|
-
InferredAggregateQueryResult,
|
|
13
|
-
} from '@headless-adminapp/core/transport';
|
|
14
|
-
import {
|
|
15
|
-
RetriveRecordsFnOptions,
|
|
16
|
-
RetriveRecordsResult,
|
|
17
|
-
} from '@headless-adminapp/core/transport/operations';
|
|
18
|
-
|
|
19
|
-
interface Options {
|
|
20
|
-
data: Record<string, unknown[]>;
|
|
21
|
-
schemas: Record<string, Schema>;
|
|
22
|
-
idGenerator: (logicalName: string, records: unknown[]) => string | number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export class InMemoryDataService implements IDataService {
|
|
26
|
-
// , IActionService, IReportService
|
|
27
|
-
public constructor(private readonly options: Options) {}
|
|
28
|
-
|
|
29
|
-
private getSchema(logicalName: string) {
|
|
30
|
-
const schema = this.options.schemas[logicalName];
|
|
31
|
-
|
|
32
|
-
if (!schema) {
|
|
33
|
-
throw new Error(`Schema for ${logicalName} not found`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return schema;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
private getCollection<T>(logicalName: string) {
|
|
40
|
-
if (!this.options.data[logicalName]) {
|
|
41
|
-
throw new Error(`Entity ${logicalName} not found`);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return this.options.data[logicalName] as T[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public async retriveRecord<T = unknown>(
|
|
48
|
-
logicalName: string,
|
|
49
|
-
id: Id
|
|
50
|
-
): Promise<Data<T>> {
|
|
51
|
-
const schema = this.getSchema(logicalName);
|
|
52
|
-
const records =
|
|
53
|
-
this.getCollection<InferredSchemaType<SchemaAttributes>>(logicalName);
|
|
54
|
-
|
|
55
|
-
const record = records.find((record) => {
|
|
56
|
-
return record[schema.idAttribute] === id;
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
if (!record) {
|
|
60
|
-
throw new Error(`Record with id ${id} not found`);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return record as any;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public async retriveRecords<T = unknown>({
|
|
67
|
-
logicalName,
|
|
68
|
-
}: RetriveRecordsFnOptions<T>): Promise<RetriveRecordsResult<T>> {
|
|
69
|
-
const records =
|
|
70
|
-
this.getCollection<InferredSchemaType<SchemaAttributes>>(logicalName);
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
logicalName,
|
|
74
|
-
records: records as Data<T>[],
|
|
75
|
-
count: records.length,
|
|
76
|
-
} as any;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
public async createRecord<T>(
|
|
80
|
-
logicalName: string,
|
|
81
|
-
data: Partial<T>
|
|
82
|
-
): Promise<CreateRecordResult> {
|
|
83
|
-
const schema = this.getSchema(logicalName);
|
|
84
|
-
const records =
|
|
85
|
-
this.getCollection<InferredSchemaType<SchemaAttributes>>(logicalName);
|
|
86
|
-
|
|
87
|
-
const newId = this.options.idGenerator(logicalName, records);
|
|
88
|
-
|
|
89
|
-
const newRecord = {
|
|
90
|
-
...data,
|
|
91
|
-
[schema.idAttribute]: newId,
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
records.push(newRecord);
|
|
95
|
-
|
|
96
|
-
return { id: newId } as any;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
public async updateRecord<T>(
|
|
100
|
-
logicalName: string,
|
|
101
|
-
id: string,
|
|
102
|
-
data: Partial<T>
|
|
103
|
-
) {
|
|
104
|
-
const schema = this.getSchema(logicalName);
|
|
105
|
-
const records =
|
|
106
|
-
this.getCollection<InferredSchemaType<SchemaAttributes>>(logicalName);
|
|
107
|
-
|
|
108
|
-
const record = records.find((record) => {
|
|
109
|
-
return record[schema.idAttribute] === id;
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
if (!record) {
|
|
113
|
-
throw new Error(`Record with id ${id} not found`);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
Object.assign(record, data);
|
|
117
|
-
|
|
118
|
-
return { id } as any;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public async deleteRecord(logicalName: string, id: string) {
|
|
122
|
-
const schema = this.getSchema(logicalName);
|
|
123
|
-
const records =
|
|
124
|
-
this.getCollection<InferredSchemaType<SchemaAttributes>>(logicalName);
|
|
125
|
-
|
|
126
|
-
const index = records.findIndex((record) => {
|
|
127
|
-
return record[schema.idAttribute] === id;
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
if (index === -1) {
|
|
131
|
-
throw new Error(`Record with id ${id} not found`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
records.splice(index, 1);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
public async executeAction<T>() {
|
|
138
|
-
return {} as T;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
public async getReportData<T>() {
|
|
142
|
-
return {} as T;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
public async retriveAggregate<
|
|
146
|
-
Q extends Record<string, AggregateAttribute> = Record<
|
|
147
|
-
string,
|
|
148
|
-
AggregateAttribute
|
|
149
|
-
>
|
|
150
|
-
>(): Promise<InferredAggregateQueryResult<Q>[]> {
|
|
151
|
-
return [] as any;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
public async customAction<T = unknown>(): Promise<T> {
|
|
155
|
-
return {} as T;
|
|
156
|
-
}
|
|
157
|
-
}
|