@abgov/react-components 6.6.0-alpha.3 → 6.6.0-alpha.4
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 +2 -0
- package/index.js +79 -68
- package/index.js.map +1 -1
- package/index.mjs +79 -68
- package/index.mjs.map +1 -1
- package/lib/form/fieldset.d.ts +4 -5
- package/lib/form/public-form-page.d.ts +2 -21
- package/lib/form/task-list.d.ts +5 -5
- package/lib/form/task.d.ts +4 -4
- package/lib/temporary-notification/temporary-notification.d.ts +33 -0
- package/lib/temporary-notification-ctrl/temporary-notification-ctrl.d.ts +23 -0
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -848,17 +848,12 @@ function GoabFieldset({
|
|
|
848
848
|
sectionTitle,
|
|
849
849
|
dispatchOn,
|
|
850
850
|
onContinue,
|
|
851
|
-
onChange,
|
|
852
851
|
children
|
|
853
852
|
}) {
|
|
854
853
|
const ref = useRef(null);
|
|
855
854
|
useEffect(() => {
|
|
856
855
|
if (!ref.current) return;
|
|
857
856
|
const current = ref.current;
|
|
858
|
-
const changeListener = (e) => {
|
|
859
|
-
const detail = e.detail;
|
|
860
|
-
onChange == null ? void 0 : onChange(detail);
|
|
861
|
-
};
|
|
862
857
|
const continueListener = (e) => {
|
|
863
858
|
const event = e.detail;
|
|
864
859
|
return onContinue == null ? void 0 : onContinue(event);
|
|
@@ -866,16 +861,10 @@ function GoabFieldset({
|
|
|
866
861
|
if (onContinue) {
|
|
867
862
|
current.addEventListener("_continue", continueListener);
|
|
868
863
|
}
|
|
869
|
-
if (onChange) {
|
|
870
|
-
current.addEventListener("_change", changeListener);
|
|
871
|
-
}
|
|
872
864
|
return () => {
|
|
873
865
|
if (onContinue) {
|
|
874
866
|
current.removeEventListener("_continue", continueListener);
|
|
875
867
|
}
|
|
876
|
-
if (onChange) {
|
|
877
|
-
current.removeEventListener("_change", changeListener);
|
|
878
|
-
}
|
|
879
868
|
};
|
|
880
869
|
}, [ref, onContinue]);
|
|
881
870
|
return /* @__PURE__ */ jsx(
|
|
@@ -899,12 +888,7 @@ function GoabPublicFormPage({
|
|
|
899
888
|
type = "step",
|
|
900
889
|
buttonText = "",
|
|
901
890
|
buttonVisibility = "visible",
|
|
902
|
-
first = false,
|
|
903
|
-
last = false,
|
|
904
891
|
onContinue,
|
|
905
|
-
onBack,
|
|
906
|
-
onFieldsetChange,
|
|
907
|
-
onComplete,
|
|
908
892
|
children,
|
|
909
893
|
mt,
|
|
910
894
|
mr,
|
|
@@ -918,44 +902,15 @@ function GoabPublicFormPage({
|
|
|
918
902
|
const continueListener = (e) => {
|
|
919
903
|
onContinue == null ? void 0 : onContinue(e);
|
|
920
904
|
};
|
|
921
|
-
const backListener = (e) => {
|
|
922
|
-
onBack == null ? void 0 : onBack(e);
|
|
923
|
-
};
|
|
924
|
-
const fieldsetChangeListener = (e) => {
|
|
925
|
-
const detail = e.detail;
|
|
926
|
-
onFieldsetChange == null ? void 0 : onFieldsetChange(detail);
|
|
927
|
-
};
|
|
928
|
-
const completeListener = (e) => {
|
|
929
|
-
const detail = e.detail;
|
|
930
|
-
onComplete == null ? void 0 : onComplete(detail);
|
|
931
|
-
};
|
|
932
905
|
if (onContinue) {
|
|
933
906
|
current.addEventListener("_continue", continueListener);
|
|
934
907
|
}
|
|
935
|
-
if (onBack) {
|
|
936
|
-
current.addEventListener("_back", backListener);
|
|
937
|
-
}
|
|
938
|
-
if (onFieldsetChange) {
|
|
939
|
-
current.addEventListener("_fieldsetChange", fieldsetChangeListener);
|
|
940
|
-
}
|
|
941
|
-
if (onComplete) {
|
|
942
|
-
current.addEventListener("_complete", completeListener);
|
|
943
|
-
}
|
|
944
908
|
return () => {
|
|
945
909
|
if (onContinue) {
|
|
946
910
|
current.removeEventListener("_continue", continueListener);
|
|
947
911
|
}
|
|
948
|
-
if (onBack) {
|
|
949
|
-
current.removeEventListener("_back", backListener);
|
|
950
|
-
}
|
|
951
|
-
if (onFieldsetChange) {
|
|
952
|
-
current.removeEventListener("_fieldsetChange", fieldsetChangeListener);
|
|
953
|
-
}
|
|
954
|
-
if (onComplete) {
|
|
955
|
-
current.removeEventListener("_complete", completeListener);
|
|
956
|
-
}
|
|
957
912
|
};
|
|
958
|
-
}, [ref, onContinue
|
|
913
|
+
}, [ref, onContinue]);
|
|
959
914
|
return /* @__PURE__ */ jsx(
|
|
960
915
|
"goa-public-form-page",
|
|
961
916
|
{
|
|
@@ -968,8 +923,6 @@ function GoabPublicFormPage({
|
|
|
968
923
|
type,
|
|
969
924
|
"button-text": buttonText,
|
|
970
925
|
"button-visibility": buttonVisibility,
|
|
971
|
-
first,
|
|
972
|
-
last,
|
|
973
926
|
"summary-heading": summaryHeading,
|
|
974
927
|
mt,
|
|
975
928
|
mr,
|
|
@@ -1127,14 +1080,28 @@ function GoabPublicSubformIndex({
|
|
|
1127
1080
|
}
|
|
1128
1081
|
);
|
|
1129
1082
|
}
|
|
1130
|
-
function GoabPublicFormTask({ status, children }) {
|
|
1083
|
+
function GoabPublicFormTask({ status = "cannot-start", children }) {
|
|
1131
1084
|
return /* @__PURE__ */ jsx("goa-public-form-task", { status, children });
|
|
1132
1085
|
}
|
|
1133
1086
|
function GoabPublicFormTaskList({
|
|
1134
|
-
heading,
|
|
1135
|
-
children
|
|
1087
|
+
heading = "",
|
|
1088
|
+
children,
|
|
1089
|
+
mt,
|
|
1090
|
+
mr,
|
|
1091
|
+
mb,
|
|
1092
|
+
ml
|
|
1136
1093
|
}) {
|
|
1137
|
-
return /* @__PURE__ */ jsx(
|
|
1094
|
+
return /* @__PURE__ */ jsx(
|
|
1095
|
+
"goa-public-form-task-list",
|
|
1096
|
+
{
|
|
1097
|
+
heading,
|
|
1098
|
+
mt,
|
|
1099
|
+
mr,
|
|
1100
|
+
mb,
|
|
1101
|
+
ml,
|
|
1102
|
+
children
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1138
1105
|
}
|
|
1139
1106
|
function GoabFormItem({
|
|
1140
1107
|
children,
|
|
@@ -3696,6 +3663,48 @@ function GoabTab({ heading, children }) {
|
|
|
3696
3663
|
children
|
|
3697
3664
|
] });
|
|
3698
3665
|
}
|
|
3666
|
+
const GoabTemporaryNotification = ({
|
|
3667
|
+
message: message2 = "",
|
|
3668
|
+
type = "basic",
|
|
3669
|
+
duration,
|
|
3670
|
+
progress,
|
|
3671
|
+
testId,
|
|
3672
|
+
actionText,
|
|
3673
|
+
visible = true,
|
|
3674
|
+
animationDirection = "down"
|
|
3675
|
+
}) => {
|
|
3676
|
+
const el = useRef(null);
|
|
3677
|
+
return /* @__PURE__ */ jsx(
|
|
3678
|
+
"goa-temp-notification",
|
|
3679
|
+
{
|
|
3680
|
+
ref: el,
|
|
3681
|
+
message: message2,
|
|
3682
|
+
type,
|
|
3683
|
+
duration,
|
|
3684
|
+
progress,
|
|
3685
|
+
testid: testId,
|
|
3686
|
+
"action-text": actionText,
|
|
3687
|
+
visible,
|
|
3688
|
+
"animation-direction": animationDirection
|
|
3689
|
+
}
|
|
3690
|
+
);
|
|
3691
|
+
};
|
|
3692
|
+
const GoabTemporaryNotificationCtrl = ({
|
|
3693
|
+
verticalPosition = "bottom",
|
|
3694
|
+
horizontalPosition = "center",
|
|
3695
|
+
testId
|
|
3696
|
+
}) => {
|
|
3697
|
+
const el = useRef(null);
|
|
3698
|
+
return /* @__PURE__ */ jsx(
|
|
3699
|
+
"goa-temp-notification-ctrl",
|
|
3700
|
+
{
|
|
3701
|
+
ref: el,
|
|
3702
|
+
"vertical-position": verticalPosition,
|
|
3703
|
+
"horizontal-position": horizontalPosition,
|
|
3704
|
+
testid: testId
|
|
3705
|
+
}
|
|
3706
|
+
);
|
|
3707
|
+
};
|
|
3699
3708
|
function GoabText(props) {
|
|
3700
3709
|
return /* @__PURE__ */ jsx(
|
|
3701
3710
|
"goa-text",
|
|
@@ -3877,6 +3886,22 @@ const GoabFilterChip = ({
|
|
|
3877
3886
|
}
|
|
3878
3887
|
);
|
|
3879
3888
|
};
|
|
3889
|
+
function relay(el, eventName, data, opts) {
|
|
3890
|
+
if (!el) {
|
|
3891
|
+
console.error("dispatch element is null");
|
|
3892
|
+
return;
|
|
3893
|
+
}
|
|
3894
|
+
el.dispatchEvent(
|
|
3895
|
+
new CustomEvent("msg", {
|
|
3896
|
+
composed: true,
|
|
3897
|
+
bubbles: opts == null ? void 0 : opts.bubbles,
|
|
3898
|
+
detail: {
|
|
3899
|
+
action: eventName,
|
|
3900
|
+
data
|
|
3901
|
+
}
|
|
3902
|
+
})
|
|
3903
|
+
);
|
|
3904
|
+
}
|
|
3880
3905
|
class PublicFormController {
|
|
3881
3906
|
constructor(type) {
|
|
3882
3907
|
__privateAdd(this, _PublicFormController_instances);
|
|
@@ -4107,22 +4132,6 @@ dispatchError_fn = function(el, name, msg, options) {
|
|
|
4107
4132
|
})
|
|
4108
4133
|
);
|
|
4109
4134
|
};
|
|
4110
|
-
function relay(el, eventName, data, opts) {
|
|
4111
|
-
if (!el) {
|
|
4112
|
-
console.error("dispatch element is null");
|
|
4113
|
-
return;
|
|
4114
|
-
}
|
|
4115
|
-
el.dispatchEvent(
|
|
4116
|
-
new CustomEvent("msg", {
|
|
4117
|
-
composed: true,
|
|
4118
|
-
bubbles: opts == null ? void 0 : opts.bubbles,
|
|
4119
|
-
detail: {
|
|
4120
|
-
action: eventName,
|
|
4121
|
-
data
|
|
4122
|
-
}
|
|
4123
|
-
})
|
|
4124
|
-
);
|
|
4125
|
-
}
|
|
4126
4135
|
function usePublicFormController(type = "details") {
|
|
4127
4136
|
const controllerRef = useRef(new PublicFormController(type));
|
|
4128
4137
|
const [state, setState] = useState(void 0);
|
|
@@ -4280,6 +4289,8 @@ export {
|
|
|
4280
4289
|
GoabTable,
|
|
4281
4290
|
GoabTableSortHeader,
|
|
4282
4291
|
GoabTabs,
|
|
4292
|
+
GoabTemporaryNotification,
|
|
4293
|
+
GoabTemporaryNotificationCtrl,
|
|
4283
4294
|
GoabText,
|
|
4284
4295
|
GoabTextArea,
|
|
4285
4296
|
GoabTextArea as GoabTextarea,
|