@abgov/react-components 6.10.0-dev.11 → 6.10.0-dev.13
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 +39 -34
- package/index.js.map +1 -1
- package/index.mjs +39 -34
- package/index.mjs.map +1 -1
- package/lib/tab/tab.d.ts +3 -1
- package/lib/tabs/tabs.d.ts +4 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -336,7 +336,7 @@ function GoabCheckbox({
|
|
|
336
336
|
const current = el.current;
|
|
337
337
|
const listener = (e) => {
|
|
338
338
|
const detail = e.detail;
|
|
339
|
-
onChange == null ? void 0 : onChange(detail);
|
|
339
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
340
340
|
};
|
|
341
341
|
current.addEventListener("_change", listener);
|
|
342
342
|
return () => {
|
|
@@ -384,7 +384,7 @@ function GoabCheckboxList({
|
|
|
384
384
|
const listener = (e) => {
|
|
385
385
|
try {
|
|
386
386
|
const detail = e.detail;
|
|
387
|
-
onChange == null ? void 0 : onChange(detail);
|
|
387
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
388
388
|
} catch (error2) {
|
|
389
389
|
console.error("Error handling checkbox list change:", error2);
|
|
390
390
|
}
|
|
@@ -525,7 +525,7 @@ function GoabDatePicker({
|
|
|
525
525
|
const current = ref.current;
|
|
526
526
|
const handleChange = (e) => {
|
|
527
527
|
const detail = e.detail;
|
|
528
|
-
onChange == null ? void 0 : onChange(detail);
|
|
528
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
529
529
|
};
|
|
530
530
|
if (onChange) {
|
|
531
531
|
current.addEventListener("_change", handleChange);
|
|
@@ -614,7 +614,7 @@ function GoabDropdown({
|
|
|
614
614
|
const current = el.current;
|
|
615
615
|
const handler = (e) => {
|
|
616
616
|
const detail = e.detail;
|
|
617
|
-
onChange == null ? void 0 : onChange(detail);
|
|
617
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
618
618
|
};
|
|
619
619
|
if (onChange) {
|
|
620
620
|
current.addEventListener("_change", handler);
|
|
@@ -676,8 +676,8 @@ function GoabFileUploadCard({
|
|
|
676
676
|
useEffect(() => {
|
|
677
677
|
if (!el.current) return;
|
|
678
678
|
const current = el.current;
|
|
679
|
-
const deleteHandler = () => onDelete == null ? void 0 : onDelete({ filename });
|
|
680
|
-
const cancelHandler = () => onCancel == null ? void 0 : onCancel({ filename });
|
|
679
|
+
const deleteHandler = (event) => onDelete == null ? void 0 : onDelete({ filename, event });
|
|
680
|
+
const cancelHandler = (event) => onCancel == null ? void 0 : onCancel({ filename, event });
|
|
681
681
|
current.addEventListener("_delete", deleteHandler);
|
|
682
682
|
current.addEventListener("_cancel", cancelHandler);
|
|
683
683
|
return () => {
|
|
@@ -698,7 +698,7 @@ function GoabFileUploadInput({
|
|
|
698
698
|
const current = el.current;
|
|
699
699
|
const handler = (e) => {
|
|
700
700
|
const detail = e.detail;
|
|
701
|
-
onSelectFile(detail);
|
|
701
|
+
onSelectFile({ ...detail, event: e });
|
|
702
702
|
};
|
|
703
703
|
current.addEventListener("_selectFile", handler);
|
|
704
704
|
return () => {
|
|
@@ -2762,22 +2762,22 @@ function GoabInput({
|
|
|
2762
2762
|
const current = ref.current;
|
|
2763
2763
|
const changeListener = (e) => {
|
|
2764
2764
|
const detail = e.detail;
|
|
2765
|
-
onChange == null ? void 0 : onChange(detail);
|
|
2765
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2766
2766
|
};
|
|
2767
2767
|
const clickListener = () => {
|
|
2768
2768
|
onTrailingIconClick == null ? void 0 : onTrailingIconClick();
|
|
2769
2769
|
};
|
|
2770
2770
|
const focusListener = (e) => {
|
|
2771
2771
|
const detail = e.detail;
|
|
2772
|
-
onFocus == null ? void 0 : onFocus(detail);
|
|
2772
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
2773
2773
|
};
|
|
2774
2774
|
const blurListener = (e) => {
|
|
2775
2775
|
const detail = e.detail;
|
|
2776
|
-
onBlur == null ? void 0 : onBlur(detail);
|
|
2776
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
2777
2777
|
};
|
|
2778
2778
|
const keypressListener = (e) => {
|
|
2779
2779
|
const detail = e.detail;
|
|
2780
|
-
onKeyPress == null ? void 0 : onKeyPress(detail);
|
|
2780
|
+
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
2781
2781
|
};
|
|
2782
2782
|
current.addEventListener("_change", changeListener);
|
|
2783
2783
|
current.addEventListener("_trailingIconClick", clickListener);
|
|
@@ -2810,28 +2810,28 @@ function GoabInput({
|
|
|
2810
2810
|
);
|
|
2811
2811
|
}
|
|
2812
2812
|
const onDateChangeHandler = (onChange) => {
|
|
2813
|
-
return ({ name, value }) => {
|
|
2813
|
+
return ({ name, value, event }) => {
|
|
2814
2814
|
if (!value) {
|
|
2815
|
-
onChange == null ? void 0 : onChange({ name, value: "" });
|
|
2815
|
+
onChange == null ? void 0 : onChange({ name, value: "", event });
|
|
2816
2816
|
return;
|
|
2817
2817
|
}
|
|
2818
2818
|
if (typeof value === "string" && isValid(new Date(value))) {
|
|
2819
|
-
onChange == null ? void 0 : onChange({ name, value: parseISO(value) });
|
|
2819
|
+
onChange == null ? void 0 : onChange({ name, value: parseISO(value), event });
|
|
2820
2820
|
return;
|
|
2821
2821
|
}
|
|
2822
2822
|
if (isValid(value)) {
|
|
2823
|
-
onChange == null ? void 0 : onChange({ name, value });
|
|
2823
|
+
onChange == null ? void 0 : onChange({ name, value, event });
|
|
2824
2824
|
return;
|
|
2825
2825
|
}
|
|
2826
2826
|
};
|
|
2827
2827
|
};
|
|
2828
2828
|
const onTimeChangeHandler = (onChange) => {
|
|
2829
|
-
return ({ name, value }) => {
|
|
2829
|
+
return ({ name, value, event }) => {
|
|
2830
2830
|
if (!value) {
|
|
2831
|
-
onChange == null ? void 0 : onChange({ name, value: "" });
|
|
2831
|
+
onChange == null ? void 0 : onChange({ name, value: "", event });
|
|
2832
2832
|
return;
|
|
2833
2833
|
}
|
|
2834
|
-
onChange == null ? void 0 : onChange({ name, value });
|
|
2834
|
+
onChange == null ? void 0 : onChange({ name, value, event });
|
|
2835
2835
|
};
|
|
2836
2836
|
};
|
|
2837
2837
|
function toString(value, tmpl = "yyyy-MM-dd") {
|
|
@@ -2923,7 +2923,11 @@ function GoabInputFile(props) {
|
|
|
2923
2923
|
type: "file",
|
|
2924
2924
|
onChange: (e) => {
|
|
2925
2925
|
var _a;
|
|
2926
|
-
return (_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
2926
|
+
return (_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
2927
|
+
name: e.target.name,
|
|
2928
|
+
value: e.target.value,
|
|
2929
|
+
event: e.nativeEvent
|
|
2930
|
+
});
|
|
2927
2931
|
},
|
|
2928
2932
|
style: { backgroundColor: "revert" }
|
|
2929
2933
|
}
|
|
@@ -2939,21 +2943,21 @@ function GoabInputNumber({
|
|
|
2939
2943
|
textAlign = "right",
|
|
2940
2944
|
...props
|
|
2941
2945
|
}) {
|
|
2942
|
-
const onNumberChange = ({ name, value: value2 }) => {
|
|
2946
|
+
const onNumberChange = ({ name, value: value2, event }) => {
|
|
2943
2947
|
var _a;
|
|
2944
|
-
(_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2) });
|
|
2948
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
|
|
2945
2949
|
};
|
|
2946
|
-
const onFocus = ({ name, value: value2 }) => {
|
|
2950
|
+
const onFocus = ({ name, value: value2, event }) => {
|
|
2947
2951
|
var _a;
|
|
2948
|
-
(_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2) });
|
|
2952
|
+
(_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
|
|
2949
2953
|
};
|
|
2950
|
-
const onBlur = ({ name, value: value2 }) => {
|
|
2954
|
+
const onBlur = ({ name, value: value2, event }) => {
|
|
2951
2955
|
var _a;
|
|
2952
|
-
(_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2) });
|
|
2956
|
+
(_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
|
|
2953
2957
|
};
|
|
2954
|
-
const onKeyPress = ({ name, value: value2, key }) => {
|
|
2958
|
+
const onKeyPress = ({ name, value: value2, key, event }) => {
|
|
2955
2959
|
var _a;
|
|
2956
|
-
(_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key) });
|
|
2960
|
+
(_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key), event });
|
|
2957
2961
|
};
|
|
2958
2962
|
return /* @__PURE__ */ jsx(
|
|
2959
2963
|
GoabInput,
|
|
@@ -3305,7 +3309,7 @@ function GoabRadioGroup({
|
|
|
3305
3309
|
if (!el.current) return;
|
|
3306
3310
|
const listener = (e) => {
|
|
3307
3311
|
const detail = e.detail;
|
|
3308
|
-
onChange == null ? void 0 : onChange(detail);
|
|
3312
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
3309
3313
|
};
|
|
3310
3314
|
const currentEl = el.current;
|
|
3311
3315
|
if (onChange) {
|
|
@@ -3449,6 +3453,7 @@ function GoabTabs({
|
|
|
3449
3453
|
initialTab,
|
|
3450
3454
|
children,
|
|
3451
3455
|
testId,
|
|
3456
|
+
variant,
|
|
3452
3457
|
onChange
|
|
3453
3458
|
}) {
|
|
3454
3459
|
const ref = useRef(null);
|
|
@@ -3465,10 +3470,10 @@ function GoabTabs({
|
|
|
3465
3470
|
};
|
|
3466
3471
|
}
|
|
3467
3472
|
}, [onChange]);
|
|
3468
|
-
return /* @__PURE__ */ jsx("goa-tabs", { ref, initialtab: initialTab, testid: testId, children });
|
|
3473
|
+
return /* @__PURE__ */ jsx("goa-tabs", { ref, initialtab: initialTab, testid: testId, variant, children });
|
|
3469
3474
|
}
|
|
3470
|
-
function GoabTab({ heading, children }) {
|
|
3471
|
-
return /* @__PURE__ */ jsxs("goa-tab", { children: [
|
|
3475
|
+
function GoabTab({ heading, disabled, children }) {
|
|
3476
|
+
return /* @__PURE__ */ jsxs("goa-tab", { disabled: disabled ? "true" : void 0, children: [
|
|
3472
3477
|
heading && /* @__PURE__ */ jsx("span", { slot: "heading", children: heading }),
|
|
3473
3478
|
children
|
|
3474
3479
|
] });
|
|
@@ -3527,15 +3532,15 @@ function GoabTextArea({
|
|
|
3527
3532
|
const current = el.current;
|
|
3528
3533
|
const changeListener = (e) => {
|
|
3529
3534
|
const detail = e.detail;
|
|
3530
|
-
onChange == null ? void 0 : onChange(detail);
|
|
3535
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
3531
3536
|
};
|
|
3532
3537
|
const keypressListener = (e) => {
|
|
3533
3538
|
const detail = e.detail;
|
|
3534
|
-
onKeyPress == null ? void 0 : onKeyPress(detail);
|
|
3539
|
+
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
3535
3540
|
};
|
|
3536
3541
|
const blurListener = (e) => {
|
|
3537
3542
|
const detail = e.detail;
|
|
3538
|
-
onBlur == null ? void 0 : onBlur(detail);
|
|
3543
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
3539
3544
|
};
|
|
3540
3545
|
current.addEventListener("_change", changeListener);
|
|
3541
3546
|
current.addEventListener("_keyPress", keypressListener);
|