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.

91 lines (90 loc) 1.72 kB
import a from "lodash"; const d = [ // 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" ], h = [ // 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" ], m = [...d, ...h], M = (e, n = {}) => { const { htmlProps: u = m, includeAria: o = !0 } = n, t = {}, s = {}; return a.forEach(e, (c, r) => { const l = o && (/^aria-.*$/.test(r) || r === "role"), i = a.includes(u, r) || l ? t : s; i[r] = c; }), [t, s]; }, p = (e, n) => e && n, y = (e, n) => e && e !== !0 && `${e} ${n}`, D = (e, n) => { const { handledProps: u = [] } = e; return Object.keys(n).reduce((o, t) => (t === "childKey" || t === "innerRef" || u.indexOf(t) === -1 && (o[t] = n[t]), o), {}); }; export { D as getUnhandledProps, d as htmlInputAttrs, h as htmlInputEvents, m as htmlInputProps, M as partitionHTMLProps, p as useKeyOnly, y as useValueAndKey };