@bbn/bbn 1.0.58 → 1.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/dist/_.js +1 -1
  2. package/dist/bundle.d.ts +3804 -242
  3. package/dist/bundle.js +4063 -504
  4. package/dist/db.js +3 -3
  5. package/dist/fn/ajax/_addLoader.d.ts +16 -0
  6. package/dist/fn/ajax/_addLoader.js +51 -0
  7. package/dist/fn/ajax/_deleteLoader.d.ts +16 -0
  8. package/dist/fn/ajax/_deleteLoader.js +39 -0
  9. package/dist/fn/ajax/abort.d.ts +24 -0
  10. package/dist/fn/ajax/abort.js +36 -0
  11. package/dist/fn/ajax/abortURL.d.ts +22 -0
  12. package/dist/fn/ajax/abortURL.js +33 -0
  13. package/dist/fn/ajax/ajax.d.ts +58 -0
  14. package/dist/fn/ajax/ajax.js +170 -0
  15. package/dist/fn/ajax/callback.d.ts +37 -0
  16. package/dist/fn/ajax/callback.js +117 -0
  17. package/dist/fn/ajax/download.d.ts +30 -0
  18. package/dist/fn/ajax/download.js +64 -0
  19. package/dist/fn/ajax/downloadContent.d.ts +28 -0
  20. package/dist/fn/ajax/downloadContent.js +74 -0
  21. package/dist/fn/ajax/getLoader.d.ts +37 -0
  22. package/dist/fn/ajax/getLoader.js +44 -0
  23. package/dist/fn/ajax/getRequestId.d.ts +50 -0
  24. package/dist/fn/ajax/getRequestId.js +62 -0
  25. package/dist/fn/ajax/link.d.ts +26 -0
  26. package/dist/fn/ajax/link.js +129 -0
  27. package/dist/fn/ajax/post.d.ts +35 -0
  28. package/dist/fn/ajax/post.js +45 -0
  29. package/dist/fn/ajax/postOut.d.ts +21 -0
  30. package/dist/fn/ajax/postOut.js +49 -0
  31. package/dist/fn/ajax/setNavigationVars.d.ts +25 -0
  32. package/dist/fn/ajax/setNavigationVars.js +80 -0
  33. package/dist/fn/ajax/treatAjaxArguments.d.ts +53 -0
  34. package/dist/fn/ajax/treatAjaxArguments.js +127 -0
  35. package/dist/fn/ajax/upload.d.ts +18 -0
  36. package/dist/fn/ajax/upload.js +52 -0
  37. package/dist/fn/ajax.js +3 -3
  38. package/dist/fn/browser/copy.d.ts +15 -0
  39. package/dist/fn/browser/copy.js +50 -0
  40. package/dist/fn/browser/eraseCookie.d.ts +15 -0
  41. package/dist/fn/browser/eraseCookie.js +17 -0
  42. package/dist/fn/browser/error.d.ts +14 -0
  43. package/dist/fn/browser/error.js +29 -0
  44. package/dist/fn/browser/getBrowserName.d.ts +9 -0
  45. package/dist/fn/browser/getBrowserName.js +28 -0
  46. package/dist/fn/browser/getBrowserVersion.d.ts +9 -0
  47. package/dist/fn/browser/getBrowserVersion.js +29 -0
  48. package/dist/fn/browser/getCookie.d.ts +16 -0
  49. package/dist/fn/browser/getCookie.js +32 -0
  50. package/dist/fn/browser/getDeviceType.d.ts +14 -0
  51. package/dist/fn/browser/getDeviceType.js +23 -0
  52. package/dist/fn/browser/getEventData.d.ts +16 -0
  53. package/dist/fn/browser/getEventData.js +116 -0
  54. package/dist/fn/browser/happy.d.ts +14 -0
  55. package/dist/fn/browser/happy.js +22 -0
  56. package/dist/fn/browser/history.d.ts +2 -0
  57. package/dist/fn/browser/history.js +4 -0
  58. package/dist/fn/browser/info.d.ts +10 -0
  59. package/dist/fn/browser/info.js +19 -0
  60. package/dist/fn/browser/isActiveInterface.d.ts +14 -0
  61. package/dist/fn/browser/isActiveInterface.js +20 -0
  62. package/dist/fn/browser/isDesktopDevice.d.ts +14 -0
  63. package/dist/fn/browser/isDesktopDevice.js +17 -0
  64. package/dist/fn/browser/isFocused.d.ts +21 -0
  65. package/dist/fn/browser/isFocused.js +23 -0
  66. package/dist/fn/browser/isMobile.d.ts +14 -0
  67. package/dist/fn/browser/isMobile.js +18 -0
  68. package/dist/fn/browser/isMobileDevice.d.ts +2 -0
  69. package/dist/fn/browser/isMobileDevice.js +5 -0
  70. package/dist/fn/browser/isTabletDevice.d.ts +14 -0
  71. package/dist/fn/browser/isTabletDevice.js +17 -0
  72. package/dist/fn/browser/log.d.ts +15 -0
  73. package/dist/fn/browser/log.js +46 -0
  74. package/dist/fn/browser/replaceSelection.d.ts +2 -0
  75. package/dist/fn/browser/replaceSelection.js +42 -0
  76. package/dist/fn/browser/selectElementText.d.ts +21 -0
  77. package/dist/fn/browser/selectElementText.js +42 -0
  78. package/dist/fn/browser/setCookie.d.ts +16 -0
  79. package/dist/fn/browser/setCookie.js +25 -0
  80. package/dist/fn/browser/toggleFullScreen.d.ts +2 -0
  81. package/dist/fn/browser/toggleFullScreen.js +39 -0
  82. package/dist/fn/browser/warning.d.ts +14 -0
  83. package/dist/fn/browser/warning.js +24 -0
  84. package/dist/fn/convert/arrayBuffer2String.d.ts +2 -0
  85. package/dist/fn/convert/arrayBuffer2String.js +4 -0
  86. package/dist/fn/convert/canvasToImage.d.ts +16 -0
  87. package/dist/fn/convert/canvasToImage.js +20 -0
  88. package/dist/fn/convert/colorToHex.d.ts +20 -0
  89. package/dist/fn/convert/colorToHex.js +24 -0
  90. package/dist/fn/convert/fromXml.d.ts +12 -0
  91. package/dist/fn/convert/fromXml.js +54 -0
  92. package/dist/fn/convert/hex2rgb.d.ts +24 -0
  93. package/dist/fn/convert/hex2rgb.js +29 -0
  94. package/dist/fn/convert/imageToCanvas.d.ts +15 -0
  95. package/dist/fn/convert/imageToCanvas.js +21 -0
  96. package/dist/fn/convert/imgToBase64.d.ts +2 -0
  97. package/dist/fn/convert/imgToBase64.js +7 -0
  98. package/dist/fn/convert/rgb2hex.d.ts +20 -0
  99. package/dist/fn/convert/rgb2hex.js +28 -0
  100. package/dist/fn/convert/string2ArrayBuffer.d.ts +2 -0
  101. package/dist/fn/convert/string2ArrayBuffer.js +9 -0
  102. package/dist/fn/convert/toCSV.d.ts +26 -0
  103. package/dist/fn/convert/toCSV.js +64 -0
  104. package/dist/fn/datetime/calendar.d.ts +2 -0
  105. package/dist/fn/datetime/calendar.js +23 -0
  106. package/dist/fn/datetime/chrono.d.ts +25 -0
  107. package/dist/fn/datetime/chrono.js +45 -0
  108. package/dist/fn/datetime/date.d.ts +18 -0
  109. package/dist/fn/datetime/date.js +44 -0
  110. package/dist/fn/datetime/dateSQL.d.ts +20 -0
  111. package/dist/fn/datetime/dateSQL.js +26 -0
  112. package/dist/fn/datetime/daysInMonth.d.ts +17 -0
  113. package/dist/fn/datetime/daysInMonth.js +24 -0
  114. package/dist/fn/datetime/fdate.d.ts +11 -0
  115. package/dist/fn/datetime/fdate.js +28 -0
  116. package/dist/fn/datetime/fdatetime.d.ts +9 -0
  117. package/dist/fn/datetime/fdatetime.js +30 -0
  118. package/dist/fn/datetime/formatDate.d.ts +2 -0
  119. package/dist/fn/datetime/formatDate.js +4 -0
  120. package/dist/fn/datetime/ftime.d.ts +9 -0
  121. package/dist/fn/datetime/ftime.js +21 -0
  122. package/dist/fn/datetime/getDay.d.ts +11 -0
  123. package/dist/fn/datetime/getDay.js +26 -0
  124. package/dist/fn/datetime/timestamp.d.ts +15 -0
  125. package/dist/fn/datetime/timestamp.js +18 -0
  126. package/dist/fn/default/defaultAjaxAbortFunction.d.ts +2 -0
  127. package/dist/fn/default/defaultAjaxAbortFunction.js +5 -0
  128. package/dist/fn/default/defaultAjaxErrorFunction.d.ts +2 -0
  129. package/dist/fn/default/defaultAjaxErrorFunction.js +4 -0
  130. package/dist/fn/default/defaultAlertFunction.d.ts +2 -0
  131. package/dist/fn/default/defaultAlertFunction.js +5 -0
  132. package/dist/fn/default/defaultConfirmFunction.d.ts +2 -0
  133. package/dist/fn/default/defaultConfirmFunction.js +14 -0
  134. package/dist/fn/default/defaultEndLoadingFunction.d.ts +2 -0
  135. package/dist/fn/default/defaultEndLoadingFunction.js +4 -0
  136. package/dist/fn/default/defaultErrorFunction.d.ts +2 -0
  137. package/dist/fn/default/defaultErrorFunction.js +5 -0
  138. package/dist/fn/default/defaultHistoryFunction.d.ts +2 -0
  139. package/dist/fn/default/defaultHistoryFunction.js +4 -0
  140. package/dist/fn/default/defaultLinkFunction.d.ts +2 -0
  141. package/dist/fn/default/defaultLinkFunction.js +4 -0
  142. package/dist/fn/default/defaultPostLinkFunction.d.ts +2 -0
  143. package/dist/fn/default/defaultPostLinkFunction.js +4 -0
  144. package/dist/fn/default/defaultPreLinkFunction.d.ts +2 -0
  145. package/dist/fn/default/defaultPreLinkFunction.js +4 -0
  146. package/dist/fn/default/defaultResizeFunction.d.ts +2 -0
  147. package/dist/fn/default/defaultResizeFunction.js +4 -0
  148. package/dist/fn/default/defaultStartLoadingFunction.d.ts +2 -0
  149. package/dist/fn/default/defaultStartLoadingFunction.js +4 -0
  150. package/dist/fn/form/addInputs.d.ts +43 -0
  151. package/dist/fn/form/addInputs.js +81 -0
  152. package/dist/fn/form/fieldValue.d.ts +12 -0
  153. package/dist/fn/form/fieldValue.js +34 -0
  154. package/dist/fn/form/formdata.d.ts +45 -0
  155. package/dist/fn/form/formdata.js +95 -0
  156. package/dist/fn/form/objectToFormData.d.ts +12 -0
  157. package/dist/fn/form/objectToFormData.js +45 -0
  158. package/dist/fn/form/submit.d.ts +20 -0
  159. package/dist/fn/form/submit.js +51 -0
  160. package/dist/fn/html/adjustHeight.d.ts +2 -0
  161. package/dist/fn/html/adjustHeight.js +10 -0
  162. package/dist/fn/html/adjustSize.d.ts +2 -0
  163. package/dist/fn/html/adjustSize.js +21 -0
  164. package/dist/fn/html/adjustWidth.d.ts +2 -0
  165. package/dist/fn/html/adjustWidth.js +10 -0
  166. package/dist/fn/html/getAllTags.d.ts +6 -0
  167. package/dist/fn/html/getAllTags.js +9 -0
  168. package/dist/fn/html/getAncestors.d.ts +2 -0
  169. package/dist/fn/html/getAncestors.js +25 -0
  170. package/dist/fn/html/getAttributes.d.ts +6 -0
  171. package/dist/fn/html/getAttributes.js +16 -0
  172. package/dist/fn/html/getHTMLOfSelection.d.ts +2 -0
  173. package/dist/fn/html/getHTMLOfSelection.js +18 -0
  174. package/dist/fn/html/getHtml.d.ts +2 -0
  175. package/dist/fn/html/getHtml.js +9 -0
  176. package/dist/fn/html/getPath.d.ts +10 -0
  177. package/dist/fn/html/getPath.js +50 -0
  178. package/dist/fn/html/getText.d.ts +2 -0
  179. package/dist/fn/html/getText.js +4 -0
  180. package/dist/fn/html/html2text.d.ts +17 -0
  181. package/dist/fn/html/html2text.js +22 -0
  182. package/dist/fn/html/isInside.d.ts +2 -0
  183. package/dist/fn/html/isInside.js +23 -0
  184. package/dist/fn/html/makeReactive.d.ts +2 -0
  185. package/dist/fn/html/makeReactive.js +185 -0
  186. package/dist/fn/html/selector.d.ts +10 -0
  187. package/dist/fn/html/selector.js +12 -0
  188. package/dist/fn/init.d.ts +13 -0
  189. package/dist/fn/init.js +25 -12
  190. package/dist/fn/loop/each.d.ts +33 -0
  191. package/dist/fn/loop/each.js +54 -0
  192. package/dist/fn/loop/fori.d.ts +36 -0
  193. package/dist/fn/loop/fori.js +53 -0
  194. package/dist/fn/loop/forir.d.ts +36 -0
  195. package/dist/fn/loop/forir.js +53 -0
  196. package/dist/fn/loop/iterate.d.ts +22 -0
  197. package/dist/fn/loop/iterate.js +36 -0
  198. package/dist/fn/loop/riterate.d.ts +21 -0
  199. package/dist/fn/loop/riterate.js +24 -0
  200. package/dist/fn/misc/analyzeFunction.d.ts +11 -0
  201. package/dist/fn/misc/analyzeFunction.js +141 -0
  202. package/dist/fn/misc/getTimeoff.d.ts +14 -0
  203. package/dist/fn/misc/getTimeoff.js +19 -0
  204. package/dist/fn/misc/money.d.ts +23 -0
  205. package/dist/fn/misc/money.js +122 -0
  206. package/dist/fn/misc/percent.d.ts +23 -0
  207. package/dist/fn/misc/percent.js +25 -0
  208. package/dist/fn/misc/randomInt.d.ts +22 -0
  209. package/dist/fn/misc/randomInt.js +24 -0
  210. package/dist/fn/misc/roundDecimal.d.ts +11 -0
  211. package/dist/fn/misc/roundDecimal.js +13 -0
  212. package/dist/fn/misc/translate.d.ts +2 -0
  213. package/dist/fn/misc/translate.js +8 -0
  214. package/dist/fn/object/_compareValues.d.ts +40 -0
  215. package/dist/fn/object/_compareValues.js +78 -0
  216. package/dist/fn/object/arrayFromProp.d.ts +33 -0
  217. package/dist/fn/object/arrayFromProp.js +41 -0
  218. package/dist/fn/object/autoExtend.d.ts +33 -0
  219. package/dist/fn/object/autoExtend.js +44 -0
  220. package/dist/fn/object/checkProps.d.ts +2 -0
  221. package/dist/fn/object/checkProps.js +5 -0
  222. package/dist/fn/object/checkPropsDetails.d.ts +2 -0
  223. package/dist/fn/object/checkPropsDetails.js +53 -0
  224. package/dist/fn/object/checkPropsOrDie.d.ts +2 -0
  225. package/dist/fn/object/checkPropsOrDie.js +9 -0
  226. package/dist/fn/object/circularReplacer.d.ts +7 -0
  227. package/dist/fn/object/circularReplacer.js +39 -0
  228. package/dist/fn/object/clone.d.ts +19 -0
  229. package/dist/fn/object/clone.js +33 -0
  230. package/dist/fn/object/compare.d.ts +53 -0
  231. package/dist/fn/object/compare.js +150 -0
  232. package/dist/fn/object/compareConditions.d.ts +46 -0
  233. package/dist/fn/object/compareConditions.js +86 -0
  234. package/dist/fn/object/count.d.ts +56 -0
  235. package/dist/fn/object/count.js +59 -0
  236. package/dist/fn/object/createObject.d.ts +2 -0
  237. package/dist/fn/object/createObject.js +9 -0
  238. package/dist/fn/object/deepPath.d.ts +57 -0
  239. package/dist/fn/object/deepPath.js +78 -0
  240. package/dist/fn/object/deleteProp.d.ts +8 -0
  241. package/dist/fn/object/deleteProp.js +13 -0
  242. package/dist/fn/object/diffObj.d.ts +79 -0
  243. package/dist/fn/object/diffObj.js +168 -0
  244. package/dist/fn/object/extend.d.ts +87 -0
  245. package/dist/fn/object/extend.js +158 -0
  246. package/dist/fn/object/extendOut.d.ts +18 -0
  247. package/dist/fn/object/extendOut.js +40 -0
  248. package/dist/fn/object/filter.d.ts +50 -0
  249. package/dist/fn/object/filter.js +94 -0
  250. package/dist/fn/object/filterToConditions.d.ts +48 -0
  251. package/dist/fn/object/filterToConditions.js +68 -0
  252. package/dist/fn/object/findAll.d.ts +57 -0
  253. package/dist/fn/object/findAll.js +73 -0
  254. package/dist/fn/object/getField.d.ts +30 -0
  255. package/dist/fn/object/getField.js +37 -0
  256. package/dist/fn/object/getFieldValues.d.ts +30 -0
  257. package/dist/fn/object/getFieldValues.js +41 -0
  258. package/dist/fn/object/getProp.d.ts +8 -0
  259. package/dist/fn/object/getProp.js +13 -0
  260. package/dist/fn/object/getProperty.d.ts +30 -0
  261. package/dist/fn/object/getProperty.js +39 -0
  262. package/dist/fn/object/getRow.d.ts +42 -0
  263. package/dist/fn/object/getRow.js +49 -0
  264. package/dist/fn/object/map.d.ts +74 -0
  265. package/dist/fn/object/map.js +83 -0
  266. package/dist/fn/object/move.d.ts +34 -0
  267. package/dist/fn/object/move.js +43 -0
  268. package/dist/fn/object/multiorder.d.ts +40 -0
  269. package/dist/fn/object/multiorder.js +60 -0
  270. package/dist/fn/object/numProperties.d.ts +31 -0
  271. package/dist/fn/object/numProperties.js +36 -0
  272. package/dist/fn/object/order.d.ts +28 -0
  273. package/dist/fn/object/order.js +36 -0
  274. package/dist/fn/object/pickValue.d.ts +2 -0
  275. package/dist/fn/object/pickValue.js +6 -0
  276. package/dist/fn/object/removeEmpty.d.ts +18 -0
  277. package/dist/fn/object/removeEmpty.js +47 -0
  278. package/dist/fn/object/removePrivateProp.d.ts +24 -0
  279. package/dist/fn/object/removePrivateProp.js +41 -0
  280. package/dist/fn/object/search.d.ts +101 -0
  281. package/dist/fn/object/search.js +177 -0
  282. package/dist/fn/object/setProp.d.ts +11 -0
  283. package/dist/fn/object/setProp.js +17 -0
  284. package/dist/fn/object/setProperty.d.ts +30 -0
  285. package/dist/fn/object/setProperty.js +50 -0
  286. package/dist/fn/object/shortenObj.d.ts +25 -0
  287. package/dist/fn/object/shortenObj.js +40 -0
  288. package/dist/fn/object/shuffle.d.ts +2 -0
  289. package/dist/fn/object/shuffle.js +13 -0
  290. package/dist/fn/object/stat.d.ts +2 -0
  291. package/dist/fn/object/stat.js +49 -0
  292. package/dist/fn/object/sum.d.ts +46 -0
  293. package/dist/fn/object/sum.js +57 -0
  294. package/dist/fn/object/unique.d.ts +18 -0
  295. package/dist/fn/object/unique.js +22 -0
  296. package/dist/fn/string/baseName.d.ts +24 -0
  297. package/dist/fn/string/baseName.js +39 -0
  298. package/dist/fn/string/br2nl.d.ts +19 -0
  299. package/dist/fn/string/br2nl.js +22 -0
  300. package/dist/fn/string/camelToCss.d.ts +18 -0
  301. package/dist/fn/string/camelToCss.js +26 -0
  302. package/dist/fn/string/camelize.d.ts +20 -0
  303. package/dist/fn/string/camelize.js +27 -0
  304. package/dist/fn/string/correctCase.d.ts +18 -0
  305. package/dist/fn/string/correctCase.js +20 -0
  306. package/dist/fn/string/crc32.d.ts +2 -0
  307. package/dist/fn/string/crc32.js +20 -0
  308. package/dist/fn/string/dirName.d.ts +17 -0
  309. package/dist/fn/string/dirName.js +33 -0
  310. package/dist/fn/string/escapeDquotes.d.ts +2 -0
  311. package/dist/fn/string/escapeDquotes.js +8 -0
  312. package/dist/fn/string/escapeRegExp.d.ts +19 -0
  313. package/dist/fn/string/escapeRegExp.js +21 -0
  314. package/dist/fn/string/escapeSquotes.d.ts +2 -0
  315. package/dist/fn/string/escapeSquotes.js +8 -0
  316. package/dist/fn/string/escapeTicks.d.ts +2 -0
  317. package/dist/fn/string/escapeTicks.js +8 -0
  318. package/dist/fn/string/escapeUrl.d.ts +9 -0
  319. package/dist/fn/string/escapeUrl.js +47 -0
  320. package/dist/fn/string/fileExt.d.ts +38 -0
  321. package/dist/fn/string/fileExt.js +47 -0
  322. package/dist/fn/string/format.d.ts +2 -0
  323. package/dist/fn/string/format.js +14 -0
  324. package/dist/fn/string/formatBytes.d.ts +14 -0
  325. package/dist/fn/string/formatBytes.js +20 -0
  326. package/dist/fn/string/formatSize.d.ts +2 -0
  327. package/dist/fn/string/formatSize.js +12 -0
  328. package/dist/fn/string/hash.d.ts +7 -0
  329. package/dist/fn/string/hash.js +42 -0
  330. package/dist/fn/string/md5.d.ts +22 -0
  331. package/dist/fn/string/md5.js +142 -0
  332. package/dist/fn/string/nl2br.d.ts +17 -0
  333. package/dist/fn/string/nl2br.js +20 -0
  334. package/dist/fn/string/printf.d.ts +10 -0
  335. package/dist/fn/string/printf.js +15 -0
  336. package/dist/fn/string/quotes2html.d.ts +30 -0
  337. package/dist/fn/string/quotes2html.js +39 -0
  338. package/dist/fn/string/randomString.d.ts +28 -0
  339. package/dist/fn/string/randomString.js +72 -0
  340. package/dist/fn/string/removeAccents.d.ts +17 -0
  341. package/dist/fn/string/removeAccents.js +30 -0
  342. package/dist/fn/string/removeExtraSpaces.d.ts +7 -0
  343. package/dist/fn/string/removeExtraSpaces.js +9 -0
  344. package/dist/fn/string/removeHtmlComments.d.ts +2 -0
  345. package/dist/fn/string/removeHtmlComments.js +8 -0
  346. package/dist/fn/string/removeTrailingChars.d.ts +11 -0
  347. package/dist/fn/string/removeTrailingChars.js +25 -0
  348. package/dist/fn/string/repeat.d.ts +16 -0
  349. package/dist/fn/string/repeat.js +18 -0
  350. package/dist/fn/string/replaceAll.d.ts +23 -0
  351. package/dist/fn/string/replaceAll.js +29 -0
  352. package/dist/fn/string/sanitize.d.ts +17 -0
  353. package/dist/fn/string/sanitize.js +34 -0
  354. package/dist/fn/string/shorten.d.ts +27 -0
  355. package/dist/fn/string/shorten.js +42 -0
  356. package/dist/fn/string/simpleHash.d.ts +2 -0
  357. package/dist/fn/string/simpleHash.js +8 -0
  358. package/dist/fn/string/simpleHash1.d.ts +2 -0
  359. package/dist/fn/string/simpleHash1.js +10 -0
  360. package/dist/fn/string/simpleHash2.d.ts +2 -0
  361. package/dist/fn/string/simpleHash2.js +10 -0
  362. package/dist/fn/string/substr.d.ts +23 -0
  363. package/dist/fn/string/substr.js +38 -0
  364. package/dist/fn/string/trim.d.ts +2 -0
  365. package/dist/fn/string/trim.js +20 -0
  366. package/dist/fn/string/uniqString.d.ts +18 -0
  367. package/dist/fn/string/uniqString.js +49 -0
  368. package/dist/fn/style/addColors.d.ts +17 -0
  369. package/dist/fn/style/addColors.js +76 -0
  370. package/dist/fn/style/addStyle.d.ts +12 -0
  371. package/dist/fn/style/addStyle.js +20 -0
  372. package/dist/fn/style/animateCss.d.ts +13 -0
  373. package/dist/fn/style/animateCss.js +31 -0
  374. package/dist/fn/style/center.d.ts +16 -0
  375. package/dist/fn/style/center.js +40 -0
  376. package/dist/fn/style/cssExists.d.ts +12 -0
  377. package/dist/fn/style/cssExists.js +40 -0
  378. package/dist/fn/style/getCssVar.d.ts +7 -0
  379. package/dist/fn/style/getCssVar.js +12 -0
  380. package/dist/fn/style/getScrollBarSize.d.ts +2 -0
  381. package/dist/fn/style/getScrollBarSize.js +25 -0
  382. package/dist/fn/style/lightenDarkenHex.d.ts +20 -0
  383. package/dist/fn/style/lightenDarkenHex.js +45 -0
  384. package/dist/fn/style/outerHeight.d.ts +11 -0
  385. package/dist/fn/style/outerHeight.js +19 -0
  386. package/dist/fn/style/outerWidth.d.ts +10 -0
  387. package/dist/fn/style/outerWidth.js +16 -0
  388. package/dist/fn/style/resize.d.ts +2 -0
  389. package/dist/fn/style/resize.js +39 -0
  390. package/dist/fn/style/setCssVar.d.ts +8 -0
  391. package/dist/fn/style/setCssVar.js +14 -0
  392. package/dist/fn/type/checkType.d.ts +2 -0
  393. package/dist/fn/type/checkType.js +59 -0
  394. package/dist/fn/type/isArray.d.ts +14 -0
  395. package/dist/fn/type/isArray.js +23 -0
  396. package/dist/fn/type/isBlob.d.ts +9 -0
  397. package/dist/fn/type/isBlob.js +18 -0
  398. package/dist/fn/type/isBoolean.d.ts +16 -0
  399. package/dist/fn/type/isBoolean.js +25 -0
  400. package/dist/fn/type/isCanvas.d.ts +16 -0
  401. package/dist/fn/type/isCanvas.js +25 -0
  402. package/dist/fn/type/isColor.d.ts +31 -0
  403. package/dist/fn/type/isColor.js +45 -0
  404. package/dist/fn/type/isComment.d.ts +14 -0
  405. package/dist/fn/type/isComment.js +23 -0
  406. package/dist/fn/type/isCp.d.ts +2 -0
  407. package/dist/fn/type/isCp.js +17 -0
  408. package/dist/fn/type/isDate.d.ts +20 -0
  409. package/dist/fn/type/isDate.js +29 -0
  410. package/dist/fn/type/isDimension.d.ts +11 -0
  411. package/dist/fn/type/isDimension.js +24 -0
  412. package/dist/fn/type/isDom.d.ts +14 -0
  413. package/dist/fn/type/isDom.js +23 -0
  414. package/dist/fn/type/isEmail.d.ts +23 -0
  415. package/dist/fn/type/isEmail.js +37 -0
  416. package/dist/fn/type/isEmpty.d.ts +41 -0
  417. package/dist/fn/type/isEmpty.js +57 -0
  418. package/dist/fn/type/isEvent.d.ts +9 -0
  419. package/dist/fn/type/isEvent.js +18 -0
  420. package/dist/fn/type/isFunction.d.ts +16 -0
  421. package/dist/fn/type/isFunction.js +25 -0
  422. package/dist/fn/type/isHostname.d.ts +2 -0
  423. package/dist/fn/type/isHostname.js +16 -0
  424. package/dist/fn/type/isIP.d.ts +2 -0
  425. package/dist/fn/type/isIP.js +12 -0
  426. package/dist/fn/type/isInt.d.ts +18 -0
  427. package/dist/fn/type/isInt.js +27 -0
  428. package/dist/fn/type/isIterable.d.ts +27 -0
  429. package/dist/fn/type/isIterable.js +37 -0
  430. package/dist/fn/type/isNull.d.ts +14 -0
  431. package/dist/fn/type/isNull.js +23 -0
  432. package/dist/fn/type/isNumber.d.ts +19 -0
  433. package/dist/fn/type/isNumber.js +30 -0
  434. package/dist/fn/type/isObject.d.ts +19 -0
  435. package/dist/fn/type/isObject.js +28 -0
  436. package/dist/fn/type/isPercent.d.ts +14 -0
  437. package/dist/fn/type/isPercent.js +23 -0
  438. package/dist/fn/type/isPrimitive.d.ts +18 -0
  439. package/dist/fn/type/isPrimitive.js +27 -0
  440. package/dist/fn/type/isPromise.d.ts +18 -0
  441. package/dist/fn/type/isPromise.js +27 -0
  442. package/dist/fn/type/isPropSize.d.ts +2 -0
  443. package/dist/fn/type/isPropSize.js +12 -0
  444. package/dist/fn/type/isSQLDate.d.ts +10 -0
  445. package/dist/fn/type/isSQLDate.js +20 -0
  446. package/dist/fn/type/isSame.d.ts +41 -0
  447. package/dist/fn/type/isSame.js +72 -0
  448. package/dist/fn/type/isString.d.ts +14 -0
  449. package/dist/fn/type/isString.js +23 -0
  450. package/dist/fn/type/isSymbol.d.ts +15 -0
  451. package/dist/fn/type/isSymbol.js +24 -0
  452. package/dist/fn/type/isURL.d.ts +2 -0
  453. package/dist/fn/type/isURL.js +11 -0
  454. package/dist/fn/type/isValidDimension.d.ts +11 -0
  455. package/dist/fn/type/isValidDimension.js +24 -0
  456. package/dist/fn/type/isValidName.d.ts +27 -0
  457. package/dist/fn/type/isValidName.js +38 -0
  458. package/dist/fn/type/isValue.d.ts +26 -0
  459. package/dist/fn/type/isValue.js +36 -0
  460. package/dist/fn/type/isVue.d.ts +16 -0
  461. package/dist/fn/type/isVue.js +42 -0
  462. package/dist/fn.d.ts +4 -5
  463. package/dist/fn.js +226 -228
  464. package/package.json +1 -1
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Returns the current device type.
3
+ * @method getDeviceType
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.getDeviceType();
8
+ * // mobile
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @returns {String}
12
+ */
13
+ const getDeviceType = function () {
14
+ const userAgent = navigator.userAgent.toLowerCase();
15
+ if (/iPhone|Android/i.test(navigator.userAgent)) {
16
+ return 'mobile';
17
+ }
18
+ if (/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(userAgent)) {
19
+ return 'tablet';
20
+ }
21
+ return 'desktop';
22
+ };
23
+ export { getDeviceType };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Returns a promise having the event's data as argument.
3
+ * @method getEventData
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * let type = e.type;
8
+ * bbn.fn.getEventData(e).then((data) => {
9
+ * bbn.fn.log("DATA FROM " + type, data);
10
+ * });
11
+ * ```
12
+ * @memberof bbn.fn
13
+ * @returns {Promise}
14
+ */
15
+ declare const getEventData: (e: any) => Promise<unknown>;
16
+ export { getEventData };
@@ -0,0 +1,116 @@
1
+ import { getHTMLOfSelection } from '../html/getHTMLOfSelection';
2
+ import { each } from '../loop/each';
3
+ import { defaultErrorFunction } from '../default/defaultErrorFunction';
4
+ /**
5
+ * Returns a promise having the event's data as argument.
6
+ * @method getEventData
7
+ * @global
8
+ * @example
9
+ * ``` javascript
10
+ * let type = e.type;
11
+ * bbn.fn.getEventData(e).then((data) => {
12
+ * bbn.fn.log("DATA FROM " + type, data);
13
+ * });
14
+ * ```
15
+ * @memberof bbn.fn
16
+ * @returns {Promise}
17
+ */
18
+ const getEventData = function (e) {
19
+ let dt = e.dataTransfer || e.clipboardData;
20
+ let t = dt.getData('Text');
21
+ let res = { raw: t, files: [], str: [] };
22
+ let p = new Promise((ok, err) => {
23
+ let done = !(dt instanceof DataTransfer);
24
+ if (!t && e.type === 'copy') {
25
+ let sel = window.getSelection();
26
+ res.raw = sel.toString();
27
+ let html = getHTMLOfSelection();
28
+ res.str.push({
29
+ type: 'text/plain',
30
+ data: res.raw,
31
+ });
32
+ if (html !== res.raw) {
33
+ res.str.push({
34
+ type: 'text/html',
35
+ data: html,
36
+ });
37
+ }
38
+ else if (res.raw.trim().indexOf('<') === 0) {
39
+ res.str.push({
40
+ type: 'text/html',
41
+ data: "<meta charset='utf-8'><code style=\"white-space: pre; font-family: 'Courier New', sans-serif\">\n" +
42
+ res.raw +
43
+ '\n</code>',
44
+ });
45
+ }
46
+ done = true;
47
+ ok(res);
48
+ }
49
+ if (!done) {
50
+ let strings = [];
51
+ let num = dt.items.length;
52
+ each(dt.items, (item, idx) => {
53
+ let kind = item.kind;
54
+ let type = item.type;
55
+ if (kind === 'file') {
56
+ let cp = dt.files[idx];
57
+ if (!type && cp.name) {
58
+ let bits = cp.name.split('.');
59
+ type = bits[bits.length - 1];
60
+ }
61
+ let name = cp ? cp.name : bbn._('untitled');
62
+ let size = cp ? cp.size : null;
63
+ let lastModified = cp ? cp.lastModified : null;
64
+ let blob = item.getAsFile();
65
+ if (blob) {
66
+ done = true;
67
+ num--;
68
+ res.files.push({
69
+ type: type,
70
+ data: blob,
71
+ name: name,
72
+ size: size,
73
+ mdate: lastModified,
74
+ });
75
+ strings.push(name);
76
+ if (!num) {
77
+ if (!res.raw) {
78
+ res.raw = strings.join(', ');
79
+ }
80
+ ok(res);
81
+ }
82
+ }
83
+ else {
84
+ defaultErrorFunction(bbn._('Impossible to read the file') + ' ' + name);
85
+ }
86
+ }
87
+ else {
88
+ done = true;
89
+ item.getAsString((data) => {
90
+ num--;
91
+ res.str.push({
92
+ type: type,
93
+ data: data,
94
+ });
95
+ if (type === 'text/plain') {
96
+ strings.push(name);
97
+ }
98
+ if (!num) {
99
+ if (!res.raw) {
100
+ res.raw = strings.join(', ');
101
+ }
102
+ ok(res);
103
+ }
104
+ });
105
+ }
106
+ });
107
+ }
108
+ if (!done) {
109
+ setTimeout(() => {
110
+ ok(res);
111
+ });
112
+ }
113
+ });
114
+ return p;
115
+ };
116
+ export { getEventData };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Logs the given argument in the browser's console highlighting it with a green background.
3
+ * @method happy
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.happy('I want to log the success of my function');
8
+ * ```
9
+ * @memberof bbn.fn
10
+ * @param {...any} args
11
+ * @returns
12
+ */
13
+ declare const happy: (...args: any[]) => any;
14
+ export { happy };
@@ -0,0 +1,22 @@
1
+ import { log } from './log';
2
+ /**
3
+ * Logs the given argument in the browser's console highlighting it with a green background.
4
+ * @method happy
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.happy('I want to log the success of my function');
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @param {...any} args
12
+ * @returns
13
+ */
14
+ const happy = function (...args) {
15
+ args.unshift({
16
+ _bbn_console_level: 3,
17
+ _bbn_console_style: 'color: white; background: green; font-size: 18px;',
18
+ });
19
+ log.apply(this, args);
20
+ return this;
21
+ };
22
+ export { happy };
@@ -0,0 +1,2 @@
1
+ declare const history: () => false | History;
2
+ export { history };
@@ -0,0 +1,4 @@
1
+ const history = function () {
2
+ return window.history || false;
3
+ };
4
+ export { history };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Logs the given argument in the browser's console highlighting it with a blue background.
3
+ * @method info
4
+ * @global
5
+ * @memberof bbn.fn
6
+ * @param {...any} args
7
+ * @returns {*}
8
+ */
9
+ declare const info: (...args: any[]) => any;
10
+ export { info };
@@ -0,0 +1,19 @@
1
+ import { log } from './log';
2
+ /**
3
+ * Logs the given argument in the browser's console highlighting it with a blue background.
4
+ * @method info
5
+ * @global
6
+ * @memberof bbn.fn
7
+ * @param {...any} args
8
+ * @returns {*}
9
+ */
10
+ const info = function (...args) {
11
+ args.unshift({
12
+ //_bbn_console_mode: "info",
13
+ _bbn_console_level: 4,
14
+ _bbn_console_style: 'color: #EEE; background: blue; font-size: 12px;',
15
+ });
16
+ log.apply(this, args);
17
+ return this;
18
+ };
19
+ export { info };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Tells if the interface is beeing active for the past x seconds.
3
+ * @method isActiveInterface
4
+ * @global
5
+ * @example
6
+ * // true
7
+ * ``` javascript
8
+ * bbn.fn.isActiveInterface(54764654);
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @returns {Boolean}
12
+ */
13
+ declare const isActiveInterface: (secs?: number) => boolean;
14
+ export { isActiveInterface };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Tells if the interface is beeing active for the past x seconds.
3
+ * @method isActiveInterface
4
+ * @global
5
+ * @example
6
+ * // true
7
+ * ``` javascript
8
+ * bbn.fn.isActiveInterface(54764654);
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @returns {Boolean}
12
+ */
13
+ const isActiveInterface = function (secs = 600) {
14
+ if (!bbn.env.last_focus) {
15
+ return false;
16
+ }
17
+ let t = new Date().getTime();
18
+ return t - bbn.env.last_focus < secs * 1000;
19
+ };
20
+ export { isActiveInterface };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns true if the current device type is a desktop.
3
+ * @method isDesktopDevice
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.isDesktopDevice();
8
+ * // true
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @returns {Boolean}
12
+ */
13
+ declare const isDesktopDevice: () => boolean;
14
+ export { isDesktopDevice };
@@ -0,0 +1,17 @@
1
+ import { getDeviceType } from '../browser/getDeviceType';
2
+ /**
3
+ * Returns true if the current device type is a desktop.
4
+ * @method isDesktopDevice
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.isDesktopDevice();
9
+ * // true
10
+ * ```
11
+ * @memberof bbn.fn
12
+ * @returns {Boolean}
13
+ */
14
+ const isDesktopDevice = function () {
15
+ return getDeviceType() === 'desktop';
16
+ };
17
+ export { isDesktopDevice };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Checks whether the given elemet is focused or not.
3
+ *
4
+ * @method isFocused
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.isFocused(document.getElementById('input_name'));
9
+ * // false
10
+ * bbn.fn.isFocused(bbn.sel('.container'));
11
+ * // true
12
+ * ```
13
+ * @memberof bbn.fn
14
+ *
15
+ * @param {Element} ele The element to be checked for focus
16
+ * @param {Boolean} contain If true will check if the focused element is contained in the given element
17
+ *
18
+ * @returns {Boolean} True if focused
19
+ */
20
+ declare const isFocused: (ele: HTMLElement, contain?: boolean) => boolean;
21
+ export { isFocused };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Checks whether the given elemet is focused or not.
3
+ *
4
+ * @method isFocused
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.isFocused(document.getElementById('input_name'));
9
+ * // false
10
+ * bbn.fn.isFocused(bbn.sel('.container'));
11
+ * // true
12
+ * ```
13
+ * @memberof bbn.fn
14
+ *
15
+ * @param {Element} ele The element to be checked for focus
16
+ * @param {Boolean} contain If true will check if the focused element is contained in the given element
17
+ *
18
+ * @returns {Boolean} True if focused
19
+ */
20
+ const isFocused = function (ele, contain) {
21
+ return ele === document.activeElement || (contain && ele.contains && ele.contains(document.activeElement));
22
+ };
23
+ export { isFocused };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns true if the current browser is on a mobile device (smartphone or tablet).
3
+ * @method isMobile
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.isMobile();
8
+ * // false
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @returns {Boolean}
12
+ */
13
+ declare const isMobile: () => boolean;
14
+ export { isMobile };
@@ -0,0 +1,18 @@
1
+ import { isMobileDevice } from './isMobileDevice';
2
+ import { isTabletDevice } from './isTabletDevice';
3
+ /**
4
+ * Returns true if the current browser is on a mobile device (smartphone or tablet).
5
+ * @method isMobile
6
+ * @global
7
+ * @example
8
+ * ``` javascript
9
+ * bbn.fn.isMobile();
10
+ * // false
11
+ * ```
12
+ * @memberof bbn.fn
13
+ * @returns {Boolean}
14
+ */
15
+ const isMobile = function () {
16
+ return isMobileDevice() || isTabletDevice();
17
+ };
18
+ export { isMobile };
@@ -0,0 +1,2 @@
1
+ declare const isMobileDevice: () => boolean;
2
+ export { isMobileDevice };
@@ -0,0 +1,5 @@
1
+ import { getDeviceType } from '../browser/getDeviceType';
2
+ const isMobileDevice = function () {
3
+ return getDeviceType() === 'mobile';
4
+ };
5
+ export { isMobileDevice };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns true if the current device type is a tablet.
3
+ * @method isTabletDevice
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.isTabletDevice();
8
+ * // false
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @returns {Boolean}
12
+ */
13
+ declare const isTabletDevice: () => boolean;
14
+ export { isTabletDevice };
@@ -0,0 +1,17 @@
1
+ import { getDeviceType } from '../browser/getDeviceType';
2
+ /**
3
+ * Returns true if the current device type is a tablet.
4
+ * @method isTabletDevice
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.isTabletDevice();
9
+ * // false
10
+ * ```
11
+ * @memberof bbn.fn
12
+ * @returns {Boolean}
13
+ */
14
+ const isTabletDevice = function () {
15
+ return getDeviceType() === 'tablet';
16
+ };
17
+ export { isTabletDevice };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Logs the given arguments in the browser's console.
3
+ * @method log
4
+ * @global
5
+ * @example
6
+ * ```javascript
7
+ * //'hello'
8
+ * bbn.fn.log('hello');
9
+ * ```
10
+ * @memberof bbn.fn
11
+ * @param {...any} args
12
+ * @returns
13
+ */
14
+ declare const log: (...args: any[]) => any;
15
+ export { log };
@@ -0,0 +1,46 @@
1
+ import { isFunction } from '../type/isFunction';
2
+ /**
3
+ * Logs the given arguments in the browser's console.
4
+ * @method log
5
+ * @global
6
+ * @example
7
+ * ```javascript
8
+ * //'hello'
9
+ * bbn.fn.log('hello');
10
+ * ```
11
+ * @memberof bbn.fn
12
+ * @param {...any} args
13
+ * @returns
14
+ */
15
+ const log = function (...args) {
16
+ if (window.console !== undefined) {
17
+ let cfg;
18
+ let level = 5;
19
+ let fn = 'log';
20
+ if (args[0] && typeof args[0] === 'object' && args[0]._bbn_console_style) {
21
+ if (args[0]._bbn_console_mode && isFunction(console[args[0]._bbn_console_mode])) {
22
+ fn = args[0]._bbn_console_mode;
23
+ }
24
+ else {
25
+ cfg = args[0]._bbn_console_style;
26
+ level = args[0]._bbn_console_level;
27
+ }
28
+ args.shift();
29
+ }
30
+ if (bbn.env.loggingLevel >= level) {
31
+ let i = 0;
32
+ while (i < args.length) {
33
+ let t = typeof args[i];
34
+ if (t === 'string' || t === 'number') {
35
+ window.console[fn]('%c %s ', cfg, args[i]);
36
+ }
37
+ else {
38
+ window.console[fn](args[i]);
39
+ }
40
+ i++;
41
+ }
42
+ }
43
+ }
44
+ return this;
45
+ };
46
+ export { log };
@@ -0,0 +1,2 @@
1
+ declare const replaceSelection: (html: any, selectInserted: any) => void;
2
+ export { replaceSelection };
@@ -0,0 +1,42 @@
1
+ const replaceSelection = function (html, selectInserted) {
2
+ let sel, range, fragment;
3
+ sel = window.getSelection();
4
+ // Test that the Selection object contains at least one Range
5
+ if (sel.getRangeAt && sel.rangeCount) {
6
+ // Get the first Range (only Firefox supports more than one)
7
+ range = window.getSelection().getRangeAt(0);
8
+ range.deleteContents();
9
+ // Create a DocumentFragment to insert and populate it with HTML
10
+ // Need to test for the existence of range.createContextualFragment
11
+ // because it's non-standard and IE 9 does not support it
12
+ if (range.createContextualFragment) {
13
+ fragment = range.createContextualFragment(html);
14
+ }
15
+ else {
16
+ // In IE 9 we need to use innerHTML of a temporary element
17
+ const div = document.createElement('div');
18
+ let child;
19
+ div.innerHTML = html;
20
+ fragment = document.createDocumentFragment();
21
+ while ((child = div.firstChild)) {
22
+ fragment.appendChild(child);
23
+ }
24
+ }
25
+ const firstInsertedNode = fragment.firstChild;
26
+ const lastInsertedNode = fragment.lastChild;
27
+ range.insertNode(fragment);
28
+ sel.removeAllRanges();
29
+ if (selectInserted) {
30
+ if (firstInsertedNode) {
31
+ range.setStartBefore(firstInsertedNode);
32
+ range.setEndAfter(lastInsertedNode);
33
+ }
34
+ sel.addRange(range);
35
+ }
36
+ else {
37
+ range.setStartAfter(lastInsertedNode);
38
+ sel.addRange(range);
39
+ }
40
+ }
41
+ };
42
+ export { replaceSelection };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Selects the content of an element.
3
+ *
4
+ * @method selectElementText
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.selectElementText(document.getElementById('my_input_id'));
9
+ * // false
10
+ * bbn.fn.selectElementText(bbn.$('#my_span_id'));
11
+ * // true
12
+ * ```
13
+ * @memberof bbn.fn
14
+ *
15
+ * @param {Element} ele The element in which the text should be selected
16
+ * @param {Boolean} win The window object
17
+ *
18
+ * @returns {Boolean} True if focused
19
+ */
20
+ declare const selectElementText: (ele: HTMLElement, win?: Window) => void;
21
+ export { selectElementText };
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Selects the content of an element.
3
+ *
4
+ * @method selectElementText
5
+ * @global
6
+ * @example
7
+ * ``` javascript
8
+ * bbn.fn.selectElementText(document.getElementById('my_input_id'));
9
+ * // false
10
+ * bbn.fn.selectElementText(bbn.$('#my_span_id'));
11
+ * // true
12
+ * ```
13
+ * @memberof bbn.fn
14
+ *
15
+ * @param {Element} ele The element in which the text should be selected
16
+ * @param {Boolean} win The window object
17
+ *
18
+ * @returns {Boolean} True if focused
19
+ */
20
+ const selectElementText = function (ele, win) {
21
+ win = win || window;
22
+ if (ele instanceof HTMLInputElement) {
23
+ ele.select();
24
+ return;
25
+ }
26
+ let doc = win.document;
27
+ let sel;
28
+ let range;
29
+ if (win.getSelection && doc.createRange) {
30
+ sel = win.getSelection();
31
+ range = doc.createRange();
32
+ range.selectNodeContents(ele);
33
+ sel.removeAllRanges();
34
+ sel.addRange(range);
35
+ }
36
+ else if (('createTextRange' in doc.body) && (typeof doc.body.createTextRange === 'function')) {
37
+ range = doc.body.createTextRange();
38
+ range.moveToElementText(ele);
39
+ range.select();
40
+ }
41
+ };
42
+ export { selectElementText };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Creates a cookie and assigns it to document.cookie.
3
+ * @method setCookie
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.setCookie('lang', 'en', 2);
8
+ * ```
9
+ * @memberof bbn.fn
10
+ * @param {String} name The name of the cookie.
11
+ * @param {String} value The value of the cookie.
12
+ * @param {Number} days The days before expiration of the cookie.
13
+ * @returns
14
+ */
15
+ declare const setCookie: (name: any, value: any, days: any) => void;
16
+ export { setCookie };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Creates a cookie and assigns it to document.cookie.
3
+ * @method setCookie
4
+ * @global
5
+ * @example
6
+ * ``` javascript
7
+ * bbn.fn.setCookie('lang', 'en', 2);
8
+ * ```
9
+ * @memberof bbn.fn
10
+ * @param {String} name The name of the cookie.
11
+ * @param {String} value The value of the cookie.
12
+ * @param {Number} days The days before expiration of the cookie.
13
+ * @returns
14
+ */
15
+ const setCookie = function (name, value, days) {
16
+ let expires = '';
17
+ if (days) {
18
+ let date = new Date();
19
+ date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
20
+ expires = '; expires=' + date.toUTCString();
21
+ }
22
+ let st = escape(JSON.stringify({ value: value }));
23
+ document.cookie = name + '=' + st + expires + '; path=/';
24
+ };
25
+ export { setCookie };
@@ -0,0 +1,2 @@
1
+ declare const toggleFullScreen: () => void;
2
+ export { toggleFullScreen };