@evergis/react 4.0.131 → 4.0.132

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/index.js CHANGED
@@ -75,205 +75,6 @@ const AddFeatureButton = ({ title, icon = "feature_add" /* , layerName, geometry
75
75
  return (jsxRuntime.jsx(uilibGl.IconButton, { kind: icon, primary: true, onClick: handleAddFeature, children: title }));
76
76
  };
77
77
 
78
- const ChartTooltipTable = styled.table.withConfig({ displayName: "ChartTooltipTable", componentId: "sc-1fk3ts5" }) `
79
- td {
80
- padding: 0;
81
- }
82
-
83
- tr:not(:last-child) td {
84
- padding-bottom: 0.375rem;
85
- }
86
- `;
87
- const ChartTooltip = styled(uilibGl.Flex).withConfig({ displayName: "ChartTooltip", componentId: "sc-1iyyyv7" }) `
88
- flex-wrap: nowrap;
89
- background: rgb(48, 69, 79);
90
- border-radius: 0.25rem;
91
- color: white;
92
-
93
- :not(:last-child) {
94
- margin-bottom: 0.25rem;
95
- }
96
- `;
97
- const ChartTooltipLabel = styled.div.withConfig({ displayName: "ChartTooltipLabel", componentId: "sc-gl0qxz" }) `
98
- margin-right: 0.25rem;
99
- `;
100
- const ChartTooltipColor = styled.div.withConfig({ displayName: "ChartTooltipColor", componentId: "sc-tmvvbh" }) `
101
- width: 0.625rem;
102
- height: 0.625rem;
103
- background-color: ${({ $color }) => $color};
104
- border-radius: ${({ theme: { borderRadius } }) => borderRadius.smallest};
105
- margin-right: 0.25rem;
106
- `;
107
- const ChartLegendColor$1 = styled.div.withConfig({ displayName: "ChartLegendColor", componentId: "sc-l66k4q" }) `
108
- width: 0.5rem;
109
- height: 0.5rem;
110
- background-color: ${({ $color }) => $color};
111
- border-radius: 0.125rem;
112
- `;
113
- const ChartLegendValue = styled.div.withConfig({ displayName: "ChartLegendValue", componentId: "sc-1d7z775" }) `
114
- opacity: 0.65;
115
- `;
116
- const ChartTooltipRow = styled(uilibGl.Flex).withConfig({ displayName: "ChartTooltipRow", componentId: "sc-ih1uc5" }) `
117
- display: flex;
118
- flex-direction: row;
119
- flex-wrap: nowrap;
120
- align-items: center;
121
- margin-top: 0.5rem;
122
- line-height: 0;
123
-
124
- ${ChartLegendColor$1} {
125
- margin-right: 0.25rem;
126
- }
127
- `;
128
- const ChartTooltipName = styled.div.withConfig({ displayName: "ChartTooltipName", componentId: "sc-sm4g0t" }) `
129
- margin-right: 1rem;
130
- opacity: 0.65;
131
- `;
132
- const PieChartCenter = styled.div.withConfig({ displayName: "PieChartCenter", componentId: "sc-1le93jy" }) `
133
- position: absolute;
134
- top: 50%;
135
- left: 50%;
136
- transform: translate(-50%, -50%);
137
- text-align: center;
138
- font-weight: bold;
139
- font-size: 1.5rem;
140
- `;
141
- const ChartWrapperContainer = styled.div.withConfig({ displayName: "ChartWrapperContainer", componentId: "sc-1f4x9zv" }) `
142
- position: relative;
143
- width: 100%;
144
- `;
145
- /*
146
- * fill-режим: обёртка забирает всю доступную ячейку (её высоту задаёт флекс-цепочка, а не контент графика),
147
- * на неё вешается ref для ResizeObserver — меряем обе оси без цикла. Плоский div (не Flex uilib), как соседний
148
- * ChartWrapperContainer, чтобы ref гарантированно дошёл до DOM-узла. Тело графика центрируется внутри.
149
- */
150
- const ChartFillMeasure = styled.div.withConfig({ displayName: "ChartFillMeasure", componentId: "sc-1r4oerb" }) `
151
- position: relative;
152
- display: flex;
153
- align-items: center;
154
- justify-content: center;
155
- width: 100%;
156
- height: 100%;
157
- min-width: 0;
158
- min-height: 0;
159
- overflow: hidden;
160
-
161
- /* SVG по умолчанию inline, поэтому под ним остаётся зазор базовой линии (~4px при line-height
162
- 18.4px): вне fill его скрывал запас высоты, а тело, точно заполнившее ячейку, из-за него
163
- вылезает за нижнюю границу. Блочный SVG зазора не даёт. */
164
- svg {
165
- display: block;
166
- }
167
- `;
168
- const Tooltip = styled.div.withConfig({ displayName: "Tooltip", componentId: "sc-1va8cy3" }) `
169
- position: relative;
170
- border-radius: 0.25rem;
171
- background-color: rgba(28, 33, 48);
172
- padding: 0.5rem;
173
- box-shadow: 0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.15);
174
- font-size: 0.75rem;
175
- transform: ${({ transform }) => transform};
176
- color: white;
177
-
178
- :before {
179
- position: absolute;
180
- display: block;
181
- content: "";
182
- width: 0;
183
- height: 0;
184
- }
185
- `;
186
- const LineChartStyles = styled.createGlobalStyle `
187
- .dashboardLineChartTooltip.${charts.lineChartClassNames.lineChartMouseLabel} {
188
- .${charts.lineChartClassNames.lineChartLabelFlex} {
189
- justify-content: center;
190
- align-items: flex-end;
191
-
192
- ${Tooltip} {
193
- margin: 0 0 12px 0;
194
-
195
- :before {
196
- top: auto;
197
- bottom: 0;
198
- left: 50%;
199
- transform: translate(-50%, 100%);
200
- border-left: 4px solid transparent;
201
- border-right: 4px solid transparent;
202
- border-top: 4px solid rgba(28, 33, 48, 0.9);
203
- }
204
- }
205
- }
206
- }
207
-
208
- .${charts.lineChartClassNames.lineChartYScaleGlobal}, .${charts.lineChartClassNames.lineChartXScaleGlobal} {
209
- .domain {
210
- visibility: hidden;
211
- }
212
-
213
- .tick {
214
- text {
215
- fill: ${({ theme: { palette } }) => palette.textDisabled};
216
- }
217
-
218
- line {
219
- visibility: hidden;
220
- }
221
- }
222
- }
223
-
224
- .${charts.lineChartClassNames.lineChartXScaleGlobal} {
225
- .tick {
226
- :first-of-type {
227
- text {
228
- text-anchor: start;
229
- }
230
- }
231
-
232
- :last-of-type {
233
- text {
234
- text-anchor: end;
235
- }
236
- }
237
- }
238
- }
239
-
240
- .${charts.lineChartClassNames.lineChartLine} {
241
- stroke-width: 2px;
242
- }
243
-
244
- .${charts.lineChartClassNames.lineChartLabel} {
245
- color: ${({ theme: { palette } }) => palette.textPrimary};
246
- }
247
-
248
- .${charts.lineChartClassNames.lineChartMouseCircle} {
249
- stroke: #ffffff;
250
- stroke-width: 2px;
251
- }
252
-
253
- .${charts.lineChartClassNames.lineChartGridLineX} {
254
- stroke: ${({ theme: { palette } }) => palette.element};
255
- }
256
-
257
- text {
258
- fill: ${({ theme: { palette } }) => palette.textDisabled};
259
- }
260
- `;
261
- const StyledBarChart = styled(charts.BarChart).withConfig({ displayName: "StyledBarChart", componentId: "sc-1l1kx80" }) `
262
- .domain {
263
- display: none;
264
- }
265
-
266
- .tick {
267
- text {
268
- fill: ${({ theme: { palette } }) => palette.textDisabled};
269
- }
270
-
271
- line {
272
- visibility: hidden;
273
- }
274
- }
275
- `;
276
-
277
78
  function range(start, stop, step) {
278
79
  start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
279
80
 
@@ -3588,6 +3389,22 @@ const ATTRIBUTE_ICON_ELEMENT_TYPES = {
3588
3389
  const EMPTY_DATA_SOURCE_LAYER_INFO = {
3589
3390
  configuration: { attributesConfiguration: { attributes: [] } },
3590
3391
  };
3392
+ /**
3393
+ * z-index плавающих слоёв дашборда: тултипы графиков и выпадающие списки фильтров.
3394
+ *
3395
+ * Тултипы графиков (`@evergis/charts`) и поповеры дропдаунов рендерятся порталом в `body`, где
3396
+ * их собственные z-index (100 у Bar/Line, 103 у Pie) ниже модального окна `Dialog` из
3397
+ * `@evergis/uilib-gl` (110) — внутри модалки дашборда они уходили под окно.
3398
+ */
3399
+ const DASHBOARD_OVERLAY_Z_INDEX = 1000;
3400
+ /**
3401
+ * Стиль контейнера тултипа `PieChart`: там z-index проставляется инлайном (103), поэтому поднять
3402
+ * его CSS-классом нельзя — только через `tooltipStyle`. Ключ пишем в CSS-нотации: значение уходит
3403
+ * в `d3.selection.style()` → `setProperty`, а camelCase он не понимает.
3404
+ */
3405
+ const PIE_CHART_TOOLTIP_STYLE = {
3406
+ "z-index": `${DASHBOARD_OVERLAY_Z_INDEX}`,
3407
+ };
3591
3408
  const DEFAULT_DROPDOWN_WIDTH = 312;
3592
3409
  const DEFAULT_FILTER_PADDING = 12;
3593
3410
  /** Базовый отступ обёртки контейнера. Снимается, когда контейнер занимает ячейку целиком. */
@@ -3621,6 +3438,217 @@ const CONTAINER_BODY_FILL_STYLE = {
3621
3438
  */
3622
3439
  const CONTAINERS_GROUP_DEFAULTS = { boxSizing: "border-box" };
3623
3440
 
3441
+ const ChartTooltipTable = styled.table.withConfig({ displayName: "ChartTooltipTable", componentId: "sc-1fk3ts5" }) `
3442
+ td {
3443
+ padding: 0;
3444
+ }
3445
+
3446
+ tr:not(:last-child) td {
3447
+ padding-bottom: 0.375rem;
3448
+ }
3449
+ `;
3450
+ const ChartTooltip = styled(uilibGl.Flex).withConfig({ displayName: "ChartTooltip", componentId: "sc-1iyyyv7" }) `
3451
+ flex-wrap: nowrap;
3452
+ background: rgb(48, 69, 79);
3453
+ border-radius: 0.25rem;
3454
+ color: white;
3455
+
3456
+ :not(:last-child) {
3457
+ margin-bottom: 0.25rem;
3458
+ }
3459
+ `;
3460
+ const ChartTooltipLabel = styled.div.withConfig({ displayName: "ChartTooltipLabel", componentId: "sc-gl0qxz" }) `
3461
+ margin-right: 0.25rem;
3462
+ `;
3463
+ const ChartTooltipColor = styled.div.withConfig({ displayName: "ChartTooltipColor", componentId: "sc-tmvvbh" }) `
3464
+ width: 0.625rem;
3465
+ height: 0.625rem;
3466
+ background-color: ${({ $color }) => $color};
3467
+ border-radius: ${({ theme: { borderRadius } }) => borderRadius.smallest};
3468
+ margin-right: 0.25rem;
3469
+ `;
3470
+ const ChartLegendColor$1 = styled.div.withConfig({ displayName: "ChartLegendColor", componentId: "sc-l66k4q" }) `
3471
+ width: 0.5rem;
3472
+ height: 0.5rem;
3473
+ background-color: ${({ $color }) => $color};
3474
+ border-radius: 0.125rem;
3475
+ `;
3476
+ const ChartLegendValue = styled.div.withConfig({ displayName: "ChartLegendValue", componentId: "sc-1d7z775" }) `
3477
+ opacity: 0.65;
3478
+ `;
3479
+ const ChartTooltipRow = styled(uilibGl.Flex).withConfig({ displayName: "ChartTooltipRow", componentId: "sc-ih1uc5" }) `
3480
+ display: flex;
3481
+ flex-direction: row;
3482
+ flex-wrap: nowrap;
3483
+ align-items: center;
3484
+ margin-top: 0.5rem;
3485
+ line-height: 0;
3486
+
3487
+ ${ChartLegendColor$1} {
3488
+ margin-right: 0.25rem;
3489
+ }
3490
+ `;
3491
+ const ChartTooltipName = styled.div.withConfig({ displayName: "ChartTooltipName", componentId: "sc-sm4g0t" }) `
3492
+ margin-right: 1rem;
3493
+ opacity: 0.65;
3494
+ `;
3495
+ const PieChartCenter = styled.div.withConfig({ displayName: "PieChartCenter", componentId: "sc-1le93jy" }) `
3496
+ position: absolute;
3497
+ top: 50%;
3498
+ left: 50%;
3499
+ transform: translate(-50%, -50%);
3500
+ text-align: center;
3501
+ font-weight: bold;
3502
+ font-size: 1.5rem;
3503
+ `;
3504
+ const ChartWrapperContainer = styled.div.withConfig({ displayName: "ChartWrapperContainer", componentId: "sc-1f4x9zv" }) `
3505
+ position: relative;
3506
+ width: 100%;
3507
+ `;
3508
+ /*
3509
+ * fill-режим: обёртка забирает всю доступную ячейку (её высоту задаёт флекс-цепочка, а не контент графика),
3510
+ * на неё вешается ref для ResizeObserver — меряем обе оси без цикла. Плоский div (не Flex uilib), как соседний
3511
+ * ChartWrapperContainer, чтобы ref гарантированно дошёл до DOM-узла. Тело графика центрируется внутри.
3512
+ */
3513
+ const ChartFillMeasure = styled.div.withConfig({ displayName: "ChartFillMeasure", componentId: "sc-1r4oerb" }) `
3514
+ position: relative;
3515
+ display: flex;
3516
+ align-items: center;
3517
+ justify-content: center;
3518
+ width: 100%;
3519
+ height: 100%;
3520
+ min-width: 0;
3521
+ min-height: 0;
3522
+ overflow: hidden;
3523
+
3524
+ /* SVG по умолчанию inline, поэтому под ним остаётся зазор базовой линии (~4px при line-height
3525
+ 18.4px): вне fill его скрывал запас высоты, а тело, точно заполнившее ячейку, из-за него
3526
+ вылезает за нижнюю границу. Блочный SVG зазора не даёт. */
3527
+ svg {
3528
+ display: block;
3529
+ }
3530
+ `;
3531
+ const Tooltip = styled.div.withConfig({ displayName: "Tooltip", componentId: "sc-1va8cy3" }) `
3532
+ position: relative;
3533
+ border-radius: 0.25rem;
3534
+ background-color: rgba(28, 33, 48);
3535
+ padding: 0.5rem;
3536
+ box-shadow: 0 0.125rem 0.25rem 0 rgba(0, 0, 0, 0.15);
3537
+ font-size: 0.75rem;
3538
+ transform: ${({ transform }) => transform};
3539
+ color: white;
3540
+
3541
+ :before {
3542
+ position: absolute;
3543
+ display: block;
3544
+ content: "";
3545
+ width: 0;
3546
+ height: 0;
3547
+ }
3548
+ `;
3549
+ /**
3550
+ * Тултипы графиков рендерятся в `body` со своим z-index (100 у Bar и Line) — ниже модального окна
3551
+ * `Dialog` из `@evergis/uilib-gl` (110), поэтому в модалке дашборда они уходили под окно. Класс
3552
+ * дублируем, чтобы правило перебило стили `@evergis/charts` по специфичности, а не по порядку
3553
+ * подключения.
3554
+ */
3555
+ const ChartTooltipStyles = styled.createGlobalStyle `
3556
+ .${charts.barChartClassNames.barChartMouseTooltip}.${charts.barChartClassNames.barChartMouseTooltip},
3557
+ .${charts.lineChartClassNames.lineChartMouseLabel}.${charts.lineChartClassNames.lineChartMouseLabel} {
3558
+ z-index: ${DASHBOARD_OVERLAY_Z_INDEX};
3559
+ }
3560
+ `;
3561
+ const LineChartStyles = styled.createGlobalStyle `
3562
+ .dashboardLineChartTooltip.${charts.lineChartClassNames.lineChartMouseLabel} {
3563
+ .${charts.lineChartClassNames.lineChartLabelFlex} {
3564
+ justify-content: center;
3565
+ align-items: flex-end;
3566
+
3567
+ ${Tooltip} {
3568
+ margin: 0 0 12px 0;
3569
+
3570
+ :before {
3571
+ top: auto;
3572
+ bottom: 0;
3573
+ left: 50%;
3574
+ transform: translate(-50%, 100%);
3575
+ border-left: 4px solid transparent;
3576
+ border-right: 4px solid transparent;
3577
+ border-top: 4px solid rgba(28, 33, 48, 0.9);
3578
+ }
3579
+ }
3580
+ }
3581
+ }
3582
+
3583
+ .${charts.lineChartClassNames.lineChartYScaleGlobal}, .${charts.lineChartClassNames.lineChartXScaleGlobal} {
3584
+ .domain {
3585
+ visibility: hidden;
3586
+ }
3587
+
3588
+ .tick {
3589
+ text {
3590
+ fill: ${({ theme: { palette } }) => palette.textDisabled};
3591
+ }
3592
+
3593
+ line {
3594
+ visibility: hidden;
3595
+ }
3596
+ }
3597
+ }
3598
+
3599
+ .${charts.lineChartClassNames.lineChartXScaleGlobal} {
3600
+ .tick {
3601
+ :first-of-type {
3602
+ text {
3603
+ text-anchor: start;
3604
+ }
3605
+ }
3606
+
3607
+ :last-of-type {
3608
+ text {
3609
+ text-anchor: end;
3610
+ }
3611
+ }
3612
+ }
3613
+ }
3614
+
3615
+ .${charts.lineChartClassNames.lineChartLine} {
3616
+ stroke-width: 2px;
3617
+ }
3618
+
3619
+ .${charts.lineChartClassNames.lineChartLabel} {
3620
+ color: ${({ theme: { palette } }) => palette.textPrimary};
3621
+ }
3622
+
3623
+ .${charts.lineChartClassNames.lineChartMouseCircle} {
3624
+ stroke: #ffffff;
3625
+ stroke-width: 2px;
3626
+ }
3627
+
3628
+ .${charts.lineChartClassNames.lineChartGridLineX} {
3629
+ stroke: ${({ theme: { palette } }) => palette.element};
3630
+ }
3631
+
3632
+ text {
3633
+ fill: ${({ theme: { palette } }) => palette.textDisabled};
3634
+ }
3635
+ `;
3636
+ const StyledBarChart = styled(charts.BarChart).withConfig({ displayName: "StyledBarChart", componentId: "sc-1l1kx80" }) `
3637
+ .domain {
3638
+ display: none;
3639
+ }
3640
+
3641
+ .tick {
3642
+ text {
3643
+ fill: ${({ theme: { palette } }) => palette.textDisabled};
3644
+ }
3645
+
3646
+ line {
3647
+ visibility: hidden;
3648
+ }
3649
+ }
3650
+ `;
3651
+
3624
3652
  const StackBarContainer = styled(uilibGl.Flex).withConfig({ displayName: "StackBarContainer", componentId: "sc-stc97k" }) `
3625
3653
  flex-wrap: nowrap;
3626
3654
  width: 100%;
@@ -4516,13 +4544,22 @@ const applyFiltersToCondition = ({ condition, name, defaultValue, filters, isSin
4516
4544
  return applyTreeFilterToCondition(condition, name, rawValue, isSingle);
4517
4545
  }
4518
4546
  const hasFilter = filters[name] !== undefined && !!filters[name].value?.toString().length;
4547
+ const filterName = `${FILTER_PREFIX}${name}`;
4548
+ // Пока фильтр не применён, границы `%name.min` / `%name.max` берём из range-дефолта конфига
4549
+ // (`defaultValue: [from, to]`) — иначе в условие ушёл бы весь массив вместо своей границы.
4550
+ // Проверка плейсхолдеров обязательна: у array-фильтра массивный дефолт подставляется целиком.
4551
+ const rangeDefault = !hasFilter &&
4552
+ Array.isArray(defaultValue) &&
4553
+ (condition.includes(`${filterName}.min`) || condition.includes(`${filterName}.max`))
4554
+ ? defaultValue
4555
+ : null;
4519
4556
  const min = formatConditionValue({
4520
- value: hasFilter ? filters[name].min : null,
4557
+ value: hasFilter ? filters[name].min : rangeDefault?.[0] ?? null,
4521
4558
  checkQuotes: !isSingle,
4522
4559
  isSetParams,
4523
4560
  });
4524
4561
  const max = formatConditionValue({
4525
- value: hasFilter ? filters[name].max : null,
4562
+ value: hasFilter ? filters[name].max : rangeDefault?.[1] ?? null,
4526
4563
  checkQuotes: !isSingle,
4527
4564
  isSetParams,
4528
4565
  });
@@ -4532,7 +4569,6 @@ const applyFiltersToCondition = ({ condition, name, defaultValue, filters, isSin
4532
4569
  checkQuotes: !isSingle,
4533
4570
  isSetParams,
4534
4571
  });
4535
- const filterName = `${FILTER_PREFIX}${name}`;
4536
4572
  const hasMin = min !== "" && min !== null && min !== undefined;
4537
4573
  const hasMax = max !== "" && max !== null && max !== undefined;
4538
4574
  let result = condition;
@@ -12744,7 +12780,7 @@ const EditStringContainer = ({ type, elementConfig, renderElement, }) => {
12744
12780
  onControlChange(String(lastSelected?.value ?? ""));
12745
12781
  setValue(lastSelected?.text ?? "");
12746
12782
  }, [onControlChange, setValue]);
12747
- return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsx(ContainerValue, { column: true, children: control?.relatedDataSource ? (jsxRuntime.jsx(uilibGl.AutoComplete, { value: value, options: options, width: "100%", onChange: onChange, onSelect: onSelect })) : (jsxRuntime.jsx(uilibGl.Input, { value: controlValue, width: "100%", onChange: (e) => onControlChange(e.target.value) })) })] }));
12783
+ return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsx(ContainerValue, { column: true, children: control?.relatedDataSource ? (jsxRuntime.jsx(uilibGl.AutoComplete, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, value: value, options: options, width: "100%", onChange: onChange, onSelect: onSelect })) : (jsxRuntime.jsx(uilibGl.Input, { value: controlValue, width: "100%", onChange: (e) => onControlChange(e.target.value) })) })] }));
12748
12784
  };
12749
12785
 
12750
12786
  const EditNumberContainer = ({ type, elementConfig, renderElement, }) => {
@@ -12757,7 +12793,7 @@ const EditDropdownContainer = ({ type, elementConfig, renderElement, }) => {
12757
12793
  const { value, control, items, onChange } = useEditControl(type, elementConfig);
12758
12794
  const { id, style } = elementConfig || {};
12759
12795
  const optionsList = React.useMemo(() => items.map(item => ({ text: item, value: item })), [items]);
12760
- return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsx(ContainerValue, { column: true, children: jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 1000, label: control?.label, placeholder: control?.placeholder, options: optionsList, value: value, width: `${control?.width ?? DEFAULT_DROPDOWN_WIDTH}px`, onChange: ([option]) => onChange(option.value) }) })] }));
12796
+ return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsx(ContainerValue, { column: true, children: jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, label: control?.label, placeholder: control?.placeholder, options: optionsList, value: value, width: `${control?.width ?? DEFAULT_DROPDOWN_WIDTH}px`, onChange: ([option]) => onChange(option.value) }) })] }));
12761
12797
  };
12762
12798
 
12763
12799
  const CheckboxWrapper = styled(ContainerValue).withConfig({ displayName: "CheckboxWrapper", componentId: "sc-169umb6" }) `
@@ -12798,7 +12834,7 @@ const EditDateContainer = ({ type, elementConfig, renderElement, }) => {
12798
12834
  const { withTime } = options || {};
12799
12835
  const dateValue = React.useMemo(() => (value ? new Date(value) : undefined), [value]);
12800
12836
  const handleChange = React.useCallback((date) => onChange(date.toISOString()), [onChange]);
12801
- return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsx(ContainerValue, { column: true, children: jsxRuntime.jsx(uilibGl.DatePicker, { value: dateValue, locale: uilibGl.getLocale(language), withTime: withTime ?? false, withHeader: true, width: "100%", onChange: handleChange }) })] }));
12837
+ return (jsxRuntime.jsxs(Container, { id: id, isColumn: true, style: { ...BASE_CONTAINER_STYLE, ...style }, children: [jsxRuntime.jsxs(ContainerAlias, { hasBottomMargin: true, children: [renderElement({ id: "alias" }), renderElement({ id: "tooltip" })] }), jsxRuntime.jsx(ContainerValue, { column: true, children: jsxRuntime.jsx(uilibGl.DatePicker, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, value: dateValue, locale: uilibGl.getLocale(language), withTime: withTime ?? false, withHeader: true, width: "100%", onChange: handleChange }) })] }));
12802
12838
  };
