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