bank20baht-ui 0.1.3 → 0.1.5

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.
@@ -28,6 +28,8 @@ export declare class BahtForm extends BahtElement {
28
28
  * if they were never in the schema: no render, no validation, no payload.
29
29
  */
30
30
  flags: FeatureFlags;
31
+ /** Force every field readonly — a display-only render of this form's own layout/widths. */
32
+ readonly: boolean;
31
33
  /** Edits the user made since the host last set `value` (controlled overlay). */
32
34
  private edits;
33
35
  private errors;
@@ -25,6 +25,8 @@ export declare class BahtWorkflow extends BahtElement {
25
25
  flags: FeatureFlags;
26
26
  /** Render a <baht-steps> progress indicator above the current form. */
27
27
  showSteps: boolean;
28
+ /** 'default' horizontal markers, or 'sidebar' vertical nav list — forwarded to <baht-steps>. */
29
+ stepsVariant: 'default' | 'sidebar';
28
30
  private data;
29
31
  private derived;
30
32
  private current;
@@ -66,8 +68,6 @@ export declare class BahtWorkflow extends BahtElement {
66
68
  private onFormChange;
67
69
  private onCommentInput;
68
70
  private emit;
69
- /** Human-readable value for the summary: option labels, Yes/No, em-dash for empty. */
70
- private displayValue;
71
71
  /** Forms the approval step summarizes: configured list, else every earlier plain form. */
72
72
  private summaryForms;
73
73
  private renderApproval;
@@ -6,15 +6,25 @@ import { BahtElement } from '../base.js';
6
6
  *
7
7
  * <baht-pagination page="4" total-pages="20"></baht-pagination>
8
8
  * <baht-pagination variant="compact" page="1" total-pages="3"></baht-pagination>
9
+ *
10
+ * `variant="cursor"` drops page numbers entirely — the host doesn't know a
11
+ * total, only whether another page exists in either direction:
12
+ *
13
+ * <baht-pagination variant="cursor" has-next has-prev></baht-pagination>
14
+ * el.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));
9
15
  */
10
16
  export declare class BahtPagination extends BahtElement {
11
17
  page: number;
12
18
  totalPages: number;
13
- /** 'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 » */
14
- variant: 'numbered' | 'compact';
19
+ /** 'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 · 'cursor' = « Prev / Next » */
20
+ variant: 'numbered' | 'compact' | 'cursor';
15
21
  /** Numbered pages shown on each side of the current page. */
16
22
  siblings: number;
23
+ /** cursor variant only — whether a next/previous page is available. */
24
+ hasNext: boolean;
25
+ hasPrev: boolean;
17
26
  private go;
27
+ private goCursor;
18
28
  /** Visible page numbers with `null` marking an ellipsis gap. */
19
29
  private get pageItems();
20
30
  protected render(): TemplateResult;
@@ -0,0 +1,13 @@
1
+ import { TemplateResult } from 'lit';
2
+ import { BahtElement } from '../base.js';
3
+ import { FieldDescriptor } from '../../core/types.js';
4
+ /** Section divider (`type: "section"`): heading + rule, no value, no emits. */
5
+ export declare class BahtSection extends BahtElement {
6
+ field: FieldDescriptor;
7
+ protected render(): TemplateResult;
8
+ }
9
+ declare global {
10
+ interface HTMLElementTagNameMap {
11
+ 'baht-section': BahtSection;
12
+ }
13
+ }
@@ -11,6 +11,8 @@ export declare class BahtSteps extends BahtElement {
11
11
  steps: string[];
12
12
  /** 0-based index of the current step. */
13
13
  current: number;
14
+ /** 'default' = horizontal numbered markers; 'sidebar' = vertical nav list, current pilled. */
15
+ variant: 'default' | 'sidebar';
14
16
  protected render(): TemplateResult;
15
17
  }
16
18
  declare global {
@@ -13,6 +13,13 @@ export type CellRenderer = (value: unknown, row: Record<string, unknown>) => unk
13
13
  * t.loading = false; t.page = 1; t.totalPages = 12;
14
14
  * t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));
15
15
  * t.addEventListener('baht-row-click', (e) => open(e.detail.id));
16
+ *
17
+ * Set `cursor-mode` for cursor-based APIs (no total count) — the footer
18
+ * becomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host
19
+ * listens for `baht-cursor-change` instead of `baht-page-change`:
20
+ *
21
+ * t.cursorMode = true; t.hasNext = true; t.hasPrev = false;
22
+ * t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));
16
23
  */
