@evergis/react 4.0.150 → 4.0.152

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 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,11 @@
1
+ import { WidgetType } from '../../../types';
2
+ /**
3
+ * Видимость диалога модалки. Флаг локальный: у одного `modalId` бывает несколько кнопок (слот
4
+ * `modal` в строках `DataSource`), и общий флаг открыл бы все диалоги сразу. Хост узнаёт об
5
+ * открытии и закрытии через `onModalToggle` — чтобы грузить `dataSources` модалки только пока она открыта.
6
+ */
7
+ export declare const useModalOpen: (type: WidgetType, modalId?: string) => {
8
+ isOpen: boolean;
9
+ handleOpen: () => void;
10
+ handleClose: () => void;
11
+ };
@@ -11,6 +11,7 @@ export * from './useFetchImageWithAuth';
11
11
  export * from './useFetchWithAuth';
12
12
  export * from './useChartChange';
13
13
  export * from './useChartData';
14
+ export * from './useConfigDataSources';
14
15
  export * from './useDashboardHeader';
15
16
  export * from './useDataSourceLoading';
16
17
  export * from './useDataSources';
@@ -0,0 +1,7 @@
1
+ import { ConfigDataSource, WidgetType } from '../types';
2
+ /**
3
+ * Конфиги всех источников, доступных контейнерам виджета: страница с корнем и все модалки.
4
+ * Одноимённый источник модалки перекрывается страничным. Только для поиска по имени — в конфиг
5
+ * страницы не пишется: `currentPage` сохраняется обратно целиком, и модальные источники осели бы в нём.
6
+ */
7
+ export declare const useConfigDataSources: (type?: WidgetType) => ConfigDataSource[];
@@ -37,6 +37,7 @@ 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
+ onModalToggle: (modalId: string, isOpen: boolean) => void;
40
41
  isLoading: boolean;
41
42
  pageIndex: number;
42
43
  filters: import('../types').SelectedFilters;
@@ -705,6 +705,7 @@ export type ConfigModalContentItem = ConfigContainerChild | ConfigModalContentRe
705
705
  export interface ConfigModal {
706
706
  id: string;
707
707
  options?: ConfigModalOptions;
708
+ dataSources?: ConfigDataSource[];
708
709
  children: ConfigModalContentItem[];
709
710
  }
710
711
  export interface ConfigContainerHeader {
@@ -0,0 +1,6 @@
1
+ import { ConfigContainer, ConfigDataSource } from '../types';
2
+ /**
3
+ * Источники модалок конфига (`config.modals[].dataSources`) без дублей по имени — выигрывает первый.
4
+ * Без `modalIds` — источники всех модалок, иначе только перечисленных.
5
+ */
6
+ export declare const getModalsDataSources: (config?: ConfigContainer, modalIds?: string[]) => ConfigDataSource[];
@@ -39,6 +39,7 @@ export * from './getFilterComponent';
39
39
  export * from './getFilterSelectedItems';
40
40
  export * from './getFilterValue';
41
41
  export * from './getMapViewDataSources';
42
+ export * from './getModalsDataSources';
42
43
  export * from './getFormattedAttributes';
43
44
  export * from './getImageUrl';
44
45
  export * from './getLayerInfo';
@@ -21,6 +21,12 @@ export type DashboardContextProps = PropsWithChildren<{
21
21
  * лежит внутри — применяется как `replaceObject(config, { id }, next)`.
22
22
  */
23
23
  onContainerChange?: (config: ConfigContainerChild) => void;
24
+ /**
25
+ * Модалка `config.modals[].id` открылась или закрылась — хост грузит её `dataSources`, пока она
26
+ * открыта. Видимостью диалога управляет сам `ElementModal`: у одного `modalId` бывает несколько
27
+ * кнопок (слот `modal` в строках `DataSource`), общий флаг открыл бы все диалоги сразу.
28
+ */
29
+ onModalToggle?: (modalId: string, isOpen: boolean) => void;
24
30
  filters?: SelectedFilters;
25
31
  dashboardLayers?: DashboardState["layers"];
26
32
  setDashboardLayer?: (props: DashboardLayerPayload) => void;
@@ -13,6 +13,8 @@ export type FeatureCardContextSettings = PropsWithChildren<{
13
13
  editMode?: boolean;
14
14
  /** Контейнер изменил собственный конфиг — см. одноимённый проп `DashboardProvider`. */
15
15
  onContainerChange?: (config: ConfigContainerChild) => void;
16
+ /** Модалка открылась или закрылась — см. одноимённый проп `DashboardProvider`. */
17
+ onModalToggle?: (modalId: string, isOpen: boolean) => void;
16
18
  isFeatureEditable?: boolean;
17
19
  hasCopyRights?: boolean;
18
20
  editOnly?: boolean;