@evergis/react 4.0.95 → 4.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dashboard/componentTypes.d.ts +19 -14
- package/dist/components/Dashboard/components/Chart/ChartFillContext.d.ts +8 -0
- package/dist/components/Dashboard/components/Chart/components/ChartWrapper.d.ts +1 -2
- package/dist/components/Dashboard/constants.d.ts +3 -2
- package/dist/components/Dashboard/containers/ChartContainer/styled.d.ts +2 -0
- package/dist/components/Dashboard/containers/DataSourceContainer/styled.d.ts +20 -0
- package/dist/components/Dashboard/containers/DataSourceProgressContainer/styled.d.ts +2 -1
- package/dist/components/Dashboard/containers/FiltersContainer/styled.d.ts +10 -1
- package/dist/components/Dashboard/containers/FiltersContainer/utils/getFilterWidth.d.ts +9 -0
- package/dist/components/Dashboard/containers/ImageContainer/styled.d.ts +2 -1
- package/dist/components/Dashboard/containers/LayersContainer/styled.d.ts +2 -1
- package/dist/components/Dashboard/containers/TaskContainer/styled.d.ts +2 -0
- package/dist/components/Dashboard/containers/TitleContainer/styled.d.ts +2 -0
- package/dist/components/Dashboard/containers/UploadContainer/styled.d.ts +4 -1
- package/dist/components/Dashboard/containers/registry.d.ts +1 -1
- package/dist/components/Dashboard/containers/styled.d.ts +2 -1
- package/dist/components/Dashboard/elements/ElementImage/styled.d.ts +5 -0
- package/dist/components/Dashboard/elements/ElementMarkdown/styled.d.ts +3 -1
- package/dist/components/Dashboard/hooks/index.d.ts +2 -0
- package/dist/components/Dashboard/hooks/useResizeWidth.d.ts +12 -0
- package/dist/components/Dashboard/hooks/useWrapperSize.d.ts +23 -0
- package/dist/components/Dashboard/styled.d.ts +18 -1
- package/dist/components/Dashboard/types.d.ts +34 -3
- package/dist/components/Dashboard/utils/getWrapperSizeStyle.d.ts +26 -4
- package/dist/components/Dashboard/utils/index.d.ts +1 -0
- package/dist/components/Dashboard/utils/toCssSize.d.ts +14 -0
- package/dist/index.js +2772 -2378
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +2766 -2381
- package/dist/react.esm.js.map +1 -1
- package/package.json +13 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueryLayerServiceInfoDc } from '@evergis/api';
|
|
2
|
-
import { ClientFeatureAttribute, ConfigContainer, ConfigContainerChild, ConfigContainerHeader, ConfigOptions, ContainerProps, ContainerTemplate, HeaderTemplate } from './types';
|
|
2
|
+
import { ClientFeatureAttribute, ConfigContainer, ConfigContainerChild, ConfigContainerHeader, ConfigOptions, ContainerProps, ContainerTemplate, HeaderTemplate, NumericSizeOptions } from './types';
|
|
3
3
|
export type ElementButtonOptions = Record<string, never>;
|
|
4
4
|
export interface ElementButtonConfig extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
5
5
|
type?: "button";
|
|
@@ -16,7 +16,7 @@ export interface ElementCameraConfig extends Omit<ConfigContainerChild, "options
|
|
|
16
16
|
export interface ElementCameraProps extends Omit<ContainerProps, "elementConfig"> {
|
|
17
17
|
elementConfig?: ElementCameraConfig;
|
|
18
18
|
}
|
|
19
|
-
export type ElementChartOptions = Pick<ConfigOptions, "column" | "markers" | "showLabels" | "showMarkers" | "showTotal" | "totalWord" | "totalAttribute" | "expandable" | "expanded" | "chartType" | "relatedDataSources" | "defaultColor" | "dotSnapping" | "
|
|
19
|
+
export type ElementChartOptions = Pick<ConfigOptions, "column" | "markers" | "showLabels" | "showMarkers" | "showTotal" | "totalWord" | "totalAttribute" | "expandable" | "expanded" | "chartType" | "relatedDataSources" | "defaultColor" | "dotSnapping" | "radius" | "padding" | "fontColor" | "angle" | "barWidth" | "cornerRadius"> & NumericSizeOptions;
|
|
20
20
|
export interface ElementChartConfig extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
21
21
|
type?: "chart";
|
|
22
22
|
options?: ElementChartOptions;
|
|
@@ -32,7 +32,7 @@ export interface ElementChipsConfig extends Omit<ConfigContainerChild, "options"
|
|
|
32
32
|
export interface ElementChipsProps extends Omit<ContainerProps, "elementConfig"> {
|
|
33
33
|
elementConfig?: ElementChipsConfig;
|
|
34
34
|
}
|
|
35
|
-
export type ElementControlOptions = Pick<ConfigOptions, "relatedDataSource" | "label" | "
|
|
35
|
+
export type ElementControlOptions = Pick<ConfigOptions, "relatedDataSource" | "label" | "control" | "placeholder"> & Pick<NumericSizeOptions, "width">;
|
|
36
36
|
export interface ElementControlConfig extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
37
37
|
type?: "control";
|
|
38
38
|
options?: ElementControlOptions;
|
|
@@ -48,7 +48,7 @@ export interface ElementIconConfig extends Omit<ConfigContainerChild, "options"
|
|
|
48
48
|
export interface ElementIconProps extends Omit<ContainerProps, "elementConfig"> {
|
|
49
49
|
elementConfig?: ElementIconConfig;
|
|
50
50
|
}
|
|
51
|
-
export type ElementImageOptions = Pick<ConfigOptions, "width">;
|
|
51
|
+
export type ElementImageOptions = Pick<ConfigOptions, "width" | "height" | "fit">;
|
|
52
52
|
export interface ElementImageConfig extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
53
53
|
type?: "image";
|
|
54
54
|
options?: ElementImageOptions;
|
|
@@ -74,7 +74,7 @@ export interface ElementLinkConfig extends Omit<ConfigContainerChild, "options"
|
|
|
74
74
|
export interface ElementLinkProps extends Omit<ContainerProps, "elementConfig"> {
|
|
75
75
|
elementConfig?: ElementLinkConfig;
|
|
76
76
|
}
|
|
77
|
-
export type ElementMarkdownOptions = Pick<ConfigOptions, "expandLength">;
|
|
77
|
+
export type ElementMarkdownOptions = Pick<ConfigOptions, "expandLength" | "noMargin">;
|
|
78
78
|
export interface ElementMarkdownConfig extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
79
79
|
type?: "markdown";
|
|
80
80
|
options?: ElementMarkdownOptions;
|
|
@@ -98,7 +98,7 @@ export interface ElementSlideshowConfig extends Omit<ConfigContainerChild, "opti
|
|
|
98
98
|
export interface ElementSlideshowProps extends Omit<ContainerProps, "elementConfig"> {
|
|
99
99
|
elementConfig?: ElementSlideshowConfig;
|
|
100
100
|
}
|
|
101
|
-
export type ElementSvgOptions = Pick<ConfigOptions, "
|
|
101
|
+
export type ElementSvgOptions = Pick<ConfigOptions, "fontColor"> & NumericSizeOptions;
|
|
102
102
|
export interface ElementSvgConfig extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
103
103
|
type?: "svg";
|
|
104
104
|
options?: ElementSvgOptions;
|
|
@@ -154,7 +154,7 @@ export interface CameraContainerConfig extends Omit<ConfigContainerChild, "optio
|
|
|
154
154
|
export interface CameraContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
155
155
|
elementConfig?: CameraContainerConfig;
|
|
156
156
|
}
|
|
157
|
-
export type ChartContainerOptions = Pick<ConfigOptions, "twoColumns" | "hideEmpty">;
|
|
157
|
+
export type ChartContainerOptions = Pick<ConfigOptions, "twoColumns" | "hideEmpty" | "width" | "height" | "chartFill">;
|
|
158
158
|
export interface ChartAliasChild extends Omit<ConfigContainerChild, "id"> {
|
|
159
159
|
id: "alias";
|
|
160
160
|
}
|
|
@@ -185,7 +185,7 @@ export interface ChartContainerConfig extends Omit<ConfigContainerChild, "option
|
|
|
185
185
|
export interface ChartContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
186
186
|
elementConfig?: ChartContainerConfig;
|
|
187
187
|
}
|
|
188
|
-
export type ContainersGroupContainerOptions = Pick<ConfigOptions, "column" | "expandable" | "expanded" | "width" | "height">;
|
|
188
|
+
export type ContainersGroupContainerOptions = Pick<ConfigOptions, "column" | "expandable" | "expanded" | "width" | "height" | "alignItems">;
|
|
189
189
|
export interface ContainersGroupContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
190
190
|
templateName?: ContainerTemplate.ContainersGroup;
|
|
191
191
|
options?: ContainersGroupContainerOptions;
|
|
@@ -193,7 +193,7 @@ export interface ContainersGroupContainerConfig extends Omit<ConfigContainerChil
|
|
|
193
193
|
export interface ContainersGroupContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
194
194
|
elementConfig?: ContainersGroupContainerConfig;
|
|
195
195
|
}
|
|
196
|
-
export type DataSourceContainerOptions = Pick<ConfigOptions, "column" | "relatedDataSource" | "expandable" | "expanded" | "width" | "height">;
|
|
196
|
+
export type DataSourceContainerOptions = Pick<ConfigOptions, "column" | "relatedDataSource" | "innerTemplateName" | "expandable" | "expanded" | "width" | "height">;
|
|
197
197
|
export interface DataSourceContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
198
198
|
templateName?: ContainerTemplate.DataSource;
|
|
199
199
|
options?: DataSourceContainerOptions;
|
|
@@ -205,7 +205,7 @@ export type DataSourceInnerContainerOptions = Pick<ConfigOptions, "relatedDataSo
|
|
|
205
205
|
export interface DataSourceInnerContainerConfig extends Omit<ConfigContainerChild, "options"> {
|
|
206
206
|
options?: DataSourceInnerContainerOptions;
|
|
207
207
|
}
|
|
208
|
-
export type DataSourceProgressContainerOptions = Pick<ConfigOptions, "maxValue" | "showTotal" | "relatedDataSource" | "expandable" | "expanded" | "shownItems" | "width" | "height">;
|
|
208
|
+
export type DataSourceProgressContainerOptions = Pick<ConfigOptions, "maxValue" | "showTotal" | "relatedDataSource" | "innerTemplateName" | "expandable" | "expanded" | "shownItems" | "otherItems" | "width" | "height">;
|
|
209
209
|
export interface DataSourceProgressContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
210
210
|
templateName?: ContainerTemplate.DataSourceProgress;
|
|
211
211
|
options?: DataSourceProgressContainerOptions;
|
|
@@ -322,7 +322,12 @@ export interface ExportPdfContainerProps extends Omit<ContainerProps, "elementCo
|
|
|
322
322
|
elementConfig?: ExportPdfContainerConfig;
|
|
323
323
|
}
|
|
324
324
|
export type FiltersContainerOptions = Pick<ConfigOptions, "padding" | "bgColor" | "fontColor" | "fontSize" | "expandable" | "expanded" | "width" | "height">;
|
|
325
|
-
|
|
325
|
+
/**
|
|
326
|
+
* Опции ребёнка FiltersContainer. Набор — объединение того, что реально читают все восемь
|
|
327
|
+
* реализаций фильтра: dropdown берёт `variants`/`noEmptyOption`, text — `searchFilterName`
|
|
328
|
+
* и `multiSelect`, chips — цвета и иконку, rangeNumber — `step` и границы, rangeDate — `withTime`.
|
|
329
|
+
*/
|
|
330
|
+
export type FilterChildOptions = Pick<ConfigOptions, "filterName" | "searchFilterName" | "label" | "placeholder" | "control" | "controls" | "relatedDataSource" | "minValue" | "maxValue" | "step" | "withTime" | "multiSelect" | "variants" | "noEmptyOption" | "width" | "height" | "align" | "shownItems" | "icon" | "iconAttribute" | "colorAttribute" | "fontColor" | "backgroundColor" | "maxTextWidth">;
|
|
326
331
|
export interface FilterChild extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
327
332
|
/** {@link FilterType} оставляем строкой, чтобы не плодить два почти одинаковых union-а в `type`. */
|
|
328
333
|
type?: ConfigContainerChild["type"];
|
|
@@ -344,7 +349,7 @@ export interface IconContainerConfig extends Omit<ConfigContainerChild, "options
|
|
|
344
349
|
export interface IconContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
345
350
|
elementConfig?: IconContainerConfig;
|
|
346
351
|
}
|
|
347
|
-
export type ImageContainerOptions =
|
|
352
|
+
export type ImageContainerOptions = Pick<ConfigOptions, "width" | "height">;
|
|
348
353
|
export interface ImageContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
349
354
|
templateName?: ContainerTemplate.Image;
|
|
350
355
|
options?: ImageContainerOptions;
|
|
@@ -387,7 +392,7 @@ export interface ProgressContainerConfig extends Omit<ConfigContainerChild, "opt
|
|
|
387
392
|
export interface ProgressContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
388
393
|
elementConfig?: ProgressContainerConfig;
|
|
389
394
|
}
|
|
390
|
-
export type RoundedBackgroundContainerOptions = Pick<ConfigOptions, "maxLength" | "center" | "fontColor" | "innerTemplateStyle" | "inlineUnits" | "big" | "bigIcon" | "hideEmpty" | "colorAttribute">;
|
|
395
|
+
export type RoundedBackgroundContainerOptions = Pick<ConfigOptions, "maxLength" | "wordBreak" | "center" | "fontColor" | "innerTemplateStyle" | "inlineUnits" | "big" | "bigIcon" | "hideEmpty" | "colorAttribute">;
|
|
391
396
|
export interface RoundedBackgroundContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
392
397
|
templateName?: ContainerTemplate.RoundedBackground;
|
|
393
398
|
options?: RoundedBackgroundContainerOptions;
|
|
@@ -424,7 +429,7 @@ export interface TaskContainerConfig extends Omit<ConfigContainerChild, "options
|
|
|
424
429
|
export interface TaskContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
425
430
|
elementConfig?: TaskContainerConfig;
|
|
426
431
|
}
|
|
427
|
-
export type TitleContainerOptions = Pick<ConfigOptions, "simple" | "downloadById">;
|
|
432
|
+
export type TitleContainerOptions = Pick<ConfigOptions, "simple" | "downloadById" | "align">;
|
|
428
433
|
export interface TitleContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
429
434
|
templateName?: ContainerTemplate.Title;
|
|
430
435
|
options?: TitleContainerOptions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Флаг «растянуть график на всю ширину контейнера» (`options.chartFill` контейнера Chart).
|
|
3
|
+
*
|
|
4
|
+
* Компонент `Chart` рендерится через `renderElement({ id: "chart" })` и получает только дочерний
|
|
5
|
+
* узел `{ id: "chart" }` — опции контейнера до него не доходят. `ChartContainer` оборачивает
|
|
6
|
+
* график в провайдер этого контекста, а `Chart` читает флаг через `useContext`.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ChartFillContext: import('react').Context<boolean>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import { ChartContainerProps } from '../types';
|
|
3
|
-
export declare const ChartWrapper:
|
|
2
|
+
export declare const ChartWrapper: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<ChartContainerProps & import('react').RefAttributes<HTMLDivElement>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
2
|
import { AttributeType } from '@evergis/api';
|
|
3
3
|
import { ConfigContainer, ConfigContainerChild } from './types';
|
|
4
4
|
export declare const CONFIG_PAGES_ID = "pages";
|
|
@@ -33,4 +33,5 @@ export declare const GEOMETRY_ATTRIBUTE = "geometry";
|
|
|
33
33
|
export declare const DEFAULT_ID_ATTRIBUTE_NAME = "gid";
|
|
34
34
|
export declare const DEFAULT_DROPDOWN_WIDTH = 312;
|
|
35
35
|
export declare const DEFAULT_FILTER_PADDING = 12;
|
|
36
|
-
|
|
36
|
+
/** Базовый отступ обёртки контейнера. Снимается, когда контейнер занимает ячейку целиком. */
|
|
37
|
+
export declare const BASE_CONTAINER_STYLE: CSSObject;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Обёртка записей источника.
|
|
3
|
+
*
|
|
4
|
+
* В ряду (`column: false`) записи переносятся на новую строку. Без переноса они дрались бы за
|
|
5
|
+
* одну строку: обёртка каждой записи — flex-элемент и ужимается, а внутренний шаблон (плашка
|
|
6
|
+
* RoundedBackground имеет жёсткие 9rem) — нет, поэтому записи наезжали бы друг на друга.
|
|
7
|
+
*
|
|
8
|
+
* `flex-wrap` намеренно не вынесен в row-ветку самого `Container`: там дети — карточки
|
|
9
|
+
* контейнеров шириной 100%, и перенос уложил бы их по одной на строку, сломав ряд у
|
|
10
|
+
* ContainersGroup.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DataSourceContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & import('../../styled').ContainerRootProps & {
|
|
13
|
+
isTitle?: boolean;
|
|
14
|
+
isColumn?: boolean;
|
|
15
|
+
isMain?: boolean;
|
|
16
|
+
noBorders?: boolean;
|
|
17
|
+
$alignItems?: import('../..').AlignItems;
|
|
18
|
+
} & {
|
|
19
|
+
$isRow?: boolean;
|
|
20
|
+
}, never>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { ContainerRootProps } from '../../styled';
|
|
2
|
+
export declare const DataSourceProgressContainerWrapper: import('styled-components').StyledComponent<"div", any, ContainerRootProps, never>;
|
|
2
3
|
export declare const ContainerToggler: import('styled-components').StyledComponent<import('react').FC<import('@evergis/uilib-gl').IIconButtonProps>, any, {
|
|
3
4
|
toggled?: boolean | undefined;
|
|
4
5
|
color?: string | undefined;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { ContainerRootProps } from '../../styled';
|
|
2
|
+
export declare const FiltersContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & ContainerRootProps & {
|
|
2
3
|
$padding?: number;
|
|
3
4
|
$bgColor?: string;
|
|
4
5
|
$fontSize?: string;
|
|
5
6
|
$fontColor?: string;
|
|
6
7
|
}, never>;
|
|
7
8
|
export declare const StyledIconButton: import('styled-components').StyledComponent<any, any, any, any>;
|
|
9
|
+
/**
|
|
10
|
+
* Обёртка фильтра-дерева.
|
|
11
|
+
*
|
|
12
|
+
* TreeDropdown вешает `width` на сам `<input>`, а не на свою корневую обёртку. Из-за этого
|
|
13
|
+
* `width: 100%` резолвится относительно обёртки, ширина которой определяется контентом, —
|
|
14
|
+
* и фильтр встаёт уже соседних. Растягиваем обёртку принудительно.
|
|
15
|
+
*/
|
|
16
|
+
export declare const TreeFilterContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
8
17
|
export declare const TextFilterContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
9
18
|
export declare const BarChartContainer: import('styled-components').StyledComponent<"div", any, {
|
|
10
19
|
barHeight?: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CssSize } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Ширина фильтра из конфига. Без явного значения фильтр занимает всю ширину контейнера.
|
|
4
|
+
*
|
|
5
|
+
* Раньше у каждого фильтра был свой пиксельный фолбэк, подогнанный под левую панель приложения
|
|
6
|
+
* (288px у Dropdown, 17.25rem у Text, 17rem у RangeNumber, ничего у Tree), из-за чего в одной
|
|
7
|
+
* панели фильтры вставали «лесенкой» — и тем заметнее, чем шире контейнер.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getFilterWidth: (width?: CssSize) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ContainerRootProps } from '../../styled';
|
|
1
2
|
export declare const ImageContainerBg: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
3
|
export declare const ImageContainerTitle: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
4
|
export declare const ImageContainerText: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
5
|
export declare const ImageContainerButton: import('styled-components').StyledComponent<"button", any, import('@evergis/uilib-gl').IButtonProps, never>;
|
|
5
|
-
export declare const ImageContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
6
|
+
export declare const ImageContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & ContainerRootProps, never>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export declare const LayersContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
1
|
+
export declare const LayersContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & import('../../styled').ContainerRootProps & {
|
|
2
2
|
isTitle?: boolean;
|
|
3
3
|
isColumn?: boolean;
|
|
4
4
|
isMain?: boolean;
|
|
5
5
|
noBorders?: boolean;
|
|
6
|
+
$alignItems?: import('../..').AlignItems;
|
|
6
7
|
} & {
|
|
7
8
|
isPresentationMode?: boolean;
|
|
8
9
|
}, never>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Alignment } from '../../types';
|
|
1
2
|
export declare const ContainerIconTitle: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
2
3
|
fontColor?: string;
|
|
3
4
|
}, never>;
|
|
4
5
|
export declare const ContainerTitle: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
5
6
|
simple?: boolean;
|
|
7
|
+
$align?: Alignment;
|
|
6
8
|
}, never>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ContainerRootProps } from '../../styled';
|
|
2
|
+
export declare const UploadContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & ContainerRootProps, never>;
|
|
3
|
+
export declare const UploaderContainer: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & ContainerRootProps & {
|
|
2
4
|
isTitle?: boolean;
|
|
3
5
|
isColumn?: boolean;
|
|
4
6
|
isMain?: boolean;
|
|
5
7
|
noBorders?: boolean;
|
|
8
|
+
$alignItems?: import('../..').AlignItems;
|
|
6
9
|
}, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ProgressContainerProps, RoundedBackgroundContainerProps } from '../types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const getContainerComponents: () => {
|
|
4
4
|
readonly DefaultAttributes: FC<import('../componentTypes').DefaultAttributesContainerProps>;
|
|
5
5
|
readonly Pages: FC<import('../componentTypes').PagesContainerProps>;
|
|
6
6
|
readonly Tabs: FC<import('../componentTypes').TabsContainerProps>;
|
|
@@ -18,9 +18,10 @@ export declare const SvgContainer: import('styled-components').StyledComponent<"
|
|
|
18
18
|
$width?: number;
|
|
19
19
|
$fontColor?: string;
|
|
20
20
|
}, never>;
|
|
21
|
-
export declare const TwoColumnContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
21
|
+
export declare const TwoColumnContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & import('../styled').ContainerRootProps & {
|
|
22
22
|
isTitle?: boolean;
|
|
23
23
|
isColumn?: boolean;
|
|
24
24
|
isMain?: boolean;
|
|
25
25
|
noBorders?: boolean;
|
|
26
|
+
$alignItems?: import('..').AlignItems;
|
|
26
27
|
}, never>;
|
|
@@ -25,8 +25,10 @@ export * from './useHideIfEmptyDataSource';
|
|
|
25
25
|
export * from './useProjectDashboardInit';
|
|
26
26
|
export * from './useRelatedDataSourceAttributes';
|
|
27
27
|
export * from './useRenderElement';
|
|
28
|
+
export * from './useResizeWidth';
|
|
28
29
|
export * from './useShownOtherItems';
|
|
29
30
|
export * from './useUpdateDataSource';
|
|
30
31
|
export * from './useWidgetConfig';
|
|
31
32
|
export * from './useWidgetContext';
|
|
32
33
|
export * from './useWidgetPage';
|
|
34
|
+
export * from './useWrapperSize';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Измеряет фактическую ширину DOM-элемента и обновляет её на любой ресайз (ResizeObserver).
|
|
4
|
+
*
|
|
5
|
+
* Возвращает `[ref, width]`, где `width` — число пикселей либо `undefined`, пока элемент ещё
|
|
6
|
+
* не измерен. Используется для «резинового» графика: d3-графикам нужна конкретная пиксельная
|
|
7
|
+
* ширина, а не CSS `100%`.
|
|
8
|
+
*
|
|
9
|
+
* `enabled: false` полностью отключает наблюдение — обычные (не fill) графики не измеряются
|
|
10
|
+
* и не вызывают лишних ре-рендеров.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useResizeWidth: (enabled: boolean) => [RefObject<HTMLDivElement>, number | undefined];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
import { ConfigContainerChild } from '../types';
|
|
4
|
+
interface UseWrapperSizeParams {
|
|
5
|
+
elementConfig?: ConfigContainerChild;
|
|
6
|
+
/** Внутренние дефолты обёртки контейнера. Ссылка должна быть стабильной (константа или useMemo). */
|
|
7
|
+
defaults?: CSSObject;
|
|
8
|
+
}
|
|
9
|
+
export interface WrapperRootProps {
|
|
10
|
+
id?: string;
|
|
11
|
+
"data-templatename"?: string;
|
|
12
|
+
style?: CSSProperties;
|
|
13
|
+
$sizeCss?: CSSObject;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Пропсы корневой обёртки контейнера: идентификаторы для внешних селекторов, авторский `style`
|
|
17
|
+
* из конфига и css-объект размеров.
|
|
18
|
+
*
|
|
19
|
+
* Размеры уходят styled-пропом (класс), а не inline-стилем, поэтому перебиваются снаружи
|
|
20
|
+
* без `!important`. Авторский `style` остаётся inline — у него приоритет по замыслу автора конфига.
|
|
21
|
+
*/
|
|
22
|
+
export declare const useWrapperSize: ({ elementConfig, defaults }: UseWrapperSizeParams) => WrapperRootProps;
|
|
23
|
+
export {};
|
|
@@ -1,12 +1,29 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
import { AlignItems } from './types';
|
|
4
|
+
/** Пропсы корневой обёртки контейнера — см. `useWrapperSize`. */
|
|
5
|
+
export interface ContainerRootProps {
|
|
6
|
+
$sizeCss?: CSSObject;
|
|
7
|
+
"data-templatename"?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Размеры контейнера из конфига.
|
|
11
|
+
*
|
|
12
|
+
* `&&` поднимает специфичность до двух классов: иначе правило проиграет родительскому
|
|
13
|
+
* `Container > * { width: 100% }` (та же специфичность — победитель зависел бы от порядка
|
|
14
|
+
* вставки стилей). Снаружи такое правило по-прежнему перебивается `#id` без `!important`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const sizeCssMixin: import('styled-components').FlattenInterpolation<import('styled-components').ThemedStyledProps<ContainerRootProps, any>>;
|
|
2
17
|
export declare const ElementValueWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
3
18
|
noMargin?: boolean;
|
|
19
|
+
$sizeTransparent?: boolean;
|
|
4
20
|
}, never>;
|
|
5
|
-
export declare const Container: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
21
|
+
export declare const Container: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & ContainerRootProps & {
|
|
6
22
|
isTitle?: boolean;
|
|
7
23
|
isColumn?: boolean;
|
|
8
24
|
isMain?: boolean;
|
|
9
25
|
noBorders?: boolean;
|
|
26
|
+
$alignItems?: AlignItems;
|
|
10
27
|
}, never>;
|
|
11
28
|
export declare const ContainerWrapper: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
12
29
|
$zIndex?: CSSProperties["zIndex"];
|
|
@@ -15,6 +15,26 @@ export type ChartType = (typeof CHART_TYPES)[number];
|
|
|
15
15
|
/** Выравнивание текста/блоков. */
|
|
16
16
|
export declare const ALIGNMENTS: readonly ["left", "center", "right"];
|
|
17
17
|
export type Alignment = (typeof ALIGNMENTS)[number];
|
|
18
|
+
/** Выравнивание детей контейнера по поперечной оси (CSS `align-items`). */
|
|
19
|
+
export declare const ALIGN_ITEMS: readonly ["flex-start", "center", "flex-end", "stretch", "baseline"];
|
|
20
|
+
export type AlignItems = (typeof ALIGN_ITEMS)[number];
|
|
21
|
+
/** Масштабирование изображения внутри своего бокса (CSS `object-fit`). */
|
|
22
|
+
export declare const OBJECT_FITS: readonly ["cover", "contain", "fill", "none", "scale-down"];
|
|
23
|
+
export type ObjectFit = (typeof OBJECT_FITS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* CSS-размер контейнера: число — пиксели, строка — любое CSS-значение (`"100%"`, `"24rem"`,
|
|
26
|
+
* `"calc(100% - 1rem)"`). Значение `"100%"` включает fill-режим — контейнер занимает всю ячейку
|
|
27
|
+
* родителя, а его внутренние дефолты (отступы, собственная высота) снимаются.
|
|
28
|
+
*/
|
|
29
|
+
export type CssSize = number | string;
|
|
30
|
+
/**
|
|
31
|
+
* Размеры, которые обязаны оставаться числом в пикселях: значение уходит в вычисления
|
|
32
|
+
* (геометрия графиков) или в HTML-атрибут, где `"100%"` не работает.
|
|
33
|
+
*/
|
|
34
|
+
export interface NumericSizeOptions {
|
|
35
|
+
width?: number;
|
|
36
|
+
height?: number;
|
|
37
|
+
}
|
|
18
38
|
/** Режим отображения коллекций. */
|
|
19
39
|
export declare const VIEW_MODES: readonly ["grid", "list"];
|
|
20
40
|
export type ViewMode = (typeof VIEW_MODES)[number];
|
|
@@ -87,11 +107,13 @@ export interface SaveHookInput {
|
|
|
87
107
|
changedProperties: Record<string, unknown>;
|
|
88
108
|
changedGeometry?: Geometry;
|
|
89
109
|
}
|
|
90
|
-
export interface ConfigControl extends Pick<ConfigOptions, "relatedDataSource" | "minValue" | "maxValue" | "step" | "label" | "placeholder" | "
|
|
110
|
+
export interface ConfigControl extends Pick<ConfigOptions, "relatedDataSource" | "minValue" | "maxValue" | "step" | "label" | "placeholder" | "variants"> {
|
|
91
111
|
type: "dropdown" | "checkbox" | "chips" | "string";
|
|
92
112
|
attributeName?: string;
|
|
93
113
|
targetAttributeName?: string;
|
|
94
114
|
defaultValue?: EditAttributeValue;
|
|
115
|
+
/** Ширина контрола в пикселях — уходит в CSS-строку, проценты не поддерживаются. */
|
|
116
|
+
width?: number;
|
|
95
117
|
}
|
|
96
118
|
export interface BaseMapSettings {
|
|
97
119
|
opacity?: number;
|
|
@@ -131,14 +153,23 @@ export interface CustomFeatureSelect {
|
|
|
131
153
|
*/
|
|
132
154
|
/** Размеры и раскладка. */
|
|
133
155
|
export interface ConfigLayoutOptions {
|
|
134
|
-
|
|
135
|
-
|
|
156
|
+
/** Ширина корневой обёртки контейнера. Число — пиксели, строка — CSS-значение. */
|
|
157
|
+
width?: CssSize;
|
|
158
|
+
/** Высота корневой обёртки контейнера. `"100%"` — заполнить ячейку родителя. */
|
|
159
|
+
height?: CssSize;
|
|
136
160
|
padding?: number;
|
|
137
161
|
radius?: number;
|
|
138
162
|
cornerRadius?: number;
|
|
139
163
|
column?: boolean;
|
|
140
164
|
twoColumns?: boolean;
|
|
165
|
+
/** Растянуть график контейнера Chart на всю ширину контейнера (график любого типа). */
|
|
166
|
+
chartFill?: boolean;
|
|
167
|
+
/** Горизонтальное выравнивание содержимого заголовка контейнера. */
|
|
141
168
|
align?: Alignment;
|
|
169
|
+
/** Выравнивание детей контейнера по поперечной оси. В ряду по умолчанию `center`. */
|
|
170
|
+
alignItems?: AlignItems;
|
|
171
|
+
/** Масштабирование изображения элемента `image`. */
|
|
172
|
+
fit?: ObjectFit;
|
|
142
173
|
center?: boolean;
|
|
143
174
|
innerTemplateStyle?: CSSProperties;
|
|
144
175
|
withPadding?: boolean;
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
|
+
import { CSSObject } from 'styled-components';
|
|
3
|
+
import { CssSize } from '../types';
|
|
4
|
+
/** Размер, при котором контейнер занимает всю ячейку родителя. */
|
|
5
|
+
export declare const FILL_SIZE = "100%";
|
|
6
|
+
export interface WrapperSizeParams {
|
|
7
|
+
/** Авторский `style` узла конфига — учитывается только ради приоритета `options` над `style`. */
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
/** `options.width` контейнера. */
|
|
10
|
+
width?: CssSize;
|
|
11
|
+
/** `options.height` контейнера. */
|
|
12
|
+
height?: CssSize;
|
|
13
|
+
/** Внутренние дефолты обёртки контейнера: отступы, собственная высота и т.п. */
|
|
14
|
+
defaults?: CSSObject;
|
|
15
|
+
/** Ширина по умолчанию, если `options.width` не задан. Контейнеры передают `FILL_SIZE`, элементы — нет. */
|
|
16
|
+
defaultWidth?: CssSize;
|
|
17
|
+
}
|
|
18
|
+
export declare const isFillSize: (size?: CssSize) => boolean;
|
|
2
19
|
/**
|
|
3
|
-
*
|
|
20
|
+
* CSS-объект корневой обёртки контейнера: внутренние дефолты плюс размеры из `options`.
|
|
4
21
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
22
|
+
* Результат уходит в styled-проп, а не в inline-style, поэтому перебивается снаружи обычной
|
|
23
|
+
* специфичностью (`#id`, `[data-templatename]`) — без `!important`.
|
|
24
|
+
*
|
|
25
|
+
* Размер `"100%"` включает fill-режим: контейнер занимает ячейку целиком, для чего снимаются
|
|
26
|
+
* конфликтующие внутренние дефолты обёртки, а контент лишается возможности её распирать
|
|
27
|
+
* (`min-width`/`min-height: 0`). Для fill-высоты добавляется `flex: 1 1 auto` — в колонке
|
|
28
|
+
* контейнер забирает остаток ячейки под заголовком, а не переполняет её на его высоту.
|
|
7
29
|
*/
|
|
8
|
-
export declare const getWrapperSizeStyle: (style
|
|
30
|
+
export declare const getWrapperSizeStyle: ({ style, width: widthOption, height, defaults, defaultWidth, }: WrapperSizeParams) => CSSObject | undefined;
|
|
@@ -61,6 +61,7 @@ export * from './removeDataSource';
|
|
|
61
61
|
export * from './roundTotalSum';
|
|
62
62
|
export * from './updateDataSource';
|
|
63
63
|
export * from './sliceShownOtherItems';
|
|
64
|
+
export * from './toCssSize';
|
|
64
65
|
export * from './toRenderableValue';
|
|
65
66
|
export * from './tooltipNameFromAttributes';
|
|
66
67
|
export * from './tooltipValueFromAttributes';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CssSize } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Приводит размер из конфига к CSS-значению: число — пиксели, строка — как есть.
|
|
4
|
+
*
|
|
5
|
+
* Нужен там, где значение подставляется в CSS-строку (`width: ${...}`), — в отличие от
|
|
6
|
+
* inline-style и css-объекта styled-components, которые добавляют `px` к числам сами.
|
|
7
|
+
*/
|
|
8
|
+
export declare const toCssSize: (size?: CssSize) => string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Пиксельное число из размера конфига — для API, которым нужен именно `number`
|
|
11
|
+
* (геометрия графиков). Относительные значения (`"100%"`, `"10rem"`) числом не выражаются
|
|
12
|
+
* и возвращают `undefined`, чтобы вызывающий код взял свой дефолт.
|
|
13
|
+
*/
|
|
14
|
+
export declare const toPxNumber: (size?: CssSize) => number | undefined;
|