17
24
  export declare class BahtTable extends BahtElement {
18
25
  /** Rows of the CURRENT page. */
@@ -35,6 +42,10 @@ export declare class BahtTable extends BahtElement {
35
42
  renderers: Record<string, CellRenderer>;
36
43
  page: number;
37
44
  totalPages: number;
45
+ /** Switch the footer to Prev/Next (cursor-based API, no total count). */
46
+ cursorMode: boolean;
47
+ hasNext: boolean;
48
+ hasPrev: boolean;
38
49
  private get columnKeys();
39
50
  private labelFor;
40
51
  private emitRow;
@@ -33,6 +33,7 @@ export { BahtToggle } from './baht-toggle.js';
33
33
  export { BahtDatepicker } from './baht-datepicker.js';
34
34
  export { BahtFile } from './baht-file.js';
35
35
  export { BahtText } from './baht-text.js';
36
+ export { BahtSection } from './baht-section.js';
36
37
  export { BahtStatChart } from './baht-stat-chart.js';
37
38
  export { BahtDonutChart } from './baht-donut-chart.js';
38
39
  export { BahtBarChart } from './baht-bar-chart.js';
@@ -1,5 +1,5 @@
1
1
  /** Control types supported by v1 (spec 01 §2). */
2
- export type FieldType = 'text' | 'textarea' | 'number' | 'email' | 'dropdown' | 'multiselect' | 'checkbox' | 'radio' | 'toggle' | 'date' | 'file' | 'label' | 'repeater';
2
+ export type FieldType = 'text' | 'textarea' | 'number' | 'email' | 'dropdown' | 'multiselect' | 'checkbox' | 'radio' | 'toggle' | 'date' | 'file' | 'label' | 'section' | 'repeater';
3
3
  export type FieldWidth = '1/4' | '1/2' | '3/4' | 'full';
4
4
  export interface FieldOption {
5
5
  key: string;
@@ -33,6 +33,7 @@ export interface FieldDescriptor {
33
33
  width?: FieldWidth;
34
34
  value?: unknown;
35
35
  disabled?: boolean;
36
+ readonly?: boolean;
36
37
  required?: boolean;
37
38
  options?: FieldOption[];
38
39
  /** Registry name resolving this field's options from current form data. */
@@ -69,6 +69,16 @@
69
69
  "default": "{}",
70
70
  "description": "Feature-flag values (spec 01 §12) — fields whose `flag` is off behave as\nif they were never in the schema: no render, no validation, no payload."
71
71
  },
72
+ {
73
+ "kind": "field",
74
+ "name": "readonly",
75
+ "type": {
76
+ "text": "boolean"
77
+ },
78
+ "default": "false",
79
+ "description": "Force every field readonly — a display-only render of this form's own layout/widths.",
80
+ "attribute": "readonly"
81
+ },
72
82
  {
73
83
  "kind": "field",
74
84
  "name": "edits",
@@ -362,6 +372,15 @@
362
372
  },
363
373
  "description": "Name of a view from `form.views`. Display-only: when set, only that view's\nfields are rendered and validated (the user can only fix what they see),\nbut getData() still returns the FULL form — the server always validates\nthe complete schema, views never change the submit payload.",
364
374
  "fieldName": "view"
375
+ },
376
+ {
377
+ "name": "readonly",
378
+ "type": {
379
+ "text": "boolean"
380
+ },
381
+ "default": "false",
382
+ "description": "Force every field readonly — a display-only render of this form's own layout/widths.",
383
+ "fieldName": "readonly"
365
384
  }
366
385
  ],
367
386
  "superclass": {
@@ -493,6 +512,16 @@
493
512
  "description": "Render a <baht-steps> progress indicator above the current form.",
494
513
  "attribute": "show-steps"
495
514
  },
515
+ {
516
+ "kind": "field",
517
+ "name": "stepsVariant",
518
+ "type": {
519
+ "text": "'default' | 'sidebar'"
520
+ },
521
+ "default": "'default'",
522
+ "description": "'default' horizontal markers, or 'sidebar' vertical nav list — forwarded to <baht-steps>.",
523
+ "attribute": "steps-variant"
524
+ },
496
525
  {
497
526
  "kind": "field",
498
527
  "name": "data",
@@ -843,31 +872,6 @@
843
872
  }
844
873
  ]
