@evergis/react 4.0.59 → 4.0.62

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.
Files changed (63) hide show
  1. package/dist/components/Dashboard/branded.d.ts +52 -0
  2. package/dist/components/Dashboard/componentTypes.d.ts +571 -0
  3. package/dist/components/Dashboard/components/TextTrim/index.d.ts +2 -0
  4. package/dist/components/Dashboard/components/TextTrim/styled.d.ts +4 -0
  5. package/dist/components/Dashboard/containers/AddFeatureContainer/index.d.ts +2 -2
  6. package/dist/components/Dashboard/containers/AttachmentContainer/index.d.ts +2 -2
  7. package/dist/components/Dashboard/containers/CameraContainer/index.d.ts +2 -2
  8. package/dist/components/Dashboard/containers/ChartContainer/index.d.ts +2 -2
  9. package/dist/components/Dashboard/containers/ContainersGroupContainer/index.d.ts +2 -2
  10. package/dist/components/Dashboard/containers/DataSourceContainer/index.d.ts +2 -2
  11. package/dist/components/Dashboard/containers/DataSourceProgressContainer/index.d.ts +2 -2
  12. package/dist/components/Dashboard/containers/DefaultAttributesContainer/index.d.ts +2 -2
  13. package/dist/components/Dashboard/containers/DividerContainer/index.d.ts +2 -2
  14. package/dist/components/Dashboard/containers/EditContainer/components/EditAttachmentContainer.d.ts +2 -2
  15. package/dist/components/Dashboard/containers/EditContainer/components/EditBooleanContainer.d.ts +2 -2
  16. package/dist/components/Dashboard/containers/EditContainer/components/EditCheckboxContainer.d.ts +2 -2
  17. package/dist/components/Dashboard/containers/EditContainer/components/EditChipsContainer.d.ts +2 -2
  18. package/dist/components/Dashboard/containers/EditContainer/components/EditDateContainer.d.ts +2 -2
  19. package/dist/components/Dashboard/containers/EditContainer/components/EditDropdownContainer.d.ts +2 -2
  20. package/dist/components/Dashboard/containers/EditContainer/components/EditGroupContainer.d.ts +2 -2
  21. package/dist/components/Dashboard/containers/EditContainer/components/EditNumberContainer.d.ts +2 -2
  22. package/dist/components/Dashboard/containers/EditContainer/components/EditStringContainer.d.ts +2 -2
  23. package/dist/components/Dashboard/containers/EditContainer/index.d.ts +2 -2
  24. package/dist/components/Dashboard/containers/ExportPdfContainer/index.d.ts +2 -2
  25. package/dist/components/Dashboard/containers/FiltersContainer/index.d.ts +2 -2
  26. package/dist/components/Dashboard/containers/IconContainer/index.d.ts +2 -2
  27. package/dist/components/Dashboard/containers/ImageContainer/index.d.ts +2 -2
  28. package/dist/components/Dashboard/containers/LayersContainer/index.d.ts +2 -2
  29. package/dist/components/Dashboard/containers/OneColumnContainer/index.d.ts +2 -2
  30. package/dist/components/Dashboard/containers/PagesContainer/index.d.ts +2 -2
  31. package/dist/components/Dashboard/containers/SlideshowContainer/index.d.ts +2 -2
  32. package/dist/components/Dashboard/containers/TabsContainer/index.d.ts +2 -2
  33. package/dist/components/Dashboard/containers/TaskContainer/index.d.ts +2 -2
  34. package/dist/components/Dashboard/containers/TitleContainer/index.d.ts +2 -2
  35. package/dist/components/Dashboard/containers/TwoColumnContainer/index.d.ts +2 -2
  36. package/dist/components/Dashboard/containers/UploadContainer/index.d.ts +2 -2
  37. package/dist/components/Dashboard/containers/registry.d.ts +37 -34
  38. package/dist/components/Dashboard/elements/ElementButton/index.d.ts +2 -2
  39. package/dist/components/Dashboard/elements/ElementCamera/types.d.ts +2 -2
  40. package/dist/components/Dashboard/elements/ElementChart/index.d.ts +2 -2
  41. package/dist/components/Dashboard/elements/ElementChips/index.d.ts +2 -2
  42. package/dist/components/Dashboard/elements/ElementControl/index.d.ts +2 -2
  43. package/dist/components/Dashboard/elements/ElementIcon/index.d.ts +2 -2
  44. package/dist/components/Dashboard/elements/ElementImage/index.d.ts +2 -2
  45. package/dist/components/Dashboard/elements/ElementImage/useElementImage.d.ts +11 -0
  46. package/dist/components/Dashboard/elements/ElementLegend/index.d.ts +2 -4
  47. package/dist/components/Dashboard/elements/ElementLink/index.d.ts +2 -2
  48. package/dist/components/Dashboard/elements/ElementMarkdown/index.d.ts +2 -2
  49. package/dist/components/Dashboard/elements/ElementModal/index.d.ts +2 -2
  50. package/dist/components/Dashboard/elements/ElementSlideshow/types.d.ts +2 -2
  51. package/dist/components/Dashboard/elements/ElementSvg/index.d.ts +2 -6
  52. package/dist/components/Dashboard/elements/ElementTooltip/index.d.ts +2 -2
  53. package/dist/components/Dashboard/elements/ElementUploader/index.d.ts +2 -2
  54. package/dist/components/Dashboard/elements/registry.d.ts +12 -14
  55. package/dist/components/Dashboard/hooks/useWidgetConfig.d.ts +5 -1
  56. package/dist/components/Dashboard/hooks/useWidgetContext.d.ts +12 -1
  57. package/dist/components/Dashboard/hooks/useWidgetPage.d.ts +4 -1
  58. package/dist/components/Dashboard/types.d.ts +198 -93
  59. package/dist/index.js +143 -57
  60. package/dist/index.js.map +1 -1
  61. package/dist/react.esm.js +132 -58
  62. package/dist/react.esm.js.map +1 -1
  63. package/package.json +3 -3
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Branded types для entity-id.
3
+ *
4
+ * Идея — TS-only бренд на строку, чтобы `ChartId`, `ModalId`, `TabId`, ... были
5
+ * несовместимы между собой на этапе компиляции (`findChart(modalId)` → ошибка),
6
+ * при этом в runtime оставались обычными строками (JSON/Redux/fetch совместимы).
7
+ *
8
+ * Slot-id (`"alias" | "chart" | "legend" | ...`) **не покрываются** этим модулем — это
9
+ * литералы фиксированного набора, типизируются через сужение `id` в parent-specific
10
+ * child-типах.
11
+ *
12
+ * Использование:
13
+ * ```ts
14
+ * import { ChartId, asChartId } from "@evergis/react";
15
+ *
16
+ * // на границе deserialize: cast через конструктор
17
+ * const id = asChartId("chart-1"); // ChartId
18
+ *
19
+ * function findChart(id: ChartId): Chart | undefined { ... }
20
+ *
21
+ * findChart(id); // ✓
22
+ * findChart("chart-1"); // ❌ TS error — string не подставится в ChartId
23
+ * findChart(modalId); // ❌ TS error — ModalId ≠ ChartId
24
+ * ```
25
+ *
26
+ * Иерархия: `ChartId`/`ModalId`/`TabId` — подтипы `ContainerId` (один runtime-keyspace,
27
+ * `ConfigContainer.id`). `LayerName`/`FilterName`/`AttributeName`/`DataSourceName`/`ResourceId`
28
+ * — независимые бренды.
29
+ */
30
+ declare const brand: unique symbol;
31
+ export type Brand<T, B extends string> = T & {
32
+ readonly [brand]: B;
33
+ };
34
+ export type ContainerId = Brand<string, "ContainerId">;
35
+ export type ChartId = ContainerId & Brand<string, "ChartId">;
36
+ export type ModalId = ContainerId & Brand<string, "ModalId">;
37
+ export type TabId = ContainerId & Brand<string, "TabId">;
38
+ export type FilterName = Brand<string, "FilterName">;
39
+ export type LayerName = Brand<string, "LayerName">;
40
+ export type AttributeName = Brand<string, "AttributeName">;
41
+ export type DataSourceName = Brand<string, "DataSourceName">;
42
+ export type ResourceId = Brand<string, "ResourceId">;
43
+ export declare const asContainerId: (value: string) => ContainerId;
44
+ export declare const asChartId: (value: string) => ChartId;
45
+ export declare const asModalId: (value: string) => ModalId;
46
+ export declare const asTabId: (value: string) => TabId;
47
+ export declare const asFilterName: (value: string) => FilterName;
48
+ export declare const asLayerName: (value: string) => LayerName;
49
+ export declare const asAttributeName: (value: string) => AttributeName;
50
+ export declare const asDataSourceName: (value: string) => DataSourceName;
51
+ export declare const asResourceId: (value: string) => ResourceId;
52
+ export {};
@@ -0,0 +1,571 @@
1
+ import { QueryLayerServiceInfoDc } from '@evergis/api';
2
+ import { ClientFeatureAttribute, ConfigContainer, ConfigContainerChild, ConfigContainerHeader, ConfigOptions, ContainerProps, ContainerTemplate, HeaderTemplate } from './types';
3
+ export type ElementButtonOptions = Record<string, never>;
4
+ export interface ElementButtonConfig extends Omit<ConfigContainerChild, "options" | "type"> {
5
+ type?: "button";
6
+ options?: ElementButtonOptions;
7
+ }
8
+ export interface ElementButtonProps extends Omit<ContainerProps, "elementConfig"> {
9
+ elementConfig?: ElementButtonConfig;
10
+ }
11
+ export type ElementCameraOptions = Pick<ConfigOptions, "expandable" | "expanded">;
12
+ export interface ElementCameraConfig extends Omit<ConfigContainerChild, "options" | "type"> {
13
+ type?: "camera";
14
+ options?: ElementCameraOptions;
15
+ }
16
+ export interface ElementCameraProps extends Omit<ContainerProps, "elementConfig"> {
17
+ elementConfig?: ElementCameraConfig;
18
+ }
19
+ export type ElementChartOptions = Pick<ConfigOptions, "column" | "markers" | "showLabels" | "showMarkers" | "showTotal" | "totalWord" | "totalAttribute" | "expandable" | "expanded" | "chartType" | "relatedDataSources" | "defaultColor" | "dotSnapping" | "height" | "radius" | "padding" | "fontColor" | "angle" | "barWidth" | "cornerRadius" | "width">;
20
+ export interface ElementChartConfig extends Omit<ConfigContainerChild, "options" | "type"> {
21
+ type?: "chart";
22
+ options?: ElementChartOptions;
23
+ }
24
+ export interface ElementChartProps extends Omit<ContainerProps, "elementConfig"> {
25
+ elementConfig?: ElementChartConfig;
26
+ }
27
+ export type ElementChipsOptions = Pick<ConfigOptions, "separator" | "bgColor" | "fontColor" | "fontSize" | "colorAttribute" | "variants">;
28
+ export interface ElementChipsConfig extends Omit<ConfigContainerChild, "options" | "type"> {
29
+ type?: "tags";
30
+ options?: ElementChipsOptions;
31
+ }
32
+ export interface ElementChipsProps extends Omit<ContainerProps, "elementConfig"> {
33
+ elementConfig?: ElementChipsConfig;
34
+ }
35
+ export type ElementControlOptions = Pick<ConfigOptions, "relatedDataSource" | "label" | "width" | "control" | "placeholder">;
36
+ export interface ElementControlConfig extends Omit<ConfigContainerChild, "options" | "type"> {
37
+ type?: "control";
38
+ options?: ElementControlOptions;
39
+ }
40
+ export interface ElementControlProps extends Omit<ContainerProps, "elementConfig"> {
41
+ elementConfig?: ElementControlConfig;
42
+ }
43
+ export type ElementIconOptions = Pick<ConfigOptions, "fontSize" | "fontColor">;
44
+ export interface ElementIconConfig extends Omit<ConfigContainerChild, "options" | "type"> {
45
+ type?: "icon";
46
+ options?: ElementIconOptions;
47
+ }
48
+ export interface ElementIconProps extends Omit<ContainerProps, "elementConfig"> {
49
+ elementConfig?: ElementIconConfig;
50
+ }
51
+ export type ElementImageOptions = Pick<ConfigOptions, "width">;
52
+ export interface ElementImageConfig extends Omit<ConfigContainerChild, "options" | "type"> {
53
+ type?: "image";
54
+ options?: ElementImageOptions;
55
+ }
56
+ export interface ElementImageProps extends Omit<ContainerProps, "elementConfig"> {
57
+ elementConfig?: ElementImageConfig;
58
+ }
59
+ export type ElementLegendOptions = Pick<ConfigOptions, "twoColumns" | "chartId" | "relatedDataSources" | "fontSize" | "chartType">;
60
+ export interface ElementLegendConfig extends Omit<ConfigContainerChild, "options" | "type"> {
61
+ type?: "legend";
62
+ options?: ElementLegendOptions;
63
+ }
64
+ export interface ElementLegendProps extends Omit<ContainerProps, "elementConfig"> {
65
+ elementConfig?: ElementLegendConfig;
66
+ /** Родительский ChartContainer-конфиг для поиска связанного chart-ребёнка по `chartId`. */
67
+ element?: ConfigContainerChild;
68
+ }
69
+ export type ElementLinkOptions = Pick<ConfigOptions, "simple" | "title">;
70
+ export interface ElementLinkConfig extends Omit<ConfigContainerChild, "options" | "type"> {
71
+ type?: "link";
72
+ options?: ElementLinkOptions;
73
+ }
74
+ export interface ElementLinkProps extends Omit<ContainerProps, "elementConfig"> {
75
+ elementConfig?: ElementLinkConfig;
76
+ }
77
+ export type ElementMarkdownOptions = Pick<ConfigOptions, "expandLength">;
78
+ export interface ElementMarkdownConfig extends Omit<ConfigContainerChild, "options" | "type"> {
79
+ type?: "markdown";
80
+ options?: ElementMarkdownOptions;
81
+ }
82
+ export interface ElementMarkdownProps extends Omit<ContainerProps, "elementConfig"> {
83
+ elementConfig?: ElementMarkdownConfig;
84
+ }
85
+ export type ElementModalOptions = Pick<ConfigOptions, "modalId" | "icon">;
86
+ export interface ElementModalConfig extends Omit<ConfigContainerChild, "options" | "type"> {
87
+ type?: "modal";
88
+ options?: ElementModalOptions;
89
+ }
90
+ export interface ElementModalProps extends Omit<ContainerProps, "elementConfig"> {
91
+ elementConfig?: ElementModalConfig;
92
+ }
93
+ export type ElementSlideshowOptions = Pick<ConfigOptions, "expandable" | "expanded" | "relatedDataSource" | "controls">;
94
+ export interface ElementSlideshowConfig extends Omit<ConfigContainerChild, "options" | "type"> {
95
+ type?: "slideshow";
96
+ options?: ElementSlideshowOptions;
97
+ }
98
+ export interface ElementSlideshowProps extends Omit<ContainerProps, "elementConfig"> {
99
+ elementConfig?: ElementSlideshowConfig;
100
+ }
101
+ export type ElementSvgOptions = Pick<ConfigOptions, "width" | "height" | "fontColor">;
102
+ export interface ElementSvgConfig extends Omit<ConfigContainerChild, "options" | "type"> {
103
+ type?: "svg";
104
+ options?: ElementSvgOptions;
105
+ }
106
+ export interface ElementSvgProps extends Omit<ContainerProps, "elementConfig"> {
107
+ elementConfig?: ElementSvgConfig;
108
+ layerInfo?: QueryLayerServiceInfoDc;
109
+ attributes?: ClientFeatureAttribute[];
110
+ }
111
+ export type ElementTooltipOptions = Pick<ConfigOptions, "icon">;
112
+ export interface ElementTooltipConfig extends Omit<ConfigContainerChild, "options" | "type"> {
113
+ type?: "tooltip";
114
+ options?: ElementTooltipOptions;
115
+ }
116
+ export interface ElementTooltipProps extends Omit<ContainerProps, "elementConfig"> {
117
+ elementConfig?: ElementTooltipConfig;
118
+ }
119
+ export type ElementUploaderOptions = Pick<ConfigOptions, "fileExtensions" | "multiSelect" | "parentResourceId" | "icon" | "title" | "filterName">;
120
+ export interface ElementUploaderConfig extends Omit<ConfigContainerChild, "options" | "type"> {
121
+ type?: "uploader";
122
+ options?: ElementUploaderOptions;
123
+ }
124
+ export interface ElementUploaderProps extends Omit<ContainerProps, "elementConfig"> {
125
+ elementConfig?: ElementUploaderConfig;
126
+ }
127
+ export type AddFeatureContainerOptions = Record<string, never>;
128
+ export type AddFeatureButtonOptions = Pick<ConfigOptions, "icon" | "title" | "layerName" | "geometryType">;
129
+ export interface AddFeatureButtonChild extends Omit<ConfigContainerChild, "options" | "type"> {
130
+ type?: "button";
131
+ options?: AddFeatureButtonOptions;
132
+ }
133
+ export interface AddFeatureContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName" | "children"> {
134
+ templateName?: ContainerTemplate.AddFeature;
135
+ options?: AddFeatureContainerOptions;
136
+ children?: AddFeatureButtonChild[];
137
+ }
138
+ export interface AddFeatureContainerProps extends Omit<ContainerProps, "elementConfig"> {
139
+ elementConfig?: AddFeatureContainerConfig;
140
+ }
141
+ export type AttachmentContainerOptions = Pick<ConfigOptions, "expandable" | "expanded" | "viewMode" | "shownItems" | "otherItems" | "relatedDataSource" | "controls">;
142
+ export interface AttachmentContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
143
+ templateName?: ContainerTemplate.Attachment;
144
+ options?: AttachmentContainerOptions;
145
+ }
146
+ export interface AttachmentContainerProps extends Omit<ContainerProps, "elementConfig"> {
147
+ elementConfig?: AttachmentContainerConfig;
148
+ }
149
+ export type CameraContainerOptions = Pick<ConfigOptions, "expandable" | "expanded">;
150
+ export interface CameraContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
151
+ templateName?: ContainerTemplate.Camera;
152
+ options?: CameraContainerOptions;
153
+ }
154
+ export interface CameraContainerProps extends Omit<ContainerProps, "elementConfig"> {
155
+ elementConfig?: CameraContainerConfig;
156
+ }
157
+ export type ChartContainerOptions = Pick<ConfigOptions, "twoColumns" | "hideEmpty">;
158
+ export interface ChartAliasChild extends Omit<ConfigContainerChild, "id"> {
159
+ id: "alias";
160
+ }
161
+ export interface ChartChartChild extends Omit<ConfigContainerChild, "id" | "type"> {
162
+ id: "chart";
163
+ type?: "chart";
164
+ }
165
+ export type ChartLegendChildOptions = ElementLegendOptions & Pick<ConfigOptions, "center">;
166
+ export interface ChartLegendChild extends Omit<ConfigContainerChild, "id" | "type" | "options"> {
167
+ id: "legend";
168
+ type?: "legend";
169
+ options?: ChartLegendChildOptions;
170
+ }
171
+ export interface ChartTitleChild extends Omit<ConfigContainerChild, "id" | "type"> {
172
+ id: "title";
173
+ type?: "text";
174
+ }
175
+ export interface ChartTitleIconChild extends Omit<ConfigContainerChild, "id" | "type"> {
176
+ id: "titleIcon";
177
+ type?: "icon";
178
+ }
179
+ export type ChartContainerChild = ChartAliasChild | ChartChartChild | ChartLegendChild | ChartTitleChild | ChartTitleIconChild;
180
+ export interface ChartContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName" | "children"> {
181
+ templateName?: ContainerTemplate.Chart;
182
+ options?: ChartContainerOptions;
183
+ children?: ChartContainerChild[];
184
+ }
185
+ export interface ChartContainerProps extends Omit<ContainerProps, "elementConfig"> {
186
+ elementConfig?: ChartContainerConfig;
187
+ }
188
+ export type ContainersGroupContainerOptions = Pick<ConfigOptions, "column" | "expandable" | "expanded">;
189
+ export interface ContainersGroupContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
190
+ templateName?: ContainerTemplate.ContainersGroup;
191
+ options?: ContainersGroupContainerOptions;
192
+ }
193
+ export interface ContainersGroupContainerProps extends Omit<ContainerProps, "elementConfig"> {
194
+ elementConfig?: ContainersGroupContainerConfig;
195
+ }
196
+ export type DataSourceContainerOptions = Pick<ConfigOptions, "column" | "relatedDataSource" | "expandable" | "expanded">;
197
+ export interface DataSourceContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
198
+ templateName?: ContainerTemplate.DataSource;
199
+ options?: DataSourceContainerOptions;
200
+ }
201
+ export interface DataSourceContainerProps extends Omit<ContainerProps, "elementConfig"> {
202
+ elementConfig?: DataSourceContainerConfig;
203
+ }
204
+ export type DataSourceInnerContainerOptions = Pick<ConfigOptions, "relatedDataSource" | "filterName" | "column">;
205
+ export interface DataSourceInnerContainerConfig extends Omit<ConfigContainerChild, "options"> {
206
+ options?: DataSourceInnerContainerOptions;
207
+ }
208
+ export type DataSourceProgressContainerOptions = Pick<ConfigOptions, "maxValue" | "showTotal" | "relatedDataSource" | "expandable" | "expanded" | "shownItems">;
209
+ export interface DataSourceProgressContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
210
+ templateName?: ContainerTemplate.DataSourceProgress;
211
+ options?: DataSourceProgressContainerOptions;
212
+ }
213
+ export interface DataSourceProgressContainerProps extends Omit<ContainerProps, "elementConfig"> {
214
+ elementConfig?: DataSourceProgressContainerConfig;
215
+ }
216
+ export type DefaultAttributesContainerOptions = Record<string, never>;
217
+ export interface DefaultAttributesContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
218
+ templateName?: ContainerTemplate.DefaultAttributes;
219
+ options?: DefaultAttributesContainerOptions;
220
+ }
221
+ export interface DefaultAttributesContainerProps extends Omit<ContainerProps, "elementConfig"> {
222
+ elementConfig?: DefaultAttributesContainerConfig;
223
+ }
224
+ export type DividerContainerOptions = Pick<ConfigOptions, "bgColor">;
225
+ export interface DividerContainerConfig extends Omit<ConfigContainer, "options"> {
226
+ options?: DividerContainerOptions;
227
+ }
228
+ export interface DividerContainerElementConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
229
+ templateName?: ContainerTemplate.Divider;
230
+ options?: Record<string, never>;
231
+ }
232
+ export interface DividerContainerProps extends Omit<ContainerProps, "config" | "elementConfig"> {
233
+ config?: DividerContainerConfig;
234
+ elementConfig?: DividerContainerElementConfig;
235
+ }
236
+ export type EditContainerOptions = Record<string, never>;
237
+ export interface EditContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
238
+ templateName?: ContainerTemplate.Edit;
239
+ options?: EditContainerOptions;
240
+ }
241
+ export interface EditContainerProps extends Omit<ContainerProps, "elementConfig"> {
242
+ elementConfig?: EditContainerConfig;
243
+ }
244
+ export type EditGroupContainerOptions = Pick<ConfigOptions, "controls" | "useProjectHiddenAttributes" | "expandable" | "expanded">;
245
+ export interface EditGroupContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
246
+ templateName?: ContainerTemplate.EditGroup;
247
+ options?: EditGroupContainerOptions;
248
+ }
249
+ export interface EditGroupContainerProps extends Omit<ContainerProps, "elementConfig"> {
250
+ elementConfig?: EditGroupContainerConfig;
251
+ }
252
+ export type EditBooleanContainerOptions = Pick<ConfigOptions, "controls">;
253
+ export interface EditBooleanContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
254
+ templateName?: ContainerTemplate.EditBoolean;
255
+ options?: EditBooleanContainerOptions;
256
+ }
257
+ export interface EditBooleanContainerProps extends Omit<ContainerProps, "elementConfig"> {
258
+ elementConfig?: EditBooleanContainerConfig;
259
+ }
260
+ export type EditStringContainerOptions = Pick<ConfigOptions, "controls">;
261
+ export interface EditStringContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
262
+ templateName?: ContainerTemplate.EditString;
263
+ options?: EditStringContainerOptions;
264
+ }
265
+ export interface EditStringContainerProps extends Omit<ContainerProps, "elementConfig"> {
266
+ elementConfig?: EditStringContainerConfig;
267
+ }
268
+ export type EditNumberContainerOptions = Pick<ConfigOptions, "controls">;
269
+ export interface EditNumberContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
270
+ templateName?: ContainerTemplate.EditNumber;
271
+ options?: EditNumberContainerOptions;
272
+ }
273
+ export interface EditNumberContainerProps extends Omit<ContainerProps, "elementConfig"> {
274
+ elementConfig?: EditNumberContainerConfig;
275
+ }
276
+ export type EditDropdownContainerOptions = Pick<ConfigOptions, "controls">;
277
+ export interface EditDropdownContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
278
+ templateName?: ContainerTemplate.EditDropdown;
279
+ options?: EditDropdownContainerOptions;
280
+ }
281
+ export interface EditDropdownContainerProps extends Omit<ContainerProps, "elementConfig"> {
282
+ elementConfig?: EditDropdownContainerConfig;
283
+ }
284
+ export type EditChipsContainerOptions = Pick<ConfigOptions, "controls">;
285
+ export interface EditChipsContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
286
+ templateName?: ContainerTemplate.EditChips;
287
+ options?: EditChipsContainerOptions;
288
+ }
289
+ export interface EditChipsContainerProps extends Omit<ContainerProps, "elementConfig"> {
290
+ elementConfig?: EditChipsContainerConfig;
291
+ }
292
+ export type EditCheckboxContainerOptions = Pick<ConfigOptions, "controls">;
293
+ export interface EditCheckboxContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
294
+ templateName?: ContainerTemplate.EditCheckbox;
295
+ options?: EditCheckboxContainerOptions;
296
+ }
297
+ export interface EditCheckboxContainerProps extends Omit<ContainerProps, "elementConfig"> {
298
+ elementConfig?: EditCheckboxContainerConfig;
299
+ }
300
+ export type EditDateContainerOptions = Pick<ConfigOptions, "withTime" | "controls">;
301
+ export interface EditDateContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
302
+ templateName?: ContainerTemplate.EditDate;
303
+ options?: EditDateContainerOptions;
304
+ }
305
+ export interface EditDateContainerProps extends Omit<ContainerProps, "elementConfig"> {
306
+ elementConfig?: EditDateContainerConfig;
307
+ }
308
+ export type EditAttachmentContainerOptions = Pick<ConfigOptions, "parentResourceId" | "fileExtensions" | "viewMode" | "shownItems" | "otherItems" | "relatedDataSource" | "controls">;
309
+ export interface EditAttachmentContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
310
+ templateName?: ContainerTemplate.EditAttachment;
311
+ options?: EditAttachmentContainerOptions;
312
+ }
313
+ export interface EditAttachmentContainerProps extends Omit<ContainerProps, "elementConfig"> {
314
+ elementConfig?: EditAttachmentContainerConfig;
315
+ }
316
+ export type ExportPdfContainerOptions = Pick<ConfigOptions, "icon" | "title">;
317
+ export interface ExportPdfContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
318
+ templateName?: ContainerTemplate.ExportPdf;
319
+ options?: ExportPdfContainerOptions;
320
+ }
321
+ export interface ExportPdfContainerProps extends Omit<ContainerProps, "elementConfig"> {
322
+ elementConfig?: ExportPdfContainerConfig;
323
+ }
324
+ export type FiltersContainerOptions = Pick<ConfigOptions, "padding" | "bgColor" | "fontColor" | "fontSize" | "expandable" | "expanded">;
325
+ export type FilterChildOptions = Pick<ConfigOptions, "filterName" | "label" | "placeholder" | "control" | "controls" | "relatedDataSource" | "minValue" | "maxValue">;
326
+ export interface FilterChild extends Omit<ConfigContainerChild, "options" | "type"> {
327
+ /** {@link FilterType} оставляем строкой, чтобы не плодить два почти одинаковых union-а в `type`. */
328
+ type?: ConfigContainerChild["type"];
329
+ options?: FilterChildOptions;
330
+ }
331
+ export interface FiltersContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName" | "children"> {
332
+ templateName?: ContainerTemplate.Filters;
333
+ options?: FiltersContainerOptions;
334
+ children?: FilterChild[];
335
+ }
336
+ export interface FiltersContainerProps extends Omit<ContainerProps, "elementConfig"> {
337
+ elementConfig?: FiltersContainerConfig;
338
+ }
339
+ export type IconContainerOptions = Record<string, never>;
340
+ export interface IconContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
341
+ templateName?: ContainerTemplate.Icon;
342
+ options?: IconContainerOptions;
343
+ }
344
+ export interface IconContainerProps extends Omit<ContainerProps, "elementConfig"> {
345
+ elementConfig?: IconContainerConfig;
346
+ }
347
+ export type ImageContainerOptions = Record<string, never>;
348
+ export interface ImageContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
349
+ templateName?: ContainerTemplate.Image;
350
+ options?: ImageContainerOptions;
351
+ }
352
+ export interface ImageContainerProps extends Omit<ContainerProps, "elementConfig"> {
353
+ elementConfig?: ImageContainerConfig;
354
+ }
355
+ export type LayersContainerOptions = Pick<ConfigOptions, "layerNames" | "expandable" | "expanded">;
356
+ export interface LayersContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
357
+ templateName?: ContainerTemplate.Layers;
358
+ options?: LayersContainerOptions;
359
+ }
360
+ export interface LayersContainerProps extends Omit<ContainerProps, "elementConfig"> {
361
+ elementConfig?: LayersContainerConfig;
362
+ }
363
+ export type OneColumnContainerOptions = Pick<ConfigOptions, "attributes" | "useProjectHiddenAttributes" | "hideEmpty" | "innerTemplateStyle">;
364
+ export interface OneColumnContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
365
+ templateName?: ContainerTemplate.OneColumn;
366
+ options?: OneColumnContainerOptions;
367
+ }
368
+ export interface OneColumnContainerProps extends Omit<ContainerProps, "elementConfig"> {
369
+ elementConfig?: OneColumnContainerConfig;
370
+ }
371
+ export type PagesContainerOptions = Pick<ConfigOptions, "column" | "width">;
372
+ export type PageChildOptions = Pick<ConfigOptions, "tabId">;
373
+ export interface PageChild extends Omit<ConfigContainerChild, "options"> {
374
+ options?: PageChildOptions & ConfigOptions;
375
+ }
376
+ export interface PagesContainerConfig extends Omit<ConfigContainer, "options"> {
377
+ options?: PagesContainerOptions;
378
+ }
379
+ export interface PagesContainerProps extends Omit<ContainerProps, "config"> {
380
+ config?: PagesContainerConfig;
381
+ }
382
+ export type ProgressContainerOptions = Pick<ConfigOptions, "bgColor" | "innerTemplateStyle" | "maxValue" | "hideTitle" | "innerValue" | "colors" | "colorAttribute">;
383
+ export interface ProgressContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
384
+ templateName?: ContainerTemplate.Progress;
385
+ options?: ProgressContainerOptions;
386
+ }
387
+ export interface ProgressContainerProps extends Omit<ContainerProps, "elementConfig"> {
388
+ elementConfig?: ProgressContainerConfig;
389
+ }
390
+ export type RoundedBackgroundContainerOptions = Pick<ConfigOptions, "maxLength" | "center" | "fontColor" | "innerTemplateStyle" | "inlineUnits" | "big" | "bigIcon" | "hideEmpty" | "colorAttribute">;
391
+ export interface RoundedBackgroundContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
392
+ templateName?: ContainerTemplate.RoundedBackground;
393
+ options?: RoundedBackgroundContainerOptions;
394
+ }
395
+ export interface RoundedBackgroundContainerProps extends Omit<ContainerProps, "elementConfig"> {
396
+ elementConfig?: RoundedBackgroundContainerConfig;
397
+ }
398
+ export type SlideshowContainerOptions = Pick<ConfigOptions, "expandable" | "expanded">;
399
+ export interface SlideshowContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
400
+ templateName?: ContainerTemplate.Slideshow;
401
+ options?: SlideshowContainerOptions;
402
+ }
403
+ export interface SlideshowContainerProps extends Omit<ContainerProps, "elementConfig"> {
404
+ elementConfig?: SlideshowContainerConfig;
405
+ }
406
+ export type TabsContainerOptions = Pick<ConfigOptions, "radius" | "column" | "bgColor" | "noBg" | "onlyIcon" | "shownItems" | "maxLength" | "wordBreak">;
407
+ export type TabOptions = Pick<ConfigOptions, "icon">;
408
+ export interface TabChild extends Omit<ConfigContainerChild, "options" | "type" | "children"> {
409
+ options?: TabOptions;
410
+ }
411
+ export interface TabsContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName" | "children"> {
412
+ templateName?: ContainerTemplate.Tabs;
413
+ options?: TabsContainerOptions;
414
+ children?: TabChild[];
415
+ }
416
+ export interface TabsContainerProps extends Omit<ContainerProps, "elementConfig"> {
417
+ elementConfig?: TabsContainerConfig;
418
+ }
419
+ export type TaskContainerOptions = Pick<ConfigOptions, "title" | "relatedResources" | "center" | "icon" | "statusColors" | "responseFilters">;
420
+ export interface TaskContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
421
+ templateName?: ContainerTemplate.Task;
422
+ options?: TaskContainerOptions;
423
+ }
424
+ export interface TaskContainerProps extends Omit<ContainerProps, "elementConfig"> {
425
+ elementConfig?: TaskContainerConfig;
426
+ }
427
+ export type TitleContainerOptions = Pick<ConfigOptions, "simple" | "downloadById">;
428
+ export interface TitleContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
429
+ templateName?: ContainerTemplate.Title;
430
+ options?: TitleContainerOptions;
431
+ }
432
+ export interface TitleContainerProps extends Omit<ContainerProps, "elementConfig"> {
433
+ elementConfig?: TitleContainerConfig;
434
+ }
435
+ export type TwoColumnContainerOptions = Pick<ConfigOptions, "attributes" | "useProjectHiddenAttributes" | "hideEmpty" | "innerTemplateStyle">;
436
+ export interface TwoColumnContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
437
+ templateName?: ContainerTemplate.TwoColumn;
438
+ options?: TwoColumnContainerOptions;
439
+ }
440
+ export interface TwoColumnContainerProps extends Omit<ContainerProps, "elementConfig"> {
441
+ elementConfig?: TwoColumnContainerConfig;
442
+ }
443
+ export type UploadContainerOptions = Pick<ConfigOptions, "expandable" | "expanded">;
444
+ export interface UploadContainerConfig extends Omit<ConfigContainerChild, "options" | "templateName"> {
445
+ templateName?: ContainerTemplate.Upload;
446
+ options?: UploadContainerOptions;
447
+ }
448
+ export interface UploadContainerProps extends Omit<ContainerProps, "elementConfig"> {
449
+ elementConfig?: UploadContainerConfig;
450
+ }
451
+ export type DashboardDefaultHeaderOptions = Pick<ConfigOptions, "url">;
452
+ export interface DashboardDefaultHeaderConfig extends Omit<ConfigContainerHeader, "options" | "templateName"> {
453
+ templateName?: HeaderTemplate.Default;
454
+ options?: DashboardDefaultHeaderOptions;
455
+ }
456
+ export type FeatureCardBackgroundHeaderOptions = Pick<ConfigOptions, "fontColor" | "bgColor" | "height" | "overlay" | "bigIcon" | "withPadding" | "bottomBlur" | "themeName" | "column">;
457
+ export interface FeatureCardBackgroundHeaderConfig extends Omit<ConfigContainerHeader, "options" | "templateName"> {
458
+ templateName?: HeaderTemplate.Background;
459
+ options?: FeatureCardBackgroundHeaderOptions;
460
+ }
461
+ export type FeatureCardDefaultHeaderOptions = Pick<ConfigOptions, "themeName" | "withPadding" | "column" | "height" | "overlay">;
462
+ export interface FeatureCardDefaultHeaderConfig extends Omit<ConfigContainerHeader, "options" | "templateName"> {
463
+ templateName?: HeaderTemplate.Default;
464
+ options?: FeatureCardDefaultHeaderOptions;
465
+ }
466
+ export type FeatureCardSlideshowHeaderOptions = Pick<ConfigOptions, "height" | "fontColor" | "withPadding" | "themeName" | "column" | "overlay">;
467
+ export interface FeatureCardSlideshowHeaderConfig extends Omit<ConfigContainerHeader, "options" | "templateName"> {
468
+ templateName?: HeaderTemplate.Slideshow;
469
+ options?: FeatureCardSlideshowHeaderOptions;
470
+ }
471
+ /**
472
+ * Discriminated union по `type` (для элементов) и `templateName` (для контейнеров).
473
+ *
474
+ * Каждая ветвь — `<Name>Config` с литеральным дискриминатором. При наличии `templateName` или `type`
475
+ * у конкретного значения TS сразу сужает union до соответствующей ветви и проверяет поля `options`.
476
+ *
477
+ * Поскольку оба поля помечены как опциональные (`?`), значения **без** дискриминатора по-прежнему
478
+ * приемлемы для любой ветви — это переходная мягкая совместимость с legacy-конфигами.
479
+ */
480
+ export type DashboardChild = ElementButtonConfig | ElementCameraConfig | ElementChartConfig | ElementChipsConfig | ElementControlConfig | ElementIconConfig | ElementImageConfig | ElementLegendConfig | ElementLinkConfig | ElementMarkdownConfig | ElementModalConfig | ElementSlideshowConfig | ElementSvgConfig | ElementTooltipConfig | ElementUploaderConfig | AddFeatureContainerConfig | AttachmentContainerConfig | CameraContainerConfig | ChartContainerConfig | ContainersGroupContainerConfig | DataSourceContainerConfig | DataSourceProgressContainerConfig | DefaultAttributesContainerConfig | DividerContainerElementConfig | EditContainerConfig | EditGroupContainerConfig | EditBooleanContainerConfig | EditStringContainerConfig | EditNumberContainerConfig | EditDropdownContainerConfig | EditChipsContainerConfig | EditCheckboxContainerConfig | EditDateContainerConfig | EditAttachmentContainerConfig | ExportPdfContainerConfig | FiltersContainerConfig | IconContainerConfig | ImageContainerConfig | LayersContainerConfig | OneColumnContainerConfig | ProgressContainerConfig | RoundedBackgroundContainerConfig | SlideshowContainerConfig | TabsContainerConfig | TaskContainerConfig | TitleContainerConfig | TwoColumnContainerConfig | UploadContainerConfig;
481
+ /**
482
+ * Discriminated union для хедеров. `HeaderTemplate.Default` сразу матчится сразу с двумя ветками
483
+ * (`DashboardDefaultHeaderConfig` и `FeatureCardDefaultHeaderConfig`) — это намеренно: ветки
484
+ * выбираются на уровне виджета (Dashboard vs FeatureCard), а на уровне типа union покрывает обе.
485
+ *
486
+ * Имя — `DashboardHeaderConfig`, потому что компонент с именем `DashboardHeader` уже занят
487
+ * (см. `components/DashboardHeader/index.tsx`).
488
+ */
489
+ export type DashboardHeaderConfig = DashboardDefaultHeaderConfig | FeatureCardBackgroundHeaderConfig | FeatureCardDefaultHeaderConfig | FeatureCardSlideshowHeaderConfig;
490
+ /**
491
+ * Карта `ContainerTemplate` → `<Name>ContainerProps`. Используется для типобезопасного
492
+ * `containers/registry.ts`, фабрики `getContainerComponent` и Code Connect Figma.
493
+ *
494
+ * `Progress` и `RoundedBackground` исторически используют `InnerContainerProps` (см.
495
+ * `containers/DataSourceInnerContainer/types.ts`). В сигнатуре регистрации это переживёт
496
+ * благодаря contravariance `FC<P>`: `FC<InnerContainerProps>` совместим с `FC<<Name>Props>`,
497
+ * пока `<Name>Props` ⊆ `InnerContainerProps`.
498
+ */
499
+ export type ContainerTemplateToProps = {
500
+ [ContainerTemplate.AddFeature]: AddFeatureContainerProps;
501
+ [ContainerTemplate.Attachment]: AttachmentContainerProps;
502
+ [ContainerTemplate.Camera]: CameraContainerProps;
503
+ [ContainerTemplate.Chart]: ChartContainerProps;
504
+ [ContainerTemplate.ContainersGroup]: ContainersGroupContainerProps;
505
+ [ContainerTemplate.DataSource]: DataSourceContainerProps;
506
+ [ContainerTemplate.DataSourceProgress]: DataSourceProgressContainerProps;
507
+ [ContainerTemplate.DefaultAttributes]: DefaultAttributesContainerProps;
508
+ [ContainerTemplate.Divider]: DividerContainerProps;
509
+ [ContainerTemplate.Edit]: EditContainerProps;
510
+ [ContainerTemplate.EditGroup]: EditGroupContainerProps;
511
+ [ContainerTemplate.EditBoolean]: EditBooleanContainerProps;
512
+ [ContainerTemplate.EditString]: EditStringContainerProps;
513
+ [ContainerTemplate.EditNumber]: EditNumberContainerProps;
514
+ [ContainerTemplate.EditDropdown]: EditDropdownContainerProps;
515
+ [ContainerTemplate.EditChips]: EditChipsContainerProps;
516
+ [ContainerTemplate.EditCheckbox]: EditCheckboxContainerProps;
517
+ [ContainerTemplate.EditDate]: EditDateContainerProps;
518
+ [ContainerTemplate.EditAttachment]: EditAttachmentContainerProps;
519
+ [ContainerTemplate.ExportPdf]: ExportPdfContainerProps;
520
+ [ContainerTemplate.Filters]: FiltersContainerProps;
521
+ [ContainerTemplate.Icon]: IconContainerProps;
522
+ [ContainerTemplate.Image]: ImageContainerProps;
523
+ [ContainerTemplate.Layers]: LayersContainerProps;
524
+ [ContainerTemplate.OneColumn]: OneColumnContainerProps;
525
+ [ContainerTemplate.Pages]: PagesContainerProps;
526
+ [ContainerTemplate.Progress]: ProgressContainerProps;
527
+ [ContainerTemplate.RoundedBackground]: RoundedBackgroundContainerProps;
528
+ [ContainerTemplate.Slideshow]: SlideshowContainerProps;
529
+ [ContainerTemplate.Tabs]: TabsContainerProps;
530
+ [ContainerTemplate.Task]: TaskContainerProps;
531
+ [ContainerTemplate.Title]: TitleContainerProps;
532
+ [ContainerTemplate.TwoColumn]: TwoColumnContainerProps;
533
+ [ContainerTemplate.Upload]: UploadContainerProps;
534
+ };
535
+ /**
536
+ * Карта `type` → `<Name>ElementProps` для регистра элементов из `elements/registry.ts`.
537
+ *
538
+ * Ключ — литерал из {@link ConfigElementType} ветки «component elements»; text/attribute-рендеры
539
+ * (`text`/`attributeValue`/...) обрабатываются в `utils/getElementValue.tsx` напрямую, без
540
+ * компонента, и в регистр не попадают.
541
+ */
542
+ export type ElementTypeToProps = {
543
+ control: ElementControlProps;
544
+ image: ElementImageProps;
545
+ slideshow: ElementSlideshowProps;
546
+ svg: ElementSvgProps;
547
+ icon: ElementIconProps;
548
+ tooltip: ElementTooltipProps;
549
+ tags: ElementChipsProps;
550
+ link: ElementLinkProps;
551
+ button: ElementButtonProps;
552
+ camera: ElementCameraProps;
553
+ chart: ElementChartProps;
554
+ legend: ElementLegendProps;
555
+ markdown: ElementMarkdownProps;
556
+ uploader: ElementUploaderProps;
557
+ modal: ElementModalProps;
558
+ };
559
+ /**
560
+ * Типобезопасный реестр контейнеров. Ключ `default` указывает FC для случая, когда `templateName`
561
+ * не задан или не найден в реестре.
562
+ */
563
+ export type ContainerComponentRegistry = {
564
+ [K in keyof ContainerTemplateToProps]: import('react').FC<ContainerTemplateToProps[K]>;
565
+ } & {
566
+ default: import('react').FC<ContainersGroupContainerProps>;
567
+ };
568
+ /** Типобезопасный реестр элементов. */
569
+ export type ElementComponentRegistry = {
570
+ [K in keyof ElementTypeToProps]: import('react').FC<ElementTypeToProps[K]>;
571
+ };
@@ -1,5 +1,7 @@
1
1
  import { FC } from 'react';
2
+ import { ConfigTextDisplayOptions } from '../../types';
2
3
  type TextTrimProps = {
4
+ wordBreak?: ConfigTextDisplayOptions["wordBreak"];
3
5
  maxLength?: number;
4
6
  expandable?: boolean;
5
7
  lineBreak?: string;
@@ -0,0 +1,4 @@
1
+ import { ConfigTextDisplayOptions } from '../../types';
2
+ export declare const TextTrimValue: import('styled-components').StyledComponent<"div", any, {
3
+ wordBreak?: ConfigTextDisplayOptions["wordBreak"];
4
+ }, never>;
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- import { ContainerProps } from '../../types';
3
- export declare const AddFeatureContainer: FC<ContainerProps>;
2
+ import { AddFeatureContainerProps } from '../../types';
3
+ export declare const AddFeatureContainer: FC<AddFeatureContainerProps>;
@@ -1,3 +1,3 @@
1
1
  import { FC } from 'react';
2
- import { ContainerProps } from '../../types';
3
- export declare const AttachmentContainer: FC<ContainerProps>;
2
+ import { AttachmentContainerProps } from '../../types';
3
+ export declare const AttachmentContainer: FC<AttachmentContainerProps>;