UNPKG

@progress/kendo-react-buttons

Version:

All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package

9 lines (8 loc) 1.79 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s="16px",n=o=>typeof o=="number"?o+"px":o,h=(o,e)=>{const t={horizontal:e?"right":"left",vertical:"bottom"};return o.horizontal==="end"&&(t.horizontal=e?"left":"right"),t},p=(o,e)=>{const t={horizontal:e?"right":"left",vertical:"top"};return o.horizontal==="end"&&(t.horizontal=e?"left":"right"),t},y=(o,e)=>{const t=e==="end"?"end":"start";return{rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[o][t]},x=(o,e,t,c)=>{const i=e.horizontal,r=e.vertical;if(o.current){const l=t&&t.x!==void 0?n(t.x):s,d=t&&t.x!==void 0?`calc(50% + ${n(t.x)})`:"50%",u=t&&t.y!==void 0?n(t.y):s,a=t&&t.y!==void 0?`calc(50% + ${n(t.y)})`:"50%";o.current.style.setProperty(b(e,c),i==="center"?d:l),o.current.style.setProperty(g(e),r==="middle"?a:u),c&&((r==="top"||r==="bottom")&&i==="start"&&o.current.style.setProperty("left","unset"),r==="middle"&&i==="end"&&o.current.style.setProperty("right","unset"),r==="middle"&&i==="start"&&o.current.style.setProperty("left","unset"))}},b=(o,e)=>{const{horizontal:t}=o;return{end:e?"left":"right",center:"left",start:e?"right":"left"}[t||"end"]},g=o=>({top:"top",middle:"top",bottom:"bottom"})[o.vertical||"bottom"];exports.DEFAULT_OFFSET=s;exports.getAnchorAlign=h;exports.getPopupAlign=p;exports.getTextDirectionClass=y;exports.position=x;exports.toStringValues=n;