@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,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchemaExperienceBuilder = void 0;
|
|
4
|
+
class BaseSchemaExperienceBuilder {
|
|
5
|
+
constructor(logicalName) {
|
|
6
|
+
this.logicalName = logicalName;
|
|
7
|
+
this.views = [];
|
|
8
|
+
this.forms = [];
|
|
9
|
+
this.lookups = [];
|
|
10
|
+
this.quickCreateForms = [];
|
|
11
|
+
this.defaultViewId = null;
|
|
12
|
+
this.defaultFormId = null;
|
|
13
|
+
this.defaultLookupId = null;
|
|
14
|
+
this.defaultQuickCreateFormId = null;
|
|
15
|
+
this.locked = false;
|
|
16
|
+
}
|
|
17
|
+
reset() {
|
|
18
|
+
this.views = [];
|
|
19
|
+
this.forms = [];
|
|
20
|
+
this.lookups = [];
|
|
21
|
+
this.quickCreateForms = [];
|
|
22
|
+
this.defaultViewId = null;
|
|
23
|
+
this.defaultFormId = null;
|
|
24
|
+
this.defaultLookupId = null;
|
|
25
|
+
this.defaultQuickCreateFormId = null;
|
|
26
|
+
this.locked = false;
|
|
27
|
+
return this;
|
|
28
|
+
}
|
|
29
|
+
baseBuild() {
|
|
30
|
+
if (!this.defaultViewId) {
|
|
31
|
+
throw new Error('Default view is required');
|
|
32
|
+
}
|
|
33
|
+
if (!this.defaultFormId) {
|
|
34
|
+
throw new Error('Default form is required');
|
|
35
|
+
}
|
|
36
|
+
if (!this.defaultLookupId) {
|
|
37
|
+
throw new Error('Default lookup is required');
|
|
38
|
+
}
|
|
39
|
+
if (!this.views.find((v) => v.id === this.defaultViewId)) {
|
|
40
|
+
throw new Error('Default view not found');
|
|
41
|
+
}
|
|
42
|
+
if (!this.forms.find((f) => f.id === this.defaultFormId)) {
|
|
43
|
+
throw new Error('Default form not found');
|
|
44
|
+
}
|
|
45
|
+
if (!this.lookups.find((l) => l.id === this.defaultLookupId)) {
|
|
46
|
+
throw new Error('Default lookup not found');
|
|
47
|
+
}
|
|
48
|
+
if (this.defaultQuickCreateFormId &&
|
|
49
|
+
!this.quickCreateForms.find((f) => f.id === this.defaultQuickCreateFormId)) {
|
|
50
|
+
throw new Error('Default quick create form not found');
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
logicalName: this.logicalName,
|
|
54
|
+
defaultFormId: this.defaultFormId,
|
|
55
|
+
defaultViewId: this.defaultViewId,
|
|
56
|
+
views: this.views,
|
|
57
|
+
forms: this.forms,
|
|
58
|
+
defaultLookupId: this.defaultLookupId,
|
|
59
|
+
lookups: this.lookups,
|
|
60
|
+
defaultQuickCreateFormId: this.defaultQuickCreateFormId,
|
|
61
|
+
quickCreateForms: this.quickCreateForms,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
// public createView(view: Omit<View<S>, 'logicalName'>): View<S> {
|
|
65
|
+
// return {
|
|
66
|
+
// logicalName: this.logicalName,
|
|
67
|
+
// ...view,
|
|
68
|
+
// };
|
|
69
|
+
// }
|
|
70
|
+
defineFormExperience(formExperience) {
|
|
71
|
+
return formExperience;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
class SchemaExperienceBuilder extends BaseSchemaExperienceBuilder {
|
|
75
|
+
constructor(schema, defaults, options) {
|
|
76
|
+
super(schema.logicalName);
|
|
77
|
+
this.schema = schema;
|
|
78
|
+
this.defaults = defaults;
|
|
79
|
+
this.options = options;
|
|
80
|
+
}
|
|
81
|
+
defineViewExperience(viewExperience) {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const cardView = (_a = viewExperience.card) !== null && _a !== void 0 ? _a : this.defineDefaultViewCard();
|
|
84
|
+
const gridView = (_b = viewExperience.grid) !== null && _b !== void 0 ? _b : this.defineDefaultViewGrid();
|
|
85
|
+
return Object.assign(Object.assign({}, viewExperience), { grid: gridView, card: cardView });
|
|
86
|
+
}
|
|
87
|
+
defineDefaultViewGrid() {
|
|
88
|
+
const columns = [];
|
|
89
|
+
columns.push({
|
|
90
|
+
name: this.schema.primaryAttribute,
|
|
91
|
+
});
|
|
92
|
+
if (this.schema.createdAtAttribute) {
|
|
93
|
+
columns.push({
|
|
94
|
+
name: this.schema.createdAtAttribute,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (this.schema.updatedAtAttribute) {
|
|
98
|
+
columns.push({
|
|
99
|
+
name: this.schema.updatedAtAttribute,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
columns,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
defineDefaultViewCard() {
|
|
107
|
+
return {
|
|
108
|
+
primaryColumn: this.schema.primaryAttribute,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
defineDefaultViewExperience() {
|
|
112
|
+
let defaultSorting = undefined;
|
|
113
|
+
if (this.schema.updatedAtAttribute) {
|
|
114
|
+
defaultSorting = [
|
|
115
|
+
{
|
|
116
|
+
field: this.schema.updatedAtAttribute,
|
|
117
|
+
order: 'desc',
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
}
|
|
121
|
+
else if (this.schema.createdAtAttribute) {
|
|
122
|
+
defaultSorting = [
|
|
123
|
+
{
|
|
124
|
+
field: this.schema.createdAtAttribute,
|
|
125
|
+
order: 'desc',
|
|
126
|
+
},
|
|
127
|
+
];
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
defaultSorting: defaultSorting,
|
|
131
|
+
grid: this.defineDefaultViewGrid(),
|
|
132
|
+
card: this.defineDefaultViewCard(),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
defineDefaultFormExperience() {
|
|
136
|
+
return {
|
|
137
|
+
headerControls: [],
|
|
138
|
+
tabs: [
|
|
139
|
+
{
|
|
140
|
+
name: 'general',
|
|
141
|
+
label: 'General',
|
|
142
|
+
columnCount: 1,
|
|
143
|
+
tabColumns: [
|
|
144
|
+
{
|
|
145
|
+
sections: [
|
|
146
|
+
{
|
|
147
|
+
name: 'general',
|
|
148
|
+
label: 'General',
|
|
149
|
+
controls: [
|
|
150
|
+
{
|
|
151
|
+
type: 'standard',
|
|
152
|
+
attributeName: this.schema.primaryAttribute,
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
getLocalizedViewNames() {
|
|
164
|
+
var _a;
|
|
165
|
+
const langugesSet = new Set();
|
|
166
|
+
this.schema.localizedPluralLabels &&
|
|
167
|
+
Object.keys(this.schema.localizedPluralLabels).forEach((key) => langugesSet.add(key));
|
|
168
|
+
((_a = this.defaults) === null || _a === void 0 ? void 0 : _a.localizedViewNames) &&
|
|
169
|
+
Object.keys(this.defaults.localizedViewNames).forEach((key) => langugesSet.add(key));
|
|
170
|
+
const localizedLabels = Array.from(langugesSet).reduce((acc, key) => {
|
|
171
|
+
var _a, _b, _c, _d, _e, _f;
|
|
172
|
+
const localizedPluralName = (_c = (_b = (_a = this.schema.localizedPluralLabels) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.toLowerCase()) !== null && _c !== void 0 ? _c : this.schema.pluralLabel.toLowerCase();
|
|
173
|
+
const localizedPlaceholder = (_f = (_e = (_d = this.defaults) === null || _d === void 0 ? void 0 : _d.localizedViewNames) === null || _e === void 0 ? void 0 : _e[key]) !== null && _f !== void 0 ? _f : `All {label}`;
|
|
174
|
+
const localeName = localizedPlaceholder.replace('{label}', localizedPluralName);
|
|
175
|
+
acc[key] = localeName;
|
|
176
|
+
return acc;
|
|
177
|
+
}, {});
|
|
178
|
+
return localizedLabels;
|
|
179
|
+
}
|
|
180
|
+
resolveDefaultId(data, defaultId) {
|
|
181
|
+
if (data.length === 0) {
|
|
182
|
+
throw new Error('No items found');
|
|
183
|
+
}
|
|
184
|
+
if (!defaultId) {
|
|
185
|
+
return data[0].id;
|
|
186
|
+
}
|
|
187
|
+
if (!data.find((x) => x.id === defaultId)) {
|
|
188
|
+
return data[0].id;
|
|
189
|
+
}
|
|
190
|
+
return defaultId;
|
|
191
|
+
}
|
|
192
|
+
defineExperience(experience) {
|
|
193
|
+
// if (!experience.defaultFormId) {
|
|
194
|
+
// throw new Error('Default form is required');
|
|
195
|
+
// }
|
|
196
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
197
|
+
// console.log('experience', experience);
|
|
198
|
+
let lookups = experience.lookups;
|
|
199
|
+
let views = experience.views;
|
|
200
|
+
let forms = experience.forms;
|
|
201
|
+
let associatedViews = experience.associatedViews;
|
|
202
|
+
if (!(lookups === null || lookups === void 0 ? void 0 : lookups.length)) {
|
|
203
|
+
lookups = [
|
|
204
|
+
{
|
|
205
|
+
id: 'default',
|
|
206
|
+
name: 'Default',
|
|
207
|
+
experience: this.defineViewExperience({}),
|
|
208
|
+
},
|
|
209
|
+
];
|
|
210
|
+
}
|
|
211
|
+
if (!(views === null || views === void 0 ? void 0 : views.length)) {
|
|
212
|
+
views = [
|
|
213
|
+
{
|
|
214
|
+
id: 'default',
|
|
215
|
+
name: `All ${this.schema.pluralLabel.toLowerCase()}`,
|
|
216
|
+
experience: this.defineDefaultViewExperience(),
|
|
217
|
+
localizedNames: this.getLocalizedViewNames(),
|
|
218
|
+
},
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
if (!(associatedViews === null || associatedViews === void 0 ? void 0 : associatedViews.length)) {
|
|
222
|
+
associatedViews = [
|
|
223
|
+
{
|
|
224
|
+
id: 'default',
|
|
225
|
+
name: `All ${this.schema.pluralLabel.toLowerCase()}`,
|
|
226
|
+
experience: this.defineDefaultViewExperience(),
|
|
227
|
+
localizedNames: this.getLocalizedViewNames(),
|
|
228
|
+
},
|
|
229
|
+
];
|
|
230
|
+
}
|
|
231
|
+
if (!(forms === null || forms === void 0 ? void 0 : forms.length)) {
|
|
232
|
+
forms = [
|
|
233
|
+
{
|
|
234
|
+
id: 'default',
|
|
235
|
+
name: 'Default',
|
|
236
|
+
experience: this.defineDefaultFormExperience(),
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
}
|
|
240
|
+
const defaultViewId = this.resolveDefaultId(views, experience.defaultViewId);
|
|
241
|
+
const defaultFormId = this.resolveDefaultId(forms, experience.defaultFormId);
|
|
242
|
+
const defaultLookupId = this.resolveDefaultId(lookups, experience.defaultLookupId);
|
|
243
|
+
const defaultAssociatedViewId = this.resolveDefaultId(associatedViews, experience.defaultAssociatedViewId);
|
|
244
|
+
let defaultQuickCreateFormId = null;
|
|
245
|
+
if ((_a = experience.quickCreateForms) === null || _a === void 0 ? void 0 : _a.length) {
|
|
246
|
+
defaultQuickCreateFormId = this.resolveDefaultId((_b = experience.quickCreateForms) !== null && _b !== void 0 ? _b : [], experience.defaultQuickCreateFormId);
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
logicalName: this.logicalName,
|
|
250
|
+
icon: experience.icon,
|
|
251
|
+
defaultQuickCreateFormId: defaultQuickCreateFormId,
|
|
252
|
+
defaultFormId,
|
|
253
|
+
defaultViewId,
|
|
254
|
+
defaultLookupId,
|
|
255
|
+
defaultAssociatedViewId,
|
|
256
|
+
quickCreateForms: (_d = (_c = experience.quickCreateForms) === null || _c === void 0 ? void 0 : _c.map((x) => (Object.assign(Object.assign({}, x), { logicalName: this.logicalName })))) !== null && _d !== void 0 ? _d : [],
|
|
257
|
+
views: (_e = views.map((x) => (Object.assign(Object.assign({}, x), { logicalName: this.logicalName })))) !== null && _e !== void 0 ? _e : [],
|
|
258
|
+
forms: (_f = forms.map((x) => (Object.assign(Object.assign({}, x), { logicalName: this.logicalName })))) !== null && _f !== void 0 ? _f : [],
|
|
259
|
+
lookups: (_g = lookups.map((x) => (Object.assign(Object.assign({}, x), { logicalName: this.logicalName })))) !== null && _g !== void 0 ? _g : [],
|
|
260
|
+
associatedViews: (_h = associatedViews.map((x) => (Object.assign(Object.assign({}, x), { logicalName: this.logicalName })))) !== null && _h !== void 0 ? _h : [],
|
|
261
|
+
formCommands: (_l = (_j = experience.formCommands) !== null && _j !== void 0 ? _j : (_k = this.defaults) === null || _k === void 0 ? void 0 : _k.formCommands) !== null && _l !== void 0 ? _l : [],
|
|
262
|
+
subgridCommands: (_p = (_m = experience.subgridCommands) !== null && _m !== void 0 ? _m : (_o = this.defaults) === null || _o === void 0 ? void 0 : _o.subgridCommands) !== null && _p !== void 0 ? _p : [],
|
|
263
|
+
viewCommands: (_s = (_q = experience.viewCommands) !== null && _q !== void 0 ? _q : (_r = this.defaults) === null || _r === void 0 ? void 0 : _r.viewCommands) !== null && _s !== void 0 ? _s : [],
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
exports.SchemaExperienceBuilder = SchemaExperienceBuilder;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommandBuilder = exports.SchemaExperienceBuilder = void 0;
|
|
4
|
+
var SchemaExperienceBuilder_1 = require("./SchemaExperienceBuilder");
|
|
5
|
+
Object.defineProperty(exports, "SchemaExperienceBuilder", { enumerable: true, get: function () { return SchemaExperienceBuilder_1.SchemaExperienceBuilder; } });
|
|
6
|
+
var CommandBuilder_1 = require("./CommandBuilder");
|
|
7
|
+
Object.defineProperty(exports, "CommandBuilder", { enumerable: true, get: function () { return CommandBuilder_1.CommandBuilder; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./useBaseCommandHandlerContext"), exports);
|
|
18
|
+
__exportStar(require("./useCommands"), exports);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useUtility = useUtility;
|
|
4
|
+
exports.useBaseCommandHandlerContext = useBaseCommandHandlerContext;
|
|
5
|
+
const react_query_1 = require("@tanstack/react-query");
|
|
6
|
+
const hooks_1 = require("../../dialog/hooks");
|
|
7
|
+
const locale_1 = require("../../locale");
|
|
8
|
+
const hooks_2 = require("../../metadata/hooks");
|
|
9
|
+
const hooks_3 = require("../../progress-indicator/hooks");
|
|
10
|
+
const useOpenToastNotification_1 = require("../../toast-notification/hooks/useOpenToastNotification");
|
|
11
|
+
const transport_1 = require("../../transport");
|
|
12
|
+
function useUtility() {
|
|
13
|
+
const { hideProgressIndicator, showProgressIndicator } = (0, hooks_3.useProgressIndicator)();
|
|
14
|
+
const openAlertDialog = (0, hooks_1.useOpenAlertDialog)();
|
|
15
|
+
const openConfirmDialog = (0, hooks_1.useOpenConfirmDialog)();
|
|
16
|
+
const openErrorDialog = (0, hooks_1.useOpenErrorDialog)();
|
|
17
|
+
const openPromptDialog = (0, hooks_1.useOpenPromptDialog)();
|
|
18
|
+
const openToastNotification = (0, useOpenToastNotification_1.useOpenToastNotification)();
|
|
19
|
+
return {
|
|
20
|
+
hideProgressIndicator,
|
|
21
|
+
showProgressIndicator,
|
|
22
|
+
openAlertDialog,
|
|
23
|
+
openConfirmDialog,
|
|
24
|
+
openErrorDialog,
|
|
25
|
+
openPromptDialog,
|
|
26
|
+
showNotification: openToastNotification,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function useBaseCommandHandlerContext() {
|
|
30
|
+
const dataService = (0, transport_1.useDataService)();
|
|
31
|
+
const queryClient = (0, react_query_1.useQueryClient)();
|
|
32
|
+
const stores = (0, hooks_2.useMetadata)();
|
|
33
|
+
const utility = useUtility();
|
|
34
|
+
const [locale] = (0, locale_1.useLocale)();
|
|
35
|
+
return {
|
|
36
|
+
dataService,
|
|
37
|
+
queryClient,
|
|
38
|
+
utility,
|
|
39
|
+
stores,
|
|
40
|
+
locale,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
|
|
2
|
+
import { CommandItemExperienceSelector, CommandItemState } from '../types';
|
|
3
|
+
/***
|
|
4
|
+
* @description Transforms the command configuration into a format that can be used by the CommandBar component
|
|
5
|
+
* and apply the necessary conditions to the commands (disabled, hidden, etc.)
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCommands<HandlerContext>(commands: CommandItemExperience<HandlerContext>[][], handlerContext: HandlerContext, selector?: CommandItemExperienceSelector<HandlerContext>): CommandItemState[][];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCommands = useCommands;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
/***
|
|
7
|
+
* @description Transforms the command configuration into a format that can be used by the CommandBar component
|
|
8
|
+
* and apply the necessary conditions to the commands (disabled, hidden, etc.)
|
|
9
|
+
*/
|
|
10
|
+
function useCommands(commands, handlerContext, selector) {
|
|
11
|
+
const selectorRef = (0, react_1.useRef)(selector);
|
|
12
|
+
selectorRef.current = selector;
|
|
13
|
+
return (0, react_1.useMemo)(() => {
|
|
14
|
+
return (0, utils_1.transformCommadnGroups)(commands, handlerContext, selectorRef.current);
|
|
15
|
+
}, [commands, handlerContext]);
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./types"), exports);
|
|
18
|
+
__exportStar(require("./hooks"), exports);
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
|
|
2
|
+
import { ConfirmDialogOptions, PromptDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
3
|
+
import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
4
|
+
import { ArrayGroupWithAtLeastOne, Localized } from '@headless-adminapp/core/types';
|
|
5
|
+
import { Icon } from '@headless-adminapp/icons';
|
|
6
|
+
interface ConfirmResult {
|
|
7
|
+
confirmed: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UtilityContextState {
|
|
10
|
+
showProgressIndicator: (message?: string) => void;
|
|
11
|
+
hideProgressIndicator: () => void;
|
|
12
|
+
openAlertDialog(options: {
|
|
13
|
+
text: string;
|
|
14
|
+
title?: string;
|
|
15
|
+
confirmButtonLabel?: string;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
openConfirmDialog(options: Omit<ConfirmDialogOptions, 'type' | 'onConfirm' | 'onDismiss' | 'onCancel'>): Promise<ConfirmResult | null>;
|
|
18
|
+
openErrorDialog(options: {
|
|
19
|
+
text: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
confirmButtonLabel?: string;
|
|
22
|
+
}): void;
|
|
23
|
+
openPromptDialog: <SA extends SchemaAttributes = SchemaAttributes>(options: Omit<PromptDialogOptions<SA>, 'type' | 'onConfirm' | 'onClose' | 'onCancel'>) => Promise<InferredSchemaType<SA> | null>;
|
|
24
|
+
showNotification: (options: {
|
|
25
|
+
text: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
actions?: {
|
|
28
|
+
text: string;
|
|
29
|
+
onClick: () => void;
|
|
30
|
+
}[];
|
|
31
|
+
type?: 'info' | 'success' | 'warning' | 'error';
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
interface BaseCommandState {
|
|
35
|
+
Icon: Icon;
|
|
36
|
+
iconPosition?: 'before' | 'after';
|
|
37
|
+
danger?: boolean;
|
|
38
|
+
hidden?: boolean;
|
|
39
|
+
}
|
|
40
|
+
interface ActionableCommandState {
|
|
41
|
+
onClick?: () => void;
|
|
42
|
+
disabled?: boolean;
|
|
43
|
+
hidden?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface IconButtonCommandState extends BaseCommandState, ActionableCommandState {
|
|
46
|
+
type: 'icon';
|
|
47
|
+
isQuickAction?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface ButtonCommandState extends BaseCommandState, ActionableCommandState {
|
|
50
|
+
type: 'button';
|
|
51
|
+
text: string;
|
|
52
|
+
isQuickAction?: boolean;
|
|
53
|
+
isContextMenu?: boolean;
|
|
54
|
+
localizedTexts?: Localized<string>;
|
|
55
|
+
}
|
|
56
|
+
export interface LabelCommandState extends BaseCommandState {
|
|
57
|
+
type: 'label';
|
|
58
|
+
text: string;
|
|
59
|
+
localizedTexts?: Localized<string>;
|
|
60
|
+
}
|
|
61
|
+
export interface MenuItemCommandState extends BaseCommandState, ActionableCommandState {
|
|
62
|
+
text: string;
|
|
63
|
+
localizedTexts?: Localized<string>;
|
|
64
|
+
items?: ArrayGroupWithAtLeastOne<MenuItemCommandState>;
|
|
65
|
+
}
|
|
66
|
+
export interface MenuComandState extends BaseCommandState, ActionableCommandState {
|
|
67
|
+
type: 'menu';
|
|
68
|
+
text: string;
|
|
69
|
+
localizedTexts?: Localized<string>;
|
|
70
|
+
isContextMenu?: boolean;
|
|
71
|
+
items: ArrayGroupWithAtLeastOne<MenuItemCommandState>;
|
|
72
|
+
}
|
|
73
|
+
export type CommandItemState = IconButtonCommandState | ButtonCommandState | MenuComandState | LabelCommandState;
|
|
74
|
+
export type Selector<T> = (value: T) => boolean;
|
|
75
|
+
export type CommandItemExperienceSelector<Context> = Selector<CommandItemExperience<Context>>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
|
|
2
|
+
import { CommandItemExperienceSelector, CommandItemState } from '../types';
|
|
3
|
+
export declare function transformCommadnGroups<HandlerContext>(groups: CommandItemExperience<HandlerContext>[][], handlerContext: HandlerContext, selector?: CommandItemExperienceSelector<HandlerContext>): CommandItemState[][];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformCommadnGroups = transformCommadnGroups;
|
|
4
|
+
const utils_1 = require("@headless-adminapp/core/experience/command/utils");
|
|
5
|
+
function transformedProperties(command, handlerContext) {
|
|
6
|
+
const IconComponent = command.Icon;
|
|
7
|
+
const hidden = (0, utils_1.checkCommandCondition)(handlerContext, command.hidden);
|
|
8
|
+
const disabled = (0, utils_1.checkCommandCondition)(handlerContext, command.disabled);
|
|
9
|
+
const onClick = command.onClick
|
|
10
|
+
? () => {
|
|
11
|
+
var _a;
|
|
12
|
+
(_a = command.onClick(handlerContext)) === null || _a === void 0 ? void 0 : _a.catch(console.error);
|
|
13
|
+
}
|
|
14
|
+
: undefined;
|
|
15
|
+
return {
|
|
16
|
+
Icon: IconComponent,
|
|
17
|
+
hidden,
|
|
18
|
+
disabled,
|
|
19
|
+
onClick,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function transformCommand(command, handlerContext) {
|
|
23
|
+
const commandType = command.type;
|
|
24
|
+
switch (command.type) {
|
|
25
|
+
case 'icon':
|
|
26
|
+
return Object.assign({ type: command.type, isQuickAction: command.isQuickAction, danger: command.danger, iconPosition: command.iconPosition }, transformedProperties(command, handlerContext));
|
|
27
|
+
case 'button':
|
|
28
|
+
return Object.assign({ type: command.type, isQuickAction: command.isQuickAction, text: command.text, danger: command.danger, iconPosition: command.iconPosition, localizedTexts: command.localizedText }, transformedProperties(command, handlerContext));
|
|
29
|
+
case 'menu':
|
|
30
|
+
return Object.assign(Object.assign({ type: command.type, text: command.text, danger: command.danger, localizedTexts: command.localizedTexts, iconPosition: command.iconPosition }, transformedProperties(command, handlerContext)), { items: command.items.map((item) => transformMenuItems(item, handlerContext)) });
|
|
31
|
+
default:
|
|
32
|
+
throw new Error(`Unknown command type: ${commandType}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function transformMenuItems(items, handlerContext) {
|
|
36
|
+
return items.map((item) => transformMenuItem(item, handlerContext));
|
|
37
|
+
}
|
|
38
|
+
function transformMenuItem(item, handlerContext) {
|
|
39
|
+
var _a;
|
|
40
|
+
return Object.assign(Object.assign({ danger: item.danger, text: item.text, localizedTexts: item.localizedTexts }, transformedProperties(item, handlerContext)), { items: (_a = item.items) === null || _a === void 0 ? void 0 : _a.map((item) => transformMenuItems(item, handlerContext)) });
|
|
41
|
+
}
|
|
42
|
+
function transformCommandGroup(group, handlerContext, selector) {
|
|
43
|
+
return group
|
|
44
|
+
.map((command) => {
|
|
45
|
+
var _a;
|
|
46
|
+
if (!((_a = selector === null || selector === void 0 ? void 0 : selector(command)) !== null && _a !== void 0 ? _a : true)) {
|
|
47
|
+
return false; // Skip command
|
|
48
|
+
}
|
|
49
|
+
const transformedCommand = transformCommand(command, handlerContext);
|
|
50
|
+
if (transformedCommand.hidden) {
|
|
51
|
+
return false; // Skip command
|
|
52
|
+
}
|
|
53
|
+
return transformedCommand;
|
|
54
|
+
})
|
|
55
|
+
.filter(Boolean);
|
|
56
|
+
}
|
|
57
|
+
function transformCommadnGroups(groups, handlerContext, selector) {
|
|
58
|
+
return groups
|
|
59
|
+
.map((group) => {
|
|
60
|
+
return transformCommandGroup(group, handlerContext, selector);
|
|
61
|
+
})
|
|
62
|
+
.filter((group) => group.length > 0);
|
|
63
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { ScrollbarProps } from 'react-custom-scrollbars-2';
|
|
3
|
+
interface ScrollViewProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
autoHide?: boolean;
|
|
6
|
+
rtl?: boolean;
|
|
7
|
+
onScroll?: ScrollbarProps['onScroll'];
|
|
8
|
+
}
|
|
9
|
+
export declare const ScrollView: FC<PropsWithChildren<ScrollViewProps>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ScrollView = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const clsx_1 = __importDefault(require("clsx"));
|
|
9
|
+
const react_custom_scrollbars_2_1 = __importDefault(require("react-custom-scrollbars-2"));
|
|
10
|
+
const ScrollView = ({ children, className, rtl, autoHide, onScroll, }) => ((0, jsx_runtime_1.jsx)(react_custom_scrollbars_2_1.default, { autoHide: autoHide, className: (0, clsx_1.default)(className, 'hdl-scrollbar', rtl && 'rtl'), onScroll: onScroll, children: children }));
|
|
11
|
+
exports.ScrollView = ScrollView;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Form } from '@headless-adminapp/core/experience/form';
|
|
2
|
+
import { SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
|
+
export declare function getControls(form: Form): (import("@headless-adminapp/core/experience/form/SectionControl").SectionSubgridControl | import("@headless-adminapp/core/experience/form/SectionControl").SectionQuickViewControl<SchemaAttributes> | import("@headless-adminapp/core/experience/form").SectionEditableGridControl<SchemaAttributes> | import("@headless-adminapp/core/experience/form/SectionControl").SectionSpacerControl | import("@headless-adminapp/core/experience/form/SectionControl").SectionStatndardControl<SchemaAttributes>)[];
|
|
4
|
+
export declare function getColumns(form: Form): string[];
|
|
5
|
+
export declare function DataResolver(): null;
|