@headless-adminapp/app 0.0.12-alpha.0 → 0.0.14-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -16
- package/src/app/context.ts +0 -11
- package/src/app/hooks/index.ts +0 -1
- package/src/app/hooks/useAppContext.ts +0 -13
- package/src/app/index.ts +0 -2
- package/src/appearance/context.ts +0 -13
- package/src/appearance/hooks/index.ts +0 -1
- package/src/appearance/hooks/useAppearanceContext.ts +0 -13
- package/src/appearance/index.ts +0 -6
- package/src/auth/AuthProvider.tsx +0 -118
- package/src/auth/context.ts +0 -41
- package/src/auth/hooks/index.ts +0 -2
- package/src/auth/hooks/useAuthSession.ts +0 -17
- package/src/auth/hooks/useLogout.ts +0 -23
- package/src/auth/index.ts +0 -4
- package/src/auth/types.ts +0 -17
- package/src/builders/CommandBuilder.ts +0 -777
- package/src/builders/SchemaExperienceBuilder.ts +0 -488
- package/src/builders/index.ts +0 -5
- package/src/command/hooks/index.ts +0 -2
- package/src/command/hooks/useBaseCommandHandlerContext.ts +0 -51
- package/src/command/hooks/useCommands.ts +0 -26
- package/src/command/index.ts +0 -2
- package/src/command/types.ts +0 -116
- package/src/command/utils/index.ts +0 -142
- package/src/components/ScrollView/index.tsx +0 -26
- package/src/dataform/DataFormProvider/DataResolver.tsx +0 -186
- package/src/dataform/DataFormProvider/InitialValueResolver.tsx +0 -55
- package/src/dataform/DataFormProvider/ReadonlyInfoResolver.tsx +0 -35
- package/src/dataform/DataFormProvider/index.tsx +0 -102
- package/src/dataform/context.ts +0 -53
- package/src/dataform/hooks/index.ts +0 -12
- package/src/dataform/hooks/useFormInstance.ts +0 -6
- package/src/dataform/hooks/useFormIsDirty.ts +0 -7
- package/src/dataform/hooks/useFormIsReadonly.ts +0 -11
- package/src/dataform/hooks/useFormNotifications.ts +0 -46
- package/src/dataform/hooks/useFormRecord.ts +0 -7
- package/src/dataform/hooks/useFormSave.ts +0 -147
- package/src/dataform/hooks/useFormSchema.ts +0 -13
- package/src/dataform/hooks/useLoadFormGridPage.ts +0 -97
- package/src/dataform/hooks/useMainFormCommands.ts +0 -65
- package/src/dataform/hooks/useRecordId.ts +0 -6
- package/src/dataform/hooks/useRecordTitle.ts +0 -22
- package/src/dataform/hooks/useSelectedForm.ts +0 -14
- package/src/dataform/index.ts +0 -4
- package/src/dataform/utils/index.ts +0 -594
- package/src/datagrid/DataGridProvider/DataResolver.tsx +0 -281
- package/src/datagrid/DataGridProvider/index.tsx +0 -134
- package/src/datagrid/DataGridProvider/transformViewColumns.ts +0 -54
- package/src/datagrid/DataGridProvider/utils.ts +0 -89
- package/src/datagrid/column-filter/constants.ts +0 -493
- package/src/datagrid/column-filter/index.ts +0 -3
- package/src/datagrid/column-filter/types.ts +0 -68
- package/src/datagrid/column-filter/utils.ts +0 -19
- package/src/datagrid/context.ts +0 -66
- package/src/datagrid/hooks/index.ts +0 -20
- package/src/datagrid/hooks/useChangeView.ts +0 -18
- package/src/datagrid/hooks/useGridColumnFilter.ts +0 -28
- package/src/datagrid/hooks/useGridColumns.ts +0 -13
- package/src/datagrid/hooks/useGridCommands.ts +0 -21
- package/src/datagrid/hooks/useGridData.ts +0 -8
- package/src/datagrid/hooks/useGridDataState.ts +0 -8
- package/src/datagrid/hooks/useGridExtraFilter.ts +0 -6
- package/src/datagrid/hooks/useGridOptions.ts +0 -3
- package/src/datagrid/hooks/useGridPagination.ts +0 -3
- package/src/datagrid/hooks/useGridRefresh.ts +0 -19
- package/src/datagrid/hooks/useGridSchema.ts +0 -13
- package/src/datagrid/hooks/useGridSelection.ts +0 -28
- package/src/datagrid/hooks/useGridSorting.ts +0 -23
- package/src/datagrid/hooks/useGridViewLookupData.ts +0 -10
- package/src/datagrid/hooks/useLoadMainGridPage.ts +0 -90
- package/src/datagrid/hooks/useMainGridCommands.ts +0 -255
- package/src/datagrid/hooks/useMaxRecords.ts +0 -6
- package/src/datagrid/hooks/useSearchText.ts +0 -22
- package/src/datagrid/hooks/useSelectedView.ts +0 -14
- package/src/datagrid/hooks/useSubGridCommands.ts +0 -104
- package/src/datagrid/index.ts +0 -14
- package/src/dialog/DialogProvider.tsx +0 -20
- package/src/dialog/context.ts +0 -14
- package/src/dialog/hooks/index.ts +0 -8
- package/src/dialog/hooks/useCloseDialog.ts +0 -36
- package/src/dialog/hooks/useDialogItem.ts +0 -8
- package/src/dialog/hooks/useDialogItems.ts +0 -6
- package/src/dialog/hooks/useOpenAlertDialog.ts +0 -30
- package/src/dialog/hooks/useOpenConfirmDialog.ts +0 -45
- package/src/dialog/hooks/useOpenDialog.ts +0 -39
- package/src/dialog/hooks/useOpenErrorDialog.ts +0 -26
- package/src/dialog/hooks/useOpenPromptDialog.ts +0 -46
- package/src/dialog/index.ts +0 -7
- package/src/form/FormValidationStringContext.ts +0 -30
- package/src/form/index.ts +0 -6
- package/src/hooks/index.ts +0 -5
- package/src/hooks/useDebouncedValue.ts +0 -38
- package/src/hooks/useElementLayout.ts +0 -49
- package/src/hooks/useIsMobile.ts +0 -21
- package/src/hooks/useStorageState.ts +0 -36
- package/src/hooks/useSystemColorScheme.ts +0 -38
- package/src/index.css +0 -4
- package/src/insights/context.ts +0 -5
- package/src/insights/hooks/index.ts +0 -14
- package/src/insights/index.ts +0 -2
- package/src/locale/context.ts +0 -7
- package/src/locale/index.ts +0 -3
- package/src/locale/types.ts +0 -3
- package/src/locale/useLocale.ts +0 -13
- package/src/metadata/MetadataProvider.tsx +0 -51
- package/src/metadata/context.ts +0 -15
- package/src/metadata/hooks/index.ts +0 -8
- package/src/metadata/hooks/useAppStore.ts +0 -6
- package/src/metadata/hooks/useExperienceStore.ts +0 -6
- package/src/metadata/hooks/useExperienceView.ts +0 -36
- package/src/metadata/hooks/useExperienceViewCommands.ts +0 -20
- package/src/metadata/hooks/useExperienceViewLookup.ts +0 -33
- package/src/metadata/hooks/useExperienceViewSubgridCommands.ts +0 -20
- package/src/metadata/hooks/useMetadata.ts +0 -44
- package/src/metadata/hooks/useSchema.ts +0 -11
- package/src/metadata/index.ts +0 -3
- package/src/mutable/context.ts +0 -71
- package/src/mutable/index.ts +0 -14
- package/src/mutable/state.ts +0 -13
- package/src/mutable/type.ts +0 -9
- package/src/mutable/utils.ts +0 -80
- package/src/navigation/hooks/useOpenForm.ts +0 -34
- package/src/progress-indicator/ProgressIndicatorProvider.tsx +0 -77
- package/src/progress-indicator/context.ts +0 -12
- package/src/progress-indicator/hooks/index.ts +0 -1
- package/src/progress-indicator/hooks/useProgressIndicator.ts +0 -15
- package/src/progress-indicator/index.ts +0 -6
- package/src/providers/PageEntityFormProvider/index.tsx +0 -34
- package/src/providers/PageEntityViewProvider/index.tsx +0 -39
- package/src/recordset/RecordSetProvider.tsx +0 -55
- package/src/recordset/context.ts +0 -12
- package/src/recordset/hooks/index.ts +0 -3
- package/src/recordset/hooks/useRecordSetResult.ts +0 -94
- package/src/recordset/hooks/useRecordSetSetter.ts +0 -21
- package/src/recordset/hooks/useRecordSetVisibility.ts +0 -24
- package/src/recordset/index.ts +0 -3
- package/src/route/RouteProvider.tsx +0 -76
- package/src/route/context.ts +0 -39
- package/src/route/hooks/index.ts +0 -5
- package/src/route/hooks/useBasePath.ts +0 -7
- package/src/route/hooks/usePathname.ts +0 -7
- package/src/route/hooks/useRouteResolver.ts +0 -7
- package/src/route/hooks/useRouter.ts +0 -7
- package/src/route/hooks/useSearchParams.ts +0 -7
- package/src/route/index.ts +0 -2
- package/src/route/types.ts +0 -1
- package/src/store/ClientAppStore.ts +0 -20
- package/src/store/ComponentStore.tsx +0 -22
- package/src/store/EventManager.ts +0 -33
- package/src/store/SchemaExperienceStore.ts +0 -374
- package/src/store/index.ts +0 -4
- package/src/toast-notification/ToastNotificationProvider.tsx +0 -23
- package/src/toast-notification/context.ts +0 -17
- package/src/toast-notification/hooks/index.ts +0 -3
- package/src/toast-notification/hooks/useCloseToastNotification.ts +0 -36
- package/src/toast-notification/hooks/useOpenToastNotification.ts +0 -38
- package/src/toast-notification/hooks/useToastNotificationItems.ts +0 -6
- package/src/toast-notification/index.ts +0 -7
- package/src/transport/InMemoryDataService/index.ts +0 -157
- package/src/transport/RestDataService/index.ts +0 -151
- package/src/transport/context.ts +0 -6
- package/src/transport/hooks/index.ts +0 -1
- package/src/transport/hooks/useDataService.ts +0 -13
- package/src/transport/index.ts +0 -2
- package/src/utils/calculateColumnWidths.ts +0 -72
- package/src/utils/index.ts +0 -1
- package/src/widget/context.ts +0 -5
- package/src/widget/hooks/index.ts +0 -11
- package/src/widget/index.ts +0 -1
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
- /package/{dist/app → app}/context.d.ts +0 -0
- /package/{dist/app → app}/context.js +0 -0
- /package/{dist/app → app}/hooks/index.d.ts +0 -0
- /package/{dist/app → app}/hooks/index.js +0 -0
- /package/{dist/app → app}/hooks/useAppContext.d.ts +0 -0
- /package/{dist/app → app}/hooks/useAppContext.js +0 -0
- /package/{dist/app → app}/index.d.ts +0 -0
- /package/{dist/app → app}/index.js +0 -0
- /package/{dist/appearance → appearance}/context.d.ts +0 -0
- /package/{dist/appearance → appearance}/context.js +0 -0
- /package/{dist/appearance → appearance}/hooks/index.d.ts +0 -0
- /package/{dist/appearance → appearance}/hooks/index.js +0 -0
- /package/{dist/appearance → appearance}/hooks/useAppearanceContext.d.ts +0 -0
- /package/{dist/appearance → appearance}/hooks/useAppearanceContext.js +0 -0
- /package/{dist/appearance → appearance}/index.d.ts +0 -0
- /package/{dist/appearance → appearance}/index.js +0 -0
- /package/{dist/auth → auth}/AuthProvider.d.ts +0 -0
- /package/{dist/auth → auth}/AuthProvider.js +0 -0
- /package/{dist/auth → auth}/context.d.ts +0 -0
- /package/{dist/auth → auth}/context.js +0 -0
- /package/{dist/auth → auth}/hooks/index.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/index.js +0 -0
- /package/{dist/auth → auth}/hooks/useAuthSession.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/useAuthSession.js +0 -0
- /package/{dist/auth → auth}/hooks/useLogout.d.ts +0 -0
- /package/{dist/auth → auth}/hooks/useLogout.js +0 -0
- /package/{dist/auth → auth}/index.d.ts +0 -0
- /package/{dist/auth → auth}/index.js +0 -0
- /package/{dist/auth → auth}/types.d.ts +0 -0
- /package/{dist/auth → auth}/types.js +0 -0
- /package/{dist/builders → builders}/CommandBuilder.d.ts +0 -0
- /package/{dist/builders → builders}/CommandBuilder.js +0 -0
- /package/{dist/builders → builders}/SchemaExperienceBuilder.d.ts +0 -0
- /package/{dist/builders → builders}/SchemaExperienceBuilder.js +0 -0
- /package/{dist/builders → builders}/index.d.ts +0 -0
- /package/{dist/builders → builders}/index.js +0 -0
- /package/{dist/command → command}/hooks/index.d.ts +0 -0
- /package/{dist/command → command}/hooks/index.js +0 -0
- /package/{dist/command → command}/hooks/useBaseCommandHandlerContext.d.ts +0 -0
- /package/{dist/command → command}/hooks/useBaseCommandHandlerContext.js +0 -0
- /package/{dist/command → command}/hooks/useCommands.d.ts +0 -0
- /package/{dist/command → command}/hooks/useCommands.js +0 -0
- /package/{dist/command → command}/index.d.ts +0 -0
- /package/{dist/command → command}/index.js +0 -0
- /package/{dist/command → command}/types.d.ts +0 -0
- /package/{dist/command → command}/types.js +0 -0
- /package/{dist/command → command}/utils/index.d.ts +0 -0
- /package/{dist/command → command}/utils/index.js +0 -0
- /package/{dist/components → components}/ScrollView/index.d.ts +0 -0
- /package/{dist/components → components}/ScrollView/index.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/DataResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/DataResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/InitialValueResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/InitialValueResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/ReadonlyInfoResolver.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/ReadonlyInfoResolver.js +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/DataFormProvider/index.js +0 -0
- /package/{dist/dataform → dataform}/context.d.ts +0 -0
- /package/{dist/dataform → dataform}/context.js +0 -0
- /package/{dist/dataform → dataform}/hooks/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/index.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormInstance.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormInstance.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsDirty.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsDirty.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsReadonly.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormIsReadonly.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormNotifications.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormNotifications.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormRecord.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormRecord.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSave.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSave.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSchema.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useFormSchema.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useLoadFormGridPage.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useLoadFormGridPage.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useMainFormCommands.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useMainFormCommands.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordId.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordId.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordTitle.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useRecordTitle.js +0 -0
- /package/{dist/dataform → dataform}/hooks/useSelectedForm.d.ts +0 -0
- /package/{dist/dataform → dataform}/hooks/useSelectedForm.js +0 -0
- /package/{dist/dataform → dataform}/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/index.js +0 -0
- /package/{dist/dataform → dataform}/utils/index.d.ts +0 -0
- /package/{dist/dataform → dataform}/utils/index.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/DataResolver.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/DataResolver.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/index.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/transformViewColumns.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/transformViewColumns.js +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/utils.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/DataGridProvider/utils.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/constants.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/constants.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/index.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/types.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/types.js +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/utils.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/column-filter/utils.js +0 -0
- /package/{dist/datagrid → datagrid}/context.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/context.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/index.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useChangeView.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useChangeView.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumnFilter.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumnFilter.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumns.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridColumns.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridData.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridData.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridDataState.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridDataState.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridExtraFilter.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridExtraFilter.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridOptions.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridOptions.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridPagination.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridPagination.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridRefresh.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridRefresh.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSchema.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSchema.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSelection.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSelection.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSorting.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridSorting.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridViewLookupData.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useGridViewLookupData.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useLoadMainGridPage.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useLoadMainGridPage.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMainGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMainGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMaxRecords.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useMaxRecords.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSearchText.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSearchText.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSelectedView.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSelectedView.js +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSubGridCommands.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/hooks/useSubGridCommands.js +0 -0
- /package/{dist/datagrid → datagrid}/index.d.ts +0 -0
- /package/{dist/datagrid → datagrid}/index.js +0 -0
- /package/{dist/dialog → dialog}/DialogProvider.d.ts +0 -0
- /package/{dist/dialog → dialog}/DialogProvider.js +0 -0
- /package/{dist/dialog → dialog}/context.d.ts +0 -0
- /package/{dist/dialog → dialog}/context.js +0 -0
- /package/{dist/dialog → dialog}/hooks/index.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/index.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useCloseDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useCloseDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItem.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItem.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItems.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useDialogItems.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenAlertDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenAlertDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenConfirmDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenConfirmDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenErrorDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenErrorDialog.js +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenPromptDialog.d.ts +0 -0
- /package/{dist/dialog → dialog}/hooks/useOpenPromptDialog.js +0 -0
- /package/{dist/dialog → dialog}/index.d.ts +0 -0
- /package/{dist/dialog → dialog}/index.js +0 -0
- /package/{dist/form → form}/FormValidationStringContext.d.ts +0 -0
- /package/{dist/form → form}/FormValidationStringContext.js +0 -0
- /package/{dist/form → form}/index.d.ts +0 -0
- /package/{dist/form → form}/index.js +0 -0
- /package/{dist/hooks → hooks}/index.d.ts +0 -0
- /package/{dist/hooks → hooks}/index.js +0 -0
- /package/{dist/hooks → hooks}/useDebouncedValue.d.ts +0 -0
- /package/{dist/hooks → hooks}/useDebouncedValue.js +0 -0
- /package/{dist/hooks → hooks}/useElementLayout.d.ts +0 -0
- /package/{dist/hooks → hooks}/useElementLayout.js +0 -0
- /package/{dist/hooks → hooks}/useIsMobile.d.ts +0 -0
- /package/{dist/hooks → hooks}/useIsMobile.js +0 -0
- /package/{dist/hooks → hooks}/useStorageState.d.ts +0 -0
- /package/{dist/hooks → hooks}/useStorageState.js +0 -0
- /package/{dist/hooks → hooks}/useSystemColorScheme.d.ts +0 -0
- /package/{dist/hooks → hooks}/useSystemColorScheme.js +0 -0
- /package/{dist/insights → insights}/context.d.ts +0 -0
- /package/{dist/insights → insights}/context.js +0 -0
- /package/{dist/insights → insights}/hooks/index.d.ts +0 -0
- /package/{dist/insights → insights}/hooks/index.js +0 -0
- /package/{dist/insights → insights}/index.d.ts +0 -0
- /package/{dist/insights → insights}/index.js +0 -0
- /package/{dist/locale → locale}/context.d.ts +0 -0
- /package/{dist/locale → locale}/context.js +0 -0
- /package/{dist/locale → locale}/index.d.ts +0 -0
- /package/{dist/locale → locale}/index.js +0 -0
- /package/{dist/locale → locale}/types.d.ts +0 -0
- /package/{dist/locale → locale}/types.js +0 -0
- /package/{dist/locale → locale}/useLocale.d.ts +0 -0
- /package/{dist/locale → locale}/useLocale.js +0 -0
- /package/{dist/metadata → metadata}/MetadataProvider.d.ts +0 -0
- /package/{dist/metadata → metadata}/MetadataProvider.js +0 -0
- /package/{dist/metadata → metadata}/context.d.ts +0 -0
- /package/{dist/metadata → metadata}/context.js +0 -0
- /package/{dist/metadata → metadata}/hooks/index.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/index.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useAppStore.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useAppStore.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceStore.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceStore.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceView.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceView.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewCommands.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewCommands.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewLookup.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewLookup.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewSubgridCommands.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useExperienceViewSubgridCommands.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useMetadata.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useMetadata.js +0 -0
- /package/{dist/metadata → metadata}/hooks/useSchema.d.ts +0 -0
- /package/{dist/metadata → metadata}/hooks/useSchema.js +0 -0
- /package/{dist/metadata → metadata}/index.d.ts +0 -0
- /package/{dist/metadata → metadata}/index.js +0 -0
- /package/{dist/mutable → mutable}/context.d.ts +0 -0
- /package/{dist/mutable → mutable}/context.js +0 -0
- /package/{dist/mutable → mutable}/index.d.ts +0 -0
- /package/{dist/mutable → mutable}/index.js +0 -0
- /package/{dist/mutable → mutable}/state.d.ts +0 -0
- /package/{dist/mutable → mutable}/state.js +0 -0
- /package/{dist/mutable → mutable}/type.d.ts +0 -0
- /package/{dist/mutable → mutable}/type.js +0 -0
- /package/{dist/mutable → mutable}/utils.d.ts +0 -0
- /package/{dist/mutable → mutable}/utils.js +0 -0
- /package/{dist/navigation → navigation}/hooks/useOpenForm.d.ts +0 -0
- /package/{dist/navigation → navigation}/hooks/useOpenForm.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/ProgressIndicatorProvider.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/ProgressIndicatorProvider.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/context.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/context.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/index.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/index.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/useProgressIndicator.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/hooks/useProgressIndicator.js +0 -0
- /package/{dist/progress-indicator → progress-indicator}/index.d.ts +0 -0
- /package/{dist/progress-indicator → progress-indicator}/index.js +0 -0
- /package/{dist/providers → providers}/PageEntityFormProvider/index.d.ts +0 -0
- /package/{dist/providers → providers}/PageEntityFormProvider/index.js +0 -0
- /package/{dist/providers → providers}/PageEntityViewProvider/index.d.ts +0 -0
- /package/{dist/providers → providers}/PageEntityViewProvider/index.js +0 -0
- /package/{dist/recordset → recordset}/RecordSetProvider.d.ts +0 -0
- /package/{dist/recordset → recordset}/RecordSetProvider.js +0 -0
- /package/{dist/recordset → recordset}/context.d.ts +0 -0
- /package/{dist/recordset → recordset}/context.js +0 -0
- /package/{dist/recordset → recordset}/hooks/index.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/index.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetResult.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetResult.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetSetter.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetSetter.js +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetVisibility.d.ts +0 -0
- /package/{dist/recordset → recordset}/hooks/useRecordSetVisibility.js +0 -0
- /package/{dist/recordset → recordset}/index.d.ts +0 -0
- /package/{dist/recordset → recordset}/index.js +0 -0
- /package/{dist/route → route}/RouteProvider.d.ts +0 -0
- /package/{dist/route → route}/RouteProvider.js +0 -0
- /package/{dist/route → route}/context.d.ts +0 -0
- /package/{dist/route → route}/context.js +0 -0
- /package/{dist/route → route}/hooks/index.d.ts +0 -0
- /package/{dist/route → route}/hooks/index.js +0 -0
- /package/{dist/route → route}/hooks/useBasePath.d.ts +0 -0
- /package/{dist/route → route}/hooks/useBasePath.js +0 -0
- /package/{dist/route → route}/hooks/usePathname.d.ts +0 -0
- /package/{dist/route → route}/hooks/usePathname.js +0 -0
- /package/{dist/route → route}/hooks/useRouteResolver.d.ts +0 -0
- /package/{dist/route → route}/hooks/useRouteResolver.js +0 -0
- /package/{dist/route → route}/hooks/useRouter.d.ts +0 -0
- /package/{dist/route → route}/hooks/useRouter.js +0 -0
- /package/{dist/route → route}/hooks/useSearchParams.d.ts +0 -0
- /package/{dist/route → route}/hooks/useSearchParams.js +0 -0
- /package/{dist/route → route}/index.d.ts +0 -0
- /package/{dist/route → route}/index.js +0 -0
- /package/{dist/route → route}/types.d.ts +0 -0
- /package/{dist/route → route}/types.js +0 -0
- /package/{dist/store → store}/ClientAppStore.d.ts +0 -0
- /package/{dist/store → store}/ClientAppStore.js +0 -0
- /package/{dist/store → store}/ComponentStore.d.ts +0 -0
- /package/{dist/store → store}/ComponentStore.js +0 -0
- /package/{dist/store → store}/EventManager.d.ts +0 -0
- /package/{dist/store → store}/EventManager.js +0 -0
- /package/{dist/store → store}/SchemaExperienceStore.d.ts +0 -0
- /package/{dist/store → store}/SchemaExperienceStore.js +0 -0
- /package/{dist/store → store}/index.d.ts +0 -0
- /package/{dist/store → store}/index.js +0 -0
- /package/{dist/toast-notification → toast-notification}/ToastNotificationProvider.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/ToastNotificationProvider.js +0 -0
- /package/{dist/toast-notification → toast-notification}/context.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/context.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/index.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/index.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useCloseToastNotification.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useCloseToastNotification.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useOpenToastNotification.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useOpenToastNotification.js +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useToastNotificationItems.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/hooks/useToastNotificationItems.js +0 -0
- /package/{dist/toast-notification → toast-notification}/index.d.ts +0 -0
- /package/{dist/toast-notification → toast-notification}/index.js +0 -0
- /package/{dist/transport → transport}/InMemoryDataService/index.d.ts +0 -0
- /package/{dist/transport → transport}/InMemoryDataService/index.js +0 -0
- /package/{dist/transport → transport}/RestDataService/index.d.ts +0 -0
- /package/{dist/transport → transport}/RestDataService/index.js +0 -0
- /package/{dist/transport → transport}/context.d.ts +0 -0
- /package/{dist/transport → transport}/context.js +0 -0
- /package/{dist/transport → transport}/hooks/index.d.ts +0 -0
- /package/{dist/transport → transport}/hooks/index.js +0 -0
- /package/{dist/transport → transport}/hooks/useDataService.d.ts +0 -0
- /package/{dist/transport → transport}/hooks/useDataService.js +0 -0
- /package/{dist/transport → transport}/index.d.ts +0 -0
- /package/{dist/transport → transport}/index.js +0 -0
- /package/{dist/utils → utils}/calculateColumnWidths.d.ts +0 -0
- /package/{dist/utils → utils}/calculateColumnWidths.js +0 -0
- /package/{dist/utils → utils}/index.d.ts +0 -0
- /package/{dist/utils → utils}/index.js +0 -0
- /package/{dist/widget → widget}/context.d.ts +0 -0
- /package/{dist/widget → widget}/context.js +0 -0
- /package/{dist/widget → widget}/hooks/index.d.ts +0 -0
- /package/{dist/widget → widget}/hooks/index.js +0 -0
- /package/{dist/widget → widget}/index.d.ts +0 -0
- /package/{dist/widget → widget}/index.js +0 -0
|
@@ -1,777 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EntityFormCommandContext,
|
|
3
|
-
EntityMainFormCommandItemExperience,
|
|
4
|
-
} from '@headless-adminapp/core/experience/form';
|
|
5
|
-
import {
|
|
6
|
-
EntityMainGridCommandItemExperience,
|
|
7
|
-
SubGridCommandItemExperience,
|
|
8
|
-
} from '@headless-adminapp/core/experience/view';
|
|
9
|
-
import { Localized } from '@headless-adminapp/core/types';
|
|
10
|
-
import { Icon } from '@headless-adminapp/icons';
|
|
11
|
-
|
|
12
|
-
export function localizedLabel<
|
|
13
|
-
T extends { label: string; localizedLabels?: Localized<string> }
|
|
14
|
-
>(language: string, value: T, fallback?: T): string {
|
|
15
|
-
return (
|
|
16
|
-
value.localizedLabels?.[language] ??
|
|
17
|
-
fallback?.localizedLabels?.[language] ??
|
|
18
|
-
value.label ??
|
|
19
|
-
fallback?.label
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function createLocalizedSelector<T>(
|
|
24
|
-
stringSet: T,
|
|
25
|
-
localizedStringSet: Localized<T> | undefined,
|
|
26
|
-
language: string
|
|
27
|
-
) {
|
|
28
|
-
return function selectLocalized<U>(selector: (stringSet: T) => U): U {
|
|
29
|
-
if (localizedStringSet && localizedStringSet[language]) {
|
|
30
|
-
return selector(localizedStringSet[language]);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return selector(stringSet);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export namespace CommandBuilder {
|
|
38
|
-
export namespace View {
|
|
39
|
-
export function createNewRecordCommand({
|
|
40
|
-
Icon,
|
|
41
|
-
text,
|
|
42
|
-
localizedTexts,
|
|
43
|
-
}: {
|
|
44
|
-
Icon: Icon;
|
|
45
|
-
text: string;
|
|
46
|
-
localizedTexts?: Record<string, string>;
|
|
47
|
-
}): EntityMainGridCommandItemExperience {
|
|
48
|
-
return {
|
|
49
|
-
type: 'button',
|
|
50
|
-
Icon,
|
|
51
|
-
text,
|
|
52
|
-
localizedText: localizedTexts,
|
|
53
|
-
onClick: (context) => {
|
|
54
|
-
console.log('New record', context);
|
|
55
|
-
},
|
|
56
|
-
hidden: (context) => {
|
|
57
|
-
console.log(context);
|
|
58
|
-
// TODO: Implement logic to hide the button
|
|
59
|
-
return false;
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export function createEditRecordCommand({
|
|
65
|
-
Icon,
|
|
66
|
-
text,
|
|
67
|
-
localizedTexts,
|
|
68
|
-
}: {
|
|
69
|
-
Icon: Icon;
|
|
70
|
-
text: string;
|
|
71
|
-
localizedTexts?: Record<string, string>;
|
|
72
|
-
}): EntityMainGridCommandItemExperience {
|
|
73
|
-
return {
|
|
74
|
-
type: 'button',
|
|
75
|
-
Icon,
|
|
76
|
-
text,
|
|
77
|
-
localizedText: localizedTexts,
|
|
78
|
-
isContextMenu: true,
|
|
79
|
-
onClick: (context) => {
|
|
80
|
-
console.log('Edit record', context);
|
|
81
|
-
},
|
|
82
|
-
hidden: (context) => context.primaryControl.selectedIds.length !== 1, // TODO: check permissions
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
interface DeleteRecordCommandStringSet {
|
|
87
|
-
confirmation: {
|
|
88
|
-
title: string | string[];
|
|
89
|
-
text: string | string[];
|
|
90
|
-
buttonCancel: string;
|
|
91
|
-
buttonConfirm: string;
|
|
92
|
-
};
|
|
93
|
-
status: {
|
|
94
|
-
deleting: string | string[];
|
|
95
|
-
};
|
|
96
|
-
successNotification: {
|
|
97
|
-
title: string | string[];
|
|
98
|
-
text: string | string[];
|
|
99
|
-
};
|
|
100
|
-
errorNotification: {
|
|
101
|
-
title: string;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function plurialize(
|
|
106
|
-
count: number,
|
|
107
|
-
singular: string | string[],
|
|
108
|
-
plural?: string
|
|
109
|
-
): string {
|
|
110
|
-
if (Array.isArray(singular)) {
|
|
111
|
-
plural = singular[1];
|
|
112
|
-
singular = singular[0];
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
let msg = count === 1 ? singular : plural ?? singular;
|
|
116
|
-
|
|
117
|
-
msg = msg.replace('{count}', count.toString());
|
|
118
|
-
|
|
119
|
-
return msg;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export const defaultDeleteRecordStringSet: DeleteRecordCommandStringSet = {
|
|
123
|
-
confirmation: {
|
|
124
|
-
text: [
|
|
125
|
-
'Are you sure you want to delete this record?',
|
|
126
|
-
'Are you sure you want to delete selected records?',
|
|
127
|
-
],
|
|
128
|
-
title: ['Delete record', 'Delete records'],
|
|
129
|
-
buttonConfirm: 'Delete',
|
|
130
|
-
buttonCancel: 'Cancel',
|
|
131
|
-
},
|
|
132
|
-
status: {
|
|
133
|
-
deleting: ['Deleting record', 'Deleting records'],
|
|
134
|
-
},
|
|
135
|
-
successNotification: {
|
|
136
|
-
title: ['Record deleted', 'Records deleted'],
|
|
137
|
-
text: ['Record deleted successfully', 'Records deleted successfully'],
|
|
138
|
-
},
|
|
139
|
-
errorNotification: {
|
|
140
|
-
title: 'Error',
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export function createDeleteRecordCommand({
|
|
145
|
-
Icon,
|
|
146
|
-
localizedText,
|
|
147
|
-
text,
|
|
148
|
-
stringSet = defaultDeleteRecordStringSet,
|
|
149
|
-
localizedStringSet,
|
|
150
|
-
}: {
|
|
151
|
-
Icon: Icon;
|
|
152
|
-
text: string;
|
|
153
|
-
localizedText?: Record<string, string>;
|
|
154
|
-
stringSet?: DeleteRecordCommandStringSet;
|
|
155
|
-
localizedStringSet?: Localized<DeleteRecordCommandStringSet>;
|
|
156
|
-
}): EntityMainGridCommandItemExperience {
|
|
157
|
-
return {
|
|
158
|
-
type: 'button',
|
|
159
|
-
Icon,
|
|
160
|
-
text,
|
|
161
|
-
localizedText,
|
|
162
|
-
danger: true,
|
|
163
|
-
isContextMenu: true,
|
|
164
|
-
hidden: [(context) => context.primaryControl.selectedIds.length === 0], // TODO: check permissions
|
|
165
|
-
onClick: async (context) => {
|
|
166
|
-
const recordIds = context.primaryControl.selectedIds;
|
|
167
|
-
|
|
168
|
-
if (!recordIds.length) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const localizeSelector = createLocalizedSelector(
|
|
173
|
-
stringSet,
|
|
174
|
-
localizedStringSet,
|
|
175
|
-
context.locale.language
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
try {
|
|
179
|
-
const confirmResult = await context.utility.openConfirmDialog({
|
|
180
|
-
title: plurialize(
|
|
181
|
-
recordIds.length,
|
|
182
|
-
localizeSelector((s) => s.confirmation.title)
|
|
183
|
-
),
|
|
184
|
-
text: plurialize(
|
|
185
|
-
recordIds.length,
|
|
186
|
-
localizeSelector((s) => s.confirmation.text)
|
|
187
|
-
),
|
|
188
|
-
cancelButtonLabel: localizeSelector(
|
|
189
|
-
(s) => s.confirmation.buttonCancel
|
|
190
|
-
),
|
|
191
|
-
confirmButtonLabel: localizeSelector(
|
|
192
|
-
(s) => s.confirmation.buttonConfirm
|
|
193
|
-
),
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
if (!confirmResult?.confirmed) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
context.utility.showProgressIndicator(
|
|
201
|
-
plurialize(
|
|
202
|
-
recordIds.length,
|
|
203
|
-
localizeSelector((s) => s.status.deleting)
|
|
204
|
-
) + '...'
|
|
205
|
-
);
|
|
206
|
-
|
|
207
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
208
|
-
|
|
209
|
-
context.utility.showNotification({
|
|
210
|
-
title: plurialize(
|
|
211
|
-
recordIds.length,
|
|
212
|
-
localizeSelector((s) => s.successNotification.title)
|
|
213
|
-
),
|
|
214
|
-
text: plurialize(
|
|
215
|
-
recordIds.length,
|
|
216
|
-
localizeSelector((s) => s.successNotification.text)
|
|
217
|
-
),
|
|
218
|
-
type: 'success',
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
context.primaryControl.refresh();
|
|
222
|
-
} catch (error) {
|
|
223
|
-
context.utility.showNotification({
|
|
224
|
-
title: localizeSelector((s) => s.errorNotification.title),
|
|
225
|
-
text: (error as Error).message,
|
|
226
|
-
type: 'error',
|
|
227
|
-
});
|
|
228
|
-
} finally {
|
|
229
|
-
context.utility.hideProgressIndicator();
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export function createRefreshCommand({
|
|
236
|
-
Icon,
|
|
237
|
-
localizedTexts,
|
|
238
|
-
text,
|
|
239
|
-
}: {
|
|
240
|
-
Icon: Icon;
|
|
241
|
-
text: string;
|
|
242
|
-
localizedTexts?: Record<string, string>;
|
|
243
|
-
}): EntityMainGridCommandItemExperience {
|
|
244
|
-
return {
|
|
245
|
-
type: 'button',
|
|
246
|
-
Icon,
|
|
247
|
-
text,
|
|
248
|
-
localizedText: localizedTexts,
|
|
249
|
-
onClick: (context) => {
|
|
250
|
-
context.primaryControl.refresh();
|
|
251
|
-
},
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
export function createExportCommand({
|
|
256
|
-
button,
|
|
257
|
-
csv,
|
|
258
|
-
excel,
|
|
259
|
-
}: {
|
|
260
|
-
button: {
|
|
261
|
-
Icon: Icon;
|
|
262
|
-
text: string;
|
|
263
|
-
localizedTexts?: Record<string, string>;
|
|
264
|
-
};
|
|
265
|
-
excel: {
|
|
266
|
-
Icon: Icon;
|
|
267
|
-
text: string;
|
|
268
|
-
localizedTexts?: Record<string, string>;
|
|
269
|
-
};
|
|
270
|
-
csv: {
|
|
271
|
-
Icon: Icon;
|
|
272
|
-
text: string;
|
|
273
|
-
localizedTexts?: Record<string, string>;
|
|
274
|
-
};
|
|
275
|
-
}): EntityMainGridCommandItemExperience {
|
|
276
|
-
return {
|
|
277
|
-
type: 'menu',
|
|
278
|
-
Icon: button.Icon,
|
|
279
|
-
text: button.text,
|
|
280
|
-
localizedTexts: button.localizedTexts,
|
|
281
|
-
items: [
|
|
282
|
-
[
|
|
283
|
-
{
|
|
284
|
-
Icon: excel.Icon,
|
|
285
|
-
text: excel.text,
|
|
286
|
-
localizedTexts: excel.localizedTexts,
|
|
287
|
-
onClick: (context) => {
|
|
288
|
-
console.log('Export to Excel', context);
|
|
289
|
-
},
|
|
290
|
-
},
|
|
291
|
-
{
|
|
292
|
-
Icon: csv.Icon,
|
|
293
|
-
text: csv.text,
|
|
294
|
-
localizedTexts: csv.localizedTexts,
|
|
295
|
-
onClick: (context) => {
|
|
296
|
-
console.log('Export to CSV', context);
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
],
|
|
300
|
-
],
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export namespace Form {
|
|
306
|
-
export function createSaveCommand({
|
|
307
|
-
Icon,
|
|
308
|
-
text,
|
|
309
|
-
localizedTexts,
|
|
310
|
-
}: {
|
|
311
|
-
Icon: Icon;
|
|
312
|
-
text: string;
|
|
313
|
-
localizedTexts?: Record<string, string>;
|
|
314
|
-
}): EntityMainFormCommandItemExperience {
|
|
315
|
-
return {
|
|
316
|
-
type: 'button',
|
|
317
|
-
Icon,
|
|
318
|
-
text,
|
|
319
|
-
localizedText: localizedTexts,
|
|
320
|
-
isQuickAction: true,
|
|
321
|
-
onClick: async (context) => {
|
|
322
|
-
await context.primaryControl.save('save');
|
|
323
|
-
},
|
|
324
|
-
hidden: (context) => {
|
|
325
|
-
if (context.primaryControl.readonly) {
|
|
326
|
-
return true;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
return false;
|
|
330
|
-
},
|
|
331
|
-
};
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export function createSaveAndCloseCommand({
|
|
335
|
-
Icon,
|
|
336
|
-
text,
|
|
337
|
-
localizedTexts,
|
|
338
|
-
}: {
|
|
339
|
-
Icon: Icon;
|
|
340
|
-
text: string;
|
|
341
|
-
localizedTexts?: Record<string, string>;
|
|
342
|
-
}): EntityMainFormCommandItemExperience {
|
|
343
|
-
return {
|
|
344
|
-
type: 'button',
|
|
345
|
-
Icon,
|
|
346
|
-
text,
|
|
347
|
-
localizedText: localizedTexts,
|
|
348
|
-
onClick: async (context) => {
|
|
349
|
-
await context.primaryControl.save('saveandclose');
|
|
350
|
-
},
|
|
351
|
-
hidden: (context) => {
|
|
352
|
-
if (context.primaryControl.readonly) {
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
return false;
|
|
357
|
-
},
|
|
358
|
-
};
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
interface DeleteRecordCommandStringSet {
|
|
362
|
-
confirmation: {
|
|
363
|
-
title: string;
|
|
364
|
-
text: string;
|
|
365
|
-
buttonCancel: string;
|
|
366
|
-
buttonConfirm: string;
|
|
367
|
-
};
|
|
368
|
-
status: {
|
|
369
|
-
deleting: string;
|
|
370
|
-
};
|
|
371
|
-
successNotification: {
|
|
372
|
-
title: string;
|
|
373
|
-
text: string;
|
|
374
|
-
};
|
|
375
|
-
errorNotification: {
|
|
376
|
-
title: string;
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
export const defaultDeleteRecordStringSet: DeleteRecordCommandStringSet = {
|
|
381
|
-
confirmation: {
|
|
382
|
-
text: 'Are you sure you want to delete this record?',
|
|
383
|
-
title: 'Delete record',
|
|
384
|
-
buttonConfirm: 'Delete',
|
|
385
|
-
buttonCancel: 'Cancel',
|
|
386
|
-
},
|
|
387
|
-
status: {
|
|
388
|
-
deleting: 'Deleting record',
|
|
389
|
-
},
|
|
390
|
-
successNotification: {
|
|
391
|
-
title: 'Record deleted',
|
|
392
|
-
text: 'Record deleted successfully',
|
|
393
|
-
},
|
|
394
|
-
errorNotification: {
|
|
395
|
-
title: 'Error',
|
|
396
|
-
},
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
export function createDeleteCommand({
|
|
400
|
-
Icon,
|
|
401
|
-
text,
|
|
402
|
-
localizedTexts,
|
|
403
|
-
stringSet,
|
|
404
|
-
}: {
|
|
405
|
-
Icon: Icon;
|
|
406
|
-
text: string;
|
|
407
|
-
localizedTexts?: Record<string, string>;
|
|
408
|
-
stringSet:
|
|
409
|
-
| DeleteRecordCommandStringSet
|
|
410
|
-
| ((context: EntityFormCommandContext) => DeleteRecordCommandStringSet);
|
|
411
|
-
}): EntityMainFormCommandItemExperience {
|
|
412
|
-
return {
|
|
413
|
-
Icon: Icon,
|
|
414
|
-
type: 'button',
|
|
415
|
-
text,
|
|
416
|
-
localizedText: localizedTexts,
|
|
417
|
-
danger: true,
|
|
418
|
-
hidden: (context) => {
|
|
419
|
-
if (!context.primaryControl.recordId) {
|
|
420
|
-
return true;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
if (context.primaryControl.schema.restrictions?.disableDelete) {
|
|
424
|
-
return true;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
return false;
|
|
428
|
-
},
|
|
429
|
-
onClick: async (context) => {
|
|
430
|
-
const recordId = context.primaryControl.recordId;
|
|
431
|
-
|
|
432
|
-
if (!recordId) {
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
if (typeof stringSet === 'function') {
|
|
437
|
-
stringSet = stringSet(context);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
try {
|
|
441
|
-
const confirmResult = await context.utility.openConfirmDialog({
|
|
442
|
-
title: stringSet.confirmation.title,
|
|
443
|
-
text: stringSet.confirmation.text,
|
|
444
|
-
cancelButtonLabel: stringSet.confirmation.buttonCancel,
|
|
445
|
-
confirmButtonLabel: stringSet.confirmation.buttonConfirm,
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
if (!confirmResult?.confirmed) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
context.utility.showProgressIndicator(
|
|
453
|
-
stringSet.status.deleting + '...'
|
|
454
|
-
);
|
|
455
|
-
|
|
456
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
457
|
-
// await context.dataService.deleteRecord(
|
|
458
|
-
// context.primaryControl.logicalName,
|
|
459
|
-
// recordId
|
|
460
|
-
// );
|
|
461
|
-
|
|
462
|
-
context.utility.showNotification({
|
|
463
|
-
title: stringSet.successNotification.title,
|
|
464
|
-
text: stringSet.successNotification.text,
|
|
465
|
-
type: 'success',
|
|
466
|
-
});
|
|
467
|
-
|
|
468
|
-
// context.primaryControl.close();
|
|
469
|
-
} catch (error) {
|
|
470
|
-
context.utility.showNotification({
|
|
471
|
-
title: stringSet.errorNotification.title,
|
|
472
|
-
text: (error as Error).message,
|
|
473
|
-
type: 'error',
|
|
474
|
-
});
|
|
475
|
-
} finally {
|
|
476
|
-
context.utility.hideProgressIndicator();
|
|
477
|
-
}
|
|
478
|
-
},
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
export function createRefreshCommand({
|
|
483
|
-
Icon,
|
|
484
|
-
text,
|
|
485
|
-
localizedTexts,
|
|
486
|
-
}: {
|
|
487
|
-
Icon: Icon;
|
|
488
|
-
text: string;
|
|
489
|
-
localizedTexts?: Record<string, string>;
|
|
490
|
-
}): EntityMainFormCommandItemExperience {
|
|
491
|
-
return {
|
|
492
|
-
Icon,
|
|
493
|
-
type: 'button',
|
|
494
|
-
text,
|
|
495
|
-
localizedText: localizedTexts,
|
|
496
|
-
onClick: async (context) => {
|
|
497
|
-
await context.primaryControl.refresh();
|
|
498
|
-
},
|
|
499
|
-
hidden: (context) => !context.primaryControl.recordId,
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
export namespace Subgrid {
|
|
505
|
-
export function createNewRecordCommand({
|
|
506
|
-
Icon,
|
|
507
|
-
text,
|
|
508
|
-
localizedTexts,
|
|
509
|
-
}: {
|
|
510
|
-
Icon: Icon;
|
|
511
|
-
text: string;
|
|
512
|
-
localizedTexts?: Record<string, string>;
|
|
513
|
-
}): SubGridCommandItemExperience {
|
|
514
|
-
return {
|
|
515
|
-
type: 'button',
|
|
516
|
-
Icon,
|
|
517
|
-
text,
|
|
518
|
-
localizedText: localizedTexts,
|
|
519
|
-
onClick: (context) => {
|
|
520
|
-
console.log('New record', context);
|
|
521
|
-
},
|
|
522
|
-
hidden: (context) => {
|
|
523
|
-
console.log(context);
|
|
524
|
-
// TODO: Implement logic to hide the button
|
|
525
|
-
return false;
|
|
526
|
-
},
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
export function createEditRecordCommand({
|
|
531
|
-
Icon,
|
|
532
|
-
text,
|
|
533
|
-
localizedTexts,
|
|
534
|
-
}: {
|
|
535
|
-
Icon: Icon;
|
|
536
|
-
text: string;
|
|
537
|
-
localizedTexts?: Record<string, string>;
|
|
538
|
-
}): SubGridCommandItemExperience {
|
|
539
|
-
return {
|
|
540
|
-
type: 'button',
|
|
541
|
-
Icon,
|
|
542
|
-
text,
|
|
543
|
-
localizedText: localizedTexts,
|
|
544
|
-
isContextMenu: true,
|
|
545
|
-
onClick: (context) => {
|
|
546
|
-
console.log('Edit record', context);
|
|
547
|
-
},
|
|
548
|
-
// hidden: (context) => context.secondaryControl.selectedIds.length !== 1, // TODO: check permissions
|
|
549
|
-
hidden: (context) => {
|
|
550
|
-
console.log('temp.', context);
|
|
551
|
-
|
|
552
|
-
return context.secondaryControl.selectedIds.length !== 1;
|
|
553
|
-
},
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
interface DeleteRecordCommandStringSet {
|
|
558
|
-
confirmation: {
|
|
559
|
-
title: string | string[];
|
|
560
|
-
text: string | string[];
|
|
561
|
-
buttonCancel: string;
|
|
562
|
-
buttonConfirm: string;
|
|
563
|
-
};
|
|
564
|
-
status: {
|
|
565
|
-
deleting: string | string[];
|
|
566
|
-
};
|
|
567
|
-
successNotification: {
|
|
568
|
-
title: string | string[];
|
|
569
|
-
text: string | string[];
|
|
570
|
-
};
|
|
571
|
-
errorNotification: {
|
|
572
|
-
title: string;
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
function plurialize(
|
|
577
|
-
count: number,
|
|
578
|
-
singular: string | string[],
|
|
579
|
-
plural?: string
|
|
580
|
-
): string {
|
|
581
|
-
if (Array.isArray(singular)) {
|
|
582
|
-
plural = singular[1];
|
|
583
|
-
singular = singular[0];
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
let msg = count === 1 ? singular : plural ?? singular;
|
|
587
|
-
|
|
588
|
-
msg = msg.replace('{count}', count.toString());
|
|
589
|
-
|
|
590
|
-
return msg;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
export const defaultDeleteRecordStringSet: DeleteRecordCommandStringSet = {
|
|
594
|
-
confirmation: {
|
|
595
|
-
text: [
|
|
596
|
-
'Are you sure you want to delete this record?',
|
|
597
|
-
'Are you sure you want to delete selected records?',
|
|
598
|
-
],
|
|
599
|
-
title: ['Delete record', 'Delete records'],
|
|
600
|
-
buttonConfirm: 'Delete',
|
|
601
|
-
buttonCancel: 'Cancel',
|
|
602
|
-
},
|
|
603
|
-
status: {
|
|
604
|
-
deleting: ['Deleting record', 'Deleting records'],
|
|
605
|
-
},
|
|
606
|
-
successNotification: {
|
|
607
|
-
title: ['Record deleted', 'Records deleted'],
|
|
608
|
-
text: ['Record deleted successfully', 'Records deleted successfully'],
|
|
609
|
-
},
|
|
610
|
-
errorNotification: {
|
|
611
|
-
title: 'Error',
|
|
612
|
-
},
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
export function createDeleteRecordCommand({
|
|
616
|
-
Icon,
|
|
617
|
-
localizedText,
|
|
618
|
-
text,
|
|
619
|
-
stringSet = defaultDeleteRecordStringSet,
|
|
620
|
-
localizedStringSet,
|
|
621
|
-
}: {
|
|
622
|
-
Icon: Icon;
|
|
623
|
-
text: string;
|
|
624
|
-
localizedText?: Record<string, string>;
|
|
625
|
-
stringSet?: DeleteRecordCommandStringSet;
|
|
626
|
-
localizedStringSet?: Localized<DeleteRecordCommandStringSet>;
|
|
627
|
-
}): SubGridCommandItemExperience {
|
|
628
|
-
return {
|
|
629
|
-
type: 'button',
|
|
630
|
-
Icon,
|
|
631
|
-
text,
|
|
632
|
-
localizedText,
|
|
633
|
-
danger: true,
|
|
634
|
-
isContextMenu: true,
|
|
635
|
-
hidden: [
|
|
636
|
-
(context) => context.secondaryControl.selectedIds.length === 0,
|
|
637
|
-
], // TODO: check permissions
|
|
638
|
-
onClick: async (context) => {
|
|
639
|
-
const recordIds = context.secondaryControl.selectedIds;
|
|
640
|
-
|
|
641
|
-
if (!recordIds.length) {
|
|
642
|
-
return;
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
const localizeSelector = createLocalizedSelector(
|
|
646
|
-
stringSet,
|
|
647
|
-
localizedStringSet,
|
|
648
|
-
context.locale.language
|
|
649
|
-
);
|
|
650
|
-
|
|
651
|
-
try {
|
|
652
|
-
const confirmResult = await context.utility.openConfirmDialog({
|
|
653
|
-
title: plurialize(
|
|
654
|
-
recordIds.length,
|
|
655
|
-
localizeSelector((s) => s.confirmation.title)
|
|
656
|
-
),
|
|
657
|
-
text: plurialize(
|
|
658
|
-
recordIds.length,
|
|
659
|
-
localizeSelector((s) => s.confirmation.text)
|
|
660
|
-
),
|
|
661
|
-
cancelButtonLabel: localizeSelector(
|
|
662
|
-
(s) => s.confirmation.buttonCancel
|
|
663
|
-
),
|
|
664
|
-
confirmButtonLabel: localizeSelector(
|
|
665
|
-
(s) => s.confirmation.buttonConfirm
|
|
666
|
-
),
|
|
667
|
-
});
|
|
668
|
-
|
|
669
|
-
if (!confirmResult?.confirmed) {
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
context.utility.showProgressIndicator(
|
|
674
|
-
plurialize(
|
|
675
|
-
recordIds.length,
|
|
676
|
-
localizeSelector((s) => s.status.deleting)
|
|
677
|
-
) + '...'
|
|
678
|
-
);
|
|
679
|
-
|
|
680
|
-
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
681
|
-
|
|
682
|
-
context.utility.showNotification({
|
|
683
|
-
title: plurialize(
|
|
684
|
-
recordIds.length,
|
|
685
|
-
localizeSelector((s) => s.successNotification.title)
|
|
686
|
-
),
|
|
687
|
-
text: plurialize(
|
|
688
|
-
recordIds.length,
|
|
689
|
-
localizeSelector((s) => s.successNotification.text)
|
|
690
|
-
),
|
|
691
|
-
type: 'success',
|
|
692
|
-
});
|
|
693
|
-
|
|
694
|
-
await context.primaryControl.refresh();
|
|
695
|
-
} catch (error) {
|
|
696
|
-
context.utility.showNotification({
|
|
697
|
-
title: localizeSelector((s) => s.errorNotification.title),
|
|
698
|
-
text: (error as Error).message,
|
|
699
|
-
type: 'error',
|
|
700
|
-
});
|
|
701
|
-
} finally {
|
|
702
|
-
context.utility.hideProgressIndicator();
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
export function createRefreshCommand({
|
|
709
|
-
Icon,
|
|
710
|
-
localizedTexts,
|
|
711
|
-
text,
|
|
712
|
-
}: {
|
|
713
|
-
Icon: Icon;
|
|
714
|
-
text: string;
|
|
715
|
-
localizedTexts?: Record<string, string>;
|
|
716
|
-
}): SubGridCommandItemExperience {
|
|
717
|
-
return {
|
|
718
|
-
type: 'button',
|
|
719
|
-
Icon,
|
|
720
|
-
text,
|
|
721
|
-
localizedText: localizedTexts,
|
|
722
|
-
onClick: (context) => {
|
|
723
|
-
context.secondaryControl.refresh();
|
|
724
|
-
},
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
export function createExportCommand({
|
|
729
|
-
button,
|
|
730
|
-
csv,
|
|
731
|
-
excel,
|
|
732
|
-
}: {
|
|
733
|
-
button: {
|
|
734
|
-
Icon: Icon;
|
|
735
|
-
text: string;
|
|
736
|
-
localizedTexts?: Record<string, string>;
|
|
737
|
-
};
|
|
738
|
-
excel: {
|
|
739
|
-
Icon: Icon;
|
|
740
|
-
text: string;
|
|
741
|
-
localizedTexts?: Record<string, string>;
|
|
742
|
-
};
|
|
743
|
-
csv: {
|
|
744
|
-
Icon: Icon;
|
|
745
|
-
text: string;
|
|
746
|
-
localizedTexts?: Record<string, string>;
|
|
747
|
-
};
|
|
748
|
-
}): SubGridCommandItemExperience {
|
|
749
|
-
return {
|
|
750
|
-
type: 'menu',
|
|
751
|
-
Icon: button.Icon,
|
|
752
|
-
text: button.text,
|
|
753
|
-
localizedTexts: button.localizedTexts,
|
|
754
|
-
items: [
|
|
755
|
-
[
|
|
756
|
-
{
|
|
757
|
-
Icon: excel.Icon,
|
|
758
|
-
text: excel.text,
|
|
759
|
-
localizedTexts: excel.localizedTexts,
|
|
760
|
-
onClick: (context) => {
|
|
761
|
-
console.log('Export to Excel', context);
|
|
762
|
-
},
|
|
763
|
-
},
|
|
764
|
-
{
|
|
765
|
-
Icon: csv.Icon,
|
|
766
|
-
text: csv.text,
|
|
767
|
-
localizedTexts: csv.localizedTexts,
|
|
768
|
-
onClick: (context) => {
|
|
769
|
-
console.log('Export to CSV', context);
|
|
770
|
-
},
|
|
771
|
-
},
|
|
772
|
-
],
|
|
773
|
-
],
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
}
|