845
874
  },
846
- {
847
- "kind": "method",
848
- "name": "displayValue",
849
- "privacy": "private",
850
- "return": {
851
- "type": {
852
- "text": "string"
853
- }
854
- },
855
- "parameters": [
856
- {
857
- "name": "fd",
858
- "type": {
859
- "text": "FieldDescriptor"
860
- }
861
- },
862
- {
863
- "name": "value",
864
- "type": {
865
- "text": "unknown"
866
- }
867
- }
868
- ],
869
- "description": "Human-readable value for the summary: option labels, Yes/No, em-dash for empty."
870
- },
871
875
  {
872
876
  "kind": "method",
873
877
  "name": "summaryForms",
@@ -961,6 +965,15 @@
961
965
  "default": "false",
962
966
  "description": "Render a <baht-steps> progress indicator above the current form.",
963
967
  "fieldName": "showSteps"
968
+ },
969
+ {
970
+ "name": "steps-variant",
971
+ "type": {
972
+ "text": "'default' | 'sidebar'"
973
+ },
974
+ "default": "'default'",
975
+ "description": "'default' horizontal markers, or 'sidebar' vertical nav list — forwarded to <baht-steps>.",
976
+ "fieldName": "stepsVariant"
964
977
  }
965
978
  ],
966
979
  "superclass": {
@@ -5718,7 +5731,7 @@
5718
5731
  "declarations": [
5719
5732
  {
5720
5733
  "kind": "class",
5721
- "description": "Server-side pagination control: it never slices data — it only reports the\npage the user asked for via `baht-page-change`; the host fetches that page.\n\n <baht-pagination page=\"4\" total-pages=\"20\"></baht-pagination>\n <baht-pagination variant=\"compact\" page=\"1\" total-pages=\"3\"></baht-pagination>",
5734
+ "description": "Server-side pagination control: it never slices data — it only reports the\npage the user asked for via `baht-page-change`; the host fetches that page.\n\n <baht-pagination page=\"4\" total-pages=\"20\"></baht-pagination>\n <baht-pagination variant=\"compact\" page=\"1\" total-pages=\"3\"></baht-pagination>\n\n`variant=\"cursor\"` drops page numbers entirely — the host doesn't know a\ntotal, only whether another page exists in either direction:\n\n <baht-pagination variant=\"cursor\" has-next has-prev></baht-pagination>\n el.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));",
5722
5735
  "name": "BahtPagination",
5723
5736
  "members": [
5724
5737
  {
@@ -5743,10 +5756,10 @@
5743
5756
  "kind": "field",
5744
5757
  "name": "variant",
5745
5758
  "type": {
5746
- "text": "'numbered' | 'compact'"
5759
+ "text": "'numbered' | 'compact' | 'cursor'"
5747
5760
  },
5748
5761
  "default": "'numbered'",
5749
- "description": "'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 »",
5762
+ "description": "'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 · 'cursor' = « Prev / Next »",
5750
5763
  "attribute": "variant"
5751
5764
  },
5752
5765
  {
@@ -5759,6 +5772,25 @@
5759
5772
  "description": "Numbered pages shown on each side of the current page.",
5760
5773
  "attribute": "siblings"
5761
5774
  },
5775
+ {
5776
+ "kind": "field",
5777
+ "name": "hasNext",
5778
+ "type": {
5779
+ "text": "boolean"
5780
+ },
5781
+ "default": "false",
5782
+ "description": "cursor variant only — whether a next/previous page is available.",
5783
+ "attribute": "has-next"
5784
+ },
5785
+ {
5786
+ "kind": "field",
5787
+ "name": "hasPrev",
5788
+ "type": {
5789
+ "text": "boolean"
5790
+ },
5791
+ "default": "false",
5792
+ "attribute": "has-prev"
5793
+ },
5762
5794
  {
5763
5795
  "kind": "method",
5764
5796
  "name": "go",
@@ -5777,6 +5809,24 @@
5777
5809
  }
5778
5810
  ]
5779
5811
  },
5812
+ {
5813
+ "kind": "method",
5814
+ "name": "goCursor",
5815
+ "privacy": "private",
5816
+ "return": {
5817
+ "type": {
5818
+ "text": "void"
5819
+ }
5820
+ },
5821
+ "parameters": [
5822
+ {
5823
+ "name": "direction",
5824
+ "type": {
5825
+ "text": "'next' | 'prev'"
5826
+ }
5827
+ }
5828
+ ]
5829
+ },
5780
5830
  {
5781
5831
  "kind": "field",
5782
5832
  "name": "pageItems",
@@ -5794,6 +5844,12 @@
5794
5844
  "type": {
5795
5845
  "text": "CustomEvent"
5796
5846
  }
5847
+ },
5848
+ {
5849
+ "name": "baht-cursor-change",
5850
+ "type": {
5851
+ "text": "CustomEvent"
5852
+ }
5797
5853
  }
5798
5854
  ],
5799
5855
  "attributes": [
@@ -5816,10 +5872,10 @@
5816
5872
  {
5817
5873
  "name": "variant",
5818
5874
  "type": {
5819
- "text": "'numbered' | 'compact'"
5875
+ "text": "'numbered' | 'compact' | 'cursor'"
5820
5876
  },
5821
5877
  "default": "'numbered'",
5822
- "description": "'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 »",
5878
+ "description": "'numbered' = 1 … 4 5 6 … 20 · 'compact' = « Page 4 of 20 · 'cursor' = « Prev / Next »",
5823
5879
  "fieldName": "variant"
5824
5880
  },
5825
5881
  {
@@ -5830,6 +5886,23 @@
5830
5886
  "default": "1",
5831
5887
  "description": "Numbered pages shown on each side of the current page.",
5832
5888
  "fieldName": "siblings"
5889
+ },
5890
+ {
5891
+ "name": "has-next",
5892
+ "type": {
5893
+ "text": "boolean"
5894
+ },
5895
+ "default": "false",
5896
+ "description": "cursor variant only — whether a next/previous page is available.",
5897
+ "fieldName": "hasNext"
5898
+ },
5899
+ {
5900
+ "name": "has-prev",
5901
+ "type": {
5902
+ "text": "boolean"
5903
+ },
5904
+ "default": "false",
5905
+ "fieldName": "hasPrev"
5833
5906
  }
5834
5907
  ],
5835
5908
  "superclass": {
@@ -7577,6 +7650,50 @@
7577
7650
  }
7578
7651
  ]