12803
12839
 
12804
12840
  const AddButton = ({ multiple = true, accept, onSelectFiles, onSelectFromCatalog, onSelectFromLink, }) => {
@@ -13946,7 +13982,7 @@ const ElementControl = ({ elementConfig }) => {
13946
13982
  });
13947
13983
  }
13948
13984
  }, [changeControls, control?.targetAttributeName]);
13949
- return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 1000, width: toCssSize(width) ?? "100%", label: label, options: items, value: currentValue, placeholder: placeholder, disabled: isDisabled, onChange: handleChange }));
13985
+ return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, width: toCssSize(width) ?? "100%", label: label, options: items, value: currentValue, placeholder: placeholder, disabled: isDisabled, onChange: handleChange }));
13950
13986
  };
13951
13987
 
13952
13988
  const StyledIconFontSizeMixin = styled.css `
@@ -14120,7 +14156,7 @@ const LocalLink = React.memo(({ link, style }) => {
14120
14156
  navigator.clipboard.writeText(link);
14121
14157
  toggleOpen();
14122
14158
  }, [link, toggleOpen]);
14123
- return (jsxRuntime.jsx(uilibGl.Popover, { open: isOpen, zIndex: 10, onRequestClose: toggleOpen, anchorOrigin: "bottom-right", targetOrigin: "top-right", anchor: jsxRuntime.jsx(LocalLinkButton, { onClick: toggleOpen }), children: jsxRuntime.jsxs(LocalLinkBlank, { children: [jsxRuntime.jsx(Link, { href: link, target: "_blank", rel: "noreferrer", style: style, children: link }), jsxRuntime.jsx(LocalLinkCopy, { children: jsxRuntime.jsx(uilibGl.IconButton, { kind: "copy", onClick: onCopy, children: t("copy", { ns: "dashboard", defaultValue: "Копировать" }) }) })] }) }));
14159
+ return (jsxRuntime.jsx(uilibGl.Popover, { open: isOpen, zIndex: DASHBOARD_OVERLAY_Z_INDEX, onRequestClose: toggleOpen, anchorOrigin: "bottom-right", targetOrigin: "top-right", anchor: jsxRuntime.jsx(LocalLinkButton, { onClick: toggleOpen }), children: jsxRuntime.jsxs(LocalLinkBlank, { children: [jsxRuntime.jsx(Link, { href: link, target: "_blank", rel: "noreferrer", style: style, children: link }), jsxRuntime.jsx(LocalLinkCopy, { children: jsxRuntime.jsx(uilibGl.IconButton, { kind: "copy", onClick: onCopy, children: t("copy", { ns: "dashboard", defaultValue: "Копировать" }) }) })] }) }));
14124
14160
  });
14125
14161
 
14126
14162
  const ElementLink = React.memo(({ type, elementConfig }) => {
@@ -14741,7 +14777,7 @@ const TableCell = React.memo(({ attribute, row, canEdit, onChange }) => {
14741
14777
  }
14742
14778
  const renderEditor = () => {
14743
14779
  if (type === api.AttributeType.DateTime) {
14744
- return (jsxRuntime.jsx(uilibGl.DatePicker, { focus: true, value: dateValue, locale: uilibGl.getLocale(language), withTime: withTime, withHeader: true, width: "100%", onChange: date => handleChange(date.toISOString()) }));
14780
+ return (jsxRuntime.jsx(uilibGl.DatePicker, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, focus: true, value: dateValue, locale: uilibGl.getLocale(language), withTime: withTime, withHeader: true, width: "100%", onChange: date => handleChange(date.toISOString()) }));
14745
14781
  }
14746
14782
  if (NUMBER_EDITOR_TYPES.includes(type)) {
14747
14783
  return (jsxRuntime.jsx(uilibGl.NumberInput, { autoFocus: true, value: value === null || value === undefined ? null : Number(value), width: "100%", numeralDecimalScale: INTEGER_ATTRIBUTE_TYPES.includes(type) ? 0 : undefined, onChange: next => handleChange(next) }));
@@ -15819,7 +15855,7 @@ const TextFilter = ({ type, filter }) => {
15819
15855
  }, [filterName, filters]);
15820
15856
  if (!configFilter)
15821
15857
  return null;
15822
- return (jsxRuntime.jsx(TextFilterContainer, { children: jsxRuntime.jsx(uilibGl.AutoComplete, { value: value, placeholder: placeholder, options: variants || options, zIndex: 100, width: getFilterWidth(width), menuHeight: height ? `${height}px` : "10rem", withInfiniteScroll: !variants, infiniteScrollProps: variants ? undefined : infiniteScrollProps, multiSelect: multiSelect, selected: selected, setOptions: variants ? undefined : setOptions, onChange: onChange, onSelect: onSelect, onGetInnerRef: ref => (suggestRef.current = ref), asyncCallback: variants ? undefined : search, onBlur: onBlur, onKeyUp: isFreeTextInput || (variants && !variants.length) ? onKeyUp : undefined }) }));
15858
+ return (jsxRuntime.jsx(TextFilterContainer, { children: jsxRuntime.jsx(uilibGl.AutoComplete, { value: value, placeholder: placeholder, options: variants || options, zIndex: DASHBOARD_OVERLAY_Z_INDEX, width: getFilterWidth(width), menuHeight: height ? `${height}px` : "10rem", withInfiniteScroll: !variants, infiniteScrollProps: variants ? undefined : infiniteScrollProps, multiSelect: multiSelect, selected: selected, setOptions: variants ? undefined : setOptions, onChange: onChange, onSelect: onSelect, onGetInnerRef: ref => (suggestRef.current = ref), asyncCallback: variants ? undefined : search, onBlur: onBlur, onKeyUp: isFreeTextInput || (variants && !variants.length) ? onKeyUp : undefined }) }));
15823
15859
  };
15824
15860
 
15825
15861
  const getListOptions = (items, filterName, configFilters) => {
@@ -15865,7 +15901,7 @@ const DropdownFilter = ({ type, filter, elementConfig }) => {
15865
15901
  }, [changeFilters, filterName]);
15866
15902
  if (!configFilter && !variants)
15867
15903
  return null;
15868
- return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: 100, width: getFilterWidth(width), value: value, placeholder: placeholder, options: filterOptions, onChange: onChange }));
15904
+ return (jsxRuntime.jsx(uilibGl.Dropdown, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, width: getFilterWidth(width), value: value, placeholder: placeholder, options: filterOptions, onChange: onChange }));
15869
15905
  };
15870
15906
 
15871
15907
  const CheckboxFilter = ({ type, filter, elementConfig }) => {
@@ -16135,7 +16171,7 @@ const BarChartFilter = ({ type, config, elementConfig, filter }) => {
16135
16171
  return (jsxRuntime.jsx(uilibGl.ThemeProvider, { children: jsxRuntime.jsx(TooltipContainer, { children: group.groupName === group.value.toString() ? group.value : [group.groupName, group.value].join(": ") }) }));
16136
16172
  }, []);
16137
16173
  const totalHeight = height + BAR_CHART_HEADER_HEIGHT + BAR_CHART_FOOTER_MARGIN;
16138
- return (jsxRuntime.jsx(ChartWrapper, { height: totalHeight, loading: loading, style: style, children: jsxRuntime.jsxs(BarChartWrapper, { height: totalHeight, children: [jsxRuntime.jsxs(BarChartFilterHeader, { height: BAR_CHART_HEADER_HEIGHT, children: [jsxRuntime.jsxs(BarChartFilterArrows, { children: [jsxRuntime.jsx(uilibGl.IconButton, { kind: "prev", disabled: prevDisabled, onClick: onPrev }), jsxRuntime.jsx(uilibGl.IconButton, { kind: "next", disabled: nextDisabled, onClick: onNext })] }), renderSelectedRange] }), jsxRuntime.jsx(BarChartContainer, { barHeight: barHeight, marginBottom: DEFAULT_BAR_CHART_MARGINS.bottom, children: jsxRuntime.jsx(BarChart, { data: data, margin: DEFAULT_BAR_CHART_MARGINS, height: height, barWidth: barWidth, barPadding: padding, xAxisPadding: 0, yAxisPadding: 0, selectable: !loading, dynamicTooltipEnable: true, isBarTooltip: true, renderTooltip: renderTooltip, ...rest }) })] }) }));
16174
+ return (jsxRuntime.jsxs(ChartWrapper, { height: totalHeight, loading: loading, style: style, children: [jsxRuntime.jsx(ChartTooltipStyles, {}), jsxRuntime.jsxs(BarChartWrapper, { height: totalHeight, children: [jsxRuntime.jsxs(BarChartFilterHeader, { height: BAR_CHART_HEADER_HEIGHT, children: [jsxRuntime.jsxs(BarChartFilterArrows, { children: [jsxRuntime.jsx(uilibGl.IconButton, { kind: "prev", disabled: prevDisabled, onClick: onPrev }), jsxRuntime.jsx(uilibGl.IconButton, { kind: "next", disabled: nextDisabled, onClick: onNext })] }), renderSelectedRange] }), jsxRuntime.jsx(BarChartContainer, { barHeight: barHeight, marginBottom: DEFAULT_BAR_CHART_MARGINS.bottom, children: jsxRuntime.jsx(BarChart, { data: data, margin: DEFAULT_BAR_CHART_MARGINS, height: height, barWidth: barWidth, barPadding: padding, xAxisPadding: 0, yAxisPadding: 0, selectable: !loading, dynamicTooltipEnable: true, isBarTooltip: true, renderTooltip: renderTooltip, ...rest }) })] })] }));
16139
16175
  };
16140
16176
 
16141
16177
  const DEFAULT_FROM_DATA = { minFromData: null, maxFromData: null };
@@ -16145,6 +16181,7 @@ const RangeDateFilter = ({ type, filter }) => {
16145
16181
  const { currentPage } = useWidgetPage(type);
16146
16182
  const [value, setValue] = React.useState([undefined, undefined]);
16147
16183
  const isInit = React.useRef(false);
16184
+ const isDefaultApplied = React.useRef(false);
16148
16185
  const updateDebounce = useDebouncedCallback(FILTER_UPDATE_DEBOUNCE);
16149
16186
  const { filters: configFilters } = currentPage;
16150
16187
  const { filterName, label, minValue, maxValue, withTime } = filter.options;
@@ -16157,28 +16194,42 @@ const RangeDateFilter = ({ type, filter }) => {
16157
16194
  maxFromData: !prev.maxFromData ? date : date > prev.maxFromData ? date : prev.maxFromData
16158
16195
  };
16159
16196
  }, DEFAULT_FROM_DATA) || DEFAULT_FROM_DATA, [configFilter?.attributeValue, dataSource?.features]);
16160
- const minDate = React.useMemo(() => minValue || minFromData.toISOString(), [minFromData, minValue]);
16161
- const maxDate = React.useMemo(() => maxValue || maxFromData.toISOString(), [maxFromData, maxValue]);
16197
+ const minDate = React.useMemo(() => minValue || minFromData?.toISOString(), [minFromData, minValue]);
16198
+ const maxDate = React.useMemo(() => maxValue || maxFromData?.toISOString(), [maxFromData, maxValue]);
16199
+ // Диапазон по умолчанию: `defaultValue: [from, to]` из конфига фильтра — начальное значение
16200
+ // и точка сброса. Границы календаря (min/max) при этом не меняются; незаданная граница
16201
+ // дефолта падает на них же — как было до появления `defaultValue`.
16202
+ const defaultRange = React.useMemo(() => {
16203
+ const [from, to] = (Array.isArray(configFilter?.defaultValue) ? configFilter.defaultValue : []);
16204
+ return [getDate(from)?.toISOString() ?? minDate, getDate(to)?.toISOString() ?? maxDate];
16205
+ }, [configFilter?.defaultValue, maxDate, minDate]);
16162
16206
  const isEmpty = React.useMemo(() => lodash.isNil(value?.[0]) && lodash.isNil(value?.[1]), [value]);
16163
- const isDefault = React.useMemo(() => value?.[0] === minDate && value?.[1] === maxDate, [maxDate, minDate, value]);
16207
+ const isDefault = React.useMemo(() => value?.[0] === defaultRange[0] && value?.[1] === defaultRange[1], [defaultRange, value]);
16164
16208
  const reset = React.useCallback(() => {
16165
- setValue([minDate, maxDate]);
16209
+ const [from, to] = defaultRange;
16210
+ setValue([from, to]);
16166
16211
  changeFilters({
16167
16212
  [filterName]: {
16168
- value: [minDate, maxDate],
16169
- min: minDate,
16170
- max: maxDate
16213
+ value: [from, to],
16214
+ min: from,
16215
+ max: to
16171
16216
  }
16172
16217
  }, configFilter?.resetFilters);
16173
- }, [changeFilters, configFilter?.resetFilters, filterName, maxDate, minDate]);
16218
+ }, [changeFilters, configFilter?.resetFilters, defaultRange, filterName]);
16174
16219
  const onChange = React.useCallback((newValue) => {
16175
16220
  setValue([newValue[0].toISOString(), newValue[1].toISOString()]);
16176
16221
  }, []);
16222
+ // Дефолт применяем однократно — как только обе границы диапазона известны. С `defaultValue`
16223
+ // это происходит сразу, без него — после подгрузки фич связанного источника данных.
16177
16224
  React.useEffect(() => {
16178
- if (!lodash.isNil(minDate) && !lodash.isNil(maxDate)) {
16179
- reset();
16180
- }
16181
- }, []); // eslint-disable-line
16225
+ if (isDefaultApplied.current)
16226
+ return;
16227
+ const [from, to] = defaultRange;
16228
+ if (lodash.isNil(from) || lodash.isNil(to))
16229
+ return;
16230
+ isDefaultApplied.current = true;
16231
+ reset();
16232
+ }, [defaultRange, reset]);
16182
16233
  React.useEffect(() => {
16183
16234
  if (!isInit.current) {
16184
16235
  isInit.current = true;
@@ -16196,7 +16247,7 @@ const RangeDateFilter = ({ type, filter }) => {
16196
16247
  }, [value]); // eslint-disable-line
16197
16248
  if (!configFilter)
16198
16249
  return null;
16199
- return (jsxRuntime.jsx(uilibGl.RangeNumberInput, { label: label || t("interval", { ns: "dashboard", defaultValue: "Интервал" }), selectedOption: { range: true }, minDate: getDate(minDate), maxDate: getDate(maxDate), value: [getDate(value[0]), getDate(value[1])], zIndex: 100, prefix: jsxRuntime.jsx(uilibGl.Icon, { kind: "date", disabled: true }), suffix: !isEmpty && !isDefault && jsxRuntime.jsx(StyledIconButton, { kind: "error", onClick: reset }), withTime: withTime, isDate: true, onChange: onChange }));
16250
+ return (jsxRuntime.jsx(uilibGl.RangeNumberInput, { label: label || t("interval", { ns: "dashboard", defaultValue: "Интервал" }), selectedOption: { range: true }, minDate: getDate(minDate), maxDate: getDate(maxDate), value: [getDate(value[0]), getDate(value[1])], zIndex: DASHBOARD_OVERLAY_Z_INDEX, prefix: jsxRuntime.jsx(uilibGl.Icon, { kind: "date", disabled: true }), suffix: !isEmpty && !isDefault && jsxRuntime.jsx(StyledIconButton, { kind: "error", onClick: reset }), withTime: withTime, isDate: true, onChange: onChange }));
16200
16251
  };
16201
16252
 
16202
16253
  const getJustifyContent = (align) => {
@@ -16840,7 +16891,7 @@ const useTreeFilter = (type, filter) => {
16840
16891
 
16841
16892
  const TreeFilter = ({ type, filter }) => {
16842
16893
  const { width, placeholder, multiSelect, loading, data, setData, expanded, setExpanded, onLoadChildren, selectedIds, selectedCount, selectedLabel, searchValue, onSearchChange, onOpen, onClose, onToggleSelect, onReset, onSave, dirty, } = useTreeFilter(type, filter);
16843
- return (jsxRuntime.jsx(TreeFilterContainer, { children: jsxRuntime.jsx(uilibGl.TreeDropdown, { zIndex: 100, width: getFilterWidth(width), placeholder: placeholder, multiSelect: multiSelect, loading: loading, data: data, setData: setData, expanded: expanded, setExpanded: setExpanded, onLoadChildren: onLoadChildren, selectedIds: selectedIds, selectedCount: selectedCount, selectedLabel: selectedLabel, searchValue: searchValue, onSearchChange: onSearchChange, onOpen: onOpen, onClose: onClose, onToggleSelect: onToggleSelect, onReset: onReset, onSave: onSave, dirty: dirty }) }));
16894
+ return (jsxRuntime.jsx(TreeFilterContainer, { children: jsxRuntime.jsx(uilibGl.TreeDropdown, { zIndex: DASHBOARD_OVERLAY_Z_INDEX, width: getFilterWidth(width), placeholder: placeholder, multiSelect: multiSelect, loading: loading, data: data, setData: setData, expanded: expanded, setExpanded: setExpanded, onLoadChildren: onLoadChildren, selectedIds: selectedIds, selectedCount: selectedCount, selectedLabel: selectedLabel, searchValue: searchValue, onSearchChange: onSearchChange, onOpen: onOpen, onClose: onClose, onToggleSelect: onToggleSelect, onReset: onReset, onSave: onSave, dirty: dirty }) }));
16844
16895
  };
16845
16896
 
16846
16897
  const getFilterComponent = (filterType) => {
@@ -17397,7 +17448,7 @@ const Chart = React.memo(({ config, element, elementConfig, type, renderElement
17397
17448
  ?.map(item => ({
17398
17449
  ...item,
17399
17450
  color: formatFilterColor(item.name, item.color, defaultColor),
17400
- })) || []), width: pieSide, height: pieSide, padAngle: angle, outerRadius: radius, cornerRadius: cornerRadius, renderTooltip: renderPieChartTooltip, withTooltip: true, onClick: filterName ? item => onFilter(item.name) : undefined, children: showTotal && (jsxRuntime.jsx(PieChartCenter, { children: totalWord || roundTotalSum(+totalSum) })) }) }));
17451
+ })) || []), width: pieSide, height: pieSide, padAngle: angle, outerRadius: radius, cornerRadius: cornerRadius, renderTooltip: renderPieChartTooltip, tooltipStyle: PIE_CHART_TOOLTIP_STYLE, withTooltip: true, onClick: filterName ? item => onFilter(item.name) : undefined, children: showTotal && (jsxRuntime.jsx(PieChartCenter, { children: totalWord || roundTotalSum(+totalSum) })) }) }));
17401
17452
  }
17402
17453
  const barChartData = getDataFromFilterItems(data[0]?.items);
17403
17454
  // Тот же случай, что у stack: обёртка выше тела на подписи оси X (margin.bottom). В fill
@@ -17457,7 +17508,7 @@ const Chart = React.memo(({ config, element, elementConfig, type, renderElement
17457
17508
  ]);
17458
17509
  if (!isVisibleContainer(id, expandable, expanded, expandedContainers))
17459
17510
  return null;
17460
- const chartBody = (jsxRuntime.jsx(ChartWrapper, { width: isPieChart && fill ? pieSide : width, height: isStackBar ? "auto" : isPieChart ? (fill ? pieSide : width) : chartHeight, column: column, loading: loading, children: renderChart }));
17511
+ const chartBody = (jsxRuntime.jsxs(ChartWrapper, { width: isPieChart && fill ? pieSide : width, height: isStackBar ? "auto" : isPieChart ? (fill ? pieSide : width) : chartHeight, column: column, loading: loading, children: [jsxRuntime.jsx(ChartTooltipStyles, {}), renderChart] }));
17461
17512
  if (!fill)
17462
17513
  return chartBody;
17463
17514
  // fill: тело центрируется в измеряемой обёртке, ref которой питает ResizeObserver обеими осями.
@@ -18155,6 +18206,7 @@ exports.ContainerLoading = ContainerLoading;
18155
18206
  exports.ContainerRoot = ContainerRoot;
18156
18207
  exports.ContainerWrapper = ContainerWrapper;
18157
18208
  exports.ContainersGroupContainer = ContainersGroupContainer;
18209
+ exports.DASHBOARD_OVERLAY_Z_INDEX = DASHBOARD_OVERLAY_Z_INDEX;
18158
18210
  exports.DEFAULT_ATTRIBUTE_NAME = DEFAULT_ATTRIBUTE_NAME;
18159
18211
  exports.DEFAULT_BARCHART_RADIUS = DEFAULT_BARCHART_RADIUS;
18160
18212
  exports.DEFAULT_BASE_MAP = DEFAULT_BASE_MAP;
@@ -18317,6 +18369,7 @@ exports.NoLiveSnapshotContainer = NoLiveSnapshotContainer;
18317
18369
  exports.OBJECT_FITS = OBJECT_FITS;
18318
18370
  exports.OVERFLOWS = OVERFLOWS;
18319
18371
  exports.OneColumnContainer = OneColumnContainer;
18372
+ exports.PIE_CHART_TOOLTIP_STYLE = PIE_CHART_TOOLTIP_STYLE;
18320
18373
  exports.POLL_SUBTASK_INTERVAL_MS = POLL_SUBTASK_INTERVAL_MS;
18321
18374
  exports.POLL_SUBTASK_TIMEOUT_MS = POLL_SUBTASK_TIMEOUT_MS;
18322
18375
  exports.PROVIDER_PREFIX = PROVIDER_PREFIX;