@openg2p/registry-widgets 0.1.5 → 0.1.7

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.
@@ -0,0 +1,19 @@
1
+ import dummyProfile from './dummy_profile.png';
2
+ import fileIcon from './file_icon.png';
3
+ import uploadIcon from './upload_icon.png';
4
+ import closeSign from './close_sign.png';
5
+ import dummyDoc from './dummy_doc.png';
6
+ import downArrowIcon from './down_arrow.png';
7
+ import personIcon from './person.png';
8
+ import calendarIcon from './calendar.png';
9
+ import rightArrowIcon from './right_arrow.png';
10
+ import arrowUpIcon from './arrow_up.png';
11
+ import arrowDownIcon from './arrow_down.png';
12
+ import arrowLeftIcon from './arrow_left.png';
13
+ import arrowRightIcon from './arrow_right.png';
14
+ import resetIcon from './reset_icon.png';
15
+ import previewIcon from './preview_icon.png';
16
+ import maximizeIcon from './maximize_icon.png';
17
+ import minimizeIcon from './minimize_icon.png';
18
+ export { dummyProfile, fileIcon, uploadIcon, closeSign, dummyDoc, downArrowIcon, personIcon, calendarIcon, rightArrowIcon, arrowUpIcon, arrowDownIcon, arrowLeftIcon, arrowRightIcon, resetIcon, previewIcon, maximizeIcon, minimizeIcon, };
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,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;AAE/C,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,GACf,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"FilePreviewModal.d.ts","sourceRoot":"","sources":["../../src/components/FilePreviewModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAsCD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsM5D,CAAC"}
1
+ {"version":3,"file":"FilePreviewModal.d.ts","sourceRoot":"","sources":["../../src/components/FilePreviewModal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAsCD,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsL5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"JSONEditorPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SectionBuilder/JSONEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgD5C,UAAU,oBAAoB;IAC5B,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC1C;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAisB1D,CAAC"}
1
+ {"version":3,"file":"JSONEditorPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SectionBuilder/JSONEditorPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAIjF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAiD5C,UAAU,oBAAoB;IAC5B,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;CAC1C;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmqB1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"VisualBuilderPanel.d.ts","sourceRoot":"","sources":["../../../src/components/SectionBuilder/VisualBuilderPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAiC,MAAM,aAAa,CA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,CAAC;IAC9C,eAAe,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAClD,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,KAAK,IAAI,CAAC;IACnF,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,eAAe,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAgUhE,CAAC"}
@@ -2,7 +2,8 @@ import { SectionConfig } from '../types';
2
2
  import { UseBaseWidgetOptions } from '../hooks/useBaseWidget';
3
3
  import { SectionMode } from './SectionsContainer';
4
4
  export interface SectionChanges {
5
- section_id: string;
5
+ section_id?: string;
6
+ section_register_id?: string;
6
7
  records: unknown[];
7
8
  files?: unknown[];
8
9
  }
@@ -18,6 +19,24 @@ export interface SectionRendererProps {
18
19
  namespace?: string;
19
20
  changeRequestType?: 'new' | 'old';
20
21
  showChangeRequestLabel?: boolean;
22
+ dbSectionId?: string;
23
+ sectionRegisterId?: string;
24
+ /** Called when the section's dirty (has unsaved changes) status changes. Only fires while in edit mode. */
25
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
26
+ /** IntakeForm mode: 0-based index of this section within the form */
27
+ sectionIndex?: number;
28
+ /** IntakeForm mode: total number of sections in the form */
29
+ sectionCount?: number;
30
+ /** IntakeForm mode: index of the currently expanded section (null = all collapsed) */
31
+ expandedSectionIndex?: number | null;
32
+ /** IntakeForm mode: called when user requests to expand a section (e.g. clicks accordion header) */
33
+ onExpandSection?: (index: number) => void;
34
+ /** IntakeForm mode: called when section save completes successfully (collapse current, expand next) */
35
+ onSectionSaveSuccess?: (index: number) => void;
36
+ /** IntakeForm mode: called when user clicks Previous (collapse current, expand previous) */
37
+ onPreviousSection?: (index: number) => void;
38
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
39
+ isDraft?: boolean;
21
40
  }
22
41
  /**
23
42
  * Renders a section with its panels
@@ -27,5 +46,5 @@ export interface SectionRendererProps {
27
46
  * - Panels wrap when they exceed available width
28
47
  * - Sections can sit side-by-side if there's space
29
48
  */
30
- export declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, }: SectionRendererProps) => import("react/jsx-runtime").JSX.Element;
49
+ 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, }: SectionRendererProps) => import("react/jsx-runtime").JSX.Element;
31
50
  //# sourceMappingURL=SectionRenderer.d.ts.map
