@bbn/bbn 1.0.25 → 1.0.27

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 (347) hide show
  1. package/dist/bundle.d.ts +226 -240
  2. package/dist/bundle.js +952 -919
  3. package/dist/fn/_addLoader.js +7 -4
  4. package/dist/fn/_compareValues.js +14 -11
  5. package/dist/fn/_deleteLoader.d.ts +1 -1
  6. package/dist/fn/_deleteLoader.js +12 -9
  7. package/dist/fn/abort.js +10 -7
  8. package/dist/fn/abortURL.js +8 -5
  9. package/dist/fn/addColors.d.ts +1 -1
  10. package/dist/fn/addColors.js +31 -11
  11. package/dist/fn/addInputs.d.ts +1 -2
  12. package/dist/fn/addInputs.js +10 -8
  13. package/dist/fn/addStyle.js +8 -5
  14. package/dist/fn/adjustHeight.js +8 -5
  15. package/dist/fn/adjustSize.js +9 -6
  16. package/dist/fn/adjustWidth.js +8 -5
  17. package/dist/fn/ajax.d.ts +1 -1
  18. package/dist/fn/ajax.js +40 -36
  19. package/dist/fn/analyzeFunction.js +11 -8
  20. package/dist/fn/animateCss.js +12 -8
  21. package/dist/fn/arrayBuffer2String.js +4 -1
  22. package/dist/fn/arrayFromProp.js +8 -5
  23. package/dist/fn/autoExtend.js +7 -4
  24. package/dist/fn/baseName.d.ts +1 -1
  25. package/dist/fn/baseName.js +10 -7
  26. package/dist/fn/br2nl.d.ts +1 -1
  27. package/dist/fn/br2nl.js +6 -3
  28. package/dist/fn/calendar.d.ts +1 -1
  29. package/dist/fn/calendar.js +21 -12
  30. package/dist/fn/callback.d.ts +1 -1
  31. package/dist/fn/callback.js +24 -21
  32. package/dist/fn/camelToCss.js +8 -3
  33. package/dist/fn/camelize.js +4 -1
  34. package/dist/fn/canvasToImage.js +5 -2
  35. package/dist/fn/center.js +7 -6
  36. package/dist/fn/checkProps.d.ts +1 -1
  37. package/dist/fn/checkProps.js +7 -4
  38. package/dist/fn/checkPropsDetails.d.ts +1 -4
  39. package/dist/fn/checkPropsDetails.js +21 -19
  40. package/dist/fn/checkPropsOrDie.d.ts +1 -1
  41. package/dist/fn/checkPropsOrDie.js +7 -4
  42. package/dist/fn/checkType.d.ts +1 -1
  43. package/dist/fn/checkType.js +20 -17
  44. package/dist/fn/chrono.d.ts +3 -0
  45. package/dist/fn/chrono.js +27 -0
  46. package/dist/fn/circularReplacer.js +11 -8
  47. package/dist/fn/clone.d.ts +0 -1
  48. package/dist/fn/clone.js +11 -8
  49. package/dist/fn/colorToHex.js +5 -2
  50. package/dist/fn/compare.js +65 -62
  51. package/dist/fn/compareConditions.d.ts +0 -1
  52. package/dist/fn/compareConditions.js +14 -11
  53. package/dist/fn/copy.js +16 -13
  54. package/dist/fn/correctCase.js +5 -2
  55. package/dist/fn/count.d.ts +1 -1
  56. package/dist/fn/count.js +7 -4
  57. package/dist/fn/crc32.js +15 -4
  58. package/dist/fn/createObject.d.ts +1 -1
  59. package/dist/fn/createObject.js +8 -5
  60. package/dist/fn/cssExists.js +12 -6
  61. package/dist/fn/date.js +13 -10
  62. package/dist/fn/dateSQL.d.ts +1 -1
  63. package/dist/fn/dateSQL.js +12 -4
  64. package/dist/fn/daysInMonth.d.ts +1 -1
  65. package/dist/fn/daysInMonth.js +11 -4
  66. package/dist/fn/deepPath.d.ts +1 -2
  67. package/dist/fn/deepPath.js +10 -7
  68. package/dist/fn/defaultAjaxAbortFunction.d.ts +1 -1
  69. package/dist/fn/defaultAjaxAbortFunction.js +7 -4
  70. package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
  71. package/dist/fn/defaultAjaxErrorFunction.js +4 -13
  72. package/dist/fn/defaultAlertFunction.d.ts +1 -1
  73. package/dist/fn/defaultAlertFunction.js +6 -4
  74. package/dist/fn/defaultConfirmFunction.d.ts +1 -1
  75. package/dist/fn/defaultConfirmFunction.js +7 -4
  76. package/dist/fn/defaultEndLoadingFunction.d.ts +1 -1
  77. package/dist/fn/defaultEndLoadingFunction.js +5 -18
  78. package/dist/fn/defaultErrorFunction.js +6 -3
  79. package/dist/fn/defaultHistoryFunction.js +4 -1
  80. package/dist/fn/defaultLinkFunction.js +4 -1
  81. package/dist/fn/defaultPostLinkFunction.d.ts +1 -1
  82. package/dist/fn/defaultPostLinkFunction.js +5 -2
  83. package/dist/fn/defaultPreLinkFunction.d.ts +1 -1
  84. package/dist/fn/defaultPreLinkFunction.js +6 -11
  85. package/dist/fn/defaultResizeFunction.js +4 -1
  86. package/dist/fn/defaultStartLoadingFunction.d.ts +1 -1
  87. package/dist/fn/defaultStartLoadingFunction.js +6 -14
  88. package/dist/fn/deleteProp.d.ts +1 -1
  89. package/dist/fn/deleteProp.js +7 -3
  90. package/dist/fn/diffObj.d.ts +1 -2
  91. package/dist/fn/diffObj.js +30 -28
  92. package/dist/fn/dirName.d.ts +1 -1
  93. package/dist/fn/dirName.js +10 -7
  94. package/dist/fn/download.d.ts +1 -1
  95. package/dist/fn/download.js +21 -20
  96. package/dist/fn/downloadContent.d.ts +1 -1
  97. package/dist/fn/downloadContent.js +12 -9
  98. package/dist/fn/each.js +10 -7
  99. package/dist/fn/eraseCookie.js +4 -1
  100. package/dist/fn/error.js +8 -5
  101. package/dist/fn/escapeDquotes.js +6 -3
  102. package/dist/fn/escapeRegExp.js +5 -2
  103. package/dist/fn/escapeSquotes.js +6 -3
  104. package/dist/fn/escapeTicks.js +7 -4
  105. package/dist/fn/escapeUrl.js +11 -8
  106. package/dist/fn/extend.d.ts +1 -2
  107. package/dist/fn/extend.js +27 -24
  108. package/dist/fn/extendOut.d.ts +1 -2
  109. package/dist/fn/extendOut.js +10 -7
  110. package/dist/fn/fdate.d.ts +1 -1
  111. package/dist/fn/fdate.js +18 -11
  112. package/dist/fn/fdatetime.d.ts +1 -1
  113. package/dist/fn/fdatetime.js +17 -10
  114. package/dist/fn/fieldValue.js +6 -3
  115. package/dist/fn/fileExt.js +7 -4
  116. package/dist/fn/filter.d.ts +1 -2
  117. package/dist/fn/filter.js +26 -22
  118. package/dist/fn/filterToConditions.d.ts +11 -3
  119. package/dist/fn/filterToConditions.js +16 -13
  120. package/dist/fn/findAll.d.ts +0 -1
  121. package/dist/fn/findAll.js +10 -7
  122. package/dist/fn/fori.d.ts +1 -1
  123. package/dist/fn/fori.js +9 -6
  124. package/dist/fn/forir.d.ts +1 -1
  125. package/dist/fn/forir.js +9 -6
  126. package/dist/fn/format.js +6 -3
  127. package/dist/fn/formatBytes.js +4 -1
  128. package/dist/fn/formatDate.d.ts +1 -1
  129. package/dist/fn/formatDate.js +9 -2
  130. package/dist/fn/formatSize.js +8 -5
  131. package/dist/fn/formdata.d.ts +1 -1
  132. package/dist/fn/formdata.js +23 -21
  133. package/dist/fn/fromXml.js +10 -7
  134. package/dist/fn/ftime.js +18 -11
  135. package/dist/fn/getAllTags.d.ts +1 -1
  136. package/dist/fn/getAllTags.js +6 -3
  137. package/dist/fn/getAncestors.d.ts +1 -1
  138. package/dist/fn/getAncestors.js +11 -9
  139. package/dist/fn/getAttributes.js +7 -4
  140. package/dist/fn/getBrowserName.js +13 -10
  141. package/dist/fn/getBrowserVersion.js +6 -3
  142. package/dist/fn/getCookie.js +5 -2
  143. package/dist/fn/getCssVar.js +4 -1
  144. package/dist/fn/getDay.js +6 -3
  145. package/dist/fn/getDeviceType.js +7 -4
  146. package/dist/fn/getEventData.js +19 -13
  147. package/dist/fn/getField.d.ts +1 -1
  148. package/dist/fn/getField.js +8 -4
  149. package/dist/fn/getFieldValues.d.ts +1 -1
  150. package/dist/fn/getFieldValues.js +10 -7
  151. package/dist/fn/getHTMLOfSelection.d.ts +1 -1
  152. package/dist/fn/getHTMLOfSelection.js +14 -21
  153. package/dist/fn/getHtml.js +6 -3
  154. package/dist/fn/getLoader.d.ts +1 -1
  155. package/dist/fn/getLoader.js +6 -3
  156. package/dist/fn/getPath.d.ts +1 -1
  157. package/dist/fn/getPath.js +9 -6
  158. package/dist/fn/getProp.js +7 -3
  159. package/dist/fn/getProperty.js +5 -2
  160. package/dist/fn/getRequestId.js +8 -5
  161. package/dist/fn/getRow.d.ts +1 -1
  162. package/dist/fn/getRow.js +7 -4
  163. package/dist/fn/getScrollBarSize.js +13 -8
  164. package/dist/fn/getText.d.ts +1 -1
  165. package/dist/fn/getText.js +4 -1
  166. package/dist/fn/getTimeoff.js +5 -2
  167. package/dist/fn/happy.js +7 -4
  168. package/dist/fn/hash.d.ts +1 -1
  169. package/dist/fn/hash.js +14 -11
  170. package/dist/fn/hex2rgb.js +11 -6
  171. package/dist/fn/history.js +4 -1
  172. package/dist/fn/html2text.d.ts +1 -1
  173. package/dist/fn/html2text.js +4 -1
  174. package/dist/fn/imageToCanvas.js +6 -3
  175. package/dist/fn/imgToBase64.d.ts +1 -1
  176. package/dist/fn/imgToBase64.js +9 -6
  177. package/dist/fn/info.js +7 -4
  178. package/dist/fn/init.js +81 -54
  179. package/dist/fn/isActiveInterface.js +6 -3
  180. package/dist/fn/isArray.js +4 -1
  181. package/dist/fn/isBlob.js +4 -1
  182. package/dist/fn/isBoolean.js +4 -1
  183. package/dist/fn/isCanvas.js +4 -1
  184. package/dist/fn/isColor.d.ts +1 -1
  185. package/dist/fn/isColor.js +16 -6
  186. package/dist/fn/isComment.js +4 -1
  187. package/dist/fn/isCp.js +12 -9
  188. package/dist/fn/isDate.js +4 -1
  189. package/dist/fn/isDesktopDevice.js +4 -1
  190. package/dist/fn/isDimension.d.ts +1 -1
  191. package/dist/fn/isDimension.js +16 -6
  192. package/dist/fn/isDom.js +4 -1
  193. package/dist/fn/isEmail.d.ts +1 -1
  194. package/dist/fn/isEmail.js +16 -6
  195. package/dist/fn/isEmpty.js +9 -6
  196. package/dist/fn/isEvent.js +4 -1
  197. package/dist/fn/isFocused.d.ts +1 -1
  198. package/dist/fn/isFocused.js +5 -2
  199. package/dist/fn/isFunction.js +4 -1
  200. package/dist/fn/isHostname.js +8 -5
  201. package/dist/fn/isIP.js +6 -3
  202. package/dist/fn/isInside.js +10 -7
  203. package/dist/fn/isInt.js +4 -1
  204. package/dist/fn/isIterable.js +5 -2
  205. package/dist/fn/isMobile.js +7 -4
  206. package/dist/fn/isMobileDevice.js +4 -1
  207. package/dist/fn/isNull.js +4 -1
  208. package/dist/fn/isNumber.js +5 -2
  209. package/dist/fn/isObject.js +4 -1
  210. package/dist/fn/isPercent.js +5 -2
  211. package/dist/fn/isPrimitive.js +5 -2
  212. package/dist/fn/isPromise.js +4 -1
  213. package/dist/fn/isPropSize.js +6 -3
  214. package/dist/fn/isSQLDate.js +5 -2
  215. package/dist/fn/isSame.d.ts +1 -2
  216. package/dist/fn/isSame.js +10 -7
  217. package/dist/fn/isString.js +4 -1
  218. package/dist/fn/isSymbol.js +4 -1
  219. package/dist/fn/isTabletDevice.js +4 -1
  220. package/dist/fn/isURL.js +5 -2
  221. package/dist/fn/isValidDimension.js +7 -5
  222. package/dist/fn/isValidName.js +6 -3
  223. package/dist/fn/isValue.js +6 -3
  224. package/dist/fn/isVue.d.ts +1 -1
  225. package/dist/fn/isVue.js +9 -6
  226. package/dist/fn/iterate.d.ts +1 -1
  227. package/dist/fn/iterate.js +10 -7
  228. package/dist/fn/lightenDarkenHex.js +6 -3
  229. package/dist/fn/link.d.ts +1 -2
  230. package/dist/fn/link.js +35 -34
  231. package/dist/fn/log.js +10 -7
  232. package/dist/fn/makeReactive.d.ts +0 -1
  233. package/dist/fn/makeReactive.js +59 -44
  234. package/dist/fn/map.d.ts +0 -1
  235. package/dist/fn/map.js +6 -3
  236. package/dist/fn/md5.js +34 -11
  237. package/dist/fn/money.d.ts +1 -1
  238. package/dist/fn/money.js +53 -37
  239. package/dist/fn/move.d.ts +1 -1
  240. package/dist/fn/move.js +5 -2
  241. package/dist/fn/multiorder.d.ts +1 -1
  242. package/dist/fn/multiorder.js +11 -8
  243. package/dist/fn/nl2br.d.ts +1 -1
  244. package/dist/fn/nl2br.js +6 -3
  245. package/dist/fn/numProperties.d.ts +1 -1
  246. package/dist/fn/numProperties.js +5 -2
  247. package/dist/fn/objectToFormData.d.ts +1 -1
  248. package/dist/fn/objectToFormData.js +17 -14
  249. package/dist/fn/order.js +6 -3
  250. package/dist/fn/outerHeight.d.ts +1 -1
  251. package/dist/fn/outerHeight.js +11 -7
  252. package/dist/fn/outerWidth.d.ts +1 -1
  253. package/dist/fn/outerWidth.js +7 -5
  254. package/dist/fn/percent.js +4 -1
  255. package/dist/fn/pickValue.d.ts +1 -1
  256. package/dist/fn/pickValue.js +4 -1
  257. package/dist/fn/post.d.ts +1 -1
  258. package/dist/fn/post.js +11 -8
  259. package/dist/fn/postOut.d.ts +1 -1
  260. package/dist/fn/postOut.js +10 -7
  261. package/dist/fn/printf.js +5 -4
  262. package/dist/fn/quotes2html.d.ts +1 -1
  263. package/dist/fn/quotes2html.js +9 -6
  264. package/dist/fn/randomInt.d.ts +1 -1
  265. package/dist/fn/randomInt.js +4 -1
  266. package/dist/fn/randomString.d.ts +1 -1
  267. package/dist/fn/randomString.js +16 -12
  268. package/dist/fn/removeAccents.d.ts +1 -1
  269. package/dist/fn/removeAccents.js +9 -6
  270. package/dist/fn/removeEmpty.d.ts +1 -1
  271. package/dist/fn/removeEmpty.js +11 -8
  272. package/dist/fn/removeExtraSpaces.d.ts +1 -1
  273. package/dist/fn/removeExtraSpaces.js +4 -1
  274. package/dist/fn/removeHtmlComments.d.ts +1 -1
  275. package/dist/fn/removeHtmlComments.js +6 -3
  276. package/dist/fn/removePrivateProp.d.ts +1 -2
  277. package/dist/fn/removePrivateProp.js +11 -8
  278. package/dist/fn/removeTrailingChars.d.ts +1 -1
  279. package/dist/fn/removeTrailingChars.js +9 -6
  280. package/dist/fn/repeat.d.ts +1 -1
  281. package/dist/fn/repeat.js +5 -7
  282. package/dist/fn/replaceAll.d.ts +1 -1
  283. package/dist/fn/replaceAll.js +7 -7
  284. package/dist/fn/replaceSelection.js +5 -2
  285. package/dist/fn/resize.js +18 -13
  286. package/dist/fn/rgb2hex.js +10 -5
  287. package/dist/fn/riterate.d.ts +1 -1
  288. package/dist/fn/riterate.js +6 -3
  289. package/dist/fn/roundDecimal.d.ts +1 -1
  290. package/dist/fn/roundDecimal.js +5 -2
  291. package/dist/fn/sanitize.js +10 -5
  292. package/dist/fn/search.d.ts +2 -1
  293. package/dist/fn/search.js +41 -35
  294. package/dist/fn/selectElementText.d.ts +1 -1
  295. package/dist/fn/selectElementText.js +5 -2
  296. package/dist/fn/selector.d.ts +1 -1
  297. package/dist/fn/selector.js +5 -2
  298. package/dist/fn/setCookie.js +8 -5
  299. package/dist/fn/setCssVar.js +6 -2
  300. package/dist/fn/setNavigationVars.d.ts +1 -1
  301. package/dist/fn/setNavigationVars.js +18 -14
  302. package/dist/fn/setProp.d.ts +1 -1
  303. package/dist/fn/setProp.js +5 -4
  304. package/dist/fn/setProperty.d.ts +1 -1
  305. package/dist/fn/setProperty.js +8 -5
  306. package/dist/fn/shorten.d.ts +1 -1
  307. package/dist/fn/shorten.js +10 -7
  308. package/dist/fn/shortenObj.d.ts +1 -2
  309. package/dist/fn/shortenObj.js +13 -10
  310. package/dist/fn/shuffle.d.ts +1 -1
  311. package/dist/fn/shuffle.js +5 -4
  312. package/dist/fn/simpleHash.d.ts +1 -1
  313. package/dist/fn/simpleHash.js +8 -5
  314. package/dist/fn/simpleHash1.d.ts +1 -1
  315. package/dist/fn/simpleHash1.js +5 -2
  316. package/dist/fn/simpleHash2.d.ts +1 -1
  317. package/dist/fn/simpleHash2.js +4 -1
  318. package/dist/fn/stat.d.ts +1 -1
  319. package/dist/fn/stat.js +12 -9
  320. package/dist/fn/string2ArrayBuffer.d.ts +1 -1
  321. package/dist/fn/string2ArrayBuffer.js +4 -1
  322. package/dist/fn/submit.d.ts +1 -1
  323. package/dist/fn/submit.js +15 -27
  324. package/dist/fn/substr.d.ts +1 -1
  325. package/dist/fn/substr.js +11 -8
  326. package/dist/fn/sum.d.ts +1 -1
  327. package/dist/fn/sum.js +9 -7
  328. package/dist/fn/timestamp.d.ts +1 -1
  329. package/dist/fn/timestamp.js +5 -2
  330. package/dist/fn/toCSV.d.ts +1 -1
  331. package/dist/fn/toCSV.js +12 -9
  332. package/dist/fn/toggleFullScreen.js +19 -16
  333. package/dist/fn/translate.d.ts +1 -1
  334. package/dist/fn/translate.js +6 -3
  335. package/dist/fn/treatAjaxArguments.d.ts +1 -1
  336. package/dist/fn/treatAjaxArguments.js +28 -23
  337. package/dist/fn/trim.js +7 -4
  338. package/dist/fn/uniqString.js +12 -9
  339. package/dist/fn/unique.d.ts +1 -1
  340. package/dist/fn/unique.js +4 -1
  341. package/dist/fn/upload.d.ts +1 -1
  342. package/dist/fn/upload.js +37 -10
  343. package/dist/fn/warning.d.ts +1 -1
  344. package/dist/fn/warning.js +12 -9
  345. package/dist/index.d.ts +110 -112
  346. package/dist/index.js +474 -463
  347. package/package.json +3 -1
