@indico-data/design-system 3.6.4 → 3.8.0
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/lib/index.esm.js +20 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +20 -1
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/forms/date/datePicker/DatePicker.tsx +26 -1
package/lib/index.esm.js
CHANGED
|
@@ -13649,7 +13649,26 @@ const DatePicker = (props) => {
|
|
|
13649
13649
|
onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
|
|
13650
13650
|
};
|
|
13651
13651
|
const finalProps = Object.assign(Object.assign(Object.assign({}, commonProps), rest), modeProps);
|
|
13652
|
-
|
|
13652
|
+
const wrapperRef = useRef(null);
|
|
13653
|
+
// Disable tab focus on all date picker elements
|
|
13654
|
+
useEffect(() => {
|
|
13655
|
+
const disableTabFocus = () => {
|
|
13656
|
+
if (wrapperRef.current) {
|
|
13657
|
+
const focusableElements = wrapperRef.current.querySelectorAll('button, input, select, textarea, a, [tabindex]:not([tabindex="-1"])');
|
|
13658
|
+
focusableElements.forEach((element) => {
|
|
13659
|
+
element.tabIndex = -1;
|
|
13660
|
+
});
|
|
13661
|
+
}
|
|
13662
|
+
};
|
|
13663
|
+
// Run immediately and set up observer for dynamic elements
|
|
13664
|
+
disableTabFocus();
|
|
13665
|
+
const observer = new MutationObserver(disableTabFocus);
|
|
13666
|
+
if (wrapperRef.current) {
|
|
13667
|
+
observer.observe(wrapperRef.current, { childList: true, subtree: true });
|
|
13668
|
+
}
|
|
13669
|
+
return () => observer.disconnect();
|
|
13670
|
+
}, []);
|
|
13671
|
+
return (jsxs("div", { className: "date-picker-wrapper", tabIndex: -1, ref: wrapperRef, children: [hasTimePicker && (jsx("div", { className: "time-picker-wrapper", children: jsxs(Row, { align: "center", children: [jsx(Col, { xs: "content", children: jsx("p", { className: "ma-0", children: "Select Time" }) }), jsx(Col, { children: jsx(TimePicker, { ref: ref, timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange, readonly: isReadOnly, tabIndex: timeTabIndex }) })] }) })), jsx(DayPicker, Object.assign({}, finalProps))] }));
|
|
13653
13672
|
};
|
|
13654
13673
|
|
|
13655
13674
|
const IconTriggerDatePicker = (props) => {
|