@evergis/react 4.0.166 → 4.0.167
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/dist/components/Dashboard/actions/components/TaskExecutionHost/index.d.ts +2 -0
- package/dist/components/Dashboard/actions/conditions/constants.d.ts +4 -0
- package/dist/components/Dashboard/actions/conditions/evaluateActionCondition.d.ts +6 -0
- package/dist/components/Dashboard/actions/conditions/operators.d.ts +4 -0
- package/dist/components/Dashboard/actions/conditions/parseActionCondition.d.ts +6 -0
- package/dist/components/Dashboard/actions/conditions/tokenizeActionCondition.d.ts +2 -0
- package/dist/components/Dashboard/actions/conditions/types.d.ts +43 -0
- package/dist/components/Dashboard/actions/constants.d.ts +4 -0
- package/dist/components/Dashboard/actions/context/ActionContextProvider.d.ts +8 -0
- package/dist/components/Dashboard/actions/context/ActionNodeProvider.d.ts +3 -0
- package/dist/components/Dashboard/actions/context/ActionScopeProvider.d.ts +5 -0
- package/dist/components/Dashboard/actions/context/WidgetActionsProvider/hooks/useActionExecutors.d.ts +3 -0
- package/dist/components/Dashboard/actions/context/WidgetActionsProvider/hooks/useActionFilters.d.ts +6 -0
- package/dist/components/Dashboard/actions/context/WidgetActionsProvider/index.d.ts +2 -0
- package/dist/components/Dashboard/actions/context/WidgetActionsProvider/types.d.ts +14 -0
- package/dist/components/Dashboard/actions/context/bindingTypes.d.ts +46 -0
- package/dist/components/Dashboard/actions/executors/ActionNavigationError.d.ts +4 -0
- package/dist/components/Dashboard/actions/executors/createActionNavigation.d.ts +5 -0
- package/dist/components/Dashboard/actions/executors/needsNavigationWindow.d.ts +2 -0
- package/dist/components/Dashboard/actions/hooks/useActionBindings.d.ts +2 -0
- package/dist/components/Dashboard/actions/hooks/useChartActions.d.ts +10 -0
- package/dist/components/Dashboard/actions/index.d.ts +20 -0
- package/dist/components/Dashboard/actions/modals/WidgetModalHost/ModalWindow.d.ts +2 -0
- package/dist/components/Dashboard/actions/modals/WidgetModalHost/index.d.ts +2 -0
- package/dist/components/Dashboard/actions/modals/WidgetModalHost/types.d.ts +6 -0
- package/dist/components/Dashboard/actions/modals/WidgetModalsProvider/index.d.ts +2 -0
- package/dist/components/Dashboard/actions/modals/hooks/useAvailableModals.d.ts +2 -0
- package/dist/components/Dashboard/actions/modals/hooks/useModalAutoSync.d.ts +2 -0
- package/dist/components/Dashboard/actions/modals/hooks/useModalSources.d.ts +8 -0
- package/dist/components/Dashboard/actions/modals/hooks/useWidgetModals.d.ts +2 -0
- package/dist/components/Dashboard/actions/modals/types.d.ts +26 -0
- package/dist/components/Dashboard/actions/modals/utils/createModalStore.d.ts +16 -0
- package/dist/components/Dashboard/actions/modals/utils/modalRequestKey.d.ts +4 -0
- package/dist/components/Dashboard/actions/parameters/resolveActionParameters.d.ts +3 -0
- package/dist/components/Dashboard/actions/registry/mergeActionParameters.d.ts +1 -0
- package/dist/components/Dashboard/actions/registry/resolveActionInvocation.d.ts +2 -0
- package/dist/components/Dashboard/actions/runtime/awaitActionStep.d.ts +2 -0
- package/dist/components/Dashboard/actions/runtime/createActionRuntime.d.ts +3 -0
- package/dist/components/Dashboard/actions/runtime/executeActionSequence.d.ts +3 -0
- package/dist/components/Dashboard/actions/runtime/types.d.ts +36 -0
- package/dist/components/Dashboard/actions/types.d.ts +81 -0
- package/dist/components/Dashboard/actions/validation/actionShape.d.ts +2 -0
- package/dist/components/Dashboard/actions/validation/isActionSelectedFilter.d.ts +1 -0
- package/dist/components/Dashboard/actions/validation/types.d.ts +15 -0
- package/dist/components/Dashboard/actions/validation/validateActionTree.d.ts +5 -0
- package/dist/components/Dashboard/actions/validation/validateDashboardActions.d.ts +3 -0
- package/dist/components/Dashboard/componentTypes.d.ts +24 -5
- package/dist/components/Dashboard/components/Chart/components/BarChartView.d.ts +2 -0
- package/dist/components/Dashboard/components/Chart/components/LineChartView.d.ts +2 -0
- package/dist/components/Dashboard/components/Chart/components/PieChartView.d.ts +2 -0
- package/dist/components/Dashboard/components/Chart/components/StackChartView.d.ts +2 -0
- package/dist/components/Dashboard/components/Chart/constants.d.ts +2 -0
- package/dist/components/Dashboard/components/Chart/hooks/index.d.ts +2 -0
- package/dist/components/Dashboard/components/Chart/hooks/useChartLayout.d.ts +71 -0
- package/dist/components/Dashboard/components/Chart/hooks/useChartPresentation.d.ts +30 -0
- package/dist/components/Dashboard/components/Chart/types.d.ts +6 -1
- package/dist/components/Dashboard/components/StackBar/index.d.ts +2 -1
- package/dist/components/Dashboard/components/SvgImage/index.d.ts +2 -2
- package/dist/components/Dashboard/constants.d.ts +2 -19
- package/dist/components/Dashboard/containers/DataSourceInnerContainer/styled.d.ts +0 -1
- package/dist/components/Dashboard/containers/StructuredDataContainer/types.d.ts +3 -1
- package/dist/components/Dashboard/containers/TaskContainer/components/LogDialog/types.d.ts +1 -0
- package/dist/components/Dashboard/containers/TaskContainer/components/TaskLogButton.d.ts +5 -0
- package/dist/components/Dashboard/containers/TaskContainer/hooks/useTaskButtonState.d.ts +1 -1
- package/dist/components/Dashboard/containers/styled.d.ts +1 -1
- package/dist/components/Dashboard/elements/ElementIcon/components/AttachmentIcon/types.d.ts +2 -2
- package/dist/components/Dashboard/elements/ElementImage/useElementImage.d.ts +3 -2
- package/dist/components/Dashboard/elements/ElementModal/hooks/useModalOpen.d.ts +2 -7
- package/dist/components/Dashboard/elements/ElementSvg/index.d.ts +0 -1
- package/dist/components/Dashboard/elements/ElementTable/components/ActionTableRow.d.ts +6 -0
- package/dist/components/Dashboard/elements/registry.d.ts +1 -1
- package/dist/components/Dashboard/hooks/dataSourceTypes.d.ts +15 -0
- package/dist/components/Dashboard/hooks/useDataSourceRequests.d.ts +4 -0
- package/dist/components/Dashboard/hooks/useDataSources.d.ts +6 -13
- package/dist/components/Dashboard/hooks/useWidgetContext.d.ts +7 -1
- package/dist/components/Dashboard/index.d.ts +1 -0
- package/dist/components/Dashboard/types.d.ts +18 -6
- package/dist/components/Dashboard/utils/applyQueryFilters.d.ts +5 -4
- package/dist/components/Dashboard/utils/checkEqualOrIncludes.d.ts +1 -1
- package/dist/components/Dashboard/utils/configString/constants.d.ts +19 -0
- package/dist/components/Dashboard/utils/configString/resolveActionToken.d.ts +3 -0
- package/dist/components/Dashboard/utils/configString/types.d.ts +10 -1
- package/dist/components/Dashboard/utils/findDashboardNode.d.ts +3 -0
- package/dist/components/Dashboard/utils/formatDataSourceCondition.d.ts +2 -1
- package/dist/components/Dashboard/utils/getDataFromAttributes.d.ts +2 -2
- package/dist/components/Dashboard/utils/getSelectedFilterValue.d.ts +1 -1
- package/dist/components/Dashboard/utils/getUpdatedDataSources.d.ts +2 -0
- package/dist/components/Dashboard/utils/index.d.ts +1 -0
- package/dist/contexts/ActionContext/index.d.ts +3 -0
- package/dist/contexts/ActionNodeContext/index.d.ts +2 -0
- package/dist/contexts/ActionScopeContext/index.d.ts +3 -0
- package/dist/contexts/ChartActionsContext/index.d.ts +2 -0
- package/dist/contexts/DashboardContext/types.d.ts +15 -6
- package/dist/contexts/FeatureCardContext/types.d.ts +14 -1
- package/dist/{components/Dashboard/grid → contexts}/GridEditContext/index.d.ts +1 -1
- package/dist/contexts/ModalDataContext/index.d.ts +2 -0
- package/dist/{components/Dashboard/containers/StructuredDataContainer/StructuredDataContext.d.ts → contexts/StructuredDataContext/index.d.ts} +1 -1
- package/dist/contexts/TaskExecutionContext/TaskExecutionProvider.d.ts +2 -0
- package/dist/contexts/TaskExecutionContext/context.d.ts +2 -0
- package/dist/contexts/TaskExecutionContext/hooks/useTaskExecution.d.ts +17 -0
- package/dist/contexts/TaskExecutionContext/index.d.ts +4 -0
- package/dist/contexts/TaskExecutionContext/types.d.ts +14 -0
- package/dist/contexts/TaskExecutionContext/utils/createTaskNotification.d.ts +4 -0
- package/dist/contexts/WidgetActionsContext/index.d.ts +4 -0
- package/dist/contexts/WidgetModalsContext/index.d.ts +3 -0
- package/dist/contexts/index.d.ts +12 -0
- package/dist/dashboardActions/index.js +577 -0
- package/dist/dashboardActions/index.js.map +1 -0
- package/dist/dashboardActions/package.json +1 -0
- package/dist/dashboardActions.d.ts +3 -0
- package/dist/hooks/task/index.d.ts +2 -0
- package/dist/hooks/task/runtime/PythonExecutionError.d.ts +9 -0
- package/dist/hooks/task/runtime/constants.d.ts +2 -0
- package/dist/hooks/task/runtime/resolvePythonTaskDefinition.d.ts +2 -0
- package/dist/hooks/task/runtime/startPythonExecution.d.ts +2 -0
- package/dist/hooks/task/runtime/types.d.ts +53 -0
- package/dist/hooks/task/types.d.ts +7 -1
- package/dist/hooks/task/usePythonTask.d.ts +12 -14
- package/dist/hooks/task/utils/pollSubtaskCompletion.d.ts +4 -1
- package/dist/hooks/task/utils/startRemoteTask.d.ts +2 -0
- package/dist/index.js +15185 -13249
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +14927 -13035
- package/dist/react.esm.js.map +1 -1
- package/dist/taskParameters/index.js +329 -0
- package/dist/taskParameters/index.js.map +1 -0
- package/dist/taskParameters/package.json +1 -0
- package/dist/taskParameters.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/isObject.d.ts +1 -1
- package/dist/utils/taskParameters/SchemaResolver.d.ts +14 -0
- package/dist/utils/taskParameters/buildDefaultForSchema.d.ts +23 -0
- package/dist/utils/taskParameters/getPrimaryType.d.ts +2 -0
- package/dist/utils/taskParameters/index.d.ts +6 -0
- package/dist/utils/taskParameters/mergeHiddenFieldDefaults.d.ts +2 -0
- package/dist/utils/taskParameters/orderPropertyKeys.d.ts +2 -0
- package/dist/utils/taskParameters/types.d.ts +36 -0
- package/package.json +2 -2
- package/dist/components/Dashboard/containers/TaskContainer/useTaskNotifications.d.ts +0 -12
- /package/dist/{components/Dashboard/components/Chart/ChartPlotContext.d.ts → contexts/ChartPlotContext/index.d.ts} +0 -0
- /package/dist/{components/Dashboard/components/Chart/FillContext.d.ts → contexts/FillContext/index.d.ts} +0 -0
- /package/dist/{components/Dashboard/containers/TaskContainer → contexts/TaskExecutionContext}/utils/clampDescription.d.ts +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActionExecutionContext } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Ошибка выражения или отсутствующее значение делают ветку ложной. Произвольный JS не исполняется;
|
|
4
|
+
* значения фильтров и ответа задачи читаются общим механизмом подстановок как данные.
|
|
5
|
+
*/
|
|
6
|
+
export declare const evaluateActionCondition: (expression: string, context: ActionExecutionContext) => boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Читаем только собственные поля данных: прототипы и унаследованные свойства недоступны. */
|
|
2
|
+
export declare const readActionProperty: (target: unknown, key: unknown) => unknown;
|
|
3
|
+
/** По контракту Actions сравнения не преобразуют типы: ==/!= равнозначны ===/!==. */
|
|
4
|
+
export declare const evaluateBinary: (operator: string, left: unknown, right: unknown) => unknown;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConditionNode } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Разбирает ограниченное выражение: приоритеты операторов, скобки, свойства, includes и Date.parse.
|
|
4
|
+
* Условия источников данных лишь форматируются для сервера; callback требует вычисления в браузере.
|
|
5
|
+
*/
|
|
6
|
+
export declare const parseActionCondition: (condition: string) => ConditionNode;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ConfigToken } from '../../utils/configString/types';
|
|
2
|
+
export type ConditionToken = {
|
|
3
|
+
kind: "literal";
|
|
4
|
+
text: string;
|
|
5
|
+
value: unknown;
|
|
6
|
+
} | {
|
|
7
|
+
kind: "reference";
|
|
8
|
+
text: string;
|
|
9
|
+
reference: ConfigToken;
|
|
10
|
+
} | {
|
|
11
|
+
kind: "operator";
|
|
12
|
+
text: string;
|
|
13
|
+
};
|
|
14
|
+
export type ConditionNode = {
|
|
15
|
+
kind: "literal";
|
|
16
|
+
value: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
kind: "reference";
|
|
19
|
+
token: ConfigToken;
|
|
20
|
+
} | {
|
|
21
|
+
kind: "array";
|
|
22
|
+
items: ConditionNode[];
|
|
23
|
+
} | {
|
|
24
|
+
kind: "unary";
|
|
25
|
+
operator: string;
|
|
26
|
+
operand: ConditionNode;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "binary";
|
|
29
|
+
operator: string;
|
|
30
|
+
left: ConditionNode;
|
|
31
|
+
right: ConditionNode;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "property";
|
|
34
|
+
target: ConditionNode;
|
|
35
|
+
key: ConditionNode;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "includes";
|
|
38
|
+
target: ConditionNode;
|
|
39
|
+
argument: ConditionNode;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "date";
|
|
42
|
+
argument: ConditionNode;
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ActionExecutionContext } from '../types';
|
|
3
|
+
import { WidgetType } from '../../types';
|
|
4
|
+
export declare const ActionContextProvider: ({ type, value, children }: PropsWithChildren<{
|
|
5
|
+
type: WidgetType;
|
|
6
|
+
value: ActionExecutionContext;
|
|
7
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const useActionContext: (type: WidgetType) => ActionExecutionContext;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ActionNodeProps } from './bindingTypes';
|
|
2
|
+
export declare const ActionNodeProvider: ({ children, path, recordId, event, attributes, disabled }: ActionNodeProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const useActionNode: () => import('./bindingTypes').ActionNodeValue;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ActionScopeProviderProps } from './bindingTypes';
|
|
2
|
+
import { WidgetType } from '../../types';
|
|
3
|
+
/** Вложенная модалка заменяет область своего виджета, сохраняя области соседних виджетов. */
|
|
4
|
+
export declare const ActionScopeProvider: ({ type, scopes, signal, children }: ActionScopeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const useActionScope: (type: WidgetType) => import('./bindingTypes').ActionScopeValue;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createActionNavigation } from '../../../executors/createActionNavigation';
|
|
2
|
+
import { SelectedFilters, WidgetType } from '../../../../types';
|
|
3
|
+
export declare const useActionExecutors: (type: WidgetType, navigations: Map<string, ReturnType<typeof createActionNavigation>>, writeFilters: (filters: SelectedFilters) => void) => (action: import('../../..').ResolvedAction, context: import('../../..').ActionExecutionContext, control: import('../../../runtime/types').ActionExecutionControl) => unknown | Promise<unknown>;
|
package/dist/components/Dashboard/actions/context/WidgetActionsProvider/hooks/useActionFilters.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SelectedFilters, WidgetType } from '../../../../types';
|
|
2
|
+
/** Последовательные действия видят записанные фильтры даже при пакетном обновлении состояния React. */
|
|
3
|
+
export declare const useActionFilters: (type: WidgetType, selected: SelectedFilters | undefined, getFilters?: () => SelectedFilters) => {
|
|
4
|
+
read: () => SelectedFilters;
|
|
5
|
+
write: (filters: SelectedFilters) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { SelectedFilters, WidgetType } from '../../../types';
|
|
3
|
+
export type WidgetActionsProviderProps = PropsWithChildren<{
|
|
4
|
+
type: WidgetType;
|
|
5
|
+
actionContextKey?: string;
|
|
6
|
+
actionsActive?: boolean;
|
|
7
|
+
actionNavigation?: ActionNavigationFactory;
|
|
8
|
+
getActionFilters?: () => SelectedFilters;
|
|
9
|
+
}>;
|
|
10
|
+
export interface ActionNavigation {
|
|
11
|
+
open: (url: string, target?: "_self" | "_blank") => void;
|
|
12
|
+
dispose: () => void;
|
|
13
|
+
}
|
|
14
|
+
export type ActionNavigationFactory = (reserve: boolean) => ActionNavigation;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { KeyboardEvent, MouseEvent, PropsWithChildren } from 'react';
|
|
2
|
+
import { ActionEventData, ActionExecutionContext, ActionScopes, ConfigActionInvocation } from '../types';
|
|
3
|
+
import { ClientFeatureAttribute, ConfigContainerChild, WidgetType } from '../../types';
|
|
4
|
+
export interface ActionBindingOptions {
|
|
5
|
+
type?: WidgetType;
|
|
6
|
+
elementConfig?: ConfigContainerChild;
|
|
7
|
+
attributes?: ClientFeatureAttribute[];
|
|
8
|
+
eventData?: ActionEventData;
|
|
9
|
+
sourceKey?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface WidgetActionsValue {
|
|
13
|
+
start: (actions: readonly ConfigActionInvocation[], scopes: ActionScopes, context: ActionExecutionContext, sourceKey: string, scopeSignal?: AbortSignal) => void;
|
|
14
|
+
}
|
|
15
|
+
export type ActionNodeProps = PropsWithChildren<{
|
|
16
|
+
path?: string;
|
|
17
|
+
recordId?: string | number;
|
|
18
|
+
event?: ActionEventData;
|
|
19
|
+
attributes?: ClientFeatureAttribute[];
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
export interface ActionNodeValue {
|
|
23
|
+
path: string;
|
|
24
|
+
recordId?: string | number;
|
|
25
|
+
event?: ActionEventData;
|
|
26
|
+
attributes?: ClientFeatureAttribute[];
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ActionBindingResult {
|
|
30
|
+
hasActions: boolean;
|
|
31
|
+
trigger: (data?: ActionEventData, attributes?: ClientFeatureAttribute[]) => void;
|
|
32
|
+
onClick?: (event: MouseEvent) => void;
|
|
33
|
+
onKeyDown?: (event: KeyboardEvent) => void;
|
|
34
|
+
role?: "button";
|
|
35
|
+
tabIndex?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ActionScopeValue {
|
|
38
|
+
scopes: ActionScopes;
|
|
39
|
+
key: string;
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
}
|
|
42
|
+
export type ActionScopeProviderProps = PropsWithChildren<{
|
|
43
|
+
type: WidgetType;
|
|
44
|
+
scopes: ActionScopes;
|
|
45
|
+
signal?: AbortSignal;
|
|
46
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ConfigContainerChild, FilterItem, WidgetType } from '../../types';
|
|
2
|
+
export declare const useChartActions: (type: WidgetType, chart: ConfigContainerChild, items: FilterItem[]) => {
|
|
3
|
+
clickable: boolean;
|
|
4
|
+
onItemClick: (item: FilterItem) => void;
|
|
5
|
+
filters: import('../../types').SelectedFilters;
|
|
6
|
+
formatFilterColor: (name: string, color: string, defaultColor?: string) => string;
|
|
7
|
+
hasAnyFilter: boolean;
|
|
8
|
+
isFiltered: (name: string) => boolean;
|
|
9
|
+
onFilter: (newValue: string) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './registry/resolveActionInvocation';
|
|
3
|
+
export * from './registry/mergeActionParameters';
|
|
4
|
+
export * from './parameters/resolveActionParameters';
|
|
5
|
+
export * from './conditions/evaluateActionCondition';
|
|
6
|
+
export * from './conditions/parseActionCondition';
|
|
7
|
+
export * from './runtime/types';
|
|
8
|
+
export * from './runtime/createActionRuntime';
|
|
9
|
+
export * from './runtime/executeActionSequence';
|
|
10
|
+
export * from './validation/validateDashboardActions';
|
|
11
|
+
export * from './context/ActionContextProvider';
|
|
12
|
+
export * from './context/ActionNodeProvider';
|
|
13
|
+
export * from './context/ActionScopeProvider';
|
|
14
|
+
export * from './context/WidgetActionsProvider';
|
|
15
|
+
export * from './context/WidgetActionsProvider/types';
|
|
16
|
+
export * from '../../../contexts/WidgetActionsContext';
|
|
17
|
+
export * from './context/bindingTypes';
|
|
18
|
+
export * from './hooks/useActionBindings';
|
|
19
|
+
export * from './modals/types';
|
|
20
|
+
export * from './modals/hooks/useWidgetModals';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConfigModal, WidgetType } from '../../../types';
|
|
2
|
+
import { WidgetModalEntry } from '../types';
|
|
3
|
+
export declare const useModalSources: (type: WidgetType, entry: WidgetModalEntry, modal?: ConfigModal) => {
|
|
4
|
+
type: WidgetType;
|
|
5
|
+
dataSources: import('../../../types').WidgetDataSource[];
|
|
6
|
+
configDataSources: import('../../../types').ConfigDataSource[];
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { ActionExecutionContext, ActionScopes } from '../types';
|
|
3
|
+
import { ConfigDataSource, WidgetDataSource, WidgetType } from '../../types';
|
|
4
|
+
export interface WidgetModalSnapshot {
|
|
5
|
+
modalId: string;
|
|
6
|
+
revision: number;
|
|
7
|
+
context: ActionExecutionContext;
|
|
8
|
+
}
|
|
9
|
+
export interface WidgetModalEntry extends WidgetModalSnapshot {
|
|
10
|
+
scopes: ActionScopes;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
}
|
|
13
|
+
export type WidgetModalProps = PropsWithChildren<{
|
|
14
|
+
type: WidgetType;
|
|
15
|
+
}>;
|
|
16
|
+
export interface WidgetModalManager {
|
|
17
|
+
openedModals: readonly WidgetModalEntry[];
|
|
18
|
+
openModal: (modalId: string, context: ActionExecutionContext, scopes: ActionScopes, parameters?: Record<string, unknown>) => void;
|
|
19
|
+
closeModal: (modalId: string) => void;
|
|
20
|
+
}
|
|
21
|
+
export interface ModalDataOverlay {
|
|
22
|
+
type: WidgetType;
|
|
23
|
+
dataSources: WidgetDataSource[];
|
|
24
|
+
configDataSources: ConfigDataSource[];
|
|
25
|
+
isLoading: boolean;
|
|
26
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionExecutionContext, ActionScopes } from '../../types';
|
|
2
|
+
import { WidgetModalEntry } from '../types';
|
|
3
|
+
/** Сигналы выполнения не попадают в снимки состояния приложения или Redux. */
|
|
4
|
+
export declare const createModalStore: () => {
|
|
5
|
+
getSnapshot: () => readonly WidgetModalEntry[];
|
|
6
|
+
subscribe: (listener: () => void) => () => void;
|
|
7
|
+
open: (modalId: string, context: ActionExecutionContext, scopes: ActionScopes) => {
|
|
8
|
+
modalId: string;
|
|
9
|
+
revision: number;
|
|
10
|
+
context: ActionExecutionContext;
|
|
11
|
+
scopes: ActionScopes;
|
|
12
|
+
signal: AbortSignal;
|
|
13
|
+
};
|
|
14
|
+
close: (modalId: string) => void;
|
|
15
|
+
clear: () => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConfigDataSource } from '../../../types';
|
|
2
|
+
import { ConfigStringSources } from '../../../utils/configString/types';
|
|
3
|
+
/** Ключ учитывает подставленные значения: посторонние изменения фильтров и карты не сбрасывают данные. */
|
|
4
|
+
export declare const modalRequestKey: (sources: ConfigDataSource[], context: ConfigStringSources) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const mergeActionParameters: (base: unknown, override: unknown) => unknown;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ActionExecutionContext } from '../types';
|
|
2
|
+
import { ActionExecutionControl, ActionRunRequest, ActionRuntimeOptions } from './types';
|
|
3
|
+
export declare const executeActionSequence: (request: ActionRunRequest, options: ActionRuntimeOptions, control: ActionExecutionControl) => Promise<ActionExecutionContext>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ConfigStringSources } from '../../utils/configString/types';
|
|
2
|
+
import { ActionExecutionContext, ActionScopes, ConfigActionInvocation, ResolvedAction } from '../types';
|
|
3
|
+
export type ActionCancelReason = "restart" | "user" | "lifecycle";
|
|
4
|
+
export interface ActionExecutionControl {
|
|
5
|
+
signal: AbortSignal;
|
|
6
|
+
runId: string;
|
|
7
|
+
scopes: ActionScopes;
|
|
8
|
+
sourceKey: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ActionRunResult {
|
|
11
|
+
status: "completed" | "cancelled" | "failed";
|
|
12
|
+
context: ActionExecutionContext;
|
|
13
|
+
error?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface ActionRunHandle extends ActionExecutionControl {
|
|
16
|
+
sourceKey: string;
|
|
17
|
+
completion: Promise<ActionRunResult>;
|
|
18
|
+
cancel: (reason?: ActionCancelReason) => void;
|
|
19
|
+
}
|
|
20
|
+
export interface ActionRuntimeOptions {
|
|
21
|
+
execute: (action: ResolvedAction, context: ActionExecutionContext, control: ActionExecutionControl) => unknown | Promise<unknown>;
|
|
22
|
+
getSources?: (context: ActionExecutionContext) => ConfigStringSources;
|
|
23
|
+
onError?: (error: unknown, handle: ActionRunHandle) => void;
|
|
24
|
+
onLongRunning?: (handle: ActionRunHandle) => void;
|
|
25
|
+
}
|
|
26
|
+
export interface ActionRunRequest {
|
|
27
|
+
sourceKey: string;
|
|
28
|
+
actions: readonly ConfigActionInvocation[];
|
|
29
|
+
scopes: ActionScopes;
|
|
30
|
+
context: ActionExecutionContext;
|
|
31
|
+
}
|
|
32
|
+
export interface ActionRuntime {
|
|
33
|
+
start: (request: ActionRunRequest) => ActionRunHandle;
|
|
34
|
+
cancel: (sourceKey: string, reason?: ActionCancelReason) => void;
|
|
35
|
+
cancelAll: (reason?: ActionCancelReason) => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { ConfigStringSources } from '../utils/configString/types';
|
|
2
|
+
import { SelectedFilters } from '../types';
|
|
3
|
+
export type ActionEvent = "click";
|
|
4
|
+
export type ActionParameters = Record<string, unknown>;
|
|
5
|
+
export interface ActionOptionsMap {
|
|
6
|
+
runTask: {
|
|
7
|
+
taskName: string;
|
|
8
|
+
parameters?: ActionParameters;
|
|
9
|
+
};
|
|
10
|
+
setFilters: {
|
|
11
|
+
filters: SelectedFilters;
|
|
12
|
+
};
|
|
13
|
+
openUrl: {
|
|
14
|
+
url: string;
|
|
15
|
+
target?: "_self" | "_blank";
|
|
16
|
+
};
|
|
17
|
+
openModal: {
|
|
18
|
+
modalId: string;
|
|
19
|
+
parameters?: ActionParameters;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export type ActionType = keyof ActionOptionsMap;
|
|
23
|
+
export type ConfigActionInline = {
|
|
24
|
+
[Kind in ActionType]: {
|
|
25
|
+
type: Kind;
|
|
26
|
+
id?: never;
|
|
27
|
+
options: ActionOptionsMap[Kind];
|
|
28
|
+
event?: ActionEvent;
|
|
29
|
+
callback?: ConfigActionCallback;
|
|
30
|
+
};
|
|
31
|
+
}[ActionType];
|
|
32
|
+
export type ConfigActionDefinition = {
|
|
33
|
+
[Kind in ActionType]: {
|
|
34
|
+
id: string;
|
|
35
|
+
type: Kind;
|
|
36
|
+
options: ActionOptionsMap[Kind];
|
|
37
|
+
event?: ActionEvent;
|
|
38
|
+
callback?: ConfigActionCallback;
|
|
39
|
+
};
|
|
40
|
+
}[ActionType];
|
|
41
|
+
export interface ConfigActionReference {
|
|
42
|
+
id: string;
|
|
43
|
+
type?: never;
|
|
44
|
+
event?: ActionEvent;
|
|
45
|
+
options?: ActionParameters;
|
|
46
|
+
callback?: ConfigActionCallback;
|
|
47
|
+
}
|
|
48
|
+
export type ConfigActionInvocation = ConfigActionInline | ConfigActionReference;
|
|
49
|
+
export type ConfigActionCallback = ConfigActionInvocation | {
|
|
50
|
+
[condition: string]: ConfigActionInvocation;
|
|
51
|
+
};
|
|
52
|
+
export type ConfigActionScope = readonly ConfigActionDefinition[];
|
|
53
|
+
export type ActionScopes = readonly ConfigActionScope[];
|
|
54
|
+
export type ResolvedAction = {
|
|
55
|
+
[Kind in ActionType]: {
|
|
56
|
+
id?: string;
|
|
57
|
+
type: Kind;
|
|
58
|
+
options: ActionOptionsMap[Kind];
|
|
59
|
+
event: ActionEvent;
|
|
60
|
+
callback?: ConfigActionCallback;
|
|
61
|
+
};
|
|
62
|
+
}[ActionType];
|
|
63
|
+
export interface ActionEventData {
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
nodeId?: string;
|
|
66
|
+
recordId?: string | number;
|
|
67
|
+
sourceKey?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface ActionExecutionContext {
|
|
70
|
+
sources: ConfigStringSources;
|
|
71
|
+
event?: ActionEventData;
|
|
72
|
+
parameters?: ActionParameters;
|
|
73
|
+
taskResponse?: unknown;
|
|
74
|
+
}
|
|
75
|
+
export interface ActionValidationIssue {
|
|
76
|
+
path: string;
|
|
77
|
+
code: string;
|
|
78
|
+
message: string;
|
|
79
|
+
ownerId?: string;
|
|
80
|
+
severity: "error" | "warning";
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isActionSelectedFilter: (filter: unknown) => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionScopes, ActionValidationIssue } from '../types';
|
|
2
|
+
export interface ValidationFrame {
|
|
3
|
+
node: Record<string, unknown>;
|
|
4
|
+
path: string;
|
|
5
|
+
scopes: ActionScopes;
|
|
6
|
+
tasks?: readonly unknown[];
|
|
7
|
+
definition: boolean;
|
|
8
|
+
declaration?: boolean;
|
|
9
|
+
ownerId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ValidationState {
|
|
12
|
+
issues: ActionValidationIssue[];
|
|
13
|
+
modalIds: Set<string>;
|
|
14
|
+
actionIds: Set<string>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ActionValidationIssue, ConfigActionDefinition } from '../types';
|
|
2
|
+
import { ValidationFrame, ValidationState } from './types';
|
|
3
|
+
export declare const addActionIssue: (state: ValidationState, frame: ValidationFrame, message: string, code?: string, severity?: ActionValidationIssue["severity"]) => void;
|
|
4
|
+
export declare const validateActionTree: (initial: ValidationFrame, state: ValidationState) => void;
|
|
5
|
+
export declare const validateRegistry: (value: unknown, frame: ValidationFrame, state: ValidationState) => ConfigActionDefinition[];
|