UNPKG

jb-core

Version:

jb design system core modules

2 lines 1.58 kB
function e(e,t,n,o={}){document.addEventListener(t,(t=>{t.composedPath().includes(e)&&(t.stopPropagation(),t.stopImmediatePropagation(),n(t))}),{capture:!0,...o})}function t(e,t,n){const o={altKey:t.altKey,bubbles:t.bubbles,cancelable:t.cancelable,code:t.code,composed:t.composed,ctrlKey:t.ctrlKey,detail:t.detail,isComposing:t.isComposing,key:t.key,location:t.location,metaKey:t.metaKey,repeat:t.repeat,shiftKey:t.shiftKey,view:t.view,charCode:t.charCode,keyCode:t.keyCode,which:t.which,...n};return new KeyboardEvent(e,o)}function n(e,t,n){const o={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,isComposing:t.isComposing,view:t.view,which:t.which,data:t.data,dataTransfer:t.dataTransfer,inputType:t.inputType,targetRanges:"function"==typeof t.getTargetRanges()?t.getTargetRanges():[],...n};return new InputEvent(e,o)}function o(e,t,n){const o={bubbles:t.bubbles,cancelable:t.cancelable,composed:t.composed,detail:t.detail,view:t.view,which:t.which,relatedTarget:t.relatedTarget,...n};return new FocusEvent(e,o)}const a=()=>/Mobi/i.test(window.navigator.userAgent);function i(e){if("string"!=typeof e)return"";return e.replace(/[۰-۹]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)-1728)}))}function r(e){if("string"!=typeof e&&isNaN(e))return"";return e.toString().replace(/[0-9]/g,(function(e){return String.fromCharCode(e.charCodeAt(0)+1728)}))}export{o as createFocusEvent,n as createInputEvent,t as createKeyboardEvent,r as enToFaDigits,i as faToEnDigits,a as isMobile,e as listenAndSilentEvent}; //# sourceMappingURL=index.js.map