(
e?: FocusEvent | MouseEvent,
positionElement = self._positionElement
)
| 1903 | } |
| 1904 | |
| 1905 | function open( |
| 1906 | e?: FocusEvent | MouseEvent, |
| 1907 | positionElement = self._positionElement |
| 1908 | ) { |
| 1909 | if (self.isMobile === true) { |
| 1910 | if (e) { |
| 1911 | e.preventDefault(); |
| 1912 | const eventTarget = getEventTarget(e); |
| 1913 | if (eventTarget) { |
| 1914 | (eventTarget as HTMLInputElement).blur(); |
| 1915 | } |
| 1916 | } |
| 1917 | |
| 1918 | if (self.mobileInput !== undefined) { |
| 1919 | self.mobileInput.focus(); |
| 1920 | self.mobileInput.click(); |
| 1921 | } |
| 1922 | |
| 1923 | triggerEvent("onOpen"); |
| 1924 | return; |
| 1925 | } else if (self._input.disabled || self.config.inline) { |
| 1926 | return; |
| 1927 | } |
| 1928 | |
| 1929 | const wasOpen = self.isOpen; |
| 1930 | |
| 1931 | self.isOpen = true; |
| 1932 | |
| 1933 | if (!wasOpen) { |
| 1934 | self.calendarContainer.classList.add("open"); |
| 1935 | self._input.classList.add("active"); |
| 1936 | triggerEvent("onOpen"); |
| 1937 | positionCalendar(positionElement); |
| 1938 | } |
| 1939 | |
| 1940 | if (self.config.enableTime === true && self.config.noCalendar === true) { |
| 1941 | if ( |
| 1942 | self.config.allowInput === false && |
| 1943 | (e === undefined || |
| 1944 | !(self.timeContainer as HTMLDivElement).contains( |
| 1945 | e.relatedTarget as Node |
| 1946 | )) |
| 1947 | ) { |
| 1948 | setTimeout(() => (self.hourElement as HTMLInputElement).select(), 50); |
| 1949 | } |
| 1950 | } |
| 1951 | } |
| 1952 | |
| 1953 | function minMaxDateSetter(type: "min" | "max") { |
| 1954 | return (date: DateOption) => { |
nothing calls this directly
no test coverage detected
searching dependent graphs…