@@ -1 +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;AAM9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIlD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,KAAK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Handler } from '../types';
2
2
  import { UseBaseWidgetOptions } from '../hooks/useBaseWidget';
3
3
  import { SectionChanges } from './SectionRenderer';
4
- export type SectionMode = 'RegistryView' | 'CRView';
4
+ export type SectionMode = 'RegistryView' | 'CRView' | 'IntakeForm';
5
+ /** Form controls passed to host via onFormReady. Allows host to validate and get all section data (e.g. on Submit). */
6
+ export interface SectionsFormHandle {
7
+ /** Validate all sections. Returns true if valid, false otherwise. */
8
+ validate(): Promise<boolean>;
9
+ /** Get raw form data from store for all sections (no validation). */
10
+ getFormData(): Record<string, unknown>;
11
+ /** Validate all sections. If valid, returns SectionChanges[]; if invalid, throws. */
12
+ validateAndGetData(): Promise<SectionChanges[]>;
13
+ /**
14
+ * Used for form save-draft functionality.
15
+ * Retrieves record and file changes without validation.
16
+ */
17
+ getStructuredData(): SectionChanges[];
18
+ }
5
19
  export interface SectionsContainerProps {
6
20
  sections: SectionConfig[];
7
21
  dataSourceRequestHandler?: DataSourceRequestHandler;
@@ -11,7 +25,13 @@ export interface SectionsContainerProps {
11
25
  onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
12
26
  hideEditButton?: boolean;
13
27
  mode?: SectionMode;
28
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
29
+ isDraft?: boolean;
14
30
  namespace?: string | ((sectionId: string, index: number) => string);
31
+ /** Called when a section's dirty (has unsaved changes) status changes. Only fires while the section is in edit mode. */
32
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
33
+ /** Called when the form is ready. Passes form controls (validate, getFormData, validateAndGetData) so the host can trigger submit from its own button. */
34
+ onFormReady?: (handle: SectionsFormHandle) => void;
15
35
  }
16
36
  /**
17
37
  * Container component that renders multiple sections
@@ -23,5 +43,5 @@ export interface SectionsContainerProps {
23
43
  * - All sections align to the same grid, ensuring right-side alignment
24
44
  * - Handles nested structure: multiple horizontal panels, each with multiple vertical panels
25
45
  */
26
- export declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, namespace, }: SectionsContainerProps) => import("react/jsx-runtime").JSX.Element;
46
+ export declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, isDraft, namespace, onSectionDirtyChange, onFormReady, }: SectionsContainerProps) => import("react/jsx-runtime").JSX.Element;
27
47
  //# sourceMappingURL=SectionsContainer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SectionsContainer.d.ts","sourceRoot":"","sources":["../../src/components/SectionsContainer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAmB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,UAAU,CAAC,EAAE,oBAAoB,CAAC,YAAY,CAAC,CAAC;IAChD,aAAa,CAAC,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClE,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;CAErE;AA4ED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,6JAU/B,sBAAsB,4CAsHxB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pE,wHAAwH;IACxH,oBAAoB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrE,0JAA0J;IAC1J,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CACpD;AA4ED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,GAAI,yMAa/B,sBAAsB,4CAgRxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useBaseWidget.d.ts","sourceRoot":"","sources":["../../src/hooks/useBaseWidget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAetE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACxD;AAMD,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB;;;;;;;;;yBAwI5C,GAAG,aAAY,OAAO;;uBA0Qd,MAAM,EAAE;;;;;;;0BAtKpB,MAAM;;;CA2KhB,CAAC"}
