@openg2p/registry-widgets 1.1.3 → 1.1.4-dev.2

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 (42) hide show
  1. package/dist/assets/index.d.ts +3 -1
  2. package/dist/assets/index.d.ts.map +1 -1
  3. package/dist/components/SectionRenderer/utils/executeSectionSave.d.ts.map +1 -1
  4. package/dist/components/SectionRenderer.d.ts +61 -0
  5. package/dist/components/SectionRenderer.d.ts.map +1 -0
  6. package/dist/hooks/useGeoHierarchy.d.ts +1 -0
  7. package/dist/hooks/useGeoHierarchy.d.ts.map +1 -1
  8. package/dist/hooks/useGeoWidgetCascade.d.ts +12 -0
  9. package/dist/hooks/useGeoWidgetCascade.d.ts.map +1 -0
  10. package/dist/hooks/useWidgetTranslation.d.ts +16 -0
  11. package/dist/hooks/useWidgetTranslation.d.ts.map +1 -0
  12. package/dist/i18n/config.d.ts +21 -0
  13. package/dist/i18n/config.d.ts.map +1 -0
  14. package/dist/index.d.ts +9 -1
  15. package/dist/index.esm.js +233 -229
  16. package/dist/index.esm.js.map +1 -1
  17. package/dist/index.js +233 -229
  18. package/dist/index.js.map +1 -1
  19. package/dist/types/index.d.ts +9 -1
  20. package/dist/types/index.d.ts.map +1 -1
  21. package/dist/utils/buildSectionChanges.d.ts +11 -0
  22. package/dist/utils/buildSectionChanges.d.ts.map +1 -0
  23. package/dist/utils/filePreview.d.ts +1 -0
  24. package/dist/utils/filePreview.d.ts.map +1 -1
  25. package/dist/utils/geoHierarchy.d.ts +13 -0
  26. package/dist/utils/geoHierarchy.d.ts.map +1 -1
  27. package/dist/utils/schemaNamespace.d.ts +12 -0
  28. package/dist/utils/schemaNamespace.d.ts.map +1 -0
  29. package/dist/widgets/ArrayWidget.d.ts +29 -0
  30. package/dist/widgets/ArrayWidget.d.ts.map +1 -0
  31. package/dist/widgets/CurrencyInputWidget.d.ts +24 -0
  32. package/dist/widgets/CurrencyInputWidget.d.ts.map +1 -0
  33. package/dist/widgets/DocsWidget.d.ts +1 -0
  34. package/dist/widgets/DocsWidget.d.ts.map +1 -1
  35. package/dist/widgets/FileInputWidget.d.ts.map +1 -1
  36. package/dist/widgets/GeoHierarchyWidget.d.ts.map +1 -1
  37. package/dist/widgets/HeaderSectionWidget.d.ts.map +1 -1
  38. package/dist/widgets/IterableAccordionWidget.d.ts +30 -0
  39. package/dist/widgets/IterableAccordionWidget.d.ts.map +1 -0
  40. package/dist/widgets/SimpleTableWidget.d.ts +32 -0
  41. package/dist/widgets/SimpleTableWidget.d.ts.map +1 -0
  42. package/package.json +1 -1
@@ -17,5 +17,7 @@ import resetIcon from './reset_icon.png';
17
17
  import previewIcon from './preview_icon.png';
18
18
  import maximizeIcon from './maximize_icon.png';
19
19
  import minimizeIcon from './minimize_icon.png';