7579
7652
  },
7653
+ {
7654
+ "kind": "javascript-module",
7655
+ "path": "src/components/primitives/baht-section.ts",
7656
+ "declarations": [
7657
+ {
7658
+ "kind": "class",
7659
+ "description": "Section divider (`type: \"section\"`): heading + rule, no value, no emits.",
7660
+ "name": "BahtSection",
7661
+ "members": [
7662
+ {
7663
+ "kind": "field",
7664
+ "name": "field",
7665
+ "type": {
7666
+ "text": "FieldDescriptor"
7667
+ }
7668
+ }
7669
+ ],
7670
+ "superclass": {
7671
+ "name": "BahtElement",
7672
+ "module": "/src/components/base.js"
7673
+ },
7674
+ "tagName": "baht-section",
7675
+ "customElement": true
7676
+ }
7677
+ ],
7678
+ "exports": [
7679
+ {
7680
+ "kind": "js",
7681
+ "name": "BahtSection",
7682
+ "declaration": {
7683
+ "name": "BahtSection",
7684
+ "module": "src/components/primitives/baht-section.ts"
7685
+ }
7686
+ },
7687
+ {
7688
+ "kind": "custom-element-definition",
7689
+ "name": "baht-section",
7690
+ "declaration": {
7691
+ "name": "BahtSection",
7692
+ "module": "src/components/primitives/baht-section.ts"
7693
+ }
7694
+ }
7695
+ ]
7696
+ },
7580
7697
  {
7581
7698
  "kind": "javascript-module",
7582
7699
  "path": "src/components/primitives/baht-select.ts",
@@ -8166,6 +8283,16 @@
8166
8283
  "default": "0",
8167
8284
  "description": "0-based index of the current step.",
8168
8285
  "attribute": "current"
8286
+ },
8287
+ {
8288
+ "kind": "field",
8289
+ "name": "variant",
8290
+ "type": {
8291
+ "text": "'default' | 'sidebar'"
8292
+ },
8293
+ "default": "'default'",
8294
+ "description": "'default' = horizontal numbered markers; 'sidebar' = vertical nav list, current pilled.",
8295
+ "attribute": "variant"
8169
8296
  }