1
+ {"version":3,"file":"useBaseWidget.d.ts","sourceRoot":"","sources":["../../src/hooks/useBaseWidget.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAgBtE,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,gBAAgB,CAAC;IACzB,wBAAwB,CAAC,EAAE,wBAAwB,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjC,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACxD;AAMD,eAAO,MAAM,aAAa,GAAI,SAAS,oBAAoB;;;;;;;;;yBA4I5C,GAAG,aAAY,OAAO;;uBA0Qd,MAAM,EAAE;;;;;;;0BAtKpB,MAAM;;;CA2KhB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -504,7 +504,21 @@ interface PanelRendererProps {
504
504
  */
505
505
  declare const PanelRenderer: ({ panel, dataSourceRequestHandler, schemaData, onValueChange, isEditMode, }: PanelRendererProps) => react_jsx_runtime.JSX.Element;
506
506
 
507
- type SectionMode = 'RegistryView' | 'CRView';
507
+ type SectionMode = 'RegistryView' | 'CRView' | 'IntakeForm';
508
+ /** Form controls passed to host via onFormReady. Allows host to validate and get all section data (e.g. on Submit). */
509
+ interface SectionsFormHandle {
510
+ /** Validate all sections. Returns true if valid, false otherwise. */
511
+ validate(): Promise<boolean>;
512
+ /** Get raw form data from store for all sections (no validation). */
513
+ getFormData(): Record<string, unknown>;
514
+ /** Validate all sections. If valid, returns SectionChanges[]; if invalid, throws. */
515
+ validateAndGetData(): Promise<SectionChanges[]>;
516
+ /**
517
+ * Used for form save-draft functionality.
518
+ * Retrieves record and file changes without validation.
519
+ */
520
+ getStructuredData(): SectionChanges[];
521
+ }
508
522
  interface SectionsContainerProps {
509
523
  sections: SectionConfig[];
510
524
  dataSourceRequestHandler?: DataSourceRequestHandler;
@@ -514,7 +528,13 @@ interface SectionsContainerProps {
514
528
  onSectionSave?: (changes: SectionChanges) => Promise<void> | void;
515
529
  hideEditButton?: boolean;
516
530
  mode?: SectionMode;
531
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
532
+ isDraft?: boolean;
517
533
  namespace?: string | ((sectionId: string, index: number) => string);
534
+ /** Called when a section's dirty (has unsaved changes) status changes. Only fires while the section is in edit mode. */
535
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
536
+ /** Called when the form is ready. Passes form controls (validate, getFormData, validateAndGetData) so the host can trigger submit from its own button. */
537
+ onFormReady?: (handle: SectionsFormHandle) => void;
518
538
  }
519
539
  /**
520
540
  * Container component that renders multiple sections
@@ -526,10 +546,11 @@ interface SectionsContainerProps {
526
546
  * - All sections align to the same grid, ensuring right-side alignment
527
547
  * - Handles nested structure: multiple horizontal panels, each with multiple vertical panels
528
548
  */
529
- declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, namespace, }: SectionsContainerProps) => react_jsx_runtime.JSX.Element;
549
+ declare const SectionsContainer: ({ sections, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, className, onSectionSave, hideEditButton, mode, isDraft, namespace, onSectionDirtyChange, onFormReady, }: SectionsContainerProps) => react_jsx_runtime.JSX.Element;
530
550
 
531
551
  interface SectionChanges {
532
- section_id: string;
552
+ section_id?: string;
553
+ section_register_id?: string;
533
554
  records: unknown[];
534
555
  files?: unknown[];
535
556
  }
@@ -545,6 +566,24 @@ interface SectionRendererProps {
545
566
  namespace?: string;
546
567
  changeRequestType?: 'new' | 'old';
547
568
  showChangeRequestLabel?: boolean;
569
+ dbSectionId?: string;
570
+ sectionRegisterId?: string;
571
+ /** Called when the section's dirty (has unsaved changes) status changes. Only fires while in edit mode. */
572
+ onSectionDirtyChange?: (sectionId: string, isDirty: boolean) => void;
573
+ /** IntakeForm mode: 0-based index of this section within the form */
574
+ sectionIndex?: number;
575
+ /** IntakeForm mode: total number of sections in the form */
576
+ sectionCount?: number;
577
+ /** IntakeForm mode: index of the currently expanded section (null = all collapsed) */
578
+ expandedSectionIndex?: number | null;
579
+ /** IntakeForm mode: called when user requests to expand a section (e.g. clicks accordion header) */
580
+ onExpandSection?: (index: number) => void;
581
+ /** IntakeForm mode: called when section save completes successfully (collapse current, expand next) */
582
+ onSectionSaveSuccess?: (index: number) => void;
583
+ /** IntakeForm mode: called when user clicks Previous (collapse current, expand previous) */
584
+ onPreviousSection?: (index: number) => void;
585
+ /** IntakeForm mode: when true or undefined, sections are editable; when false, sections are readonly */
586
+ isDraft?: boolean;
548
587
  }
549
588
  /**
550
589
  * Renders a section with its panels
@@ -554,7 +593,7 @@ interface SectionRendererProps {
554
593
  * - Panels wrap when they exceed available width
555
594
  * - Sections can sit side-by-side if there's space
556
595
  */
557
- declare const SectionRenderer: ({ section, dataSourceRequestHandler: propDataSourceRequestHandler, schemaData, onValueChange, gridColumnSpan, onSectionSave, hideEditButton, mode, namespace, changeRequestType, showChangeRequestLabel, }: SectionRendererProps) => react_jsx_runtime.JSX.Element;
596
+ 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, }: SectionRendererProps) => react_jsx_runtime.JSX.Element;
558
597
 
