@abgov/react-components 6.11.0-dev.13 → 6.11.0-dev.15

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/index.js CHANGED
@@ -12,7 +12,7 @@ var _PublicFormController_instances, updateObjectListState_fn, dispatchError_fn;
12
12
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
13
13
  const jsxRuntime = require("react/jsx-runtime");
14
14
  const react = require("react");
15
- const parseISO = require("./parseISO-Dj57mwuH.js");
15
+ const calendarDate = require("./calendar-date-IMhR_PA6.js");
16
16
  function GoabAccordion({
17
17
  open,
18
18
  onChange,
@@ -21,7 +21,7 @@ function GoabAccordion({
21
21
  ...rest
22
22
  }) {
23
23
  const ref = react.useRef(null);
24
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
24
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
25
25
  react.useEffect(() => {
26
26
  const element = ref.current;
27
27
  if (element && onChange) {
@@ -54,7 +54,7 @@ function GoabAppHeader({
54
54
  ...rest
55
55
  }) {
56
56
  const el = react.useRef(null);
57
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
57
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
58
58
  react.useEffect(() => {
59
59
  if (!el.current) {
60
60
  return;
@@ -85,7 +85,7 @@ function GoabAppHeaderMenu({
85
85
  children,
86
86
  ...rest
87
87
  }) {
88
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
88
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
89
89
  return /* @__PURE__ */ jsxRuntime.jsx("goa-app-header-menu", { ..._props, children });
90
90
  }
91
91
  function getIconValue(icon, iconType) {
@@ -95,7 +95,7 @@ function getIconValue(icon, iconType) {
95
95
  return iconType ? "true" : "false";
96
96
  }
97
97
  function GoabBadge({ icon, iconType, ...rest }) {
98
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
98
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
99
99
  return /* @__PURE__ */ jsxRuntime.jsx(
100
100
  "goa-badge",
101
101
  {
@@ -210,9 +210,9 @@ function GoabBlock({
210
210
  children,
211
211
  ...rest
212
212
  }) {
213
- const _props = parseISO.transformProps(
213
+ const _props = calendarDate.transformProps(
214
214
  { testid: testId, ...rest },
215
- parseISO.kebab
215
+ calendarDate.kebab
216
216
  );
217
217
  return /* @__PURE__ */ jsxRuntime.jsx("goa-block", { ..._props, children });
218
218
  }
@@ -225,7 +225,7 @@ function GoabButton({
225
225
  ...rest
226
226
  }) {
227
227
  const el = react.useRef(null);
228
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
228
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
229
229
  react.useEffect(() => {
230
230
  if (!el.current) {
231
231
  return;
@@ -258,7 +258,7 @@ function GoabButtonGroup({
258
258
  children,
259
259
  ...rest
260
260
  }) {
261
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
261
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
262
262
  return /* @__PURE__ */ jsxRuntime.jsx("goa-button-group", { ..._props, children });
263
263
  }
264
264
  function GoabCalendar({
@@ -269,7 +269,7 @@ function GoabCalendar({
269
269
  ...rest
270
270
  }) {
271
271
  const ref = react.useRef(null);
272
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
272
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
273
273
  react.useEffect(() => {
274
274
  if (!ref.current) {
275
275
  return;
@@ -305,9 +305,9 @@ const GoabCallout = ({
305
305
  children,
306
306
  ...rest
307
307
  }) => {
308
- const _props = parseISO.transformProps(
308
+ const _props = calendarDate.transformProps(
309
309
  { type, icontheme: iconTheme, size, arialive: ariaLive, ...rest },
310
- parseISO.lowercase
310
+ calendarDate.lowercase
311
311
  );
312
312
  return /* @__PURE__ */ jsxRuntime.jsx("goa-callout", { ..._props, children });
313
313
  };
@@ -325,7 +325,7 @@ function GoabCheckbox({
325
325
  ...rest
326
326
  }) {
327
327
  const el = react.useRef(null);
328
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
328
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
329
329
  react.useEffect(() => {
330
330
  if (!el.current) {
331
331
  return;
@@ -424,7 +424,7 @@ const GoabChip = ({
424
424
  ...rest
425
425
  }) => {
426
426
  const el = react.useRef(null);
427
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
427
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
428
428
  react.useEffect(() => {
429
429
  if (!el.current) return;
430
430
  if (!onClick) return;
@@ -474,7 +474,7 @@ function GoabContainer({
474
474
  children,
475
475
  ...rest
476
476
  }) {
477
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
477
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
478
478
  const headingContent = heading || title;
479
479
  return /* @__PURE__ */ jsxRuntime.jsxs("goa-container", { ..._props, children: [
480
480
  headingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "title", children: headingContent }),
@@ -498,1088 +498,966 @@ function GoabDataGrid({
498
498
  }
499
499
  );
500
500
  }
501
- function GoabDatePicker({
502
- value,
503
- error,
504
- min,
505
- max,
506
- disabled,
507
- relative,
508
- onChange,
509
- ...rest
510
- }) {
511
- const ref = react.useRef(null);
512
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
513
- react.useEffect(() => {
514
- if (value && typeof value !== "string") {
515
- console.warn("Using a `Date` type for value is deprecated. Instead use a string of the format `yyyy-mm-dd`");
516
- }
517
- }, []);
518
- react.useEffect(() => {
519
- if (!ref.current) {
520
- return;
521
- }
522
- const current = ref.current;
523
- const handleChange = (e) => {
524
- const detail = e.detail;
525
- onChange == null ? void 0 : onChange({ ...detail, event: e });
526
- };
527
- if (onChange) {
528
- current.addEventListener("_change", handleChange);
529
- }
530
- return () => {
531
- if (onChange) {
532
- current.removeEventListener("_change", handleChange);
533
- }
534
- };
535
- }, [onChange]);
536
- const formatValue = (val) => {
537
- if (!val) return "";
538
- if (val instanceof Date) {
539
- return val.toISOString();
540
- }
541
- return val;
542
- };
543
- return /* @__PURE__ */ jsxRuntime.jsx(
544
- "goa-date-picker",
545
- {
546
- ref,
547
- value: formatValue(value) || void 0,
548
- error: error ? "true" : void 0,
549
- disabled: disabled ? "true" : void 0,
550
- min: formatValue(min) || void 0,
551
- max: formatValue(max) || void 0,
552
- relative: relative ? "true" : void 0,
553
- ..._props
554
- }
555
- );
556
- }
557
- function GoabDetails({
558
- open,
559
- children,
560
- ...rest
561
- }) {
562
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
563
- return /* @__PURE__ */ jsxRuntime.jsx(
564
- "goa-details",
565
- {
566
- open: open ? "true" : void 0,
567
- ..._props,
568
- children
569
- }
501
+ function dispatch(el, eventName, detail, opts) {
502
+ if (!el) {
503
+ console.error("dispatch element is null");
504
+ return;
505
+ }
506
+ el.dispatchEvent(
507
+ new CustomEvent(eventName, {
508
+ composed: true,
509
+ bubbles: opts == null ? void 0 : opts.bubbles,
510
+ detail
511
+ })
570
512
  );
571
513
  }
572
- function GoabDivider(props) {
573
- return /* @__PURE__ */ jsxRuntime.jsx(
574
- "goa-divider",
575
- {
576
- mt: props.mt,
577
- mr: props.mr,
578
- mb: props.mb,
579
- ml: props.ml,
580
- testid: props.testId
581
- }
514
+ function relay(el, eventName, data, opts) {
515
+ if (!el) {
516
+ console.error("dispatch element is null");
517
+ return;
518
+ }
519
+ el.dispatchEvent(
520
+ new CustomEvent("msg", {
521
+ composed: true,
522
+ bubbles: opts == null ? void 0 : opts.bubbles,
523
+ detail: {
524
+ action: eventName,
525
+ data
526
+ }
527
+ })
582
528
  );
583
529
  }
584
- function GoabDrawer({
585
- position,
586
- open,
587
- heading,
588
- maxSize,
589
- testId,
590
- actions,
591
- children,
592
- onClose
593
- }) {
594
- const el = react.useRef(null);
595
- react.useEffect(() => {
596
- var _a;
597
- if (!(el == null ? void 0 : el.current) || !onClose) {
530
+ class PublicFormController {
531
+ constructor(type) {
532
+ __privateAdd(this, _PublicFormController_instances);
533
+ __publicField(this, "state");
534
+ __publicField(this, "_formData");
535
+ __publicField(this, "_formRef");
536
+ __publicField(this, "_isCompleting", false);
537
+ this.type = type;
538
+ }
539
+ // Obtain reference to the form element
540
+ init(e) {
541
+ if (this._formRef) {
542
+ console.warn("init: form element has already been set");
598
543
  return;
599
544
  }
600
- (_a = el.current) == null ? void 0 : _a.addEventListener("_close", onClose);
601
- return () => {
602
- var _a2;
603
- (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_close", onClose);
545
+ this._formRef = e.detail.el;
546
+ this.state = {
547
+ uuid: crypto.randomUUID(),
548
+ form: {},
549
+ history: [],
550
+ editting: "",
551
+ status: "not-started"
604
552
  };
605
- }, [el, onClose]);
606
- return /* @__PURE__ */ jsxRuntime.jsxs(
607
- "goa-drawer",
608
- {
609
- ref: el,
610
- position,
611
- open: open ? true : void 0,
612
- heading: typeof heading === "string" ? heading : void 0,
613
- maxsize: maxSize,
614
- testid: testId,
615
- children: [
616
- heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
617
- actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
618
- children
619
- ]
553
+ }
554
+ initList(e) {
555
+ this._formRef = e.detail.el;
556
+ this.state = [];
557
+ }
558
+ // Public method to allow for the initialization of the state
559
+ initState(state, callback) {
560
+ relay(this._formRef, "external::init:state", state);
561
+ if (typeof state === "string") {
562
+ this.state = JSON.parse(state);
563
+ } else if (!Array.isArray(state)) {
564
+ this.state = state;
565
+ }
566
+ if (callback) {
567
+ setTimeout(callback, 200);
620
568
  }
621
- );
622
- }
623
- function stringify(value) {
624
- if (typeof value === "undefined") {
625
- return "";
626
569
  }
627
- if (typeof value === "string") {
628
- return value;
570
+ updateListState(e) {
571
+ const detail = e.detail;
572
+ if (!Array.isArray(detail.data)) {
573
+ return;
574
+ }
575
+ this.state = detail.data;
629
576
  }
630
- return JSON.stringify(value);
631
- }
632
- function GoabDropdown({
633
- value,
634
- onChange,
635
- disabled,
636
- error,
637
- filterable,
638
- multiselect,
639
- native,
640
- relative,
641
- children,
642
- ...rest
643
- }) {
644
- const el = react.useRef(null);
645
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
646
- react.useEffect(() => {
647
- if (!el.current) {
577
+ updateObjectState(e) {
578
+ var _a, _b;
579
+ if (Array.isArray(this.state)) {
648
580
  return;
649
581
  }
650
- const current = el.current;
651
- const handler = (e) => {
652
- const detail = e.detail;
653
- onChange == null ? void 0 : onChange({ ...detail, event: e });
654
- };
655
- if (onChange) {
656
- current.addEventListener("_change", handler);
582
+ const detail = e.detail;
583
+ if (detail.type === "list") {
584
+ this.state = {
585
+ ...this.state,
586
+ form: { ...((_a = this.state) == null ? void 0 : _a.form) || {}, [detail.id]: detail.data }
587
+ };
588
+ } else {
589
+ this.state = {
590
+ ...this.state,
591
+ ...detail.data,
592
+ form: { ...((_b = this.state) == null ? void 0 : _b.form) || {}, ...detail.data.form },
593
+ history: detail.data.history
594
+ };
657
595
  }
658
- return () => {
659
- if (onChange) {
660
- current.removeEventListener("_change", handler);
661
- }
662
- };
663
- }, [el, onChange]);
664
- return /* @__PURE__ */ jsxRuntime.jsx(
665
- "goa-dropdown",
666
- {
667
- ref: el,
668
- value: stringify(value),
669
- disabled: disabled ? "true" : void 0,
670
- error: error ? "true" : void 0,
671
- filterable: filterable ? "true" : void 0,
672
- multiselect: multiselect ? "true" : void 0,
673
- native: native ? "true" : void 0,
674
- relative: relative ? "true" : void 0,
675
- ..._props,
676
- children
596
+ }
597
+ getStateList() {
598
+ if (!this.state) {
599
+ return [];
677
600
  }
678
- );
679
- }
680
- function GoabDropdownOption(props) {
681
- react.useEffect(() => {
682
- console.warn("GoabDropdownOption is deprecated. Please use GoabDropdownItem");
683
- }, []);
684
- return /* @__PURE__ */ jsxRuntime.jsx(GoabDropdownItem, { ...props });
685
- }
686
- function GoabDropdownItem({
687
- value,
688
- label,
689
- filter,
690
- name,
691
- mountType = "append"
692
- }) {
693
- return /* @__PURE__ */ jsxRuntime.jsx(
694
- "goa-dropdown-item",
695
- {
696
- value,
697
- label,
698
- filter,
699
- name,
700
- mount: mountType
601
+ if (!Array.isArray(this.state)) {
602
+ console.warn(
603
+ "Utils:getStateList: unable to update the state of a non-multi form type",
604
+ this.state
605
+ );
606
+ return [];
701
607
  }
702
- );
703
- }
704
- function GoabFileUploadCard({
705
- onDelete,
706
- onCancel,
707
- filename,
708
- ...rest
709
- }) {
710
- const el = react.useRef(null);
711
- const _props = parseISO.transformProps({ filename, ...rest }, parseISO.lowercase);
712
- react.useEffect(() => {
713
- if (!el.current) return;
714
- const current = el.current;
715
- const deleteHandler = (event) => onDelete == null ? void 0 : onDelete({ filename, event });
716
- const cancelHandler = (event) => onCancel == null ? void 0 : onCancel({ filename, event });
717
- current.addEventListener("_delete", deleteHandler);
718
- current.addEventListener("_cancel", cancelHandler);
719
- return () => {
720
- current.removeEventListener("_delete", deleteHandler);
721
- current.removeEventListener("_cancel", cancelHandler);
722
- };
723
- }, [el, onDelete, onCancel, filename]);
724
- return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-card", { ref: el, ..._props });
725
- }
726
- function GoabFileUploadInput({
727
- onSelectFile,
728
- ...rest
729
- }) {
730
- const el = react.useRef(null);
731
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
732
- react.useEffect(() => {
733
- if (!el.current) return;
734
- const current = el.current;
735
- const handler = (e) => {
736
- const detail = e.detail;
737
- onSelectFile({ ...detail, event: e });
738
- };
739
- current.addEventListener("_selectFile", handler);
740
- return () => {
741
- current.removeEventListener("_selectFile", handler);
742
- };
743
- }, [el, onSelectFile]);
744
- return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-input", { ref: el, ..._props });
745
- }
746
- function GoabAppFooter({
747
- children,
748
- ...rest
749
- }) {
750
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
751
- return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props, children });
752
- }
753
- function GoabAppFooterMetaSection({
754
- children,
755
- ...rest
756
- }) {
757
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
758
- return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-meta-section", { slot: "meta", ..._props, children });
759
- }
760
- function GoabAppFooterNavSection({
761
- children,
762
- ...rest
763
- }) {
764
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
765
- return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-nav-section", { slot: "nav", ..._props, children });
766
- }
767
- function GoabFieldset({
768
- onContinue,
769
- children,
770
- ...rest
771
- }) {
772
- const ref = react.useRef(null);
773
- const _props = parseISO.transformProps(rest, parseISO.kebab);
774
- react.useEffect(() => {
775
- if (!ref.current) return;
776
- const current = ref.current;
777
- const continueListener = (e) => {
778
- const event = e.detail;
779
- return onContinue == null ? void 0 : onContinue(event);
780
- };
781
- if (onContinue) {
782
- current.addEventListener("_continue", continueListener);
608
+ if (this.state.length === 0) {
609
+ return [];
783
610
  }
784
- return () => {
785
- if (onContinue) {
786
- current.removeEventListener("_continue", continueListener);
787
- }
788
- };
789
- }, [ref, onContinue]);
790
- return /* @__PURE__ */ jsxRuntime.jsx("goa-fieldset", { ref, ..._props, children });
791
- }
792
- function GoabPublicFormPage({
793
- onContinue,
794
- children,
795
- ...rest
796
- }) {
797
- const ref = react.useRef(null);
798
- const _props = parseISO.transformProps(rest, parseISO.kebab);
799
- react.useEffect(() => {
800
- if (!ref.current) return;
801
- const current = ref.current;
802
- const continueListener = (e) => {
803
- onContinue == null ? void 0 : onContinue(e);
804
- };
805
- if (onContinue) {
806
- current.addEventListener("_continue", continueListener);
611
+ return this.state.map((s) => {
612
+ return Object.values(s.form).filter((item) => {
613
+ var _a;
614
+ return ((_a = item == null ? void 0 : item.data) == null ? void 0 : _a.type) === "details";
615
+ }).map((item) => {
616
+ var _a;
617
+ return item.data.type === "details" && ((_a = item.data) == null ? void 0 : _a.fieldsets) || {};
618
+ }).reduce(
619
+ (acc, item) => {
620
+ for (const [key, value] of Object.entries(item)) {
621
+ acc[key] = value.value;
622
+ }
623
+ return acc;
624
+ },
625
+ {}
626
+ );
627
+ });
628
+ }
629
+ // getStateItems(group: string): Record<string, FieldsetItemState>[] {
630
+ // if (Array.isArray(this.state)) {
631
+ // console.error(
632
+ // "Utils:getStateItems: unable to update the state of a multi form type",
633
+ // );
634
+ // return [];
635
+ // }
636
+ // if (!this.state) {
637
+ // console.error("Utils:getStateItems: state has not yet been set");
638
+ // return [];
639
+ // }
640
+ //
641
+ // const data = this.state.form[group].data;
642
+ // if (data.type !== "list") {
643
+ // return [];
644
+ // }
645
+ //
646
+ // return data.items.;
647
+ // }
648
+ // Public method to allow for the retrieval of the state value
649
+ getStateValue(group, key) {
650
+ if (Array.isArray(this.state)) {
651
+ console.error("getStateValue: unable to update the state of a multi form type");
652
+ return "";
807
653
  }
808
- return () => {
809
- if (onContinue) {
810
- current.removeEventListener("_continue", continueListener);
811
- }
812
- };
813
- }, [ref, onContinue]);
814
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-page", { ref, ..._props, children });
815
- }
816
- function GoabPublicFormSummary({
817
- heading = "",
818
- ...rest
819
- }) {
820
- const _props = parseISO.transformProps(
821
- { heading, ...rest },
822
- parseISO.lowercase
823
- );
824
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-summary", { ..._props });
825
- }
826
- function GoabPublicForm({
827
- onInit,
828
- onComplete,
829
- onStateChange,
830
- children,
831
- ...rest
832
- }) {
833
- const ref = react.useRef(null);
834
- const initialized = react.useRef(false);
835
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
836
- react.useLayoutEffect(() => {
837
- if (!ref.current) return;
838
- const current = ref.current;
839
- const initListener = (e) => {
840
- onInit == null ? void 0 : onInit(e);
841
- };
842
- if (onInit && !initialized.current) {
843
- current.addEventListener("_init", initListener);
654
+ if (!this.state) {
655
+ console.error("getStateValue: state has not yet been set");
656
+ return "";
844
657
  }
845
- const completeListener = (e) => {
846
- const detail = e.detail;
847
- onComplete == null ? void 0 : onComplete(detail);
848
- };
849
- const stateChangeListener = (e) => {
850
- const detail = e.detail;
851
- onStateChange == null ? void 0 : onStateChange(detail.data);
852
- };
853
- if (onComplete) {
854
- current.addEventListener("_complete", completeListener);
658
+ const data = this.state.form[group].data;
659
+ if (data.type !== "details") {
660
+ return "";
855
661
  }
856
- if (onStateChange) {
857
- current.addEventListener("_stateChange", stateChangeListener);
662
+ return data.fieldsets[key].value;
663
+ }
664
+ // Public method to allow for the continuing to the next page
665
+ continueTo(next) {
666
+ if (!next) {
667
+ console.error("continueTo [name] is undefined");
668
+ return;
858
669
  }
859
- return () => {
860
- if (onInit) {
861
- current.removeEventListener("_init", initListener);
862
- }
863
- if (onComplete) {
864
- current.removeEventListener("_complete", completeListener);
670
+ relay(this._formRef, "external::continue", { next });
671
+ }
672
+ // Public method to perform validation and send the appropriate messages to the form elements
673
+ validate(e, field, validators, options) {
674
+ var _a;
675
+ const { el, state, cancelled } = e.detail;
676
+ const value = (_a = state == null ? void 0 : state[field]) == null ? void 0 : _a.value;
677
+ window.scrollTo({ top: 0, behavior: "smooth" });
678
+ if (cancelled) {
679
+ return [true, value];
680
+ }
681
+ for (const validator of validators) {
682
+ const msg = validator(value);
683
+ __privateMethod(this, _PublicFormController_instances, dispatchError_fn).call(this, el, field, msg, options);
684
+ if (msg) {
685
+ return [false, ""];
865
686
  }
866
- if (onStateChange) {
867
- current.removeEventListener("_stateChange", stateChangeListener);
687
+ }
688
+ return [true, value];
689
+ }
690
+ /**
691
+ * Validates a group of fields ensuring that at least `minPassCount` of the items within the group
692
+ * passes. This is useful in the scenario when n number fields are required out of n+m number of fields.
693
+ *
694
+ * @param {string[]} fields - An array of field names to be validated.
695
+ * @param {Event} e - The event object associated with the validation trigger.
696
+ * @param {FieldValidator[]} validators - An array of validator functions to apply to the fields.
697
+ * @return {[number, Record<string, boolean>]} - Returns back the number of fields that passed and a record of the fields and their pass status.
698
+ */
699
+ validateGroup(e, fields, validators) {
700
+ let passCount = 0;
701
+ const validGroups = {};
702
+ for (const field of fields) {
703
+ const [_valid] = this.validate(e, field, validators, { grouped: true });
704
+ if (_valid) {
705
+ validGroups[field] = true;
706
+ passCount++;
868
707
  }
708
+ }
709
+ return [passCount, validGroups];
710
+ }
711
+ edit(index) {
712
+ relay(this._formRef, "external::alter:state", { index, operation: "edit" });
713
+ }
714
+ remove(index) {
715
+ relay(this._formRef, "external::alter:state", {
716
+ index,
717
+ operation: "remove"
718
+ });
719
+ }
720
+ /**
721
+ * Completes the form and triggers the onComplete callback.
722
+ * This method should be used when you want to complete a form without navigating to a summary page.
723
+ *
724
+ * @important Developers must validate the form before calling this method.
725
+ *
726
+ * @example
727
+ * // Validate first, then complete
728
+ * const [isValid] = this.validate(e, "firstName", [
729
+ * requiredValidator("First name is required.")
730
+ * ]);
731
+ * if (isValid) {
732
+ * this.complete();
733
+ * }
734
+ * @returns void
735
+ */
736
+ complete() {
737
+ if (!this._formRef) {
738
+ console.error("complete: form ref is not set");
739
+ return;
740
+ }
741
+ if (this._isCompleting) {
742
+ console.warn("complete: completion already in progress");
743
+ return;
744
+ }
745
+ this._isCompleting = true;
746
+ relay(this._formRef, "fieldset::submit", null, { bubbles: true });
747
+ this._isCompleting = false;
748
+ }
749
+ /**
750
+ * Completes a subform and returns control to the parent form.
751
+ * This method should be used when working with subforms that need to complete without a summary page.
752
+ *
753
+ * @important Developers must validate the subform before calling this method.
754
+ *
755
+ * @example
756
+ * // Validate first, then complete the subform
757
+ * const [isValid] = this._childFormController.validate(e, "fullName", [
758
+ * requiredValidator("Please enter the dependent's full name.")
759
+ * ]);
760
+ * if (isValid) {
761
+ * this._childFormController.completeSubform();
762
+ * }
763
+ * @returns void
764
+ */
765
+ completeSubform() {
766
+ if (!this._formRef) {
767
+ console.error("completeSubform: form ref is not set");
768
+ return;
769
+ }
770
+ if (this._isCompleting) {
771
+ console.warn("completeSubform: completion already in progress");
772
+ return;
773
+ }
774
+ const formRef = this._formRef;
775
+ this._isCompleting = true;
776
+ const stateChangeHandler = (e) => {
777
+ formRef.removeEventListener("_stateChange", stateChangeHandler);
778
+ dispatch(formRef, "_complete", {}, { bubbles: true });
779
+ this._isCompleting = false;
869
780
  };
870
- }, [onInit, onComplete, onStateChange]);
871
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form", { ref, ..._props, children });
781
+ formRef.addEventListener("_stateChange", stateChangeHandler);
782
+ dispatch(formRef, "_continue", null, { bubbles: true });
783
+ }
784
+ // removes any data collected that doesn't correspond with the final history path
785
+ clean(data) {
786
+ return data.history.reduce((acc, fieldsetId) => {
787
+ acc[fieldsetId] = data.form[fieldsetId];
788
+ return acc;
789
+ }, {});
790
+ }
872
791
  }
873
- function GoabPublicSubform({
874
- id = "",
875
- name = "",
876
- continueMsg = "",
877
- onInit,
878
- onStateChange,
879
- children,
792
+ _PublicFormController_instances = new WeakSet();
793
+ updateObjectListState_fn = function(detail) {
794
+ var _a;
795
+ if (!Array.isArray(detail.data)) {
796
+ return;
797
+ }
798
+ if (Array.isArray(this.state)) {
799
+ return;
800
+ }
801
+ this.state = {
802
+ ...this.state,
803
+ form: {
804
+ ...((_a = this.state) == null ? void 0 : _a.form) || {},
805
+ [detail.id]: detail.data
806
+ }
807
+ };
808
+ };
809
+ // Private method to dispatch the error message to the form element
810
+ dispatchError_fn = function(el, name, msg, options) {
811
+ el.dispatchEvent(
812
+ new CustomEvent("msg", {
813
+ composed: true,
814
+ detail: {
815
+ action: "external::set:error",
816
+ data: {
817
+ name,
818
+ msg,
819
+ grouped: options == null ? void 0 : options.grouped
820
+ }
821
+ }
822
+ })
823
+ );
824
+ };
825
+ function GoabDatePicker({
826
+ value,
827
+ error,
828
+ min,
829
+ max,
830
+ disabled,
831
+ relative,
832
+ onChange,
880
833
  ...rest
881
834
  }) {
882
835
  const ref = react.useRef(null);
883
- const _props = parseISO.transformProps(
884
- { id, name, "continue-msg": continueMsg, ...rest },
885
- parseISO.kebab
886
- );
836
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
887
837
  react.useEffect(() => {
888
- if (!ref.current) return;
838
+ if (value && typeof value !== "string") {
839
+ console.warn("Using a `Date` type for value is deprecated. Instead use a string of the format `yyyy-mm-dd`");
840
+ }
841
+ }, []);
842
+ react.useEffect(() => {
843
+ if (!ref.current) {
844
+ return;
845
+ }
889
846
  const current = ref.current;
890
- const initListener = (e) => {
891
- onInit == null ? void 0 : onInit(e);
892
- };
893
- const stateChangeListener = (e) => {
894
- onStateChange == null ? void 0 : onStateChange(e);
847
+ const handleChange = (e) => {
848
+ const detail = e.detail;
849
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
895
850
  };
896
- if (onInit) {
897
- current.addEventListener("_init", initListener);
898
- }
899
- if (onStateChange) {
900
- current.addEventListener("_stateChange", stateChangeListener);
851
+ if (onChange) {
852
+ current.addEventListener("_change", handleChange);
901
853
  }
902
854
  return () => {
903
- if (onInit) {
904
- current.removeEventListener("_init", initListener);
905
- }
906
- if (onStateChange) {
907
- current.removeEventListener("_stateChange", stateChangeListener);
855
+ if (onChange) {
856
+ current.removeEventListener("_change", handleChange);
908
857
  }
909
858
  };
910
- }, [ref, onInit, onStateChange]);
911
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-subform", { ref, ..._props, children });
912
- }
913
- function GoabPublicSubformIndex({
914
- heading = "",
915
- sectionTitle = "",
916
- actionButtonText = "",
917
- buttonVisibility = "hidden",
918
- children,
919
- ...rest
920
- }) {
921
- const _props = parseISO.transformProps(
922
- { heading, "section-title": sectionTitle, "action-button-text": actionButtonText, "button-visibility": buttonVisibility, ...rest },
923
- parseISO.kebab
859
+ }, [onChange]);
860
+ const formatValue = (val) => {
861
+ if (!val) return "";
862
+ if (val instanceof Date) {
863
+ return new calendarDate.CalendarDate(val).toString();
864
+ }
865
+ return val;
866
+ };
867
+ return /* @__PURE__ */ jsxRuntime.jsx(
868
+ "goa-date-picker",
869
+ {
870
+ ref,
871
+ value: formatValue(value) || void 0,
872
+ error: error ? "true" : void 0,
873
+ disabled: disabled ? "true" : void 0,
874
+ min: formatValue(min) || void 0,
875
+ max: formatValue(max) || void 0,
876
+ relative: relative ? "true" : void 0,
877
+ ..._props
878
+ }
924
879
  );
925
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-subform-index", { slot: "subform-index", ..._props, children });
926
880
  }
927
- function GoabPublicFormTask({
928
- status = "cannot-start",
881
+ function GoabDetails({
882
+ open,
929
883
  children,
930
884
  ...rest
931
885
  }) {
932
- const _props = parseISO.transformProps(
933
- { status, ...rest },
934
- parseISO.lowercase
886
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
887
+ return /* @__PURE__ */ jsxRuntime.jsx(
888
+ "goa-details",
889
+ {
890
+ open: open ? "true" : void 0,
891
+ ..._props,
892
+ children
893
+ }
935
894
  );
936
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task", { ..._props, children });
937
895
  }
938
- function GoabPublicFormTaskList({
939
- children,
940
- ...rest
941
- }) {
942
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
943
- return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task-list", { ..._props, children });
896
+ function GoabDivider(props) {
897
+ return /* @__PURE__ */ jsxRuntime.jsx(
898
+ "goa-divider",
899
+ {
900
+ mt: props.mt,
901
+ mr: props.mr,
902
+ mb: props.mb,
903
+ ml: props.ml,
904
+ testid: props.testId
905
+ }
906
+ );
944
907
  }
945
- function GoabFormItem({
946
- error,
947
- helpText,
948
- publicFormSummaryOrder,
908
+ function GoabDrawer({
909
+ position,
910
+ open,
911
+ heading,
912
+ maxSize,
913
+ testId,
914
+ actions,
949
915
  children,
950
- ...rest
916
+ onClose
951
917
  }) {
952
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
918
+ const el = react.useRef(null);
919
+ react.useEffect(() => {
920
+ var _a;
921
+ if (!(el == null ? void 0 : el.current) || !onClose) {
922
+ return;
923
+ }
924
+ (_a = el.current) == null ? void 0 : _a.addEventListener("_close", onClose);
925
+ return () => {
926
+ var _a2;
927
+ (_a2 = el.current) == null ? void 0 : _a2.removeEventListener("_close", onClose);
928
+ };
929
+ }, [el, onClose]);
953
930
  return /* @__PURE__ */ jsxRuntime.jsxs(
954
- "goa-form-item",
931
+ "goa-drawer",
955
932
  {
956
- error: typeof error === "string" ? error : void 0,
957
- helptext: typeof helpText === "string" ? helpText : void 0,
958
- "public-form-summary-order": publicFormSummaryOrder,
959
- ..._props,
933
+ ref: el,
934
+ position,
935
+ open: open ? true : void 0,
936
+ heading: typeof heading === "string" ? heading : void 0,
937
+ maxsize: maxSize,
938
+ testid: testId,
960
939
  children: [
961
- error && typeof error !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "error", children: error }),
962
- helpText && typeof helpText !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "helptext", children: helpText }),
940
+ heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
941
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
963
942
  children
964
943
  ]
965
944
  }
966
945
  );
967
946
  }
968
- function GoabFormStep(props) {
969
- return /* @__PURE__ */ jsxRuntime.jsx("goa-form-step", { text: props.text, status: props.status });
947
+ function stringify(value) {
948
+ if (typeof value === "undefined") {
949
+ return "";
950
+ }
951
+ if (typeof value === "string") {
952
+ return value;
953
+ }
954
+ return JSON.stringify(value);
970
955
  }
971
- function GoabFormStepper({
972
- testId,
973
- step,
974
- mt,
975
- mb,
976
- ml,
977
- mr,
956
+ function GoabDropdown({
957
+ value,
978
958
  onChange,
979
- children
959
+ disabled,
960
+ error,
961
+ filterable,
962
+ multiselect,
963
+ native,
964
+ relative,
965
+ children,
966
+ ...rest
980
967
  }) {
981
- const ref = react.useRef(null);
968
+ const el = react.useRef(null);
969
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
982
970
  react.useEffect(() => {
983
- if (!ref.current) {
971
+ if (!el.current) {
984
972
  return;
985
973
  }
986
- const current = ref.current;
987
- const changeListener = (e) => {
974
+ const current = el.current;
975
+ const handler = (e) => {
988
976
  const detail = e.detail;
989
- onChange == null ? void 0 : onChange(detail);
977
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
990
978
  };
991
- current.addEventListener("_change", changeListener);
979
+ if (onChange) {
980
+ current.addEventListener("_change", handler);
981
+ }
992
982
  return () => {
993
- current.removeEventListener("_change", changeListener);
983
+ if (onChange) {
984
+ current.removeEventListener("_change", handler);
985
+ }
994
986
  };
995
- }, [ref, onChange]);
987
+ }, [el, onChange]);
996
988
  return /* @__PURE__ */ jsxRuntime.jsx(
997
- "goa-form-stepper",
989
+ "goa-dropdown",
998
990
  {
999
- ref,
1000
- testid: testId,
1001
- step,
1002
- mt,
1003
- mr,
1004
- mb,
1005
- ml,
991
+ ref: el,
992
+ value: stringify(value),
993
+ disabled: disabled ? "true" : void 0,
994
+ error: error ? "true" : void 0,
995
+ filterable: filterable ? "true" : void 0,
996
+ multiselect: multiselect ? "true" : void 0,
997
+ native: native ? "true" : void 0,
998
+ relative: relative ? "true" : void 0,
999
+ ..._props,
1006
1000
  children
1007
1001
  }
1008
1002
  );
1009
1003
  }
1010
- function GoabGrid({
1011
- gap,
1012
- minChildWidth,
1013
- mt,
1014
- mr,
1015
- mb,
1016
- ml,
1017
- testId,
1018
- children
1004
+ function GoabDropdownOption(props) {
1005
+ react.useEffect(() => {
1006
+ console.warn("GoabDropdownOption is deprecated. Please use GoabDropdownItem");
1007
+ }, []);
1008
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabDropdownItem, { ...props });
1009
+ }
1010
+ function GoabDropdownItem({
1011
+ value,
1012
+ label,
1013
+ filter,
1014
+ name,
1015
+ mountType = "append"
1019
1016
  }) {
1020
1017
  return /* @__PURE__ */ jsxRuntime.jsx(
1021
- "goa-grid",
1018
+ "goa-dropdown-item",
1022
1019
  {
1023
- gap,
1024
- minchildwidth: minChildWidth,
1025
- mt,
1026
- mr,
1027
- mb,
1028
- ml,
1029
- testid: testId,
1030
- children
1020
+ value,
1021
+ label,
1022
+ filter,
1023
+ name,
1024
+ mount: mountType
1031
1025
  }
1032
1026
  );
1033
1027
  }
1034
- function GoabHeroBanner({
1035
- heading,
1036
- backgroundUrl,
1037
- minHeight,
1038
- maxContentWidth,
1039
- backgroundColor,
1040
- textColor,
1028
+ function GoabFileUploadCard({
1029
+ onDelete,
1030
+ onCancel,
1031
+ filename,
1032
+ ...rest
1033
+ }) {
1034
+ const el = react.useRef(null);
1035
+ const _props = calendarDate.transformProps({ filename, ...rest }, calendarDate.lowercase);
1036
+ react.useEffect(() => {
1037
+ if (!el.current) return;
1038
+ const current = el.current;
1039
+ const deleteHandler = (event) => onDelete == null ? void 0 : onDelete({ filename, event });
1040
+ const cancelHandler = (event) => onCancel == null ? void 0 : onCancel({ filename, event });
1041
+ current.addEventListener("_delete", deleteHandler);
1042
+ current.addEventListener("_cancel", cancelHandler);
1043
+ return () => {
1044
+ current.removeEventListener("_delete", deleteHandler);
1045
+ current.removeEventListener("_cancel", cancelHandler);
1046
+ };
1047
+ }, [el, onDelete, onCancel, filename]);
1048
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-card", { ref: el, ..._props });
1049
+ }
1050
+ function GoabFileUploadInput({
1051
+ onSelectFile,
1052
+ ...rest
1053
+ }) {
1054
+ const el = react.useRef(null);
1055
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1056
+ react.useEffect(() => {
1057
+ if (!el.current) return;
1058
+ const current = el.current;
1059
+ const handler = (e) => {
1060
+ const detail = e.detail;
1061
+ onSelectFile({ ...detail, event: e });
1062
+ };
1063
+ current.addEventListener("_selectFile", handler);
1064
+ return () => {
1065
+ current.removeEventListener("_selectFile", handler);
1066
+ };
1067
+ }, [el, onSelectFile]);
1068
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-file-upload-input", { ref: el, ..._props });
1069
+ }
1070
+ function GoabAppFooter({
1041
1071
  children,
1042
- testId
1072
+ ...rest
1043
1073
  }) {
1044
- return /* @__PURE__ */ jsxRuntime.jsx(
1045
- "goa-hero-banner",
1046
- {
1047
- heading,
1048
- backgroundurl: backgroundUrl,
1049
- minheight: minHeight,
1050
- maxcontentwidth: maxContentWidth,
1051
- backgroundcolor: backgroundColor,
1052
- textcolor: textColor,
1053
- testid: testId,
1054
- children
1055
- }
1056
- );
1074
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1075
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer", { ..._props, children });
1057
1076
  }
1058
- function GoabHeroBannerActions({
1059
- children
1077
+ function GoabAppFooterMetaSection({
1078
+ children,
1079
+ ...rest
1060
1080
  }) {
1061
- return /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children });
1081
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1082
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-meta-section", { slot: "meta", ..._props, children });
1062
1083
  }
1063
- function GoabIconButton({
1064
- variant = "color",
1065
- size = "medium",
1066
- disabled,
1067
- onClick,
1068
- actionArgs,
1069
- actionArg,
1084
+ function GoabAppFooterNavSection({
1085
+ children,
1086
+ ...rest
1087
+ }) {
1088
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1089
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-app-footer-nav-section", { slot: "nav", ..._props, children });
1090
+ }
1091
+ function GoabFieldset({
1092
+ onContinue,
1070
1093
  children,
1071
1094
  ...rest
1072
1095
  }) {
1073
1096
  const ref = react.useRef(null);
1074
- const _props = parseISO.transformProps(
1075
- { variant, size, ...rest },
1076
- parseISO.lowercase
1077
- );
1097
+ const _props = calendarDate.transformProps(rest, calendarDate.kebab);
1078
1098
  react.useEffect(() => {
1079
- if (!ref.current) {
1080
- return;
1081
- }
1082
- if (!onClick) {
1083
- return;
1084
- }
1099
+ if (!ref.current) return;
1085
1100
  const current = ref.current;
1086
- const listener = () => {
1087
- onClick == null ? void 0 : onClick();
1101
+ const continueListener = (e) => {
1102
+ const event = e.detail;
1103
+ return onContinue == null ? void 0 : onContinue(event);
1088
1104
  };
1089
- current.addEventListener("_click", listener);
1105
+ if (onContinue) {
1106
+ current.addEventListener("_continue", continueListener);
1107
+ }
1090
1108
  return () => {
1091
- current.removeEventListener("_click", listener);
1109
+ if (onContinue) {
1110
+ current.removeEventListener("_continue", continueListener);
1111
+ }
1112
+ };
1113
+ }, [ref, onContinue]);
1114
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-fieldset", { ref, ..._props, children });
1115
+ }
1116
+ function GoabPublicFormPage({
1117
+ onContinue,
1118
+ children,
1119
+ ...rest
1120
+ }) {
1121
+ const ref = react.useRef(null);
1122
+ const _props = calendarDate.transformProps(rest, calendarDate.kebab);
1123
+ react.useEffect(() => {
1124
+ if (!ref.current) return;
1125
+ const current = ref.current;
1126
+ const continueListener = (e) => {
1127
+ onContinue == null ? void 0 : onContinue(e);
1092
1128
  };
1093
- }, [ref, onClick]);
1094
- return /* @__PURE__ */ jsxRuntime.jsx(
1095
- "goa-icon-button",
1096
- {
1097
- ref,
1098
- disabled: disabled ? "true" : void 0,
1099
- "action-arg": actionArg,
1100
- "action-args": JSON.stringify(actionArgs),
1101
- ..._props,
1102
- children
1129
+ if (onContinue) {
1130
+ current.addEventListener("_continue", continueListener);
1103
1131
  }
1104
- );
1132
+ return () => {
1133
+ if (onContinue) {
1134
+ current.removeEventListener("_continue", continueListener);
1135
+ }
1136
+ };
1137
+ }, [ref, onContinue]);
1138
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-page", { ref, ..._props, children });
1105
1139
  }
1106
- function GoabIcon({
1107
- inverted,
1140
+ function GoabPublicFormSummary({
1141
+ heading = "",
1108
1142
  ...rest
1109
1143
  }) {
1110
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1111
- return /* @__PURE__ */ jsxRuntime.jsx(
1112
- "goa-icon",
1113
- {
1114
- inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
1115
- ..._props
1116
- }
1144
+ const _props = calendarDate.transformProps(
1145
+ { heading, ...rest },
1146
+ calendarDate.lowercase
1117
1147
  );
1148
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-summary", { ..._props });
1118
1149
  }
1119
- function GoabInput({
1120
- variant = "goa",
1121
- textAlign = "left",
1122
- focused,
1123
- disabled,
1124
- readonly,
1125
- error,
1126
- leadingContent,
1127
- trailingContent,
1128
- onTrailingIconClick,
1129
- onChange,
1130
- onFocus,
1131
- onBlur,
1132
- onKeyPress,
1150
+ function GoabPublicForm({
1151
+ onInit,
1152
+ onComplete,
1153
+ onStateChange,
1154
+ children,
1133
1155
  ...rest
1134
1156
  }) {
1135
1157
  const ref = react.useRef(null);
1136
- const _props = parseISO.transformProps({ variant, textalign: textAlign, ...rest }, parseISO.lowercase);
1137
- react.useEffect(() => {
1138
- if (!ref.current) {
1139
- return;
1140
- }
1158
+ const initialized = react.useRef(false);
1159
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1160
+ react.useLayoutEffect(() => {
1161
+ if (!ref.current) return;
1141
1162
  const current = ref.current;
1142
- const changeListener = (e) => {
1143
- const detail = e.detail;
1144
- onChange == null ? void 0 : onChange({ ...detail, event: e });
1145
- };
1146
- const clickListener = () => {
1147
- onTrailingIconClick == null ? void 0 : onTrailingIconClick();
1148
- };
1149
- const focusListener = (e) => {
1150
- const detail = e.detail;
1151
- onFocus == null ? void 0 : onFocus({ ...detail, event: e });
1163
+ const initListener = (e) => {
1164
+ onInit == null ? void 0 : onInit(e);
1152
1165
  };
1153
- const blurListener = (e) => {
1166
+ if (onInit && !initialized.current) {
1167
+ current.addEventListener("_init", initListener);
1168
+ }
1169
+ const completeListener = (e) => {
1154
1170
  const detail = e.detail;
1155
- onBlur == null ? void 0 : onBlur({ ...detail, event: e });
1171
+ onComplete == null ? void 0 : onComplete(detail);
1156
1172
  };
1157
- const keypressListener = (e) => {
1173
+ const stateChangeListener = (e) => {
1158
1174
  const detail = e.detail;
1159
- onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
1160
- };
1161
- current.addEventListener("_change", changeListener);
1162
- current.addEventListener("_trailingIconClick", clickListener);
1163
- current.addEventListener("_focus", focusListener);
1164
- current.addEventListener("_blur", blurListener);
1165
- current.addEventListener("_keyPress", keypressListener);
1166
- return () => {
1167
- current.removeEventListener("_change", changeListener);
1168
- current.removeEventListener("_trailingIconClick", clickListener);
1169
- current.removeEventListener("_focus", focusListener);
1170
- current.removeEventListener("_blur", blurListener);
1171
- current.removeEventListener("_keyPress", keypressListener);
1175
+ onStateChange == null ? void 0 : onStateChange(detail.data);
1172
1176
  };
1173
- }, [ref, onChange, onTrailingIconClick, onFocus, onBlur, onKeyPress]);
1174
- return /* @__PURE__ */ jsxRuntime.jsxs(
1175
- "goa-input",
1176
- {
1177
- ref,
1178
- ..._props,
1179
- focused: focused ? "true" : void 0,
1180
- disabled: disabled ? "true" : void 0,
1181
- readonly: readonly ? "true" : void 0,
1182
- error: error ? "true" : void 0,
1183
- handletrailingiconclick: onTrailingIconClick ? "true" : "false",
1184
- children: [
1185
- leadingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "leadingContent", children: leadingContent }),
1186
- trailingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "trailingContent", children: trailingContent })
1187
- ]
1188
- }
1189
- );
1190
- }
1191
- const onDateChangeHandler = (onChange) => {
1192
- return ({ name, value, event }) => {
1193
- if (!value) {
1194
- onChange == null ? void 0 : onChange({ name, value: "", event });
1195
- return;
1196
- }
1197
- if (typeof value === "string" && parseISO.isValid(new Date(value))) {
1198
- onChange == null ? void 0 : onChange({ name, value: parseISO.parseISO(value), event });
1199
- return;
1200
- }
1201
- if (parseISO.isValid(value)) {
1202
- onChange == null ? void 0 : onChange({ name, value, event });
1203
- return;
1204
- }
1205
- };
1206
- };
1207
- const onTimeChangeHandler = (onChange) => {
1208
- return ({ name, value, event }) => {
1209
- if (!value) {
1210
- onChange == null ? void 0 : onChange({ name, value: "", event });
1211
- return;
1212
- }
1213
- onChange == null ? void 0 : onChange({ name, value, event });
1214
- };
1215
- };
1216
- function toString(value, tmpl = "yyyy-MM-dd") {
1217
- if (!value) {
1218
- return "";
1219
- }
1220
- if (typeof value === "string") {
1221
- return parseISO.format(parseISO.parseISO(value), tmpl);
1222
- }
1223
- if (value.toISOString() === (/* @__PURE__ */ new Date(0)).toISOString()) {
1224
- return "";
1225
- }
1226
- return parseISO.format(value, tmpl);
1227
- }
1228
- function GoabInputText(props) {
1229
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "text" });
1230
- }
1231
- function GoabInputPassword(props) {
1232
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "password" });
1233
- }
1234
- function GoabInputDate({
1235
- value,
1236
- min = "",
1237
- max = "",
1238
- ...props
1239
- }) {
1240
- return /* @__PURE__ */ jsxRuntime.jsx(
1241
- GoabInput,
1242
- {
1243
- ...props,
1244
- type: "date",
1245
- onChange: onDateChangeHandler(props.onChange),
1246
- min: toString(min),
1247
- max: toString(max),
1248
- value: toString(value)
1177
+ if (onComplete) {
1178
+ current.addEventListener("_complete", completeListener);
1249
1179
  }
1250
- );
1251
- }
1252
- function GoabInputTime({
1253
- value,
1254
- min = "",
1255
- max = "",
1256
- ...props
1257
- }) {
1258
- return /* @__PURE__ */ jsxRuntime.jsx(
1259
- GoabInput,
1260
- {
1261
- ...props,
1262
- onChange: onTimeChangeHandler(props.onChange),
1263
- value,
1264
- type: "time"
1180
+ if (onStateChange) {
1181
+ current.addEventListener("_stateChange", stateChangeListener);
1265
1182
  }
1266
- );
1183
+ return () => {
1184
+ if (onInit) {
1185
+ current.removeEventListener("_init", initListener);
1186
+ }
1187
+ if (onComplete) {
1188
+ current.removeEventListener("_complete", completeListener);
1189
+ }
1190
+ if (onStateChange) {
1191
+ current.removeEventListener("_stateChange", stateChangeListener);
1192
+ }
1193
+ };
1194
+ }, [onInit, onComplete, onStateChange]);
1195
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form", { ref, ..._props, children });
1267
1196
  }
1268
- function GoabInputDateTime({
1269
- value,
1270
- min = "",
1271
- max = "",
1272
- ...props
1197
+ function GoabPublicSubform({
1198
+ id = "",
1199
+ name = "",
1200
+ continueMsg = "",
1201
+ onInit,
1202
+ onStateChange,
1203
+ children,
1204
+ ...rest
1273
1205
  }) {
1274
- return /* @__PURE__ */ jsxRuntime.jsx(
1275
- GoabInput,
1276
- {
1277
- ...props,
1278
- onChange: onDateChangeHandler(props.onChange),
1279
- value: toString(value, "yyyy-MM-dd'T'HH:mm"),
1280
- type: "datetime-local"
1281
- }
1206
+ const ref = react.useRef(null);
1207
+ const _props = calendarDate.transformProps(
1208
+ { id, name, "continue-msg": continueMsg, ...rest },
1209
+ calendarDate.kebab
1282
1210
  );
1283
- }
1284
- function GoabInputEmail(props) {
1285
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "email" });
1286
- }
1287
- function GoabInputSearch(props) {
1288
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "search", trailingIcon: "search" });
1289
- }
1290
- function GoabInputUrl(props) {
1291
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "url" });
1292
- }
1293
- function GoabInputTel(props) {
1294
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "tel" });
1295
- }
1296
- function GoabInputFile(props) {
1297
- return /* @__PURE__ */ jsxRuntime.jsx(
1298
- "input",
1299
- {
1300
- id: props.id,
1301
- name: props.name,
1302
- type: "file",
1303
- onChange: (e) => {
1304
- var _a;
1305
- return (_a = props.onChange) == null ? void 0 : _a.call(props, {
1306
- name: e.target.name,
1307
- value: e.target.value,
1308
- event: e.nativeEvent
1309
- });
1310
- },
1311
- style: { backgroundColor: "revert" }
1211
+ react.useEffect(() => {
1212
+ if (!ref.current) return;
1213
+ const current = ref.current;
1214
+ const initListener = (e) => {
1215
+ onInit == null ? void 0 : onInit(e);
1216
+ };
1217
+ const stateChangeListener = (e) => {
1218
+ onStateChange == null ? void 0 : onStateChange(e);
1219
+ };
1220
+ if (onInit) {
1221
+ current.addEventListener("_init", initListener);
1312
1222
  }
1313
- );
1314
- }
1315
- function GoabInputMonth(props) {
1316
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "month" });
1223
+ if (onStateChange) {
1224
+ current.addEventListener("_stateChange", stateChangeListener);
1225
+ }
1226
+ return () => {
1227
+ if (onInit) {
1228
+ current.removeEventListener("_init", initListener);
1229
+ }
1230
+ if (onStateChange) {
1231
+ current.removeEventListener("_stateChange", stateChangeListener);
1232
+ }
1233
+ };
1234
+ }, [ref, onInit, onStateChange]);
1235
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-subform", { ref, ..._props, children });
1317
1236
  }
1318
- function GoabInputNumber({
1319
- min = Number.MIN_VALUE,
1320
- max = Number.MAX_VALUE,
1321
- value,
1322
- textAlign = "right",
1323
- ...props
1237
+ function GoabPublicSubformIndex({
1238
+ heading = "",
1239
+ sectionTitle = "",
1240
+ actionButtonText = "",
1241
+ buttonVisibility = "hidden",
1242
+ children,
1243
+ ...rest
1324
1244
  }) {
1325
- const onNumberChange = ({ name, value: value2, event }) => {
1326
- var _a;
1327
- (_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
1328
- };
1329
- const onFocus = ({ name, value: value2, event }) => {
1330
- var _a;
1331
- (_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
1332
- };
1333
- const onBlur = ({ name, value: value2, event }) => {
1334
- var _a;
1335
- (_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
1336
- };
1337
- const onKeyPress = ({ name, value: value2, key, event }) => {
1338
- var _a;
1339
- (_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key), event });
1340
- };
1341
- return /* @__PURE__ */ jsxRuntime.jsx(
1342
- GoabInput,
1343
- {
1344
- ...props,
1345
- onChange: onNumberChange,
1346
- min: min == null ? void 0 : min.toString(),
1347
- max: max == null ? void 0 : max.toString(),
1348
- value: value == null ? void 0 : value.toString(),
1349
- onFocus,
1350
- onBlur,
1351
- type: "number",
1352
- onKeyPress,
1353
- textAlign
1354
- }
1245
+ const _props = calendarDate.transformProps(
1246
+ { heading, "section-title": sectionTitle, "action-button-text": actionButtonText, "button-visibility": buttonVisibility, ...rest },
1247
+ calendarDate.kebab
1355
1248
  );
1249
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-subform-index", { slot: "subform-index", ..._props, children });
1356
1250
  }
1357
- function GoabInputRange(props) {
1358
- return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "range" });
1359
- }
1360
- const GoabLinearProgress = ({
1361
- progress,
1362
- percentVisibility,
1363
- ariaLabel,
1364
- ariaLabelledBy,
1365
- testId
1366
- }) => {
1367
- return /* @__PURE__ */ jsxRuntime.jsx(
1368
- "goa-linear-progress",
1369
- {
1370
- progress,
1371
- "percent-visibility": percentVisibility,
1372
- "aria-label": ariaLabel,
1373
- "aria-labelledby": ariaLabelledBy,
1374
- testid: testId
1375
- }
1376
- );
1377
- };
1378
- function GoabLink({
1379
- actionArgs,
1380
- actionArg,
1251
+ function GoabPublicFormTask({
1252
+ status = "cannot-start",
1381
1253
  children,
1382
1254
  ...rest
1383
1255
  }) {
1384
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1385
- return /* @__PURE__ */ jsxRuntime.jsx(
1386
- "goa-link",
1387
- {
1388
- "action-arg": actionArg,
1389
- "action-args": JSON.stringify(actionArgs),
1390
- ..._props,
1391
- children
1392
- }
1256
+ const _props = calendarDate.transformProps(
1257
+ { status, ...rest },
1258
+ calendarDate.lowercase
1393
1259
  );
1260
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task", { ..._props, children });
1394
1261
  }
1395
- function GoALinkButton({
1396
- type = "primary",
1262
+ function GoabPublicFormTaskList({
1397
1263
  children,
1398
1264
  ...rest
1399
1265
  }) {
1400
- const _props = parseISO.transformProps(
1401
- { type, ...rest },
1402
- parseISO.lowercase
1403
- );
1404
- return /* @__PURE__ */ jsxRuntime.jsx("goa-link-button", { ..._props, children });
1266
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1267
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task-list", { ..._props, children });
1405
1268
  }
1406
- function GoabMenuButton({
1407
- type = "primary",
1408
- testId,
1409
- onAction,
1269
+ function GoabFormItem({
1270
+ error,
1271
+ helpText,
1272
+ publicFormSummaryOrder,
1410
1273
  children,
1411
1274
  ...rest
1412
1275
  }) {
1413
- const el = react.useRef(null);
1414
- const _props = parseISO.transformProps(
1415
- { type, testid: testId, ...rest },
1416
- parseISO.kebab
1417
- );
1418
- react.useEffect(() => {
1419
- if (!el.current) {
1420
- return;
1421
- }
1422
- if (!onAction) {
1423
- return;
1276
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1277
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1278
+ "goa-form-item",
1279
+ {
1280
+ error: typeof error === "string" ? error : void 0,
1281
+ helptext: typeof helpText === "string" ? helpText : void 0,
1282
+ "public-form-summary-order": publicFormSummaryOrder,
1283
+ ..._props,
1284
+ children: [
1285
+ error && typeof error !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "error", children: error }),
1286
+ helpText && typeof helpText !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "helptext", children: helpText }),
1287
+ children
1288
+ ]
1424
1289
  }
1425
- const current = el.current;
1426
- const listener = (e) => {
1427
- const detail = e.detail;
1428
- onAction == null ? void 0 : onAction(detail);
1429
- };
1430
- current.addEventListener("_action", listener);
1431
- return () => {
1432
- current.removeEventListener("_action", listener);
1433
- };
1434
- }, [el, onAction]);
1435
- return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, ref: el, children });
1290
+ );
1436
1291
  }
1437
- function GoabMenuAction(props) {
1438
- const _props = parseISO.transformProps(props, parseISO.lowercase);
1439
- return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-action", { ..._props });
1292
+ function GoabFormStep(props) {
1293
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-form-step", { text: props.text, status: props.status });
1440
1294
  }
1441
- function GoabMicrositeHeader({
1442
- type,
1443
- version,
1444
- feedbackUrl,
1445
- maxContentWidth,
1446
- feedbackUrlTarget,
1447
- headerUrlTarget,
1295
+ function GoabFormStepper({
1448
1296
  testId,
1449
- onFeedbackClick
1297
+ step,
1298
+ mt,
1299
+ mb,
1300
+ ml,
1301
+ mr,
1302
+ onChange,
1303
+ children
1450
1304
  }) {
1451
- const el = react.useRef(null);
1305
+ const ref = react.useRef(null);
1452
1306
  react.useEffect(() => {
1453
- if (!el.current) {
1454
- return;
1455
- }
1456
- if (!onFeedbackClick) {
1307
+ if (!ref.current) {
1457
1308
  return;
1458
1309
  }
1459
- const current = el.current;
1460
- const listener = () => {
1461
- onFeedbackClick();
1310
+ const current = ref.current;
1311
+ const changeListener = (e) => {
1312
+ const detail = e.detail;
1313
+ onChange == null ? void 0 : onChange(detail);
1462
1314
  };
1463
- current.addEventListener("_feedbackClick", listener);
1315
+ current.addEventListener("_change", changeListener);
1464
1316
  return () => {
1465
- current.removeEventListener("_feedbackClick", listener);
1317
+ current.removeEventListener("_change", changeListener);
1466
1318
  };
1467
- }, [el, onFeedbackClick]);
1319
+ }, [ref, onChange]);
1468
1320
  return /* @__PURE__ */ jsxRuntime.jsx(
1469
- "goa-microsite-header",
1321
+ "goa-form-stepper",
1470
1322
  {
1471
- ref: el,
1472
- type,
1473
- version: typeof version === "string" ? version : void 0,
1474
- feedbackurl: feedbackUrl,
1323
+ ref,
1475
1324
  testid: testId,
1476
- maxcontentwidth: maxContentWidth,
1477
- feedbackurltarget: feedbackUrlTarget,
1478
- headerurltarget: headerUrlTarget,
1479
- hasfeedbackhandler: onFeedbackClick ? "true" : "false",
1480
- children: version && typeof version !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "version", children: version })
1325
+ step,
1326
+ mt,
1327
+ mr,
1328
+ mb,
1329
+ ml,
1330
+ children
1481
1331
  }
1482
1332
  );
1483
1333
  }
1484
- function GoabModal({
1485
- heading,
1486
- children,
1487
- maxWidth,
1488
- open,
1489
- actions,
1490
- transition,
1491
- calloutVariant,
1492
- onClose,
1493
- testId
1334
+ function GoabGrid({
1335
+ gap,
1336
+ minChildWidth,
1337
+ mt,
1338
+ mr,
1339
+ mb,
1340
+ ml,
1341
+ testId,
1342
+ children
1494
1343
  }) {
1495
- const el = react.useRef(null);
1496
- react.useEffect(() => {
1497
- if (!el.current) {
1498
- return;
1499
- }
1500
- const current = el.current;
1501
- const listener = () => {
1502
- onClose == null ? void 0 : onClose();
1503
- };
1504
- current.addEventListener("_close", listener);
1505
- return () => {
1506
- current.removeEventListener("_close", listener);
1507
- };
1508
- }, [el, onClose]);
1509
- return /* @__PURE__ */ jsxRuntime.jsxs(
1510
- "goa-modal",
1344
+ return /* @__PURE__ */ jsxRuntime.jsx(
1345
+ "goa-grid",
1511
1346
  {
1512
- ref: el,
1513
- open: open ? "true" : void 0,
1514
- closable: onClose ? "true" : "false",
1515
- heading: typeof heading === "string" ? heading : void 0,
1516
- maxwidth: maxWidth,
1517
- transition,
1518
- calloutvariant: calloutVariant,
1347
+ gap,
1348
+ minchildwidth: minChildWidth,
1349
+ mt,
1350
+ mr,
1351
+ mb,
1352
+ ml,
1519
1353
  testid: testId,
1520
- children: [
1521
- heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
1522
- actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
1523
- children
1524
- ]
1354
+ children
1525
1355
  }
1526
1356
  );
1527
1357
  }
1528
- const GoabNotification = ({
1529
- type = "information",
1530
- ariaLive,
1358
+ function GoabHeroBanner({
1359
+ heading,
1360
+ backgroundUrl,
1361
+ minHeight,
1531
1362
  maxContentWidth,
1363
+ backgroundColor,
1364
+ textColor,
1532
1365
  children,
1533
- testId,
1534
- onDismiss
1535
- }) => {
1536
- const el = react.useRef(null);
1366
+ testId
1367
+ }) {
1368
+ return /* @__PURE__ */ jsxRuntime.jsx(
1369
+ "goa-hero-banner",
1370
+ {
1371
+ heading,
1372
+ backgroundurl: backgroundUrl,
1373
+ minheight: minHeight,
1374
+ maxcontentwidth: maxContentWidth,
1375
+ backgroundcolor: backgroundColor,
1376
+ textcolor: textColor,
1377
+ testid: testId,
1378
+ children
1379
+ }
1380
+ );
1381
+ }
1382
+ function GoabHeroBannerActions({
1383
+ children
1384
+ }) {
1385
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children });
1386
+ }
1387
+ function GoabIconButton({
1388
+ variant = "color",
1389
+ size = "medium",
1390
+ disabled,
1391
+ onClick,
1392
+ actionArgs,
1393
+ actionArg,
1394
+ children,
1395
+ ...rest
1396
+ }) {
1397
+ const ref = react.useRef(null);
1398
+ const _props = calendarDate.transformProps(
1399
+ { variant, size, ...rest },
1400
+ calendarDate.lowercase
1401
+ );
1537
1402
  react.useEffect(() => {
1538
- if (!el.current) {
1403
+ if (!ref.current) {
1539
1404
  return;
1540
1405
  }
1541
- const current = el.current;
1406
+ if (!onClick) {
1407
+ return;
1408
+ }
1409
+ const current = ref.current;
1542
1410
  const listener = () => {
1543
- onDismiss == null ? void 0 : onDismiss();
1411
+ onClick == null ? void 0 : onClick();
1544
1412
  };
1545
- current.addEventListener("_dismiss", listener);
1413
+ current.addEventListener("_click", listener);
1546
1414
  return () => {
1547
- current.removeEventListener("_dismiss", listener);
1415
+ current.removeEventListener("_click", listener);
1548
1416
  };
1549
- }, [el, onDismiss]);
1417
+ }, [ref, onClick]);
1550
1418
  return /* @__PURE__ */ jsxRuntime.jsx(
1551
- "goa-notification",
1419
+ "goa-icon-button",
1552
1420
  {
1553
- ref: el,
1554
- type,
1555
- testid: testId,
1556
- maxcontentwidth: maxContentWidth,
1557
- arialive: ariaLive,
1421
+ ref,
1422
+ disabled: disabled ? "true" : void 0,
1423
+ "action-arg": actionArg,
1424
+ "action-args": JSON.stringify(actionArgs),
1425
+ ..._props,
1558
1426
  children
1559
1427
  }
1560
1428
  );
1561
- };
1562
- function GoabOneColumnLayout(props) {
1563
- return /* @__PURE__ */ jsxRuntime.jsx("goa-one-column-layout", { children: props.children });
1564
- }
1565
- function GoabPageBlock(props) {
1566
- return /* @__PURE__ */ jsxRuntime.jsx("goa-page-block", { width: props.width, testid: props.testId, children: props.children });
1567
1429
  }
1568
- function GoabPages(props) {
1430
+ function GoabIcon({
1431
+ inverted,
1432
+ ...rest
1433
+ }) {
1434
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1569
1435
  return /* @__PURE__ */ jsxRuntime.jsx(
1570
- "goa-pages",
1436
+ "goa-icon",
1571
1437
  {
1572
- current: props.current,
1573
- ml: props.ml,
1574
- mr: props.mr,
1575
- mt: props.mt,
1576
- mb: props.mb,
1577
- children: props.children
1438
+ inverted: typeof inverted === "boolean" ? inverted ? "true" : void 0 : inverted,
1439
+ ..._props
1578
1440
  }
1579
1441
  );
1580
1442
  }
1581
- function GoabPagination({ onChange, ...props }) {
1443
+ function GoabInput({
1444
+ variant = "goa",
1445
+ textAlign = "left",
1446
+ focused,
1447
+ disabled,
1448
+ readonly,
1449
+ error,
1450
+ leadingContent,
1451
+ trailingContent,
1452
+ onTrailingIconClick,
1453
+ onChange,
1454
+ onFocus,
1455
+ onBlur,
1456
+ onKeyPress,
1457
+ ...rest
1458
+ }) {
1582
1459
  const ref = react.useRef(null);
1460
+ const _props = calendarDate.transformProps({ variant, textalign: textAlign, ...rest }, calendarDate.lowercase);
1583
1461
  react.useEffect(() => {
1584
1462
  if (!ref.current) {
1585
1463
  return;
@@ -1587,807 +1465,929 @@ function GoabPagination({ onChange, ...props }) {
1587
1465
  const current = ref.current;
1588
1466
  const changeListener = (e) => {
1589
1467
  const detail = e.detail;
1590
- onChange(detail);
1468
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
1469
+ };
1470
+ const clickListener = () => {
1471
+ onTrailingIconClick == null ? void 0 : onTrailingIconClick();
1472
+ };
1473
+ const focusListener = (e) => {
1474
+ const detail = e.detail;
1475
+ onFocus == null ? void 0 : onFocus({ ...detail, event: e });
1476
+ };
1477
+ const blurListener = (e) => {
1478
+ const detail = e.detail;
1479
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
1480
+ };
1481
+ const keypressListener = (e) => {
1482
+ const detail = e.detail;
1483
+ onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
1591
1484
  };
1592
1485
  current.addEventListener("_change", changeListener);
1486
+ current.addEventListener("_trailingIconClick", clickListener);
1487
+ current.addEventListener("_focus", focusListener);
1488
+ current.addEventListener("_blur", blurListener);
1489
+ current.addEventListener("_keyPress", keypressListener);
1593
1490
  return () => {
1594
1491
  current.removeEventListener("_change", changeListener);
1492
+ current.removeEventListener("_trailingIconClick", clickListener);
1493
+ current.removeEventListener("_focus", focusListener);
1494
+ current.removeEventListener("_blur", blurListener);
1495
+ current.removeEventListener("_keyPress", keypressListener);
1595
1496
  };
1596
- }, [ref, onChange]);
1597
- return /* @__PURE__ */ jsxRuntime.jsx(
1598
- "goa-pagination",
1599
- {
1600
- ref,
1601
- itemcount: props.itemCount,
1602
- perpagecount: props.perPageCount,
1603
- pagenumber: props.pageNumber,
1604
- variant: props.variant,
1605
- mt: props.mt,
1606
- mb: props.mb,
1607
- ml: props.ml,
1608
- mr: props.mr,
1609
- testid: props.testId
1610
- }
1611
- );
1612
- }
1613
- function GoabPopover({
1614
- target,
1615
- padded,
1616
- relative,
1617
- children,
1618
- ...rest
1619
- }) {
1620
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1497
+ }, [ref, onChange, onTrailingIconClick, onFocus, onBlur, onKeyPress]);
1621
1498
  return /* @__PURE__ */ jsxRuntime.jsxs(
1622
- "goa-popover",
1499
+ "goa-input",
1623
1500
  {
1624
- padded: typeof padded === "undefined" ? void 0 : padded ? "true" : "false",
1625
- relative: relative ? "true" : void 0,
1501
+ ref,
1626
1502
  ..._props,
1503
+ focused: focused ? "true" : void 0,
1504
+ disabled: disabled ? "true" : void 0,
1505
+ readonly: readonly ? "true" : void 0,
1506
+ error: error ? "true" : void 0,
1507
+ handletrailingiconclick: onTrailingIconClick ? "true" : "false",
1627
1508
  children: [
1628
- children,
1629
- target && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "target", children: target })
1509
+ leadingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "leadingContent", children: leadingContent }),
1510
+ trailingContent && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "trailingContent", children: trailingContent })
1630
1511
  ]
1631
1512
  }
1632
1513
  );
1633
1514
  }
1634
- function GoabPushDrawer({
1635
- testid,
1636
- open,
1637
- heading,
1638
- width,
1639
- actions,
1640
- children,
1641
- onClose
1642
- }) {
1643
- const el = react.useRef(null);
1644
- react.useEffect(() => {
1645
- const elCurrent = el == null ? void 0 : el.current;
1646
- if (!elCurrent || !onClose) {
1515
+ const onDateChangeHandler = (onChange) => {
1516
+ return ({ name, value, event }) => {
1517
+ if (!value) {
1518
+ onChange == null ? void 0 : onChange({ name, value: "", event });
1647
1519
  return;
1648
1520
  }
1649
- elCurrent.addEventListener("_close", onClose);
1650
- return () => {
1651
- elCurrent.removeEventListener("_close", onClose);
1652
- };
1653
- }, [el, onClose]);
1654
- return /* @__PURE__ */ jsxRuntime.jsxs(
1655
- "goa-push-drawer",
1656
- {
1657
- ref: el,
1658
- testid,
1659
- open: open ? true : void 0,
1660
- heading: typeof heading === "string" ? heading : void 0,
1661
- width,
1662
- children: [
1663
- heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
1664
- actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
1665
- children
1666
- ]
1521
+ if (typeof value === "string" && calendarDate.isValid(new Date(value))) {
1522
+ onChange == null ? void 0 : onChange({ name, value: calendarDate.parseISO(value), event });
1523
+ return;
1524
+ }
1525
+ if (calendarDate.isValid(value)) {
1526
+ onChange == null ? void 0 : onChange({ name, value, event });
1527
+ return;
1528
+ }
1529
+ };
1530
+ };
1531
+ const onTimeChangeHandler = (onChange) => {
1532
+ return ({ name, value, event }) => {
1533
+ if (!value) {
1534
+ onChange == null ? void 0 : onChange({ name, value: "", event });
1535
+ return;
1536
+ }
1537
+ onChange == null ? void 0 : onChange({ name, value, event });
1538
+ };
1539
+ };
1540
+ function toString(value, tmpl = "yyyy-MM-dd") {
1541
+ if (!value) {
1542
+ return "";
1543
+ }
1544
+ if (typeof value === "string") {
1545
+ return calendarDate.format(calendarDate.parseISO(value), tmpl);
1546
+ }
1547
+ if (value.toISOString() === (/* @__PURE__ */ new Date(0)).toISOString()) {
1548
+ return "";
1549
+ }
1550
+ return calendarDate.format(value, tmpl);
1551
+ }
1552
+ function GoabInputText(props) {
1553
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "text" });
1554
+ }
1555
+ function GoabInputPassword(props) {
1556
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "password" });
1557
+ }
1558
+ function GoabInputDate({
1559
+ value,
1560
+ min = "",
1561
+ max = "",
1562
+ ...props
1563
+ }) {
1564
+ return /* @__PURE__ */ jsxRuntime.jsx(
1565
+ GoabInput,
1566
+ {
1567
+ ...props,
1568
+ type: "date",
1569
+ onChange: onDateChangeHandler(props.onChange),
1570
+ min: toString(min),
1571
+ max: toString(max),
1572
+ value: toString(value)
1667
1573
  }
1668
1574
  );
1669
1575
  }
1670
- function GoabRadioItem({
1671
- name,
1672
- label,
1576
+ function GoabInputTime({
1673
1577
  value,
1674
- description,
1675
- reveal,
1676
- revealAriaLabel,
1677
- maxWidth,
1678
- disabled,
1679
- checked,
1680
- error,
1681
- ariaLabel,
1682
- children,
1683
- mt,
1684
- mr,
1685
- mb,
1686
- ml
1578
+ min = "",
1579
+ max = "",
1580
+ ...props
1687
1581
  }) {
1688
- return /* @__PURE__ */ jsxRuntime.jsxs(
1689
- "goa-radio-item",
1582
+ return /* @__PURE__ */ jsxRuntime.jsx(
1583
+ GoabInput,
1690
1584
  {
1691
- name,
1692
- label,
1585
+ ...props,
1586
+ onChange: onTimeChangeHandler(props.onChange),
1693
1587
  value,
1694
- description: typeof description === "string" ? description : void 0,
1695
- maxwidth: maxWidth,
1696
- error: error ? "true" : void 0,
1697
- disabled: disabled ? "true" : void 0,
1698
- checked: checked ? "true" : void 0,
1699
- arialabel: ariaLabel,
1700
- revealarialabel: revealAriaLabel,
1701
- mt,
1702
- mr,
1703
- mb,
1704
- ml,
1705
- children: [
1706
- description && typeof description !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "description", children: description }),
1707
- reveal && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "reveal", children: reveal }),
1708
- children
1709
- ]
1588
+ type: "time"
1710
1589
  }
1711
1590
  );
1712
1591
  }
1713
- function GoabRadioGroup({
1714
- disabled,
1715
- error,
1716
- onChange,
1717
- name,
1718
- children,
1719
- ...rest
1592
+ function GoabInputDateTime({
1593
+ value,
1594
+ min = "",
1595
+ max = "",
1596
+ ...props
1720
1597
  }) {
1721
- const el = react.useRef(null);
1722
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1723
- react.useEffect(() => {
1724
- if (!el.current) return;
1725
- const listener = (e) => {
1726
- const detail = e.detail;
1727
- onChange == null ? void 0 : onChange({ ...detail, event: e });
1728
- };
1729
- const currentEl = el.current;
1730
- if (onChange) {
1731
- currentEl.addEventListener("_change", listener);
1732
- }
1733
- return () => {
1734
- if (onChange) {
1735
- currentEl.removeEventListener("_change", listener);
1736
- }
1737
- };
1738
- }, [name, onChange]);
1739
1598
  return /* @__PURE__ */ jsxRuntime.jsx(
1740
- "goa-radio-group",
1599
+ GoabInput,
1741
1600
  {
1742
- ref: el,
1743
- ..._props,
1744
- name,
1745
- disabled: disabled ? "true" : void 0,
1746
- error: error ? "true" : void 0,
1747
- children
1601
+ ...props,
1602
+ onChange: onDateChangeHandler(props.onChange),
1603
+ value: toString(value, "yyyy-MM-dd'T'HH:mm"),
1604
+ type: "datetime-local"
1748
1605
  }
1749
1606
  );
1750
1607
  }
1751
- function GoabSideMenuGroup(props) {
1608
+ function GoabInputEmail(props) {
1609
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "email" });
1610
+ }
1611
+ function GoabInputSearch(props) {
1612
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "search", trailingIcon: "search" });
1613
+ }
1614
+ function GoabInputUrl(props) {
1615
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "url" });
1616
+ }
1617
+ function GoabInputTel(props) {
1618
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "tel" });
1619
+ }
1620
+ function GoabInputFile(props) {
1752
1621
  return /* @__PURE__ */ jsxRuntime.jsx(
1753
- "goa-side-menu-group",
1622
+ "input",
1754
1623
  {
1755
- heading: props.heading,
1756
- icon: props.icon,
1757
- testid: props.testId,
1758
- mt: props.mt,
1759
- mr: props.mr,
1760
- mb: props.mb,
1761
- ml: props.ml,
1762
- children: props.children
1624
+ id: props.id,
1625
+ name: props.name,
1626
+ type: "file",
1627
+ onChange: (e) => {
1628
+ var _a;
1629
+ return (_a = props.onChange) == null ? void 0 : _a.call(props, {
1630
+ name: e.target.name,
1631
+ value: e.target.value,
1632
+ event: e.nativeEvent
1633
+ });
1634
+ },
1635
+ style: { backgroundColor: "revert" }
1763
1636
  }
1764
1637
  );
1765
1638
  }
1766
- function GoabSideMenuHeading(props) {
1767
- return /* @__PURE__ */ jsxRuntime.jsxs("goa-side-menu-heading", { icon: props.icon, testid: props.testId, children: [
1768
- props.children,
1769
- props.meta && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "meta", children: props.meta })
1770
- ] });
1639
+ function GoabInputMonth(props) {
1640
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "month" });
1771
1641
  }
1772
- function GoabSideMenu(props) {
1773
- return /* @__PURE__ */ jsxRuntime.jsx("goa-side-menu", { testid: props.testId, children: props.children });
1642
+ function GoabInputNumber({
1643
+ min = Number.MIN_VALUE,
1644
+ max = Number.MAX_VALUE,
1645
+ value,
1646
+ textAlign = "right",
1647
+ ...props
1648
+ }) {
1649
+ const onNumberChange = ({ name, value: value2, event }) => {
1650
+ var _a;
1651
+ (_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
1652
+ };
1653
+ const onFocus = ({ name, value: value2, event }) => {
1654
+ var _a;
1655
+ (_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
1656
+ };
1657
+ const onBlur = ({ name, value: value2, event }) => {
1658
+ var _a;
1659
+ (_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
1660
+ };
1661
+ const onKeyPress = ({ name, value: value2, key, event }) => {
1662
+ var _a;
1663
+ (_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key), event });
1664
+ };
1665
+ return /* @__PURE__ */ jsxRuntime.jsx(
1666
+ GoabInput,
1667
+ {
1668
+ ...props,
1669
+ onChange: onNumberChange,
1670
+ min: min == null ? void 0 : min.toString(),
1671
+ max: max == null ? void 0 : max.toString(),
1672
+ value: value == null ? void 0 : value.toString(),
1673
+ onFocus,
1674
+ onBlur,
1675
+ type: "number",
1676
+ onKeyPress,
1677
+ textAlign
1678
+ }
1679
+ );
1774
1680
  }
1775
- const GoabSkeleton = ({
1776
- maxWidth,
1777
- size,
1778
- lineCount,
1779
- type,
1780
- testId,
1781
- mt,
1782
- mr,
1783
- mb,
1784
- ml
1681
+ function GoabInputRange(props) {
1682
+ return /* @__PURE__ */ jsxRuntime.jsx(GoabInput, { ...props, type: "range" });
1683
+ }
1684
+ const GoabLinearProgress = ({
1685
+ progress,
1686
+ percentVisibility,
1687
+ ariaLabel,
1688
+ ariaLabelledBy,
1689
+ testId
1785
1690
  }) => {
1786
1691
  return /* @__PURE__ */ jsxRuntime.jsx(
1787
- "goa-skeleton",
1692
+ "goa-linear-progress",
1788
1693
  {
1789
- maxwidth: maxWidth,
1790
- linecount: lineCount,
1791
- type,
1792
- size,
1793
- mt,
1794
- mr,
1795
- mb,
1796
- ml,
1694
+ progress,
1695
+ "percent-visibility": percentVisibility,
1696
+ "aria-label": ariaLabel,
1697
+ "aria-labelledby": ariaLabelledBy,
1797
1698
  testid: testId
1798
1699
  }
1799
1700
  );
1800
1701
  };
1801
- function GoabSpacer(props) {
1702
+ function GoabLink({
1703
+ actionArgs,
1704
+ actionArg,
1705
+ children,
1706
+ ...rest
1707
+ }) {
1708
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
1802
1709
  return /* @__PURE__ */ jsxRuntime.jsx(
1803
- "goa-spacer",
1710
+ "goa-link",
1804
1711
  {
1805
- hspacing: props.hSpacing,
1806
- vspacing: props.vSpacing,
1807
- testid: props.testId
1712
+ "action-arg": actionArg,
1713
+ "action-args": JSON.stringify(actionArgs),
1714
+ ..._props,
1715
+ children
1808
1716
  }
1809
1717
  );
1810
1718
  }
1811
- function GoabSpinner({
1719
+ function GoALinkButton({
1720
+ type = "primary",
1721
+ children,
1722
+ ...rest
1723
+ }) {
1724
+ const _props = calendarDate.transformProps(
1725
+ { type, ...rest },
1726
+ calendarDate.lowercase
1727
+ );
1728
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-link-button", { ..._props, children });
1729
+ }
1730
+ function GoabMenuButton({
1731
+ type = "primary",
1732
+ testId,
1733
+ onAction,
1734
+ children,
1735
+ ...rest
1736
+ }) {
1737
+ const el = react.useRef(null);
1738
+ const _props = calendarDate.transformProps(
1739
+ { type, testid: testId, ...rest },
1740
+ calendarDate.kebab
1741
+ );
1742
+ react.useEffect(() => {
1743
+ if (!el.current) {
1744
+ return;
1745
+ }
1746
+ if (!onAction) {
1747
+ return;
1748
+ }
1749
+ const current = el.current;
1750
+ const listener = (e) => {
1751
+ const detail = e.detail;
1752
+ onAction == null ? void 0 : onAction(detail);
1753
+ };
1754
+ current.addEventListener("_action", listener);
1755
+ return () => {
1756
+ current.removeEventListener("_action", listener);
1757
+ };
1758
+ }, [el, onAction]);
1759
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-button", { ..._props, ref: el, children });
1760
+ }
1761
+ function GoabMenuAction(props) {
1762
+ const _props = calendarDate.transformProps(props, calendarDate.lowercase);
1763
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-menu-action", { ..._props });
1764
+ }
1765
+ function GoabMicrositeHeader({
1812
1766
  type,
1813
- size,
1814
- progress,
1815
- invert,
1816
- testId
1767
+ version,
1768
+ feedbackUrl,
1769
+ maxContentWidth,
1770
+ feedbackUrlTarget,
1771
+ headerUrlTarget,
1772
+ testId,
1773
+ onFeedbackClick
1817
1774
  }) {
1818
- return /* @__PURE__ */ jsxRuntime.jsx(
1819
- "goa-spinner",
1820
- {
1821
- type,
1822
- size,
1823
- progress,
1824
- invert: invert ? "true" : void 0,
1825
- testid: testId
1826
- }
1827
- );
1828
- }
1829
- function GoabTable({ onSort, ...props }) {
1830
- const ref = react.useRef(null);
1775
+ const el = react.useRef(null);
1831
1776
  react.useEffect(() => {
1832
- if (!ref.current) {
1777
+ if (!el.current) {
1833
1778
  return;
1834
1779
  }
1835
- const current = ref.current;
1836
- const sortListener = (e) => {
1837
- const detail = e.detail;
1838
- onSort == null ? void 0 : onSort(detail);
1780
+ if (!onFeedbackClick) {
1781
+ return;
1782
+ }
1783
+ const current = el.current;
1784
+ const listener = () => {
1785
+ onFeedbackClick();
1839
1786
  };
1840
- current.addEventListener("_sort", sortListener);
1787
+ current.addEventListener("_feedbackClick", listener);
1841
1788
  return () => {
1842
- current.removeEventListener("_sort", sortListener);
1789
+ current.removeEventListener("_feedbackClick", listener);
1843
1790
  };
1844
- }, [ref, onSort]);
1791
+ }, [el, onFeedbackClick]);
1845
1792
  return /* @__PURE__ */ jsxRuntime.jsx(
1846
- "goa-table",
1793
+ "goa-microsite-header",
1847
1794
  {
1848
- ref,
1849
- width: props.width,
1850
- variant: props.variant,
1851
- testid: props.testId,
1852
- mt: props.mt,
1853
- mb: props.mb,
1854
- ml: props.ml,
1855
- mr: props.mr,
1856
- children: /* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%" }, children: props.children })
1795
+ ref: el,
1796
+ type,
1797
+ version: typeof version === "string" ? version : void 0,
1798
+ feedbackurl: feedbackUrl,
1799
+ testid: testId,
1800
+ maxcontentwidth: maxContentWidth,
1801
+ feedbackurltarget: feedbackUrlTarget,
1802
+ headerurltarget: headerUrlTarget,
1803
+ hasfeedbackhandler: onFeedbackClick ? "true" : "false",
1804
+ children: version && typeof version !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "version", children: version })
1857
1805
  }
1858
1806
  );
1859
1807
  }
1860
- function GoabTableSortHeader({
1861
- children,
1862
- ...rest
1863
- }) {
1864
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1865
- return /* @__PURE__ */ jsxRuntime.jsx("goa-table-sort-header", { ..._props, children });
1866
- }
1867
- function GoabTabs({
1868
- initialTab,
1808
+ function GoabModal({
1809
+ heading,
1869
1810
  children,
1870
- testId,
1871
- variant,
1872
- onChange
1811
+ maxWidth,
1812
+ open,
1813
+ actions,
1814
+ transition,
1815
+ calloutVariant,
1816
+ onClose,
1817
+ testId
1873
1818
  }) {
1874
- const ref = react.useRef(null);
1819
+ const el = react.useRef(null);
1875
1820
  react.useEffect(() => {
1876
- const element = ref.current;
1877
- if (element && onChange) {
1878
- const handler = (event) => {
1879
- const detail = event.detail;
1880
- onChange(detail);
1881
- };
1882
- element.addEventListener("_change", handler);
1883
- return () => {
1884
- element.removeEventListener("_change", handler);
1885
- };
1821
+ if (!el.current) {
1822
+ return;
1886
1823
  }
1887
- }, [onChange]);
1888
- return /* @__PURE__ */ jsxRuntime.jsx("goa-tabs", { ref, initialtab: initialTab, testid: testId, variant, children });
1889
- }
1890
- function GoabTab({ heading, disabled, slug, children }) {
1824
+ const current = el.current;
1825
+ const listener = () => {
1826
+ onClose == null ? void 0 : onClose();
1827
+ };
1828
+ current.addEventListener("_close", listener);
1829
+ return () => {
1830
+ current.removeEventListener("_close", listener);
1831
+ };
1832
+ }, [el, onClose]);
1891
1833
  return /* @__PURE__ */ jsxRuntime.jsxs(
1892
- "goa-tab",
1834
+ "goa-modal",
1893
1835
  {
1894
- slug,
1895
- disabled: disabled ? "true" : void 0,
1836
+ ref: el,
1837
+ open: open ? "true" : void 0,
1838
+ closable: onClose ? "true" : "false",
1896
1839
  heading: typeof heading === "string" ? heading : void 0,
1840
+ maxwidth: maxWidth,
1841
+ transition,
1842
+ calloutvariant: calloutVariant,
1843
+ testid: testId,
1897
1844
  children: [
1898
- typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "heading", children: heading }),
1845
+ heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
1846
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
1899
1847
  children
1900
1848
  ]
1901
1849
  }
1902
1850
  );
1903
1851
  }
1904
- const GoabTemporaryNotificationCtrl = ({
1905
- verticalPosition = "bottom",
1906
- horizontalPosition = "center",
1852
+ const GoabNotification = ({
1853
+ type = "information",
1854
+ ariaLive,
1855
+ maxContentWidth,
1856
+ children,
1907
1857
  testId,
1908
- ...rest
1858
+ onDismiss
1909
1859
  }) => {
1910
1860
  const el = react.useRef(null);
1911
- const _props = parseISO.transformProps(
1912
- { "vertical-position": verticalPosition, "horizontal-position": horizontalPosition, ...rest },
1913
- parseISO.kebab
1914
- );
1861
+ react.useEffect(() => {
1862
+ if (!el.current) {
1863
+ return;
1864
+ }
1865
+ const current = el.current;
1866
+ const listener = () => {
1867
+ onDismiss == null ? void 0 : onDismiss();
1868
+ };
1869
+ current.addEventListener("_dismiss", listener);
1870
+ return () => {
1871
+ current.removeEventListener("_dismiss", listener);
1872
+ };
1873
+ }, [el, onDismiss]);
1915
1874
  return /* @__PURE__ */ jsxRuntime.jsx(
1916
- "goa-temp-notification-ctrl",
1875
+ "goa-notification",
1917
1876
  {
1918
1877
  ref: el,
1919
- ..._props,
1920
- testid: testId
1878
+ type,
1879
+ testid: testId,
1880
+ maxcontentwidth: maxContentWidth,
1881
+ arialive: ariaLive,
1882
+ children
1921
1883
  }
1922
1884
  );
1923
1885
  };
1924
- function GoabText({
1925
- as,
1926
- tag,
1927
- children,
1928
- ...rest
1929
- }) {
1930
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1886
+ function GoabOneColumnLayout(props) {
1887
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-one-column-layout", { children: props.children });
1888
+ }
1889
+ function GoabPageBlock(props) {
1890
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-page-block", { width: props.width, testid: props.testId, children: props.children });
1891
+ }
1892
+ function GoabPages(props) {
1931
1893
  return /* @__PURE__ */ jsxRuntime.jsx(
1932
- "goa-text",
1894
+ "goa-pages",
1933
1895
  {
1934
- as: tag || as,
1935
- ..._props,
1936
- children
1896
+ current: props.current,
1897
+ ml: props.ml,
1898
+ mr: props.mr,
1899
+ mt: props.mt,
1900
+ mb: props.mb,
1901
+ children: props.children
1937
1902
  }
1938
1903
  );
1939
1904
  }
1940
- function GoabTextArea({
1941
- readOnly,
1942
- disabled,
1943
- error,
1944
- onChange,
1945
- onKeyPress,
1946
- onBlur,
1947
- ...rest
1948
- }) {
1949
- const el = react.useRef(null);
1950
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
1905
+ function GoabPagination({ onChange, ...props }) {
1906
+ const ref = react.useRef(null);
1951
1907
  react.useEffect(() => {
1952
- if (!el.current) {
1908
+ if (!ref.current) {
1953
1909
  return;
1954
1910
  }
1955
- const current = el.current;
1911
+ const current = ref.current;
1956
1912
  const changeListener = (e) => {
1957
1913
  const detail = e.detail;
1958
- onChange == null ? void 0 : onChange({ ...detail, event: e });
1959
- };
1960
- const keypressListener = (e) => {
1961
- const detail = e.detail;
1962
- onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
1963
- };
1964
- const blurListener = (e) => {
1965
- const detail = e.detail;
1966
- onBlur == null ? void 0 : onBlur({ ...detail, event: e });
1914
+ onChange(detail);
1967
1915
  };
1968
1916
  current.addEventListener("_change", changeListener);
1969
- current.addEventListener("_keyPress", keypressListener);
1970
- current.addEventListener("_blur", blurListener);
1971
1917
  return () => {
1972
1918
  current.removeEventListener("_change", changeListener);
1973
- current.removeEventListener("_keyPress", keypressListener);
1974
- current.removeEventListener("_blur", blurListener);
1975
1919
  };
1976
- }, [el, onChange, onKeyPress, onBlur]);
1977
- return /* @__PURE__ */ jsxRuntime.jsx(
1978
- "goa-textarea",
1979
- {
1980
- ref: el,
1981
- readOnly: readOnly ? "true" : void 0,
1982
- disabled: disabled ? "true" : void 0,
1983
- error: error ? "true" : void 0,
1984
- ..._props
1985
- }
1986
- );
1987
- }
1988
- function GoabThreeColumnLayout(props) {
1989
- return /* @__PURE__ */ jsxRuntime.jsxs(
1990
- "goa-three-column-layout",
1991
- {
1992
- leftcolumnwidth: props.leftColumnWidth,
1993
- rightcolumnwidth: props.rightColumnWidth,
1994
- maxcontentwidth: props.maxContentWidth,
1995
- children: [
1996
- props.header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: props.header }),
1997
- props.nav && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "nav", children: props.nav }),
1998
- props.sidebar && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: props.sidebar }),
1999
- props.sideMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: props.sideMenu }),
2000
- props.children,
2001
- props.footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: props.footer })
2002
- ]
1920
+ }, [ref, onChange]);
1921
+ return /* @__PURE__ */ jsxRuntime.jsx(
1922
+ "goa-pagination",
1923
+ {
1924
+ ref,
1925
+ itemcount: props.itemCount,
1926
+ perpagecount: props.perPageCount,
1927
+ pagenumber: props.pageNumber,
1928
+ variant: props.variant,
1929
+ mt: props.mt,
1930
+ mb: props.mb,
1931
+ ml: props.ml,
1932
+ mr: props.mr,
1933
+ testid: props.testId
2003
1934
  }
2004
1935
  );
2005
1936
  }
2006
- function GoabTooltip({
2007
- content,
1937
+ function GoabPopover({
1938
+ target,
1939
+ padded,
1940
+ relative,
2008
1941
  children,
2009
1942
  ...rest
2010
1943
  }) {
2011
- const _props = parseISO.transformProps(rest, parseISO.lowercase);
2012
- const isStringContent = typeof content === "string";
1944
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
2013
1945
  return /* @__PURE__ */ jsxRuntime.jsxs(
2014
- "goa-tooltip",
1946
+ "goa-popover",
2015
1947
  {
2016
- content: isStringContent ? content : void 0,
1948
+ padded: typeof padded === "undefined" ? void 0 : padded ? "true" : "false",
1949
+ relative: relative ? "true" : void 0,
2017
1950
  ..._props,
2018
1951
  children: [
2019
- !isStringContent && content && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content }),
2020
- children
2021
- ]
2022
- }
2023
- );
2024
- }
2025
- function GoabTwoColumnLayout(props) {
2026
- return /* @__PURE__ */ jsxRuntime.jsxs(
2027
- "goa-two-column-layout",
2028
- {
2029
- navcolumnwidth: props.navColumnWidth,
2030
- maxcontentwidth: props.maxContentWidth,
2031
- children: [
2032
- props.header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: props.header }),
2033
- props.nav && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "nav", children: props.nav }),
2034
- props.children,
2035
- props.footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: props.footer })
1952
+ children,
1953
+ target && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "target", children: target })
2036
1954
  ]
2037
1955
  }
2038
1956
  );
2039
1957
  }
2040
- const GoabFilterChip = ({
2041
- iconTheme = "outline",
2042
- error,
2043
- onClick,
2044
- ...rest
2045
- }) => {
1958
+ function GoabPushDrawer({
1959
+ testid,
1960
+ open,
1961
+ heading,
1962
+ width,
1963
+ actions,
1964
+ children,
1965
+ onClose
1966
+ }) {
2046
1967
  const el = react.useRef(null);
2047
- const _props = parseISO.transformProps(
2048
- { icontheme: iconTheme, ...rest },
2049
- parseISO.lowercase
2050
- );
2051
1968
  react.useEffect(() => {
2052
- if (!el.current) return;
2053
- if (!onClick) return;
2054
- const current = el.current;
2055
- current.addEventListener("_click", onClick);
1969
+ const elCurrent = el == null ? void 0 : el.current;
1970
+ if (!elCurrent || !onClose) {
1971
+ return;
1972
+ }
1973
+ elCurrent.addEventListener("_close", onClose);
2056
1974
  return () => {
2057
- current.removeEventListener("_click", onClick);
1975
+ elCurrent.removeEventListener("_close", onClose);
2058
1976
  };
2059
- }, [el, onClick]);
2060
- return /* @__PURE__ */ jsxRuntime.jsx(
2061
- "goa-filter-chip",
1977
+ }, [el, onClose]);
1978
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1979
+ "goa-push-drawer",
2062
1980
  {
2063
1981
  ref: el,
2064
- error: error ? "true" : void 0,
2065
- ..._props
1982
+ testid,
1983
+ open: open ? true : void 0,
1984
+ heading: typeof heading === "string" ? heading : void 0,
1985
+ width,
1986
+ children: [
1987
+ heading && typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "heading", children: heading }),
1988
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "actions", children: actions }),
1989
+ children
1990
+ ]
2066
1991
  }
2067
1992
  );
2068
- };
2069
- function dispatch(el, eventName, detail, opts) {
2070
- if (!el) {
2071
- console.error("dispatch element is null");
2072
- return;
2073
- }
2074
- el.dispatchEvent(
2075
- new CustomEvent(eventName, {
2076
- composed: true,
2077
- bubbles: opts == null ? void 0 : opts.bubbles,
2078
- detail
2079
- })
2080
- );
2081
- }
2082
- function relay(el, eventName, data, opts) {
2083
- if (!el) {
2084
- console.error("dispatch element is null");
2085
- return;
2086
- }
2087
- el.dispatchEvent(
2088
- new CustomEvent("msg", {
2089
- composed: true,
2090
- bubbles: opts == null ? void 0 : opts.bubbles,
2091
- detail: {
2092
- action: eventName,
2093
- data
2094
- }
2095
- })
2096
- );
2097
1993
  }
2098
- class PublicFormController {
2099
- constructor(type) {
2100
- __privateAdd(this, _PublicFormController_instances);
2101
- __publicField(this, "state");
2102
- __publicField(this, "_formData");
2103
- __publicField(this, "_formRef");
2104
- __publicField(this, "_isCompleting", false);
2105
- this.type = type;
2106
- }
2107
- // Obtain reference to the form element
2108
- init(e) {
2109
- if (this._formRef) {
2110
- console.warn("init: form element has already been set");
2111
- return;
2112
- }
2113
- this._formRef = e.detail.el;
2114
- this.state = {
2115
- uuid: crypto.randomUUID(),
2116
- form: {},
2117
- history: [],
2118
- editting: "",
2119
- status: "not-started"
2120
- };
2121
- }
2122
- initList(e) {
2123
- this._formRef = e.detail.el;
2124
- this.state = [];
2125
- }
2126
- // Public method to allow for the initialization of the state
2127
- initState(state, callback) {
2128
- relay(this._formRef, "external::init:state", state);
2129
- if (typeof state === "string") {
2130
- this.state = JSON.parse(state);
2131
- } else if (!Array.isArray(state)) {
2132
- this.state = state;
2133
- }
2134
- if (callback) {
2135
- setTimeout(callback, 200);
2136
- }
2137
- }
2138
- updateListState(e) {
2139
- const detail = e.detail;
2140
- if (!Array.isArray(detail.data)) {
2141
- return;
2142
- }
2143
- this.state = detail.data;
2144
- }
2145
- updateObjectState(e) {
2146
- var _a, _b;
2147
- if (Array.isArray(this.state)) {
2148
- return;
2149
- }
2150
- const detail = e.detail;
2151
- if (detail.type === "list") {
2152
- this.state = {
2153
- ...this.state,
2154
- form: { ...((_a = this.state) == null ? void 0 : _a.form) || {}, [detail.id]: detail.data }
2155
- };
2156
- } else {
2157
- this.state = {
2158
- ...this.state,
2159
- ...detail.data,
2160
- form: { ...((_b = this.state) == null ? void 0 : _b.form) || {}, ...detail.data.form },
2161
- history: detail.data.history
2162
- };
2163
- }
2164
- }
2165
- getStateList() {
2166
- if (!this.state) {
2167
- return [];
2168
- }
2169
- if (!Array.isArray(this.state)) {
2170
- console.warn(
2171
- "Utils:getStateList: unable to update the state of a non-multi form type",
2172
- this.state
2173
- );
2174
- return [];
2175
- }
2176
- if (this.state.length === 0) {
2177
- return [];
2178
- }
2179
- return this.state.map((s) => {
2180
- return Object.values(s.form).filter((item) => {
2181
- var _a;
2182
- return ((_a = item == null ? void 0 : item.data) == null ? void 0 : _a.type) === "details";
2183
- }).map((item) => {
2184
- var _a;
2185
- return item.data.type === "details" && ((_a = item.data) == null ? void 0 : _a.fieldsets) || {};
2186
- }).reduce(
2187
- (acc, item) => {
2188
- for (const [key, value] of Object.entries(item)) {
2189
- acc[key] = value.value;
2190
- }
2191
- return acc;
2192
- },
2193
- {}
2194
- );
2195
- });
2196
- }
2197
- // getStateItems(group: string): Record<string, FieldsetItemState>[] {
2198
- // if (Array.isArray(this.state)) {
2199
- // console.error(
2200
- // "Utils:getStateItems: unable to update the state of a multi form type",
2201
- // );
2202
- // return [];
2203
- // }
2204
- // if (!this.state) {
2205
- // console.error("Utils:getStateItems: state has not yet been set");
2206
- // return [];
2207
- // }
2208
- //
2209
- // const data = this.state.form[group].data;
2210
- // if (data.type !== "list") {
2211
- // return [];
2212
- // }
2213
- //
2214
- // return data.items.;
2215
- // }
2216
- // Public method to allow for the retrieval of the state value
2217
- getStateValue(group, key) {
2218
- if (Array.isArray(this.state)) {
2219
- console.error("getStateValue: unable to update the state of a multi form type");
2220
- return "";
1994
+ function GoabRadioItem({
1995
+ name,
1996
+ label,
1997
+ value,
1998
+ description,
1999
+ reveal,
2000
+ revealAriaLabel,
2001
+ maxWidth,
2002
+ disabled,
2003
+ checked,
2004
+ error,
2005
+ ariaLabel,
2006
+ children,
2007
+ mt,
2008
+ mr,
2009
+ mb,
2010
+ ml
2011
+ }) {
2012
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2013
+ "goa-radio-item",
2014
+ {
2015
+ name,
2016
+ label,
2017
+ value,
2018
+ description: typeof description === "string" ? description : void 0,
2019
+ maxwidth: maxWidth,
2020
+ error: error ? "true" : void 0,
2021
+ disabled: disabled ? "true" : void 0,
2022
+ checked: checked ? "true" : void 0,
2023
+ arialabel: ariaLabel,
2024
+ revealarialabel: revealAriaLabel,
2025
+ mt,
2026
+ mr,
2027
+ mb,
2028
+ ml,
2029
+ children: [
2030
+ description && typeof description !== "string" && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "description", children: description }),
2031
+ reveal && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "reveal", children: reveal }),
2032
+ children
2033
+ ]
2221
2034
  }
2222
- if (!this.state) {
2223
- console.error("getStateValue: state has not yet been set");
2224
- return "";
2035
+ );
2036
+ }
2037
+ function GoabRadioGroup({
2038
+ disabled,
2039
+ error,
2040
+ onChange,
2041
+ name,
2042
+ children,
2043
+ ...rest
2044
+ }) {
2045
+ const el = react.useRef(null);
2046
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
2047
+ react.useEffect(() => {
2048
+ if (!el.current) return;
2049
+ const listener = (e) => {
2050
+ const detail = e.detail;
2051
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
2052
+ };
2053
+ const currentEl = el.current;
2054
+ if (onChange) {
2055
+ currentEl.addEventListener("_change", listener);
2225
2056
  }
2226
- const data = this.state.form[group].data;
2227
- if (data.type !== "details") {
2228
- return "";
2057
+ return () => {
2058
+ if (onChange) {
2059
+ currentEl.removeEventListener("_change", listener);
2060
+ }
2061
+ };
2062
+ }, [name, onChange]);
2063
+ return /* @__PURE__ */ jsxRuntime.jsx(
2064
+ "goa-radio-group",
2065
+ {
2066
+ ref: el,
2067
+ ..._props,
2068
+ name,
2069
+ disabled: disabled ? "true" : void 0,
2070
+ error: error ? "true" : void 0,
2071
+ children
2229
2072
  }
2230
- return data.fieldsets[key].value;
2231
- }
2232
- // Public method to allow for the continuing to the next page
2233
- continueTo(next) {
2234
- if (!next) {
2235
- console.error("continueTo [name] is undefined");
2236
- return;
2073
+ );
2074
+ }
2075
+ function GoabSideMenuGroup(props) {
2076
+ return /* @__PURE__ */ jsxRuntime.jsx(
2077
+ "goa-side-menu-group",
2078
+ {
2079
+ heading: props.heading,
2080
+ icon: props.icon,
2081
+ testid: props.testId,
2082
+ mt: props.mt,
2083
+ mr: props.mr,
2084
+ mb: props.mb,
2085
+ ml: props.ml,
2086
+ children: props.children
2237
2087
  }
2238
- relay(this._formRef, "external::continue", { next });
2239
- }
2240
- // Public method to perform validation and send the appropriate messages to the form elements
2241
- validate(e, field, validators, options) {
2242
- var _a;
2243
- const { el, state, cancelled } = e.detail;
2244
- const value = (_a = state == null ? void 0 : state[field]) == null ? void 0 : _a.value;
2245
- window.scrollTo({ top: 0, behavior: "smooth" });
2246
- if (cancelled) {
2247
- return [true, value];
2088
+ );
2089
+ }
2090
+ function GoabSideMenuHeading(props) {
2091
+ return /* @__PURE__ */ jsxRuntime.jsxs("goa-side-menu-heading", { icon: props.icon, testid: props.testId, children: [
2092
+ props.children,
2093
+ props.meta && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "meta", children: props.meta })
2094
+ ] });
2095
+ }
2096
+ function GoabSideMenu(props) {
2097
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-side-menu", { testid: props.testId, children: props.children });
2098
+ }
2099
+ const GoabSkeleton = ({
2100
+ maxWidth,
2101
+ size,
2102
+ lineCount,
2103
+ type,
2104
+ testId,
2105
+ mt,
2106
+ mr,
2107
+ mb,
2108
+ ml
2109
+ }) => {
2110
+ return /* @__PURE__ */ jsxRuntime.jsx(
2111
+ "goa-skeleton",
2112
+ {
2113
+ maxwidth: maxWidth,
2114
+ linecount: lineCount,
2115
+ type,
2116
+ size,
2117
+ mt,
2118
+ mr,
2119
+ mb,
2120
+ ml,
2121
+ testid: testId
2248
2122
  }
2249
- for (const validator of validators) {
2250
- const msg = validator(value);
2251
- __privateMethod(this, _PublicFormController_instances, dispatchError_fn).call(this, el, field, msg, options);
2252
- if (msg) {
2253
- return [false, ""];
2254
- }
2123
+ );
2124
+ };
2125
+ function GoabSpacer(props) {
2126
+ return /* @__PURE__ */ jsxRuntime.jsx(
2127
+ "goa-spacer",
2128
+ {
2129
+ hspacing: props.hSpacing,
2130
+ vspacing: props.vSpacing,
2131
+ testid: props.testId
2255
2132
  }
2256
- return [true, value];
2257
- }
2258
- /**
2259
- * Validates a group of fields ensuring that at least `minPassCount` of the items within the group
2260
- * passes. This is useful in the scenario when n number fields are required out of n+m number of fields.
2261
- *
2262
- * @param {string[]} fields - An array of field names to be validated.
2263
- * @param {Event} e - The event object associated with the validation trigger.
2264
- * @param {FieldValidator[]} validators - An array of validator functions to apply to the fields.
2265
- * @return {[number, Record<string, boolean>]} - Returns back the number of fields that passed and a record of the fields and their pass status.
2266
- */
2267
- validateGroup(e, fields, validators) {
2268
- let passCount = 0;
2269
- const validGroups = {};
2270
- for (const field of fields) {
2271
- const [_valid] = this.validate(e, field, validators, { grouped: true });
2272
- if (_valid) {
2273
- validGroups[field] = true;
2274
- passCount++;
2275
- }
2133
+ );
2134
+ }
2135
+ function GoabSpinner({
2136
+ type,
2137
+ size,
2138
+ progress,
2139
+ invert,
2140
+ testId
2141
+ }) {
2142
+ return /* @__PURE__ */ jsxRuntime.jsx(
2143
+ "goa-spinner",
2144
+ {
2145
+ type,
2146
+ size,
2147
+ progress,
2148
+ invert: invert ? "true" : void 0,
2149
+ testid: testId
2276
2150
  }
2277
- return [passCount, validGroups];
2278
- }
2279
- edit(index) {
2280
- relay(this._formRef, "external::alter:state", { index, operation: "edit" });
2281
- }
2282
- remove(index) {
2283
- relay(this._formRef, "external::alter:state", {
2284
- index,
2285
- operation: "remove"
2286
- });
2287
- }
2288
- /**
2289
- * Completes the form and triggers the onComplete callback.
2290
- * This method should be used when you want to complete a form without navigating to a summary page.
2291
- *
2292
- * @important Developers must validate the form before calling this method.
2293
- *
2294
- * @example
2295
- * // Validate first, then complete
2296
- * const [isValid] = this.validate(e, "firstName", [
2297
- * requiredValidator("First name is required.")
2298
- * ]);
2299
- * if (isValid) {
2300
- * this.complete();
2301
- * }
2302
- * @returns void
2303
- */
2304
- complete() {
2305
- if (!this._formRef) {
2306
- console.error("complete: form ref is not set");
2151
+ );
2152
+ }
2153
+ function GoabTable({ onSort, ...props }) {
2154
+ const ref = react.useRef(null);
2155
+ react.useEffect(() => {
2156
+ if (!ref.current) {
2307
2157
  return;
2308
2158
  }
2309
- if (this._isCompleting) {
2310
- console.warn("complete: completion already in progress");
2311
- return;
2159
+ const current = ref.current;
2160
+ const sortListener = (e) => {
2161
+ const detail = e.detail;
2162
+ onSort == null ? void 0 : onSort(detail);
2163
+ };
2164
+ current.addEventListener("_sort", sortListener);
2165
+ return () => {
2166
+ current.removeEventListener("_sort", sortListener);
2167
+ };
2168
+ }, [ref, onSort]);
2169
+ return /* @__PURE__ */ jsxRuntime.jsx(
2170
+ "goa-table",
2171
+ {
2172
+ ref,
2173
+ width: props.width,
2174
+ variant: props.variant,
2175
+ testid: props.testId,
2176
+ mt: props.mt,
2177
+ mb: props.mb,
2178
+ ml: props.ml,
2179
+ mr: props.mr,
2180
+ children: /* @__PURE__ */ jsxRuntime.jsx("table", { style: { width: "100%" }, children: props.children })
2181
+ }
2182
+ );
2183
+ }
2184
+ function GoabTableSortHeader({
2185
+ children,
2186
+ ...rest
2187
+ }) {
2188
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
2189
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-table-sort-header", { ..._props, children });
2190
+ }
2191
+ function GoabTabs({
2192
+ initialTab,
2193
+ children,
2194
+ testId,
2195
+ variant,
2196
+ onChange
2197
+ }) {
2198
+ const ref = react.useRef(null);
2199
+ react.useEffect(() => {
2200
+ const element = ref.current;
2201
+ if (element && onChange) {
2202
+ const handler = (event) => {
2203
+ const detail = event.detail;
2204
+ onChange(detail);
2205
+ };
2206
+ element.addEventListener("_change", handler);
2207
+ return () => {
2208
+ element.removeEventListener("_change", handler);
2209
+ };
2210
+ }
2211
+ }, [onChange]);
2212
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-tabs", { ref, initialtab: initialTab, testid: testId, variant, children });
2213
+ }
2214
+ function GoabTab({ heading, disabled, slug, children }) {
2215
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2216
+ "goa-tab",
2217
+ {
2218
+ slug,
2219
+ disabled: disabled ? "true" : void 0,
2220
+ heading: typeof heading === "string" ? heading : void 0,
2221
+ children: [
2222
+ typeof heading !== "string" && /* @__PURE__ */ jsxRuntime.jsx("span", { slot: "heading", children: heading }),
2223
+ children
2224
+ ]
2312
2225
  }
2313
- this._isCompleting = true;
2314
- relay(this._formRef, "fieldset::submit", null, { bubbles: true });
2315
- this._isCompleting = false;
2316
- }
2317
- /**
2318
- * Completes a subform and returns control to the parent form.
2319
- * This method should be used when working with subforms that need to complete without a summary page.
2320
- *
2321
- * @important Developers must validate the subform before calling this method.
2322
- *
2323
- * @example
2324
- * // Validate first, then complete the subform
2325
- * const [isValid] = this._childFormController.validate(e, "fullName", [
2326
- * requiredValidator("Please enter the dependent's full name.")
2327
- * ]);
2328
- * if (isValid) {
2329
- * this._childFormController.completeSubform();
2330
- * }
2331
- * @returns void
2332
- */
2333
- completeSubform() {
2334
- if (!this._formRef) {
2335
- console.error("completeSubform: form ref is not set");
2336
- return;
2226
+ );
2227
+ }
2228
+ const GoabTemporaryNotificationCtrl = ({
2229
+ verticalPosition = "bottom",
2230
+ horizontalPosition = "center",
2231
+ testId,
2232
+ ...rest
2233
+ }) => {
2234
+ const el = react.useRef(null);
2235
+ const _props = calendarDate.transformProps(
2236
+ { "vertical-position": verticalPosition, "horizontal-position": horizontalPosition, ...rest },
2237
+ calendarDate.kebab
2238
+ );
2239
+ return /* @__PURE__ */ jsxRuntime.jsx(
2240
+ "goa-temp-notification-ctrl",
2241
+ {
2242
+ ref: el,
2243
+ ..._props,
2244
+ testid: testId
2337
2245
  }
2338
- if (this._isCompleting) {
2339
- console.warn("completeSubform: completion already in progress");
2246
+ );
2247
+ };
2248
+ function GoabText({
2249
+ as,
2250
+ tag,
2251
+ children,
2252
+ ...rest
2253
+ }) {
2254
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
2255
+ return /* @__PURE__ */ jsxRuntime.jsx(
2256
+ "goa-text",
2257
+ {
2258
+ as: tag || as,
2259
+ ..._props,
2260
+ children
2261
+ }
2262
+ );
2263
+ }
2264
+ function GoabTextArea({
2265
+ readOnly,
2266
+ disabled,
2267
+ error,
2268
+ onChange,
2269
+ onKeyPress,
2270
+ onBlur,
2271
+ ...rest
2272
+ }) {
2273
+ const el = react.useRef(null);
2274
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
2275
+ react.useEffect(() => {
2276
+ if (!el.current) {
2340
2277
  return;
2341
2278
  }
2342
- const formRef = this._formRef;
2343
- this._isCompleting = true;
2344
- const stateChangeHandler = (e) => {
2345
- formRef.removeEventListener("_stateChange", stateChangeHandler);
2346
- dispatch(formRef, "_complete", {}, { bubbles: true });
2347
- this._isCompleting = false;
2279
+ const current = el.current;
2280
+ const changeListener = (e) => {
2281
+ const detail = e.detail;
2282
+ onChange == null ? void 0 : onChange({ ...detail, event: e });
2348
2283
  };
2349
- formRef.addEventListener("_stateChange", stateChangeHandler);
2350
- dispatch(formRef, "_continue", null, { bubbles: true });
2351
- }
2352
- // removes any data collected that doesn't correspond with the final history path
2353
- clean(data) {
2354
- return data.history.reduce((acc, fieldsetId) => {
2355
- acc[fieldsetId] = data.form[fieldsetId];
2356
- return acc;
2357
- }, {});
2358
- }
2284
+ const keypressListener = (e) => {
2285
+ const detail = e.detail;
2286
+ onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
2287
+ };
2288
+ const blurListener = (e) => {
2289
+ const detail = e.detail;
2290
+ onBlur == null ? void 0 : onBlur({ ...detail, event: e });
2291
+ };
2292
+ current.addEventListener("_change", changeListener);
2293
+ current.addEventListener("_keyPress", keypressListener);
2294
+ current.addEventListener("_blur", blurListener);
2295
+ return () => {
2296
+ current.removeEventListener("_change", changeListener);
2297
+ current.removeEventListener("_keyPress", keypressListener);
2298
+ current.removeEventListener("_blur", blurListener);
2299
+ };
2300
+ }, [el, onChange, onKeyPress, onBlur]);
2301
+ return /* @__PURE__ */ jsxRuntime.jsx(
2302
+ "goa-textarea",
2303
+ {
2304
+ ref: el,
2305
+ readOnly: readOnly ? "true" : void 0,
2306
+ disabled: disabled ? "true" : void 0,
2307
+ error: error ? "true" : void 0,
2308
+ ..._props
2309
+ }
2310
+ );
2359
2311
  }
2360
- _PublicFormController_instances = new WeakSet();
2361
- updateObjectListState_fn = function(detail) {
2362
- var _a;
2363
- if (!Array.isArray(detail.data)) {
2364
- return;
2365
- }
2366
- if (Array.isArray(this.state)) {
2367
- return;
2368
- }
2369
- this.state = {
2370
- ...this.state,
2371
- form: {
2372
- ...((_a = this.state) == null ? void 0 : _a.form) || {},
2373
- [detail.id]: detail.data
2312
+ function GoabThreeColumnLayout(props) {
2313
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2314
+ "goa-three-column-layout",
2315
+ {
2316
+ leftcolumnwidth: props.leftColumnWidth,
2317
+ rightcolumnwidth: props.rightColumnWidth,
2318
+ maxcontentwidth: props.maxContentWidth,
2319
+ children: [
2320
+ props.header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: props.header }),
2321
+ props.nav && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "nav", children: props.nav }),
2322
+ props.sidebar && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: props.sidebar }),
2323
+ props.sideMenu && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "side-menu", children: props.sideMenu }),
2324
+ props.children,
2325
+ props.footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: props.footer })
2326
+ ]
2327
+ }
2328
+ );
2329
+ }
2330
+ function GoabTooltip({
2331
+ content,
2332
+ children,
2333
+ ...rest
2334
+ }) {
2335
+ const _props = calendarDate.transformProps(rest, calendarDate.lowercase);
2336
+ const isStringContent = typeof content === "string";
2337
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2338
+ "goa-tooltip",
2339
+ {
2340
+ content: isStringContent ? content : void 0,
2341
+ ..._props,
2342
+ children: [
2343
+ !isStringContent && content && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "content", children: content }),
2344
+ children
2345
+ ]
2346
+ }
2347
+ );
2348
+ }
2349
+ function GoabTwoColumnLayout(props) {
2350
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2351
+ "goa-two-column-layout",
2352
+ {
2353
+ navcolumnwidth: props.navColumnWidth,
2354
+ maxcontentwidth: props.maxContentWidth,
2355
+ children: [
2356
+ props.header && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "header", children: props.header }),
2357
+ props.nav && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "nav", children: props.nav }),
2358
+ props.children,
2359
+ props.footer && /* @__PURE__ */ jsxRuntime.jsx("div", { slot: "footer", children: props.footer })
2360
+ ]
2361
+ }
2362
+ );
2363
+ }
2364
+ const GoabFilterChip = ({
2365
+ iconTheme = "outline",
2366
+ error,
2367
+ onClick,
2368
+ ...rest
2369
+ }) => {
2370
+ const el = react.useRef(null);
2371
+ const _props = calendarDate.transformProps(
2372
+ { icontheme: iconTheme, ...rest },
2373
+ calendarDate.lowercase
2374
+ );
2375
+ react.useEffect(() => {
2376
+ if (!el.current) return;
2377
+ if (!onClick) return;
2378
+ const current = el.current;
2379
+ current.addEventListener("_click", onClick);
2380
+ return () => {
2381
+ current.removeEventListener("_click", onClick);
2382
+ };
2383
+ }, [el, onClick]);
2384
+ return /* @__PURE__ */ jsxRuntime.jsx(
2385
+ "goa-filter-chip",
2386
+ {
2387
+ ref: el,
2388
+ error: error ? "true" : void 0,
2389
+ ..._props
2374
2390
  }
2375
- };
2376
- };
2377
- // Private method to dispatch the error message to the form element
2378
- dispatchError_fn = function(el, name, msg, options) {
2379
- el.dispatchEvent(
2380
- new CustomEvent("msg", {
2381
- composed: true,
2382
- detail: {
2383
- action: "external::set:error",
2384
- data: {
2385
- name,
2386
- msg,
2387
- grouped: options == null ? void 0 : options.grouped
2388
- }
2389
- }
2390
- })
2391
2391
  );
2392
2392
  };
2393
2393
  function usePublicFormController(type = "details") {