@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.d.ts CHANGED
@@ -26,6 +26,10 @@ export * from './lib/form/fieldset';
26
26
  export * from './lib/form/public-form-page';
27
27
  export * from './lib/form/public-form-summary';
28
28
  export * from './lib/form/public-form';
29
+ export * from './lib/form/public-subform';
30
+ export * from './lib/form/public-subform-index';
31
+ export * from './lib/form/task';
32
+ export * from './lib/form/task-list';
29
33
  export * from './lib/form-item/form-item';
30
34
  export * from './lib/form-step/form-step';
31
35
  export * from './lib/form-stepper/form-stepper';
package/index.js CHANGED
@@ -681,12 +681,17 @@ function GoabDropdown(props) {
681
681
  }
682
682
  const current = el.current;
683
683
  const handler = (e) => {
684
+ var _a;
684
685
  const detail = e.detail;
685
- props.onChange(detail);
686
+ (_a = props.onChange) == null ? void 0 : _a.call(props, detail);
686
687
  };
687
- current.addEventListener("_change", handler);
688
+ if (props.onChange) {
689
+ current.addEventListener("_change", handler);
690
+ }
688
691
  return () => {
689
- current.removeEventListener("_change", handler);
692
+ if (props.onChange) {
693
+ current.removeEventListener("_change", handler);
694
+ }
690
695
  };
691
696
  }, [el, props]);
692
697
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1043,6 +1048,96 @@ function GoabPublicForm({
1043
1048
  }
1044
1049
  );
1045
1050
  }
1051
+ function GoabPublicSubform({
1052
+ id = "",
1053
+ name = "",
1054
+ continueMsg = "",
1055
+ onInit,
1056
+ onStateChange,
1057
+ children,
1058
+ mt,
1059
+ mr,
1060
+ mb,
1061
+ ml
1062
+ }) {
1063
+ const ref = react.useRef(null);
1064
+ react.useEffect(() => {
1065
+ if (!ref.current) return;
1066
+ const current = ref.current;
1067
+ const initListener = (e) => {
1068
+ onInit == null ? void 0 : onInit(e);
1069
+ };
1070
+ const stateChangeListener = (e) => {
1071
+ onStateChange == null ? void 0 : onStateChange(e);
1072
+ };
1073
+ if (onInit) {
1074
+ current.addEventListener("_init", initListener);
1075
+ }
1076
+ if (onStateChange) {
1077
+ current.addEventListener("_stateChange", stateChangeListener);
1078
+ }
1079
+ return () => {
1080
+ if (onInit) {
1081
+ current.removeEventListener("_init", initListener);
1082
+ }
1083
+ if (onStateChange) {
1084
+ current.removeEventListener("_stateChange", stateChangeListener);
1085
+ }
1086
+ };
1087
+ }, [ref, onInit, onStateChange]);
1088
+ return /* @__PURE__ */ jsxRuntime.jsx(
1089
+ "goa-public-subform",
1090
+ {
1091
+ ref,
1092
+ id,
1093
+ name,
1094
+ "continue-msg": continueMsg,
1095
+ mt,
1096
+ mr,
1097
+ mb,
1098
+ ml,
1099
+ children
1100
+ }
1101
+ );
1102
+ }
1103
+ function GoabPublicSubformIndex({
1104
+ heading = "",
1105
+ sectionTitle = "",
1106
+ actionButtonText = "",
1107
+ buttonVisibility = "hidden",
1108
+ children,
1109
+ mt,
1110
+ mr,
1111
+ mb,
1112
+ ml
1113
+ }) {
1114
+ const ref = react.useRef(null);
1115
+ return /* @__PURE__ */ jsxRuntime.jsx(
1116
+ "goa-public-subform-index",
1117
+ {
1118
+ ref,
1119
+ heading,
1120
+ "section-title": sectionTitle,
1121
+ "action-button-text": actionButtonText,
1122
+ "button-visibility": buttonVisibility,
1123
+ slot: "subform-index",
1124
+ mt,
1125
+ mr,
1126
+ mb,
1127
+ ml,
1128
+ children
1129
+ }
1130
+ );
1131
+ }
1132
+ function GoabPublicFormTask({ status, children }) {
1133
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task", { status, children });
1134
+ }
1135
+ function GoabPublicFormTaskList({
1136
+ heading,
1137
+ children
1138
+ }) {
1139
+ return /* @__PURE__ */ jsxRuntime.jsx("goa-public-form-task-list", { heading, children });
1140
+ }
1046
1141
  function GoabFormItem({
1047
1142
  children,
1048
1143
  helpText,
@@ -4169,6 +4264,10 @@ exports.GoabPopover = GoabPopover;
4169
4264
  exports.GoabPublicForm = GoabPublicForm;
4170
4265
  exports.GoabPublicFormPage = GoabPublicFormPage;
4171
4266
  exports.GoabPublicFormSummary = GoabPublicFormSummary;
4267
+ exports.GoabPublicFormTask = GoabPublicFormTask;
4268
+ exports.GoabPublicFormTaskList = GoabPublicFormTaskList;
4269
+ exports.GoabPublicSubform = GoabPublicSubform;
4270
+ exports.GoabPublicSubformIndex = GoabPublicSubformIndex;
4172
4271
  exports.GoabRadioGroup = GoabRadioGroup;
4173
4272
  exports.GoabRadioItem = GoabRadioItem;
4174
4273
  exports.GoabSideMenu = GoabSideMenu;