@@ -1,13 +1,16 @@
1
- import { extend } from './extend';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.autoExtend = void 0;
4
+ const extend_1 = require("./extend");
2
5
  const autoExtend = function (namespace, obj) {
3
6
  if (!bbn[namespace]) {
4
7
  bbn[namespace] = {};
5
8
  //$.extend(true, bbn[namespace], obj);
6
- extend(bbn[namespace], obj);
9
+ (0, extend_1.extend)(bbn[namespace], obj);
7
10
  }
8
11
  else {
9
12
  // $.extend(true, bbn[namespace], obj);
10
- extend(bbn[namespace], obj);
13
+ (0, extend_1.extend)(bbn[namespace], obj);
11
14
  }
12
15
  };
13
- export { autoExtend };
16
+ exports.autoExtend = autoExtend;
@@ -1,2 +1,2 @@
1
- declare const baseName: (path: any, suffix: any) => any;
1
+ declare const baseName: (path: string, suffix?: string) => string;
2
2
  export { baseName };
@@ -1,17 +1,20 @@
1
- import { isString } from './isString';
2
- import { substr } from './substr';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.baseName = void 0;
4
+ const isString_1 = require("./isString");
5
+ const substr_1 = require("./substr");
3
6
  const baseName = function (path, suffix) {
4
- if (path && isString(path)) {
5
- let bits = path.split("/");
7
+ if (path && (0, isString_1.isString)(path)) {
8
+ let bits = path.split('/');
6
9
  let res = bits.pop();
7
10
  if (!suffix) {
8
11
  return res;
9
12
  }
10
13
  let len = suffix.length;
11
- if (res && substr(res, -len) === suffix) {
12
- return substr(res, 0, res.length - len);
14
+ if (res && (0, substr_1.substr)(res, -len) === suffix) {
15
+ return (0, substr_1.substr)(res, 0, res.length - len);
13
16
  }
14
17
  }
15
18
  return '';
16
19
  };
17
- export { baseName };
20
+ exports.baseName = baseName;
@@ -1,2 +1,2 @@
1
- declare const br2nl: (st: any) => any;
1
+ declare const br2nl: (st: any) => string;
2
2
  export { br2nl };
package/dist/fn/br2nl.js CHANGED
@@ -1,5 +1,8 @@
1
- import { replaceAll } from './replaceAll';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.br2nl = void 0;
4
+ const replaceAll_1 = require("./replaceAll");
2
5
  const br2nl = function (st) {
3
- return replaceAll("<br />", "\n", replaceAll("<br/>", "\n", replaceAll("<br>", "\n", st)));
6
+ return (0, replaceAll_1.replaceAll)('<br />', '\n', (0, replaceAll_1.replaceAll)('<br/>', '\n', (0, replaceAll_1.replaceAll)('<br>', '\n', st)));
4
7
  };
5
- export { br2nl };
8
+ exports.br2nl = br2nl;
@@ -1,2 +1,2 @@
1
- declare const calendar: (d: any, wrong_result: any) => any;
1
+ declare const calendar: (d?: Date | number | string, wrong_result?: string) => any;
2
2
  export { calendar };
@@ -1,22 +1,31 @@
1
- import { fdate } from './fdate';
2
- import { date } from './date';
3
- import { isDate } from './isDate';
4
- import { isString } from './isString';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.calendar = void 0;
7
+ const fdate_1 = require("./fdate");
8
+ const date_1 = require("./date");
9
+ const isDate_1 = require("./isDate");
10
+ const isString_1 = require("./isString");
11
+ const dayjs_1 = __importDefault(require("dayjs"));
12
+ const calendar_1 = __importDefault(require("dayjs/plugin/calendar"));
13
+ dayjs_1.default.extend(calendar_1.default);
5
14
  const calendar = function (d, wrong_result) {
6
- if (undefined === dayjs) {
7
- return fdate(d, wrong_result);
15
+ if (undefined === dayjs_1.default) {
16
+ return (0, fdate_1.fdate)(d, wrong_result);
8
17
  }
9
- let r = date(d);
10
- if (!isDate(r)) {
11
- return wrong_result && isString(wrong_result) ? wrong_result : '';
18
+ let r = (0, date_1.date)(d);
19
+ if (!(0, isDate_1.isDate)(r)) {
20
+ return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
12
21
  }
13
- return dayjs(r).calendar(null, {
22
+ return (0, dayjs_1.default)(r).calendar(null, {
14
23
  sameDay: '[' + bbn._('Today') + ']',
15
24
  nextDay: '[' + bbn._('Tomorrow') + ']',
16
25
  nextWeek: 'ddd D',
17
26
  lastDay: '[' + bbn._('Yesterday') + ']',
18
27
  lastWeek: 'ddd D',
19
- sameElse: 'L'
28
+ sameElse: 'L',
20
29
  });
21
30
  };
22
- export { calendar };
31
+ exports.calendar = calendar;
@@ -1,2 +1,2 @@
1
- declare const callback: (url: any, res: any, fn: any, fn2: any, ele: any) => boolean;
1
+ declare const callback: (url: string, res?: BbnAjaxResult, fn?: (a: BbnAjaxResult, b?: HTMLElement) => any, fn2?: (a: BbnAjaxResult) => any, ele?: HTMLElement | HTMLInputElement | HTMLTextAreaElement) => boolean;
2
2
  export { callback };
@@ -1,10 +1,13 @@
1
- import { error } from './error';
2
- import { defaultLinkFunction } from './defaultLinkFunction';
3
- import { isFunction } from './isFunction';
4
- import { log } from './log';
5
- import { defaultPostLinkFunction } from './defaultPostLinkFunction';
6
- import { defaultAlertFunction } from './defaultAlertFunction';
7
- const callback = function (url, res, fn, fn2, ele) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.callback = void 0;
4
+ const error_1 = require("./error");
5
+ const defaultLinkFunction_1 = require("./defaultLinkFunction");
6
+ const isFunction_1 = require("./isFunction");
7
+ const log_1 = require("./log");
8
+ const defaultPostLinkFunction_1 = require("./defaultPostLinkFunction");
9
+ const defaultAlertFunction_1 = require("./defaultAlertFunction");
10
+ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
8
11
  let tmp = false;
9
12
  if (res) {
10
13
  tmp = true;
@@ -17,7 +20,7 @@ const callback = function (url, res, fn, fn2, ele) {
17
20
  eval(res.prescript);
18
21
  }
19
22
  catch (e) {
20
- error(e.message || '');
23
+ (0, error_1.error)(e.message || '');
21
24
  }
22
25
  }
23
26
  if (isObj && res.url === undefined) {
@@ -28,32 +31,32 @@ const callback = function (url, res, fn, fn2, ele) {
28
31
  tmp = fn(res, ele);
29
32
  }
30
33
  else {
31
- tmp = defaultLinkFunction(res, ele);
34
+ tmp = (0, defaultLinkFunction_1.defaultLinkFunction)(res, ele);
32
35
  }
33
36
  if (ele && isObj && (res.content !== undefined)) {
34
- if (ele.is("input,textarea")) {
35
- ele.val(res.content);
37
+ if ('value' in ele) {
38
+ ele.value = res.content;
36
39
  }
37
40
  else {
38
41
  ele.innerHTML = res.content;
39
42
  }
40
43
  }
41
44
  if (tmp && isObj && res.script) {
42
- if (isFunction(res.script)) {
43
- tmp = res.script(res.data ? res.data : {}, ele ? ele : false);
45
+ if (typeof (res.script) === 'function') {
46
+ tmp = res.script(res.data ? res.data : {}, ele || null);
44
47
  }
45
48
  else {
46
49
  tmp = ((data, ele) => {
47
50
  let r = null;
48
51
  try {
49
52
  r = eval(res.script);
50
- if (isFunction(r)) {
53
+ if ((0, isFunction_1.isFunction)(r)) {
51
54
  r = r(data, ele);
52
55
  }
53
56
  }
54
57
  catch (e) {
55
- log(e, res);
56
- error(isFunction(e.getMessage) ? e.getMessage() : null);
58
+ (0, log_1.log)(e, res);
59
+ (0, error_1.error)((0, isFunction_1.isFunction)(e.getMessage) ? e.getMessage() : null);
57
60
  }
58
61
  return r;
59
62
  })(res.data ? res.data : {}, ele ? ele : false);
@@ -63,20 +66,20 @@ const callback = function (url, res, fn, fn2, ele) {
63
66
  if (tmp && fn2) {
64
67
  fn2(res);
65
68
  }
66
- else if (isObj && defaultPostLinkFunction) {
67
- defaultPostLinkFunction(res, ele);
69
+ else if (isObj && defaultPostLinkFunction_1.defaultPostLinkFunction) {
70
+ (0, defaultPostLinkFunction_1.defaultPostLinkFunction)(res, ele);
68
71
  }
69
72
  if (tmp && isObj && res.postscript) {
70
73
  eval(res.postscript);
71
74
  }
72
75
  if (isObj && res.error) {
73
76
  errTitle = res.errorTitle || bbn.lng.server_response;
74
- defaultAlertFunction(res.error, errTitle);
77
+ (0, defaultAlertFunction_1.defaultAlertFunction)(res.error, errTitle);
75
78
  }
76
79
  }
77
80
  else {
78
- defaultAlertFunction(bbn.lng.errorText, bbn.lng.error);
81
+ (0, defaultAlertFunction_1.defaultAlertFunction)(bbn.lng.errorText, bbn.lng.error);
79
82
  }
80
83
  return tmp;
81
84
  };
82
- export { callback };
85
+ exports.callback = callback;
@@ -1,8 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.camelToCss = void 0;
1
4
  const camelToCss = function (str) {
2
- return str.replace(/([A-Z])/g, function (st) {
5
+ return str
6
+ .replace(/([A-Z])/g, function (st) {
3
7
  return '-' + st.toLowerCase();
4
- }).replace('/^./', function (st) {
8
+ })
9
+ .replace('/^./', function (st) {
5
10
  return st.toLowerCase();
6
11
  });
7
12
  };
8
- export { camelToCss };
13
+ exports.camelToCss = camelToCss;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.camelize = void 0;
1
4
  const camelize = function (str) {
2
5
  return str.replace(/^([A-Z])|[\s-](\w)/g, function (match, p1, p2, offset) {
3
6
  if (p2) {
@@ -6,4 +9,4 @@ const camelize = function (str) {
6
9
  return p1.toLowerCase();
7
10
  });
8
11
  };
9
- export { camelize };
12
+ exports.camelize = camelize;
@@ -1,6 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canvasToImage = void 0;
1
4
  const canvasToImage = function (canvas) {
2
5
  let img = new Image();
3
- img.src = canvas.toDataURL("image/png");
6
+ img.src = canvas.toDataURL('image/png');
4
7
  return img;
5
8
  };
6
- export { canvasToImage };
9
+ exports.canvasToImage = canvasToImage;
package/dist/fn/center.js CHANGED
@@ -1,4 +1,6 @@
1
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.center = void 0;
2
4
  const center = function (ele) {
3
5
  //ele = $(ele);
4
6
  let parent = ele.parentNode,
@@ -14,13 +16,12 @@ const center = function (ele) {
14
16
  w = parent.clientWidth;
15
17
  h = parent.clientHeight;
16
18
  }
17
- log("BBN_CENTER", w, h);
18
19
  //ele.css("position","absolute");
19
- ele.style.position = "absolute";
20
+ ele.style.position = 'absolute';
20
21
  //ele.css("top", Math.max(0, ((h - ele.outerHeight()) / 2) + parent.scrollTop()) + "px");
21
- ele.style.top = Math.max(0, ((h - ele.offsetHeight) / 2) + parent.scrollTop) + "px";
22
+ ele.style.top = Math.max(0, (h - ele.offsetHeight) / 2 + parent.scrollTop) + 'px';
22
23
  //ele.css("left", Math.max(0, ((w - ele.outerWidth()) / 2) + parent.scrollLeft()) + "px");
23
- ele.style.left = Math.max(0, ((h - ele.offsetWidth) / 2) + parent.scrollLeft) + "px";
24
+ ele.style.left = Math.max(0, (h - ele.offsetWidth) / 2 + parent.scrollLeft) + 'px';
24
25
  return ele;
25
26
  };
26
- export { center };
27
+ exports.center = center;
@@ -1,2 +1,2 @@
1
- declare const checkProps: (obj: any, props: any, checkEmpty: any) => boolean;
1
+ declare const checkProps: (obj: object, props: string | string[], checkEmpty?: boolean) => boolean;
2
2
  export { checkProps };
@@ -1,5 +1,8 @@
1
- import { checkPropsDetails } from './checkPropsDetails';
2
- const checkProps = function (obj, props, checkEmpty) {
3
- return checkPropsDetails(obj, props, checkEmpty).result;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkProps = void 0;
4
+ const checkPropsDetails_1 = require("./checkPropsDetails");
5
+ const checkProps = function (obj, props, checkEmpty = false) {
6
+ return (0, checkPropsDetails_1.checkPropsDetails)(obj, props, checkEmpty).result;
4
7
  };
5
- export { checkProps };
8
+ exports.checkProps = checkProps;
@@ -1,5 +1,2 @@
1
- declare const checkPropsDetails: (obj: any, props: any, checkEmpty: any) => {
2
- error: boolean;
3
- result: boolean;
4
- };
1
+ declare const checkPropsDetails: (obj: object, props: string | string[], checkEmpty?: boolean) => BbnResError;
5
2
  export { checkPropsDetails };
@@ -1,42 +1,44 @@
1
- import { isString } from './isString';
2
- import { isArray } from './isArray';
3
- import { isObject } from './isObject';
4
- import { each } from './each';
5
- import { substr } from './substr';
6
- const checkPropsDetails = function (obj, props, checkEmpty) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkPropsDetails = void 0;
4
+ const isArray_1 = require("./isArray");
5
+ const isObject_1 = require("./isObject");
6
+ const each_1 = require("./each");
7
+ const substr_1 = require("./substr");
8
+ const checkPropsDetails = function (obj, props, checkEmpty = false) {
7
9
  let res = {
8
10
  error: false,
9
- result: true
11
+ result: true,
10
12
  };
11
- if (isString(props)) {
13
+ if (typeof (props) === 'string') {
12
14
  props = [props];
13
15
  }
14
- if (!isArray(props)) {
15
- res.error = bbn._("checkProps must receive a string or an array as props argument");
16
+ if (!(0, isArray_1.isArray)(props)) {
17
+ res.error = bbn._('checkProps must receive a string or an array as props argument');
16
18
  }
17
- if (!isObject(obj)) {
18
- res.error = bbn._("checkProps must receive an object as obj argument");
19
+ if (!(0, isObject_1.isObject)(obj)) {
20
+ res.error = bbn._('checkProps must receive an object as obj argument');
19
21
  }
20
22
  if (!res.error) {
21
23
  let check;
22
- each(props, varName => {
24
+ (0, each_1.each)(props, (varName) => {
23
25
  varName = varName.trim().split(':');
24
26
  let type = varName[1] || false;
25
27
  varName = varName[0];
26
28
  if (obj[varName] === undefined) {
27
- res.error = varName + ' ' + bbn._("is not defined");
29
+ res.error = varName + ' ' + bbn._('is not defined');
28
30
  }
29
31
  else if (type) {
30
- check = 'is' + substr(type, 0, 1).toUpperCase() + substr(type, 1).toLowerCase();
32
+ check = 'is' + (0, substr_1.substr)(type, 0, 1).toUpperCase() + (0, substr_1.substr)(type, 1).toLowerCase();
31
33
  if (bbn.fn[check] === undefined) {
32
- res.error = type + ' ' + bbn._("is not a valid type");
34
+ res.error = type + ' ' + bbn._('is not a valid type');
33
35
  }
34
36
  else if (!bbn.fn[check](obj[varName])) {
35
- res.error = varName + ' ' + bbn._("is not a") + ' ' + type;
37
+ res.error = varName + ' ' + bbn._('is not a') + ' ' + type;
36
38
  }
37
39
  }
38
40
  else if (checkEmpty && !obj[varName]) {
39
- res.error = varName + ' ' + bbn._("is empty");
41
+ res.error = varName + ' ' + bbn._('is empty');
40
42
  }
41
43
  if (res.error) {
42
44
  return false;
@@ -48,4 +50,4 @@ const checkPropsDetails = function (obj, props, checkEmpty) {
48
50
  }
49
51
  return res;
50
52
  };
51
- export { checkPropsDetails };
53
+ exports.checkPropsDetails = checkPropsDetails;
@@ -1,2 +1,2 @@
1
- declare const checkPropsOrDie: (obj: any, props: any, checkEmpty: any) => boolean;
1
+ declare const checkPropsOrDie: (obj: object, props: string | string[], checkEmpty?: boolean) => boolean;
2
2
  export { checkPropsOrDie };
@@ -1,9 +1,12 @@
1
- import { checkPropsDetails } from './checkPropsDetails';
2
- const checkPropsOrDie = function (obj, props, checkEmpty) {
3
- let res = checkPropsDetails(obj, props, checkEmpty);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkPropsOrDie = void 0;
4
+ const checkPropsDetails_1 = require("./checkPropsDetails");
5
+ const checkPropsOrDie = function (obj, props, checkEmpty = false) {
6
+ let res = (0, checkPropsDetails_1.checkPropsDetails)(obj, props, checkEmpty);
4
7
  if (res.error) {
5
8
  throw new Error(res.error);
6
9
  }
7
10
  return true;
8
11
  };
9
- export { checkPropsOrDie };
12
+ exports.checkPropsOrDie = checkPropsOrDie;
@@ -1,2 +1,2 @@
1
- declare const checkType: (value: any, type: any, msg: any, ...logs: any[]) => void;
1
+ declare const checkType: (value: any, type: object | string, msg?: string, ...logs: any[]) => void;
2
2
  export { checkType };
@@ -1,17 +1,20 @@
1
- import { isArray } from './isArray';
2
- import { each } from './each';
3
- import { isFunction } from './isFunction';
4
- import { isString } from './isString';
5
- import { correctCase } from './correctCase';
6
- import { error } from './error';
7
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkType = void 0;
4
+ const isArray_1 = require("./isArray");
5
+ const each_1 = require("./each");
6
+ const isFunction_1 = require("./isFunction");
7
+ const isString_1 = require("./isString");
8
+ const correctCase_1 = require("./correctCase");
9
+ const error_1 = require("./error");
10
+ const log_1 = require("./log");
8
11
  const checkType = function (value, type, msg, ...logs) {
9
12
  let ok = false;
10
- if (!isArray(type)) {
13
+ if (!(0, isArray_1.isArray)(type)) {
11
14
  type = [type];
12
15
  }
13
16
  const typesList = [];
14
- each(type, t => {
17
+ (0, each_1.each)(type, (t) => {
15
18
  var _a;
16
19
  if (t === String) {
17
20
  t = 'string';
@@ -31,17 +34,17 @@ const checkType = function (value, type, msg, ...logs) {
31
34
  else if (t === Function) {
32
35
  t = 'function';
33
36
  }
34
- if (isFunction(t)) {
37
+ if ((0, isFunction_1.isFunction)(t)) {
35
38
  typesList.push(t.name || ((_a = t.constructor) === null || _a === void 0 ? void 0 : _a.name) || t.toString());
36
39
  if (value instanceof t) {
37
40
  ok = true;
38
41
  return false;
39
42
  }
40
43
  }
41
- else if (!isString(t) || !isFunction(bbn.fn['is' + correctCase(t)])) {
42
- error(`The type ${t} is not recognized`);
44
+ else if (!(0, isString_1.isString)(t) || !(0, isFunction_1.isFunction)(bbn.fn['is' + (0, correctCase_1.correctCase)(t)])) {
45
+ (0, error_1.error)(`The type ${t} is not recognized`);
43
46
  }
44
- else if (bbn.fn['is' + correctCase(t)](value)) {
47
+ else if (bbn.fn['is' + (0, correctCase_1.correctCase)(t)](value)) {
45
48
  ok = true;
46
49
  return false;
47
50
  }
@@ -50,11 +53,11 @@ const checkType = function (value, type, msg, ...logs) {
50
53
  }
51
54
  });
52
55
  if (!ok) {
53
- log(["Value given", value, "type", typeof value, "expected", typesList.join(' or ')]);
56
+ (0, log_1.log)(['Value given', value, 'type', typeof value, 'expected', typesList.join(' or ')]);
54
57
  if (logs.length) {
55
- log(logs);
58
+ (0, log_1.log)(logs);
56
59
  }
57
- throw new Error((msg ? msg + ' - ' : '') + bbn._("The value should be a %s", typesList.join(' ' + bbn._("or a") + ' ')));
60
+ throw new Error((msg ? msg + ' - ' : '') + bbn._('The value should be a %s', typesList.join(' ' + bbn._('or a') + ' ')));
58
61
  }
59
62
  };
60
- export { checkType };
63
+ exports.checkType = checkType;
@@ -0,0 +1,3 @@
1
+ declare const startChrono: (name: any) => void;
2
+ declare const stopChrono: (name: any) => number;
3
+ export { startChrono, stopChrono };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stopChrono = exports.startChrono = void 0;
4
+ const each_1 = require("./each");
5
+ const _private = [];
6
+ const startChrono = function (name) {
7
+ let now = new Date().getTime();
8
+ let h1 = 3600 * 1000;
9
+ if (_private.length) {
10
+ (0, each_1.each)(_private, (t, n) => {
11
+ if (now - t > h1) {
12
+ delete _private[n];
13
+ }
14
+ });
15
+ now = new Date().getTime();
16
+ }
17
+ _private[name] = now;
18
+ };
19
+ exports.startChrono = startChrono;
20
+ const stopChrono = function (name) {
21
+ if (_private[name]) {
22
+ let now = new Date().getTime();
23
+ let diff = now - _private[name];
24
+ return diff;
25
+ }
26
+ };
27
+ exports.stopChrono = stopChrono;
@@ -1,16 +1,19 @@
1
- import { isDom } from './isDom';
2
- import { isCp } from './isCp';
3
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.circularReplacer = void 0;
4
+ const isDom_1 = require("./isDom");
5
+ const isCp_1 = require("./isCp");
6
+ const log_1 = require("./log");
4
7
  const circularReplacer = function () {
5
8
  const visited = new WeakSet();
6
9
  return (key, value) => {
7
- if ((typeof value === "object") && (value !== null)) {
10
+ if (typeof value === 'object' && value !== null) {
8
11
  if (visited.has(value)) {
9
12
  return;
10
13
  }
11
14
  visited.add(value);
12
15
  if (![undefined, Object, Array, null].includes(value.constructor)) {
13
- if (isDom(value)) {
16
+ if ((0, isDom_1.isDom)(value)) {
14
17
  if (value.bbnId) {
15
18
  value = '__BBN_DOM__' + value.tagName + '/' + value.bbnId + value.bbnHash;
16
19
  }
@@ -18,8 +21,8 @@ const circularReplacer = function () {
18
21
  value = '__BBN_DOM__' + value.tagName + '/' + value.className;
19
22
  }
20
23
  }
21
- else if (isCp(value)) {
22
- log("IS CP");
24
+ else if ((0, isCp_1.isCp)(value)) {
25
+ (0, log_1.log)('IS CP');
23
26
  value = '__BBN_CP__' + value.$options.name + '/' + value.$cid;
24
27
  }
25
28
  else {
@@ -30,4 +33,4 @@ const circularReplacer = function () {
30
33
  return value;
31
34
  };
32
35
  };
33
- export { circularReplacer };
36
+ exports.circularReplacer = circularReplacer;
@@ -1,3 +1,2 @@
1
- import { clone } from './clone';
2
1
  declare const clone: (obj: any) => any;
3
2
  export { clone };
package/dist/fn/clone.js CHANGED
@@ -1,16 +1,19 @@
1
- import { isArray } from './isArray';
2
- import { isObject } from './isObject';
3
- import { extend } from './extend';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clone = void 0;
4
+ const isArray_1 = require("./isArray");
5
+ const isObject_1 = require("./isObject");
6
+ const extend_1 = require("./extend");
4
7
  const clone = function (obj) {
5
- if (isArray(obj)) {
8
+ if ((0, isArray_1.isArray)(obj)) {
6
9
  return obj.slice().map((a) => {
7
- return typeof (a) === 'object' ? clone(a) : a;
10
+ return typeof a === 'object' ? clone(a) : a;
8
11
  });
9
12
  }
10
- if (isObject(obj)) {
13
+ if ((0, isObject_1.isObject)(obj)) {
11
14
  const o = Object.create(Object.getPrototypeOf(obj));
12
- return extend(true, o, obj);
15
+ return (0, extend_1.extend)(true, o, obj);
13
16
  }
14
17
  return obj;
15
18
  };
16
- export { clone };
19
+ exports.clone = clone;
@@ -1,6 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.colorToHex = void 0;
1
4
  const colorToHex = function (color) {
2
- let canvas = document.createElement("canvas").getContext("2d");
5
+ let canvas = document.createElement('canvas').getContext('2d');
3
6
  canvas.fillStyle = color;
4
7
  return canvas.fillStyle;
5
8
  };
6
- export { colorToHex };
9
+ exports.colorToHex = colorToHex;