@evergis/react 4.0.165 → 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.
Files changed (150) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +7 -7
  3. package/dist/components/Dashboard/actions/components/TaskExecutionHost/index.d.ts +2 -0
  4. package/dist/components/Dashboard/actions/conditions/constants.d.ts +4 -0
  5. package/dist/components/Dashboard/actions/conditions/evaluateActionCondition.d.ts +6 -0
  6. package/dist/components/Dashboard/actions/conditions/operators.d.ts +4 -0
  7. package/dist/components/Dashboard/actions/conditions/parseActionCondition.d.ts +6 -0
  8. package/dist/components/Dashboard/actions/conditions/tokenizeActionCondition.d.ts +2 -0
  9. package/dist/components/Dashboard/actions/conditions/types.d.ts +43 -0
  10. package/dist/components/Dashboard/actions/constants.d.ts +4 -0
  11. package/dist/components/Dashboard/actions/context/ActionContextProvider.d.ts +8 -0
  12. package/dist/components/Dashboard/actions/context/ActionNodeProvider.d.ts +3 -0
  13. package/dist/components/Dashboard/actions/context/ActionScopeProvider.d.ts +5 -0
  14. package/dist/components/Dashboard/actions/context/WidgetActionsProvider/hooks/useActionExecutors.d.ts +3 -0
  15. package/dist/components/Dashboard/actions/context/WidgetActionsProvider/hooks/useActionFilters.d.ts +6 -0
  16. package/dist/components/Dashboard/actions/context/WidgetActionsProvider/index.d.ts +2 -0
  17. package/dist/components/Dashboard/actions/context/WidgetActionsProvider/types.d.ts +14 -0
  18. package/dist/components/Dashboard/actions/context/bindingTypes.d.ts +46 -0
  19. package/dist/components/Dashboard/actions/executors/ActionNavigationError.d.ts +4 -0
  20. package/dist/components/Dashboard/actions/executors/createActionNavigation.d.ts +5 -0
  21. package/dist/components/Dashboard/actions/executors/needsNavigationWindow.d.ts +2 -0
  22. package/dist/components/Dashboard/actions/hooks/useActionBindings.d.ts +2 -0
  23. package/dist/components/Dashboard/actions/hooks/useChartActions.d.ts +10 -0
  24. package/dist/components/Dashboard/actions/index.d.ts +20 -0
  25. package/dist/components/Dashboard/actions/modals/WidgetModalHost/ModalWindow.d.ts +2 -0
  26. package/dist/components/Dashboard/actions/modals/WidgetModalHost/index.d.ts +2 -0
  27. package/dist/components/Dashboard/actions/modals/WidgetModalHost/types.d.ts +6 -0
  28. package/dist/components/Dashboard/actions/modals/WidgetModalsProvider/index.d.ts +2 -0
  29. package/dist/components/Dashboard/actions/modals/hooks/useAvailableModals.d.ts +2 -0
  30. package/dist/components/Dashboard/actions/modals/hooks/useModalAutoSync.d.ts +2 -0
  31. package/dist/components/Dashboard/actions/modals/hooks/useModalSources.d.ts +8 -0
  32. package/dist/components/Dashboard/actions/modals/hooks/useWidgetModals.d.ts +2 -0
  33. package/dist/components/Dashboard/actions/modals/types.d.ts +26 -0
  34. package/dist/components/Dashboard/actions/modals/utils/createModalStore.d.ts +16 -0
  35. package/dist/components/Dashboard/actions/modals/utils/modalRequestKey.d.ts +4 -0
  36. package/dist/components/Dashboard/actions/parameters/resolveActionParameters.d.ts +3 -0
  37. package/dist/components/Dashboard/actions/registry/mergeActionParameters.d.ts +1 -0
  38. package/dist/components/Dashboard/actions/registry/resolveActionInvocation.d.ts +2 -0
  39. package/dist/components/Dashboard/actions/runtime/awaitActionStep.d.ts +2 -0
  40. package/dist/components/Dashboard/actions/runtime/createActionRuntime.d.ts +3 -0
  41. package/dist/components/Dashboard/actions/runtime/executeActionSequence.d.ts +3 -0
  42. package/dist/components/Dashboard/actions/runtime/types.d.ts +36 -0
  43. package/dist/components/Dashboard/actions/types.d.ts +81 -0
  44. package/dist/components/Dashboard/actions/validation/actionShape.d.ts +2 -0
  45. package/dist/components/Dashboard/actions/validation/isActionSelectedFilter.d.ts +1 -0
  46. package/dist/components/Dashboard/actions/validation/types.d.ts +15 -0
  47. package/dist/components/Dashboard/actions/validation/validateActionTree.d.ts +5 -0
  48. package/dist/components/Dashboard/actions/validation/validateDashboardActions.d.ts +3 -0
  49. package/dist/components/Dashboard/componentTypes.d.ts +52 -8
  50. package/dist/components/Dashboard/components/Chart/components/BarChartView.d.ts +2 -0
  51. package/dist/components/Dashboard/components/Chart/components/LineChartView.d.ts +2 -0
  52. package/dist/components/Dashboard/components/Chart/components/PieChartView.d.ts +2 -0
  53. package/dist/components/Dashboard/components/Chart/components/StackChartView.d.ts +2 -0
  54. package/dist/components/Dashboard/components/Chart/constants.d.ts +2 -0
  55. package/dist/components/Dashboard/components/Chart/hooks/index.d.ts +2 -0
  56. package/dist/components/Dashboard/components/Chart/hooks/useChartLayout.d.ts +71 -0
  57. package/dist/components/Dashboard/components/Chart/hooks/useChartPresentation.d.ts +30 -0
  58. package/dist/components/Dashboard/components/Chart/types.d.ts +6 -1
  59. package/dist/components/Dashboard/components/StackBar/index.d.ts +2 -1
  60. package/dist/components/Dashboard/components/SvgImage/index.d.ts +2 -2
  61. package/dist/components/Dashboard/constants.d.ts +2 -19
  62. package/dist/components/Dashboard/containers/DataSourceInnerContainer/styled.d.ts +0 -1
  63. package/dist/components/Dashboard/containers/StructuredDataContainer/types.d.ts +3 -1
  64. package/dist/components/Dashboard/containers/TaskContainer/components/LogDialog/types.d.ts +1 -0
  65. package/dist/components/Dashboard/containers/TaskContainer/components/StatusWaitingButton/index.d.ts +2 -11
  66. package/dist/components/Dashboard/containers/TaskContainer/components/TaskButton/index.d.ts +4 -0
  67. package/dist/components/Dashboard/containers/TaskContainer/components/TaskButton/styled.d.ts +2 -0
  68. package/dist/components/Dashboard/containers/TaskContainer/components/TaskLogButton.d.ts +5 -0
  69. package/dist/components/Dashboard/containers/TaskContainer/hooks/useTaskButtonState.d.ts +13 -0
  70. package/dist/components/Dashboard/containers/TaskContainer/types.d.ts +16 -0
  71. package/dist/components/Dashboard/containers/styled.d.ts +1 -1
  72. package/dist/components/Dashboard/elements/ElementButton/constants.d.ts +6 -0
  73. package/dist/components/Dashboard/elements/ElementButton/utils/getElementButtonProps.d.ts +8 -0
  74. package/dist/components/Dashboard/elements/ElementIcon/components/AttachmentIcon/types.d.ts +2 -2
  75. package/dist/components/Dashboard/elements/ElementImage/useElementImage.d.ts +3 -2
  76. package/dist/components/Dashboard/elements/ElementModal/hooks/useModalOpen.d.ts +2 -7
  77. package/dist/components/Dashboard/elements/ElementSvg/index.d.ts +0 -1
  78. package/dist/components/Dashboard/elements/ElementTable/components/ActionTableRow.d.ts +6 -0
  79. package/dist/components/Dashboard/elements/registry.d.ts +1 -1
  80. package/dist/components/Dashboard/hooks/dataSourceTypes.d.ts +15 -0
  81. package/dist/components/Dashboard/hooks/useDataSourceRequests.d.ts +4 -0
  82. package/dist/components/Dashboard/hooks/useDataSources.d.ts +6 -13
  83. package/dist/components/Dashboard/hooks/useWidgetContext.d.ts +7 -1
  84. package/dist/components/Dashboard/index.d.ts +1 -0
  85. package/dist/components/Dashboard/types.d.ts +41 -8
  86. package/dist/components/Dashboard/utils/applyQueryFilters.d.ts +5 -4
  87. package/dist/components/Dashboard/utils/checkEqualOrIncludes.d.ts +1 -1
  88. package/dist/components/Dashboard/utils/configString/constants.d.ts +19 -0
  89. package/dist/components/Dashboard/utils/configString/resolveActionToken.d.ts +3 -0
  90. package/dist/components/Dashboard/utils/configString/types.d.ts +10 -1
  91. package/dist/components/Dashboard/utils/findDashboardNode.d.ts +3 -0
  92. package/dist/components/Dashboard/utils/formatDataSourceCondition.d.ts +2 -1
  93. package/dist/components/Dashboard/utils/getDataFromAttributes.d.ts +2 -2
  94. package/dist/components/Dashboard/utils/getSelectedFilterValue.d.ts +1 -1
  95. package/dist/components/Dashboard/utils/getUpdatedDataSources.d.ts +2 -0
  96. package/dist/components/Dashboard/utils/index.d.ts +1 -0
  97. package/dist/contexts/ActionContext/index.d.ts +3 -0
  98. package/dist/contexts/ActionNodeContext/index.d.ts +2 -0
  99. package/dist/contexts/ActionScopeContext/index.d.ts +3 -0
  100. package/dist/contexts/ChartActionsContext/index.d.ts +2 -0
  101. package/dist/contexts/DashboardContext/types.d.ts +15 -6
  102. package/dist/contexts/FeatureCardContext/types.d.ts +14 -1
  103. package/dist/{components/Dashboard/grid → contexts}/GridEditContext/index.d.ts +1 -1
  104. package/dist/contexts/ModalDataContext/index.d.ts +2 -0
  105. package/dist/{components/Dashboard/containers/StructuredDataContainer/StructuredDataContext.d.ts → contexts/StructuredDataContext/index.d.ts} +1 -1
  106. package/dist/contexts/TaskExecutionContext/TaskExecutionProvider.d.ts +2 -0
  107. package/dist/contexts/TaskExecutionContext/context.d.ts +2 -0
  108. package/dist/contexts/TaskExecutionContext/hooks/useTaskExecution.d.ts +17 -0
  109. package/dist/contexts/TaskExecutionContext/index.d.ts +4 -0
  110. package/dist/contexts/TaskExecutionContext/types.d.ts +14 -0
  111. package/dist/contexts/TaskExecutionContext/utils/createTaskNotification.d.ts +4 -0
  112. package/dist/contexts/WidgetActionsContext/index.d.ts +4 -0
  113. package/dist/contexts/WidgetModalsContext/index.d.ts +3 -0
  114. package/dist/contexts/index.d.ts +12 -0
  115. package/dist/dashboardActions/index.js +577 -0
  116. package/dist/dashboardActions/index.js.map +1 -0
  117. package/dist/dashboardActions/package.json +1 -0
  118. package/dist/dashboardActions.d.ts +3 -0
  119. package/dist/hooks/task/index.d.ts +2 -0
  120. package/dist/hooks/task/runtime/PythonExecutionError.d.ts +9 -0
  121. package/dist/hooks/task/runtime/constants.d.ts +2 -0
  122. package/dist/hooks/task/runtime/resolvePythonTaskDefinition.d.ts +2 -0
  123. package/dist/hooks/task/runtime/startPythonExecution.d.ts +2 -0
  124. package/dist/hooks/task/runtime/types.d.ts +53 -0
  125. package/dist/hooks/task/types.d.ts +7 -1
  126. package/dist/hooks/task/usePythonTask.d.ts +12 -14
  127. package/dist/hooks/task/utils/pollSubtaskCompletion.d.ts +4 -1
  128. package/dist/hooks/task/utils/startRemoteTask.d.ts +2 -0
  129. package/dist/index.js +15715 -13686
  130. package/dist/index.js.map +1 -1
  131. package/dist/react.esm.js +15386 -13401
  132. package/dist/react.esm.js.map +1 -1
  133. package/dist/taskParameters/index.js +329 -0
  134. package/dist/taskParameters/index.js.map +1 -0
  135. package/dist/taskParameters/package.json +1 -0
  136. package/dist/taskParameters.d.ts +2 -0
  137. package/dist/utils/index.d.ts +1 -0
  138. package/dist/utils/isObject.d.ts +1 -1
  139. package/dist/utils/taskParameters/SchemaResolver.d.ts +14 -0
  140. package/dist/utils/taskParameters/buildDefaultForSchema.d.ts +23 -0
  141. package/dist/utils/taskParameters/getPrimaryType.d.ts +2 -0
  142. package/dist/utils/taskParameters/index.d.ts +6 -0
  143. package/dist/utils/taskParameters/mergeHiddenFieldDefaults.d.ts +2 -0
  144. package/dist/utils/taskParameters/orderPropertyKeys.d.ts +2 -0
  145. package/dist/utils/taskParameters/types.d.ts +36 -0
  146. package/package.json +5 -5
  147. package/dist/components/Dashboard/containers/TaskContainer/useTaskNotifications.d.ts +0 -12
  148. /package/dist/{components/Dashboard/components/Chart/ChartPlotContext.d.ts → contexts/ChartPlotContext/index.d.ts} +0 -0
  149. /package/dist/{components/Dashboard/components/Chart/FillContext.d.ts → contexts/FillContext/index.d.ts} +0 -0
  150. /package/dist/{components/Dashboard/containers/TaskContainer → contexts/TaskExecutionContext}/utils/clampDescription.d.ts +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Everpoint
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Everpoint
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- # @evergis/react
2
-
3
- В данном репозитории находятся специфичные (в отличии от `@evergis/uilib-gl`) для `Evergis Online`,
4
- но в целом переиспользуемые на других проектах, построенных на Evergis API, React-компоненты.
5
-
6
- ***ВАЖНО!!!***: Разрабатываемые компоненты не должны иметь зависимостей
7
- от системы поддержки мультиязычности `Evergis Online`!
1
+ # @evergis/react
2
+
3
+ В данном репозитории находятся специфичные (в отличии от `@evergis/uilib-gl`) для `Evergis Online`,
4
+ но в целом переиспользуемые на других проектах, построенных на Evergis API, React-компоненты.
5
+
6
+ ***ВАЖНО!!!***: Разрабатываемые компоненты не должны иметь зависимостей
7
+ от системы поддержки мультиязычности `Evergis Online`!
@@ -0,0 +1,2 @@
1
+ import { FC } from 'react';
2
+ export declare const TaskExecutionHost: FC;
@@ -0,0 +1,4 @@
1
+ export declare const BINARY_PRECEDENCE: Record<string, number>;
2
+ export declare const UNARY_PRECEDENCE = 7;
3
+ export declare const ISO_DATE_LENGTH = 10;
4
+ export declare const CONDITION_TOKEN: RegExp;
@@ -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,2 @@
1
+ import { ConditionToken } from './types';
2
+ export declare const tokenizeActionCondition: (expression: string) => ConditionToken[];
@@ -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,4 @@
1
+ export declare const ACTION_TYPES: readonly ["runTask", "setFilters", "openUrl", "openModal"];
2
+ export declare const UNSAFE_ACTION_KEYS: Set<string>;
3
+ export declare const ACTION_YIELD_INTERVAL = 50;
4
+ export declare const ACTION_LONG_RUNNING_MS = 500;
@@ -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>;
@@ -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,2 @@
1
+ import { WidgetActionsProviderProps } from './types';
2
+ export declare const WidgetActionsProvider: ({ type, children, actionContextKey, actionsActive, getActionFilters, actionNavigation, }: WidgetActionsProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -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,4 @@
1
+ export declare class ActionNavigationError extends Error {
2
+ readonly url: string;
3
+ constructor(url: string);
4
+ }
@@ -0,0 +1,5 @@
1
+ /** Один клик резервирует одну вкладку; неиспользованная вкладка закрывается при завершении цепочки. */
2
+ export declare const createActionNavigation: (reserve: boolean) => {
3
+ open(url: string, target?: "_self" | "_blank"): void;
4
+ dispose(): void;
5
+ };
@@ -0,0 +1,2 @@
1
+ import { ActionScopes, ConfigActionInvocation } from '../types';
2
+ export declare const needsNavigationWindow: (actions: readonly ConfigActionInvocation[], scopes: ActionScopes) => boolean;
@@ -0,0 +1,2 @@
1
+ import { ActionBindingOptions, ActionBindingResult } from '../context/bindingTypes';
2
+ export declare const useActionBindings: ({ type, elementConfig, attributes, eventData, sourceKey, disabled, }: ActionBindingOptions) => ActionBindingResult;
@@ -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,2 @@
1
+ import { ModalWindowProps } from './types';
2
+ export declare const ModalWindow: ({ type, entry }: ModalWindowProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { WidgetModalProps } from '../types';
2
+ export declare const WidgetModalHost: ({ type }: WidgetModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { WidgetModalEntry } from '../types';
2
+ import { WidgetType } from '../../../types';
3
+ export interface ModalWindowProps {
4
+ type: WidgetType;
5
+ entry: WidgetModalEntry;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { WidgetModalProps } from '../types';
2
+ export declare const WidgetModalsProvider: ({ type, children }: WidgetModalProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { WidgetType } from '../../../types';
2
+ export declare const useAvailableModals: (type: WidgetType) => any[];
@@ -0,0 +1,2 @@
1
+ import { ConfigDataSource, WidgetType } from '../../../types';
2
+ export declare const useModalAutoSync: (type: WidgetType, sources: ConfigDataSource[]) => number;
@@ -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,2 @@
1
+ import { WidgetType } from '../../../types';
2
+ export declare const useWidgetModals: (type: WidgetType) => import('../types').WidgetModalManager;
@@ -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,3 @@
1
+ import { ActionExecutionContext } from '../types';
2
+ /** Все вложенные параметры одного шага читаются из одного контекста цепочки. */
3
+ export declare const resolveActionParameters: (value: unknown, context: ActionExecutionContext) => unknown;
@@ -0,0 +1 @@
1
+ export declare const mergeActionParameters: (base: unknown, override: unknown) => unknown;
@@ -0,0 +1,2 @@
1
+ import { ActionScopes, ConfigActionInvocation, ResolvedAction } from '../types';
2
+ export declare const resolveActionInvocation: (invocation: ConfigActionInvocation, scopes: ActionScopes) => ResolvedAction;
@@ -0,0 +1,2 @@
1
+ /** При отмене прекращаем ожидание операции, сохраняя обработку её возможной поздней ошибки. */
2
+ export declare const awaitActionStep: (operation: Promise<unknown>, signal: AbortSignal) => Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { ActionRuntime, ActionRuntimeOptions } from './types';
2
+ /** Независимые цепочки по источникам клика; повторный клик заменяет только цепочку того же источника. */
3
+ export declare const createActionRuntime: (options: ActionRuntimeOptions) => ActionRuntime;
@@ -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,2 @@
1
+ export declare const getActionShapeError: (action: Record<string, unknown>, definition: boolean) => string | undefined;
2
+ export declare function getActionOptionsError(type: string, value: unknown): string | undefined;
@@ -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[];
@@ -0,0 +1,3 @@
1
+ import { ActionValidationIssue } from '../types';
2
+ /** Проверка JSON использует общий механизм разрешения действий и разбора условий. Циклы допустимы. */
3
+ export declare const validateDashboardActions: (config: unknown) => ActionValidationIssue[];