559
598
  interface SectionBuilderProps {
560
599
  initialSection?: SectionConfig;
@@ -1537,4 +1576,4 @@ declare const translatePanelConfig: (panel: PanelConfig, translate: (key: string
1537
1576
  declare const translateUISchema: (schema: UISchema, translate: (key: string, options?: any) => string) => UISchema;
1538
1577
 
1539
1578
  export { ArrayWidget, BooleanWidget, CheckboxWidget, CurrencyInputWidget, DateInputWidget, DateTimeInputWidget, DisplayWidget, FileInputWidget, IterableAccordionWidget, JSONEditorPanel, NumberInputWidget, PanelRenderer, PhoneInputWidget, ProfileWidget, PropertyEditor, RadioWidget, SectionBuilder, SectionRenderer, SectionTree, SectionsContainer, SelectWidget, SimpleTableWidget, TableWidget, TextAreaWidget, TextInputWidget, VisualBuilderPanel, WidgetEventBus, WidgetProvider, WidgetRenderer, applyCaseControl, applyDecimalPrecision, applyMask, createWidgetStore, createZodSchema, evaluateCondition, filterByCharacterType, formatCurrency, formatDate, formatNumber, formatPhone, formatValue, geoHierarchyBuilder, getApiDataSource, getFormattedNumberLength, getSchemaDataSource, getStaticDataSource, getValueByPath, getWidgetValue, initI18n, isAllowedKey, parseDataPath, parseNumber, registerDefaultWidgets, removeMask, resetAll, resetWidget, setDataSource, setError, setLoading, setTouched, setValue, setValueByPath, setValues, setWidgetValue, shouldEnableWidget, shouldShowWidget, transformDataSourceOptions, translatePanelConfig, translateUISchema, translateWidgetConfig, useBaseWidget, useGeoWidgetCascade, useWidgetCascade, useWidgetContext, useWidgetEventBus, useWidgetTranslation, validateNumericValue, validateWidget, widgetRegistry };
1540
- export type { ApiAdapter, ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType, GeoLevelData, InputMask, NumericType, PanelConfig, RoundingMode, SchemaDataSource, SectionBuilderProps, SectionChanges, SectionConfig, SectionMode, SectionsContainerProps, StaticDataSource, SupportingDocumentConfig, TextAlign, TreeNode, TreeNodeType, UISchema, UseBaseWidgetOptions, ValidationType, WidgetCascadeConfig, WidgetCondition, WidgetContextValue, WidgetDataPath, WidgetDispatch, WidgetEvent, WidgetEventType, WidgetFormat, WidgetGeoConfig, WidgetOptions, WidgetRegistryEntry, WidgetRenderFunction, WidgetRootState, WidgetState, WidgetStore, WidgetValidation, WidgetValue };
1579
+ export type { ApiAdapter, ApiDataSource, BaseWidgetConfig, BooleanControlType, BooleanRepresentation, CaseControl, CharacterType, ConditionOperator, DataSource, DataSourceRequestHandler, DataSourceType, GeoLevelData, InputMask, NumericType, PanelConfig, RoundingMode, SchemaDataSource, SectionBuilderProps, SectionChanges, SectionConfig, SectionMode, SectionRendererProps, SectionsContainerProps, SectionsFormHandle, StaticDataSource, SupportingDocumentConfig, TextAlign, TreeNode, TreeNodeType, UISchema, UseBaseWidgetOptions, ValidationType, WidgetCascadeConfig, WidgetCondition, WidgetContextValue, WidgetDataPath, WidgetDispatch, WidgetEvent, WidgetEventType, WidgetFormat, WidgetGeoConfig, WidgetOptions, WidgetRegistryEntry, WidgetRenderFunction, WidgetRootState, WidgetState, WidgetStore, WidgetValidation, WidgetValue };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC5E,cAAc,qBAAqB,CAAC;AAGpC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAG1F,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6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