@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.
- package/LICENSE +21 -21
- package/README.md +7 -7
- 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 +52 -8
- 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/StatusWaitingButton/index.d.ts +2 -11
- package/dist/components/Dashboard/containers/TaskContainer/components/TaskButton/index.d.ts +4 -0
- package/dist/components/Dashboard/containers/TaskContainer/components/TaskButton/styled.d.ts +2 -0
- package/dist/components/Dashboard/containers/TaskContainer/components/TaskLogButton.d.ts +5 -0
- package/dist/components/Dashboard/containers/TaskContainer/hooks/useTaskButtonState.d.ts +13 -0
- package/dist/components/Dashboard/containers/TaskContainer/types.d.ts +16 -0
- package/dist/components/Dashboard/containers/styled.d.ts +1 -1
- package/dist/components/Dashboard/elements/ElementButton/constants.d.ts +6 -0
- package/dist/components/Dashboard/elements/ElementButton/utils/getElementButtonProps.d.ts +8 -0
- 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 +41 -8
- 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 +15715 -13686
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +15386 -13401
- 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 +5 -5
- 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,4 @@
|
|
|
1
|
+
import { PagedFeaturesListDc } from '@evergis/api';
|
|
2
|
+
import { DataSourceRequestOptions } from './dataSourceTypes';
|
|
3
|
+
import { ConfigDataSource, EqlDataSource, SelectedFilters } from '../types';
|
|
4
|
+
export declare const useDataSourceRequests: ({ contextSources, type: widgetType, config, attributes, filters, layerParams, eqlParameters, }: DataSourceRequestOptions) => ({ ds, query, parameters, layerName, limit, condition, url, resourceId, fileName, methodName, }: ConfigDataSource, newFilters?: SelectedFilters, offset?: number) => Promise<EqlDataSource | PagedFeaturesListDc>;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare const useDataSources: (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
filters: SelectedFilters;
|
|
8
|
-
layerParams?: Record<string, string>;
|
|
9
|
-
eqlParameters?: QueryLayerServiceConfigurationDc["eqlParameters"];
|
|
10
|
-
}) => {
|
|
11
|
-
getDataSourcePromises: ({ ds, query, parameters, layerName, limit, condition, url, resourceId, fileName, methodName, }: ConfigDataSource, newFilters?: SelectedFilters, offset?: number) => Promise<EqlDataSource | PagedFeaturesListDc>;
|
|
12
|
-
getUpdatingDataSources: () => ConfigDataSource[];
|
|
13
|
-
getUpdatedDataSources: (responses: DataSourcePromise[], currentDataSources: ConfigDataSource[], otherDataSources: FetchedDataSource[]) => any;
|
|
1
|
+
import { SelectedFilters } from '../types';
|
|
2
|
+
import { DataSourceRequestOptions } from './dataSourceTypes';
|
|
3
|
+
export declare const useDataSources: (options: DataSourceRequestOptions) => {
|
|
4
|
+
getDataSourcePromises: ({ ds, query, parameters, layerName, limit, condition, url, resourceId, fileName, methodName, }: import('../types').ConfigDataSource, newFilters?: SelectedFilters, offset?: number) => Promise<import('../types').EqlDataSource | import('@evergis/api').PagedFeaturesListDc>;
|
|
5
|
+
getUpdatingDataSources: () => import('../types').ConfigDataSource[];
|
|
6
|
+
getUpdatedDataSources: (responses: import('../types').DataSourcePromise[], currentDataSources: import('../types').ConfigDataSource[], otherDataSources: import('../types').FetchedDataSource[]) => any;
|
|
14
7
|
};
|
|
@@ -37,7 +37,13 @@ export declare const useWidgetContext: <T extends WidgetType = WidgetType.Dashbo
|
|
|
37
37
|
config: import('../types').ConfigContainer;
|
|
38
38
|
isEditing: boolean;
|
|
39
39
|
onContainerChange: (config: import('../types').ConfigContainerChild) => void;
|
|
40
|
-
|
|
40
|
+
isModalNotificationAllowed: (senderName: string | undefined, source: import('../types').ConfigDataSource, layerName: string) => boolean;
|
|
41
|
+
actionContextKey: string;
|
|
42
|
+
actionsActive: boolean;
|
|
43
|
+
onModalContextChange: (modalId: string, snapshot: import('..').WidgetModalSnapshot | null) => void;
|
|
44
|
+
onModalToggle: (modalId: string, isOpen: boolean, metadata?: {
|
|
45
|
+
managed: boolean;
|
|
46
|
+
}) => void;
|
|
41
47
|
isLoading: boolean;
|
|
42
48
|
pageIndex: number;
|
|
43
49
|
filters: import('../types').SelectedFilters;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { ActionEventData, ConfigActionDefinition, ConfigActionInvocation } from './actions/types';
|
|
1
2
|
import { CSSProperties, FC, ReactNode } from 'react';
|
|
2
3
|
import { FeatureCollection, Geometry } from 'geojson';
|
|
3
4
|
import { i18n } from 'i18next';
|
|
4
5
|
import { PieChartData, BarChartMarker } from '@evergis/charts';
|
|
5
|
-
import { IconTypesKeys, IOption } from '@evergis/uilib-gl';
|
|
6
|
+
import { IconButtonShape, IconButtonSize, IconButtonVariant, IconTypesKeys, IOption } from '@evergis/uilib-gl';
|
|
6
7
|
import { CircleLayerSpecification, FillLayerSpecification, LineLayerSpecification } from 'maplibre-gl';
|
|
7
8
|
import { AttributeType, EqlRequestDc, FeatureDc, OgcGeometryType, PagedFeaturesListDc, PositionDc, QueryLayerServiceInfoDc, RemoteTaskStatus, StringSubType, AttributesConfigurationDc } from '@evergis/api';
|
|
8
9
|
import { FeatureAttributeValue, EditGeometryType, ThemeName } from '../../types';
|
|
@@ -301,7 +302,9 @@ export interface ConfigLayoutOptions {
|
|
|
301
302
|
* Игнорируется при `twoColumns` (легенда справа) и при отсутствии подписи оси X.
|
|
302
303
|
*/
|
|
303
304
|
legendInline?: boolean;
|
|
304
|
-
/**
|
|
305
|
+
/**
|
|
306
|
+
* Вписать график Chart в контейнер: по ширине всегда, по высоте — при заданной высоте (object-fit: contain).
|
|
307
|
+
*/
|
|
305
308
|
fill?: boolean;
|
|
306
309
|
/**
|
|
307
310
|
* Горизонтальное выравнивание: содержимого заголовка контейнера, а для плиток
|
|
@@ -413,6 +416,27 @@ export interface ConfigChartOptions {
|
|
|
413
416
|
/** Подписи осей и подпись оси X. Работает только у линейного графика. */
|
|
414
417
|
axis?: ConfigChartAxisOptions;
|
|
415
418
|
}
|
|
419
|
+
/**
|
|
420
|
+
* Внешний вид кнопки (`IconButton` из uilib-gl). Скругление вручную — `radius` (px)
|
|
421
|
+
* из {@link ConfigLayoutOptions}, иконка — `icon` из {@link ConfigVisualOptions}.
|
|
422
|
+
*/
|
|
423
|
+
export interface ConfigButtonOptions {
|
|
424
|
+
/** Заливка и обводка: `solid` | `soft` | `outline` | `ghost`. */
|
|
425
|
+
variant?: IconButtonVariant;
|
|
426
|
+
/** Произвольный CSS-цвет; перекрывает флаги цвета. Оттенки наведения и нажатия вычисляются. */
|
|
427
|
+
color?: string;
|
|
428
|
+
/** Флаги цвета, приоритет: primary → secondary → error → violet. Без флагов и `color` — нейтральный. */
|
|
429
|
+
primary?: boolean;
|
|
430
|
+
secondary?: boolean;
|
|
431
|
+
error?: boolean;
|
|
432
|
+
violet?: boolean;
|
|
433
|
+
/** Высота 24 / 32 / 40 / 48. */
|
|
434
|
+
size?: IconButtonSize;
|
|
435
|
+
/** `square` — скругление по размеру, `round` — пилюля/круг. */
|
|
436
|
+
shape?: IconButtonShape;
|
|
437
|
+
/** Иконка справа от текста. */
|
|
438
|
+
iconRight?: boolean;
|
|
439
|
+
}
|
|
416
440
|
/** Иконки/изображения. */
|
|
417
441
|
export interface ConfigVisualOptions {
|
|
418
442
|
icon?: IconTypesKeys;
|
|
@@ -561,7 +585,7 @@ export type ConfigNotifications = "all" | "my" | string[];
|
|
|
561
585
|
* `Pick<ConfigOptions, ...>`, продолжают работать. Для нового кода предпочтительно делать
|
|
562
586
|
* `Pick<Config<Domain>Options, ...>` — это лучше документирует, к какому домену относится опция.
|
|
563
587
|
*/
|
|
564
|
-
export interface ConfigOptions extends ConfigLayoutOptions, ConfigTypographyOptions, ConfigExpandableOptions, ConfigDataSourceBindingOptions, ConfigChartOptions, ConfigVisualOptions, ConfigTextDisplayOptions, ConfigCollectionOptions, ConfigMapLayerOptions, ConfigEditOptions, ConfigVoteOptions, ConfigMiscOptions {
|
|
588
|
+
export interface ConfigOptions extends ConfigLayoutOptions, ConfigTypographyOptions, ConfigExpandableOptions, ConfigDataSourceBindingOptions, ConfigChartOptions, ConfigButtonOptions, ConfigVisualOptions, ConfigTextDisplayOptions, ConfigCollectionOptions, ConfigMapLayerOptions, ConfigEditOptions, ConfigVoteOptions, ConfigMiscOptions {
|
|
565
589
|
}
|
|
566
590
|
/**
|
|
567
591
|
* Настройки атрибута источника данных, заданные в конфиге.
|
|
@@ -739,6 +763,9 @@ export interface ConfigFilter {
|
|
|
739
763
|
resetFilters?: string[];
|
|
740
764
|
}
|
|
741
765
|
export interface FilterItem {
|
|
766
|
+
eventData?: ActionEventData;
|
|
767
|
+
syntheticOther?: boolean;
|
|
768
|
+
rawName?: string;
|
|
742
769
|
name: string;
|
|
743
770
|
value: string | number;
|
|
744
771
|
color: string;
|
|
@@ -767,7 +794,7 @@ export type TreeFilterValue = Record<string, Array<string | number>>;
|
|
|
767
794
|
*/
|
|
768
795
|
export type FeaturesFilterValue = FeatureCollection<null, Record<string, FeatureAttributeValue>>;
|
|
769
796
|
export interface SelectedFilter {
|
|
770
|
-
value: string | number | string[] | number[] | Date | Date[] | TreeFilterValue | FeaturesFilterValue;
|
|
797
|
+
value: string | number | boolean | string[] | number[] | Date | Date[] | TreeFilterValue | FeaturesFilterValue;
|
|
771
798
|
min?: string | number | Date;
|
|
772
799
|
max?: string | number | Date;
|
|
773
800
|
}
|
|
@@ -779,8 +806,8 @@ export interface ConfigLayer {
|
|
|
779
806
|
opacity?: number;
|
|
780
807
|
condition?: string | string[];
|
|
781
808
|
query?: string;
|
|
782
|
-
parameters?: Record<string,
|
|
783
|
-
geometries?:
|
|
809
|
+
parameters?: Record<string, unknown>;
|
|
810
|
+
geometries?: unknown[];
|
|
784
811
|
isVisible?: boolean;
|
|
785
812
|
selectable?: boolean;
|
|
786
813
|
filterZoomTo?: boolean;
|
|
@@ -803,7 +830,7 @@ export interface ConfigTask {
|
|
|
803
830
|
alias?: string;
|
|
804
831
|
description?: string;
|
|
805
832
|
icon?: string;
|
|
806
|
-
params?: Record<string,
|
|
833
|
+
params?: Record<string, unknown>;
|
|
807
834
|
subType?: string;
|
|
808
835
|
resourceId?: string;
|
|
809
836
|
owner?: string;
|
|
@@ -849,6 +876,7 @@ export interface ConfigModal {
|
|
|
849
876
|
id: string;
|
|
850
877
|
options?: ConfigModalOptions;
|
|
851
878
|
dataSources?: ConfigDataSource[];
|
|
879
|
+
actions?: ConfigActionDefinition[];
|
|
852
880
|
children: ConfigModalContentItem[];
|
|
853
881
|
}
|
|
854
882
|
export interface ConfigContainerHeader {
|
|
@@ -859,6 +887,7 @@ export interface ConfigContainerHeader {
|
|
|
859
887
|
options?: ConfigOptions;
|
|
860
888
|
}
|
|
861
889
|
export interface ConfigContainer {
|
|
890
|
+
actions?: ConfigActionDefinition[];
|
|
862
891
|
layers?: ConfigLayer[];
|
|
863
892
|
children: ConfigContainerChild[];
|
|
864
893
|
dataSources?: ConfigDataSource[];
|
|
@@ -883,7 +912,8 @@ export type FilterType = "checkbox" | "rangeNumber" | "rangeDate" | "text" | "dr
|
|
|
883
912
|
* `id`, см. parent-specific child-типы.
|
|
884
913
|
*/
|
|
885
914
|
export type ConfigElementType = "text" | "attributeAlias" | "attributeValue" | "attributeUnits" | "attributeDescription" | "layerName" | "control" | "image" | "slideshow" | "svg" | "icon" | "tooltip" | "tags" | "link" | "button" | "camera" | "chart" | "legend" | "markdown" | "uploader" | "modal" | "table";
|
|
886
|
-
export interface ConfigContainerChild extends Partial<ConfigContainer> {
|
|
915
|
+
export interface ConfigContainerChild extends Omit<Partial<ConfigContainer>, "actions"> {
|
|
916
|
+
actions?: (ConfigActionDefinition | ConfigActionInvocation)[];
|
|
887
917
|
id?: string;
|
|
888
918
|
/**
|
|
889
919
|
* Узел-лист. Кроме элементов сюда попадают фильтры — дети FiltersContainer тоже узлы конфига,
|
|
@@ -1000,6 +1030,9 @@ export interface ContainerProps {
|
|
|
1000
1030
|
}
|
|
1001
1031
|
export type PieChartDisplayedData = Array<Omit<PieChartData, "value"> & {
|
|
1002
1032
|
value: string | number;
|
|
1033
|
+
eventData?: ActionEventData;
|
|
1034
|
+
syntheticOther?: boolean;
|
|
1035
|
+
rawName?: string;
|
|
1003
1036
|
}>;
|
|
1004
1037
|
export type DataSourcePromise = PromiseSettledResult<EqlDataSource | PagedFeaturesListDc>;
|
|
1005
1038
|
export interface FetchedDataSource {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { QueryLayerServiceInfoDc } from '@evergis/api';
|
|
2
2
|
import { ClientFeatureAttribute, ConfigFilter, SelectedFilters, WidgetDataSource } from '../types';
|
|
3
|
-
import { ConfigFilterStore } from './configString/types';
|
|
4
|
-
export declare const applyQueryFilters: ({ parameters: configParameters, filters: configFilters, selectedFilters, dashboard, geometry, extent, zoomLevel, projectName, projectAlias, attributes, layerInfo, dataSources, }: {
|
|
5
|
-
|
|
3
|
+
import { ConfigFilterStore, ConfigStringSources } from './configString/types';
|
|
4
|
+
export declare const applyQueryFilters: ({ contextSources, parameters: configParameters, filters: configFilters, selectedFilters, dashboard, geometry, extent, zoomLevel, projectName, projectAlias, attributes, layerInfo, dataSources, }: {
|
|
5
|
+
contextSources?: ConfigStringSources;
|
|
6
|
+
parameters: Record<string, unknown>;
|
|
6
7
|
filters: ConfigFilter[];
|
|
7
8
|
selectedFilters?: SelectedFilters;
|
|
8
9
|
dashboard?: ConfigFilterStore;
|
|
@@ -14,4 +15,4 @@ export declare const applyQueryFilters: ({ parameters: configParameters, filters
|
|
|
14
15
|
attributes?: ClientFeatureAttribute[];
|
|
15
16
|
layerInfo?: QueryLayerServiceInfoDc;
|
|
16
17
|
dataSources: WidgetDataSource[];
|
|
17
|
-
}) => Record<string,
|
|
18
|
+
}) => Record<string, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const checkEqualOrIncludes: <T extends string | number | Date>(arrayOrSingle: T | T[], value: T) => boolean;
|
|
1
|
+
export declare const checkEqualOrIncludes: <T extends string | number | boolean | Date>(arrayOrSingle: T | T[], value: T) => boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const FILTER_PREFIX = "%";
|
|
2
|
+
export declare const PROVIDER_PREFIX = "$";
|
|
3
|
+
export declare enum ProviderPrefix {
|
|
4
|
+
/** `$card:<слой>:<поле>` — атрибут объекта карточки. */
|
|
5
|
+
Card = "card",
|
|
6
|
+
/**
|
|
7
|
+
* Ближайший дашборд, в ряд к `%` своего виджета: `$dashboard:<фильтр>[.свойство]` — его фильтр,
|
|
8
|
+
* `$dashboard:<датасорс>:<поле>` — поле первой строки его датасорса.
|
|
9
|
+
*/
|
|
10
|
+
Dashboard = "dashboard"
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Все подстановки строки конфига одной грамматикой, по группам:
|
|
14
|
+
* 1–2 `$dashboard:<датасорс>:<поле>`, 3–4 `$dashboard:<фильтр>[.свойство]`, 5–6 `$card:<слой>:<поле>`,
|
|
15
|
+
* 7–8 `%<фильтр>[.свойство]`, 9 `{<атрибут>}`. Форма датасорса проверяется раньше формы фильтра:
|
|
16
|
+
* их различает второе двоеточие. Имя фильтра — `\w+` целиком, поэтому `%name` не цепляет начало
|
|
17
|
+
* `%name2`, а точка в конце предложения («за %year.») не считается свойством.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CONFIG_TOKEN_REGEXP: RegExp;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ConfigActionToken, ConfigStringSources, ResolvedConfigToken } from './types';
|
|
2
|
+
/** #field берётся из первой feature ответа задачи; $event/$params — из локального контекста цепочки. */
|
|
3
|
+
export declare const resolveActionToken: (token: ConfigActionToken, sources: ConfigStringSources) => ResolvedConfigToken;
|
|
@@ -8,6 +8,9 @@ export type ConfigFilterStore = {
|
|
|
8
8
|
};
|
|
9
9
|
/** Всё, откуда строка конфига может взять значение. Префикс токена выбирает стор. */
|
|
10
10
|
export type ConfigStringSources = {
|
|
11
|
+
taskResponse?: unknown;
|
|
12
|
+
event?: Record<string, unknown>;
|
|
13
|
+
parameters?: Record<string, unknown>;
|
|
11
14
|
/** `%name` — фильтры своего виджета (в карточке — фильтры карточки). */
|
|
12
15
|
widget?: ConfigFilterStore;
|
|
13
16
|
/**
|
|
@@ -54,7 +57,13 @@ export type ConfigAttributeToken = {
|
|
|
54
57
|
name: string;
|
|
55
58
|
raw: string;
|
|
56
59
|
};
|
|
57
|
-
export type
|
|
60
|
+
export type ConfigActionToken = {
|
|
61
|
+
kind: "action";
|
|
62
|
+
scope: "result" | "event" | "parameters";
|
|
63
|
+
path: string;
|
|
64
|
+
raw: string;
|
|
65
|
+
};
|
|
66
|
+
export type ConfigToken = ConfigActionToken | ConfigFilterToken | ConfigCardToken | ConfigDataSourceToken | ConfigAttributeToken;
|
|
58
67
|
/** Строка конфига, разобранная на литералы и токены. */
|
|
59
68
|
export type ConfigStringSegment = string | ConfigToken;
|
|
60
69
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { QueryLayerServiceConfigurationDc } from '@evergis/api';
|
|
2
2
|
import { ClientFeatureAttribute, ConfigFilter, SelectedFilters, WidgetDataSource } from '../types';
|
|
3
|
-
import { ConfigFilterStore } from './configString/types';
|
|
3
|
+
import { ConfigFilterStore, ConfigStringSources } from './configString/types';
|
|
4
4
|
type FormatDataSourceConditionParams = {
|
|
5
|
+
contextSources?: ConfigStringSources;
|
|
5
6
|
configFilters?: ConfigFilter[];
|
|
6
7
|
filters: SelectedFilters;
|
|
7
8
|
/** Датасорсы виджета — для `%name.prop` через `relatedDataSource` фильтра. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i18n } from 'i18next';
|
|
2
2
|
import { PieChartData } from '@evergis/charts';
|
|
3
|
-
import { ClientFeatureAttribute, ConfigContainerChild } from '../types';
|
|
4
|
-
export declare const getDataFromAttributes: (t: i18n["t"], config: ConfigContainerChild, attributes?: ClientFeatureAttribute[]) => PieChartData[];
|
|
3
|
+
import { ClientFeatureAttribute, ConfigContainerChild, FilterItem } from '../types';
|
|
4
|
+
export declare const getDataFromAttributes: (t: i18n["t"], config: ConfigContainerChild, attributes?: ClientFeatureAttribute[]) => (PieChartData & Partial<FilterItem>)[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { SelectedFilter, SelectedFilters } from '../types';
|
|
2
|
-
export declare const getSelectedFilterValue: (filterName: string, selectedFilters: SelectedFilters, defaultValue: SelectedFilter["value"]) => string | number | Date | import('../types').TreeFilterValue | import('../types').FeaturesFilterValue | (string | number | Date | import('../types').TreeFilterValue | import('../types').FeaturesFilterValue)[];
|
|
2
|
+
export declare const getSelectedFilterValue: (filterName: string, selectedFilters: SelectedFilters, defaultValue: SelectedFilter["value"]) => string | number | boolean | Date | import('../types').TreeFilterValue | import('../types').FeaturesFilterValue | (string | number | boolean | Date | import('../types').TreeFilterValue | import('../types').FeaturesFilterValue)[];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ActionNavigationFactory } from '../../components/Dashboard/actions/context/WidgetActionsProvider/types';
|
|
2
|
+
import { ConfigDataSource } from '../../components/Dashboard/types';
|
|
3
|
+
import { WidgetModalSnapshot } from '../../components/Dashboard/actions/modals/types';
|
|
1
4
|
import { FC, PropsWithChildren } from 'react';
|
|
2
5
|
import { CatalogResourceDc, ExtendedProjectInfoDc, QueryLayerServiceInfoDc } from '@evergis/api';
|
|
3
6
|
import { ConfigContainer, ConfigContainerChild, DashboardLayerPayload, DashboardState, LayerItemProps, SelectedFilters, WidgetDataSource } from '../../components';
|
|
@@ -21,13 +24,19 @@ export type DashboardContextProps = PropsWithChildren<{
|
|
|
21
24
|
* лежит внутри — применяется как `replaceObject(config, { id }, next)`.
|
|
22
25
|
*/
|
|
23
26
|
onContainerChange?: (config: ConfigContainerChild) => void;
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
/** События жизненного цикла модалок. Управляемые окна используют общий хост и отдельную область данных. */
|
|
28
|
+
isModalNotificationAllowed?: (senderName: string | undefined, source: ConfigDataSource, layerName: string) => boolean;
|
|
29
|
+
onModalContextChange?: (modalId: string, snapshot: WidgetModalSnapshot | null) => void;
|
|
30
|
+
onModalToggle?: (modalId: string, isOpen: boolean, metadata?: {
|
|
31
|
+
managed: boolean;
|
|
32
|
+
}) => void;
|
|
30
33
|
filters?: SelectedFilters;
|
|
34
|
+
/** Синхронный снимок фильтров для последовательных действий. */
|
|
35
|
+
actionNavigation?: ActionNavigationFactory;
|
|
36
|
+
getActionFilters?: () => SelectedFilters;
|
|
37
|
+
/** Меняется при переходе на другую страницу, проект или карточку. */
|
|
38
|
+
actionContextKey?: string;
|
|
39
|
+
actionsActive?: boolean;
|
|
31
40
|
dashboardLayers?: DashboardState["layers"];
|
|
32
41
|
setDashboardLayer?: (props: DashboardLayerPayload) => void;
|
|
33
42
|
selectedTabId?: string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { ActionNavigationFactory } from '../../components/Dashboard/actions/context/WidgetActionsProvider/types';
|
|
2
|
+
import { ConfigDataSource } from '../../components/Dashboard/types';
|
|
3
|
+
import { WidgetModalSnapshot } from '../../components/Dashboard/actions/modals/types';
|
|
1
4
|
import { PropsWithChildren } from 'react';
|
|
2
5
|
import { QueryLayerServiceInfoDc } from '@evergis/api';
|
|
3
6
|
import { ClientFeatureAttribute, ConfigContainer, ConfigContainerChild, EditAttributeValue, SelectedFilters, WidgetDataSource } from '../../components';
|
|
@@ -14,7 +17,11 @@ export type FeatureCardContextSettings = PropsWithChildren<{
|
|
|
14
17
|
/** Контейнер изменил собственный конфиг — см. одноимённый проп `DashboardProvider`. */
|
|
15
18
|
onContainerChange?: (config: ConfigContainerChild) => void;
|
|
16
19
|
/** Модалка открылась или закрылась — см. одноимённый проп `DashboardProvider`. */
|
|
17
|
-
|
|
20
|
+
isModalNotificationAllowed?: (senderName: string | undefined, source: ConfigDataSource, layerName: string) => boolean;
|
|
21
|
+
onModalContextChange?: (modalId: string, snapshot: WidgetModalSnapshot | null) => void;
|
|
22
|
+
onModalToggle?: (modalId: string, isOpen: boolean, metadata?: {
|
|
23
|
+
managed: boolean;
|
|
24
|
+
}) => void;
|
|
18
25
|
isFeatureEditable?: boolean;
|
|
19
26
|
hasCopyRights?: boolean;
|
|
20
27
|
editOnly?: boolean;
|
|
@@ -23,6 +30,12 @@ export type FeatureCardContextSettings = PropsWithChildren<{
|
|
|
23
30
|
dataSources?: WidgetDataSource[];
|
|
24
31
|
loading?: boolean;
|
|
25
32
|
filters?: SelectedFilters;
|
|
33
|
+
/** Синхронный снимок фильтров для последовательных действий. */
|
|
34
|
+
actionNavigation?: ActionNavigationFactory;
|
|
35
|
+
getActionFilters?: () => SelectedFilters;
|
|
36
|
+
/** Меняется при переходе на другую страницу, проект или карточку. */
|
|
37
|
+
actionContextKey?: string;
|
|
38
|
+
actionsActive?: boolean;
|
|
26
39
|
changeFilters?: (filters: SelectedFilters) => void;
|
|
27
40
|
controls?: Record<string, EditAttributeValue>;
|
|
28
41
|
changeControls?: (controls: Record<string, EditAttributeValue>) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridEditSessionValue } from '
|
|
1
|
+
import { GridEditSessionValue } from '../../components/Dashboard/grid/types';
|
|
2
2
|
/**
|
|
3
3
|
* Сессия редактирования раскладки. Создаётся ВНЕШНИМ grid-узлом с `options.editMode`;
|
|
4
4
|
* вложенные сетки её только читают, собственный `editMode` у них игнорируется.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StructuredDataContextValue } from '
|
|
1
|
+
import { StructuredDataContextValue } from '../../components/Dashboard/containers/StructuredDataContainer/types';
|
|
2
2
|
/**
|
|
3
3
|
* Канал «контейнер → представление». Схему, строки и колбэки правки держит
|
|
4
4
|
* `StructuredDataContainer`, а рендерит их элемент-представление (`ElementTable`),
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PythonExecutionRequest } from '../../../hooks/task/runtime/types';
|
|
2
|
+
export declare const useOptionalTaskExecution: () => {
|
|
3
|
+
runTask: (request: PythonExecutionRequest) => import('../../../hooks/task/runtime/types').PythonExecutionHandle;
|
|
4
|
+
entries: import('..').TaskExecutionEntry[];
|
|
5
|
+
openLog: (runId: string) => void;
|
|
6
|
+
closeLog: () => void;
|
|
7
|
+
dismissTask: (runId: string) => void;
|
|
8
|
+
logRunId: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const useTaskExecution: () => {
|
|
11
|
+
runTask: (request: PythonExecutionRequest) => import('../../../hooks/task/runtime/types').PythonExecutionHandle;
|
|
12
|
+
entries: import('..').TaskExecutionEntry[];
|
|
13
|
+
openLog: (runId: string) => void;
|
|
14
|
+
closeLog: () => void;
|
|
15
|
+
dismissTask: (runId: string) => void;
|
|
16
|
+
logRunId: string | null;
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PythonExecutionHandle, PythonExecutionRequest } from '../../hooks/task/runtime/types';
|
|
2
|
+
import { ServerNotificationsContextProps } from '../ServerNotificationsContext/types';
|
|
3
|
+
export interface TaskExecutionEntry {
|
|
4
|
+
handle: PythonExecutionHandle;
|
|
5
|
+
request: PythonExecutionRequest;
|
|
6
|
+
}
|
|
7
|
+
export interface TaskExecutionContextValue {
|
|
8
|
+
runTask: (request: PythonExecutionRequest, transport?: ServerNotificationsContextProps) => PythonExecutionHandle;
|
|
9
|
+
entries: TaskExecutionEntry[];
|
|
10
|
+
openLog: (runId: string) => void;
|
|
11
|
+
closeLog: () => void;
|
|
12
|
+
dismissTask: (runId: string) => void;
|
|
13
|
+
logRunId: string | null;
|
|
14
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { INotificationItem } from '@evergis/uilib-gl';
|
|
2
|
+
import { TaskExecutionEntry } from '../types';
|
|
3
|
+
import { GlobalContextProps } from '../../GlobalContext/types';
|
|
4
|
+
export declare const createTaskNotification: ({ handle, request }: TaskExecutionEntry, translate: GlobalContextProps["t"], open: () => void, dismiss: () => void) => INotificationItem;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { WidgetActionsValue } from '../../components/Dashboard/actions/context/bindingTypes';
|
|
2
|
+
import { WidgetType } from '../../components/Dashboard/types';
|
|
3
|
+
export declare const WidgetActionsContext: import('react').Context<Partial<Record<WidgetType, WidgetActionsValue>>>;
|
|
4
|
+
export declare const useWidgetActions: (type: WidgetType) => WidgetActionsValue;
|
package/dist/contexts/index.d.ts
CHANGED
|
@@ -3,3 +3,15 @@ export * from './FeatureCardContext';
|
|
|
3
3
|
export * from './GlobalContext';
|
|
4
4
|
export * from './MapContext';
|
|
5
5
|
export * from './ServerNotificationsContext';
|
|
6
|
+
export * from './TaskExecutionContext';
|
|
7
|
+
export * from './WidgetModalsContext';
|
|
8
|
+
export * from './ModalDataContext';
|
|
9
|
+
export * from './ChartActionsContext';
|
|
10
|
+
export * from './WidgetActionsContext';
|
|
11
|
+
export * from './FillContext';
|
|
12
|
+
export * from './ChartPlotContext';
|
|
13
|
+
export * from './StructuredDataContext';
|
|
14
|
+
export * from './GridEditContext';
|
|
15
|
+
export * from './ActionContext';
|
|
16
|
+
export * from './ActionNodeContext';
|
|
17
|
+
export * from './ActionScopeContext';
|