@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.
- package/app/AppProvider.d.ts +1 -1
- package/app/AuthWrapper.d.ts +2 -2
- package/app/LayoutProvider.d.ts +7 -7
- package/app/context.d.ts +2 -2
- package/app/hooks/useAppContext.d.ts +1 -1
- package/auth/AuthProvider.d.ts +2 -2
- package/auth/context.d.ts +1 -1
- package/auth/hooks/useAuthSession.d.ts +1 -1
- package/auth/index.d.ts +1 -1
- package/auth/index.js +0 -1
- package/auth/types.d.ts +1 -1
- package/board/BoardColumnProvider.d.ts +2 -2
- package/board/context.d.ts +1 -1
- package/board/hooks/useBoardColumnConfig.d.ts +1 -1
- package/board/hooks/useBoardColumnData.d.ts +2 -2
- package/board/hooks/useBoardConfig.d.ts +2 -2
- package/board/hooks/useBoardSchema.d.ts +1 -1
- package/board/types.d.ts +7 -7
- package/board/utils.d.ts +2 -2
- package/builders/CommandBuilder/DefaultCommandBuilder.d.ts +4 -4
- package/builders/CommandBuilder/FormCommandBuilder.d.ts +3 -3
- package/builders/CommandBuilder/SubgridCommandBuilder.d.ts +3 -3
- package/builders/CommandBuilder/ViewCommandBuilder.d.ts +3 -3
- package/builders/CommandBuilder/ViewCommandBuilder.js +7 -3
- package/builders/CommandBuilder/utils.d.ts +1 -1
- package/builders/SchemaExperienceBuilder.d.ts +4 -4
- package/builders/utils.d.ts +6 -6
- package/builders/utils.js +5 -1
- package/calendar/CalendarProvider.d.ts +3 -3
- package/calendar/context.d.ts +1 -1
- package/calendar/hooks/useConfig.d.ts +2 -2
- package/calendar/hooks/useOpenDetailDialog.d.ts +1 -1
- package/calendar/types.d.ts +5 -5
- package/calendar/utils.d.ts +2 -2
- package/command/hooks/useBaseCommandHandlerContext.d.ts +2 -2
- package/command/hooks/useBaseCommandHandlerContext.js +10 -2
- package/command/hooks/useCommands.d.ts +2 -2
- package/command/index.d.ts +1 -1
- package/command/index.js +0 -1
- package/command/types.d.ts +5 -5
- package/command/utils/index.d.ts +2 -2
- package/components/ScrollView/index.d.ts +1 -1
- package/components/ScrollbarWithMoreDataRequest/index.d.ts +1 -1
- package/dataform/DataFormProvider/CalculatedField.d.ts +1 -1
- package/dataform/DataFormProvider/CalculatedField.js +1 -0
- package/dataform/DataFormProvider/DataResolver.d.ts +2 -2
- package/dataform/DataFormProvider/DataResolver.js +1 -0
- package/dataform/DataFormProvider/UnsavedChangesInfoSetter.d.ts +1 -1
- package/dataform/DataFormProvider/getRecord.d.ts +5 -5
- package/dataform/DataFormProvider/getRecord.js +1 -0
- package/dataform/DataFormProvider/index.d.ts +5 -5
- package/dataform/DataFormProvider/index.js +1 -0
- package/dataform/DataFormProvider/types.d.ts +4 -4
- package/dataform/DataFormProvider/utils.d.ts +6 -6
- package/dataform/FormManager.d.ts +7 -7
- package/dataform/context.d.ts +8 -8
- package/dataform/hooks/useFormNotifications.d.ts +5 -3
- package/dataform/hooks/useFormNotifications.js +5 -8
- package/dataform/hooks/useFormSave.d.ts +1 -1
- package/dataform/hooks/useFormSchema.d.ts +1 -1
- package/dataform/hooks/useLoadFormGridPage.d.ts +2 -2
- package/dataform/hooks/useMainFormCommands.d.ts +2 -2
- package/dataform/hooks/useMainFormCommands.js +2 -1
- package/dataform/hooks/useOnFieldValueChangeListener.js +3 -1
- package/dataform/hooks/useProcessFlowSteps.js +3 -1
- package/dataform/hooks/useSelectedForm.d.ts +2 -2
- package/dataform/utils/defaultParameters.d.ts +3 -3
- package/dataform/utils/defaultParameters.js +4 -1
- package/dataform/utils/index.d.ts +7 -7
- package/dataform/utils/index.js +31 -8
- package/dataform/utils/saveRecord.d.ts +6 -6
- package/dataform/utils/saveRecord.js +11 -2
- package/datagrid/DataGridProvider/DataResolver.d.ts +1 -1
- package/datagrid/DataGridProvider/index.d.ts +6 -6
- package/datagrid/DataGridProvider/transformViewColumns.d.ts +4 -4
- package/datagrid/DataGridProvider/useGridCellRangeResolver.d.ts +4 -4
- package/datagrid/DataGridProvider/utils.d.ts +5 -5
- package/datagrid/DataGridProvider/utils.js +3 -0
- package/datagrid/column-filter/constants.d.ts +1 -1
- package/datagrid/column-filter/utils.d.ts +1 -1
- package/datagrid/context.d.ts +5 -5
- package/datagrid/hooks/useGridColumnFilter.d.ts +1 -1
- package/datagrid/hooks/useGridColumns.d.ts +2 -2
- package/datagrid/hooks/useGridCommands.d.ts +2 -2
- package/datagrid/hooks/useGridOptions.js +1 -0
- package/datagrid/hooks/useGridPagination.js +1 -0
- package/datagrid/hooks/useGridSchema.d.ts +1 -1
- package/datagrid/hooks/useGridSorting.d.ts +2 -2
- package/datagrid/hooks/useGridSorting.js +1 -0
- package/datagrid/hooks/useLoadMainGridPage.d.ts +3 -3
- package/datagrid/hooks/useMainGridCommands.d.ts +2 -2
- package/datagrid/hooks/useMainGridCommands.js +2 -0
- package/datagrid/hooks/useSelectedView.d.ts +2 -2
- package/datagrid/hooks/useSubGridCommands.d.ts +2 -2
- package/dialog/DialogProvider.d.ts +1 -1
- package/dialog/context.d.ts +1 -1
- package/dialog/hooks/useOpenAlertDialog.d.ts +1 -1
- package/dialog/hooks/useOpenConfirmDialog.d.ts +1 -1
- package/dialog/hooks/useOpenDialog.d.ts +1 -1
- package/dialog/hooks/useOpenErrorDialog.d.ts +1 -1
- package/dialog/hooks/useOpenPromptDialog.d.ts +2 -2
- package/header/HeaderProvider.d.ts +1 -1
- package/header/components/MobileHeaderLeftContent.d.ts +1 -1
- package/header/components/MobileHeaderRightContent.d.ts +1 -1
- package/header/components/MobileHeaderTitle.d.ts +1 -1
- package/header/hooks/useHeaderValue.d.ts +1 -1
- package/header/hooks/useMobileHeaderSetValue.d.ts +1 -1
- package/historystate/provider.d.ts +1 -1
- package/hooks/useDebouncedValue.js +5 -2
- package/hooks/useElementLayout.d.ts +2 -2
- package/hooks/useItemsWithKey.d.ts +1 -1
- package/hooks/useLongPress.js +4 -2
- package/hooks/useStorageState.d.ts +1 -1
- package/insights/context.d.ts +1 -1
- package/insights/hooks/index.d.ts +2 -2
- package/insights/hooks/index.js +1 -0
- package/locale/LocaleProvider.d.ts +2 -2
- package/locale/context.d.ts +1 -1
- package/locale/utils.d.ts +1 -1
- package/metadata/MetadataProvider.d.ts +5 -5
- package/metadata/context.d.ts +2 -2
- package/metadata/hooks/useExperienceView.d.ts +1 -1
- package/metadata/hooks/useExperienceView.js +3 -1
- package/metadata/hooks/useMetadata.d.ts +1 -1
- package/metadata/hooks/useRecentItemStore.d.ts +1 -1
- package/metadata/hooks/useSchema.d.ts +1 -1
- package/mutable/context.d.ts +1 -1
- package/mutable/context.js +1 -0
- package/mutable/index.d.ts +1 -1
- package/mutable/index.js +0 -15
- package/mutable/state.d.ts +1 -1
- package/mutable/utils.d.ts +1 -1
- package/mutable/utils.js +1 -1
- package/navigation/hooks/useOpenForm.d.ts +1 -1
- package/navigation/unsaved-changes/useUnsavedChangesRouteGuard.js +1 -0
- package/package.json +3 -3
- package/progress-indicator/ProgressIndicatorProvider.d.ts +1 -1
- package/progress-indicator/ProgressIndicatorProvider.js +1 -1
- package/progress-indicator/context.js +3 -1
- package/providers/PageEntityFormProvider/index.d.ts +5 -5
- package/providers/PageEntityViewProvider/index.d.ts +4 -4
- package/quickcreate/QuickCreateProvider.d.ts +1 -1
- package/quickcreate/context.d.ts +2 -2
- package/quickcreate/hooks/useFormSave.d.ts +1 -1
- package/quickcreate/hooks/useOpenQuickCreate.d.ts +2 -2
- package/recordset/RecordSetProvider.d.ts +1 -1
- package/recordset/RecordSetProvider.js +1 -1
- package/recordset/context.d.ts +1 -1
- package/recordset/hooks/useRecordSetResult.d.ts +1 -1
- package/route/RouteProvider.d.ts +4 -4
- package/route/context.d.ts +3 -3
- package/route/context.js +8 -2
- package/store/ComponentStore.d.ts +1 -1
- package/store/EventManager.d.ts +1 -1
- package/store/EventManager.js +1 -0
- package/store/RecentItemStore.d.ts +1 -1
- package/store/SchemaExperienceStore.d.ts +6 -6
- package/store/SchemaExperienceStore.js +2 -2
- package/toast-notification/ToastNotificationProvider.d.ts +1 -1
- package/toast-notification/hooks/useOpenToastNotification.d.ts +1 -1
- package/transport/InMemoryDataService/index.d.ts +3 -3
- package/transport/InMemoryDataService/index.js +5 -0
- package/transport/RestDataService/index.d.ts +2 -2
- package/transport/context.d.ts +1 -1
- package/transport/hooks/useCustomActionQuery.d.ts +2 -1
- package/transport/hooks/useDataService.d.ts +1 -1
- package/transport/hooks/useRetriveRecords.d.ts +6 -16
- package/transport/hooks/useRetriveRecords.js +2 -1
- package/utils/getAttributeFormattedValue.d.ts +3 -3
- package/utils/getAttributeFormattedValue.js +20 -3
package/dialog/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicDialogProps, DialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
1
|
+
import type { BasicDialogProps, DialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
2
2
|
export type DialogItemState = BasicDialogProps & DialogOptions;
|
|
3
3
|
export interface DialogContextState {
|
|
4
4
|
items: DialogItemState[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
1
|
+
import type { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
2
2
|
export declare function useOpenAlertDialog(): (options: Omit<AlertDialogOptions, "type" | "onConfirm" | "onClose">) => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
1
|
+
import type { AlertDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
2
2
|
export declare function useOpenErrorDialog(): (options: Omit<AlertDialogOptions, "type" | "onConfirm" | "onClose">) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PromptDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
2
|
-
import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
1
|
+
import type { PromptDialogOptions } from '@headless-adminapp/core/experience/dialog';
|
|
2
|
+
import type { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
3
|
export declare function useOpenPromptDialog(): <SA extends SchemaAttributes = SchemaAttributes>(options: Omit<PromptDialogOptions<SA>, "type" | "onConfirm" | "onClose" | "onCancel">) => Promise<InferredSchemaType<SA> | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
2
|
export declare const HeaderProvider: FC<PropsWithChildren<{}>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HeaderStoreState } from '../context';
|
|
1
|
+
import { type HeaderStoreState } from '../context';
|
|
2
2
|
export declare function useHeaderValue<T>(field: keyof HeaderStoreState): T | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HeaderStoreState } from '../context';
|
|
1
|
+
import { type HeaderStoreState } from '../context';
|
|
2
2
|
export declare function useMobileHeaderSetValue<T>(value: T, order: number, field: keyof HeaderStoreState): void;
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useDebouncedValue = useDebouncedValue;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
function useDebouncedValue(value, wait, options = { leading: false }) {
|
|
6
7
|
const [internalValue, setInternalValue] = (0, react_1.useState)(value);
|
|
7
8
|
const mountedRef = (0, react_1.useRef)(false);
|
|
8
|
-
const timeoutRef = (0, react_1.useRef)();
|
|
9
|
+
const timeoutRef = (0, react_1.useRef)(null);
|
|
9
10
|
const cooldownRef = (0, react_1.useRef)(false);
|
|
10
|
-
const cancel = () =>
|
|
11
|
+
const cancel = () => {
|
|
12
|
+
timeoutRef.current && window.clearTimeout(timeoutRef.current);
|
|
13
|
+
};
|
|
11
14
|
(0, react_1.useEffect)(() => {
|
|
12
15
|
if (mountedRef.current) {
|
|
13
16
|
if (!cooldownRef.current && options.leading) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
2
|
interface ElementLayout {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
@@ -7,5 +7,5 @@ interface ElementLayout {
|
|
|
7
7
|
right: number;
|
|
8
8
|
bottom: number;
|
|
9
9
|
}
|
|
10
|
-
export declare function useElementSize(elementRef: RefObject<HTMLElement>, interval?: number): ElementLayout;
|
|
10
|
+
export declare function useElementSize(elementRef: RefObject<HTMLElement | null>, interval?: number): ElementLayout;
|
|
11
11
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ItemWithKey } from '@headless-adminapp/core/types';
|
|
1
|
+
import type { ItemWithKey } from '@headless-adminapp/core/types';
|
|
2
2
|
export declare function useItemsWithKey<T>(value: T[]): ItemWithKey<T>[];
|
|
3
3
|
export declare function useItemsWithKey(value: null): null;
|
|
4
4
|
export declare function useItemsWithKey(value: undefined): undefined;
|
package/hooks/useLongPress.js
CHANGED
|
@@ -14,8 +14,8 @@ const preventDefault = (ev) => {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
const useLongPress = (callback, { isPreventDefault = true, delay = 300 } = {}) => {
|
|
17
|
-
const timeout = (0, react_1.useRef)();
|
|
18
|
-
const target = (0, react_1.useRef)();
|
|
17
|
+
const timeout = (0, react_1.useRef)(null);
|
|
18
|
+
const target = (0, react_1.useRef)(null);
|
|
19
19
|
const start = (0, react_1.useCallback)((event) => {
|
|
20
20
|
// prevent ghost click on mobile devices
|
|
21
21
|
if (isPreventDefault && event.target) {
|
|
@@ -38,7 +38,9 @@ const useLongPress = (callback, { isPreventDefault = true, delay = 300 } = {}) =
|
|
|
38
38
|
};
|
|
39
39
|
}, [clear]);
|
|
40
40
|
return {
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
42
|
onMouseDown: (e) => start(e),
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
44
|
onTouchStart: (e) => start(e),
|
|
43
45
|
onMouseUp: clear,
|
|
44
46
|
onMouseLeave: clear,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
1
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
2
|
export declare function useStorageState<S = undefined>(initialState: S, key: string, store?: Storage): [S, Dispatch<SetStateAction<S>>];
|
package/insights/context.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InsightsState } from '@headless-adminapp/core/experience/insights';
|
|
1
|
+
import type { InsightsState } from '@headless-adminapp/core/experience/insights';
|
|
2
2
|
export declare const InsightsContext: import("react").Context<import("../mutable/context").ContextValue<InsightsState<import("@headless-adminapp/core/schema").SchemaAttributes>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InsightConfig, InsightsState } from '@headless-adminapp/core/experience/insights';
|
|
2
|
-
import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
1
|
+
import type { InsightConfig, InsightsState } from '@headless-adminapp/core/experience/insights';
|
|
2
|
+
import type { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
3
|
export declare function useInsightsState<S extends SchemaAttributes = SchemaAttributes>(): InsightsState<S>;
|
|
4
4
|
export declare function useInsightConfig<S extends SchemaAttributes = SchemaAttributes>(): InsightConfig<S>;
|
|
5
5
|
export declare function useInsightFilterValues<S extends SchemaAttributes = SchemaAttributes>(): InferredSchemaType<S>;
|
package/insights/hooks/index.js
CHANGED
|
@@ -16,6 +16,7 @@ function useInsightConfig() {
|
|
|
16
16
|
function useInsightFilterValues() {
|
|
17
17
|
return (0, mutable_1.useContextSelector)(context_1.InsightsContext, (state) => state.filterValues);
|
|
18
18
|
}
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
20
|
function useRefreshEventListener(callback) {
|
|
20
21
|
const eventManager = (0, mutable_1.useContextSelector)(context_1.InsightsContext, (state) => state.eventManager);
|
|
21
22
|
const callbackRef = (0, react_1.useRef)(callback);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Locale } from '@headless-adminapp/core/experience/locale';
|
|
2
|
-
import { FC, PropsWithChildren } from 'react';
|
|
1
|
+
import { type Locale } from '@headless-adminapp/core/experience/locale';
|
|
2
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
3
3
|
export interface LocaleProviderProps {
|
|
4
4
|
locale?: string;
|
|
5
5
|
timezone?: string;
|
package/locale/context.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Locale } from '@headless-adminapp/core/experience/locale';
|
|
1
|
+
import type { Locale } from '@headless-adminapp/core/experience/locale';
|
|
2
2
|
export declare const LocaleContext: import("react").Context<Locale | null>;
|
package/locale/utils.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AppExperience } from '@headless-adminapp/core/experience/app';
|
|
2
|
-
import { ISchemaExperienceStore, ISchemaStore, SchemaStore } from '@headless-adminapp/core/store';
|
|
3
|
-
import { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
|
|
4
|
-
import { FC, PropsWithChildren } from 'react';
|
|
5
|
-
import { IRecentItemStore, SchemaExperienceStore } from '../store';
|
|
1
|
+
import { type AppExperience } from '@headless-adminapp/core/experience/app';
|
|
2
|
+
import { type ISchemaExperienceStore, type ISchemaStore, SchemaStore } from '@headless-adminapp/core/store';
|
|
3
|
+
import type { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
|
|
4
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
5
|
+
import { type IRecentItemStore, SchemaExperienceStore } from '../store';
|
|
6
6
|
export interface MetadataProviderProps {
|
|
7
7
|
schemaStore?: ISchemaStore;
|
|
8
8
|
experienceStore?: ISchemaExperienceStore;
|
package/metadata/context.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppExperience } from '@headless-adminapp/core/experience/app';
|
|
2
2
|
import type { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
|
|
3
|
-
import { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
|
|
4
|
-
import { IRecentItemStore } from '../store';
|
|
3
|
+
import type { ICalculatedAttributeStore } from '@headless-adminapp/core/store/ICalculatedAttributeStore';
|
|
4
|
+
import type { IRecentItemStore } from '../store';
|
|
5
5
|
export interface MetadataContextState {
|
|
6
6
|
schemaStore: ISchemaStore;
|
|
7
7
|
experienceStore: ISchemaExperienceStore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { View, ViewExperience } from '@headless-adminapp/core/experience/view';
|
|
1
|
+
import type { View, ViewExperience } from '@headless-adminapp/core/experience/view';
|
|
2
2
|
export declare function useExperienceView(logicalName: string, viewId?: string, associated?: boolean, viewIds?: string[], view?: ViewExperience<any>): {
|
|
3
3
|
view: View<import("@headless-adminapp/core/schema").SchemaAttributes> | undefined;
|
|
4
4
|
isLoadingView: boolean;
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useExperienceView = useExperienceView;
|
|
4
4
|
const react_query_1 = require("@tanstack/react-query");
|
|
5
5
|
const useExperienceStore_1 = require("./useExperienceStore");
|
|
6
|
-
function useExperienceView(logicalName, viewId, associated, viewIds,
|
|
6
|
+
function useExperienceView(logicalName, viewId, associated, viewIds,
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
view) {
|
|
7
9
|
const experienceStore = (0, useExperienceStore_1.useExperienceStore)();
|
|
8
10
|
const { data, isPending } = (0, react_query_1.useQuery)({
|
|
9
11
|
queryKey: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRecentItemStore } from '@headless-adminapp/app/store';
|
|
1
|
+
import type { IRecentItemStore } from '@headless-adminapp/app/store';
|
|
2
2
|
import type { AppExperience } from '@headless-adminapp/core/experience/app';
|
|
3
3
|
import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
4
4
|
import type { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IRecentItemStore } from '../../store/RecentItemStore';
|
|
1
|
+
import type { IRecentItemStore } from '../../store/RecentItemStore';
|
|
2
2
|
export declare function useRecentItemStore(): IRecentItemStore;
|
|
@@ -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 useSchema<S extends SchemaAttributes = SchemaAttributes>(logicalName: string): import("@headless-adminapp/core/schema").Schema<S> | null;
|
package/mutable/context.d.ts
CHANGED
package/mutable/context.js
CHANGED
|
@@ -12,6 +12,7 @@ const utils_1 = require("./utils");
|
|
|
12
12
|
const createContextValue = utils_1.createMutableValue;
|
|
13
13
|
exports.useContextSelectorInternal = utils_1.useMutableValueSelector;
|
|
14
14
|
function createContext() {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
16
|
const context = (0, react_1.createContext)(null);
|
|
16
17
|
return context;
|
|
17
18
|
}
|
package/mutable/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { createContext, useContextSelector, useContextSetValue, useCreateContextStore, useContextValueSetter, type ContextValue, } from './context';
|
|
2
2
|
export { useMutableState, useMutableStateSelector, type MutableState, } from './state';
|
|
3
|
-
export * from './type';
|
|
3
|
+
export type * from './type';
|
package/mutable/index.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.useMutableStateSelector = exports.useMutableState = exports.useContextValueSetter = exports.useCreateContextStore = exports.useContextSetValue = exports.useContextSelector = exports.createContext = void 0;
|
|
18
4
|
var context_1 = require("./context");
|
|
@@ -24,4 +10,3 @@ Object.defineProperty(exports, "useContextValueSetter", { enumerable: true, get:
|
|
|
24
10
|
var state_1 = require("./state");
|
|
25
11
|
Object.defineProperty(exports, "useMutableState", { enumerable: true, get: function () { return state_1.useMutableState; } });
|
|
26
12
|
Object.defineProperty(exports, "useMutableStateSelector", { enumerable: true, get: function () { return state_1.useMutableStateSelector; } });
|
|
27
|
-
__exportStar(require("./type"), exports);
|
package/mutable/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MutableValue } from './type';
|
|
1
|
+
import type { MutableValue } from './type';
|
|
2
2
|
import { createMutableValue, useMutableValueSelector } from './utils';
|
|
3
3
|
export type MutableState<T> = MutableValue<T>;
|
|
4
4
|
export declare const createMutableState: typeof createMutableValue;
|
package/mutable/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MutableValue } from './type';
|
|
1
|
+
import type { MutableValue } from './type';
|
|
2
2
|
export declare function createMutableValue<T>(initialValue: T | (() => T), isArray?: boolean): MutableValue<T>;
|
|
3
3
|
export declare function useMutableValueSelector<T, R>(mutableValue: MutableValue<T>, selector: (state: T) => R): R;
|
package/mutable/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.createMutableValue = createMutableValue;
|
|
|
4
4
|
exports.useMutableValueSelector = useMutableValueSelector;
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
function createMutableValue(initialValue, isArray) {
|
|
7
|
-
|
|
7
|
+
const storeValue = {
|
|
8
8
|
current: typeof initialValue === 'function'
|
|
9
9
|
? initialValue()
|
|
10
10
|
: initialValue,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { OpenFormOptions } from '@headless-adminapp/core/experience/command';
|
|
1
|
+
import type { OpenFormOptions } from '@headless-adminapp/core/experience/command';
|
|
2
2
|
export declare function useOpenForm(): (options: OpenFormOptions) => Promise<void>;
|
|
@@ -36,6 +36,7 @@ function useUnsavedChangesRouteGuard() {
|
|
|
36
36
|
const unsavedChangesInfo = (0, unsavedChangesInfo_1.getUnsavedChangesInfo)();
|
|
37
37
|
if (unsavedChangesInfo) {
|
|
38
38
|
event.preventDefault();
|
|
39
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
39
40
|
event.returnValue = unsavedChangesInfo.message;
|
|
40
41
|
}
|
|
41
42
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@headless-adminapp/app",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"exceljs": "^4.4.0",
|
|
32
32
|
"json-to-csv-export": "^2.1.1",
|
|
33
33
|
"libphonenumber-js": "1.11.20",
|
|
34
|
-
"lodash": "^4.
|
|
34
|
+
"lodash": "^4.18.0",
|
|
35
35
|
"react-custom-scrollbars-2": "^4.5.0",
|
|
36
36
|
"react-hook-form": "7.52.2",
|
|
37
37
|
"react-use": "17.6.0",
|
|
38
38
|
"uuid": "11.0.3",
|
|
39
39
|
"yup": "^1.4.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "fb3bf47203b51c020b363e1cc4aa3aa20a98d538"
|
|
42
42
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
2
2
|
export declare const ProgressIndicatorProvider: FC<PropsWithChildren>;
|
|
@@ -8,7 +8,7 @@ const ProgressIndicatorProvider = ({ children, }) => {
|
|
|
8
8
|
const [overlayVisible, setOverlayVisible] = (0, react_1.useState)(false);
|
|
9
9
|
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
10
10
|
const [message, setMessage] = (0, react_1.useState)(undefined);
|
|
11
|
-
const showTimeoutRef = (0, react_1.useRef)();
|
|
11
|
+
const showTimeoutRef = (0, react_1.useRef)(undefined);
|
|
12
12
|
const showProgressIndicator = (0, react_1.useCallback)((message, delay) => {
|
|
13
13
|
setOverlayVisible(true);
|
|
14
14
|
setMessage(message);
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProgressIndicatorContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
exports.ProgressIndicatorContext =
|
|
5
|
+
exports.ProgressIndicatorContext =
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
(0, react_1.createContext)(null);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
|
|
2
|
-
import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
|
-
import { PropsWithChildren } from 'react';
|
|
4
|
-
import { RetriveRecordFn } from '../../dataform/DataFormProvider/types';
|
|
5
|
-
import { SaveRecordFn } from '../../dataform/utils/saveRecord';
|
|
1
|
+
import type { EntityMainFormCommandItemExperience, Form } from '@headless-adminapp/core/experience/form';
|
|
2
|
+
import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
3
|
+
import type { PropsWithChildren } from 'react';
|
|
4
|
+
import type { RetriveRecordFn } from '../../dataform/DataFormProvider/types';
|
|
5
|
+
import type { SaveRecordFn } from '../../dataform/utils/saveRecord';
|
|
6
6
|
interface PageEntityFormProviderProps<S extends SchemaAttributes> {
|
|
7
7
|
schema: Schema<S>;
|
|
8
8
|
form: Form<S>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import { EntityMainGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
|
|
3
|
-
import { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
4
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
+
import type { EntityMainGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
|
|
3
|
+
import type { Schema, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
4
|
+
import type { PropsWithChildren } from 'react';
|
|
5
5
|
interface PageEntityViewProviderProps<S extends SchemaAttributes> {
|
|
6
6
|
schema: Schema<S>;
|
|
7
7
|
view: View<S>;
|
package/quickcreate/context.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Id } from '@headless-adminapp/core';
|
|
2
|
-
import { DataLookup } from '@headless-adminapp/core/attributes';
|
|
1
|
+
import type { Id } from '@headless-adminapp/core';
|
|
2
|
+
import type { DataLookup } from '@headless-adminapp/core/attributes';
|
|
3
3
|
export interface QuickCreateOptions {
|
|
4
4
|
logicalName: string;
|
|
5
5
|
formId?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataLookup, Id } from '@headless-adminapp/core/attributes';
|
|
1
|
+
import type { DataLookup, Id } from '@headless-adminapp/core/attributes';
|
|
2
2
|
export declare function useFormSave(): () => Promise<DataLookup<Id> | null>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { DataLookup, Id } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import { QuickCreateOptions } from '../context';
|
|
1
|
+
import type { DataLookup, Id } from '@headless-adminapp/core/attributes';
|
|
2
|
+
import { type QuickCreateOptions } from '../context';
|
|
3
3
|
export declare function useOpenQuickCreate(): (options: Omit<QuickCreateOptions, "onCreate" | "onCancel">) => Promise<DataLookup<Id> | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
2
2
|
export declare const RecordSetProvider: FC<PropsWithChildren>;
|
|
@@ -16,7 +16,7 @@ const RecordSetProvider = ({ children }) => {
|
|
|
16
16
|
visibleNavigator: router.getState('navigator')?.visible ?? false,
|
|
17
17
|
}));
|
|
18
18
|
(0, react_1.useEffect)(() => {
|
|
19
|
-
function listener(state,
|
|
19
|
+
function listener(state, _prevState, changes) {
|
|
20
20
|
if (['ids', 'logicalName', 'visibleNavigator'].some((key) => key in changes)) {
|
|
21
21
|
router.setState('navigator', {
|
|
22
22
|
logicalName: state.logicalName,
|
package/recordset/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
1
|
+
import type { InferredSchemaType, SchemaAttributes } from '@headless-adminapp/core/schema';
|
|
2
2
|
export declare function useRecordSetResult(): {
|
|
3
3
|
isLoading: boolean;
|
|
4
4
|
data: import("@headless-adminapp/core/transport").Data<InferredSchemaType<SchemaAttributes>>[] | undefined;
|
package/route/RouteProvider.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IsRouteActive, RouteResolver } from '@headless-adminapp/core/experience/route';
|
|
2
|
-
import { RouterInstance } from '@headless-adminapp/core/navigation';
|
|
3
|
-
import { FC, PropsWithChildren } from 'react';
|
|
4
|
-
import { ReadonlyURLSearchParams } from './types';
|
|
1
|
+
import { type IsRouteActive, type RouteResolver } from '@headless-adminapp/core/experience/route';
|
|
2
|
+
import type { RouterInstance } from '@headless-adminapp/core/navigation';
|
|
3
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
4
|
+
import type { ReadonlyURLSearchParams } from './types';
|
|
5
5
|
export interface RouteProviderProps {
|
|
6
6
|
router: RouterInstance;
|
|
7
7
|
pathname: string;
|
package/route/context.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NavPageItem } from '@headless-adminapp/core/experience/app';
|
|
2
|
-
import { RouterInstance } from '@headless-adminapp/core/navigation';
|
|
3
|
-
import { ReadonlyURLSearchParams } from './types';
|
|
1
|
+
import type { NavPageItem } from '@headless-adminapp/core/experience/app';
|
|
2
|
+
import type { RouterInstance } from '@headless-adminapp/core/navigation';
|
|
3
|
+
import type { ReadonlyURLSearchParams } from './types';
|
|
4
4
|
export type InternalRouteResolver = (item: NavPageItem) => string;
|
|
5
5
|
export type InternalIsRouteActive = (path: string, item: NavPageItem) => boolean;
|
|
6
6
|
export declare const RouterContext: import("react").Context<RouterInstance>;
|
package/route/context.js
CHANGED
|
@@ -2,8 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RouteHelperContext = exports.RouterBasePathContext = exports.RouterSearchParamsContext = exports.RouterPathnameContext = exports.RouterContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
6
|
exports.RouterContext = (0, react_1.createContext)(null);
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
8
|
exports.RouterPathnameContext = (0, react_1.createContext)(null);
|
|
7
|
-
exports.RouterSearchParamsContext = (0, react_1.createContext)(
|
|
9
|
+
exports.RouterSearchParamsContext = (0, react_1.createContext)(
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
null);
|
|
8
12
|
exports.RouterBasePathContext = (0, react_1.createContext)('');
|
|
9
|
-
exports.RouteHelperContext = (0, react_1.createContext)(
|
|
13
|
+
exports.RouteHelperContext = (0, react_1.createContext)(
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
null);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IComponentStore } from '@headless-adminapp/core/store';
|
|
1
|
+
import type { IComponentStore } from '@headless-adminapp/core/store';
|
|
2
2
|
export declare class ComponentStore implements IComponentStore {
|
|
3
3
|
private components;
|
|
4
4
|
registerComponent<T>(name: string, component: T): void;
|
package/store/EventManager.d.ts
CHANGED
package/store/EventManager.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Id } from '@headless-adminapp/core';
|
|
1
|
+
import type { Id } from '@headless-adminapp/core';
|
|
2
2
|
export interface IRecentItemStore {
|
|
3
3
|
getItems: <T = unknown>(cacheKey: string, limit?: number) => RecentItem<T>[];
|
|
4
4
|
addItem: <T = unknown>(cacheKey: string, id: Id, value: T, limit?: number) => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
-
import { EntityMainFormCommandItemExperience, Form, QuickCreateForm } from '@headless-adminapp/core/experience/form';
|
|
3
|
-
import { SchemaExperience, SchemaExperienceMetadata } from '@headless-adminapp/core/experience/schema';
|
|
4
|
-
import { CardView, EntityMainGridCommandItemExperience, SubGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
|
|
5
|
-
import { Schema, SchemaAttributes, SchemaMetadata } from '@headless-adminapp/core/schema';
|
|
6
|
-
import { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
|
|
1
|
+
import type { LocalizedDataLookup } from '@headless-adminapp/core/attributes';
|
|
2
|
+
import type { EntityMainFormCommandItemExperience, Form, QuickCreateForm } from '@headless-adminapp/core/experience/form';
|
|
3
|
+
import type { SchemaExperience, SchemaExperienceMetadata } from '@headless-adminapp/core/experience/schema';
|
|
4
|
+
import type { CardView, EntityMainGridCommandItemExperience, SubGridCommandItemExperience, View } from '@headless-adminapp/core/experience/view';
|
|
5
|
+
import type { Schema, SchemaAttributes, SchemaMetadata } from '@headless-adminapp/core/schema';
|
|
6
|
+
import type { ISchemaExperienceStore, ISchemaStore } from '@headless-adminapp/core/store';
|
|
7
7
|
export declare function getDefaultCardView<S extends SchemaAttributes = SchemaAttributes>(schema: Schema<S>): CardView<S>;
|
|
8
8
|
interface SchemaExperienceStoreOptions {
|
|
9
9
|
schemaStore: ISchemaStore;
|
|
@@ -76,7 +76,7 @@ class SchemaExperienceStore {
|
|
|
76
76
|
if (!validViewIds.includes(viewId)) {
|
|
77
77
|
viewId = validViewIds[0];
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
const view = experience.views.find((v) => v.id === viewId);
|
|
80
80
|
if (!view) {
|
|
81
81
|
throw new Error(`View ${viewId} not found`);
|
|
82
82
|
}
|
|
@@ -106,7 +106,7 @@ class SchemaExperienceStore {
|
|
|
106
106
|
if (!validViewIds.includes(viewId)) {
|
|
107
107
|
viewId = validViewIds[0];
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
const view = experience.associatedViews.find((v) => v.id === viewId);
|
|
110
110
|
if (!view) {
|
|
111
111
|
throw new Error(`View ${viewId} not found`);
|
|
112
112
|
}
|