@abgov/react-components 6.10.0-dev.11 → 6.10.0-dev.12
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 +35 -31
- package/index.js.map +1 -1
- package/index.mjs +35 -31
- package/index.mjs.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -337,7 +337,7 @@ function GoabCheckbox({
|
|
|
337
337
|
const current = el.current;
|
|
338
338
|
const listener = (e) => {
|
|
339
339
|
const detail = e.detail;
|
|
340
|
-
onChange == null ? void 0 : onChange(detail);
|
|
340
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
341
341
|
};
|
|
342
342
|
current.addEventListener("_change", listener);
|
|
343
343
|
return () => {
|
|
@@ -385,7 +385,7 @@ function GoabCheckboxList({
|
|
|
385
385
|
const listener = (e) => {
|
|
386
386
|
try {
|
|
387
387
|
const detail = e.detail;
|
|
388
|
-
onChange == null ? void 0 : onChange(detail);
|
|
388
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
389
389
|
} catch (error2) {
|
|
390
390
|
console.error("Error handling checkbox list change:", error2);
|
|
391
391
|
}
|
|
@@ -526,7 +526,7 @@ function GoabDatePicker({
|
|
|
526
526
|
const current = ref.current;
|
|
527
527
|
const handleChange = (e) => {
|
|
528
528
|
const detail = e.detail;
|
|
529
|
-
onChange == null ? void 0 : onChange(detail);
|
|
529
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
530
530
|
};
|
|
531
531
|
if (onChange) {
|
|
532
532
|
current.addEventListener("_change", handleChange);
|
|
@@ -615,7 +615,7 @@ function GoabDropdown({
|
|
|
615
615
|
const current = el.current;
|
|
616
616
|
const handler = (e) => {
|
|
617
617
|
const detail = e.detail;
|
|
618
|
-
onChange == null ? void 0 : onChange(detail);
|
|
618
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
619
619
|
};
|
|
620
620
|
if (onChange) {
|
|
621
621
|
current.addEventListener("_change", handler);
|
|
@@ -677,8 +677,8 @@ function GoabFileUploadCard({
|
|
|
677
677
|
react.useEffect(() => {
|
|
678
678
|
if (!el.current) return;
|
|
679
679
|
const current = el.current;
|
|
680
|
-
const deleteHandler = () => onDelete == null ? void 0 : onDelete({ filename });
|
|
681
|
-
const cancelHandler = () => onCancel == null ? void 0 : onCancel({ filename });
|
|
680
|
+
const deleteHandler = (event) => onDelete == null ? void 0 : onDelete({ filename, event });
|
|
681
|
+
const cancelHandler = (event) => onCancel == null ? void 0 : onCancel({ filename, event });
|
|
682
682
|
current.addEventListener("_delete", deleteHandler);
|
|
683
683
|
current.addEventListener("_cancel", cancelHandler);
|
|
684
684
|
return () => {
|
|
@@ -699,7 +699,7 @@ function GoabFileUploadInput({
|
|
|
699
699
|
const current = el.current;
|
|
700
700
|
const handler = (e) => {
|
|
701
701
|
const detail = e.detail;
|
|
702
|
-
onSelectFile(detail);
|
|
702
|
+
onSelectFile({ ...detail, event: e });
|
|
703
703
|
};
|
|
704
704
|
current.addEventListener("_selectFile", handler);
|
|
705
705
|
return () => {
|
|
@@ -2763,22 +2763,22 @@ function GoabInput({
|
|
|
2763
2763
|
const current = ref.current;
|
|
2764
2764
|
const changeListener = (e) => {
|
|
2765
2765
|
const detail = e.detail;
|
|
2766
|
-
onChange == null ? void 0 : onChange(detail);
|
|
2766
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
2767
2767
|
};
|
|
2768
2768
|
const clickListener = () => {
|
|
2769
2769
|
onTrailingIconClick == null ? void 0 : onTrailingIconClick();
|
|
2770
2770
|
};
|
|
2771
2771
|
const focusListener = (e) => {
|
|
2772
2772
|
const detail = e.detail;
|
|
2773
|
-
onFocus == null ? void 0 : onFocus(detail);
|
|
2773
|
+
onFocus == null ? void 0 : onFocus({ ...detail, event: e });
|
|
2774
2774
|
};
|
|
2775
2775
|
const blurListener = (e) => {
|
|
2776
2776
|
const detail = e.detail;
|
|
2777
|
-
onBlur == null ? void 0 : onBlur(detail);
|
|
2777
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
2778
2778
|
};
|
|
2779
2779
|
const keypressListener = (e) => {
|
|
2780
2780
|
const detail = e.detail;
|
|
2781
|
-
onKeyPress == null ? void 0 : onKeyPress(detail);
|
|
2781
|
+
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
2782
2782
|
};
|
|
2783
2783
|
current.addEventListener("_change", changeListener);
|
|
2784
2784
|
current.addEventListener("_trailingIconClick", clickListener);
|
|
@@ -2811,28 +2811,28 @@ function GoabInput({
|
|
|
2811
2811
|
);
|
|
2812
2812
|
}
|
|
2813
2813
|
const onDateChangeHandler = (onChange) => {
|
|
2814
|
-
return ({ name, value }) => {
|
|
2814
|
+
return ({ name, value, event }) => {
|
|
2815
2815
|
if (!value) {
|
|
2816
|
-
onChange == null ? void 0 : onChange({ name, value: "" });
|
|
2816
|
+
onChange == null ? void 0 : onChange({ name, value: "", event });
|
|
2817
2817
|
return;
|
|
2818
2818
|
}
|
|
2819
2819
|
if (typeof value === "string" && isValid(new Date(value))) {
|
|
2820
|
-
onChange == null ? void 0 : onChange({ name, value: parseISO(value) });
|
|
2820
|
+
onChange == null ? void 0 : onChange({ name, value: parseISO(value), event });
|
|
2821
2821
|
return;
|
|
2822
2822
|
}
|
|
2823
2823
|
if (isValid(value)) {
|
|
2824
|
-
onChange == null ? void 0 : onChange({ name, value });
|
|
2824
|
+
onChange == null ? void 0 : onChange({ name, value, event });
|
|
2825
2825
|
return;
|
|
2826
2826
|
}
|
|
2827
2827
|
};
|
|
2828
2828
|
};
|
|
2829
2829
|
const onTimeChangeHandler = (onChange) => {
|
|
2830
|
-
return ({ name, value }) => {
|
|
2830
|
+
return ({ name, value, event }) => {
|
|
2831
2831
|
if (!value) {
|
|
2832
|
-
onChange == null ? void 0 : onChange({ name, value: "" });
|
|
2832
|
+
onChange == null ? void 0 : onChange({ name, value: "", event });
|
|
2833
2833
|
return;
|
|
2834
2834
|
}
|
|
2835
|
-
onChange == null ? void 0 : onChange({ name, value });
|
|
2835
|
+
onChange == null ? void 0 : onChange({ name, value, event });
|
|
2836
2836
|
};
|
|
2837
2837
|
};
|
|
2838
2838
|
function toString(value, tmpl = "yyyy-MM-dd") {
|
|
@@ -2924,7 +2924,11 @@ function GoabInputFile(props) {
|
|
|
2924
2924
|
type: "file",
|
|
2925
2925
|
onChange: (e) => {
|
|
2926
2926
|
var _a;
|
|
2927
|
-
return (_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
2927
|
+
return (_a = props.onChange) == null ? void 0 : _a.call(props, {
|
|
2928
|
+
name: e.target.name,
|
|
2929
|
+
value: e.target.value,
|
|
2930
|
+
event: e.nativeEvent
|
|
2931
|
+
});
|
|
2928
2932
|
},
|
|
2929
2933
|
style: { backgroundColor: "revert" }
|
|
2930
2934
|
}
|
|
@@ -2940,21 +2944,21 @@ function GoabInputNumber({
|
|
|
2940
2944
|
textAlign = "right",
|
|
2941
2945
|
...props
|
|
2942
2946
|
}) {
|
|
2943
|
-
const onNumberChange = ({ name, value: value2 }) => {
|
|
2947
|
+
const onNumberChange = ({ name, value: value2, event }) => {
|
|
2944
2948
|
var _a;
|
|
2945
|
-
(_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2) });
|
|
2949
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
|
|
2946
2950
|
};
|
|
2947
|
-
const onFocus = ({ name, value: value2 }) => {
|
|
2951
|
+
const onFocus = ({ name, value: value2, event }) => {
|
|
2948
2952
|
var _a;
|
|
2949
|
-
(_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2) });
|
|
2953
|
+
(_a = props.onFocus) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
|
|
2950
2954
|
};
|
|
2951
|
-
const onBlur = ({ name, value: value2 }) => {
|
|
2955
|
+
const onBlur = ({ name, value: value2, event }) => {
|
|
2952
2956
|
var _a;
|
|
2953
|
-
(_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2) });
|
|
2957
|
+
(_a = props.onBlur) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), event });
|
|
2954
2958
|
};
|
|
2955
|
-
const onKeyPress = ({ name, value: value2, key }) => {
|
|
2959
|
+
const onKeyPress = ({ name, value: value2, key, event }) => {
|
|
2956
2960
|
var _a;
|
|
2957
|
-
(_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key) });
|
|
2961
|
+
(_a = props.onKeyPress) == null ? void 0 : _a.call(props, { name, value: parseFloat(value2), key: parseInt(key), event });
|
|
2958
2962
|
};
|
|
2959
2963
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2960
2964
|
GoabInput,
|
|
@@ -3306,7 +3310,7 @@ function GoabRadioGroup({
|
|
|
3306
3310
|
if (!el.current) return;
|
|
3307
3311
|
const listener = (e) => {
|
|
3308
3312
|
const detail = e.detail;
|
|
3309
|
-
onChange == null ? void 0 : onChange(detail);
|
|
3313
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
3310
3314
|
};
|
|
3311
3315
|
const currentEl = el.current;
|
|
3312
3316
|
if (onChange) {
|
|
@@ -3528,15 +3532,15 @@ function GoabTextArea({
|
|
|
3528
3532
|
const current = el.current;
|
|
3529
3533
|
const changeListener = (e) => {
|
|
3530
3534
|
const detail = e.detail;
|
|
3531
|
-
onChange == null ? void 0 : onChange(detail);
|
|
3535
|
+
onChange == null ? void 0 : onChange({ ...detail, event: e });
|
|
3532
3536
|
};
|
|
3533
3537
|
const keypressListener = (e) => {
|
|
3534
3538
|
const detail = e.detail;
|
|
3535
|
-
onKeyPress == null ? void 0 : onKeyPress(detail);
|
|
3539
|
+
onKeyPress == null ? void 0 : onKeyPress({ ...detail, event: e });
|
|
3536
3540
|
};
|
|
3537
3541
|
const blurListener = (e) => {
|
|
3538
3542
|
const detail = e.detail;
|
|
3539
|
-
onBlur == null ? void 0 : onBlur(detail);
|
|
3543
|
+
onBlur == null ? void 0 : onBlur({ ...detail, event: e });
|
|
3540
3544
|
};
|
|
3541
3545
|
current.addEventListener("_change", changeListener);
|
|
3542
3546
|
current.addEventListener("_keyPress", keypressListener);
|