@headless-adminapp/app 0.0.8-0.0.9-alpha.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/app/context.d.ts +8 -0
- package/dist/app/context.js +5 -0
- package/dist/app/hooks/index.d.ts +1 -0
- package/dist/app/hooks/index.js +17 -0
- package/dist/app/hooks/useAppContext.d.ts +2 -0
- package/dist/app/hooks/useAppContext.js +12 -0
- package/dist/app/index.d.ts +2 -0
- package/dist/app/index.js +7 -0
- package/dist/appearance/context.d.ts +7 -0
- package/dist/appearance/context.js +5 -0
- package/dist/appearance/hooks/index.d.ts +1 -0
- package/dist/appearance/hooks/index.js +17 -0
- package/dist/appearance/hooks/useAppearanceContext.d.ts +1 -0
- package/dist/appearance/hooks/useAppearanceContext.js +12 -0
- package/dist/appearance/index.d.ts +2 -0
- package/dist/appearance/index.js +20 -0
- package/dist/auth/AuthProvider.d.ts +7 -0
- package/dist/auth/AuthProvider.js +104 -0
- package/dist/auth/context.d.ts +30 -0
- package/dist/auth/context.js +5 -0
- package/dist/auth/hooks/index.d.ts +2 -0
- package/dist/auth/hooks/index.js +18 -0
- package/dist/auth/hooks/useAuthSession.d.ts +2 -0
- package/dist/auth/hooks/useAuthSession.js +16 -0
- package/dist/auth/hooks/useLogout.d.ts +1 -0
- package/dist/auth/hooks/useLogout.js +19 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.js +23 -0
- package/dist/auth/types.d.ts +10 -0
- package/dist/auth/types.js +2 -0
- package/dist/builders/CommandBuilder.d.ts +176 -0
- package/dist/builders/CommandBuilder.js +474 -0
- package/dist/builders/SchemaExperienceBuilder.d.ts +69 -0
- package/dist/builders/SchemaExperienceBuilder.js +267 -0
- package/dist/builders/index.d.ts +2 -0
- package/dist/builders/index.js +7 -0
- package/dist/command/hooks/index.d.ts +2 -0
- package/dist/command/hooks/index.js +18 -0
- package/dist/command/hooks/useBaseCommandHandlerContext.d.ts +4 -0
- package/dist/command/hooks/useBaseCommandHandlerContext.js +42 -0
- package/dist/command/hooks/useCommands.d.ts +7 -0
- package/dist/command/hooks/useCommands.js +16 -0
- package/dist/command/index.d.ts +2 -0
- package/dist/command/index.js +18 -0
- package/dist/command/types.d.ts +76 -0
- package/dist/command/types.js +2 -0
- package/dist/command/utils/index.d.ts +3 -0
- package/dist/command/utils/index.js +63 -0
- package/dist/components/ScrollView/index.d.ts +10 -0
- package/dist/components/ScrollView/index.js +11 -0
- package/dist/dataform/DataFormProvider/DataResolver.d.ts +5 -0
- package/dist/dataform/DataFormProvider/DataResolver.js +143 -0
- package/dist/dataform/DataFormProvider/InitialValueResolver.d.ts +1 -0
- package/dist/dataform/DataFormProvider/InitialValueResolver.js +44 -0
- package/dist/dataform/DataFormProvider/ReadonlyInfoResolver.d.ts +3 -0
- package/dist/dataform/DataFormProvider/ReadonlyInfoResolver.js +27 -0
- package/dist/dataform/DataFormProvider/index.d.ts +10 -0
- package/dist/dataform/DataFormProvider/index.js +72 -0
- package/dist/dataform/context.d.ts +22 -0
- package/dist/dataform/context.js +5 -0
- package/dist/dataform/hooks/index.d.ts +11 -0
- package/dist/dataform/hooks/index.js +27 -0
- package/dist/dataform/hooks/useFormInstance.d.ts +1 -0
- package/dist/dataform/hooks/useFormInstance.js +8 -0
- package/dist/dataform/hooks/useFormIsDirty.d.ts +1 -0
- package/dist/dataform/hooks/useFormIsDirty.js +8 -0
- package/dist/dataform/hooks/useFormIsReadonly.d.ts +1 -0
- package/dist/dataform/hooks/useFormIsReadonly.js +9 -0
- package/dist/dataform/hooks/useFormNotifications.d.ts +4 -0
- package/dist/dataform/hooks/useFormNotifications.js +34 -0
- package/dist/dataform/hooks/useFormRecord.d.ts +1 -0
- package/dist/dataform/hooks/useFormRecord.js +9 -0
- package/dist/dataform/hooks/useFormSave.d.ts +2 -0
- package/dist/dataform/hooks/useFormSave.js +135 -0
- package/dist/dataform/hooks/useFormSchema.d.ts +2 -0
- package/dist/dataform/hooks/useFormSchema.js +8 -0
- package/dist/dataform/hooks/useLoadFormGridPage.d.ts +18 -0
- package/dist/dataform/hooks/useLoadFormGridPage.js +73 -0
- package/dist/dataform/hooks/useMainFormCommands.d.ts +16 -0
- package/dist/dataform/hooks/useMainFormCommands.js +47 -0
- package/dist/dataform/hooks/useRecordId.d.ts +1 -0
- package/dist/dataform/hooks/useRecordId.js +8 -0
- package/dist/dataform/hooks/useRecordTitle.d.ts +1 -0
- package/dist/dataform/hooks/useRecordTitle.js +20 -0
- package/dist/dataform/hooks/useSelectedForm.d.ts +3 -0
- package/dist/dataform/hooks/useSelectedForm.js +8 -0
- package/dist/dataform/utils/index.d.ts +62 -0
- package/dist/dataform/utils/index.js +356 -0
- package/dist/datagrid/DataGridProvider/DataResolver.d.ts +2 -0
- package/dist/datagrid/DataGridProvider/DataResolver.js +208 -0
- package/dist/datagrid/DataGridProvider/index.d.ts +18 -0
- package/dist/datagrid/DataGridProvider/index.js +77 -0
- package/dist/datagrid/DataGridProvider/transformViewColumns.d.ts +5 -0
- package/dist/datagrid/DataGridProvider/transformViewColumns.js +29 -0
- package/dist/datagrid/DataGridProvider/utils.d.ts +3 -0
- package/dist/datagrid/DataGridProvider/utils.js +74 -0
- package/dist/datagrid/column-filter/constants.d.ts +4 -0
- package/dist/datagrid/column-filter/constants.js +482 -0
- package/dist/datagrid/column-filter/index.d.ts +3 -0
- package/dist/datagrid/column-filter/index.js +7 -0
- package/dist/datagrid/column-filter/types.d.ts +65 -0
- package/dist/datagrid/column-filter/types.js +2 -0
- package/dist/datagrid/column-filter/utils.d.ts +3 -0
- package/dist/datagrid/column-filter/utils.js +8 -0
- package/dist/datagrid/context.d.ts +33 -0
- package/dist/datagrid/context.js +5 -0
- package/dist/datagrid/hooks/index.d.ts +19 -0
- package/dist/datagrid/hooks/index.js +35 -0
- package/dist/datagrid/hooks/useChangeView.d.ts +1 -0
- package/dist/datagrid/hooks/useChangeView.js +12 -0
- package/dist/datagrid/hooks/useGridColumnFilter.d.ts +2 -0
- package/dist/datagrid/hooks/useGridColumnFilter.js +16 -0
- package/dist/datagrid/hooks/useGridColumns.d.ts +3 -0
- package/dist/datagrid/hooks/useGridColumns.js +8 -0
- package/dist/datagrid/hooks/useGridCommands.d.ts +3 -0
- package/dist/datagrid/hooks/useGridCommands.js +9 -0
- package/dist/datagrid/hooks/useGridData.d.ts +1 -0
- package/dist/datagrid/hooks/useGridData.js +9 -0
- package/dist/datagrid/hooks/useGridDataState.d.ts +5 -0
- package/dist/datagrid/hooks/useGridDataState.js +9 -0
- package/dist/datagrid/hooks/useGridExtraFilter.d.ts +1 -0
- package/dist/datagrid/hooks/useGridExtraFilter.js +8 -0
- package/dist/datagrid/hooks/useGridOptions.d.ts +1 -0
- package/dist/datagrid/hooks/useGridOptions.js +6 -0
- package/dist/datagrid/hooks/useGridPagination.d.ts +1 -0
- package/dist/datagrid/hooks/useGridPagination.js +6 -0
- package/dist/datagrid/hooks/useGridRefresh.d.ts +1 -0
- package/dist/datagrid/hooks/useGridRefresh.js +18 -0
- package/dist/datagrid/hooks/useGridSchema.d.ts +2 -0
- package/dist/datagrid/hooks/useGridSchema.js +8 -0
- package/dist/datagrid/hooks/useGridSelection.d.ts +1 -0
- package/dist/datagrid/hooks/useGridSelection.js +21 -0
- package/dist/datagrid/hooks/useGridSorting.d.ts +3 -0
- package/dist/datagrid/hooks/useGridSorting.js +14 -0
- package/dist/datagrid/hooks/useGridViewLookupData.d.ts +1 -0
- package/dist/datagrid/hooks/useGridViewLookupData.js +9 -0
- package/dist/datagrid/hooks/useLoadMainGridPage.d.ts +20 -0
- package/dist/datagrid/hooks/useLoadMainGridPage.js +55 -0
- package/dist/datagrid/hooks/useMainGridCommands.d.ts +19 -0
- package/dist/datagrid/hooks/useMainGridCommands.js +228 -0
- package/dist/datagrid/hooks/useMaxRecords.d.ts +1 -0
- package/dist/datagrid/hooks/useMaxRecords.js +8 -0
- package/dist/datagrid/hooks/useSearchText.d.ts +1 -0
- package/dist/datagrid/hooks/useSearchText.js +14 -0
- package/dist/datagrid/hooks/useSelectedView.d.ts +3 -0
- package/dist/datagrid/hooks/useSelectedView.js +8 -0
- package/dist/datagrid/hooks/useSubGridCommands.d.ts +5 -0
- package/dist/datagrid/hooks/useSubGridCommands.js +87 -0
- package/dist/dialog/DialogProvider.d.ts +5 -0
- package/dist/dialog/DialogProvider.js +13 -0
- package/dist/dialog/context.d.ts +6 -0
- package/dist/dialog/context.js +5 -0
- package/dist/dialog/hooks/index.d.ts +8 -0
- package/dist/dialog/hooks/index.js +24 -0
- package/dist/dialog/hooks/useCloseDialog.d.ts +1 -0
- package/dist/dialog/hooks/useCloseDialog.js +30 -0
- package/dist/dialog/hooks/useDialogItem.d.ts +1 -0
- package/dist/dialog/hooks/useDialogItem.js +8 -0
- package/dist/dialog/hooks/useDialogItems.d.ts +1 -0
- package/dist/dialog/hooks/useDialogItems.js +8 -0
- package/dist/dialog/hooks/useOpenAlertDialog.d.ts +2 -0
- package/dist/dialog/hooks/useOpenAlertDialog.js +20 -0
- package/dist/dialog/hooks/useOpenConfirmDialog.d.ts +2 -0
- package/dist/dialog/hooks/useOpenConfirmDialog.js +26 -0
- package/dist/dialog/hooks/useOpenDialog.d.ts +5 -0
- package/dist/dialog/hooks/useOpenDialog.js +27 -0
- package/dist/dialog/hooks/useOpenErrorDialog.d.ts +2 -0
- package/dist/dialog/hooks/useOpenErrorDialog.js +16 -0
- package/dist/dialog/hooks/useOpenPromptDialog.d.ts +3 -0
- package/dist/dialog/hooks/useOpenPromptDialog.js +26 -0
- package/dist/dialog/index.d.ts +3 -0
- package/dist/dialog/index.js +22 -0
- package/dist/form/FormValidationStringContext.d.ts +12 -0
- package/dist/form/FormValidationStringContext.js +19 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.js +21 -0
- package/dist/hooks/useDebouncedValue.d.ts +3 -0
- package/dist/hooks/useDebouncedValue.js +32 -0
- package/dist/hooks/useElementLayout.d.ts +7 -0
- package/dist/hooks/useElementLayout.js +34 -0
- package/dist/hooks/useIsMobile.d.ts +1 -0
- package/dist/hooks/useIsMobile.js +21 -0
- package/dist/hooks/useStorageState.d.ts +2 -0
- package/dist/hooks/useStorageState.js +26 -0
- package/dist/hooks/useSystemColorScheme.d.ts +1 -0
- package/dist/hooks/useSystemColorScheme.js +27 -0
- package/dist/insights/context.d.ts +2 -0
- package/dist/insights/context.js +5 -0
- package/dist/locale/context.d.ts +2 -0
- package/dist/locale/context.js +5 -0
- package/dist/locale/index.d.ts +3 -0
- package/dist/locale/index.js +21 -0
- package/dist/locale/types.d.ts +2 -0
- package/dist/locale/types.js +2 -0
- package/dist/locale/useLocale.d.ts +1 -0
- package/dist/locale/useLocale.js +12 -0
- package/dist/metadata/MetadataProvider.d.ts +9 -0
- package/dist/metadata/MetadataProvider.js +29 -0
- package/dist/metadata/context.d.ts +7 -0
- package/dist/metadata/context.js +5 -0
- package/dist/metadata/hooks/index.d.ts +8 -0
- package/dist/metadata/hooks/index.js +24 -0
- package/dist/metadata/hooks/useAppStore.d.ts +1 -0
- package/dist/metadata/hooks/useAppStore.js +8 -0
- package/dist/metadata/hooks/useExperienceStore.d.ts +1 -0
- package/dist/metadata/hooks/useExperienceStore.js +8 -0
- package/dist/metadata/hooks/useExperienceView.d.ts +4 -0
- package/dist/metadata/hooks/useExperienceView.js +37 -0
- package/dist/metadata/hooks/useExperienceViewCommands.d.ts +4 -0
- package/dist/metadata/hooks/useExperienceViewCommands.js +28 -0
- package/dist/metadata/hooks/useExperienceViewLookup.d.ts +4 -0
- package/dist/metadata/hooks/useExperienceViewLookup.js +36 -0
- package/dist/metadata/hooks/useExperienceViewSubgridCommands.d.ts +4 -0
- package/dist/metadata/hooks/useExperienceViewSubgridCommands.js +28 -0
- package/dist/metadata/hooks/useMetadata.d.ts +9 -0
- package/dist/metadata/hooks/useMetadata.js +28 -0
- package/dist/metadata/hooks/useSchema.d.ts +2 -0
- package/dist/metadata/hooks/useSchema.js +8 -0
- package/dist/metadata/index.d.ts +3 -0
- package/dist/metadata/index.js +22 -0
- package/dist/mutable/context.d.ts +11 -0
- package/dist/mutable/context.js +46 -0
- package/dist/mutable/index.d.ts +3 -0
- package/dist/mutable/index.js +26 -0
- package/dist/mutable/state.d.ts +6 -0
- package/dist/mutable/state.js +12 -0
- package/dist/mutable/type.d.ts +11 -0
- package/dist/mutable/type.js +2 -0
- package/dist/mutable/utils.d.ts +3 -0
- package/dist/mutable/utils.js +62 -0
- package/dist/navigation/hooks/useOpenForm.d.ts +4 -0
- package/dist/navigation/hooks/useOpenForm.js +20 -0
- package/dist/progress-indicator/ProgressIndicatorProvider.d.ts +2 -0
- package/dist/progress-indicator/ProgressIndicatorProvider.js +54 -0
- package/dist/progress-indicator/context.d.ts +8 -0
- package/dist/progress-indicator/context.js +5 -0
- package/dist/progress-indicator/hooks/index.d.ts +1 -0
- package/dist/progress-indicator/hooks/index.js +17 -0
- package/dist/progress-indicator/hooks/useProgressIndicator.d.ts +1 -0
- package/dist/progress-indicator/hooks/useProgressIndicator.js +12 -0
- package/dist/progress-indicator/index.d.ts +3 -0
- package/dist/progress-indicator/index.js +22 -0
- package/dist/providers/PageEntityFormProvider/index.d.ts +11 -0
- package/dist/providers/PageEntityFormProvider/index.js +8 -0
- package/dist/providers/PageEntityViewProvider/index.d.ts +13 -0
- package/dist/providers/PageEntityViewProvider/index.js +8 -0
- package/dist/recordset/RecordSetProvider.d.ts +2 -0
- package/dist/recordset/RecordSetProvider.js +40 -0
- package/dist/recordset/context.d.ts +8 -0
- package/dist/recordset/context.js +5 -0
- package/dist/recordset/hooks/index.d.ts +3 -0
- package/dist/recordset/hooks/index.js +19 -0
- package/dist/recordset/hooks/useRecordSetResult.d.ts +7 -0
- package/dist/recordset/hooks/useRecordSetResult.js +81 -0
- package/dist/recordset/hooks/useRecordSetSetter.d.ts +1 -0
- package/dist/recordset/hooks/useRecordSetSetter.js +17 -0
- package/dist/recordset/hooks/useRecordSetVisibility.d.ts +1 -0
- package/dist/recordset/hooks/useRecordSetVisibility.js +16 -0
- package/dist/recordset/index.d.ts +3 -0
- package/dist/recordset/index.js +22 -0
- package/dist/route/RouteProvider.d.ts +13 -0
- package/dist/route/RouteProvider.js +24 -0
- package/dist/route/context.d.ts +23 -0
- package/dist/route/context.js +9 -0
- package/dist/route/hooks/index.d.ts +4 -0
- package/dist/route/hooks/index.js +20 -0
- package/dist/route/hooks/useBasePath.d.ts +1 -0
- package/dist/route/hooks/useBasePath.js +8 -0
- package/dist/route/hooks/usePathname.d.ts +1 -0
- package/dist/route/hooks/usePathname.js +8 -0
- package/dist/route/hooks/useRouteResolver.d.ts +1 -0
- package/dist/route/hooks/useRouteResolver.js +8 -0
- package/dist/route/hooks/useRouter.d.ts +1 -0
- package/dist/route/hooks/useRouter.js +8 -0
- package/dist/route/hooks/useSearchParams.d.ts +1 -0
- package/dist/route/hooks/useSearchParams.js +8 -0
- package/dist/route/index.d.ts +2 -0
- package/dist/route/index.js +20 -0
- package/dist/route/types.d.ts +2 -0
- package/dist/route/types.js +2 -0
- package/dist/store/ClientAppStore.d.ts +7 -0
- package/dist/store/ClientAppStore.js +30 -0
- package/dist/store/ComponentStore.d.ts +6 -0
- package/dist/store/ComponentStore.js +23 -0
- package/dist/store/EventManager.d.ts +7 -0
- package/dist/store/EventManager.js +42 -0
- package/dist/store/SchemaExperienceStore.d.ts +32 -0
- package/dist/store/SchemaExperienceStore.js +264 -0
- package/dist/store/index.d.ts +4 -0
- package/dist/store/index.js +20 -0
- package/dist/toast-notification/ToastNotificationProvider.d.ts +5 -0
- package/dist/toast-notification/ToastNotificationProvider.js +13 -0
- package/dist/toast-notification/context.d.ts +15 -0
- package/dist/toast-notification/context.js +5 -0
- package/dist/toast-notification/hooks/index.d.ts +3 -0
- package/dist/toast-notification/hooks/index.js +19 -0
- package/dist/toast-notification/hooks/useCloseToastNotification.d.ts +1 -0
- package/dist/toast-notification/hooks/useCloseToastNotification.js +30 -0
- package/dist/toast-notification/hooks/useOpenToastNotification.d.ts +5 -0
- package/dist/toast-notification/hooks/useOpenToastNotification.js +27 -0
- package/dist/toast-notification/hooks/useToastNotificationItems.d.ts +1 -0
- package/dist/toast-notification/hooks/useToastNotificationItems.js +8 -0
- package/dist/toast-notification/index.d.ts +3 -0
- package/dist/toast-notification/index.js +22 -0
- package/dist/transport/InMemoryDataService/index.d.ts +25 -0
- package/dist/transport/InMemoryDataService/index.js +112 -0
- package/dist/transport/RestDataService/index.d.ts +25 -0
- package/dist/transport/RestDataService/index.js +124 -0
- package/dist/transport/context.d.ts +2 -0
- package/dist/transport/context.js +5 -0
- package/dist/transport/hooks/index.d.ts +1 -0
- package/dist/transport/hooks/index.js +17 -0
- package/dist/transport/hooks/useDataService.d.ts +1 -0
- package/dist/transport/hooks/useDataService.js +12 -0
- package/dist/transport/index.d.ts +2 -0
- package/dist/transport/index.js +20 -0
- package/dist/utils/calculateColumnWidths.d.ts +14 -0
- package/dist/utils/calculateColumnWidths.js +46 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +17 -0
- package/dist/widget/context.d.ts +2 -0
- package/dist/widget/context.js +5 -0
- package/dist/widget/hooks/index.d.ts +3 -0
- package/dist/widget/hooks/index.js +8 -0
- package/dist/widget/index.d.ts +1 -0
- package/dist/widget/index.js +5 -0
- package/package.json +45 -0
- package/src/app/context.ts +11 -0
- package/src/app/hooks/index.ts +1 -0
- package/src/app/hooks/useAppContext.ts +13 -0
- package/src/app/index.ts +2 -0
- package/src/appearance/context.ts +13 -0
- package/src/appearance/hooks/index.ts +1 -0
- package/src/appearance/hooks/useAppearanceContext.ts +13 -0
- package/src/appearance/index.ts +6 -0
- package/src/auth/AuthProvider.tsx +118 -0
- package/src/auth/context.ts +41 -0
- package/src/auth/hooks/index.ts +2 -0
- package/src/auth/hooks/useAuthSession.ts +17 -0
- package/src/auth/hooks/useLogout.ts +23 -0
- package/src/auth/index.ts +4 -0
- package/src/auth/types.ts +17 -0
- package/src/builders/CommandBuilder.ts +777 -0
- package/src/builders/SchemaExperienceBuilder.ts +488 -0
- package/src/builders/index.ts +2 -0
- package/src/command/hooks/index.ts +2 -0
- package/src/command/hooks/useBaseCommandHandlerContext.ts +51 -0
- package/src/command/hooks/useCommands.ts +26 -0
- package/src/command/index.ts +2 -0
- package/src/command/types.ts +116 -0
- package/src/command/utils/index.ts +142 -0
- package/src/components/ScrollView/index.tsx +26 -0
- package/src/dataform/DataFormProvider/DataResolver.tsx +186 -0
- package/src/dataform/DataFormProvider/InitialValueResolver.tsx +55 -0
- package/src/dataform/DataFormProvider/ReadonlyInfoResolver.tsx +35 -0
- package/src/dataform/DataFormProvider/index.tsx +102 -0
- package/src/dataform/context.ts +53 -0
- package/src/dataform/hooks/index.ts +11 -0
- package/src/dataform/hooks/useFormInstance.ts +6 -0
- package/src/dataform/hooks/useFormIsDirty.ts +7 -0
- package/src/dataform/hooks/useFormIsReadonly.ts +11 -0
- package/src/dataform/hooks/useFormNotifications.ts +46 -0
- package/src/dataform/hooks/useFormRecord.ts +7 -0
- package/src/dataform/hooks/useFormSave.ts +147 -0
- package/src/dataform/hooks/useFormSchema.ts +13 -0
- package/src/dataform/hooks/useLoadFormGridPage.ts +97 -0
- package/src/dataform/hooks/useMainFormCommands.ts +65 -0
- package/src/dataform/hooks/useRecordId.ts +6 -0
- package/src/dataform/hooks/useRecordTitle.ts +22 -0
- package/src/dataform/hooks/useSelectedForm.ts +14 -0
- package/src/dataform/utils/index.ts +582 -0
- package/src/datagrid/DataGridProvider/DataResolver.tsx +281 -0
- package/src/datagrid/DataGridProvider/index.tsx +134 -0
- package/src/datagrid/DataGridProvider/transformViewColumns.ts +54 -0
- package/src/datagrid/DataGridProvider/utils.ts +89 -0
- package/src/datagrid/column-filter/constants.ts +493 -0
- package/src/datagrid/column-filter/index.ts +3 -0
- package/src/datagrid/column-filter/types.ts +68 -0
- package/src/datagrid/column-filter/utils.ts +19 -0
- package/src/datagrid/context.ts +66 -0
- package/src/datagrid/hooks/index.ts +19 -0
- package/src/datagrid/hooks/useChangeView.ts +18 -0
- package/src/datagrid/hooks/useGridColumnFilter.ts +28 -0
- package/src/datagrid/hooks/useGridColumns.ts +13 -0
- package/src/datagrid/hooks/useGridCommands.ts +21 -0
- package/src/datagrid/hooks/useGridData.ts +8 -0
- package/src/datagrid/hooks/useGridDataState.ts +8 -0
- package/src/datagrid/hooks/useGridExtraFilter.ts +6 -0
- package/src/datagrid/hooks/useGridOptions.ts +3 -0
- package/src/datagrid/hooks/useGridPagination.ts +3 -0
- package/src/datagrid/hooks/useGridRefresh.ts +19 -0
- package/src/datagrid/hooks/useGridSchema.ts +13 -0
- package/src/datagrid/hooks/useGridSelection.ts +28 -0
- package/src/datagrid/hooks/useGridSorting.ts +23 -0
- package/src/datagrid/hooks/useGridViewLookupData.ts +10 -0
- package/src/datagrid/hooks/useLoadMainGridPage.ts +90 -0
- package/src/datagrid/hooks/useMainGridCommands.ts +255 -0
- package/src/datagrid/hooks/useMaxRecords.ts +6 -0
- package/src/datagrid/hooks/useSearchText.ts +22 -0
- package/src/datagrid/hooks/useSelectedView.ts +14 -0
- package/src/datagrid/hooks/useSubGridCommands.ts +104 -0
- package/src/dialog/DialogProvider.tsx +20 -0
- package/src/dialog/context.ts +14 -0
- package/src/dialog/hooks/index.ts +8 -0
- package/src/dialog/hooks/useCloseDialog.ts +36 -0
- package/src/dialog/hooks/useDialogItem.ts +8 -0
- package/src/dialog/hooks/useDialogItems.ts +6 -0
- package/src/dialog/hooks/useOpenAlertDialog.ts +30 -0
- package/src/dialog/hooks/useOpenConfirmDialog.ts +45 -0
- package/src/dialog/hooks/useOpenDialog.ts +39 -0
- package/src/dialog/hooks/useOpenErrorDialog.ts +26 -0
- package/src/dialog/hooks/useOpenPromptDialog.ts +46 -0
- package/src/dialog/index.ts +7 -0
- package/src/form/FormValidationStringContext.ts +30 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useDebouncedValue.ts +38 -0
- package/src/hooks/useElementLayout.ts +49 -0
- package/src/hooks/useIsMobile.ts +21 -0
- package/src/hooks/useStorageState.ts +36 -0
- package/src/hooks/useSystemColorScheme.ts +38 -0
- package/src/index.css +4 -0
- package/src/insights/context.ts +5 -0
- package/src/locale/context.ts +7 -0
- package/src/locale/index.ts +3 -0
- package/src/locale/types.ts +3 -0
- package/src/locale/useLocale.ts +13 -0
- package/src/metadata/MetadataProvider.tsx +51 -0
- package/src/metadata/context.ts +15 -0
- package/src/metadata/hooks/index.ts +8 -0
- package/src/metadata/hooks/useAppStore.ts +6 -0
- package/src/metadata/hooks/useExperienceStore.ts +6 -0
- package/src/metadata/hooks/useExperienceView.ts +36 -0
- package/src/metadata/hooks/useExperienceViewCommands.ts +20 -0
- package/src/metadata/hooks/useExperienceViewLookup.ts +33 -0
- package/src/metadata/hooks/useExperienceViewSubgridCommands.ts +20 -0
- package/src/metadata/hooks/useMetadata.ts +44 -0
- package/src/metadata/hooks/useSchema.ts +11 -0
- package/src/metadata/index.ts +3 -0
- package/src/mutable/context.ts +71 -0
- package/src/mutable/index.ts +9 -0
- package/src/mutable/state.ts +13 -0
- package/src/mutable/type.ts +9 -0
- package/src/mutable/utils.ts +80 -0
- package/src/navigation/hooks/useOpenForm.ts +34 -0
- package/src/progress-indicator/ProgressIndicatorProvider.tsx +77 -0
- package/src/progress-indicator/context.ts +12 -0
- package/src/progress-indicator/hooks/index.ts +1 -0
- package/src/progress-indicator/hooks/useProgressIndicator.ts +15 -0
- package/src/progress-indicator/index.ts +6 -0
- package/src/providers/PageEntityFormProvider/index.tsx +34 -0
- package/src/providers/PageEntityViewProvider/index.tsx +39 -0
- package/src/recordset/RecordSetProvider.tsx +55 -0
- package/src/recordset/context.ts +12 -0
- package/src/recordset/hooks/index.ts +3 -0
- package/src/recordset/hooks/useRecordSetResult.ts +94 -0
- package/src/recordset/hooks/useRecordSetSetter.ts +21 -0
- package/src/recordset/hooks/useRecordSetVisibility.ts +24 -0
- package/src/recordset/index.ts +3 -0
- package/src/route/RouteProvider.tsx +76 -0
- package/src/route/context.ts +39 -0
- package/src/route/hooks/index.ts +4 -0
- package/src/route/hooks/useBasePath.ts +7 -0
- package/src/route/hooks/usePathname.ts +7 -0
- package/src/route/hooks/useRouteResolver.ts +7 -0
- package/src/route/hooks/useRouter.ts +7 -0
- package/src/route/hooks/useSearchParams.ts +7 -0
- package/src/route/index.ts +2 -0
- package/src/route/types.ts +1 -0
- package/src/store/ClientAppStore.ts +20 -0
- package/src/store/ComponentStore.tsx +22 -0
- package/src/store/EventManager.ts +33 -0
- package/src/store/SchemaExperienceStore.ts +374 -0
- package/src/store/index.ts +4 -0
- package/src/toast-notification/ToastNotificationProvider.tsx +23 -0
- package/src/toast-notification/context.ts +17 -0
- package/src/toast-notification/hooks/index.ts +3 -0
- package/src/toast-notification/hooks/useCloseToastNotification.ts +36 -0
- package/src/toast-notification/hooks/useOpenToastNotification.ts +38 -0
- package/src/toast-notification/hooks/useToastNotificationItems.ts +6 -0
- package/src/toast-notification/index.ts +7 -0
- package/src/transport/InMemoryDataService/index.ts +157 -0
- package/src/transport/RestDataService/index.ts +151 -0
- package/src/transport/context.ts +6 -0
- package/src/transport/hooks/index.ts +1 -0
- package/src/transport/hooks/useDataService.ts +13 -0
- package/src/transport/index.ts +2 -0
- package/src/utils/calculateColumnWidths.ts +72 -0
- package/src/utils/index.ts +1 -0
- package/src/widget/context.ts +5 -0
- package/src/widget/hooks/index.ts +11 -0
- package/src/widget/index.ts +1 -0
- package/tsconfig.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.RouteProvider = void 0;
|
|
18
|
+
var RouteProvider_1 = require("./RouteProvider");
|
|
19
|
+
Object.defineProperty(exports, "RouteProvider", { enumerable: true, get: function () { return RouteProvider_1.RouteProvider; } });
|
|
20
|
+
__exportStar(require("./hooks"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AppExperience } from '@headless-adminapp/core/experience/app';
|
|
2
|
+
import { IClientAppStore } from '@headless-adminapp/core/store';
|
|
3
|
+
export declare class ClientAppStore implements IClientAppStore {
|
|
4
|
+
private apps;
|
|
5
|
+
register(app: AppExperience): void;
|
|
6
|
+
getApp(id: string): Promise<AppExperience>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ClientAppStore = void 0;
|
|
13
|
+
class ClientAppStore {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.apps = {};
|
|
16
|
+
}
|
|
17
|
+
register(app) {
|
|
18
|
+
this.apps[app.id] = app;
|
|
19
|
+
}
|
|
20
|
+
getApp(id) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const app = this.apps[id];
|
|
23
|
+
if (!app) {
|
|
24
|
+
throw new Error(`App Experience for ${id} not found`);
|
|
25
|
+
}
|
|
26
|
+
return app;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ClientAppStore = ClientAppStore;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentStore = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
class ComponentStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.components = {};
|
|
8
|
+
}
|
|
9
|
+
registerComponent(name, component) {
|
|
10
|
+
this.components[name] = component;
|
|
11
|
+
}
|
|
12
|
+
resolveComponent(name) {
|
|
13
|
+
const self = this;
|
|
14
|
+
return function (props) {
|
|
15
|
+
if (!self.components[name]) {
|
|
16
|
+
throw new Error(`Component ${name} is not registered`);
|
|
17
|
+
}
|
|
18
|
+
const Component = self.components[name];
|
|
19
|
+
return (0, jsx_runtime_1.jsx)(Component, Object.assign({}, props));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ComponentStore = ComponentStore;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IEventManager } from '@headless-adminapp/core/store';
|
|
2
|
+
export declare class EventManager implements IEventManager {
|
|
3
|
+
private handlers;
|
|
4
|
+
on<T>(key: string, handler: T): Promise<void>;
|
|
5
|
+
off<T>(key: string, handler: T): Promise<void>;
|
|
6
|
+
emit(key: string, ...args: any[]): any[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EventManager = void 0;
|
|
13
|
+
class EventManager {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.handlers = {};
|
|
16
|
+
}
|
|
17
|
+
on(key, handler) {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
if (!this.handlers[key]) {
|
|
20
|
+
this.handlers[key] = [];
|
|
21
|
+
}
|
|
22
|
+
this.handlers[key].push(handler);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
off(key, handler) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
if (!this.handlers[key]) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
this.handlers[key] = this.handlers[key].filter((h) => h !== handler);
|
|
31
|
+
if (this.handlers[key].length === 0) {
|
|
32
|
+
delete this.handlers[key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
emit(key, ...args) {
|
|
37
|
+
var _a;
|
|
38
|
+
const handlers = ((_a = this.handlers[key]) !== null && _a !== void 0 ? _a : []);
|
|
39
|
+
return handlers.map((handler) => handler(...args));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.EventManager = EventManager;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
+
import { EntityMainFormCommandItemExperience, Form, QuickCreateForm } from '@headless-adminapp/core/experience/form';
|
|
3
|
+
import { SchemaExperience, SchemaExperienceMetadata } from '@headless-adminapp/core/experience/schema';
|
|
4
|
+
import { CardView, EntityMainGridCommandItemExperience, SubGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
|
|
5
|
+
import { Schema, SchemaAttributes, SchemaMetadata } from '@headless-adminapp/core/schema';
|
|
6
|
+
import { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
|
|
7
|
+
export declare function getDefaultCardView<S extends SchemaAttributes = SchemaAttributes>(schema: Schema<S>): CardView<S>;
|
|
8
|
+
interface SchemaExperienceStoreOptions {
|
|
9
|
+
schemaStore: ISchemaStore;
|
|
10
|
+
}
|
|
11
|
+
export declare class SchemaExperienceStore implements ISchemaExperienceStore {
|
|
12
|
+
protected options: SchemaExperienceStoreOptions;
|
|
13
|
+
private experiences;
|
|
14
|
+
constructor(options: SchemaExperienceStoreOptions);
|
|
15
|
+
register<S extends SchemaAttributes = SchemaAttributes>(experience: SchemaExperience<S>): void;
|
|
16
|
+
getExperience<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): Promise<SchemaExperience<S>>;
|
|
17
|
+
getPublicViewLookup(logicalName: string, viewIds?: string[]): Promise<LocalizedDataLookup[]>;
|
|
18
|
+
getAssociatedViewLookup(logicalName: string, viewIds?: string[]): Promise<LocalizedDataLookup[]>;
|
|
19
|
+
getPublicView<S extends SchemaAttributes = SchemaAttributes>(logicalName: string, viewId?: string, viewIds?: string[]): Promise<View<S>>;
|
|
20
|
+
getAssociatedView<S extends SchemaAttributes = SchemaAttributes>(logicalName: string, viewId?: string, viewIds?: string[]): Promise<View<S>>;
|
|
21
|
+
getViewLookupV2<S extends SchemaAttributes = SchemaAttributes>(logicalName: string, viewId?: string): Promise<View<S>>;
|
|
22
|
+
getDefaultViewId(logicalName: string): Promise<string>;
|
|
23
|
+
getDefaultViewLookupId(logicalName: string): Promise<string>;
|
|
24
|
+
getForm<S extends SchemaAttributes = SchemaAttributes>(logicalName: string, formId: string): Promise<Form<S>>;
|
|
25
|
+
getQuickCreateForm<S extends SchemaAttributes = SchemaAttributes>(logicalName: string, formId: string): Promise<QuickCreateForm<S>>;
|
|
26
|
+
getViewCommands(logicalName: string): Promise<EntityMainGridCommandItemExperience[][]>;
|
|
27
|
+
getFormCommands(logicalName: string): Promise<EntityMainFormCommandItemExperience[][]>;
|
|
28
|
+
getSubgridCommands(logicalName: string): Promise<SubGridCommandItemExperience[][]>;
|
|
29
|
+
getSchemaMetadataList(): SchemaMetadata[];
|
|
30
|
+
getExperienceSchemaMetadatList(): Promise<SchemaExperienceMetadata[]>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SchemaExperienceStore = void 0;
|
|
13
|
+
exports.getDefaultCardView = getDefaultCardView;
|
|
14
|
+
function getDefaultCardView(schema) {
|
|
15
|
+
return {
|
|
16
|
+
primaryColumn: schema.primaryAttribute,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
class SchemaExperienceStore {
|
|
20
|
+
constructor(options) {
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.experiences = {};
|
|
23
|
+
}
|
|
24
|
+
register(experience) {
|
|
25
|
+
for (const view of Object.values(experience.views)) {
|
|
26
|
+
if (!view.id) {
|
|
27
|
+
throw new Error('View id is required');
|
|
28
|
+
}
|
|
29
|
+
if (!view.name) {
|
|
30
|
+
throw new Error('View name is required');
|
|
31
|
+
}
|
|
32
|
+
if (view.logicalName !== experience.logicalName) {
|
|
33
|
+
throw new Error('View logicalName must match experience logicalName');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
this.experiences[experience.logicalName] = experience;
|
|
37
|
+
}
|
|
38
|
+
getExperience(logicalName) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const experience = this.experiences[logicalName];
|
|
41
|
+
if (!experience) {
|
|
42
|
+
throw new Error(`Experience for ${logicalName} not found`);
|
|
43
|
+
}
|
|
44
|
+
return experience;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getPublicViewLookup(logicalName, viewIds) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const experience = yield this.getExperience(logicalName);
|
|
50
|
+
let views = experience.views;
|
|
51
|
+
if (viewIds === null || viewIds === void 0 ? void 0 : viewIds.length) {
|
|
52
|
+
views = views.filter((view) => viewIds.includes(view.id));
|
|
53
|
+
}
|
|
54
|
+
if (!views.length) {
|
|
55
|
+
views = experience.views.filter((x) => x.id === experience.defaultViewId);
|
|
56
|
+
}
|
|
57
|
+
return views.map((view) => ({
|
|
58
|
+
id: view.id,
|
|
59
|
+
name: view.name,
|
|
60
|
+
localizedNames: view.localizedNames,
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
getAssociatedViewLookup(logicalName, viewIds) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const experience = yield this.getExperience(logicalName);
|
|
67
|
+
let associatedViews = experience.associatedViews;
|
|
68
|
+
if (viewIds === null || viewIds === void 0 ? void 0 : viewIds.length) {
|
|
69
|
+
associatedViews = associatedViews.filter((view) => viewIds.includes(view.id));
|
|
70
|
+
}
|
|
71
|
+
if (!associatedViews.length) {
|
|
72
|
+
associatedViews = experience.associatedViews.filter((x) => x.id === experience.defaultAssociatedViewId);
|
|
73
|
+
}
|
|
74
|
+
return associatedViews.map((view) => ({
|
|
75
|
+
id: view.id,
|
|
76
|
+
name: view.name,
|
|
77
|
+
localizedNames: view.localizedNames,
|
|
78
|
+
}));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
getPublicView(logicalName, viewId, viewIds) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const experience = yield this.getExperience(logicalName);
|
|
84
|
+
const availableViewLookup = yield this.getPublicViewLookup(logicalName, viewIds);
|
|
85
|
+
let validViewIds = availableViewLookup.map((x) => x.id);
|
|
86
|
+
if (!validViewIds.length) {
|
|
87
|
+
validViewIds = [experience.defaultViewId];
|
|
88
|
+
}
|
|
89
|
+
if (!viewId) {
|
|
90
|
+
viewId = experience.defaultViewId;
|
|
91
|
+
}
|
|
92
|
+
if (!validViewIds.includes(viewId)) {
|
|
93
|
+
viewId = validViewIds[0];
|
|
94
|
+
}
|
|
95
|
+
let view = experience.views.find((v) => v.id === viewId);
|
|
96
|
+
if (!view) {
|
|
97
|
+
throw new Error(`View ${viewId} not found`);
|
|
98
|
+
}
|
|
99
|
+
let viewExperience = view.experience;
|
|
100
|
+
if (typeof viewExperience === 'function') {
|
|
101
|
+
viewExperience = yield viewExperience();
|
|
102
|
+
}
|
|
103
|
+
if (!viewExperience.card) {
|
|
104
|
+
viewExperience.card = getDefaultCardView(this.options.schemaStore.getSchema(logicalName));
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
id: view.id,
|
|
108
|
+
name: view.name,
|
|
109
|
+
logicalName: view.logicalName,
|
|
110
|
+
localizedNames: view.localizedNames,
|
|
111
|
+
experience: viewExperience,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
getAssociatedView(logicalName, viewId, viewIds) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
const experience = yield this.getExperience(logicalName);
|
|
118
|
+
const availableViewLookup = yield this.getAssociatedViewLookup(logicalName, viewIds);
|
|
119
|
+
let validViewIds = availableViewLookup.map((x) => x.id);
|
|
120
|
+
if (!validViewIds.length) {
|
|
121
|
+
validViewIds = [experience.defaultViewId];
|
|
122
|
+
}
|
|
123
|
+
if (!viewId) {
|
|
124
|
+
viewId = experience.defaultAssociatedViewId;
|
|
125
|
+
}
|
|
126
|
+
if (!validViewIds.includes(viewId)) {
|
|
127
|
+
viewId = validViewIds[0];
|
|
128
|
+
}
|
|
129
|
+
let view = experience.associatedViews.find((v) => v.id === viewId);
|
|
130
|
+
if (!view) {
|
|
131
|
+
throw new Error(`View ${viewId} not found`);
|
|
132
|
+
}
|
|
133
|
+
let viewExperience = view.experience;
|
|
134
|
+
if (typeof viewExperience === 'function') {
|
|
135
|
+
viewExperience = yield viewExperience();
|
|
136
|
+
}
|
|
137
|
+
if (!viewExperience.card) {
|
|
138
|
+
viewExperience.card = getDefaultCardView(this.options.schemaStore.getSchema(logicalName));
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
id: view.id,
|
|
142
|
+
name: view.name,
|
|
143
|
+
logicalName: view.logicalName,
|
|
144
|
+
localizedNames: view.localizedNames,
|
|
145
|
+
experience: viewExperience,
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
getViewLookupV2(logicalName, viewId) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const experience = yield this.getExperience(logicalName);
|
|
152
|
+
if (!viewId) {
|
|
153
|
+
viewId = experience.defaultViewId;
|
|
154
|
+
}
|
|
155
|
+
const view = experience.lookups.find((v) => v.id === viewId);
|
|
156
|
+
if (!view) {
|
|
157
|
+
throw new Error(`Lookup ${viewId} not found`);
|
|
158
|
+
}
|
|
159
|
+
let viewExperience = view.experience;
|
|
160
|
+
if (typeof viewExperience === 'function') {
|
|
161
|
+
viewExperience = yield viewExperience();
|
|
162
|
+
}
|
|
163
|
+
return {
|
|
164
|
+
id: view.id,
|
|
165
|
+
name: view.name,
|
|
166
|
+
logicalName: view.logicalName,
|
|
167
|
+
experience: viewExperience,
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
getDefaultViewId(logicalName) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
const experience = yield this.getExperience(logicalName);
|
|
174
|
+
return experience.defaultViewId;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
getDefaultViewLookupId(logicalName) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const experience = yield this.getExperience(logicalName);
|
|
180
|
+
return experience.defaultLookupId;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
getForm(logicalName, formId) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
const experience = yield this.getExperience(logicalName);
|
|
186
|
+
if (!formId) {
|
|
187
|
+
formId = experience.defaultFormId;
|
|
188
|
+
}
|
|
189
|
+
const form = experience.forms.find((f) => f.id === formId);
|
|
190
|
+
if (!form) {
|
|
191
|
+
throw new Error(`Form ${formId} not found`);
|
|
192
|
+
}
|
|
193
|
+
let formExperience = form.experience;
|
|
194
|
+
if (typeof formExperience === 'function') {
|
|
195
|
+
formExperience = yield formExperience();
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
id: form.id,
|
|
199
|
+
name: form.name,
|
|
200
|
+
logicalName: form.logicalName,
|
|
201
|
+
experience: formExperience,
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
getQuickCreateForm(logicalName, formId) {
|
|
206
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
const experience = yield this.getExperience(logicalName);
|
|
208
|
+
const form = experience.quickCreateForms.find((f) => f.id === formId);
|
|
209
|
+
if (!form) {
|
|
210
|
+
throw new Error(`Quick create form ${formId} not found`);
|
|
211
|
+
}
|
|
212
|
+
let formExperience = form.experience;
|
|
213
|
+
if (typeof formExperience === 'function') {
|
|
214
|
+
formExperience = yield formExperience();
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
id: form.id,
|
|
218
|
+
name: form.name,
|
|
219
|
+
logicalName: form.logicalName,
|
|
220
|
+
experience: formExperience,
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
getViewCommands(logicalName) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
const experience = yield this.getExperience(logicalName);
|
|
227
|
+
return experience.viewCommands;
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
getFormCommands(logicalName) {
|
|
231
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
232
|
+
const experience = yield this.getExperience(logicalName);
|
|
233
|
+
return experience.formCommands;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
getSubgridCommands(logicalName) {
|
|
237
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
238
|
+
const experience = yield this.getExperience(logicalName);
|
|
239
|
+
return experience.subgridCommands;
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
getSchemaMetadataList() {
|
|
243
|
+
const schemas = this.options.schemaStore.getAllSchema();
|
|
244
|
+
return Object.values(schemas).map((schema) => ({
|
|
245
|
+
logicalName: schema.logicalName,
|
|
246
|
+
label: schema.label,
|
|
247
|
+
pluralLabel: schema.pluralLabel,
|
|
248
|
+
description: schema.description,
|
|
249
|
+
localizedDescriptions: schema.localizedDescriptions,
|
|
250
|
+
localizedLabels: schema.localizedLabels,
|
|
251
|
+
localizedPluralLabels: schema.localizedPluralLabels,
|
|
252
|
+
}));
|
|
253
|
+
}
|
|
254
|
+
getExperienceSchemaMetadatList() {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
const schemaMetadatas = this.getSchemaMetadataList();
|
|
257
|
+
return schemaMetadatas.map((schemaMetadata) => {
|
|
258
|
+
var _a;
|
|
259
|
+
return (Object.assign(Object.assign({}, schemaMetadata), { icon: (_a = this.experiences[schemaMetadata.logicalName]) === null || _a === void 0 ? void 0 : _a.icon }));
|
|
260
|
+
});
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
exports.SchemaExperienceStore = SchemaExperienceStore;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ClientAppStore"), exports);
|
|
18
|
+
__exportStar(require("./ComponentStore"), exports);
|
|
19
|
+
__exportStar(require("./EventManager"), exports);
|
|
20
|
+
__exportStar(require("./SchemaExperienceStore"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ToastNotificationProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const context_1 = require("../mutable/context");
|
|
6
|
+
const context_2 = require("./context");
|
|
7
|
+
const ToastNotificationProvider = ({ children }) => {
|
|
8
|
+
const contextState = (0, context_1.useCreateContextStore)({
|
|
9
|
+
items: [],
|
|
10
|
+
});
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(context_2.ToastNotificationContext.Provider, { value: contextState, children: children }));
|
|
12
|
+
};
|
|
13
|
+
exports.ToastNotificationProvider = ToastNotificationProvider;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ToastNotificationItem {
|
|
2
|
+
id: string;
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
text: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
actions?: {
|
|
7
|
+
text: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}[];
|
|
10
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
11
|
+
}
|
|
12
|
+
export interface ToastNotificationContextState {
|
|
13
|
+
items: ToastNotificationItem[];
|
|
14
|
+
}
|
|
15
|
+
export declare const ToastNotificationContext: import("react").Context<import("../mutable/context").ContextValue<ToastNotificationContextState>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useCloseToastNotification"), exports);
|
|
18
|
+
__exportStar(require("./useOpenToastNotification"), exports);
|
|
19
|
+
__exportStar(require("./useToastNotificationItems"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useCloseToastNotification(): (id: string) => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCloseToastNotification = useCloseToastNotification;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_1 = require("../../mutable/context");
|
|
6
|
+
const context_2 = require("../context");
|
|
7
|
+
function useCloseToastNotification() {
|
|
8
|
+
const setValue = (0, context_1.useContextSetValue)(context_2.ToastNotificationContext);
|
|
9
|
+
const closeDialog = (0, react_1.useCallback)((id) => {
|
|
10
|
+
setValue((state) => {
|
|
11
|
+
return {
|
|
12
|
+
items: state.items.map((item) => {
|
|
13
|
+
if (item.id === id) {
|
|
14
|
+
return Object.assign(Object.assign({}, item), { isOpen: false });
|
|
15
|
+
}
|
|
16
|
+
return item;
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
// Simulate a delay to show the dialog closing animation
|
|
21
|
+
setTimeout(() => {
|
|
22
|
+
setValue((state) => {
|
|
23
|
+
return {
|
|
24
|
+
items: state.items.filter((item) => item.id !== id),
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
}, 1000);
|
|
28
|
+
}, [setValue]);
|
|
29
|
+
return closeDialog;
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOpenToastNotification = useOpenToastNotification;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_1 = require("../../mutable/context");
|
|
6
|
+
const context_2 = require("../context");
|
|
7
|
+
const useCloseToastNotification_1 = require("./useCloseToastNotification");
|
|
8
|
+
function randomId() {
|
|
9
|
+
return Math.random().toString(36).substring(2);
|
|
10
|
+
}
|
|
11
|
+
function useOpenToastNotification() {
|
|
12
|
+
const setValue = (0, context_1.useContextSetValue)(context_2.ToastNotificationContext);
|
|
13
|
+
const closeDialog = (0, useCloseToastNotification_1.useCloseToastNotification)();
|
|
14
|
+
const openToastNotification = (0, react_1.useCallback)((options) => {
|
|
15
|
+
const id = randomId();
|
|
16
|
+
setValue((state) => {
|
|
17
|
+
return {
|
|
18
|
+
items: [
|
|
19
|
+
...state.items,
|
|
20
|
+
Object.assign({ id, isOpen: true }, options),
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
return { id, close: () => closeDialog(id) };
|
|
25
|
+
}, [setValue, closeDialog]);
|
|
26
|
+
return openToastNotification;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useToastNotificationItems(): import("../context").ToastNotificationItem[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useToastNotificationItems = useToastNotificationItems;
|
|
4
|
+
const context_1 = require("../../mutable/context");
|
|
5
|
+
const context_2 = require("../context");
|
|
6
|
+
function useToastNotificationItems() {
|
|
7
|
+
return (0, context_1.useContextSelector)(context_2.ToastNotificationContext, (state) => state.items);
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ToastNotificationProvider = exports.ToastNotificationContext = void 0;
|
|
18
|
+
var context_1 = require("./context");
|
|
19
|
+
Object.defineProperty(exports, "ToastNotificationContext", { enumerable: true, get: function () { return context_1.ToastNotificationContext; } });
|
|
20
|
+
var ToastNotificationProvider_1 = require("./ToastNotificationProvider");
|
|
21
|
+
Object.defineProperty(exports, "ToastNotificationProvider", { enumerable: true, get: function () { return ToastNotificationProvider_1.ToastNotificationProvider; } });
|
|
22
|
+
__exportStar(require("./hooks"), exports);
|