8170
8297
  ],
8171
8298
  "attributes": [
@@ -8177,6 +8304,15 @@
8177
8304
  "default": "0",
8178
8305
  "description": "0-based index of the current step.",
8179
8306
  "fieldName": "current"
8307
+ },
8308
+ {
8309
+ "name": "variant",
8310
+ "type": {
8311
+ "text": "'default' | 'sidebar'"
8312
+ },
8313
+ "default": "'default'",
8314
+ "description": "'default' = horizontal numbered markers; 'sidebar' = vertical nav list, current pilled.",
8315
+ "fieldName": "variant"
8180
8316
  }
8181
8317
  ],
8182
8318
  "superclass": {
@@ -8212,7 +8348,7 @@
8212
8348
  "declarations": [
8213
8349
  {
8214
8350
  "kind": "class",
8215
- "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));",
8351
+ "description": "Server-side data table. `items` is ONE page of rows — the component never\nslices or fetches; on `baht-page-change` the host fetches the next page and\nre-feeds `items`/`page`. While that fetch runs, set `loading` to show\nskeleton rows.\n\n const t = document.querySelector('baht-table');\n t.columns = { name: 'Name', created_at: 'Created' };\n t.items = pageRows; // current page only\n t.loading = false; t.page = 1; t.totalPages = 12;\n t.addEventListener('baht-page-change', (e) => fetchPage(e.detail.page));\n t.addEventListener('baht-row-click', (e) => open(e.detail.id));\n\nSet `cursor-mode` for cursor-based APIs (no total count) — the footer\nbecomes a Prev/Next pair gated by `has-next`/`has-prev`, and the host\nlistens for `baht-cursor-change` instead of `baht-page-change`:\n\n t.cursorMode = true; t.hasNext = true; t.hasPrev = false;\n t.addEventListener('baht-cursor-change', (e) => fetchPage(e.detail.direction));",
8216
8352
  "name": "BahtTable",
8217
8353
  "members": [
8218
8354
  {
@@ -8344,6 +8480,34 @@
8344
8480
  "default": "1",
8345
8481
  "attribute": "total-pages"
8346
8482
  },
8483
+ {
8484
+ "kind": "field",
8485
+ "name": "cursorMode",
8486
+ "type": {
8487
+ "text": "boolean"
8488
+ },
8489
+ "default": "false",
8490
+ "description": "Switch the footer to Prev/Next (cursor-based API, no total count).",
8491
+ "attribute": "cursor-mode"
8492
+ },
8493
+ {
8494
+ "kind": "field",
8495
+ "name": "hasNext",
8496
+ "type": {
8497
+ "text": "boolean"
8498
+ },
8499
+ "default": "false",
8500
+ "attribute": "has-next"
8501
+ },
8502
+ {
8503
+ "kind": "field",
8504
+ "name": "hasPrev",
8505
+ "type": {
8506
+ "text": "boolean"
8507
+ },
8508
+ "default": "false",
8509
+ "attribute": "has-prev"
8510
+ },
8347
8511
  {
8348
8512
  "kind": "field",
8349
8513
  "name": "columnKeys",
@@ -8537,6 +8701,31 @@
8537
8701
  },
8538
8702
  "default": "1",
8539
8703
  "fieldName": "totalPages"
8704
+ },
8705
+ {
8706
+ "name": "cursor-mode",
8707
+ "type": {
8708
+ "text": "boolean"
8709
+ },
8710
+ "default": "false",
8711
+ "description": "Switch the footer to Prev/Next (cursor-based API, no total count).",
8712
+ "fieldName": "cursorMode"
8713
+ },
8714
+ {
8715
+ "name": "has-next",
8716
+ "type": {
8717
+ "text": "boolean"
8718
+ },
8719
+ "default": "false",
8720
+ "fieldName": "hasNext"
8721
+ },
8722
+ {
8723
+ "name": "has-prev",
8724
+ "type": {
8725
+ "text": "boolean"
8726
+ },
8727
+ "default": "false",
8728
+ "fieldName": "hasPrev"
8540
8729
  }
8541
8730
  ],
8542
8731
  "superclass": {
@@ -9973,6 +10162,14 @@
9973
10162
  "module": "./baht-text.js"
9974
10163
  }
9975
10164
  },
10165
+ {
10166
+ "kind": "js",
10167
+ "name": "BahtSection",
10168
+ "declaration": {
10169
+ "name": "BahtSection",
10170
+ "module": "./baht-section.js"
10171
+ }
10172
+ },
9976
10173
  {
9977
10174
  "kind": "js",
9978
10175
  "name": "BahtStatChart",
@@ -10089,7 +10286,7 @@
10089
10286
  "type": {
10090
10287
  "text": "Record<FieldType, string>"
10091
10288
  },
10092
- "default": "{ text: 'baht-input', email: 'baht-input', textarea: 'baht-textarea', number: 'baht-number', dropdown: 'baht-select', multiselect: 'baht-multiselect', checkbox: 'baht-checkbox', radio: 'baht-radio', toggle: 'baht-toggle', date: 'baht-datepicker', file: 'baht-file', label: 'baht-text', repeater: 'baht-repeater', }",
10289
+ "default": "{ text: 'baht-input', email: 'baht-input', textarea: 'baht-textarea', number: 'baht-number', dropdown: 'baht-select', multiselect: 'baht-multiselect', checkbox: 'baht-checkbox', radio: 'baht-radio', toggle: 'baht-toggle', date: 'baht-datepicker', file: 'baht-file', label: 'baht-text', section: 'baht-section', repeater: 'baht-repeater', }",
10093
10290
  "description": "field descriptor `type` -> primitive tag (used by <baht-form>, <baht-repeater>\nand the builder). Lives in its own module so baht-repeater can read it\nwithout importing the primitives barrel (which would be circular)."
10094
10291
  }
10095
10292
  ],
