@abgov/react-components 6.6.0-alpha.1 → 6.6.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -679,12 +679,17 @@ function GoabDropdown(props) {
679
679
  }
680
680
  const current = el.current;
681
681
  const handler = (e) => {
682
+ var _a;
682
683
  const detail = e.detail;
683
- props.onChange(detail);
684
+ (_a = props.onChange) == null ? void 0 : _a.call(props, detail);
684
685
  };
685
- current.addEventListener("_change", handler);
686
+ if (props.onChange) {
687
+ current.addEventListener("_change", handler);
688
+ }
686
689
  return () => {
687
- current.removeEventListener("_change", handler);
690
+ if (props.onChange) {
691
+ current.removeEventListener("_change", handler);
692
+ }
688
693
  };
689
694
  }, [el, props]);
690
695
  return /* @__PURE__ */ jsx(
@@ -1041,6 +1046,96 @@ function GoabPublicForm({
1041
1046
  }
1042
1047
  );
1043
1048
  }
1049
+ function GoabPublicSubform({
1050
+ id = "",
1051
+ name = "",
1052
+ continueMsg = "",
1053
+ onInit,
1054
+ onStateChange,
1055
+ children,
1056
+ mt,
1057
+ mr,
1058
+ mb,
1059
+ ml
1060
+ }) {
1061
+ const ref = useRef(null);
1062
+ useEffect(() => {
1063
+ if (!ref.current) return;
1064
+ const current = ref.current;
1065
+ const initListener = (e) => {
1066
+ onInit == null ? void 0 : onInit(e);
1067
+ };
1068
+ const stateChangeListener = (e) => {
1069
+ onStateChange == null ? void 0 : onStateChange(e);
1070
+ };
1071
+ if (onInit) {
1072
+ current.addEventListener("_init", initListener);
1073
+ }
1074
+ if (onStateChange) {
1075
+ current.addEventListener("_stateChange", stateChangeListener);
1076
+ }
1077
+ return () => {
1078
+ if (onInit) {
1079
+ current.removeEventListener("_init", initListener);
1080
+ }
1081
+ if (onStateChange) {
1082
+ current.removeEventListener("_stateChange", stateChangeListener);
1083
+ }
1084
+ };
1085
+ }, [ref, onInit, onStateChange]);
1086
+ return /* @__PURE__ */ jsx(
1087
+ "goa-public-subform",
1088
+ {
1089
+ ref,
1090
+ id,
1091
+ name,
1092
+ "continue-msg": continueMsg,
1093
+ mt,
1094
+ mr,
1095
+ mb,
1096
+ ml,
1097
+ children
1098
+ }
1099
+ );
1100
+ }
1101
+ function GoabPublicSubformIndex({
1102
+ heading = "",
1103
+ sectionTitle = "",
1104
+ actionButtonText = "",
1105
+ buttonVisibility = "hidden",
1106
+ children,
1107
+ mt,
1108
+ mr,
1109
+ mb,
1110
+ ml
1111
+ }) {
1112
+ const ref = useRef(null);
1113
+ return /* @__PURE__ */ jsx(
1114
+ "goa-public-subform-index",
1115
+ {
1116
+ ref,
1117
+ heading,
1118
+ "section-title": sectionTitle,
1119
+ "action-button-text": actionButtonText,
1120
+ "button-visibility": buttonVisibility,
1121
+ slot: "subform-index",
1122
+ mt,
1123
+ mr,
1124
+ mb,
1125
+ ml,
1126
+ children
1127
+ }
1128
+ );
1129
+ }
1130
+ function GoabPublicFormTask({ status, children }) {
1131
+ return /* @__PURE__ */ jsx("goa-public-form-task", { status, children });
1132
+ }
1133
+ function GoabPublicFormTaskList({
1134
+ heading,
1135
+ children
1136
+ }) {
1137
+ return /* @__PURE__ */ jsx("goa-public-form-task-list", { heading, children });
1138
+ }
1044
1139
  function GoabFormItem({
1045
1140
  children,
1046
1141
  helpText,
@@ -4168,6 +4263,10 @@ export {
4168
4263
  GoabPublicForm,
4169
4264
  GoabPublicFormPage,
4170
4265
  GoabPublicFormSummary,
4266
+ GoabPublicFormTask,
4267
+ GoabPublicFormTaskList,
4268
+ GoabPublicSubform,
4269
+ GoabPublicSubformIndex,
4171
4270
  GoabRadioGroup,
4172
4271
  GoabRadioItem,
4173
4272
  GoabSideMenu,