@evergis/react 4.0.102 → 4.0.103
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 +20 -14
- package/dist/components/Dashboard/components/StackBar/index.d.ts +2 -0
- package/dist/components/Dashboard/components/StackBar/styled.d.ts +4 -1
- package/dist/components/Dashboard/containers/FiltersContainer/styled.d.ts +2 -0
- package/dist/components/Dashboard/types.d.ts +11 -0
- package/dist/components/Dashboard/utils/getWrapperSizeStyle.d.ts +7 -2
- package/dist/index.js +48 -18
- package/dist/index.js.map +1 -1
- package/dist/react.esm.js +48 -19
- package/dist/react.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -124,6 +124,12 @@ export interface ElementUploaderConfig extends Omit<ConfigContainerChild, "optio
|
|
|
124
124
|
export interface ElementUploaderProps extends Omit<ContainerProps, "elementConfig"> {
|
|
125
125
|
elementConfig?: ElementUploaderConfig;
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Опции размерной модели корневой обёртки — общие для всех контейнеров, которые проходят через
|
|
129
|
+
* `getWrapperSizeStyle`. Подмешивается к `<Name>ContainerOptions` вместо перечисления полей в
|
|
130
|
+
* каждом `Pick`, чтобы следующее размерное свойство не пришлось разносить по полутора десяткам мест.
|
|
131
|
+
*/
|
|
132
|
+
export type ContainerBoxOptions = Pick<ConfigOptions, "width" | "height" | "overflow">;
|
|
127
133
|
export type AddFeatureContainerOptions = Record<string, never>;
|
|
128
134
|
export type AddFeatureButtonOptions = Pick<ConfigOptions, "icon" | "title" | "layerName" | "geometryType">;
|
|
129
135
|
export interface AddFeatureButtonChild extends Omit<ConfigContainerChild, "options" | "type"> {
|
|
@@ -138,7 +144,7 @@ export interface AddFeatureContainerConfig extends Omit<ConfigContainerChild, "o
|
|
|
138
144
|
export interface AddFeatureContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
139
145
|
elementConfig?: AddFeatureContainerConfig;
|
|
140
146
|
}
|
|
141
|
-
export type AttachmentContainerOptions = Pick<ConfigOptions, "expandable" | "expanded" | "viewMode" | "shownItems" | "otherItems" | "relatedDataSource" | "controls"
|
|
147
|
+
export type AttachmentContainerOptions = Pick<ConfigOptions, "expandable" | "expanded" | "viewMode" | "shownItems" | "otherItems" | "relatedDataSource" | "controls"> & ContainerBoxOptions;
|
|
142
148
|
export interface AttachmentContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
143
149
|
templateName?: ContainerTemplate.Attachment;
|
|
144
150
|
options?: AttachmentContainerOptions;
|
|
@@ -146,7 +152,7 @@ export interface AttachmentContainerConfig extends Omit<ConfigContainerChild, "o
|
|
|
146
152
|
export interface AttachmentContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
147
153
|
elementConfig?: AttachmentContainerConfig;
|
|
148
154
|
}
|
|
149
|
-
export type CameraContainerOptions = Pick<ConfigOptions, "expandable" | "expanded"
|
|
155
|
+
export type CameraContainerOptions = Pick<ConfigOptions, "expandable" | "expanded"> & ContainerBoxOptions;
|
|
150
156
|
export interface CameraContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
151
157
|
templateName?: ContainerTemplate.Camera;
|
|
152
158
|
options?: CameraContainerOptions;
|
|
@@ -154,7 +160,7 @@ export interface CameraContainerConfig extends Omit<ConfigContainerChild, "optio
|
|
|
154
160
|
export interface CameraContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
155
161
|
elementConfig?: CameraContainerConfig;
|
|
156
162
|
}
|
|
157
|
-
export type ChartContainerOptions = Pick<ConfigOptions, "twoColumns" | "hideEmpty" | "
|
|
163
|
+
export type ChartContainerOptions = Pick<ConfigOptions, "twoColumns" | "hideEmpty" | "fill"> & ContainerBoxOptions;
|
|
158
164
|
export interface ChartAliasChild extends Omit<ConfigContainerChild, "id"> {
|
|
159
165
|
id: "alias";
|
|
160
166
|
}
|
|
@@ -185,7 +191,7 @@ export interface ChartContainerConfig extends Omit<ConfigContainerChild, "option
|
|
|
185
191
|
export interface ChartContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
186
192
|
elementConfig?: ChartContainerConfig;
|
|
187
193
|
}
|
|
188
|
-
export type ContainersGroupContainerOptions = Pick<ConfigOptions, "column" | "expandable" | "expanded" | "
|
|
194
|
+
export type ContainersGroupContainerOptions = Pick<ConfigOptions, "column" | "expandable" | "expanded" | "alignItems"> & ContainerBoxOptions;
|
|
189
195
|
export interface ContainersGroupContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
190
196
|
templateName?: ContainerTemplate.ContainersGroup;
|
|
191
197
|
options?: ContainersGroupContainerOptions;
|
|
@@ -193,7 +199,7 @@ export interface ContainersGroupContainerConfig extends Omit<ConfigContainerChil
|
|
|
193
199
|
export interface ContainersGroupContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
194
200
|
elementConfig?: ContainersGroupContainerConfig;
|
|
195
201
|
}
|
|
196
|
-
export type DataSourceContainerOptions = Pick<ConfigOptions, "column" | "relatedDataSource" | "innerTemplateName" | "expandable" | "expanded"
|
|
202
|
+
export type DataSourceContainerOptions = Pick<ConfigOptions, "column" | "relatedDataSource" | "innerTemplateName" | "expandable" | "expanded"> & ContainerBoxOptions;
|
|
197
203
|
export interface DataSourceContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
198
204
|
templateName?: ContainerTemplate.DataSource;
|
|
199
205
|
options?: DataSourceContainerOptions;
|
|
@@ -205,7 +211,7 @@ export type DataSourceInnerContainerOptions = Pick<ConfigOptions, "relatedDataSo
|
|
|
205
211
|
export interface DataSourceInnerContainerConfig extends Omit<ConfigContainerChild, "options"> {
|
|
206
212
|
options?: DataSourceInnerContainerOptions;
|
|
207
213
|
}
|
|
208
|
-
export type DataSourceProgressContainerOptions = Pick<ConfigOptions, "maxValue" | "showTotal" | "relatedDataSource" | "innerTemplateName" | "expandable" | "expanded" | "shownItems" | "otherItems"
|
|
214
|
+
export type DataSourceProgressContainerOptions = Pick<ConfigOptions, "maxValue" | "showTotal" | "relatedDataSource" | "innerTemplateName" | "expandable" | "expanded" | "shownItems" | "otherItems"> & ContainerBoxOptions;
|
|
209
215
|
export interface DataSourceProgressContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
210
216
|
templateName?: ContainerTemplate.DataSourceProgress;
|
|
211
217
|
options?: DataSourceProgressContainerOptions;
|
|
@@ -321,7 +327,7 @@ export interface ExportPdfContainerConfig extends Omit<ConfigContainerChild, "op
|
|
|
321
327
|
export interface ExportPdfContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
322
328
|
elementConfig?: ExportPdfContainerConfig;
|
|
323
329
|
}
|
|
324
|
-
export type FiltersContainerOptions = Pick<ConfigOptions, "padding" | "bgColor" | "fontColor" | "fontSize" | "expandable" | "expanded"
|
|
330
|
+
export type FiltersContainerOptions = Pick<ConfigOptions, "padding" | "bgColor" | "fontColor" | "fontSize" | "expandable" | "expanded"> & ContainerBoxOptions;
|
|
325
331
|
/**
|
|
326
332
|
* Опции ребёнка FiltersContainer. Набор — объединение того, что реально читают все восемь
|
|
327
333
|
* реализаций фильтра: dropdown берёт `variants`/`noEmptyOption`, text — `searchFilterName`
|
|
@@ -349,7 +355,7 @@ export interface IconContainerConfig extends Omit<ConfigContainerChild, "options
|
|
|
349
355
|
export interface IconContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
350
356
|
elementConfig?: IconContainerConfig;
|
|
351
357
|
}
|
|
352
|
-
export type ImageContainerOptions =
|
|
358
|
+
export type ImageContainerOptions = ContainerBoxOptions;
|
|
353
359
|
export interface ImageContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
354
360
|
templateName?: ContainerTemplate.Image;
|
|
355
361
|
options?: ImageContainerOptions;
|
|
@@ -357,7 +363,7 @@ export interface ImageContainerConfig extends Omit<ConfigContainerChild, "option
|
|
|
357
363
|
export interface ImageContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
358
364
|
elementConfig?: ImageContainerConfig;
|
|
359
365
|
}
|
|
360
|
-
export type LayersContainerOptions = Pick<ConfigOptions, "layerNames" | "expandable" | "expanded"
|
|
366
|
+
export type LayersContainerOptions = Pick<ConfigOptions, "layerNames" | "expandable" | "expanded"> & ContainerBoxOptions;
|
|
361
367
|
export interface LayersContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
362
368
|
templateName?: ContainerTemplate.Layers;
|
|
363
369
|
options?: LayersContainerOptions;
|
|
@@ -365,7 +371,7 @@ export interface LayersContainerConfig extends Omit<ConfigContainerChild, "optio
|
|
|
365
371
|
export interface LayersContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
366
372
|
elementConfig?: LayersContainerConfig;
|
|
367
373
|
}
|
|
368
|
-
export type OneColumnContainerOptions = Pick<ConfigOptions, "attributes" | "useProjectHiddenAttributes" | "hideEmpty" | "innerTemplateStyle"
|
|
374
|
+
export type OneColumnContainerOptions = Pick<ConfigOptions, "attributes" | "useProjectHiddenAttributes" | "hideEmpty" | "innerTemplateStyle"> & ContainerBoxOptions;
|
|
369
375
|
export interface OneColumnContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
370
376
|
templateName?: ContainerTemplate.OneColumn;
|
|
371
377
|
options?: OneColumnContainerOptions;
|
|
@@ -400,7 +406,7 @@ export interface RoundedBackgroundContainerConfig extends Omit<ConfigContainerCh
|
|
|
400
406
|
export interface RoundedBackgroundContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
401
407
|
elementConfig?: RoundedBackgroundContainerConfig;
|
|
402
408
|
}
|
|
403
|
-
export type SlideshowContainerOptions = Pick<ConfigOptions, "expandable" | "expanded"
|
|
409
|
+
export type SlideshowContainerOptions = Pick<ConfigOptions, "expandable" | "expanded"> & ContainerBoxOptions;
|
|
404
410
|
export interface SlideshowContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
405
411
|
templateName?: ContainerTemplate.Slideshow;
|
|
406
412
|
options?: SlideshowContainerOptions;
|
|
@@ -421,7 +427,7 @@ export interface TabsContainerConfig extends Omit<ConfigContainerChild, "options
|
|
|
421
427
|
export interface TabsContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
422
428
|
elementConfig?: TabsContainerConfig;
|
|
423
429
|
}
|
|
424
|
-
export type TaskContainerOptions = Pick<ConfigOptions, "title" | "relatedResources" | "center" | "icon" | "statusColors" | "responseFilters" | "useNotifications"
|
|
430
|
+
export type TaskContainerOptions = Pick<ConfigOptions, "title" | "relatedResources" | "center" | "icon" | "statusColors" | "responseFilters" | "useNotifications"> & ContainerBoxOptions;
|
|
425
431
|
export interface TaskContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
426
432
|
templateName?: ContainerTemplate.Task;
|
|
427
433
|
options?: TaskContainerOptions;
|
|
@@ -437,7 +443,7 @@ export interface TitleContainerConfig extends Omit<ConfigContainerChild, "option
|
|
|
437
443
|
export interface TitleContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
438
444
|
elementConfig?: TitleContainerConfig;
|
|
439
445
|
}
|
|
440
|
-
export type TwoColumnContainerOptions = Pick<ConfigOptions, "attributes" | "useProjectHiddenAttributes" | "hideEmpty" | "innerTemplateStyle"
|
|
446
|
+
export type TwoColumnContainerOptions = Pick<ConfigOptions, "attributes" | "useProjectHiddenAttributes" | "hideEmpty" | "innerTemplateStyle"> & ContainerBoxOptions;
|
|
441
447
|
export interface TwoColumnContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
442
448
|
templateName?: ContainerTemplate.TwoColumn;
|
|
443
449
|
options?: TwoColumnContainerOptions;
|
|
@@ -445,7 +451,7 @@ export interface TwoColumnContainerConfig extends Omit<ConfigContainerChild, "op
|
|
|
445
451
|
export interface TwoColumnContainerProps extends Omit<ContainerProps, "elementConfig"> {
|
|
446
452
|
elementConfig?: TwoColumnContainerConfig;
|
|
447
453
|
}
|
|
448
|
-
export type UploadContainerOptions = Pick<ConfigOptions, "expandable" | "expanded"
|
|
454
|
+
export type UploadContainerOptions = Pick<ConfigOptions, "expandable" | "expanded"> & ContainerBoxOptions;
|
|
449
455
|
export interface UploadContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
|
|
450
456
|
templateName?: ContainerTemplate.Upload;
|
|
451
457
|
options?: UploadContainerOptions;
|
|
@@ -8,6 +8,8 @@ export declare const StackBar: FC<{
|
|
|
8
8
|
type: WidgetType;
|
|
9
9
|
alias: ConfigContainerChild;
|
|
10
10
|
options: ConfigOptions;
|
|
11
|
+
/** fill контейнера: полоса тянется на всю доступную высоту вместо толщины из options.height. */
|
|
12
|
+
fill?: boolean;
|
|
11
13
|
renderElement: ContainerProps["renderElement"];
|
|
12
14
|
renderTooltip: (data: PieChartData[]) => ReactElement | string;
|
|
13
15
|
}>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
export declare const StackBarContainer: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps
|
|
1
|
+
export declare const StackBarContainer: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
2
|
+
$fill?: boolean;
|
|
3
|
+
}, never>;
|
|
2
4
|
export declare const StackBarHeader: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps, never>;
|
|
3
5
|
export declare const StackBarSection: import('styled-components').StyledComponent<"div", any, {
|
|
4
6
|
$width: string;
|
|
5
7
|
$height?: string | number;
|
|
8
|
+
$fill?: boolean;
|
|
6
9
|
$color: string;
|
|
7
10
|
cornerRadius: number;
|
|
8
11
|
hasAnyFilter?: boolean;
|
|
@@ -21,9 +21,11 @@ export declare const BarChartContainer: import('styled-components').StyledCompon
|
|
|
21
21
|
}, never>;
|
|
22
22
|
export declare const AnyChartWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
23
23
|
height?: number;
|
|
24
|
+
$fill?: boolean;
|
|
24
25
|
}, never>;
|
|
25
26
|
export declare const BarChartWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
26
27
|
height?: number;
|
|
28
|
+
$fill?: boolean;
|
|
27
29
|
}, never>;
|
|
28
30
|
export declare const BarChartFilterHeader: import('styled-components').StyledComponent<"div", any, import('@evergis/uilib-gl').FlexProps & {
|
|
29
31
|
height?: string | number;
|
|
@@ -21,6 +21,9 @@ export type AlignItems = (typeof ALIGN_ITEMS)[number];
|
|
|
21
21
|
/** Масштабирование изображения внутри своего бокса (CSS `object-fit`). */
|
|
22
22
|
export declare const OBJECT_FITS: readonly ["cover", "contain", "fill", "none", "scale-down"];
|
|
23
23
|
export type ObjectFit = (typeof OBJECT_FITS)[number];
|
|
24
|
+
/** Поведение контента, выходящего за бокс контейнера (CSS `overflow`). */
|
|
25
|
+
export declare const OVERFLOWS: readonly ["visible", "hidden", "scroll", "auto"];
|
|
26
|
+
export type Overflow = (typeof OVERFLOWS)[number];
|
|
24
27
|
/**
|
|
25
28
|
* CSS-размер контейнера: число — пиксели, строка — любое CSS-значение (`"100%"`, `"24rem"`,
|
|
26
29
|
* `"calc(100% - 1rem)"`). Значение `"100%"` включает fill-режим — контейнер занимает всю ячейку
|
|
@@ -157,6 +160,14 @@ export interface ConfigLayoutOptions {
|
|
|
157
160
|
width?: CssSize;
|
|
158
161
|
/** Высота корневой обёртки контейнера. `"100%"` — заполнить ячейку родителя. */
|
|
159
162
|
height?: CssSize;
|
|
163
|
+
/**
|
|
164
|
+
* Что делать с контентом, вылезающим за бокс контейнера (CSS `overflow`). Не задана — браузерный
|
|
165
|
+
* дефолт `visible`: контент вытекает и залезает на соседние слоты.
|
|
166
|
+
*
|
|
167
|
+
* Значения кроме `"visible"` обрезают и абсолютно спозиционированных потомков — у контейнера
|
|
168
|
+
* Filters с заданной высотой открытый список фильтра будет обрезан по боксу.
|
|
169
|
+
*/
|
|
170
|
+
overflow?: Overflow;
|
|
160
171
|
padding?: number;
|
|
161
172
|
radius?: number;
|
|
162
173
|
cornerRadius?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
import { CSSObject } from 'styled-components';
|
|
3
|
-
import { CssSize } from '../types';
|
|
3
|
+
import { CssSize, Overflow } from '../types';
|
|
4
4
|
/** Размер, при котором контейнер занимает всю ячейку родителя. */
|
|
5
5
|
export declare const FILL_SIZE = "100%";
|
|
6
6
|
export interface WrapperSizeParams {
|
|
@@ -10,6 +10,8 @@ export interface WrapperSizeParams {
|
|
|
10
10
|
width?: CssSize;
|
|
11
11
|
/** `options.height` контейнера. */
|
|
12
12
|
height?: CssSize;
|
|
13
|
+
/** `options.overflow` контейнера — что делать с контентом, вылезающим за бокс. */
|
|
14
|
+
overflow?: Overflow;
|
|
13
15
|
/** Внутренние дефолты обёртки контейнера: отступы, собственная высота и т.п. */
|
|
14
16
|
defaults?: CSSObject;
|
|
15
17
|
/** Ширина по умолчанию, если `options.width` не задан. Контейнеры передают `FILL_SIZE`, элементы — нет. */
|
|
@@ -26,5 +28,8 @@ export declare const isFillSize: (size?: CssSize) => boolean;
|
|
|
26
28
|
* конфликтующие внутренние дефолты обёртки, а контент лишается возможности её распирать
|
|
27
29
|
* (`min-width`/`min-height: 0`). Для fill-высоты добавляется `flex: 1 1 auto` — в колонке
|
|
28
30
|
* контейнер забирает остаток ячейки под заголовком, а не переполняет её на его высоту.
|
|
31
|
+
*
|
|
32
|
+
* `overflow` уходит в CSS как есть и ничем не подменяется: не задан — работает браузерный
|
|
33
|
+
* `visible`, то есть контент крупнее бокса вытекает на соседние слоты.
|
|
29
34
|
*/
|
|
30
|
-
export declare const getWrapperSizeStyle: ({ style, width: widthOption, height, defaults, defaultWidth, }: WrapperSizeParams) => CSSObject | undefined;
|
|
35
|
+
export declare const getWrapperSizeStyle: ({ style, width: widthOption, height, overflow, defaults, defaultWidth, }: WrapperSizeParams) => CSSObject | undefined;
|
package/dist/index.js
CHANGED
|
@@ -3406,6 +3406,8 @@ const ALIGNMENTS = ["left", "center", "right"];
|
|
|
3406
3406
|
const ALIGN_ITEMS = ["flex-start", "center", "flex-end", "stretch", "baseline"];
|
|
3407
3407
|
/** Масштабирование изображения внутри своего бокса (CSS `object-fit`). */
|
|
3408
3408
|
const OBJECT_FITS = ["cover", "contain", "fill", "none", "scale-down"];
|
|
3409
|
+
/** Поведение контента, выходящего за бокс контейнера (CSS `overflow`). */
|
|
3410
|
+
const OVERFLOWS = ["visible", "hidden", "scroll", "auto"];
|
|
3409
3411
|
/** Режим отображения коллекций. */
|
|
3410
3412
|
const VIEW_MODES = ["grid", "list"];
|
|
3411
3413
|
exports.ContainerTemplate = void 0;
|
|
@@ -3520,6 +3522,13 @@ const BASE_CONTAINER_STYLE = {
|
|
|
3520
3522
|
const StackBarContainer = styled(uilibGl.Flex).withConfig({ displayName: "StackBarContainer", componentId: "sc-stc97k" }) `
|
|
3521
3523
|
flex-wrap: nowrap;
|
|
3522
3524
|
width: 100%;
|
|
3525
|
+
|
|
3526
|
+
${({ $fill }) => $fill &&
|
|
3527
|
+
styled.css `
|
|
3528
|
+
/* fill: полоса забирает остаток высоты обёртки (вся ячейка минус шапка с итогом). */
|
|
3529
|
+
flex: 1 1 auto;
|
|
3530
|
+
min-height: 0;
|
|
3531
|
+
`}
|
|
3523
3532
|
`;
|
|
3524
3533
|
const StackBarHeader = styled(uilibGl.Flex).withConfig({ displayName: "StackBarHeader", componentId: "sc-8mc354" }) `
|
|
3525
3534
|
justify-content: space-between;
|
|
@@ -3529,7 +3538,8 @@ const StackBarHeader = styled(uilibGl.Flex).withConfig({ displayName: "StackBarH
|
|
|
3529
3538
|
const StackBarSection = styled.div.withConfig({ displayName: "StackBarSection", componentId: "sc-i3gdu" }) `
|
|
3530
3539
|
cursor: ${({ onClick }) => (onClick ? "pointer" : "default")};
|
|
3531
3540
|
width: ${({ $width }) => $width}%;
|
|
3532
|
-
|
|
3541
|
+
/* В fill толщину полосы задаёт растянутый контейнер, а не options.height элемента chart. */
|
|
3542
|
+
height: ${({ $fill, $height }) => ($fill ? "100%" : $height ? `${$height}px` : "0.5rem")};
|
|
3533
3543
|
margin: 0 0.5px;
|
|
3534
3544
|
background-color: ${({ $color }) => $color};
|
|
3535
3545
|
opacity: ${({ hasAnyFilter, isFiltered }) => (isFiltered ? 1 : hasAnyFilter ? FILTERED_VALUE_OPACITY / 100 : 1)};
|
|
@@ -7727,13 +7737,13 @@ const useUpdateDataSource = ({ dataSource, config, filters, attributes, layerPar
|
|
|
7727
7737
|
*/
|
|
7728
7738
|
const useWrapperSize = ({ elementConfig, defaults }) => {
|
|
7729
7739
|
const { id, style, templateName, options } = elementConfig || {};
|
|
7730
|
-
const { width, height } = options || {};
|
|
7740
|
+
const { width, height, overflow } = options || {};
|
|
7731
7741
|
return React.useMemo(() => ({
|
|
7732
7742
|
id,
|
|
7733
7743
|
"data-templatename": templateName,
|
|
7734
7744
|
style,
|
|
7735
|
-
$sizeCss: getWrapperSizeStyle({ style, width, height, defaults, defaultWidth: FILL_SIZE }),
|
|
7736
|
-
}), [id, templateName, style, width, height, defaults]);
|
|
7745
|
+
$sizeCss: getWrapperSizeStyle({ style, width, height, overflow, defaults, defaultWidth: FILL_SIZE }),
|
|
7746
|
+
}), [id, templateName, style, width, height, overflow, defaults]);
|
|
7737
7747
|
};
|
|
7738
7748
|
|
|
7739
7749
|
const ContainersGroupContainer = React.memo(({ elementConfig, type, renderElement }) => {
|
|
@@ -7944,15 +7954,16 @@ const useRenderContainer = ({ elementConfig, type, renderElement, renderBody, })
|
|
|
7944
7954
|
};
|
|
7945
7955
|
|
|
7946
7956
|
const OneColumnContainer = React.memo(({ type, elementConfig, renderElement }) => {
|
|
7947
|
-
const { width, height } = elementConfig?.options || {};
|
|
7957
|
+
const { width, height, overflow } = elementConfig?.options || {};
|
|
7948
7958
|
const templateName = elementConfig?.templateName;
|
|
7949
7959
|
const renderBody = React.useCallback(({ id, value, style, hasUnits, render }) => (jsxRuntime.jsxs(Container, { id: id, isColumn: true, "data-templatename": templateName, style: style, "$sizeCss": getWrapperSizeStyle({
|
|
7950
7960
|
style,
|
|
7951
7961
|
width,
|
|
7952
7962
|
height,
|
|
7963
|
+
overflow,
|
|
7953
7964
|
defaults: BASE_CONTAINER_STYLE,
|
|
7954
7965
|
defaultWidth: FILL_SIZE,
|
|
7955
|
-
}), children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] })), [width, height, templateName]);
|
|
7966
|
+
}), children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxRuntime.jsxs(ContainerValue, { children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] })), [width, height, overflow, templateName]);
|
|
7956
7967
|
const { renderContainer, attributesToRender } = useRenderContainer({
|
|
7957
7968
|
type,
|
|
7958
7969
|
elementConfig,
|
|
@@ -7963,9 +7974,9 @@ const OneColumnContainer = React.memo(({ type, elementConfig, renderElement }) =
|
|
|
7963
7974
|
});
|
|
7964
7975
|
|
|
7965
7976
|
const TwoColumnContainer = React.memo(({ elementConfig, type, renderElement }) => {
|
|
7966
|
-
const { width, height } = elementConfig?.options || {};
|
|
7977
|
+
const { width, height, overflow } = elementConfig?.options || {};
|
|
7967
7978
|
const templateName = elementConfig?.templateName;
|
|
7968
|
-
const renderBody = React.useCallback(({ id, value, style, hasIcon, hasUnits, render }) => (jsxRuntime.jsxs(TwoColumnContainerWrapper, { id: id, "data-templatename": templateName, style: style, "$sizeCss": getWrapperSizeStyle({ style, width, height, defaultWidth: FILL_SIZE }), children: [jsxRuntime.jsxs(ContainerAlias, { children: [hasIcon && (jsxRuntime.jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxRuntime.jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] })), [width, height, templateName]);
|
|
7979
|
+
const renderBody = React.useCallback(({ id, value, style, hasIcon, hasUnits, render }) => (jsxRuntime.jsxs(TwoColumnContainerWrapper, { id: id, "data-templatename": templateName, style: style, "$sizeCss": getWrapperSizeStyle({ style, width, height, overflow, defaultWidth: FILL_SIZE }), children: [jsxRuntime.jsxs(ContainerAlias, { children: [hasIcon && (jsxRuntime.jsx(ContainerAliasIcon, { children: render({ id: "icon" }) })), render({ id: "alias" }), render({ id: "tooltip" }), render({ id: "modal" })] }), jsxRuntime.jsxs(ContainerValue, { big: true, children: [value, hasUnits && (jsxRuntime.jsx(ContainerUnits, { children: render({ id: "units" }) }))] })] })), [width, height, overflow, templateName]);
|
|
7969
7980
|
const { renderContainer, attributesToRender } = useRenderContainer({
|
|
7970
7981
|
type,
|
|
7971
7982
|
elementConfig,
|
|
@@ -8347,6 +8358,15 @@ const BarChartContainer = styled.div.withConfig({ displayName: "BarChartContaine
|
|
|
8347
8358
|
const AnyChartWrapper = styled.div.withConfig({ displayName: "AnyChartWrapper", componentId: "sc-1txgly0" }) `
|
|
8348
8359
|
width: 100%;
|
|
8349
8360
|
height: ${({ height }) => height}px;
|
|
8361
|
+
|
|
8362
|
+
${({ $fill }) => $fill &&
|
|
8363
|
+
styled.css `
|
|
8364
|
+
/* fill: обёртке задана ВСЯ доступная высота ячейки, поэтому тело внутри забирает её остаток
|
|
8365
|
+
флексом (полоса stack тянется под строкой итога), а не вычисляется арифметикой. */
|
|
8366
|
+
display: flex;
|
|
8367
|
+
flex-direction: column;
|
|
8368
|
+
min-height: 0;
|
|
8369
|
+
`}
|
|
8350
8370
|
`;
|
|
8351
8371
|
const BarChartWrapper = styled(AnyChartWrapper).withConfig({ displayName: "BarChartWrapper", componentId: "sc-98mm1q" }) `
|
|
8352
8372
|
width: 100%;
|
|
@@ -13908,13 +13928,17 @@ const omitKeys = (source, keys = []) => {
|
|
|
13908
13928
|
* конфликтующие внутренние дефолты обёртки, а контент лишается возможности её распирать
|
|
13909
13929
|
* (`min-width`/`min-height: 0`). Для fill-высоты добавляется `flex: 1 1 auto` — в колонке
|
|
13910
13930
|
* контейнер забирает остаток ячейки под заголовком, а не переполняет её на его высоту.
|
|
13931
|
+
*
|
|
13932
|
+
* `overflow` уходит в CSS как есть и ничем не подменяется: не задан — работает браузерный
|
|
13933
|
+
* `visible`, то есть контент крупнее бокса вытекает на соседние слоты.
|
|
13911
13934
|
*/
|
|
13912
|
-
const getWrapperSizeStyle = ({ style, width: widthOption, height, defaults, defaultWidth, }) => {
|
|
13935
|
+
const getWrapperSizeStyle = ({ style, width: widthOption, height, overflow, defaults, defaultWidth, }) => {
|
|
13913
13936
|
// Ширина по умолчанию (контейнеры передают FILL_SIZE): явный `options.width` её перекрывает.
|
|
13914
13937
|
const width = widthOption ?? defaultWidth;
|
|
13915
13938
|
const hasWidth = width != null;
|
|
13916
13939
|
const hasHeight = height != null;
|
|
13917
|
-
|
|
13940
|
+
const hasOverflow = overflow != null;
|
|
13941
|
+
if (!hasWidth && !hasHeight && !hasOverflow) {
|
|
13918
13942
|
return defaults;
|
|
13919
13943
|
}
|
|
13920
13944
|
const fillWidth = isFillSize(width);
|
|
@@ -13923,13 +13947,18 @@ const getWrapperSizeStyle = ({ style, width: widthOption, height, defaults, defa
|
|
|
13923
13947
|
...(fillWidth ? FILL_WIDTH_CONFLICTS : []),
|
|
13924
13948
|
...(fillHeight ? FILL_HEIGHT_CONFLICTS : []),
|
|
13925
13949
|
];
|
|
13926
|
-
const sizeKeys = [
|
|
13950
|
+
const sizeKeys = [
|
|
13951
|
+
...(hasWidth ? ["width"] : []),
|
|
13952
|
+
...(hasHeight ? ["height"] : []),
|
|
13953
|
+
...(hasOverflow ? ["overflow"] : []),
|
|
13954
|
+
];
|
|
13927
13955
|
return {
|
|
13928
13956
|
...omitKeys(defaults, conflicts),
|
|
13929
13957
|
// `options` перекрывают одноимённые поля `style` — приоритет тот же, что был у inline-варианта.
|
|
13930
13958
|
...omitKeys(style, sizeKeys),
|
|
13931
13959
|
...(hasWidth && { width, ...(fillWidth && { minWidth: 0 }) }),
|
|
13932
13960
|
...(hasHeight && { height, ...(fillHeight && { minHeight: 0, flex: "1 1 auto" }) }),
|
|
13961
|
+
...(hasOverflow && { overflow }),
|
|
13933
13962
|
};
|
|
13934
13963
|
};
|
|
13935
13964
|
|
|
@@ -14062,7 +14091,7 @@ const tooltipValueFromRelatedFeatures = (t, value, relatedAttributes, layerInfo)
|
|
|
14062
14091
|
return formatChartRelatedValue(t, value, layerInfo, relatedAttributes);
|
|
14063
14092
|
};
|
|
14064
14093
|
|
|
14065
|
-
const StackBar = ({ data, filterName, type, alias, options, renderElement, renderTooltip }) => {
|
|
14094
|
+
const StackBar = ({ data, filterName, type, alias, options, fill, renderElement, renderTooltip }) => {
|
|
14066
14095
|
const { height, showTotal, cornerRadius, groupTooltip } = options || {};
|
|
14067
14096
|
const { t } = useGlobalContext();
|
|
14068
14097
|
const { hasAnyFilter, isFiltered, onFilter } = useWidgetFilters(type, filterName, data?.[0]?.items);
|
|
@@ -14076,11 +14105,11 @@ const StackBar = ({ data, filterName, type, alias, options, renderElement, rende
|
|
|
14076
14105
|
const visibleItems = React.useMemo(() => items?.filter(({ value }) => Number(value) > 0), [items]);
|
|
14077
14106
|
const getWidth = React.useCallback(value => ((Number(value) / total) * 100).toFixed(2), [total]);
|
|
14078
14107
|
const renderGroupTooltip = React.useMemo(() => (jsxRuntime.jsx(uilibGl.ThemeProvider, { children: jsxRuntime.jsx(ChartTooltipTable, { cellPadding: 0, cellSpacing: 0, children: visibleItems?.map(({ name, value, color }, index) => (jsxRuntime.jsxs("tr", { children: [jsxRuntime.jsx("td", { children: jsxRuntime.jsxs(ChartTooltip, { alignItems: "center", children: [jsxRuntime.jsx(ChartTooltipColor, { "$color": color }), jsxRuntime.jsx(ChartTooltipName, { children: name })] }) }), jsxRuntime.jsx("td", { children: formatValue(value) })] }, index))) }) })), [visibleItems, formatValue]);
|
|
14079
|
-
const renderItem = React.useCallback(({ name, value, color }, ref) => (jsxRuntime.jsx(StackBarSection, { ref: ref, "$width": getWidth(value), "$height": height, "$color": color, cornerRadius: cornerRadius, hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: filterName ? () => onFilter(name) : undefined })), [cornerRadius, filterName, getWidth, hasAnyFilter, height, isFiltered, onFilter]);
|
|
14108
|
+
const renderItem = React.useCallback(({ name, value, color }, ref) => (jsxRuntime.jsx(StackBarSection, { ref: ref, "$width": getWidth(value), "$height": height, "$fill": fill, "$color": color, cornerRadius: cornerRadius, hasAnyFilter: hasAnyFilter, isFiltered: isFiltered(name), onClick: filterName ? () => onFilter(name) : undefined })), [cornerRadius, fill, filterName, getWidth, hasAnyFilter, height, isFiltered, onFilter]);
|
|
14080
14109
|
const renderItems = React.useMemo(() => (jsxRuntime.jsx(jsxRuntime.Fragment, { children: visibleItems?.map((item, index) => (jsxRuntime.jsx(React.Fragment, { children: groupTooltip ? (renderItem(item)) : (jsxRuntime.jsx(uilibGl.ThemeProvider, { children: jsxRuntime.jsx(uilibGl.Tooltip, { placement: "top", arrow: true, content: renderTooltip([item]), children: ref => renderItem(item, ref) }) })) }, index))) })), [groupTooltip, visibleItems, renderItem, renderTooltip]);
|
|
14081
14110
|
if (!total)
|
|
14082
14111
|
return null;
|
|
14083
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(alias || showTotal) && (jsxRuntime.jsxs(StackBarHeader, { children: [jsxRuntime.jsx(StackBarAlias, { children: renderElement({ id: "alias" }) }), showTotal && (jsxRuntime.jsxs(StackBarTotal, { children: [jsxRuntime.jsx(StackBarValue, { children: formatValue(total) }), !!units && jsxRuntime.jsx(StackBarUnits, { children: units })] }))] })), groupTooltip ? (jsxRuntime.jsx(uilibGl.Tooltip, { placement: "top", arrow: true, content: renderGroupTooltip, children: ref => jsxRuntime.jsx(StackBarContainer, { ref: ref, children: renderItems }) })) : (jsxRuntime.jsx(StackBarContainer, { children: renderItems }))] }));
|
|
14112
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [(alias || showTotal) && (jsxRuntime.jsxs(StackBarHeader, { children: [jsxRuntime.jsx(StackBarAlias, { children: renderElement({ id: "alias" }) }), showTotal && (jsxRuntime.jsxs(StackBarTotal, { children: [jsxRuntime.jsx(StackBarValue, { children: formatValue(total) }), !!units && jsxRuntime.jsx(StackBarUnits, { children: units })] }))] })), groupTooltip ? (jsxRuntime.jsx(uilibGl.Tooltip, { placement: "top", arrow: true, content: renderGroupTooltip, children: ref => (jsxRuntime.jsx(StackBarContainer, { ref: ref, "$fill": fill, children: renderItems })) })) : (jsxRuntime.jsx(StackBarContainer, { "$fill": fill, children: renderItems }))] }));
|
|
14084
14113
|
};
|
|
14085
14114
|
|
|
14086
14115
|
const Chart = React.memo(({ config, element, elementConfig, type, renderElement }) => {
|
|
@@ -14248,11 +14277,11 @@ const Chart = React.memo(({ config, element, elementConfig, type, renderElement
|
|
|
14248
14277
|
}
|
|
14249
14278
|
if (isStackBar) {
|
|
14250
14279
|
// Вне fill chartHeight — высота самой полосы, и обёртка честно становится выше на строку
|
|
14251
|
-
// итога. В fill chartHeight — уже ВСЯ доступная высота
|
|
14252
|
-
//
|
|
14253
|
-
//
|
|
14280
|
+
// итога. В fill chartHeight — уже ВСЯ доступная высота ячейки: обёртка занимает её целиком,
|
|
14281
|
+
// а полоса забирает остаток под шапкой флексом ($fill), поэтому прибавлять/вычитать
|
|
14282
|
+
// STACK_BAR_TOTAL_HEIGHT не нужно — иначе тело вылезло бы за нижнюю границу.
|
|
14254
14283
|
const stackBarHeight = showTotal && !fitsHeight ? chartHeight + STACK_BAR_TOTAL_HEIGHT : chartHeight;
|
|
14255
|
-
return (jsxRuntime.jsx(AnyChartWrapper, { height: stackBarHeight, children: jsxRuntime.jsx(StackBar, { data: data, filterName: filterName, type: type, alias: elementConfig?.children?.find(child => child.id === "alias"), options: options, renderTooltip: renderPieChartTooltip, renderElement: renderElement }) }));
|
|
14284
|
+
return (jsxRuntime.jsx(AnyChartWrapper, { height: stackBarHeight, "$fill": fitsHeight, children: jsxRuntime.jsx(StackBar, { data: data, filterName: filterName, type: type, alias: elementConfig?.children?.find(child => child.id === "alias"), options: options, fill: fitsHeight, renderTooltip: renderPieChartTooltip, renderElement: renderElement }) }));
|
|
14256
14285
|
}
|
|
14257
14286
|
if (isPieChart) {
|
|
14258
14287
|
return (jsxRuntime.jsx(AnyChartWrapper, { height: fill ? pieSide : height, children: jsxRuntime.jsx(charts.PieChart, { data: (data[0]?.items
|
|
@@ -15179,6 +15208,7 @@ exports.NO_CONTENT_VALUE = NO_CONTENT_VALUE;
|
|
|
15179
15208
|
exports.NUMERIC_ATTRIBUTE_TYPES = NUMERIC_ATTRIBUTE_TYPES;
|
|
15180
15209
|
exports.NoLiveSnapshotContainer = NoLiveSnapshotContainer;
|
|
15181
15210
|
exports.OBJECT_FITS = OBJECT_FITS;
|
|
15211
|
+
exports.OVERFLOWS = OVERFLOWS;
|
|
15182
15212
|
exports.OneColumnContainer = OneColumnContainer;
|
|
15183
15213
|
exports.POLL_SUBTASK_INTERVAL_MS = POLL_SUBTASK_INTERVAL_MS;
|
|
15184
15214
|
exports.POLL_SUBTASK_TIMEOUT_MS = POLL_SUBTASK_TIMEOUT_MS;
|