package/dist/engine.js CHANGED
@@ -10,6 +10,7 @@ function S(e) {
10
10
  case "file":
11
11
  return e.multiple ? [] : null;
12
12
  case "label":
13
+ case "section":
13
14
  return;
14
15
  // static block, no value
15
16
  default:
@@ -282,11 +283,11 @@ function ee(e, t, n) {
282
283
  return o.forEach((i, u) => {
283
284
  const d = i !== null && typeof i == "object" && !Array.isArray(i) ? i : {}, p = {};
284
285
  for (const a of s)
285
- a.type === "label" || a.type === "repeater" || (p[a.key] = Object.hasOwn(d, a.key) ? d[a.key] : S(a));
286
+ a.type === "label" || a.type === "section" || a.type === "repeater" || (p[a.key] = Object.hasOwn(d, a.key) ? d[a.key] : S(a));
286
287
  for (const a of s)
287
- if (!(a.type === "label" || a.type === "repeater"))
288
- for (const h of X(a, p[a.key], n, p))
289
- r.push({ key: `${e.key}[${u}].${h.key}`, message: h.message });
288
+ if (!(a.type === "label" || a.type === "section" || a.type === "repeater"))
289
+ for (const y of X(a, p[a.key], n, p))
290
+ r.push({ key: `${e.key}[${u}].${y.key}`, message: y.message });
290
291
  }), r;
291
292
  }
292
293
  function ce(e, t) {
@@ -401,9 +402,9 @@ function oe(e, t) {
401
402
  continue;
402
403
  }
403
404
  r.push(a.formName);
404
- const h = {}, v = V(t, a.formName);
405
+ const y = {}, v = V(t, a.formName);
405
406
  for (const f of [...a.field_data, ...P(a)]) {
406
- if (f.type === "label") continue;
407
+ if (f.type === "label" || f.type === "section") continue;
407
408
  if (_.has(f.key)) {
408
409
  n.push({
409
410
  ref: `${a.formName}.${f.key}`,
@@ -414,35 +415,35 @@ function oe(e, t) {
414
415
  }
415
416
  o.set(`${a.formName}.${f.key}`, f);
416
417
  const l = V(v, f.key);
417
- h[f.key] = l !== void 0 ? l : S(f);
418
+ y[f.key] = l !== void 0 ? l : S(f);
418
419
  }
419
- s[a.formName] = h;
420
+ s[a.formName] = y;
420
421
  }
421
422
  let i = {}, u = {}, d = !1;
422
423
  for (let a = 0; a < M; a++) {
423
424
  i = {}, u = {};
424
425
  for (const l of r) u[l] = { visible: !0 };
425
- for (const [l, y] of o)
426
+ for (const [l, h] of o)
426
427
  i[l] = {
427
428
  visible: !0,
428
- enabled: !y.disabled,
429
- readonly: !1,
430
- required: !!y.required,
429
+ enabled: !h.disabled,
430
+ readonly: !!h.readonly,
431
+ required: !!h.required,
431
432
  computed: !1
432
433
  };
433
- const h = /* @__PURE__ */ new Map();
434
- e.rules.forEach((l, y) => {
434
+ const y = /* @__PURE__ */ new Map();
435
+ e.rules.forEach((l, h) => {
435
436
  const c = w(l.when, s) ? l.then : l.else;
436
437
  if (!c) return;
437
438
  const N = l.priority ?? 0;
438
439
  for (const g of c) {
439
- const b = se(g), A = h.get(b) ?? [];
440
- A.push({ action: g, priority: N, index: y }), h.set(b, A);
440
+ const b = se(g), A = y.get(b) ?? [];
441
+ A.push({ action: g, priority: N, index: h }), y.set(b, A);
441
442
  }
442
443
  });
443
444
  const v = [];
444
- for (const [l, y] of h) {
445
- const c = re(y);
445
+ for (const [l, h] of y) {
446
+ const c = re(h);
446
447
  if (!c) continue;
447
448
  if (c.action === "setValue") {
448
449
  v.push({ ref: `${c.target.form}.${c.target.field}`, action: c });
@@ -492,17 +493,17 @@ function oe(e, t) {
492
493
  }
493
494
  const f = {};
494
495
  for (const l of r) f[l] = { ...s[l] };
495
- for (const [l, y] of o) {
496
+ for (const [l, h] of o) {
496
497
  const [c, N] = C(l);
497
- (!u[c].visible || !i[l].visible) && (f[c][N] = S(y));
498
+ (!u[c].visible || !i[l].visible) && (f[c][N] = S(h));
498
499
  }
499
- for (const { ref: l, action: y } of v) {
500
+ for (const { ref: l, action: h } of v) {
500
501
  const [c, N] = C(l), g = i[l];
501
502
  if (!g) {
502
503
  n.push({ ref: l, message: "setValue targets unknown field", kind: "schema" });
503
504
  continue;
504
505
  }
505
- !u[c].visible || !g.visible || (f[c][N] = ne(y.value, f), y.lock !== !1 && (g.readonly = !0, g.computed = !0));
506
+ !u[c].visible || !g.visible || (f[c][N] = ne(h.value, f), h.lock !== !1 && (g.readonly = !0, g.computed = !0));
506
507
  }
507
508
  if (E(f, s)) {
508
509
  d = !0, s = f;
@@ -518,10 +519,10 @@ function oe(e, t) {
518
519
  const p = {};
519
520
  for (const a of r) {
520
521
  if (!u[a].visible) continue;
521
- const h = {};
522
+ const y = {};
522
523
  for (const [v, f] of Object.entries(s[a]))
523
- i[`${a}.${v}`].visible && (h[v] = f);
524
- p[a] = h;
524
+ i[`${a}.${v}`].visible && (y[v] = f);
525
+ p[a] = y;
525
526
  }
526
527
  return { data: p, fields: i, forms: u, errors: n };
527
528
  }