20
- export { dummyProfile, fileIcon, uploadIcon, closeSign, dummyDoc, downArrowIcon, personIcon, calendarIcon, rightArrowIcon, arrowUpIcon, arrowDownIcon, arrowLeftIcon, arrowRightIcon, resetIcon, previewIcon, maximizeIcon, minimizeIcon, searchIcon, closeIcon, };
20
+ import attachmentIcon from './attached_doc.png';
21
+ import remove from './remove.png';
22
+ export { dummyProfile, fileIcon, uploadIcon, closeSign, dummyDoc, downArrowIcon, personIcon, calendarIcon, rightArrowIcon, arrowUpIcon, arrowDownIcon, arrowLeftIcon, arrowRightIcon, resetIcon, previewIcon, maximizeIcon, minimizeIcon, searchIcon, closeIcon, remove, attachmentIcon, };
21
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/assets/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,SAAS,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C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAC/C,OAAO,cAAc,MAAM,oBAAoB,CAAC;AAChD,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,OAAO,EACH,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,aAAa,EACb,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,SAAS,EACT,MAAM,EACN,cAAc,GACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"executeSectionSave.d.ts","sourceRoot":"","sources":["../../../../src/components/SectionRenderer/utils/executeSectionSave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI/C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAiGD,eAAO,MAAM,kBAAkB,GAAU,qIAUtC,wBAAwB,KAAG,OAAO,CAAC,wBAAwB,CAwD7D,CAAC"}
1
+ {"version":3,"file":"executeSectionSave.d.ts","sourceRoot":"","sources":["../../../../src/components/SectionRenderer/utils/executeSectionSave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAO/C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1C,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAwGD,eAAO,MAAM,kBAAkB,GAAU,qIAUtC,wBAAwB,KAAG,OAAO,CAAC,wBAAwB,CAwD7D,CAAC"}
@@ -0,0 +1,61 @@
1
+ import { SectionConfig } from '../types';
2
+ import { UseBaseWidgetOptions } from '../hooks/useBaseWidget';
3
+ import { SectionMode } from './SectionsContainer';
4
+ export interface SectionChanges {
5
+ section_id?: string;
6
+ section_register_id?: string;
7
+ records: unknown[];
8
+ files?: unknown[];
9
+ image?: File | null;
10
+ }
11
+ export interface SectionRendererProps {
12
+ section: SectionConfig;
13
+ dataSourceRequestHandler?: UseBaseWidgetOptions['dataSourceRequestHandler'];
14
+ schemaData?: UseBaseWidgetOptions['schemaData'];
15
+ onValueChange?: UseBaseWidgetOptions['onValueChange'];
16
+ gridColumnSpan?: number;
17
+ onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
18
+ hideEditButton?: boolean;
19
+ mode?: SectionMode;
20
+ namespace?: string;
21
+ changeRequestType?: 'new' | 'old';
22
+ showChangeRequestLabel?: boolean;
23
+ dbSectionId?: string;
24
+ sectionRegisterId?: string;
25
+ /** Called when the section's dirty (has unsaved changes) status changes. Only fires while in edit mode. */
26
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
27
+ /** IntakeForm mode: 0-based index of this section within the form */
28
+ sectionIndex?: number;
29
+ /** IntakeForm mode: total number of sections in the form */
30
+ sectionCount?: number;
31
+ /** IntakeForm mode: index of the currently expanded section (null = all collapsed) */
32
+ expandedSectionIndex?: number | null;
33
+ /** IntakeForm mode: called when user requests to expand a section (e.g. clicks accordion header) */
34
+ onExpandSection?: (index: number) => void;
35
+ /** IntakeForm mode: called when section save completes successfully (collapse current, expand next) */
36
+ onSectionSaveSuccess?: (index: number) => void;
37
+ /** IntakeForm mode: called when user clicks Previous (collapse current, expand previous) */
38
+ onPreviousSection?: (index: number) => void;
39
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
40
+ isDraft?: boolean;
41
+ /**
42
+ * IntakeForm mode: when true the accordion header is clickable so the user can open/close this
43
+ * section freely. False (default) locks the header — navigation is only via Next/Previous.
44
+ * SectionsContainer sets this to true for every visited section plus the one immediately after.
45
+ */
46
+ isAccessible?: boolean;
47
+ /** RegistryView: called when this section enters or exits edit mode. Used by SectionsContainer to enforce single-edit. */
48
+ onEditModeChange?: (sectionId: string, editing: boolean) => void;
49
+ /** RegistryView: when true, forces this section out of edit mode (another section took over). */
50
+ forceExitEdit?: boolean;
51
+ }
52
+ /**
53
+ * Renders a section with its panels
54
+ *
55
+ * Layout behavior:
56
+ * - Section width is based on max 3 panels (or more on high resolution)
57
+ * - Panels wrap when they exceed available width
58
+ * - Sections can sit side-by-side if there's space
59
+ */
60
+ export 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) => import("react/jsx-runtime").JSX.Element;
61
+ //# sourceMappingURL=SectionRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionRenderer.d.ts","sourceRoot":"","sources":["../../src/components/SectionRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAyC,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAQ9D,OAAO,EAAE,WAAW,EAAE,MAAM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,IAAI,CAAC;IAC1C,uGAAuG;IACvG,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,4FAA4F;IAC5F,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,wGAAwG;IACxG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,0HAA0H;IAC1H,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACjE,iGAAiG;IACjG,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,saAyB7B,oBAAoB,4CAqlDtB,CAAC"}
@@ -9,6 +9,7 @@ export declare function useGeoHierarchy({ config }: UseGeoHierarchyOptions): {
9
9
  options: Record<string, GeoSelectOption[]>;
10
10
  resolvedLabels: Record<string, string>;
11
11
  columnCounts: number[];
12
+ columnSpan: number;
12
13
  visibleColumns: {
13
14
  index: number;
14
15
  levels: GeoLevel[];
@@ -1 +1 @@
1
- {"version":3,"file":"useGeoHierarchy.d.ts","sourceRoot":"","sources":["../../src/hooks/useGeoHierarchy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAA4B,MAAM,UAAU,CAAC;AAKtE,OAAO,EACL,QAAQ,EAER,eAAe,EAMf,gBAAgB,EASjB,MAAM,uBAAuB,CAAC;AAE/B,UAAU,sBAAsB;IAC9B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AA+BD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,sBAAsB;;;;;;;;;;;;;;oCAmU3C,MAAM,aAAa,MAAM,GAAG,SAAS;iCA2E3B,MAAM;;;;;;;;;;;;;;;;;;;;;;;EAGtC"}
1
+ {"version":3,"file":"useGeoHierarchy.d.ts","sourceRoot":"","sources":["../../src/hooks/useGeoHierarchy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAA4B,MAAM,UAAU,CAAC;AAKtE,OAAO,EACL,QAAQ,EAER,eAAe,EAQf,gBAAgB,EASjB,MAAM,uBAAuB,CAAC;AAE/B,UAAU,sBAAsB;IAC9B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AA+BD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE,sBAAsB;;;;;;;;;;;;;;;oCA0V3C,MAAM,aAAa,MAAM,GAAG,SAAS;iCAuF3B,MAAM;;;;;;;;;;;;;;;;;;;;;;;EAGtC"}
@@ -0,0 +1,12 @@
1
+ import { BaseWidgetConfig, DataSourceRequestHandler } from '../types';
2
+ export interface UseGeoWidgetCascadeOptions {
3
+ config: BaseWidgetConfig;
4
+ dataSourceRequestHandler?: DataSourceRequestHandler;
5
+ values: Record<string, any>;
6
+ }
7
+ /**
8
+ * Hook for geo widget cascade functionality
9
+ * Handles geo hierarchy building and cascade behavior
10
+ */
11
+ export declare const useGeoWidgetCascade: (options: UseGeoWidgetCascadeOptions) => void;
12
+ //# sourceMappingURL=useGeoWidgetCascade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGeoWidgetCascade.d.ts","sourceRoot":"","sources":["../../src/hooks/useGeoWidgetCascade.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAmBtE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,gBAAgB,CAAC;IACzB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAGD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,SAAS,0BAA0B,SAwMtE,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Custom hook for widget translations
3
+ * Provides translation function with widget-specific namespace and fallback support
4
+ */
5
+ export declare const useWidgetTranslation: () => {
6
+ t: (keyOrString: string | undefined | null, options?: {
7
+ defaultValue?: string;
8
+ [key: string]: any;
9
+ }) => string;
10
+ translate: (keyOrString: string | undefined | null, options?: {
11
+ defaultValue?: string;
12
+ [key: string]: any;
13
+ }) => string;
14
+ translateConfig: (value: string | undefined | null, fallback?: string) => string;
15
+ };
16
+ //# sourceMappingURL=useWidgetTranslation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useWidgetTranslation.d.ts","sourceRoot":"","sources":["../../src/hooks/useWidgetTranslation.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,oBAAoB;qBAoBhB,MAAM,GAAG,SAAS,GAAG,IAAI,YAC5B;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,KACA,MAAM;6BALM,MAAM,GAAG,SAAS,GAAG,IAAI,YAC5B;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,KACA,MAAM;6BA0BA,MAAM,GAAG,SAAS,GAAG,IAAI,aACrB,MAAM,KAChB,MAAM;CAqDV,CAAC"}
@@ -0,0 +1,21 @@
1
+ import i18n from 'i18next';
2
+ /**
3
+ * Initialize i18n for the widget library
4
+ * Can be customized by passing custom resources or configuration
5
+ *
6
+ * If no resources are provided, it will attempt to automatically load translations
7
+ * from the consuming project's locale directory.
8
+ *
9
+ * If options are provided and the default instance is already initialized,
10
+ * creates a new i18n instance to avoid reinitialization issues.
11
+ */
12
+ export declare const initI18n: (options?: {
13
+ resources?: Record<string, any>;
14
+ lng?: string;
15
+ fallbackLng?: string;
16
+ debug?: boolean;
17
+ loadPath?: string | string[];
18
+ autoLoad?: boolean;
19
+ }) => Promise<import("i18next").i18n>;
20
+ export default i18n;
21
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/i18n/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,SAAS,CAAC;AA6C3B;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,GAAU,UAAU;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,oCAuEA,CAAC;AAwBF,eAAe,IAAI,CAAC"}
package/dist/index.d.ts CHANGED
@@ -57,7 +57,14 @@ interface DocsWidgetDocumentConfig {
57
57
  }
58
58
  interface GeoHierarchyLayout {
59
59
  distribution?: 'fixed';
60
+ /** Explicit levels-per-column counts, e.g. [3, 3] for a 6-level hierarchy in 2 columns. */
60
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;
61
68
  columnIndex?: number;
62
69
  }
63
70
  /** Optional read path for edit-mode hydration (defaults from widget-data-path). */
@@ -180,7 +187,8 @@ interface BaseWidgetConfig {
180
187
  /** Column layout for geo-hierarchy widget (e.g. 3 levels per column). */
181
188
  'widget-geo-layout'?: GeoHierarchyLayout;
182
189
  /**
183
- * Read path for geo_code_hierarchy_json (geo-hierarchy widget, edit-mode hydrate).
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.
184
192
  */
185
193
  'widget-geo-hierarchy-path'?: string;
186
194
  widgets?: BaseWidgetConfig[];