UNPKG

@progress/kendo-react-inputs

Version:

React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package

36 lines (35 loc) 1.24 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ const d = (s, t) => s.length === 0 ? "" : `<path d="${s.reduce( (n, c, o, h) => o === 0 ? ( // if first point `M ${c[0]},${c[1]}` ) : ( // else `${n} ${t(c, o, h)}` ), "" )}" fill="none" stroke="white" stroke-width="1"/>`, u = (s, t) => { const e = t[0] - s[0], n = t[1] - s[1]; return { length: Math.sqrt(Math.pow(e, 2) + Math.pow(n, 2)), angle: Math.atan2(n, e) }; }, w = (s) => (t, e, n, c) => { const o = e || t, h = n || t, l = 0.1, a = s(o, h), r = a.angle + (c ? Math.PI : 0), $ = a.length * l, g = t[0] + Math.cos(r) * $, M = t[1] + Math.sin(r) * $; return [g, M]; }, m = (s) => (t, e, n) => { const [c, o] = s(n[e - 1], n[e - 2], t), [h, l] = s(t, n[e - 1], n[e + 1], !0); return `C ${c},${o} ${h},${l} ${t[0]},${t[1]}`; }; export { m as bezierCommand, w as controlPoint, u as line, d as svgPath };