MCPcopy
hub / github.com/flatpickr/flatpickr / createNumberInput

Function createNumberInput

src/utils/dom.ts:41–68  ·  view source on GitHub ↗
(
  inputClassName: string,
  opts?: Record<string, any>
)

Source from the content-addressed store, hash-verified

39}
40
41export function createNumberInput(
42 inputClassName: string,
43 opts?: Record<string, any>
44) {
45 const wrapper = createElement<HTMLDivElement>("div", "numInputWrapper"),
46 numInput = createElement<HTMLInputElement>(
47 "input",
48 "numInput " + inputClassName
49 ),
50 arrowUp = createElement<HTMLSpanElement>("span", "arrowUp"),
51 arrowDown = createElement<HTMLSpanElement>("span", "arrowDown");
52
53 if (navigator.userAgent.indexOf("MSIE 9.0") === -1) {
54 numInput.type = "number";
55 } else {
56 numInput.type = "text";
57 numInput.pattern = "\\d*";
58 }
59
60 if (opts !== undefined)
61 for (const key in opts) numInput.setAttribute(key, opts[key]);
62
63 wrapper.appendChild(numInput);
64 wrapper.appendChild(arrowUp);
65 wrapper.appendChild(arrowDown);
66
67 return wrapper;
68}
69
70export function getEventTarget(event: Event): EventTarget | null {
71 try {

Callers 2

buildMonthFunction · 0.90
buildTimeFunction · 0.90

Calls 1

createElementFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…