@openg2p/registry-widgets 1.1.3-dev.1 → 1.1.4-dev.1
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/README.md +100 -0
- package/dist/components/FilePreviewModal.d.ts +2 -4
- package/dist/components/FilePreviewModal.d.ts.map +1 -1
- package/dist/components/PanelRenderer.d.ts +0 -7
- package/dist/components/PanelRenderer.d.ts.map +1 -1
- package/dist/components/SectionBuilder/JSONEditorPanel.d.ts.map +1 -1
- package/dist/components/SectionBuilder/schemas.d.ts +5 -5
- package/dist/components/SectionBuilder/schemas.d.ts.map +1 -1
- package/dist/components/SectionRenderer/SectionRenderer.d.ts +3 -0
- package/dist/components/SectionRenderer/SectionRenderer.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/CRViewFooter.d.ts +8 -0
- package/dist/components/SectionRenderer/components/CRViewFooter.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/EditSectionPortal.d.ts +30 -0
- package/dist/components/SectionRenderer/components/EditSectionPortal.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/IntakeFormLayout.d.ts +23 -0
- package/dist/components/SectionRenderer/components/IntakeFormLayout.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/PanelGrid.d.ts +17 -0
- package/dist/components/SectionRenderer/components/PanelGrid.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/RegistryViewLayout.d.ts +26 -0
- package/dist/components/SectionRenderer/components/RegistryViewLayout.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/SectionEditControls.d.ts +7 -0
- package/dist/components/SectionRenderer/components/SectionEditControls.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/SectionStyles.d.ts +11 -0
- package/dist/components/SectionRenderer/components/SectionStyles.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/SupportingDocuments.d.ts +13 -0
- package/dist/components/SectionRenderer/components/SupportingDocuments.d.ts.map +1 -0
- package/dist/components/SectionRenderer/components/index.d.ts +9 -0
- package/dist/components/SectionRenderer/components/index.d.ts.map +1 -0
- package/dist/components/SectionRenderer/hooks/index.d.ts +6 -0
- package/dist/components/SectionRenderer/hooks/index.d.ts.map +1 -0
- package/dist/components/SectionRenderer/hooks/useCrViewData.d.ts +8 -0
- package/dist/components/SectionRenderer/hooks/useCrViewData.d.ts.map +1 -0
- package/dist/components/SectionRenderer/hooks/useIntakeFormAccordion.d.ts +6 -0
- package/dist/components/SectionRenderer/hooks/useIntakeFormAccordion.d.ts.map +1 -0
- package/dist/components/SectionRenderer/hooks/useSectionActions.d.ts +34 -0
- package/dist/components/SectionRenderer/hooks/useSectionActions.d.ts.map +1 -0
- package/dist/components/SectionRenderer/hooks/useSectionDirty.d.ts +25 -0
- package/dist/components/SectionRenderer/hooks/useSectionDirty.d.ts.map +1 -0
- package/dist/components/SectionRenderer/hooks/useSectionEditPortal.d.ts +15 -0
- package/dist/components/SectionRenderer/hooks/useSectionEditPortal.d.ts.map +1 -0
- package/dist/components/SectionRenderer/index.d.ts +3 -0
- package/dist/components/SectionRenderer/index.d.ts.map +1 -0
- package/dist/components/SectionRenderer/types/index.d.ts +3 -0
- package/dist/components/SectionRenderer/types/index.d.ts.map +1 -0
- package/dist/components/SectionRenderer/types/sectionChanges.d.ts +8 -0
- package/dist/components/SectionRenderer/types/sectionChanges.d.ts.map +1 -0
- package/dist/components/SectionRenderer/types/sectionRendererProps.d.ts +30 -0
- package/dist/components/SectionRenderer/types/sectionRendererProps.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/documentWidgetConfig.d.ts +17 -0
- package/dist/components/SectionRenderer/utils/documentWidgetConfig.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/executeSectionSave.d.ts +24 -0
- package/dist/components/SectionRenderer/utils/executeSectionSave.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/index.d.ts +10 -0
- package/dist/components/SectionRenderer/utils/index.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/makePanelsEditable.d.ts +4 -0
- package/dist/components/SectionRenderer/utils/makePanelsEditable.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/panelLayout.d.ts +10 -0
- package/dist/components/SectionRenderer/utils/panelLayout.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/readonlyStyles.d.ts +9 -0
- package/dist/components/SectionRenderer/utils/readonlyStyles.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/revertSectionValues.d.ts +16 -0
- package/dist/components/SectionRenderer/utils/revertSectionValues.d.ts.map +1 -0
- package/dist/components/SectionRenderer/utils/sectionSnapshot.d.ts +25 -0
- package/dist/components/SectionRenderer/utils/sectionSnapshot.d.ts.map +1 -0
- package/dist/components/SectionsContainer.d.ts +1 -23
- package/dist/components/SectionsContainer.d.ts.map +1 -1
- package/dist/components/WidgetFieldLabel.d.ts +2 -5
- package/dist/components/WidgetFieldLabel.d.ts.map +1 -1
- package/dist/components/WidgetProvider.d.ts +4 -5
- package/dist/components/WidgetProvider.d.ts.map +1 -1
- package/dist/components/WidgetRenderer.d.ts +2 -2
- package/dist/components/WidgetRenderer.d.ts.map +1 -1
- package/dist/events/WidgetEventBus.d.ts +0 -22
- package/dist/events/WidgetEventBus.d.ts.map +1 -1
- package/dist/hooks/useBaseWidget.d.ts +0 -1
- package/dist/hooks/useBaseWidget.d.ts.map +1 -1
- package/dist/hooks/useGeoHierarchy.d.ts +47 -0
- package/dist/hooks/useGeoHierarchy.d.ts.map +1 -0
- package/dist/hooks/useWidgetCascade.d.ts.map +1 -1
- package/dist/hooks/useWidgetEventBus.d.ts +0 -3
- package/dist/hooks/useWidgetEventBus.d.ts.map +1 -1
- package/dist/hooks/useWidgetTheme.d.ts +0 -8
- package/dist/hooks/useWidgetTheme.d.ts.map +1 -1
- package/dist/index.d.ts +83 -1102
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +4280 -5834
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4280 -5858
- package/dist/index.js.map +1 -1
- package/dist/registry/WidgetRegistry.d.ts +0 -24
- package/dist/registry/WidgetRegistry.d.ts.map +1 -1
- package/dist/registry/defaultWidgets.d.ts +0 -4
- package/dist/registry/defaultWidgets.d.ts.map +1 -1
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/widgetSlice.d.ts.map +1 -1
- package/dist/theme/index.d.ts +3 -51
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +50 -118
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/dataSource.d.ts +2 -8
- package/dist/utils/dataSource.d.ts.map +1 -1
- package/dist/utils/dateInput.d.ts +0 -33
- package/dist/utils/dateInput.d.ts.map +1 -1
- package/dist/utils/datetimeInput.d.ts +1 -28
- package/dist/utils/datetimeInput.d.ts.map +1 -1
- package/dist/utils/extractTableRecordsFromSnapshot.d.ts.map +1 -1
- package/dist/utils/filePreview.d.ts +0 -6
- package/dist/utils/filePreview.d.ts.map +1 -1
- package/dist/utils/fileSerialization.d.ts +1 -25
- package/dist/utils/fileSerialization.d.ts.map +1 -1
- package/dist/utils/formatting.d.ts +0 -12
- package/dist/utils/formatting.d.ts.map +1 -1
- package/dist/utils/geoHierarchy.d.ts +67 -109
- package/dist/utils/geoHierarchy.d.ts.map +1 -1
- package/dist/utils/numberInput.d.ts +0 -18
- package/dist/utils/numberInput.d.ts.map +1 -1
- package/dist/utils/pathUtils.d.ts +0 -7
- package/dist/utils/pathUtils.d.ts.map +1 -1
- package/dist/utils/schemaTranslation.d.ts +0 -18
- package/dist/utils/schemaTranslation.d.ts.map +1 -1
- package/dist/utils/sectionRevert.d.ts +0 -6
- package/dist/utils/sectionRevert.d.ts.map +1 -1
- package/dist/utils/sectionValidate.d.ts +4 -8
- package/dist/utils/sectionValidate.d.ts.map +1 -1
- package/dist/utils/tSchema.d.ts +5 -0
- package/dist/utils/tSchema.d.ts.map +1 -0
- package/dist/utils/textInput.d.ts +0 -12
- package/dist/utils/textInput.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +2 -8
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validationPatterns.d.ts +0 -10
- package/dist/utils/validationPatterns.d.ts.map +1 -1
- package/dist/widgets/BooleanWidget.d.ts +0 -28
- package/dist/widgets/BooleanWidget.d.ts.map +1 -1
- package/dist/widgets/CheckboxWidget.d.ts +0 -49
- package/dist/widgets/CheckboxWidget.d.ts.map +1 -1
- package/dist/widgets/DateInputWidget.d.ts +0 -40
- package/dist/widgets/DateInputWidget.d.ts.map +1 -1
- package/dist/widgets/DateTimeInputWidget.d.ts +0 -35
- package/dist/widgets/DateTimeInputWidget.d.ts.map +1 -1
- package/dist/widgets/DialogTableWidget.d.ts.map +1 -1
- package/dist/widgets/DisplayWidget.d.ts +0 -4
- package/dist/widgets/DisplayWidget.d.ts.map +1 -1
- package/dist/widgets/DocsWidget.d.ts +15 -0
- package/dist/widgets/DocsWidget.d.ts.map +1 -0
- package/dist/widgets/FileInputWidget.d.ts +0 -17
- package/dist/widgets/FileInputWidget.d.ts.map +1 -1
- package/dist/widgets/GeoHierarchyWidget.d.ts +7 -0
- package/dist/widgets/GeoHierarchyWidget.d.ts.map +1 -0
- package/dist/widgets/HeaderSectionWidget.d.ts.map +1 -1
- package/dist/widgets/IdAuthenticationWidget.d.ts.map +1 -1
- package/dist/widgets/MultiSelectWidget.d.ts.map +1 -1
- package/dist/widgets/NumberInputWidget.d.ts +0 -42
- package/dist/widgets/NumberInputWidget.d.ts.map +1 -1
- package/dist/widgets/PhoneInputWidget.d.ts +0 -15
- package/dist/widgets/PhoneInputWidget.d.ts.map +1 -1
- package/dist/widgets/ProfileWidget.d.ts +0 -43
- package/dist/widgets/ProfileWidget.d.ts.map +1 -1
- package/dist/widgets/RadioWidget.d.ts +0 -37
- package/dist/widgets/RadioWidget.d.ts.map +1 -1
- package/dist/widgets/RegisterLookupWidget.d.ts.map +1 -1
- package/dist/widgets/ScoresDisplayWidget.d.ts +0 -11
- package/dist/widgets/ScoresDisplayWidget.d.ts.map +1 -1
- package/dist/widgets/SelectWidget.d.ts +0 -16
- package/dist/widgets/SelectWidget.d.ts.map +1 -1
- package/dist/widgets/TableWidget.d.ts +0 -39
- package/dist/widgets/TableWidget.d.ts.map +1 -1
- package/dist/widgets/TextAreaWidget.d.ts +0 -33
- package/dist/widgets/TextAreaWidget.d.ts.map +1 -1
- package/dist/widgets/TextInputWidget.d.ts +0 -41
- package/dist/widgets/TextInputWidget.d.ts.map +1 -1
- package/dist/widgets/index.d.ts +2 -4
- package/dist/widgets/index.d.ts.map +1 -1
- package/package.json +11 -14
package/dist/index.d.ts
CHANGED
|
@@ -3,22 +3,10 @@ import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
|
3
3
|
import * as redux_thunk from 'redux-thunk';
|
|
4
4
|
import * as redux from 'redux';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
-
import React$1, { ReactNode } from 'react';
|
|
7
|
-
import * as i18next from 'i18next';
|
|
8
|
-
import i18next__default from 'i18next';
|
|
9
|
-
export { default as i18n } from 'i18next';
|
|
6
|
+
import React$1, { ComponentType, ReactNode } from 'react';
|
|
10
7
|
|
|
11
|
-
/**
|
|
12
|
-
* Widget data path can be a string (single path) or object (multi-path)
|
|
13
|
-
*/
|
|
14
8
|
type WidgetDataPath = string | Record<string, string>;
|
|
15
|
-
/**
|
|
16
|
-
* Data source types
|
|
17
|
-
*/
|
|
18
9
|
type DataSourceType = 'static' | 'api' | 'schema';
|
|
19
|
-
/**
|
|
20
|
-
* Static data source configuration
|
|
21
|
-
*/
|
|
22
10
|
interface StaticDataSource {
|
|
23
11
|
type: 'static';
|
|
24
12
|
options: Array<{
|
|
@@ -26,20 +14,10 @@ interface StaticDataSource {
|
|
|
26
14
|
label: string;
|
|
27
15
|
}>;
|
|
28
16
|
}
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
* Host application handles all API calls, formatting, CORS, auth, etc.
|
|
32
|
-
*/
|
|
33
|
-
type DataSourceRequestHandler = (service: string, // Service mnemonic (e.g., "master-data", "geo-service")
|
|
34
|
-
endpoint: string, // Endpoint/operation name (e.g., "get_g2p_geo_level_values", "get_g2p_programs")
|
|
35
|
-
method: string, // HTTP method ("GET", "POST", etc.)
|
|
36
|
-
params: Record<string, any>, // Request parameters (level_id, parent_level_value_id, etc.)
|
|
37
|
-
options?: {
|
|
17
|
+
/** Called by widgets to request data; the host app handles API calls, formatting, CORS, and auth. */
|
|
18
|
+
type DataSourceRequestHandler = (service: string, endpoint: string, method: string, params: Record<string, any>, options?: {
|
|
38
19
|
headers?: Record<string, string>;
|
|
39
20
|
}) => Promise<any>;
|
|
40
|
-
/**
|
|
41
|
-
* API data source configuration
|
|
42
|
-
*/
|
|
43
21
|
interface ApiDataSource$1 {
|
|
44
22
|
type: 'api';
|
|
45
23
|
service: string;
|
|
@@ -50,44 +28,63 @@ interface ApiDataSource$1 {
|
|
|
50
28
|
labelKey?: string;
|
|
51
29
|
params?: Record<string, any>;
|
|
52
30
|
[key: string]: any;
|
|
31
|
+
/** @deprecated Use `service` + `endpoint` instead. */
|
|
53
32
|
url?: string;
|
|
54
33
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Schema reference data source configuration
|
|
57
|
-
*/
|
|
58
34
|
interface SchemaDataSource {
|
|
59
35
|
type: 'schema';
|
|
60
36
|
path: string;
|
|
61
37
|
valueKey?: string;
|
|
62
38
|
labelKey?: string;
|
|
63
39
|
}
|
|
40
|
+
interface GeoHierarchyDataSource {
|
|
41
|
+
type: 'api';
|
|
42
|
+
service: string;
|
|
43
|
+
method?: 'POST';
|
|
44
|
+
/** e.g. get-all-g2p-geo-levels (matches /api/master-data/...) */
|
|
45
|
+
levelsEndpoint: string;
|
|
46
|
+
/** e.g. geo-level-values (matches /api/master-data/...) */
|
|
47
|
+
valuesEndpoint: string;
|
|
48
|
+
}
|
|
64
49
|
type DataSource = StaticDataSource | ApiDataSource$1 | SchemaDataSource;
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
50
|
+
/** Configuration for a single upload slot inside a `docs` widget. */
|
|
51
|
+
interface DocsWidgetDocumentConfig {
|
|
52
|
+
'document-key': string;
|
|
53
|
+
'document-label': string;
|
|
54
|
+
'document-required'?: boolean;
|
|
55
|
+
'document-accept': string;
|
|
56
|
+
'document-max-size': number;
|
|
57
|
+
}
|
|
58
|
+
interface GeoHierarchyLayout {
|
|
59
|
+
distribution?: 'fixed';
|
|
60
|
+
/** Explicit levels-per-column counts, e.g. [3, 3] for a 6-level hierarchy in 2 columns. */
|
|
61
|
+
columns?: number[];
|
|
62
|
+
/**
|
|
63
|
+
* How many section columns this hierarchy occupies (1–3), matching panel-column-span.
|
|
64
|
+
* Levels are distributed evenly across these columns.
|
|
65
|
+
* When omitted, derived from level count: ≤3 → 1, 4–5 → 2, ≥6 → 3.
|
|
66
|
+
*/
|
|
67
|
+
columnSpan?: number;
|
|
68
|
+
columnIndex?: number;
|
|
69
|
+
}
|
|
70
|
+
/** Optional read path for edit-mode hydration (defaults from widget-data-path). */
|
|
71
|
+
type GeoHierarchyDataPath = string | {
|
|
72
|
+
value: string;
|
|
73
|
+
hierarchy: string;
|
|
74
|
+
};
|
|
75
|
+
declare function isGeoHierarchyDataSource(dataSource: unknown): dataSource is GeoHierarchyDataSource;
|
|
68
76
|
type CharacterType = 'any' | 'alphabetic' | 'alphanumeric' | 'numeric' | 'numeric-decimal' | 'custom';
|
|
69
|
-
/**
|
|
70
|
-
* Case control options
|
|
71
|
-
*/
|
|
72
77
|
type CaseControl = 'none' | 'lowercase' | 'uppercase' | 'capitalize';
|
|
73
|
-
/**
|
|
74
|
-
* Input mask configuration
|
|
75
|
-
*/
|
|
76
78
|
interface InputMask {
|
|
77
79
|
pattern: string;
|
|
78
80
|
type?: 'static' | 'phone' | 'national-id' | 'custom';
|
|
79
81
|
placeholder?: string;
|
|
80
82
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Validation type options for common patterns
|
|
83
|
-
*/
|
|
84
83
|
type ValidationType = 'email' | 'phone' | 'url';
|
|
85
|
-
/**
|
|
86
|
-
* Validation configuration
|
|
87
|
-
*/
|
|
88
84
|
interface WidgetValidation {
|
|
89
85
|
required?: boolean;
|
|
90
86
|
validationType?: ValidationType;
|
|
87
|
+
/** Pattern takes precedence over `validationType` when both are set. */
|
|
91
88
|
pattern?: string;
|
|
92
89
|
patternMessage?: string;
|
|
93
90
|
minLength?: number;
|
|
@@ -97,29 +94,11 @@ interface WidgetValidation {
|
|
|
97
94
|
custom?: string;
|
|
98
95
|
zodSchema?: z.ZodSchema;
|
|
99
96
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Numeric type options
|
|
102
|
-
*/
|
|
103
97
|
type NumericType = 'integer' | 'decimal';
|
|
104
|
-
/**
|
|
105
|
-
* Rounding mode for decimal numbers
|
|
106
|
-
*/
|
|
107
98
|
type RoundingMode = 'round' | 'truncate';
|
|
108
|
-
/**
|
|
109
|
-
* Text alignment options
|
|
110
|
-
*/
|
|
111
99
|
type TextAlign = 'left' | 'right';
|
|
112
|
-
/**
|
|
113
|
-
* Boolean representation options
|
|
114
|
-
*/
|
|
115
100
|
type BooleanRepresentation = 'true-false' | 'yes-no' | 'on-off' | 'custom';
|
|
116
|
-
/**
|
|
117
|
-
* Boolean control type options
|
|
118
|
-
*/
|
|
119
101
|
type BooleanControlType = 'checkbox' | 'radio' | 'toggle';
|
|
120
|
-
/**
|
|
121
|
-
* Format configuration
|
|
122
|
-
*/
|
|
123
102
|
interface WidgetFormat {
|
|
124
103
|
dateFormat?: string;
|
|
125
104
|
currency?: string;
|
|
@@ -145,7 +124,6 @@ interface WidgetFormat {
|
|
|
145
124
|
booleanControlType?: BooleanControlType;
|
|
146
125
|
booleanTrueLabel?: string;
|
|
147
126
|
booleanFalseLabel?: string;
|
|
148
|
-
/** Label for null/unset when allowUnset (radio, toggle); defaults to "Not set" */
|
|
149
127
|
booleanUnsetLabel?: string;
|
|
150
128
|
allowUnset?: boolean;
|
|
151
129
|
layout?: 'vertical' | 'horizontal' | 'grid';
|
|
@@ -155,33 +133,21 @@ interface WidgetFormat {
|
|
|
155
133
|
dateTimeFormat?: string;
|
|
156
134
|
dateTimeConstraint?: 'any' | 'past-only' | 'future-only';
|
|
157
135
|
}
|
|
158
|
-
/**
|
|
159
|
-
* Condition operators
|
|
160
|
-
*/
|
|
161
136
|
type ConditionOperator = 'equals' | 'notEquals' | 'notEmpty' | 'empty' | 'greaterThan' | 'lessThan' | 'contains' | 'notContains';
|
|
162
|
-
/**
|
|
163
|
-
* Condition configuration
|
|
164
|
-
*/
|
|
165
137
|
interface WidgetCondition {
|
|
166
138
|
field: string;
|
|
167
139
|
operator: ConditionOperator;
|
|
168
140
|
value?: any;
|
|
169
141
|
}
|
|
170
|
-
/**
|
|
171
|
-
* Single conditional action rule (used in widget-data-options.actions list)
|
|
172
|
-
*/
|
|
173
142
|
interface WidgetOptionRule {
|
|
174
143
|
action: 'show' | 'hide' | 'enable' | 'disable' | 'require';
|
|
175
144
|
condition?: WidgetCondition;
|
|
176
145
|
}
|
|
177
|
-
/**
|
|
178
|
-
* Widget options for conditional behavior
|
|
179
|
-
*/
|
|
180
146
|
interface WidgetOptions {
|
|
181
|
-
|
|
147
|
+
/**`actions` for multiple sequential rules. */
|
|
182
148
|
action?: 'show' | 'hide' | 'enable' | 'disable' | 'require';
|
|
183
149
|
condition?: WidgetCondition;
|
|
184
|
-
/**
|
|
150
|
+
/** Apply enable/disable/show/hide first, then require. */
|
|
185
151
|
actions?: WidgetOptionRule[];
|
|
186
152
|
minDate?: string;
|
|
187
153
|
maxDate?: string;
|
|
@@ -192,9 +158,6 @@ interface WidgetOptions {
|
|
|
192
158
|
showCalendar?: boolean;
|
|
193
159
|
[key: string]: any;
|
|
194
160
|
}
|
|
195
|
-
/**
|
|
196
|
-
* Widget cascade configuration
|
|
197
|
-
*/
|
|
198
161
|
interface WidgetCascadeConfig {
|
|
199
162
|
listenTo: string[];
|
|
200
163
|
onEvent?: 'widget:change' | 'widget:blur' | 'widget:focus' | 'widget:reload' | 'widget:clear';
|
|
@@ -203,18 +166,6 @@ interface WidgetCascadeConfig {
|
|
|
203
166
|
debounce?: number;
|
|
204
167
|
throttle?: number;
|
|
205
168
|
}
|
|
206
|
-
/**
|
|
207
|
-
* Widget geo configuration
|
|
208
|
-
*/
|
|
209
|
-
interface WidgetGeoConfig {
|
|
210
|
-
level: string;
|
|
211
|
-
isLastLevel: boolean;
|
|
212
|
-
parentWidgetId: string | null;
|
|
213
|
-
levelMnemonic?: string;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Base widget configuration
|
|
217
|
-
*/
|
|
218
169
|
interface BaseWidgetConfig {
|
|
219
170
|
widget: string;
|
|
220
171
|
'widget-type'?: 'input' | 'layout' | 'table' | 'group';
|
|
@@ -233,7 +184,13 @@ interface BaseWidgetConfig {
|
|
|
233
184
|
'widget-data-helptext'?: string;
|
|
234
185
|
'widget-data-tooltip'?: string;
|
|
235
186
|
'widget-cascade'?: WidgetCascadeConfig;
|
|
236
|
-
|
|
187
|
+
/** Column layout for geo-hierarchy widget (e.g. 3 levels per column). */
|
|
188
|
+
'widget-geo-layout'?: GeoHierarchyLayout;
|
|
189
|
+
/**
|
|
190
|
+
* Read path for geo_code_hierarchy_json (hydrate/display).
|
|
191
|
+
* To also persist draft hierarchy on edit/save, use object widget-data-path with a hierarchy key.
|
|
192
|
+
*/
|
|
193
|
+
'widget-geo-hierarchy-path'?: string;
|
|
237
194
|
widgets?: BaseWidgetConfig[];
|
|
238
195
|
'widget-item'?: BaseWidgetConfig;
|
|
239
196
|
'widget-data-columns'?: Array<{
|
|
@@ -259,12 +216,11 @@ interface BaseWidgetConfig {
|
|
|
259
216
|
'widget-data-add-label'?: string;
|
|
260
217
|
'widget-data-collapsed'?: boolean;
|
|
261
218
|
'widget-column-span'?: number;
|
|
219
|
+
'widget-total-docs'?: number;
|
|
220
|
+
documents?: DocsWidgetDocumentConfig[];
|
|
262
221
|
_comment?: string;
|
|
263
222
|
[key: string]: any;
|
|
264
223
|
}
|
|
265
|
-
/**
|
|
266
|
-
* Panel configuration - a layout container that can contain nested panels or widgets
|
|
267
|
-
*/
|
|
268
224
|
interface PanelConfig {
|
|
269
225
|
'panel-id': string;
|
|
270
226
|
'panel-orientation'?: 'horizontal' | 'vertical';
|
|
@@ -272,9 +228,6 @@ interface PanelConfig {
|
|
|
272
228
|
panels?: PanelConfig[];
|
|
273
229
|
widgets?: BaseWidgetConfig[];
|
|
274
230
|
}
|
|
275
|
-
/**
|
|
276
|
-
* Supporting document configuration
|
|
277
|
-
*/
|
|
278
231
|
interface SupportingDocumentConfig {
|
|
279
232
|
'document-data-path': string;
|
|
280
233
|
'document-type'?: string;
|
|
@@ -283,9 +236,6 @@ interface SupportingDocumentConfig {
|
|
|
283
236
|
'document-accept'?: string;
|
|
284
237
|
'document-max-size'?: number;
|
|
285
238
|
}
|
|
286
|
-
/**
|
|
287
|
-
* Section configuration
|
|
288
|
-
*/
|
|
289
239
|
interface SectionConfig {
|
|
290
240
|
'section-id': string;
|
|
291
241
|
'section-title'?: string;
|
|
@@ -296,19 +246,10 @@ interface SectionConfig {
|
|
|
296
246
|
'section-supporting-documents'?: SupportingDocumentConfig[];
|
|
297
247
|
panels: PanelConfig[];
|
|
298
248
|
}
|
|
299
|
-
/**
|
|
300
|
-
* UI Schema structure
|
|
301
|
-
*/
|
|
302
249
|
interface UISchema {
|
|
303
250
|
sections: SectionConfig[];
|
|
304
251
|
}
|
|
305
|
-
/**
|
|
306
|
-
* Widget value type
|
|
307
|
-
*/
|
|
308
252
|
type WidgetValue = any;
|
|
309
|
-
/**
|
|
310
|
-
* Widget state in Redux store
|
|
311
|
-
*/
|
|
312
253
|
interface WidgetState {
|
|
313
254
|
values: Record<string, WidgetValue>;
|
|
314
255
|
errors: Record<string, string[]>;
|
|
@@ -316,9 +257,6 @@ interface WidgetState {
|
|
|
316
257
|
loading: Record<string, boolean>;
|
|
317
258
|
dataSources: Record<string, any[]>;
|
|
318
259
|
}
|
|
319
|
-
/**
|
|
320
|
-
* Widget context value
|
|
321
|
-
*/
|
|
322
260
|
interface WidgetContextValue {
|
|
323
261
|
widgetId: string;
|
|
324
262
|
value: WidgetValue;
|
|
@@ -331,21 +269,12 @@ interface WidgetContextValue {
|
|
|
331
269
|
getFieldValue: (path: string) => any;
|
|
332
270
|
getDataSource: (widgetId: string) => any[];
|
|
333
271
|
}
|
|
334
|
-
/**
|
|
335
|
-
* Custom widget render function
|
|
336
|
-
*/
|
|
337
272
|
type WidgetRenderFunction = (config: BaseWidgetConfig, context: WidgetContextValue) => React.ReactNode;
|
|
338
|
-
/**
|
|
339
|
-
* Widget registry entry
|
|
340
|
-
*/
|
|
341
273
|
interface WidgetRegistryEntry {
|
|
342
274
|
widget: string;
|
|
343
275
|
component: React.ComponentType<any> | WidgetRenderFunction;
|
|
344
276
|
defaultProps?: Record<string, any>;
|
|
345
277
|
}
|
|
346
|
-
/**
|
|
347
|
-
* API adapter function type
|
|
348
|
-
*/
|
|
349
278
|
type ApiAdapter = (url: string, options: {
|
|
350
279
|
method?: string;
|
|
351
280
|
headers?: Record<string, string>;
|
|
@@ -397,7 +326,6 @@ interface UseBaseWidgetOptions {
|
|
|
397
326
|
declare const useBaseWidget: (options: UseBaseWidgetOptions) => {
|
|
398
327
|
widgetId: string;
|
|
399
328
|
value: any;
|
|
400
|
-
geoDisplayLabel: string | undefined;
|
|
401
329
|
formattedValue: any;
|
|
402
330
|
error: string[];
|
|
403
331
|
touched: boolean;
|
|
@@ -419,11 +347,6 @@ declare const useBaseWidget: (options: UseBaseWidgetOptions) => {
|
|
|
419
347
|
config: BaseWidgetConfig;
|
|
420
348
|
};
|
|
421
349
|
|
|
422
|
-
/**
|
|
423
|
-
* Widget Event Bus
|
|
424
|
-
* Provides a publish/subscribe mechanism for widget communication
|
|
425
|
-
* Supports debounce and throttle for performance optimization
|
|
426
|
-
*/
|
|
427
350
|
type WidgetEventType = 'widget:change' | 'widget:blur' | 'widget:focus' | 'widget:reload' | 'widget:clear';
|
|
428
351
|
interface WidgetEvent {
|
|
429
352
|
type: WidgetEventType;
|
|
@@ -435,35 +358,15 @@ type EventHandler = (event: WidgetEvent) => void | Promise<void>;
|
|
|
435
358
|
declare class WidgetEventBus {
|
|
436
359
|
private subscriptions;
|
|
437
360
|
private throttleTimers;
|
|
438
|
-
/**
|
|
439
|
-
* Subscribe to an event type
|
|
440
|
-
* @param eventType The type of event to listen to
|
|
441
|
-
* @param handler The handler function
|
|
442
|
-
* @param options Debounce/throttle options
|
|
443
|
-
* @returns Unsubscribe function
|
|
444
|
-
*/
|
|
445
361
|
subscribe(eventType: WidgetEventType, handler: EventHandler, options?: {
|
|
446
362
|
debounce?: number;
|
|
447
363
|
throttle?: number;
|
|
448
364
|
}): () => void;
|
|
449
|
-
/**
|
|
450
|
-
* Publish an event
|
|
451
|
-
* @param event The event to publish
|
|
452
|
-
*/
|
|
453
365
|
publish(event: WidgetEvent): void;
|
|
454
|
-
/**
|
|
455
|
-
* Execute handler with debounce/throttle support
|
|
456
|
-
*/
|
|
457
366
|
private executeHandler;
|
|
458
|
-
/**
|
|
459
|
-
* Clear all subscriptions
|
|
460
|
-
*/
|
|
461
367
|
clear(): void;
|
|
462
368
|
}
|
|
463
369
|
|
|
464
|
-
/**
|
|
465
|
-
* Hook to access the widget event bus from context
|
|
466
|
-
*/
|
|
467
370
|
declare const useWidgetEventBus: () => WidgetEventBus | null;
|
|
468
371
|
|
|
469
372
|
interface UseWidgetCascadeOptions {
|
|
@@ -477,65 +380,29 @@ interface UseWidgetCascadeOptions {
|
|
|
477
380
|
*/
|
|
478
381
|
declare const useWidgetCascade: (options: UseWidgetCascadeOptions) => void;
|
|
479
382
|
|
|
480
|
-
interface UseGeoWidgetCascadeOptions {
|
|
481
|
-
config: BaseWidgetConfig;
|
|
482
|
-
dataSourceRequestHandler?: DataSourceRequestHandler;
|
|
483
|
-
values: Record<string, any>;
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* Hook for geo widget cascade functionality
|
|
487
|
-
* Handles geo hierarchy building and cascade behavior
|
|
488
|
-
*/
|
|
489
|
-
declare const useGeoWidgetCascade: (options: UseGeoWidgetCascadeOptions) => void;
|
|
490
|
-
|
|
491
383
|
interface WidgetRendererProps extends Omit<UseBaseWidgetOptions, 'config'> {
|
|
492
384
|
config: BaseWidgetConfig;
|
|
493
|
-
defaultComponent?:
|
|
385
|
+
defaultComponent?: ComponentType<any>;
|
|
494
386
|
}
|
|
495
387
|
declare const WidgetRenderer: ({ config, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData: propSchemaData, onValueChange, defaultComponent, }: WidgetRendererProps) => react_jsx_runtime.JSX.Element | null;
|
|
496
388
|
|
|
497
|
-
/**
|
|
498
|
-
* Theme color tokens for the widget library.
|
|
499
|
-
* All properties are optional — omitted values fall back to built-in defaults.
|
|
500
|
-
*
|
|
501
|
-
* Default palette derived from OpenG2P brand colours:
|
|
502
|
-
* Gold #F5BB1A · Orange #F07B1A · Purple #88498F
|
|
503
|
-
* Grey #C4C4C4 · Dark Navy #011627 · Light Grey #F6F6F6
|
|
504
|
-
*/
|
|
505
389
|
interface WidgetThemeColors {
|
|
506
|
-
/** Main brand colour (default: #F5BB1A — Gold) */
|
|
507
390
|
primary?: string;
|
|
508
|
-
/** Darker brand accent (default: #F07B1A — Orange) */
|
|
509
391
|
primaryDark?: string;
|
|
510
|
-
/** Light brand tint for backgrounds (default: #FBE6AA — Gold +62.5%) */
|
|
511
392
|
primaryLight?: string;
|
|
512
|
-
/** Secondary accent used in edit-mode borders (default: #EE7C22 — Orange 0% shade) */
|
|
513
393
|
primaryAccent?: string;
|
|
514
|
-
/** Standard border colour (default: #C4C4C4 — Grey) */
|
|
515
394
|
border?: string;
|
|
516
|
-
/** Lighter border colour (default: #E4E4E4 — Grey +62.5%) */
|
|
517
395
|
borderLight?: string;
|
|
518
|
-
/** Default background (default: #FFFFFF) */
|
|
519
396
|
background?: string;
|
|
520
|
-
/** Alternate/muted background (default: #F6F6F6 — Light Grey) */
|
|
521
397
|
backgroundAlt?: string;
|
|
522
|
-
/** Primary text colour (default: #011627 — Dark Navy) */
|
|
523
398
|
text?: string;
|
|
524
|
-
/** Secondary / muted text colour (default: #727474 — Grey -37.5%) */
|
|
525
399
|
textMuted?: string;
|
|
526
|
-
/** Success green (default: #16A34A) */
|
|
527
400
|
success?: string;
|
|
528
|
-
/** Success dark green (default: #047857) */
|
|
529
401
|
successDark?: string;
|
|
530
|
-
/** Light success surface for badges / highlights (default: #D1FAE5) */
|
|
531
402
|
successLight?: string;
|
|
532
|
-
/** Error / danger red (default: #B91C1C) */
|
|
533
403
|
error?: string;
|
|
534
|
-
/** Light error surface for badges / highlights (default: #FEE2E2) */
|
|
535
404
|
errorLight?: string;
|
|
536
|
-
/** Warning amber (default: #F59E0B) */
|
|
537
405
|
warning?: string;
|
|
538
|
-
/** Info / link blue (default: #2563EB) */
|
|
539
406
|
info?: string;
|
|
540
407
|
}
|
|
541
408
|
interface WidgetThemeSection {
|
|
@@ -543,11 +410,9 @@ interface WidgetThemeSection {
|
|
|
543
410
|
borderColor?: string;
|
|
544
411
|
backgroundColor?: string;
|
|
545
412
|
titleColor?: string;
|
|
546
|
-
/** Horizontal-rule / divider colour between panels (default: primary) */
|
|
547
413
|
dividerColor?: string;
|
|
548
414
|
}
|
|
549
415
|
interface WidgetThemePanel {
|
|
550
|
-
/** Vertical divider colour between side-by-side panels */
|
|
551
416
|
dividerColor?: string;
|
|
552
417
|
backgroundColor?: string;
|
|
553
418
|
}
|
|
@@ -567,29 +432,17 @@ interface WidgetThemeWidget {
|
|
|
567
432
|
inputBackground?: string;
|
|
568
433
|
errorColor?: string;
|
|
569
434
|
helpTextColor?: string;
|
|
570
|
-
/** Table: header row background (default: #F6F6F6) */
|
|
571
435
|
tableHeaderBg?: string;
|
|
572
|
-
/** Table: header text colour (default: #727474) */
|
|
573
436
|
tableHeaderColor?: string;
|
|
574
|
-
/** Table: body / cell background (default: #FFFFFF) */
|
|
575
437
|
tableBodyBg?: string;
|
|
576
|
-
/** Table: outer border colour (default: #C4C4C4) */
|
|
577
438
|
tableBorderColor?: string;
|
|
578
|
-
/** Table: row divider lines (default: #E4E4E4) */
|
|
579
439
|
tableRowDividerColor?: string;
|
|
580
|
-
/** Table: background of a row being edited (default: #FBE6AA) */
|
|
581
440
|
tableEditingRowBg?: string;
|
|
582
|
-
/** Table: background of a row marked for deletion (default: #FEE2E2) */
|
|
583
441
|
tableDeletedRowBg?: string;
|
|
584
|
-
/** Table: empty-state text colour (default: #727474) */
|
|
585
442
|
tableEmptyTextColor?: string;
|
|
586
|
-
/** Table: container border radius (default: 15px) */
|
|
587
443
|
tableBorderRadius?: string;
|
|
588
444
|
}
|
|
589
|
-
/**
|
|
590
|
-
* Top-level theme object accepted by `<WidgetProvider theme={…}>`.
|
|
591
|
-
* Every field is optional — only supply what you want to override.
|
|
592
|
-
*/
|
|
445
|
+
/** Top-level theme object accepted by `<WidgetProvider theme={…}>`. */
|
|
593
446
|
interface WidgetTheme {
|
|
594
447
|
colors?: WidgetThemeColors;
|
|
595
448
|
section?: WidgetThemeSection;
|
|
@@ -597,9 +450,6 @@ interface WidgetTheme {
|
|
|
597
450
|
button?: WidgetThemeButton;
|
|
598
451
|
widget?: WidgetThemeWidget;
|
|
599
452
|
}
|
|
600
|
-
/**
|
|
601
|
-
* Built-in default values (matches the original hardcoded colours).
|
|
602
|
-
*/
|
|
603
453
|
declare const defaultTheme: Required<{
|
|
604
454
|
colors: Required<WidgetThemeColors>;
|
|
605
455
|
section: Required<WidgetThemeSection>;
|
|
@@ -607,26 +457,22 @@ declare const defaultTheme: Required<{
|
|
|
607
457
|
button: Required<WidgetThemeButton>;
|
|
608
458
|
widget: Required<WidgetThemeWidget>;
|
|
609
459
|
}>;
|
|
610
|
-
/**
|
|
611
|
-
* Merge a user-supplied (partial) theme with the built-in defaults.
|
|
612
|
-
*/
|
|
613
460
|
declare function resolveTheme(theme?: WidgetTheme): typeof defaultTheme;
|
|
614
461
|
|
|
615
462
|
interface WidgetProviderProps {
|
|
616
463
|
store?: WidgetStore;
|
|
617
464
|
dataSourceRequestHandler?: DataSourceRequestHandler;
|
|
618
465
|
schemaData?: Record<string, any>;
|
|
619
|
-
|
|
620
|
-
/** Optional theme object to override default colors and styles across all widgets. */
|
|
466
|
+
t?: (key: string, options?: any) => string;
|
|
621
467
|
theme?: WidgetTheme;
|
|
622
468
|
children: ReactNode;
|
|
623
469
|
}
|
|
624
470
|
declare const useWidgetContext: () => {
|
|
625
471
|
dataSourceRequestHandler?: DataSourceRequestHandler;
|
|
626
472
|
schemaData?: Record<string, any>;
|
|
627
|
-
|
|
473
|
+
t?: (key: string, options?: any) => string;
|
|
628
474
|
};
|
|
629
|
-
declare const WidgetProvider: ({ store, dataSourceRequestHandler, schemaData,
|
|
475
|
+
declare const WidgetProvider: ({ store, dataSourceRequestHandler, schemaData, t, theme, children, }: WidgetProviderProps) => react_jsx_runtime.JSX.Element;
|
|
630
476
|
|
|
631
477
|
interface PanelRendererProps {
|
|
632
478
|
panel: PanelConfig;
|
|
@@ -635,28 +481,21 @@ interface PanelRendererProps {
|
|
|
635
481
|
onValueChange?: UseBaseWidgetOptions['onValueChange'];
|
|
636
482
|
isEditMode?: boolean;
|
|
637
483
|
}
|
|
638
|
-
/**
|
|
639
|
-
* Renders a panel with its nested panels or widgets
|
|
640
|
-
*
|
|
641
|
-
* Panels can contain:
|
|
642
|
-
* - Nested panels (for layout composition)
|
|
643
|
-
* - Widgets (for actual form inputs/controls)
|
|
644
|
-
*/
|
|
645
484
|
declare const PanelRenderer: ({ panel, dataSourceRequestHandler, schemaData, onValueChange, isEditMode, }: PanelRendererProps) => react_jsx_runtime.JSX.Element;
|
|
646
485
|
|
|
486
|
+
interface SectionChanges {
|
|
487
|
+
section_id?: string;
|
|
488
|
+
section_register_id?: string;
|
|
489
|
+
records: unknown[];
|
|
490
|
+
files?: unknown[];
|
|
491
|
+
image?: File | null;
|
|
492
|
+
}
|
|
493
|
+
|
|
647
494
|
type SectionMode = 'RegistryView' | 'CRView' | 'IntakeForm';
|
|
648
|
-
/** Form controls passed to host via onFormReady. Allows host to validate and get all section data (e.g. on Submit). */
|
|
649
495
|
interface SectionsFormHandle {
|
|
650
|
-
/** Validate all sections. Returns true if valid, false otherwise. */
|
|
651
496
|
validate(): Promise<boolean>;
|
|
652
|
-
/** Get raw form data from store for all sections (no validation). */
|
|
653
497
|
getFormData(): Record<string, unknown>;
|
|
654
|
-
/** Validate all sections. If valid, returns SectionChanges[]; if invalid, throws. */
|
|
655
498
|
validateAndGetData(): Promise<SectionChanges[]>;
|
|
656
|
-
/**
|
|
657
|
-
* Used for form save-draft functionality.
|
|
658
|
-
* Retrieves record and file changes without validation.
|
|
659
|
-
*/
|
|
660
499
|
getStructuredData(): SectionChanges[];
|
|
661
500
|
}
|
|
662
501
|
interface SectionsContainerProps {
|
|
@@ -668,33 +507,12 @@ interface SectionsContainerProps {
|
|
|
668
507
|
onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
|
|
669
508
|
hideEditButton?: boolean;
|
|
670
509
|
mode?: SectionMode;
|
|
671
|
-
/** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
|
|
672
510
|
isDraft?: boolean;
|
|
673
|
-
namespace?: string | ((sectionId: string, index: number) => string);
|
|
674
|
-
/** Called when a section's dirty (has unsaved changes) status changes. Only fires while the section is in edit mode. */
|
|
675
511
|
onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
|
|
676
|
-
/** Called when the form is ready. Passes form controls (validate, getFormData, validateAndGetData) so the host can trigger submit from its own button. */
|
|
677
512
|
onFormReady?: (handle: SectionsFormHandle) => void;
|
|
678
513
|
}
|
|
679
|
-
|
|
680
|
-
* Container component that renders multiple sections
|
|
681
|
-
*
|
|
682
|
-
* Layout behavior:
|
|
683
|
-
* - Uses CSS Grid for proper alignment
|
|
684
|
-
* - Each grid column = 200px (one vertical panel width)
|
|
685
|
-
* - Sections span columns based on their total vertical panel count
|
|
686
|
-
* - All sections align to the same grid, ensuring right-side alignment
|
|
687
|
-
* - Handles nested structure: multiple horizontal panels, each with multiple vertical panels
|
|
688
|
-
*/
|
|
689
|
-
declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, isDraft, namespace, onSectionDirtyChange, onFormReady, }: SectionsContainerProps) => react_jsx_runtime.JSX.Element;
|
|
514
|
+
declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, isDraft, onSectionDirtyChange, onFormReady, }: SectionsContainerProps) => react_jsx_runtime.JSX.Element;
|
|
690
515
|
|
|
691
|
-
interface SectionChanges {
|
|
692
|
-
section_id?: string;
|
|
693
|
-
section_register_id?: string;
|
|
694
|
-
records: unknown[];
|
|
695
|
-
files?: unknown[];
|
|
696
|
-
image?: File | null;
|
|
697
|
-
}
|
|
698
516
|
interface SectionRendererProps {
|
|
699
517
|
section: SectionConfig;
|
|
700
518
|
dataSourceRequestHandler?: UseBaseWidgetOptions['dataSourceRequestHandler'];
|
|
@@ -704,47 +522,24 @@ interface SectionRendererProps {
|
|
|
704
522
|
onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
|
|
705
523
|
hideEditButton?: boolean;
|
|
706
524
|
mode?: SectionMode;
|
|
707
|
-
namespace?: string;
|
|
708
525
|
changeRequestType?: 'new' | 'old';
|
|
709
526
|
showChangeRequestLabel?: boolean;
|
|
710
527
|
dbSectionId?: string;
|
|
711
528
|
sectionRegisterId?: string;
|
|
712
|
-
/** Called when the section's dirty (has unsaved changes) status changes. Only fires while in edit mode. */
|
|
713
529
|
onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
|
|
714
|
-
/** IntakeForm mode: 0-based index of this section within the form */
|
|
715
530
|
sectionIndex?: number;
|
|
716
|
-
/** IntakeForm mode: total number of sections in the form */
|
|
717
531
|
sectionCount?: number;
|
|
718
|
-
/** IntakeForm mode: index of the currently expanded section (null = all collapsed) */
|
|
719
532
|
expandedSectionIndex?: number | null;
|
|
720
|
-
/** IntakeForm mode: called when user requests to expand a section (e.g. clicks accordion header) */
|
|
721
533
|
onExpandSection?: (index: number) => void;
|
|
722
|
-
/** IntakeForm mode: called when section save completes successfully (collapse current, expand next) */
|
|
723
534
|
onSectionSaveSuccess?: (index: number) => void;
|
|
724
|
-
/** IntakeForm mode: called when user clicks Previous (collapse current, expand previous) */
|
|
725
535
|
onPreviousSection?: (index: number) => void;
|
|
726
|
-
/** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
|
|
727
536
|
isDraft?: boolean;
|
|
728
|
-
/**
|
|
729
|
-
* IntakeForm mode: when true the accordion header is clickable so the user can open/close this
|
|
730
|
-
* section freely. False (default) locks the header — navigation is only via Next/Previous.
|
|
731
|
-
* SectionsContainer sets this to true for every visited section plus the one immediately after.
|
|
732
|
-
*/
|
|
733
537
|
isAccessible?: boolean;
|
|
734
|
-
/** RegistryView: called when this section enters or exits edit mode. Used by SectionsContainer to enforce single-edit. */
|
|
735
538
|
onEditModeChange?: (sectionId: string, editing: boolean) => void;
|
|
736
|
-
/** RegistryView: when true, forces this section out of edit mode (another section took over). */
|
|
737
539
|
forceExitEdit?: boolean;
|
|
738
540
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
*
|
|
742
|
-
* Layout behavior:
|
|
743
|
-
* - Section width is based on max 3 panels (or more on high resolution)
|
|
744
|
-
* - Panels wrap when they exceed available width
|
|
745
|
-
* - Sections can sit side-by-side if there's space
|
|
746
|
-
*/
|
|
747
|
-
declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, dbSectionId, sectionRegisterId, onSectionDirtyChange, sectionIndex, sectionCount, expandedSectionIndex, onExpandSection, onSectionSaveSuccess, onPreviousSection, isDraft, isAccessible, onEditModeChange, forceExitEdit, }: SectionRendererProps) => react_jsx_runtime.JSX.Element;
|
|
541
|
+
|
|
542
|
+
declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, changeRequestType, showChangeRequestLabel, dbSectionId, sectionRegisterId, onSectionDirtyChange, sectionIndex, expandedSectionIndex, onExpandSection, onSectionSaveSuccess, onPreviousSection, isDraft, isAccessible, onEditModeChange, forceExitEdit, }: SectionRendererProps) => react_jsx_runtime.JSX.Element;
|
|
748
543
|
|
|
749
544
|
interface SectionBuilderProps {
|
|
750
545
|
initialSection?: SectionConfig;
|
|
@@ -820,574 +615,76 @@ interface PropertyEditorProps {
|
|
|
820
615
|
*/
|
|
821
616
|
declare const PropertyEditor: React$1.FC<PropertyEditorProps>;
|
|
822
617
|
|
|
823
|
-
/**
|
|
824
|
-
* Register all default/generic widgets
|
|
825
|
-
* This is called automatically when the package is imported
|
|
826
|
-
*/
|
|
827
618
|
declare const registerDefaultWidgets: () => void;
|
|
828
619
|
|
|
829
620
|
declare class WidgetRegistry {
|
|
830
621
|
private widgets;
|
|
831
|
-
/**
|
|
832
|
-
* Register a widget
|
|
833
|
-
*/
|
|
834
622
|
register(entry: WidgetRegistryEntry): void;
|
|
835
|
-
/**
|
|
836
|
-
* Register multiple widgets
|
|
837
|
-
*/
|
|
838
623
|
registerMany(entries: WidgetRegistryEntry[]): void;
|
|
839
|
-
/**
|
|
840
|
-
* Get widget entry
|
|
841
|
-
*/
|
|
842
624
|
get(widgetName: string): WidgetRegistryEntry | undefined;
|
|
843
|
-
/**
|
|
844
|
-
* Check if widget is registered
|
|
845
|
-
*/
|
|
846
625
|
has(widgetName: string): boolean;
|
|
847
|
-
/**
|
|
848
|
-
* Get all registered widgets
|
|
849
|
-
*/
|
|
850
626
|
getAll(): WidgetRegistryEntry[];
|
|
851
|
-
/**
|
|
852
|
-
* Unregister a widget
|
|
853
|
-
*/
|
|
854
627
|
unregister(widgetName: string): boolean;
|
|
855
|
-
/**
|
|
856
|
-
* Clear all widgets
|
|
857
|
-
*/
|
|
858
628
|
clear(): void;
|
|
859
|
-
/**
|
|
860
|
-
* Render widget component
|
|
861
|
-
*/
|
|
862
629
|
render(config: BaseWidgetConfig, context: any, defaultComponent?: React$1.ComponentType<any>): React$1.ReactNode;
|
|
863
630
|
}
|
|
864
631
|
declare const widgetRegistry: WidgetRegistry;
|
|
865
632
|
|
|
866
|
-
/**
|
|
867
|
-
* Generic text input widget with advanced features
|
|
868
|
-
* Supports all text-based inputs via configuration (text, email, password, number, tel, url, etc.)
|
|
869
|
-
*
|
|
870
|
-
* Features:
|
|
871
|
-
* - Allowed character types (any, alphabetic, alphanumeric, numeric, numeric-decimal, custom)
|
|
872
|
-
* - Case control (none, lowercase, uppercase, capitalize)
|
|
873
|
-
* - Length constraints with live character counter
|
|
874
|
-
* - Regular expression validation with custom messages
|
|
875
|
-
* - Input masking (static and dynamic)
|
|
876
|
-
* - Placeholder text with i18n support
|
|
877
|
-
*
|
|
878
|
-
* Usage in schema:
|
|
879
|
-
* {
|
|
880
|
-
* "widget": "text",
|
|
881
|
-
* "widget-type": "input",
|
|
882
|
-
* "widget-label": "Field Label",
|
|
883
|
-
* "widget-id": "fieldId",
|
|
884
|
-
* "widget-data-path": "person.name",
|
|
885
|
-
* "widget-data-format": {
|
|
886
|
-
* "inputType": "email",
|
|
887
|
-
* "characterType": "alphanumeric",
|
|
888
|
-
* "caseControl": "lowercase",
|
|
889
|
-
* "mask": {
|
|
890
|
-
* "pattern": "XXX-XXX-XXXX",
|
|
891
|
-
* "type": "static"
|
|
892
|
-
* },
|
|
893
|
-
* "showCharCounter": true
|
|
894
|
-
* },
|
|
895
|
-
* "widget-data-validation": {
|
|
896
|
-
* "validationType": "email", // Predefined type: "email", "phone", or "url"
|
|
897
|
-
* // OR use custom pattern:
|
|
898
|
-
* // "pattern": "^[a-z0-9]+$",
|
|
899
|
-
* // "patternMessage": "Only lowercase alphanumeric characters allowed",
|
|
900
|
-
* "minLength": 5,
|
|
901
|
-
* "maxLength": 20
|
|
902
|
-
* },
|
|
903
|
-
* "widget-required": true,
|
|
904
|
-
* "widget-data-placeholder": "Enter your value"
|
|
905
|
-
* }
|
|
906
|
-
*/
|
|
907
633
|
interface TextInputWidgetProps {
|
|
908
634
|
config: BaseWidgetConfig;
|
|
909
635
|
}
|
|
910
636
|
declare const TextInputWidget: ({ config }: TextInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
911
637
|
|
|
912
|
-
/**
|
|
913
|
-
* Number input widget with advanced numeric features
|
|
914
|
-
*
|
|
915
|
-
* Features:
|
|
916
|
-
* - Numeric type (integer/decimal, signed/unsigned)
|
|
917
|
-
* - Decimal precision control (0-6 places, rounding/truncation)
|
|
918
|
-
* - Value range validation (min/max)
|
|
919
|
-
* - Regular expression validation with custom messages
|
|
920
|
-
* - Maximum character limit
|
|
921
|
-
* - Default value (numeric, applied when field has no existing data)
|
|
922
|
-
* - Numeric masking and formatting (thousand/decimal separators)
|
|
923
|
-
* - Text alignment (right by default, configurable)
|
|
924
|
-
* - Key input restrictions
|
|
925
|
-
*
|
|
926
|
-
* Usage in schema:
|
|
927
|
-
* {
|
|
928
|
-
* "widget": "number",
|
|
929
|
-
* "widget-type": "input",
|
|
930
|
-
* "widget-label": "Amount",
|
|
931
|
-
* "widget-id": "amount",
|
|
932
|
-
* "widget-data-path": "transaction.amount",
|
|
933
|
-
* "widget-data-format": {
|
|
934
|
-
* "numericType": "decimal",
|
|
935
|
-
* "decimalPlaces": 2,
|
|
936
|
-
* "roundingMode": "round",
|
|
937
|
-
* "thousandSeparator": ",",
|
|
938
|
-
* "decimalSeparator": ".",
|
|
939
|
-
* "textAlign": "right",
|
|
940
|
-
* "allowSigned": true,
|
|
941
|
-
* "formatOnBlur": true
|
|
942
|
-
* },
|
|
943
|
-
* "widget-data-validation": {
|
|
944
|
-
* "min": 0,
|
|
945
|
-
* "max": 10000,
|
|
946
|
-
* "pattern": "^[0-9]+(\\.[0-9]{1,2})?$",
|
|
947
|
-
* "patternMessage": "Invalid number format"
|
|
948
|
-
* },
|
|
949
|
-
* "widget-data-default": 0,
|
|
950
|
-
* "widget-required": true,
|
|
951
|
-
* "widget-data-placeholder": "Enter amount"
|
|
952
|
-
* }
|
|
953
|
-
*/
|
|
954
638
|
interface NumberInputWidgetProps {
|
|
955
639
|
config: BaseWidgetConfig;
|
|
956
640
|
}
|
|
957
641
|
declare const NumberInputWidget: ({ config }: NumberInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
958
642
|
|
|
959
|
-
/**
|
|
960
|
-
* Boolean widget with advanced features
|
|
961
|
-
*
|
|
962
|
-
* Features:
|
|
963
|
-
* - Boolean representation (true/false, yes/no, on/off, custom labels)
|
|
964
|
-
* - Control type (checkbox, radio buttons, toggle/switch)
|
|
965
|
-
* - Default value (true, false, unset/null)
|
|
966
|
-
* - Required vs optional
|
|
967
|
-
* - Layout options (horizontal/vertical)
|
|
968
|
-
*
|
|
969
|
-
* Usage in schema:
|
|
970
|
-
* {
|
|
971
|
-
* "widget": "boolean",
|
|
972
|
-
* "widget-type": "input",
|
|
973
|
-
* "widget-label": "Is Married",
|
|
974
|
-
* "widget-id": "married",
|
|
975
|
-
* "widget-data-path": "person.married",
|
|
976
|
-
* "widget-data-default": false,
|
|
977
|
-
* "widget-data-format": {
|
|
978
|
-
* "booleanRepresentation": "yes-no",
|
|
979
|
-
* "booleanControlType": "radio",
|
|
980
|
-
* "allowUnset": true
|
|
981
|
-
* },
|
|
982
|
-
* "widget-data-validation": {},
|
|
983
|
-
* "widget-required": false,
|
|
984
|
-
* "widget-orientation": "horizontal"
|
|
985
|
-
* }
|
|
986
|
-
*/
|
|
987
643
|
interface BooleanWidgetProps {
|
|
988
644
|
config: BaseWidgetConfig;
|
|
989
645
|
}
|
|
990
646
|
declare const BooleanWidget: ({ config }: BooleanWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
991
647
|
|
|
992
|
-
/**
|
|
993
|
-
* Date input widget with advanced features
|
|
994
|
-
*
|
|
995
|
-
* Features:
|
|
996
|
-
* - Configurable date format (DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD, etc.)
|
|
997
|
-
* - Default value (none / today)
|
|
998
|
-
* - Date constraints (minDate, maxDate, any/past only/future only)
|
|
999
|
-
* - Relative bounds via minDateField / maxDateField (e.g. end date >= start date)
|
|
1000
|
-
* - Required vs optional
|
|
1001
|
-
* - Input method (date picker / manual / hybrid)
|
|
1002
|
-
* - Placeholder text
|
|
1003
|
-
* - Read-only & disabled
|
|
1004
|
-
* - Canonical stored format (ISO 8601)
|
|
1005
|
-
*
|
|
1006
|
-
* Usage in schema:
|
|
1007
|
-
* {
|
|
1008
|
-
* "widget": "date",
|
|
1009
|
-
* "widget-type": "input",
|
|
1010
|
-
* "widget-label": "Date of Birth",
|
|
1011
|
-
* "widget-id": "dob",
|
|
1012
|
-
* "widget-data-path": "person.dob",
|
|
1013
|
-
* "widget-data-default": "today",
|
|
1014
|
-
* "widget-data-format": {
|
|
1015
|
-
* "dateFormat": "DD/MM/YYYY",
|
|
1016
|
-
* "inputMethod": "hybrid",
|
|
1017
|
-
* "dateConstraint": "past-only"
|
|
1018
|
-
* },
|
|
1019
|
-
* "widget-data-options": {
|
|
1020
|
-
* "minDate": "1900-01-01",
|
|
1021
|
-
* "maxDate": "today"
|
|
1022
|
-
* "minDateField": "register.start_date",
|
|
1023
|
-
* "minDateMessage": "Date of birth must be on or after 1900-01-01"
|
|
1024
|
-
* "maxDateField": "register.end_date",
|
|
1025
|
-
* "maxDateMessage": "Date of birth must be on or before today"
|
|
1026
|
-
* },
|
|
1027
|
-
* "widget-data-validation": {},
|
|
1028
|
-
* "widget-required": true,
|
|
1029
|
-
* "widget-data-placeholder": "DD/MM/YYYY"
|
|
1030
|
-
* }
|
|
1031
|
-
*/
|
|
1032
648
|
interface DateInputWidgetProps {
|
|
1033
649
|
config: BaseWidgetConfig;
|
|
1034
650
|
}
|
|
1035
651
|
declare const DateInputWidget: ({ config }: DateInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1036
652
|
|
|
1037
|
-
/**
|
|
1038
|
-
* DateTime input widget with advanced features
|
|
1039
|
-
*
|
|
1040
|
-
* Features:
|
|
1041
|
-
* - Configurable datetime format (DD/MM/YYYY HH:mm, MM/DD/YYYY HH:mm:ss, etc.)
|
|
1042
|
-
* - Default value (none / now)
|
|
1043
|
-
* - DateTime constraints (minDateTime, maxDateTime, any/past only/future only)
|
|
1044
|
-
* - Required vs optional
|
|
1045
|
-
* - Input method (datetime picker / manual / hybrid)
|
|
1046
|
-
* - Placeholder text
|
|
1047
|
-
* - Read-only & disabled
|
|
1048
|
-
* - Canonical stored format (ISO 8601 with time)
|
|
1049
|
-
*
|
|
1050
|
-
* Usage in schema:
|
|
1051
|
-
* {
|
|
1052
|
-
* "widget": "datetime",
|
|
1053
|
-
* "widget-type": "input",
|
|
1054
|
-
* "widget-label": "Appointment Time",
|
|
1055
|
-
* "widget-id": "appointment",
|
|
1056
|
-
* "widget-data-path": "appointment.datetime",
|
|
1057
|
-
* "widget-data-default": "now",
|
|
1058
|
-
* "widget-data-format": {
|
|
1059
|
-
* "dateTimeFormat": "DD/MM/YYYY HH:mm",
|
|
1060
|
-
* "inputMethod": "picker",
|
|
1061
|
-
* "dateTimeConstraint": "future-only"
|
|
1062
|
-
* },
|
|
1063
|
-
* "widget-data-options": {
|
|
1064
|
-
* "minDateTime": "2024-01-01T00:00",
|
|
1065
|
-
* "maxDateTime": "now"
|
|
1066
|
-
* },
|
|
1067
|
-
* "widget-data-validation": {},
|
|
1068
|
-
* "widget-required": true,
|
|
1069
|
-
* "widget-data-placeholder": "DD/MM/YYYY HH:mm"
|
|
1070
|
-
* }
|
|
1071
|
-
*/
|
|
1072
653
|
interface DateTimeInputWidgetProps {
|
|
1073
654
|
config: BaseWidgetConfig;
|
|
1074
655
|
}
|
|
1075
656
|
declare const DateTimeInputWidget: ({ config }: DateTimeInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1076
657
|
|
|
1077
|
-
/**
|
|
1078
|
-
* Select/Dropdown widget with data source support
|
|
1079
|
-
*
|
|
1080
|
-
* Usage in schema:
|
|
1081
|
-
* {
|
|
1082
|
-
* "widget": "select",
|
|
1083
|
-
* "widget-type": "input",
|
|
1084
|
-
* "widget-label": "Country",
|
|
1085
|
-
* "widget-id": "country",
|
|
1086
|
-
* "widget-data-path": "address.country",
|
|
1087
|
-
* "widget-data-source": {
|
|
1088
|
-
* "type": "static" | "api" | "schema",
|
|
1089
|
-
* ...
|
|
1090
|
-
* }
|
|
1091
|
-
* }
|
|
1092
|
-
*/
|
|
1093
658
|
interface SelectWidgetProps {
|
|
1094
659
|
config: BaseWidgetConfig;
|
|
1095
660
|
}
|
|
1096
661
|
declare const SelectWidget: ({ config }: SelectWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1097
662
|
|
|
1098
|
-
/**
|
|
1099
|
-
* Radio button widget with advanced features
|
|
1100
|
-
*
|
|
1101
|
-
* Features:
|
|
1102
|
-
* - Static list of options
|
|
1103
|
-
* - Dynamic options (from API / dataset)
|
|
1104
|
-
* - Ordered options (preserve order or sort)
|
|
1105
|
-
* - Option label & value separation
|
|
1106
|
-
* - Display label
|
|
1107
|
-
* - Stored value
|
|
1108
|
-
* - Default selection (pre-selected option or unset)
|
|
1109
|
-
* - Required vs optional
|
|
1110
|
-
* - Layout options (vertical, horizontal, grid)
|
|
1111
|
-
*
|
|
1112
|
-
* Usage in schema:
|
|
1113
|
-
* {
|
|
1114
|
-
* "widget": "radio",
|
|
1115
|
-
* "widget-type": "input",
|
|
1116
|
-
* "widget-label": "Gender",
|
|
1117
|
-
* "widget-id": "gender",
|
|
1118
|
-
* "widget-data-path": "person.gender",
|
|
1119
|
-
* "widget-data-default": "male",
|
|
1120
|
-
* "widget-data-source": {
|
|
1121
|
-
* "type": "static",
|
|
1122
|
-
* "options": [
|
|
1123
|
-
* { "value": "male", "label": "Male" },
|
|
1124
|
-
* { "value": "female", "label": "Female" },
|
|
1125
|
-
* { "value": "other", "label": "Other" }
|
|
1126
|
-
* ]
|
|
1127
|
-
* },
|
|
1128
|
-
* "widget-data-format": {
|
|
1129
|
-
* "layout": "vertical",
|
|
1130
|
-
* "sortOptions": false
|
|
1131
|
-
* },
|
|
1132
|
-
* "widget-required": true
|
|
1133
|
-
* }
|
|
1134
|
-
*/
|
|
1135
663
|
interface RadioWidgetProps {
|
|
1136
664
|
config: BaseWidgetConfig;
|
|
1137
665
|
}
|
|
1138
666
|
declare const RadioWidget: ({ config }: RadioWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1139
667
|
|
|
1140
|
-
/**
|
|
1141
|
-
* Checkbox widget with advanced features
|
|
1142
|
-
*
|
|
1143
|
-
* Features:
|
|
1144
|
-
* - Single checkbox (boolean) - when no data source
|
|
1145
|
-
* - Multiple checkboxes (array) - when data source provided
|
|
1146
|
-
* - Static list of options
|
|
1147
|
-
* - Dynamic options (from API / dataset)
|
|
1148
|
-
* - Ordered options (preserve order or sort)
|
|
1149
|
-
* - Option label & value separation
|
|
1150
|
-
* - Display label
|
|
1151
|
-
* - Stored value (array for multi-select)
|
|
1152
|
-
* - Default selection (pre-selected options or empty array)
|
|
1153
|
-
* - Required vs optional (at least one must be selected if required)
|
|
1154
|
-
* - Layout options (vertical, horizontal, grid)
|
|
1155
|
-
*
|
|
1156
|
-
* Usage in schema (single checkbox):
|
|
1157
|
-
* {
|
|
1158
|
-
* "widget": "checkbox",
|
|
1159
|
-
* "widget-type": "input",
|
|
1160
|
-
* "widget-label": "I agree to terms",
|
|
1161
|
-
* "widget-id": "agree",
|
|
1162
|
-
* "widget-data-path": "form.agree",
|
|
1163
|
-
* "widget-data-default": false
|
|
1164
|
-
* }
|
|
1165
|
-
*
|
|
1166
|
-
* Usage in schema (multiple checkboxes):
|
|
1167
|
-
* {
|
|
1168
|
-
* "widget": "checkbox",
|
|
1169
|
-
* "widget-type": "input",
|
|
1170
|
-
* "widget-label": "Interests",
|
|
1171
|
-
* "widget-id": "interests",
|
|
1172
|
-
* "widget-data-path": "person.interests",
|
|
1173
|
-
* "widget-data-default": ["sports"],
|
|
1174
|
-
* "widget-data-source": {
|
|
1175
|
-
* "type": "static",
|
|
1176
|
-
* "options": [
|
|
1177
|
-
* { "value": "sports", "label": "Sports" },
|
|
1178
|
-
* { "value": "music", "label": "Music" },
|
|
1179
|
-
* { "value": "reading", "label": "Reading" }
|
|
1180
|
-
* ]
|
|
1181
|
-
* },
|
|
1182
|
-
* "widget-data-format": {
|
|
1183
|
-
* "layout": "vertical",
|
|
1184
|
-
* "sortOptions": false
|
|
1185
|
-
* },
|
|
1186
|
-
* "widget-required": true
|
|
1187
|
-
* }
|
|
1188
|
-
*/
|
|
1189
668
|
interface CheckboxWidgetProps {
|
|
1190
669
|
config: BaseWidgetConfig;
|
|
1191
670
|
}
|
|
1192
671
|
declare const CheckboxWidget: ({ config }: CheckboxWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1193
672
|
|
|
1194
|
-
/**
|
|
1195
|
-
* File input widget
|
|
1196
|
-
*
|
|
1197
|
-
* Usage in schema:
|
|
1198
|
-
* {
|
|
1199
|
-
* "widget": "file",
|
|
1200
|
-
* "widget-type": "input",
|
|
1201
|
-
* "widget-label": "Upload Document",
|
|
1202
|
-
* "widget-id": "document",
|
|
1203
|
-
* "widget-data-path": "form.document",
|
|
1204
|
-
* "widget-data-options": {
|
|
1205
|
-
* "accept": ".pdf,.doc,.docx",
|
|
1206
|
-
* "multiple": false,
|
|
1207
|
-
* "maxSize": 5242880 // 5MB in bytes
|
|
1208
|
-
* }
|
|
1209
|
-
* }
|
|
1210
|
-
*/
|
|
1211
673
|
interface FileInputWidgetProps {
|
|
1212
674
|
config: BaseWidgetConfig;
|
|
1213
675
|
}
|
|
1214
676
|
declare const FileInputWidget: ({ config }: FileInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1215
677
|
|
|
1216
|
-
/**
|
|
1217
|
-
* Simple table widget for structured data
|
|
1218
|
-
*
|
|
1219
|
-
* Usage in schema:
|
|
1220
|
-
* {
|
|
1221
|
-
* "widget": "simple-table",
|
|
1222
|
-
* "widget-type": "table",
|
|
1223
|
-
* "widget-label": "Education History",
|
|
1224
|
-
* "widget-id": "educationHistory",
|
|
1225
|
-
* "widget-data-path": "education.history",
|
|
1226
|
-
* "widget-data-columns": [
|
|
1227
|
-
* {
|
|
1228
|
-
* "column-key": "degree",
|
|
1229
|
-
* "widget-label": "Degree",
|
|
1230
|
-
* "widget": "text",
|
|
1231
|
-
* "widget-data-path": "degree"
|
|
1232
|
-
* }
|
|
1233
|
-
* ],
|
|
1234
|
-
* "widget-data-operations": {
|
|
1235
|
-
* "add": true,
|
|
1236
|
-
* "remove": true,
|
|
1237
|
-
* "edit": true
|
|
1238
|
-
* }
|
|
1239
|
-
* }
|
|
1240
|
-
*/
|
|
1241
|
-
interface SimpleTableWidgetProps {
|
|
1242
|
-
config: BaseWidgetConfig;
|
|
1243
|
-
}
|
|
1244
|
-
declare const SimpleTableWidget: ({ config }: SimpleTableWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1245
|
-
|
|
1246
|
-
/**
|
|
1247
|
-
* Array widget for simple repeating values
|
|
1248
|
-
*
|
|
1249
|
-
* Usage in schema:
|
|
1250
|
-
* {
|
|
1251
|
-
* "widget": "array-widget",
|
|
1252
|
-
* "widget-type": "group",
|
|
1253
|
-
* "widget-label": "Skills",
|
|
1254
|
-
* "widget-id": "skills",
|
|
1255
|
-
* "widget-data-path": "person.skills",
|
|
1256
|
-
* "widget-item": {
|
|
1257
|
-
* "widget": "text",
|
|
1258
|
-
* "widget-type": "input",
|
|
1259
|
-
* "widget-label": "Skill"
|
|
1260
|
-
* },
|
|
1261
|
-
* "widget-data-add-label": "Add Skill",
|
|
1262
|
-
* "widget-data-operations": {
|
|
1263
|
-
* "add": true,
|
|
1264
|
-
* "remove": true
|
|
1265
|
-
* }
|
|
1266
|
-
* }
|
|
1267
|
-
*/
|
|
1268
|
-
interface ArrayWidgetProps {
|
|
1269
|
-
config: BaseWidgetConfig;
|
|
1270
|
-
}
|
|
1271
|
-
declare const ArrayWidget: ({ config }: ArrayWidgetProps) => react_jsx_runtime.JSX.Element | null;
|
|
1272
|
-
|
|
1273
|
-
/**
|
|
1274
|
-
* Iterable accordion widget - expandable/collapsible container for widgets
|
|
1275
|
-
*
|
|
1276
|
-
* Usage in schema:
|
|
1277
|
-
* {
|
|
1278
|
-
* "widget": "iterable-accordion",
|
|
1279
|
-
* "widget-type": "group",
|
|
1280
|
-
* "widget-label": "Advanced Options",
|
|
1281
|
-
* "widget-id": "advancedOptions",
|
|
1282
|
-
* "widget-data-path": "person.notes",
|
|
1283
|
-
* "widget-data-collapsed": true,
|
|
1284
|
-
* "widget-item": {
|
|
1285
|
-
* "widget": "text",
|
|
1286
|
-
* "widget-type": "input",
|
|
1287
|
-
* "widget-label": "Additional Notes",
|
|
1288
|
-
* "widget-id": "notes",
|
|
1289
|
-
* ...
|
|
1290
|
-
* }
|
|
1291
|
-
* }
|
|
1292
|
-
*
|
|
1293
|
-
* Note: widget-item can be any widget config. If it has nested widgets property,
|
|
1294
|
-
* those will be rendered as well.
|
|
1295
|
-
*/
|
|
1296
|
-
interface IterableAccordionWidgetProps {
|
|
1297
|
-
config: BaseWidgetConfig;
|
|
1298
|
-
}
|
|
1299
|
-
declare const IterableAccordionWidget: ({ config }: IterableAccordionWidgetProps) => react_jsx_runtime.JSX.Element | null;
|
|
1300
|
-
|
|
1301
|
-
/**
|
|
1302
|
-
* Phone input widget with formatting
|
|
1303
|
-
*
|
|
1304
|
-
* Usage in schema:
|
|
1305
|
-
* {
|
|
1306
|
-
* "widget": "phone",
|
|
1307
|
-
* "widget-type": "input",
|
|
1308
|
-
* "widget-label": "Phone",
|
|
1309
|
-
* "widget-id": "phone",
|
|
1310
|
-
* "widget-data-path": "person.phone",
|
|
1311
|
-
* "widget-data-format": {
|
|
1312
|
-
* "pattern": "(XXX) XXX-XXXX"
|
|
1313
|
-
* }
|
|
1314
|
-
* }
|
|
1315
|
-
*/
|
|
1316
678
|
interface PhoneInputWidgetProps {
|
|
1317
679
|
config: BaseWidgetConfig;
|
|
1318
680
|
}
|
|
1319
681
|
declare const PhoneInputWidget: ({ config }: PhoneInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1320
682
|
|
|
1321
|
-
/**
|
|
1322
|
-
* Currency input widget with formatting
|
|
1323
|
-
*
|
|
1324
|
-
* Usage in schema:
|
|
1325
|
-
* {
|
|
1326
|
-
* "widget": "currency",
|
|
1327
|
-
* "widget-type": "input",
|
|
1328
|
-
* "widget-label": "Salary",
|
|
1329
|
-
* "widget-id": "salary",
|
|
1330
|
-
* "widget-data-path": "person.salary",
|
|
1331
|
-
* "widget-data-format": {
|
|
1332
|
-
* "currency": "USD",
|
|
1333
|
-
* "locale": "en-US",
|
|
1334
|
-
* "decimals": 2
|
|
1335
|
-
* }
|
|
1336
|
-
* }
|
|
1337
|
-
*/
|
|
1338
|
-
interface CurrencyInputWidgetProps {
|
|
1339
|
-
config: BaseWidgetConfig;
|
|
1340
|
-
}
|
|
1341
|
-
declare const CurrencyInputWidget: ({ config }: CurrencyInputWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1342
|
-
|
|
1343
|
-
/**
|
|
1344
|
-
* Display widget for readonly text display
|
|
1345
|
-
* Used for displaying information in a card layout
|
|
1346
|
-
*/
|
|
1347
683
|
interface DisplayWidgetProps {
|
|
1348
684
|
config: BaseWidgetConfig;
|
|
1349
685
|
}
|
|
1350
686
|
declare const DisplayWidget: ({ config }: DisplayWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1351
687
|
|
|
1352
|
-
/**
|
|
1353
|
-
* Table widget with record-level inline editing
|
|
1354
|
-
*
|
|
1355
|
-
* Usage in schema:
|
|
1356
|
-
* {
|
|
1357
|
-
* "widget": "table",
|
|
1358
|
-
* "widget-type": "table",
|
|
1359
|
-
* "widget-label": "Education History",
|
|
1360
|
-
* "widget-id": "educationHistory",
|
|
1361
|
-
* "widget-data-path": "education.history",
|
|
1362
|
-
* "widget-data-columns": [
|
|
1363
|
-
* {
|
|
1364
|
-
* "column-key": "degree",
|
|
1365
|
-
* "widget-label": "Degree",
|
|
1366
|
-
* "widget": "text",
|
|
1367
|
-
* "widget-type": "input",
|
|
1368
|
-
* "widget-data-path": "degree",
|
|
1369
|
-
* "widget-data-format": {...}
|
|
1370
|
-
* },
|
|
1371
|
-
* {
|
|
1372
|
-
* "column-key": "year",
|
|
1373
|
-
* "widget-label": "Year",
|
|
1374
|
-
* "widget": "number",
|
|
1375
|
-
* "widget-type": "input",
|
|
1376
|
-
* "widget-data-path": "year"
|
|
1377
|
-
* }
|
|
1378
|
-
* ],
|
|
1379
|
-
* "widget-data-operations": {
|
|
1380
|
-
* "add": true,
|
|
1381
|
-
* "remove": true,
|
|
1382
|
-
* "edit": true
|
|
1383
|
-
* },
|
|
1384
|
-
* "widget-data-api": {
|
|
1385
|
-
* "add": { "url": "/api/records", "method": "POST" },
|
|
1386
|
-
* "edit": { "url": "/api/records/{id}", "method": "PUT" },
|
|
1387
|
-
* "delete": { "url": "/api/records/{id}", "method": "DELETE" }
|
|
1388
|
-
* }
|
|
1389
|
-
* }
|
|
1390
|
-
*/
|
|
1391
688
|
interface TableWidgetProps {
|
|
1392
689
|
config: BaseWidgetConfig;
|
|
1393
690
|
}
|
|
@@ -1403,87 +700,11 @@ interface DialogTableWidgetProps {
|
|
|
1403
700
|
*/
|
|
1404
701
|
declare const DialogTableWidget: ({ config }: DialogTableWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1405
702
|
|
|
1406
|
-
/**
|
|
1407
|
-
* Profile widget for displaying user identity information
|
|
1408
|
-
* Displays an image/avatar, display name, and ID in a vertical layout
|
|
1409
|
-
*
|
|
1410
|
-
* This is a display widget that groups related profile fields together.
|
|
1411
|
-
* Recommended widget-type: 'group' (groups related data fields)
|
|
1412
|
-
* Alternative: 'layout' (for display-only, no value storage)
|
|
1413
|
-
*
|
|
1414
|
-
* Configuration (Recommended - Multi-path data binding):
|
|
1415
|
-
*
|
|
1416
|
-
* - widget-data-path: Object with keys 'image', 'name', 'id' mapping to data paths
|
|
1417
|
-
* Example: { "image": "person.photo", "name": "person.name", "id": "person.id" }
|
|
1418
|
-
*
|
|
1419
|
-
* Alternative (Individual path properties - fallback):
|
|
1420
|
-
* - widget-image-path?: string - Data path for the image/photo (e.g., "person.photo")
|
|
1421
|
-
* - widget-name-path?: string - Data path for the display name (e.g., "person.name")
|
|
1422
|
-
* - widget-id-path?: string - Data path for the ID (e.g., "person.id")
|
|
1423
|
-
*
|
|
1424
|
-
* Format options:
|
|
1425
|
-
* - widget-data-format: Optional format configuration
|
|
1426
|
-
* - imageSize?: number - Size of the avatar image in pixels (default: 80)
|
|
1427
|
-
* - nameColor?: string - Color for the name text (default: '#F07B1A')
|
|
1428
|
-
* - showIdLabel?: boolean - Whether to show "ID :" label (default: true)
|
|
1429
|
-
*
|
|
1430
|
-
* Example usage (Recommended):
|
|
1431
|
-
* ```json
|
|
1432
|
-
* {
|
|
1433
|
-
* "widget": "profile",
|
|
1434
|
-
* "widget-type": "group",
|
|
1435
|
-
* "widget-id": "user-profile",
|
|
1436
|
-
* "widget-data-path": {
|
|
1437
|
-
* "image": "photo",
|
|
1438
|
-
* "name": "display_name",
|
|
1439
|
-
* "id": "national_id"
|
|
1440
|
-
* },
|
|
1441
|
-
* "widget-data-format": {
|
|
1442
|
-
* "imageSize": 80,
|
|
1443
|
-
* "nameColor": "#F07B1A",
|
|
1444
|
-
* "showIdLabel": true
|
|
1445
|
-
* }
|
|
1446
|
-
* }
|
|
1447
|
-
* ```
|
|
1448
|
-
*/
|
|
1449
703
|
interface ProfileWidgetProps {
|
|
1450
704
|
config: BaseWidgetConfig;
|
|
1451
705
|
}
|
|
1452
706
|
declare const ProfileWidget: ({ config }: ProfileWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1453
707
|
|
|
1454
|
-
/**
|
|
1455
|
-
* TextArea widget for multi-line text input
|
|
1456
|
-
* Supports 2 rows by default with configurable rows
|
|
1457
|
-
*
|
|
1458
|
-
* Features:
|
|
1459
|
-
* - Multi-line text input
|
|
1460
|
-
* - Character type filtering (any, alphabetic, alphanumeric, numeric, etc.)
|
|
1461
|
-
* - Case control (none, lowercase, uppercase, capitalize)
|
|
1462
|
-
* - Length constraints with live character counter
|
|
1463
|
-
* - Regular expression validation with custom messages
|
|
1464
|
-
* - Placeholder text with i18n support
|
|
1465
|
-
*
|
|
1466
|
-
* Usage in schema:
|
|
1467
|
-
* {
|
|
1468
|
-
* "widget": "textarea",
|
|
1469
|
-
* "widget-type": "input",
|
|
1470
|
-
* "widget-label": "Description",
|
|
1471
|
-
* "widget-id": "description",
|
|
1472
|
-
* "widget-data-path": "person.description",
|
|
1473
|
-
* "widget-data-format": {
|
|
1474
|
-
* "characterType": "any",
|
|
1475
|
-
* "caseControl": "none",
|
|
1476
|
-
* "showCharCounter": true,
|
|
1477
|
-
* "rows": 2
|
|
1478
|
-
* },
|
|
1479
|
-
* "widget-data-validation": {
|
|
1480
|
-
* "minLength": 10,
|
|
1481
|
-
* "maxLength": 500
|
|
1482
|
-
* },
|
|
1483
|
-
* "widget-required": true,
|
|
1484
|
-
* "widget-data-placeholder": "Enter description"
|
|
1485
|
-
* }
|
|
1486
|
-
*/
|
|
1487
708
|
interface TextAreaWidgetProps {
|
|
1488
709
|
config: BaseWidgetConfig;
|
|
1489
710
|
}
|
|
@@ -1498,17 +719,6 @@ interface ScoresDisplayWidgetProps {
|
|
|
1498
719
|
config: BaseWidgetConfig;
|
|
1499
720
|
schemaData?: Record<string, unknown>;
|
|
1500
721
|
}
|
|
1501
|
-
/**
|
|
1502
|
-
* Scores Display Widget - full-width, view-only widget (list)
|
|
1503
|
-
*
|
|
1504
|
-
* Expected config (reference):
|
|
1505
|
-
* {
|
|
1506
|
-
* "widget": "scores-display",
|
|
1507
|
-
* "widget-type": "group",
|
|
1508
|
-
* "widget-id": "record-scores",
|
|
1509
|
-
* "widget-data-path": "scores"
|
|
1510
|
-
* }
|
|
1511
|
-
*/
|
|
1512
722
|
declare const ScoresDisplayWidget: ({ config, schemaData: propSchemaData, }: ScoresDisplayWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1513
723
|
|
|
1514
724
|
interface IdAuthenticationWidgetProps {
|
|
@@ -1526,6 +736,16 @@ interface MultiSelectWidgetProps {
|
|
|
1526
736
|
}
|
|
1527
737
|
declare const MultiSelectWidget: ({ config }: MultiSelectWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
1528
738
|
|
|
739
|
+
interface GeoHierarchyWidgetProps {
|
|
740
|
+
config: BaseWidgetConfig;
|
|
741
|
+
}
|
|
742
|
+
declare const GeoHierarchyWidget: ({ config }: GeoHierarchyWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
743
|
+
|
|
744
|
+
interface DocsWidgetProps {
|
|
745
|
+
config: BaseWidgetConfig;
|
|
746
|
+
}
|
|
747
|
+
declare const DocsWidget: ({ config }: DocsWidgetProps) => react_jsx_runtime.JSX.Element;
|
|
748
|
+
|
|
1529
749
|
/**
|
|
1530
750
|
* Get value from object using dot notation path
|
|
1531
751
|
* Safely handles nested paths like "person.name" or "address.street.number"
|
|
@@ -1540,13 +760,6 @@ declare const setValueByPath: (obj: any, path: string, value: any) => any;
|
|
|
1540
760
|
* Parse widget data path (can be string or object)
|
|
1541
761
|
*/
|
|
1542
762
|
declare const parseDataPath: (dataPath: string | Record<string, string> | undefined) => string | Record<string, string> | null;
|
|
1543
|
-
/**
|
|
1544
|
-
* Get value from widget state using data path
|
|
1545
|
-
*/
|
|
1546
|
-
/**
|
|
1547
|
-
* Resolve a widget-id reference in Redux values.
|
|
1548
|
-
* Supports namespaced ids (e.g. "rv-section-0__region_code" when ref is "region_code").
|
|
1549
|
-
*/
|
|
1550
763
|
declare const resolveWidgetIdValue: (values: Record<string, any>, ref: string) => any;
|
|
1551
764
|
declare const getWidgetValue: (values: Record<string, any>, dataPath: string | Record<string, string> | undefined, widgetId: string) => any;
|
|
1552
765
|
/**
|
|
@@ -1555,33 +768,15 @@ declare const getWidgetValue: (values: Record<string, any>, dataPath: string | R
|
|
|
1555
768
|
declare const setWidgetValue: (currentValues: Record<string, any>, dataPath: string | Record<string, string> | undefined, widgetId: string, value: any) => Record<string, any>;
|
|
1556
769
|
|
|
1557
770
|
/**
|
|
1558
|
-
*
|
|
1559
|
-
*
|
|
1560
|
-
* @param skipRequired - When true, required-field checks are skipped (used by
|
|
1561
|
-
* per-section Save/Next buttons so the user can move between sections without
|
|
1562
|
-
* filling every mandatory field; only format/range checks still run).
|
|
771
|
+
* @param skipRequired - Skip required checks for per-section Save/Next navigation;
|
|
772
|
+
* format and range validation still run.
|
|
1563
773
|
*/
|
|
1564
774
|
declare const validateWidget: (value: any, validation: WidgetValidation | undefined, required?: boolean, skipRequired?: boolean) => string[];
|
|
1565
|
-
/**
|
|
1566
|
-
* Create Zod schema from validation config
|
|
1567
|
-
*/
|
|
1568
775
|
declare const createZodSchema: (validation: WidgetValidation | undefined, required?: boolean) => z.ZodSchema | null;
|
|
1569
776
|
|
|
1570
|
-
/**
|
|
1571
|
-
* Format date value
|
|
1572
|
-
*/
|
|
1573
777
|
declare const formatDate: (value: any, format: WidgetFormat | undefined) => string;
|
|
1574
|
-
/**
|
|
1575
|
-
* Format currency value
|
|
1576
|
-
*/
|
|
1577
778
|
declare const formatCurrency: (value: any, format: WidgetFormat | undefined) => string;
|
|
1578
|
-
/**
|
|
1579
|
-
* Format phone number
|
|
1580
|
-
*/
|
|
1581
779
|
declare const formatPhone: (value: any, format: WidgetFormat | undefined) => string;
|
|
1582
|
-
/**
|
|
1583
|
-
* Format value based on widget format config
|
|
1584
|
-
*/
|
|
1585
780
|
declare const formatValue: (value: any, format: WidgetFormat | undefined, widgetType?: string) => string;
|
|
1586
781
|
|
|
1587
782
|
/**
|
|
@@ -1613,7 +808,7 @@ type ApiDataSource = Extract<DataSource, {
|
|
|
1613
808
|
type: 'api';
|
|
1614
809
|
}>;
|
|
1615
810
|
/** Return cached API options when already fetched (e.g. duplicate table cells). */
|
|
1616
|
-
declare function getCachedApiDataSource(dataSource: ApiDataSource, allValues: Record<string, any
|
|
811
|
+
declare function getCachedApiDataSource(dataSource: ApiDataSource, allValues: Record<string, any>): any[] | undefined;
|
|
1617
812
|
/**
|
|
1618
813
|
* Get static data source options
|
|
1619
814
|
*/
|
|
@@ -1626,256 +821,42 @@ declare const getStaticDataSource: (dataSource: Extract<DataSource, {
|
|
|
1626
821
|
*/
|
|
1627
822
|
declare const getApiDataSource: (dataSource: Extract<DataSource, {
|
|
1628
823
|
type: "api";
|
|
1629
|
-
}>, allValues: Record<string, any>, dataSourceRequestHandler: DataSourceRequestHandler
|
|
1630
|
-
/**
|
|
1631
|
-
* Get schema reference data source options
|
|
1632
|
-
*/
|
|
824
|
+
}>, allValues: Record<string, any>, dataSourceRequestHandler: DataSourceRequestHandler) => Promise<any[]>;
|
|
1633
825
|
declare const getSchemaDataSource: (dataSource: Extract<DataSource, {
|
|
1634
826
|
type: "schema";
|
|
1635
827
|
}>, schemaData: Record<string, any>) => any[];
|
|
1636
|
-
/**
|
|
1637
|
-
* Transform data source options to { value, label } format
|
|
1638
|
-
*/
|
|
1639
828
|
declare const transformDataSourceOptions: (data: any[], valueKey?: string, labelKey?: string) => Array<{
|
|
1640
829
|
value: any;
|
|
1641
830
|
label: string;
|
|
1642
831
|
}>;
|
|
1643
832
|
|
|
1644
|
-
/**
|
|
1645
|
-
* Filter input value based on allowed character type
|
|
1646
|
-
*/
|
|
1647
833
|
declare const filterByCharacterType: (value: string, characterType?: CharacterType, customCharset?: string) => string;
|
|
1648
|
-
/**
|
|
1649
|
-
* Apply case transformation to text
|
|
1650
|
-
*/
|
|
1651
834
|
declare const applyCaseControl: (value: string, caseControl?: CaseControl) => string;
|
|
1652
|
-
/**
|
|
1653
|
-
* Apply input mask to value
|
|
1654
|
-
*/
|
|
1655
835
|
declare const applyMask: (value: string, mask: InputMask) => {
|
|
1656
836
|
displayValue: string;
|
|
1657
837
|
rawValue: string;
|
|
1658
838
|
};
|
|
1659
|
-
/**
|
|
1660
|
-
* Remove mask from value to get raw value
|
|
1661
|
-
*/
|
|
1662
839
|
declare const removeMask: (value: string, mask: InputMask) => string;
|
|
1663
840
|
|
|
1664
|
-
/**
|
|
1665
|
-
* Format number with thousand and decimal separators
|
|
1666
|
-
*/
|
|
1667
841
|
declare const formatNumber: (value: number | string, format: WidgetFormat | undefined) => string;
|
|
1668
|
-
/**
|
|
1669
|
-
* Parse formatted number string to number
|
|
1670
|
-
*/
|
|
1671
842
|
declare const parseNumber: (value: string, format: WidgetFormat | undefined) => number | null;
|
|
1672
|
-
/**
|
|
1673
|
-
* Apply decimal precision with rounding or truncation
|
|
1674
|
-
*/
|
|
1675
843
|
declare const applyDecimalPrecision: (value: number, format: WidgetFormat | undefined) => number;
|
|
1676
|
-
/**
|
|
1677
|
-
* Validate numeric value against constraints
|
|
1678
|
-
*/
|
|
1679
844
|
declare const validateNumericValue: (value: number | null, format: WidgetFormat | undefined, validation?: {
|
|
1680
845
|
min?: number;
|
|
1681
846
|
max?: number;
|
|
1682
847
|
pattern?: string;
|
|
1683
848
|
patternMessage?: string;
|
|
1684
849
|
}) => string[];
|
|
1685
|
-
/**
|
|
1686
|
-
* Check if a key is allowed for numeric input
|
|
1687
|
-
*/
|
|
1688
850
|
declare const isAllowedKey: (key: string, format: WidgetFormat | undefined, currentValue: string, event?: React.KeyboardEvent<HTMLInputElement>) => boolean;
|
|
1689
|
-
/**
|
|
1690
|
-
* Calculate character count including separators and sign
|
|
1691
|
-
*/
|
|
1692
851
|
declare const getFormattedNumberLength: (value: number | string | null, format: WidgetFormat | undefined) => number;
|
|
1693
852
|
declare const normalizeNumericDefault: (defaultValue: unknown, format: WidgetFormat | undefined) => number | null | undefined;
|
|
1694
853
|
|
|
1695
|
-
/**
|
|
1696
|
-
* Geo Hierarchy Builder
|
|
1697
|
-
* Manages geo hierarchy state and builds hierarchy JSON structure
|
|
1698
|
-
*/
|
|
1699
|
-
interface GeoLevelData {
|
|
1700
|
-
level: string;
|
|
1701
|
-
level_value_id: string;
|
|
1702
|
-
level_value_mnemonic: string;
|
|
1703
|
-
}
|
|
1704
|
-
interface GeoLevelConfig {
|
|
1705
|
-
level: string;
|
|
1706
|
-
}
|
|
1707
|
-
/**
|
|
1708
|
-
* Resolve the display value for a geo level widget.
|
|
1709
|
-
* When widgetId is explicitly set in Redux (including cleared undefined/null), do not
|
|
1710
|
-
* fall back to shared hierarchy dataPath — that stale path was keeping grandchildren visible.
|
|
1711
|
-
*/
|
|
1712
|
-
declare function resolveGeoWidgetLevelValue(values: Record<string, any>, widgetId: string, dataPath: string | Record<string, string> | undefined, geoConfig: GeoLevelConfig): any;
|
|
1713
|
-
/**
|
|
1714
|
-
* Write the in-memory geo hierarchy builder state into Redux at the shared dataPath.
|
|
1715
|
-
*/
|
|
1716
|
-
declare function applySharedGeoHierarchyToValues(baseValues: Record<string, any>, groupId: string, dataPath: string | Record<string, string> | undefined, widgetId: string): Record<string, any>;
|
|
1717
|
-
declare class GeoHierarchyBuilder {
|
|
1718
|
-
private hierarchies;
|
|
1719
|
-
/**
|
|
1720
|
-
* Get or create hierarchy state for a group
|
|
1721
|
-
*/
|
|
1722
|
-
private getHierarchy;
|
|
1723
|
-
/**
|
|
1724
|
-
* Add a level to the hierarchy
|
|
1725
|
-
*/
|
|
1726
|
-
addLevel(level: string, level_value_id: string, level_value_mnemonic: string, groupId?: string): void;
|
|
1727
|
-
/**
|
|
1728
|
-
* Remove a level and all levels below it
|
|
1729
|
-
*/
|
|
1730
|
-
removeLevelAndBelow(level: string, groupId?: string): void;
|
|
1731
|
-
/**
|
|
1732
|
-
* Build hierarchy JSON structure
|
|
1733
|
-
*/
|
|
1734
|
-
buildHierarchyJson(groupId?: string): {
|
|
1735
|
-
geo_lowest_level_value_id: string;
|
|
1736
|
-
geo_code_hierarchy_json: {
|
|
1737
|
-
hierarchy: Array<{
|
|
1738
|
-
level: string;
|
|
1739
|
-
level_value_id: string;
|
|
1740
|
-
level_value_mnemonic: string;
|
|
1741
|
-
}>;
|
|
1742
|
-
lowest_level_value_id: string;
|
|
1743
|
-
};
|
|
1744
|
-
} | null;
|
|
1745
|
-
/**
|
|
1746
|
-
* Clear hierarchy for a group
|
|
1747
|
-
*/
|
|
1748
|
-
clear(groupId?: string): void;
|
|
1749
|
-
/**
|
|
1750
|
-
* Clear all hierarchies
|
|
1751
|
-
*/
|
|
1752
|
-
clearAll(): void;
|
|
1753
|
-
/**
|
|
1754
|
-
* Get current levels for a group
|
|
1755
|
-
*/
|
|
1756
|
-
getLevels(groupId?: string): GeoLevelData[];
|
|
1757
|
-
}
|
|
1758
|
-
declare const geoHierarchyBuilder: GeoHierarchyBuilder;
|
|
1759
|
-
/** Sentinel written to Redux when a geo level is cleared by cascade (distinct from "never set"). */
|
|
1760
|
-
declare const GEO_LEVEL_CLEARED: null;
|
|
1761
|
-
interface GeoWidgetRegistration {
|
|
1762
|
-
widgetId: string;
|
|
1763
|
-
parentWidgetId: string | null;
|
|
1764
|
-
level: string;
|
|
1765
|
-
geoConfig: GeoLevelConfig;
|
|
1766
|
-
dataPath: string;
|
|
1767
|
-
groupId: string;
|
|
1768
|
-
}
|
|
1769
|
-
declare function registerGeoWidgetParent(widgetId: string, parentWidgetId: string | null): void;
|
|
1770
|
-
declare function unregisterGeoWidgetParent(widgetId: string): void;
|
|
1771
|
-
declare function registerGeoWidget(widgetId: string, geoConfig: GeoLevelConfig & {
|
|
1772
|
-
parentWidgetId?: string | null;
|
|
1773
|
-
}, dataPath: string): void;
|
|
1774
|
-
declare function unregisterGeoWidget(widgetId: string): void;
|
|
1775
|
-
declare function orderGeoWidgetRegistrations(registrations: GeoWidgetRegistration[]): GeoWidgetRegistration[];
|
|
1776
|
-
/** Resolve display mnemonic from cached dropdown options, then stored hierarchy. */
|
|
1777
|
-
declare function createGeoLevelMnemonicResolver(values: Record<string, any>, dataSources: Record<string, Array<{
|
|
1778
|
-
value: any;
|
|
1779
|
-
label: string;
|
|
1780
|
-
}>>): (registration: GeoWidgetRegistration, valueId: string) => string | undefined;
|
|
1781
|
-
/** Rebuild group hierarchy from widget values in parent→child order; stop at first missing level. */
|
|
1782
|
-
declare function rebuildGeoHierarchyFromRegistrations(groupId: string, values: Record<string, any>, registrations: GeoWidgetRegistration[], resolveMnemonic?: (registration: GeoWidgetRegistration, valueId: string) => string | undefined): boolean;
|
|
1783
|
-
declare function collectGeoWidgetRegistrationsFromWidgets(widgets: Array<{
|
|
1784
|
-
'widget-id': string;
|
|
1785
|
-
'widget-data-path'?: string | Record<string, string>;
|
|
1786
|
-
'widget-geo-config'?: GeoLevelConfig & {
|
|
1787
|
-
parentWidgetId?: string | null;
|
|
1788
|
-
};
|
|
1789
|
-
}>, namespace?: string): GeoWidgetRegistration[];
|
|
1790
|
-
/** Reconcile all geo groups in section values before save. */
|
|
1791
|
-
declare function reconcileGeoHierarchiesInValues(values: Record<string, any>, registrations: GeoWidgetRegistration[], dataSources?: Record<string, Array<{
|
|
1792
|
-
value: any;
|
|
1793
|
-
label: string;
|
|
1794
|
-
}>>): Record<string, any>;
|
|
1795
|
-
declare function getGeoWidgetRegistrationsInGroup(groupId: string): GeoWidgetRegistration[];
|
|
1796
|
-
/** True when changedWidgetId is any upstream geo parent of widgetId (not only immediate parent). */
|
|
1797
|
-
declare function isUpstreamGeoAncestor(changedWidgetId: string, widgetId: string, immediateParentWidgetId: string | null): boolean;
|
|
1798
|
-
/** Group id for geo widgets sharing the same register prefix (e.g. `{registerId}`). */
|
|
1799
|
-
declare function getGeoGroupId(dataPath: string | Record<string, string> | undefined): string;
|
|
1800
|
-
/**
|
|
1801
|
-
* Resolve the human-readable label for a geo level from persisted hierarchy JSON.
|
|
1802
|
-
* Used in readonly mode when API options are not loaded.
|
|
1803
|
-
*/
|
|
1804
|
-
declare function resolveGeoWidgetLevelLabel(values: Record<string, any>, widgetId: string, dataPath: string | Record<string, string> | undefined, geoConfig: GeoLevelConfig): string | undefined;
|
|
1805
|
-
/** All registered geo widgets that are descendants of ancestorWidgetId. */
|
|
1806
|
-
declare function getGeoDescendantWidgetIds(ancestorWidgetId: string): string[];
|
|
1807
|
-
/** Seed in-memory builder from persisted hierarchy JSON (edit-mode rehydration). */
|
|
1808
|
-
declare function seedGeoHierarchyFromValues(values: Record<string, any>, dataPath: string | Record<string, string> | undefined, widgetId: string, groupId: string): void;
|
|
1809
|
-
/** Force-clear builder for a group, then seed from Redux/schema values (e.g. after Cancel). */
|
|
1810
|
-
declare function resetAndSeedGeoHierarchyFromValues(values: Record<string, any>, dataPath: string, widgetId: string, groupId: string): void;
|
|
1811
|
-
|
|
1812
854
|
type ResolvedTheme = ReturnType<typeof resolveTheme>;
|
|
1813
|
-
/**
|
|
1814
|
-
* Access the resolved widget theme from any component inside `<WidgetProvider>`.
|
|
1815
|
-
*
|
|
1816
|
-
* ```tsx
|
|
1817
|
-
* const theme = useWidgetTheme();
|
|
1818
|
-
* // theme.colors.primary, theme.section.dividerColor, etc.
|
|
1819
|
-
* ```
|
|
1820
|
-
*/
|
|
1821
855
|
declare function useWidgetTheme(): ResolvedTheme;
|
|
1822
856
|
|
|
1823
|
-
/**
|
|
1824
|
-
* Initialize i18n for the widget library
|
|
1825
|
-
* Can be customized by passing custom resources or configuration
|
|
1826
|
-
*
|
|
1827
|
-
* If no resources are provided, it will attempt to automatically load translations
|
|
1828
|
-
* from the consuming project's locale directory.
|
|
1829
|
-
*
|
|
1830
|
-
* If options are provided and the default instance is already initialized,
|
|
1831
|
-
* creates a new i18n instance to avoid reinitialization issues.
|
|
1832
|
-
*/
|
|
1833
|
-
declare const initI18n: (options?: {
|
|
1834
|
-
resources?: Record<string, any>;
|
|
1835
|
-
lng?: string;
|
|
1836
|
-
fallbackLng?: string;
|
|
1837
|
-
debug?: boolean;
|
|
1838
|
-
loadPath?: string | string[];
|
|
1839
|
-
autoLoad?: boolean;
|
|
1840
|
-
}) => Promise<i18next.i18n>;
|
|
1841
|
-
|
|
1842
|
-
/**
|
|
1843
|
-
* Custom hook for widget translations
|
|
1844
|
-
* Provides translation function with widget-specific namespace and fallback support
|
|
1845
|
-
*/
|
|
1846
|
-
declare const useWidgetTranslation: () => {
|
|
1847
|
-
t: (keyOrString: string | undefined | null, options?: {
|
|
1848
|
-
defaultValue?: string;
|
|
1849
|
-
[key: string]: any;
|
|
1850
|
-
}) => string;
|
|
1851
|
-
translate: (keyOrString: string | undefined | null, options?: {
|
|
1852
|
-
defaultValue?: string;
|
|
1853
|
-
[key: string]: any;
|
|
1854
|
-
}) => string;
|
|
1855
|
-
translateConfig: (value: string | undefined | null, fallback?: string) => string;
|
|
1856
|
-
};
|
|
1857
|
-
|
|
1858
|
-
/**
|
|
1859
|
-
* Recursively translate widget configuration using translation keys
|
|
1860
|
-
* This utility helps transform a schema with translation keys into translated strings
|
|
1861
|
-
*
|
|
1862
|
-
* @param widgetConfig - Widget configuration that may contain translation keys
|
|
1863
|
-
* @param translate - Translation function (from useWidgetTranslation or i18next)
|
|
1864
|
-
* @returns Translated widget configuration
|
|
1865
|
-
*/
|
|
1866
857
|
declare const translateWidgetConfig: (widgetConfig: BaseWidgetConfig, translate: (key: string, options?: any) => string) => BaseWidgetConfig;
|
|
1867
|
-
/**
|
|
1868
|
-
* Recursively translate panel configuration
|
|
1869
|
-
*/
|
|
1870
858
|
declare const translatePanelConfig: (panel: PanelConfig, translate: (key: string, options?: any) => string) => PanelConfig;
|
|
1871
|
-
/**
|
|
1872
|
-
* Translate entire UI Schema
|
|
1873
|
-
*
|
|
1874
|
-
* @param schema - UI Schema with potential translation keys
|
|
1875
|
-
* @param translate - Translation function
|
|
1876
|
-
* @returns Translated UI Schema
|
|
1877
|
-
*/
|
|
1878
859
|
declare const translateUISchema: (schema: UISchema, translate: (key: string, options?: any) => string) => UISchema;
|
|
1879
860
|
|
|
1880
|
-
export {
|
|
1881
|
-
export type { ApiAdapter, ApiDataSource$1 as ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType,
|
|
861
|
+
export { BooleanWidget, CheckboxWidget, DateInputWidget, DateTimeInputWidget, DialogTableWidget, DisplayWidget, DocsWidget, FileInputWidget, GeoHierarchyWidget, HeaderSectionWidget, IdAuthenticationWidget, JSONEditorPanel, MultiSelectWidget, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, RegisterLookupWidget, ScoresDisplayWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, defaultTheme, evaluateCondition, evaluateWidgetConditions, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, getApiDataSource, getCachedApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, hasVisibilityRules, isAllowedKey, isGeoHierarchyDataSource, normalizeNumericDefault, normalizeOptionRules, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, resolveTheme, resolveWidgetIdValue, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldRequireWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTheme, validateNumericValue, validateWidget, widgetRegistry };
|
|
862
|
+
export type { ApiAdapter, ApiDataSource$1 as ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType, DocsWidgetDocumentConfig, GeoHierarchyDataPath, GeoHierarchyDataSource, GeoHierarchyLayout, InputMask, NumericType, PanelConfig, RoundingMode, SchemaDataSource, SectionBuilderProps, SectionChanges, SectionConfig, SectionMode, SectionRendererProps, SectionsContainerProps, SectionsFormHandle, StaticDataSource, SupportingDocumentConfig, TextAlign, TreeNode, TreeNodeType, UISchema, UseBaseWidgetOptions, ValidationType, WidgetCascadeConfig, WidgetCondition, WidgetConditionState, WidgetContextValue, WidgetDataPath, WidgetDispatch, WidgetEvent, WidgetEventType, WidgetFormat, WidgetOptionRule, WidgetOptions, WidgetRegistryEntry, WidgetRenderFunction, WidgetRootState, WidgetState, WidgetStore, WidgetTheme, WidgetThemeButton, WidgetThemeColors, WidgetThemePanel, WidgetThemeSection, WidgetThemeWidget, WidgetValidation, WidgetValue };
|