UNPKG

@devgateway/dvz-ui-react

Version:

A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.

85 lines (84 loc) 1.4 kB
import t from "lodash"; const p = [ // REACT "selected", "defaultValue", "defaultChecked", // LIMITED HTML PROPS "accept", "autoCapitalize", "autoComplete", "autoCorrect", "autoFocus", "checked", "disabled", "enterKeyHint", "form", "id", "inputMode", "lang", "list", "max", "maxLength", "min", "minLength", "multiple", "name", "pattern", "placeholder", "readOnly", "required", "step", "title", "type", "value" ], d = [ // EVENTS // keyboard "onKeyDown", "onKeyPress", "onKeyUp", // focus "onFocus", "onBlur", // form "onChange", "onInput", // mouse "onClick", "onContextMenu", "onDrag", "onDragEnd", "onDragEnter", "onDragExit", "onDragLeave", "onDragOver", "onDragStart", "onDrop", "onMouseDown", "onMouseEnter", "onMouseLeave", "onMouseMove", "onMouseOut", "onMouseOver", "onMouseUp", // selection "onSelect", // touch "onTouchCancel", "onTouchEnd", "onTouchMove", "onTouchStart" ], h = [...p, ...d], g = (r, a = {}) => { const { htmlProps: u = h, includeAria: s = !0 } = a, e = {}, n = {}; return t.forEach(r, (c, o) => { const l = s && (/^aria-.*$/.test(o) || o === "role"), i = t.includes(u, o) || l ? e : n; i[o] = c; }), [e, n]; }; export { p as htmlInputAttrs, d as htmlInputEvents, h as htmlInputProps, g as partitionHTMLProps };