@headless-adminapp/app 1.4.49 → 1.5.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.
Files changed (170) hide show
  1. package/app/AppProvider.d.ts +1 -1
  2. package/app/AuthWrapper.d.ts +2 -2
  3. package/app/LayoutProvider.d.ts +7 -7
  4. package/app/context.d.ts +2 -2
  5. package/app/hooks/useAppContext.d.ts +1 -1
  6. package/auth/AuthProvider.d.ts +2 -2
  7. package/auth/context.d.ts +1 -1
  8. package/auth/hooks/useAuthSession.d.ts +1 -1
  9. package/auth/index.d.ts +1 -1
  10. package/auth/index.js +0 -1
  11. package/auth/types.d.ts +1 -1
  12. package/board/BoardColumnProvider.d.ts +2 -2
  13. package/board/context.d.ts +1 -1
  14. package/board/hooks/useBoardColumnConfig.d.ts +1 -1
  15. package/board/hooks/useBoardColumnData.d.ts +2 -2
  16. package/board/hooks/useBoardConfig.d.ts +2 -2
  17. package/board/hooks/useBoardSchema.d.ts +1 -1
  18. package/board/types.d.ts +7 -7
  19. package/board/utils.d.ts +2 -2
  20. package/builders/CommandBuilder/DefaultCommandBuilder.d.ts +4 -4
  21. package/builders/CommandBuilder/FormCommandBuilder.d.ts +3 -3
  22. package/builders/CommandBuilder/SubgridCommandBuilder.d.ts +3 -3
  23. package/builders/CommandBuilder/ViewCommandBuilder.d.ts +3 -3
  24. package/builders/CommandBuilder/ViewCommandBuilder.js +7 -3
  25. package/builders/CommandBuilder/utils.d.ts +1 -1
  26. package/builders/SchemaExperienceBuilder.d.ts +4 -4
  27. package/builders/utils.d.ts +6 -6
  28. package/builders/utils.js +5 -1
  29. package/calendar/CalendarProvider.d.ts +3 -3
  30. package/calendar/context.d.ts +1 -1
  31. package/calendar/hooks/useConfig.d.ts +2 -2
  32. package/calendar/hooks/useOpenDetailDialog.d.ts +1 -1
  33. package/calendar/types.d.ts +5 -5
  34. package/calendar/utils.d.ts +2 -2
  35. package/command/hooks/useBaseCommandHandlerContext.d.ts +2 -2
  36. package/command/hooks/useBaseCommandHandlerContext.js +10 -2
  37. package/command/hooks/useCommands.d.ts +2 -2
  38. package/command/index.d.ts +1 -1
  39. package/command/index.js +0 -1
  40. package/command/types.d.ts +5 -5
  41. package/command/utils/index.d.ts +2 -2
  42. package/components/ScrollView/index.d.ts +1 -1
  43. package/components/ScrollbarWithMoreDataRequest/index.d.ts +1 -1
  44. package/dataform/DataFormProvider/CalculatedField.d.ts +1 -1
  45. package/dataform/DataFormProvider/CalculatedField.js +1 -0
  46. package/dataform/DataFormProvider/DataResolver.d.ts +2 -2
  47. package/dataform/DataFormProvider/DataResolver.js +1 -0
  48. package/dataform/DataFormProvider/UnsavedChangesInfoSetter.d.ts +1 -1
  49. package/dataform/DataFormProvider/getRecord.d.ts +5 -5
  50. package/dataform/DataFormProvider/getRecord.js +1 -0
  51. package/dataform/DataFormProvider/index.d.ts +5 -5
  52. package/dataform/DataFormProvider/index.js +1 -0
  53. package/dataform/DataFormProvider/types.d.ts +4 -4
  54. package/dataform/DataFormProvider/utils.d.ts +6 -6
  55. package/dataform/FormManager.d.ts +7 -7
  56. package/dataform/context.d.ts +8 -8
  57. package/dataform/hooks/useFormNotifications.d.ts +5 -3
  58. package/dataform/hooks/useFormNotifications.js +5 -8
  59. package/dataform/hooks/useFormSave.d.ts +1 -1
  60. package/dataform/hooks/useFormSchema.d.ts +1 -1
  61. package/dataform/hooks/useLoadFormGridPage.d.ts +2 -2
  62. package/dataform/hooks/useMainFormCommands.d.ts +2 -2
  63. package/dataform/hooks/useMainFormCommands.js +2 -1
  64. package/dataform/hooks/useOnFieldValueChangeListener.js +3 -1
  65. package/dataform/hooks/useProcessFlowSteps.js +3 -1
  66. package/dataform/hooks/useSelectedForm.d.ts +2 -2
  67. package/dataform/utils/defaultParameters.d.ts +3 -3
  68. package/dataform/utils/defaultParameters.js +4 -1
  69. package/dataform/utils/index.d.ts +7 -7
  70. package/dataform/utils/index.js +31 -8
  71. package/dataform/utils/saveRecord.d.ts +6 -6
  72. package/dataform/utils/saveRecord.js +11 -2
  73. package/datagrid/DataGridProvider/DataResolver.d.ts +1 -1
  74. package/datagrid/DataGridProvider/index.d.ts +6 -6
  75. package/datagrid/DataGridProvider/transformViewColumns.d.ts +4 -4
  76. package/datagrid/DataGridProvider/useGridCellRangeResolver.d.ts +4 -4
  77. package/datagrid/DataGridProvider/utils.d.ts +5 -5
  78. package/datagrid/DataGridProvider/utils.js +3 -0
  79. package/datagrid/column-filter/constants.d.ts +1 -1
  80. package/datagrid/column-filter/utils.d.ts +1 -1
  81. package/datagrid/context.d.ts +5 -5
  82. package/datagrid/hooks/useGridColumnFilter.d.ts +1 -1
  83. package/datagrid/hooks/useGridColumns.d.ts +2 -2
  84. package/datagrid/hooks/useGridCommands.d.ts +2 -2
  85. package/datagrid/hooks/useGridOptions.js +1 -0
  86. package/datagrid/hooks/useGridPagination.js +1 -0
  87. package/datagrid/hooks/useGridSchema.d.ts +1 -1
  88. package/datagrid/hooks/useGridSorting.d.ts +2 -2
  89. package/datagrid/hooks/useGridSorting.js +1 -0
  90. package/datagrid/hooks/useLoadMainGridPage.d.ts +3 -3
  91. package/datagrid/hooks/useMainGridCommands.d.ts +2 -2
  92. package/datagrid/hooks/useMainGridCommands.js +2 -0
  93. package/datagrid/hooks/useSelectedView.d.ts +2 -2
  94. package/datagrid/hooks/useSubGridCommands.d.ts +2 -2
  95. package/dialog/DialogProvider.d.ts +1 -1
  96. package/dialog/context.d.ts +1 -1
  97. package/dialog/hooks/useOpenAlertDialog.d.ts +1 -1
  98. package/dialog/hooks/useOpenConfirmDialog.d.ts +1 -1
  99. package/dialog/hooks/useOpenDialog.d.ts +1 -1
  100. package/dialog/hooks/useOpenErrorDialog.d.ts +1 -1
  101. package/dialog/hooks/useOpenPromptDialog.d.ts +2 -2
  102. package/header/HeaderProvider.d.ts +1 -1
  103. package/header/components/MobileHeaderLeftContent.d.ts +1 -1
  104. package/header/components/MobileHeaderRightContent.d.ts +1 -1
  105. package/header/components/MobileHeaderTitle.d.ts +1 -1
  106. package/header/hooks/useHeaderValue.d.ts +1 -1
  107. package/header/hooks/useMobileHeaderSetValue.d.ts +1 -1
  108. package/historystate/provider.d.ts +1 -1
  109. package/hooks/useDebouncedValue.js +5 -2
  110. package/hooks/useElementLayout.d.ts +2 -2
  111. package/hooks/useItemsWithKey.d.ts +1 -1
  112. package/hooks/useLongPress.js +4 -2
  113. package/hooks/useStorageState.d.ts +1 -1
  114. package/insights/context.d.ts +1 -1
  115. package/insights/hooks/index.d.ts +2 -2
  116. package/insights/hooks/index.js +1 -0
  117. package/locale/LocaleProvider.d.ts +2 -2
  118. package/locale/context.d.ts +1 -1
  119. package/locale/utils.d.ts +1 -1
  120. package/metadata/MetadataProvider.d.ts +5 -5
  121. package/metadata/context.d.ts +2 -2
  122. package/metadata/hooks/useExperienceView.d.ts +1 -1
  123. package/metadata/hooks/useExperienceView.js +3 -1
  124. package/metadata/hooks/useMetadata.d.ts +1 -1
  125. package/metadata/hooks/useRecentItemStore.d.ts +1 -1
  126. package/metadata/hooks/useSchema.d.ts +1 -1
  127. package/mutable/context.d.ts +1 -1
  128. package/mutable/context.js +1 -0
  129. package/mutable/index.d.ts +1 -1
  130. package/mutable/index.js +0 -15
  131. package/mutable/state.d.ts +1 -1
  132. package/mutable/utils.d.ts +1 -1
  133. package/mutable/utils.js +1 -1
  134. package/navigation/hooks/useOpenForm.d.ts +1 -1
  135. package/navigation/unsaved-changes/useUnsavedChangesRouteGuard.js +1 -0
  136. package/package.json +3 -3
  137. package/progress-indicator/ProgressIndicatorProvider.d.ts +1 -1
  138. package/progress-indicator/ProgressIndicatorProvider.js +1 -1
  139. package/progress-indicator/context.js +3 -1
  140. package/providers/PageEntityFormProvider/index.d.ts +5 -5
  141. package/providers/PageEntityViewProvider/index.d.ts +4 -4
  142. package/quickcreate/QuickCreateProvider.d.ts +1 -1
  143. package/quickcreate/context.d.ts +2 -2
  144. package/quickcreate/hooks/useFormSave.d.ts +1 -1
  145. package/quickcreate/hooks/useOpenQuickCreate.d.ts +2 -2
  146. package/recordset/RecordSetProvider.d.ts +1 -1
  147. package/recordset/RecordSetProvider.js +1 -1
  148. package/recordset/context.d.ts +1 -1
  149. package/recordset/hooks/useRecordSetResult.d.ts +1 -1
  150. package/route/RouteProvider.d.ts +4 -4
  151. package/route/context.d.ts +3 -3
  152. package/route/context.js +8 -2
  153. package/store/ComponentStore.d.ts +1 -1
  154. package/store/EventManager.d.ts +1 -1
  155. package/store/EventManager.js +1 -0
  156. package/store/RecentItemStore.d.ts +1 -1
  157. package/store/SchemaExperienceStore.d.ts +6 -6
  158. package/store/SchemaExperienceStore.js +2 -2
  159. package/toast-notification/ToastNotificationProvider.d.ts +1 -1
  160. package/toast-notification/hooks/useOpenToastNotification.d.ts +1 -1
  161. package/transport/InMemoryDataService/index.d.ts +3 -3
  162. package/transport/InMemoryDataService/index.js +5 -0
  163. package/transport/RestDataService/index.d.ts +2 -2
  164. package/transport/context.d.ts +1 -1
  165. package/transport/hooks/useCustomActionQuery.d.ts +2 -1
  166. package/transport/hooks/useDataService.d.ts +1 -1
  167. package/transport/hooks/useRetriveRecords.d.ts +6 -16
  168. package/transport/hooks/useRetriveRecords.js +2 -1
  169. package/utils/getAttributeFormattedValue.d.ts +3 -3
  170. package/utils/getAttributeFormattedValue.js +20 -3
