@evergis/react 4.0.100 → 4.0.101
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/constants.d.ts +3 -1
- package/dist/components/Dashboard/hooks/useRelatedDataSourceAttributes.d.ts +2 -2
- package/dist/components/Dashboard/types.d.ts +13 -0
- package/dist/components/Dashboard/utils/getAttributeConfigurationByName.d.ts +8 -0
- package/dist/components/Dashboard/utils/getDataSourceLayerInfo.d.ts +17 -0
- package/dist/components/Dashboard/utils/getLayerInfoAttribute.d.ts +3 -0
- package/dist/components/Dashboard/utils/index.d.ts +4 -0
- package/dist/components/Dashboard/utils/mergeAttributeConfigurations.d.ts +8 -0
- package/dist/index.js +8884 -8788
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +8883 -8792
- package/dist/react.esm.js.map +1 -1
- package/package.json +3 -2
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`!
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSObject } from 'styled-components';
|
|
2
|
-
import { AttributeType } from '@evergis/api';
|
|
2
|
+
import { AttributeType, QueryLayerServiceInfoDc } from '@evergis/api';
|
|
3
3
|
import { ConfigContainer, ConfigContainerChild } from './types';
|
|
4
4
|
export declare const CONFIG_PAGES_ID = "pages";
|
|
5
5
|
export declare const CONFIG_PAGE_ID = "page";
|
|
@@ -31,6 +31,8 @@ export declare const DEFAULT_ZOOM = 10;
|
|
|
31
31
|
export declare const NUMERIC_ATTRIBUTE_TYPES: AttributeType[];
|
|
32
32
|
export declare const GEOMETRY_ATTRIBUTE = "geometry";
|
|
33
33
|
export declare const DEFAULT_ID_ATTRIBUTE_NAME = "gid";
|
|
34
|
+
/** Заглушка для потребителей, ожидающих non-null layerInfo у источника без описания атрибутов. */
|
|
35
|
+
export declare const EMPTY_DATA_SOURCE_LAYER_INFO: QueryLayerServiceInfoDc;
|
|
34
36
|
export declare const DEFAULT_DROPDOWN_WIDTH = 312;
|
|
35
37
|
export declare const DEFAULT_FILTER_PADDING = 12;
|
|
36
38
|
/** Базовый отступ обёртки контейнера. Снимается, когда контейнер занимает ячейку целиком. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FeatureDc
|
|
1
|
+
import { FeatureDc } from '@evergis/api';
|
|
2
2
|
import { ConfigContainerChild, FetchedDataSource, WidgetType } from '../types';
|
|
3
3
|
export declare const useRelatedDataSourceAttributes: ({ type, elementConfig, dataSources, feature, }: {
|
|
4
4
|
type: WidgetType;
|
|
@@ -6,7 +6,7 @@ export declare const useRelatedDataSourceAttributes: ({ type, elementConfig, dat
|
|
|
6
6
|
dataSources: FetchedDataSource[];
|
|
7
7
|
feature?: FeatureDc;
|
|
8
8
|
}) => {
|
|
9
|
-
layerInfo: QueryLayerServiceInfoDc;
|
|
9
|
+
layerInfo: import('@evergis/api').QueryLayerServiceInfoDc;
|
|
10
10
|
attributes: import('../types').ClientFeatureAttribute[];
|
|
11
11
|
dataSource: import('../types').WidgetDataSource;
|
|
12
12
|
};
|
|
@@ -344,9 +344,22 @@ export interface ConfigMiscOptions {
|
|
|
344
344
|
*/
|
|
345
345
|
export interface ConfigOptions extends ConfigLayoutOptions, ConfigTypographyOptions, ConfigExpandableOptions, ConfigDataSourceBindingOptions, ConfigChartOptions, ConfigVisualOptions, ConfigTextDisplayOptions, ConfigCollectionOptions, ConfigMapLayerOptions, ConfigEditOptions, ConfigMiscOptions {
|
|
346
346
|
}
|
|
347
|
+
/**
|
|
348
|
+
* Настройки атрибута источника данных, заданные в конфиге.
|
|
349
|
+
* Накладываются поверх атрибутов слоя/ответа EQL: `stringFormat` мержится по полям,
|
|
350
|
+
* поэтому задавать нужно только то, что переопределяется.
|
|
351
|
+
*/
|
|
352
|
+
export interface ConfigDataSourceAttribute {
|
|
353
|
+
attributeName: string;
|
|
354
|
+
alias?: string;
|
|
355
|
+
type?: AttributeType;
|
|
356
|
+
stringFormat?: AttributeFormatConfigurationDc;
|
|
357
|
+
}
|
|
347
358
|
export interface ConfigDataSource {
|
|
348
359
|
name: string;
|
|
349
360
|
alias?: string;
|
|
361
|
+
/** Формат и метаданные атрибутов источника. Не путать с `options.attributes` (список имён у элемента). */
|
|
362
|
+
attributes?: ConfigDataSourceAttribute[];
|
|
350
363
|
condition?: string | string[];
|
|
351
364
|
ds?: string;
|
|
352
365
|
layerName?: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AttributeConfigurationDc, AttributesConfigurationDc } from '@evergis/api';
|
|
2
|
+
/**
|
|
3
|
+
* Находит конфигурацию атрибута по имени.
|
|
4
|
+
*
|
|
5
|
+
* `AttributesConfigurationDc["attributes"]` — массив, но часть источников отдаёт атрибуты
|
|
6
|
+
* объектом-мапой (см. нормализацию в `useDataSources`), поэтому поддерживаются обе формы.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getAttributeConfigurationByName: (attributes?: AttributesConfigurationDc["attributes"], name?: string) => AttributeConfigurationDc | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryLayerServiceInfoDc } from '@evergis/api';
|
|
2
|
+
import { ConfigDataSource, FetchedDataSource } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Резолвит layerInfo источника данных и накладывает поверх атрибуты из его конфига.
|
|
5
|
+
*
|
|
6
|
+
* База — реальный слой по `layerName`, а если слоя нет (EQL, python) — атрибуты из ответа.
|
|
7
|
+
* Возвращает `null`, когда атрибутов нет вообще: потребители отличают по этому «источник без
|
|
8
|
+
* описания атрибутов» от загруженного, и non-null сломал бы их loading/empty-state.
|
|
9
|
+
*
|
|
10
|
+
* Синтетическому layerInfo намеренно не задаётся `name` — по нему ищут скрытые атрибуты слоя
|
|
11
|
+
* и рендерят элемент `layerName`, имя источника данных дало бы там ложные срабатывания.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getDataSourceLayerInfo: ({ layerInfos, configDataSource, fetchedDataSource, }: {
|
|
14
|
+
layerInfos?: QueryLayerServiceInfoDc[];
|
|
15
|
+
configDataSource?: ConfigDataSource;
|
|
16
|
+
fetchedDataSource?: FetchedDataSource;
|
|
17
|
+
}) => QueryLayerServiceInfoDc | null;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AttributeConfigurationDc, QueryLayerServiceInfoDc } from '@evergis/api';
|
|
2
|
+
/** Достаёт конфигурацию атрибута по имени прямо из layerInfo, снимая повторяющийся каст конфигурации. */
|
|
3
|
+
export declare const getLayerInfoAttribute: (layerInfo?: QueryLayerServiceInfoDc, name?: string) => AttributeConfigurationDc | undefined;
|
|
@@ -13,6 +13,7 @@ export * from './formatConditionValue';
|
|
|
13
13
|
export * from './formatDataSourceCondition';
|
|
14
14
|
export * from './formatElementValue';
|
|
15
15
|
export * from './getAttributeByName';
|
|
16
|
+
export * from './getAttributeConfigurationByName';
|
|
16
17
|
export * from './getAttributesConfiguration';
|
|
17
18
|
export * from './getAttributeValue';
|
|
18
19
|
export * from './getChartAxes';
|
|
@@ -25,6 +26,7 @@ export * from './getDataFromAttributes';
|
|
|
25
26
|
export * from './getDataFromRelatedFeatures';
|
|
26
27
|
export * from './getDataSource';
|
|
27
28
|
export * from './getDataSourceFilterValue';
|
|
29
|
+
export * from './getDataSourceLayerInfo';
|
|
28
30
|
export * from './getDefaultConfig';
|
|
29
31
|
export * from './getElementValue';
|
|
30
32
|
export * from './getFeatureAttributes';
|
|
@@ -34,6 +36,7 @@ export * from './getFilterSelectedItems';
|
|
|
34
36
|
export * from './getFilterValue';
|
|
35
37
|
export * from './getFormattedAttributes';
|
|
36
38
|
export * from './getLayerInfo';
|
|
39
|
+
export * from './getLayerInfoAttribute';
|
|
37
40
|
export * from './getLayerInfoFromDataSources';
|
|
38
41
|
export * from './getPagesFromConfig';
|
|
39
42
|
export * from './getPagesFromProjectInfo';
|
|
@@ -55,6 +58,7 @@ export * from './isEmptyValue';
|
|
|
55
58
|
export * from './isHiddenEmptyValue';
|
|
56
59
|
export * from './isNotValidSelectedTab';
|
|
57
60
|
export * from './isVisibleContainer';
|
|
61
|
+
export * from './mergeAttributeConfigurations';
|
|
58
62
|
export * from './pieChartTooltipFromAttributes';
|
|
59
63
|
export * from './pieChartTooltipFromRelatedFeatures';
|
|
60
64
|
export * from './removeDataSource';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AttributesConfigurationDc } from '@evergis/api';
|
|
2
|
+
import { ConfigDataSourceAttribute } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Накладывает атрибуты из конфига источника поверх атрибутов слоя или ответа EQL.
|
|
5
|
+
* `stringFormat` мержится по полям — в конфиге задают только переопределяемое,
|
|
6
|
+
* остальное (в т.ч. критичный для форматирования `type`) наследуется от базы.
|
|
7
|
+
*/
|
|
8
|
+
export declare const mergeAttributeConfigurations: (base?: AttributesConfigurationDc["attributes"], overlay?: ConfigDataSourceAttribute[]) => AttributesConfigurationDc["attributes"];
|