@@ -1,10 +1,10 @@
1
- import { Attribute } from '@headless-adminapp/core';
2
- import { Section } from '@headless-adminapp/core/experience/form';
3
- import { SectionControl } from '@headless-adminapp/core/experience/form/SectionControl';
4
- import { Tab } from '@headless-adminapp/core/experience/form/Tab';
5
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
6
- import { ContextValue } from '../mutable';
7
- import { DataFormContextState } from './context';
1
+ import type { Attribute } from '@headless-adminapp/core';
2
+ import type { Section } from '@headless-adminapp/core/experience/form';
3
+ import type { SectionControl } from '@headless-adminapp/core/experience/form/SectionControl';
4
+ import type { Tab } from '@headless-adminapp/core/experience/form/Tab';
5
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
6
+ import type { ContextValue } from '../mutable';
7
+ import type { DataFormContextState } from './context';
8
8
  export declare class FormManager<SA extends SchemaAttributes = SchemaAttributes> {
9
9
  private readonly contextState;
10
10
  constructor(contextState: ContextValue<DataFormContextState<SA>>);
@@ -1,11 +1,11 @@
1
- import { EntityMainFormCommandItemExperience, Form, Section } from '@headless-adminapp/core/experience/form';
2
- import { SectionControl } from '@headless-adminapp/core/experience/form/SectionControl';
3
- import { Tab } from '@headless-adminapp/core/experience/form/Tab';
4
- import { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
5
- import { IEventManager } from '@headless-adminapp/core/store';
6
- import { Data } from '@headless-adminapp/core/transport';
7
- import { Localized, Nullable } from '@headless-adminapp/core/types';
8
- import { SaveRecordFn } from './utils/saveRecord';
1
+ import type { EntityMainFormCommandItemExperience, Form, Section } from '@headless-adminapp/core/experience/form';
2
+ import type { SectionControl } from '@headless-adminapp/core/experience/form/SectionControl';
3
+ import type { Tab } from '@headless-adminapp/core/experience/form/Tab';
4
+ import type { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
5
+ import type { IEventManager } from '@headless-adminapp/core/store';
6
+ import type { Data } from '@headless-adminapp/core/transport';
7
+ import type { Localized, Nullable } from '@headless-adminapp/core/types';
8
+ import type { SaveRecordFn } from './utils/saveRecord';
9
9
  export interface RelatedItemInfo {
10
10
  key: string;
11
11
  logicalName: string;
@@ -1,4 +1,6 @@
1
- export declare function useFormNotifications(): {
2
- level: "info" | "warning" | "error";
1
+ type Notification = {
2
+ level: 'info' | 'warning' | 'error';
3
3
  message: string;
4
- }[];
4
+ };
5
+ export declare function useFormNotifications(): Notification[];
6
+ export {};
@@ -8,6 +8,8 @@ function useFormNotifications() {
8
8
  const readonly = (0, useFormIsReadonly_1.useFormIsReadonly)();
9
9
  const formInstance = (0, useFormInstance_1.useFormInstance)();
10
10
  const formInstanceAvailable = !!formInstance;
11
+ const errors = formInstance?.formState.errors;
12
+ const isSubmitted = formInstance?.formState.isSubmitted;
11
13
  return (0, react_1.useMemo)(() => {
12
14
  const notifications = [];
13
15
  if (readonly) {
@@ -17,18 +19,13 @@ function useFormNotifications() {
17
19
  });
18
20
  }
19
21
  if (formInstanceAvailable &&
20
- formInstance.formState.isSubmitted &&
21
- Object.keys(formInstance.formState.errors).length > 0) {
22
+ isSubmitted &&
23
+ Object.keys(errors).length > 0) {
22
24
  notifications.push({
23
25
  level: 'error',
24
26
  message: 'Please fill in the required fields',
25
27
  });
26
28
  }
27
29
  return notifications;
28
- }, [
29
- formInstanceAvailable,
30
- formInstance?.formState.errors,
31
- formInstance?.formState.isSubmitted,
32
- readonly,
33
- ]);
30
+ }, [formInstanceAvailable, errors, isSubmitted, readonly]);
34
31
  }
@@ -1,2 +1,2 @@
1
- import { SaveMode } from '@headless-adminapp/core/experience/form';
1
+ import type { SaveMode } from '@headless-adminapp/core/experience/form';
2
2
  export declare function useFormSave(): (mode?: SaveMode) => Promise<void>;
@@ -1,2 +1,2 @@
1
- import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
2
2
  export declare function useDataFormSchema<S extends SchemaAttributes = SchemaAttributes>(): Schema<S>;
@@ -1,5 +1,5 @@
1
- import { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
2
- import { Schema } from '@headless-adminapp/core/schema';
1
+ import type { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
2
+ import type { Schema } from '@headless-adminapp/core/schema';
3
3
  type UseLoadMainFormPageResult = {
4
4
  loading: true;
5
5
  } | {
@@ -1,5 +1,5 @@
1
- import { EntityFormCommandContext } from '@headless-adminapp/core/experience/form';
2
- import { CommandItemState } from '../../command';
1
+ import type { EntityFormCommandContext } from '@headless-adminapp/core/experience/form';
2
+ import { type CommandItemState } from '../../command';
3
3
  export declare function useFormControlContext(): EntityFormCommandContext['primaryControl'];
4
4
  export declare function useMainFormCommandHandlerContext(): EntityFormCommandContext;
5
5
  export declare function useMainFormCommands(): CommandItemState[][];
@@ -23,10 +23,11 @@ function useFormControlContext() {
23
23
  const refresh = (0, context_1.useContextSelector)(context_2.DataFormContext, (state) => state.refresh);
24
24
  const formInstance = (0, useFormInstance_1.useFormInstance)();
25
25
  const readonly = (0, useFormIsReadonly_1.useFormIsReadonly)() ?? false;
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
27
  const data = formInstance.watch();
27
28
  const router = (0, route_1.useRouter)();
28
29
  const close = (0, react_1.useCallback)(() => {
29
- router.back();
30
+ void router.back();
30
31
  }, [router]);
31
32
  return {
32
33
  data,
@@ -4,7 +4,9 @@ exports.useOnFieldValueChangeListener = useOnFieldValueChangeListener;
4
4
  const react_1 = require("react");
5
5
  const constants_1 = require("../constants");
6
6
  const useEventManager_1 = require("./useEventManager");
7
- function useOnFieldValueChangeListener(key, callback) {
7
+ function useOnFieldValueChangeListener(key,
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ callback) {
8
10
  const eventManager = (0, useEventManager_1.useEventManager)();
9
11
  const callbackRef = (0, react_1.useRef)(callback);
10
12
  callbackRef.current = callback;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useProcessFlowSteps = useProcessFlowSteps;
4
4
  const command_1 = require("@headless-adminapp/app/command");
5
+ const react_hook_form_1 = require("react-hook-form");
5
6
  const context_1 = require("../../mutable/context");
6
7
  const context_2 = require("../context");
7
8
  const useFormInstance_1 = require("./useFormInstance");
@@ -17,7 +18,8 @@ function useFormControlContext() {
17
18
  const recordId = (0, useRecordId_1.useRecordId)();
18
19
  const formInstance = (0, useFormInstance_1.useFormInstance)();
19
20
  const readonly = (0, useFormIsReadonly_1.useFormIsReadonly)() ?? false;
20
- const data = formInstance.watch();
21
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
22
+ const data = (0, react_hook_form_1.useWatch)({ control: formInstance.control });
21
23
  return {
22
24
  data,
23
25
  logicalName: schema.logicalName,
@@ -1,3 +1,3 @@
1
- import { Form } from '@headless-adminapp/core/experience/form';
2
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { Form } from '@headless-adminapp/core/experience/form';
2
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
3
3
  export declare function useSelectedForm<S extends SchemaAttributes = SchemaAttributes>(): Form<S>;
@@ -1,6 +1,6 @@
1
- import { FormExperience } from '@headless-adminapp/core/experience/form';
2
- import { RouterInstance } from '@headless-adminapp/core/navigation';
3
- import { Schema } from '@headless-adminapp/core/schema';
1
+ import type { FormExperience } from '@headless-adminapp/core/experience/form';
2
+ import type { RouterInstance } from '@headless-adminapp/core/navigation';
3
+ import type { Schema } from '@headless-adminapp/core/schema';
4
4
  export declare function getFormDefaultParameters(schema: Schema, formExperience: FormExperience, router: RouterInstance): {
5
5
  [x: string]: any;
6
6
  };
@@ -29,7 +29,10 @@ function getFormDefaultParameters(schema, formExperience, router) {
29
29
  ...acc,
30
30
  [key]: defaultValue,
31
31
  };
32
- }, {});
32
+ },
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ {});
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
36
  let formDefaultValues = {};
34
37
  if (typeof formExperience.defaultValues === 'function') {
35
38
  formDefaultValues = formExperience.defaultValues();
@@ -1,12 +1,12 @@
1
1
  import type { Attribute } from '@headless-adminapp/core/attributes';
2
- import { Form, SectionEditableGridControl } from '@headless-adminapp/core/experience/form';
3
- import { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
- import { ISchemaStore } from '@headless-adminapp/core/store';
5
- import { Nullable } from '@headless-adminapp/core/types';
6
- import { MemoizedFunction } from 'lodash';
7
- import { ResolverResult } from 'react-hook-form';
2
+ import type { Form, SectionEditableGridControl } from '@headless-adminapp/core/experience/form';
3
+ import type { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
+ import type { ISchemaStore } from '@headless-adminapp/core/store';
5
+ import type { Nullable } from '@headless-adminapp/core/types';
6
+ import { type MemoizedFunction } from 'lodash';
7
+ import type { ResolverResult } from 'react-hook-form';
8
8
  import * as yup from 'yup';
9
- import { FormValidationStringSet } from '../../form/FormValidationStringContext';
9
+ import type { FormValidationStringSet } from '../../form/FormValidationStringContext';
10
10
  export { saveRecord } from './saveRecord';
11
11
  export declare function getInitialValues({ cloneRecord, form, record, recordId, schema, defaultParameters, }: {
12
12
  cloneRecord: InferredSchemaType<SchemaAttributes> | undefined;
@@ -52,7 +52,9 @@ function getInitialValues({ cloneRecord, form, record, recordId, schema, default
52
52
  // acc[item.attributeName] = item;
53
53
  // }
54
54
  return acc;
55
- }, {});
55
+ },
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ {});
56
58
  return allColumns.reduce((acc, column) => {
57
59
  const cloneAttributeInfo = cloneAttributesObj[column];
58
60
  // | EditableGridCloneAttribute; // TODO:
@@ -92,7 +94,9 @@ function getInitialValues({ cloneRecord, form, record, recordId, schema, default
92
94
  }, {});
93
95
  }
94
96
  return allColumns.reduce((acc, column) => {
95
- const value = record ? record[column] : defaultParameters[column] ?? null;
97
+ const value = record
98
+ ? record[column]
99
+ : (defaultParameters[column] ?? null);
96
100
  return {
97
101
  ...acc,
98
102
  [column]: value,
@@ -100,6 +104,7 @@ function getInitialValues({ cloneRecord, form, record, recordId, schema, default
100
104
  }, {});
101
105
  }
102
106
  exports.formValidator = (0, lodash_1.memoize)(function formValidator({ form, schema, readonlyAttributes, formReadOnly, schemaStore, language, strings, region, }) {
107
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
103
108
  return async (values, context, options) => {
104
109
  let validator = yup.object().shape({});
105
110
  if (!formReadOnly) {
@@ -159,7 +164,13 @@ exports.formValidator = (0, lodash_1.memoize)(function formValidator({ form, sch
159
164
  formReadOnly,
160
165
  }));
161
166
  exports.editableSubgridFormValidator = (0, lodash_1.memoize)(function formValidator({ schema, readonlyAttributes, formReadOnly, schemaStore, language, strings, region, control, alias, }) {
162
- return async (values, context, options) => {
167
+ return async (
168
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
169
+ values,
170
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171
+ context,
172
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
173
+ options) => {
163
174
  let validator = yup.object().shape({});
164
175
  if (!formReadOnly) {
165
176
  const controlSchema = schemaStore.getSchema(control.logicalName);
@@ -208,7 +219,9 @@ exports.generateValidationSchema = (0, lodash_1.memoize)(function generateValida
208
219
  ...acc,
209
220
  [column]: validationSchema,
210
221
  };
211
- }, {}),
222
+ },
223
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
224
+ {}),
212
225
  ...editableGrids?.reduce((acc, grid) => {
213
226
  let validationSchema = yup
214
227
  .array()
@@ -220,7 +233,9 @@ exports.generateValidationSchema = (0, lodash_1.memoize)(function generateValida
220
233
  ...acc,
221
234
  [column]: validationSchema,
222
235
  };
223
- }, {}),
236
+ },
237
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
238
+ {}),
224
239
  }))
225
240
  .nullable();
226
241
  if (grid.required) {
@@ -230,7 +245,9 @@ exports.generateValidationSchema = (0, lodash_1.memoize)(function generateValida
230
245
  }
231
246
  acc[grid.attributeName] = validationSchema;
232
247
  return acc;
233
- }, {}),
248
+ },
249
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
250
+ {}),
234
251
  });
235
252
  }, ({ columns, editableGrids, language, schema, strings, readonlyAttributes, region, }) => JSON.stringify({
236
253
  schema,
@@ -289,6 +306,7 @@ function extendAttributeValidationSchema({ attribute, validationSchema, label, s
289
306
  case 'attachments':
290
307
  validationSchema = extendAttributeAttachmentsValidationSchema({
291
308
  attribute,
309
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
292
310
  validationSchema: validationSchema,
293
311
  label,
294
312
  strings,
@@ -350,7 +368,9 @@ function extendAttributeAttachmentsValidationSchema({ attribute, validationSchem
350
368
  if (!value) {
351
369
  return true;
352
370
  }
353
- return value.every((file) => file?.size && file.size <= attribute.maxSize);
371
+ return value.every(
372
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
373
+ (file) => file?.size && file.size <= attribute.maxSize);
354
374
  });
355
375
  }
356
376
  return validationSchema;
@@ -398,10 +418,13 @@ exports.generateAttributesValidationSchema = (0, lodash_1.memoize)(function gene
398
418
  ...acc,
399
419
  [column]: validationSchema,
400
420
  };
401
- }, {}),
421
+ },
422
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
423
+ {}),
402
424
  });
403
425
  }, (options) => JSON.stringify(options));
404
426
  exports.attributesFormValidator = (0, lodash_1.memoize)(function formValidator({ attributes, language, strings, region, }) {
427
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
405
428
  return async (values, context, options) => {
406
429
  const validator = (0, exports.generateAttributesValidationSchema)({
407
430
  attributes,
@@ -1,9 +1,9 @@
1
- import { Id } from '@headless-adminapp/core';
2
- import { Form, SectionEditableGridControl } from '@headless-adminapp/core/experience/form';
3
- import { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
- import { ISchemaStore } from '@headless-adminapp/core/store';
5
- import { IDataService } from '@headless-adminapp/core/transport';
6
- import { Nullable } from '@headless-adminapp/core/types';
1
+ import type { Id } from '@headless-adminapp/core';
2
+ import type { Form, SectionEditableGridControl } from '@headless-adminapp/core/experience/form';
3
+ import type { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
4
+ import type { ISchemaStore } from '@headless-adminapp/core/store';
5
+ import type { IDataService } from '@headless-adminapp/core/transport';
6
+ import type { Nullable } from '@headless-adminapp/core/types';
7
7
  export declare function getModifiedValues(initialValues: any, values: any, exclude?: string[]): Record<string, any>;
8
8
  export type SaveRecordResult = {
9
9
  success: true;
@@ -4,7 +4,11 @@ exports.getModifiedValues = getModifiedValues;
4
4
  exports.saveRecord = saveRecord;
5
5
  exports.saveEditableGridControl = saveEditableGridControl;
6
6
  const utils_1 = require("../DataFormProvider/utils");
7
- function getModifiedValues(initialValues, values, exclude) {
7
+ function getModifiedValues(
8
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9
+ initialValues,
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ values, exclude) {
8
12
  const keys = Object.keys(values);
9
13
  return keys.reduce((p, c) => {
10
14
  if (c === '_id') {
@@ -17,7 +21,9 @@ function getModifiedValues(initialValues, values, exclude) {
17
21
  p[c] = values[c];
18
22
  }
19
23
  return p;
20
- }, {});
24
+ },
25
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
+ {});
21
27
  }
22
28
  async function executeOperation(operation, dataService) {
23
29
  switch (operation.type) {
@@ -34,7 +40,9 @@ async function executeOperation(operation, dataService) {
34
40
  function generateSubgridUpdateOperation({ recordId, control, schemaStore, values, initialValues, alias, }) {
35
41
  const operations = [];
36
42
  const gridSchema = schemaStore.getSchema(control.logicalName);
43
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
44
  const gridRows = values[alias];
45
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
46
  const initialGridRows = initialValues[alias];
39
47
  const newRows = gridRows.filter((x) => !x[gridSchema.idAttribute]);
40
48
  const updatedRows = gridRows.filter((x) => x[gridSchema.idAttribute]);
@@ -85,6 +93,7 @@ async function createRecord({ values, form, schema, dataService, }) {
85
93
  const result = await dataService.createRecord(schema.logicalName, values);
86
94
  const recordId = result.id;
87
95
  for (const control of editableGridControls) {
96
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
88
97
  const gridRows = values[control.alias];
89
98
  for (const row of gridRows) {
90
99
  await dataService.createRecord(control.logicalName, {
@@ -1,2 +1,2 @@
1
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
2
2
  export declare function DataResolver<S extends SchemaAttributes = SchemaAttributes>(): null;
@@ -1,9 +1,9 @@
1
- import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
- import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
3
- import { EntityMainGridCommandContext, EntitySubGridCommandContext, View } from '@headless-adminapp/core/experience/view';
4
- import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
5
- import { Filter } from '@headless-adminapp/core/transport';
6
- import { PropsWithChildren } from 'react';
1
+ import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
+ import type { CommandItemExperience } from '@headless-adminapp/core/experience/command';
3
+ import type { EntityMainGridCommandContext, EntitySubGridCommandContext, View } from '@headless-adminapp/core/experience/view';
4
+ import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
5
+ import type { Filter } from '@headless-adminapp/core/transport';
6
+ import { type PropsWithChildren } from 'react';
7
7
  export interface DataGridProviderProps<S extends SchemaAttributes = SchemaAttributes, CommandContext extends EntityMainGridCommandContext | EntitySubGridCommandContext = EntityMainGridCommandContext> {
8
8
  schema: Schema<S>;
9
9
  views: LocalizedDataLookup[];
@@ -1,5 +1,5 @@
1
- import { ViewColumn } from '@headless-adminapp/core/experience/view';
2
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
3
- import { ISchemaStore } from '@headless-adminapp/core/store';
4
- import { TransformedViewColumn } from '../context';
1
+ import type { ViewColumn } from '@headless-adminapp/core/experience/view';
2
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
3
+ import type { ISchemaStore } from '@headless-adminapp/core/store';
4
+ import type { TransformedViewColumn } from '../context';
5
5
  export declare function transformViewColumns<S extends SchemaAttributes>(logicalName: string, columns: ViewColumn<S>[], schemaStore: ISchemaStore, language: string): TransformedViewColumn<S>[];
@@ -1,5 +1,5 @@
1
- import { MutableValue } from '@headless-adminapp/app/mutable';
2
- import { EntityMainGridCommandContext, EntitySubGridCommandContext } from '@headless-adminapp/core/experience/view';
3
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
4
- import { GridContextState } from '../context';
1
+ import { type MutableValue } from '@headless-adminapp/app/mutable';
2
+ import type { EntityMainGridCommandContext, EntitySubGridCommandContext } from '@headless-adminapp/core/experience/view';
3
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
4
+ import type { GridContextState } from '../context';
5
5
  export declare function useGridCellRangeResolver<S extends SchemaAttributes = SchemaAttributes, CommandContext extends EntityMainGridCommandContext | EntitySubGridCommandContext = EntityMainGridCommandContext>(context: MutableValue<GridContextState<S, CommandContext>>): void;
@@ -1,8 +1,8 @@
1
- import { CardView, ColumnCondition } from '@headless-adminapp/core/experience/view';
2
- import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
3
- import { ISchemaStore } from '@headless-adminapp/core/store';
4
- import { Filter } from '@headless-adminapp/core/transport';
5
- import { TransformedViewColumn } from '../context';
1
+ import type { CardView, ColumnCondition } from '@headless-adminapp/core/experience/view';
2
+ import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
3
+ import type { ISchemaStore } from '@headless-adminapp/core/store';
4
+ import type { Filter } from '@headless-adminapp/core/transport';
5
+ import type { TransformedViewColumn } from '../context';
6
6
  export declare function transformColumnFilter<S extends SchemaAttributes = SchemaAttributes>(filter: Partial<Record<string, ColumnCondition>>, schema: Schema<S>, schemaStore: ISchemaStore): Record<string, ColumnCondition> | null;
7
7
  export declare function mergeConditions<S extends SchemaAttributes = SchemaAttributes>(schema: Schema<S>, filter: Filter | null | undefined, extraFilter: Filter | null | undefined, quickFilterResults: Filter | null | undefined, columnFilters: Partial<Record<string, ColumnCondition>> | undefined, schemaStore: ISchemaStore): Filter | null;
8
8
  export declare function mergeFilters(...filters: Array<Filter | null | undefined>): Filter | null;
@@ -30,6 +30,7 @@ function transformColumnFilter(filter, schema, schemaStore) {
30
30
  return acc;
31
31
  }
32
32
  if (value) {
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
34
  let transformedValue = undefined;
34
35
  switch (value.operator) {
35
36
  case 'eq':
@@ -56,6 +57,7 @@ function transformColumnFilter(filter, schema, schemaStore) {
56
57
  case 'in':
57
58
  case 'not-in':
58
59
  if (attribute.type === 'lookup') {
60
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
61
  transformedValue = value.value[0].map((x) => x.id);
60
62
  }
61
63
  else {
@@ -134,6 +136,7 @@ function mergeFilters(...filters) {
134
136
  };
135
137
  }
136
138
  function simplyfyFilter(filter) {
139
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
140
  const conditions = filter.conditions ?? [];
138
141
  const filters = [];
139
142
  if (filter.filters) {
@@ -1,4 +1,4 @@
1
1
  import type { AttributeType } from '@headless-adminapp/core/attributes';
2
- import { OperatorOptionConfig, OperatorStrings } from './types';
2
+ import type { OperatorOptionConfig, OperatorStrings } from './types';
3
3
  export declare const defaultOperatorStrings: OperatorStrings;
4
4
  export declare const operatorOptions: Record<AttributeType, OperatorOptionConfig[]>;
@@ -1,3 +1,3 @@
1
1
  import type { AttributeType } from '@headless-adminapp/core/attributes';
2
- import { OperatorOption, OperatorStrings } from './types';
2
+ import type { OperatorOption, OperatorStrings } from './types';
3
3
  export declare const getLocalizedOperatorOptions: (strings: OperatorStrings) => Record<AttributeType, OperatorOption[]>;
@@ -1,9 +1,9 @@
1
- import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
- import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
3
- import { ColumnCondition, EntityMainGridCommandContext, EntitySubGridCommandContext, SortingState, View } from '@headless-adminapp/core/experience/view';
1
+ import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
+ import type { CommandItemExperience } from '@headless-adminapp/core/experience/command';
3
+ import type { ColumnCondition, EntityMainGridCommandContext, EntitySubGridCommandContext, SortingState, View } from '@headless-adminapp/core/experience/view';
4
4
  import { type TransformedViewColumn } from '@headless-adminapp/core/experience/view/ViewColumn';
5
- import { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
6
- import { Filter, RetriveRecordsResult } from '@headless-adminapp/core/transport';
5
+ import type { InferredSchemaType, Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
6
+ import type { Filter, RetriveRecordsResult } from '@headless-adminapp/core/transport';
7
7
  export { type TransformedViewColumn } from '@headless-adminapp/core/experience/view/ViewColumn';
8
8
  export interface GridContextState<S extends SchemaAttributes = SchemaAttributes, CommandContext extends EntityMainGridCommandContext | EntitySubGridCommandContext = EntityMainGridCommandContext> {
9
9
  schema: Schema<S>;
@@ -1,2 +1,2 @@
1
- import { ColumnCondition } from '@headless-adminapp/core/experience/view';
1
+ import type { ColumnCondition } from '@headless-adminapp/core/experience/view';
2
2
  export declare function useGridColumnFilter(): readonly [Partial<Record<string, ColumnCondition>>, (columnName: string, value: ColumnCondition | undefined) => void, (columnFilters: Partial<Record<string, ColumnCondition>>) => void];
@@ -1,3 +1,3 @@
1
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
2
- import { TransformedViewColumn } from '../context';
1
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
2
+ import { type TransformedViewColumn } from '../context';
3
3
  export declare function useGridColumns<S extends SchemaAttributes = SchemaAttributes>(): TransformedViewColumn<S>[];
@@ -1,5 +1,5 @@
1
- import { CommandItemExperience } from '@headless-adminapp/core/experience/command';
2
- import { EntityMainGridCommandContext, EntitySubGridCommandContext } from '@headless-adminapp/core/experience/view';
1
+ import type { CommandItemExperience } from '@headless-adminapp/core/experience/command';
2
+ import type { EntityMainGridCommandContext, EntitySubGridCommandContext } from '@headless-adminapp/core/experience/view';
3
3
  /**
4
4
  * @deprecated
5
5
  */
@@ -2,5 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useDataGridOptions = useDataGridOptions;
4
4
  function useDataGridOptions() {
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
6
  return null;
6
7
  }
@@ -2,5 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGridPagination = useGridPagination;
4
4
  function useGridPagination() {
5
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
6
  return null;
6
7
  }
@@ -1,2 +1,2 @@
1
- import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
2
2
  export declare function useDataGridSchema<S extends SchemaAttributes = SchemaAttributes>(): Schema<S>;
@@ -1,3 +1,3 @@
1
- import { SortingState } from '@headless-adminapp/core/experience/view';
2
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { SortingState } from '@headless-adminapp/core/experience/view';
2
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
3
3
  export declare function useGridSorting<S extends SchemaAttributes = SchemaAttributes>(): readonly [SortingState<SchemaAttributes>, (value: SortingState<S>) => void];
@@ -8,6 +8,7 @@ function useGridSorting() {
8
8
  const sorting = (0, context_1.useContextSelector)(context_2.GridContext, (state) => state.sorting);
9
9
  const setValue = (0, context_1.useContextSetValue)(context_2.GridContext);
10
10
  const setSorting = (0, react_1.useCallback)((value) => {
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
12
  setValue({ sorting: value });
12
13
  }, [setValue]);
13
14
  return [sorting, setSorting];
@@ -1,6 +1,6 @@
1
- import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
- import { EntityMainGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
3
- import { Schema } from '@headless-adminapp/core/schema';
1
+ import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
2
+ import type { EntityMainGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
3
+ import type { Schema } from '@headless-adminapp/core/schema';
4
4
  type UseLoadMainGridPageResult = {
5
5
  loading: true;
6
6
  } | {
@@ -1,5 +1,5 @@
1
- import { EntityMainGridCommandContext } from '@headless-adminapp/core/experience/view';
2
- import { CommandItemState, MenuItemCommandState, UtilityContextState } from '../../command/types';
1
+ import type { EntityMainGridCommandContext } from '@headless-adminapp/core/experience/view';
2
+ import type { CommandItemState, MenuItemCommandState, UtilityContextState } from '../../command/types';
3
3
  export declare function useUtility(): UtilityContextState;
4
4
  export declare function useGridControlContext(): EntityMainGridCommandContext['primaryControl'];
5
5
  export declare function useMainGridCommandHandlerContext(): EntityMainGridCommandContext;
@@ -35,8 +35,10 @@ function useUtility() {
35
35
  hideProgressIndicator,
36
36
  showProgressIndicator,
37
37
  openAlertDialog,
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
39
  openConfirmDialog: openConfirmDialog,
39
40
  openErrorDialog,
41
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
42
  openPromptDialog: openPromptDialog,
41
43
  showNotification: openToastNotification,
42
44
  };
@@ -1,3 +1,3 @@
1
- import { View } from '@headless-adminapp/core/experience/view';
2
- import { SchemaAttributes } from '@headless-adminapp/core/schema';
1
+ import type { View } from '@headless-adminapp/core/experience/view';
2
+ import type { SchemaAttributes } from '@headless-adminapp/core/schema';
3
3
  export declare function useSelectedView<S extends SchemaAttributes = SchemaAttributes>(): View<S>;
@@ -1,5 +1,5 @@
1
- import { EntitySubGridCommandContext } from '@headless-adminapp/core/experience/view';
2
- import { CommandItemState, MenuItemCommandState } from '../../command/types';
1
+ import type { EntitySubGridCommandContext } from '@headless-adminapp/core/experience/view';
2
+ import type { CommandItemState, MenuItemCommandState } from '../../command/types';
3
3
  export declare function useSubGridCommandHandlerContext(): EntitySubGridCommandContext;
4
4
  export declare function useSubGridCommands(): CommandItemState[][];
5
5
  export declare function useSubGridContextCommands(): MenuItemCommandState[][];
@@ -1,4 +1,4 @@
1
- import { FC, PropsWithChildren } from 'react';
1
+ import type { FC, PropsWithChildren } from 'react';
2
2
  interface DialogProviderProps {
3
3
  }
4
4
  export declare const DialogProvider: FC<PropsWithChildren<DialogProviderProps>>;