@bbn/bbn 1.0.29 → 1.0.30

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 (234) hide show
  1. package/dist/fn/_addLoader.js +6 -3
  2. package/dist/fn/_compareValues.js +14 -11
  3. package/dist/fn/_deleteLoader.js +10 -7
  4. package/dist/fn/abort.js +6 -3
  5. package/dist/fn/abortURL.js +7 -4
  6. package/dist/fn/addColors.js +8 -5
  7. package/dist/fn/addInputs.js +6 -3
  8. package/dist/fn/addStyle.js +8 -5
  9. package/dist/fn/adjustHeight.js +8 -5
  10. package/dist/fn/adjustSize.js +8 -5
  11. package/dist/fn/adjustWidth.js +8 -5
  12. package/dist/fn/ajax.js +34 -31
  13. package/dist/fn/analyzeFunction.js +6 -3
  14. package/dist/fn/animateCss.js +4 -1
  15. package/dist/fn/arrayBuffer2String.js +4 -1
  16. package/dist/fn/arrayFromProp.js +8 -5
  17. package/dist/fn/autoExtend.js +7 -4
  18. package/dist/fn/baseName.js +9 -6
  19. package/dist/fn/br2nl.js +6 -3
  20. package/dist/fn/calendar.js +14 -11
  21. package/dist/fn/callback.js +19 -16
  22. package/dist/fn/camelToCss.js +4 -1
  23. package/dist/fn/camelize.js +4 -1
  24. package/dist/fn/canvasToImage.js +4 -1
  25. package/dist/fn/center.js +4 -1
  26. package/dist/fn/checkProps.js +6 -3
  27. package/dist/fn/checkPropsDetails.js +12 -9
  28. package/dist/fn/checkPropsOrDie.js +6 -3
  29. package/dist/fn/checkType.js +19 -16
  30. package/dist/fn/chrono.js +7 -3
  31. package/dist/fn/circularReplacer.js +10 -7
  32. package/dist/fn/clone.js +10 -7
  33. package/dist/fn/colorToHex.js +4 -1
  34. package/dist/fn/compare.js +21 -18
  35. package/dist/fn/compareConditions.js +13 -10
  36. package/dist/fn/copy.js +7 -4
  37. package/dist/fn/correctCase.js +4 -1
  38. package/dist/fn/count.js +6 -3
  39. package/dist/fn/crc32.js +4 -1
  40. package/dist/fn/createObject.js +6 -3
  41. package/dist/fn/cssExists.js +6 -3
  42. package/dist/fn/date.js +11 -8
  43. package/dist/fn/dateSQL.d.ts +1 -1
  44. package/dist/fn/dateSQL.js +7 -4
  45. package/dist/fn/daysInMonth.d.ts +1 -1
  46. package/dist/fn/daysInMonth.js +7 -4
  47. package/dist/fn/deepPath.js +10 -7
  48. package/dist/fn/defaultAjaxAbortFunction.js +6 -3
  49. package/dist/fn/defaultAjaxErrorFunction.js +4 -1
  50. package/dist/fn/defaultAlertFunction.js +4 -1
  51. package/dist/fn/defaultConfirmFunction.js +7 -4
  52. package/dist/fn/defaultEndLoadingFunction.js +4 -1
  53. package/dist/fn/defaultErrorFunction.js +6 -3
  54. package/dist/fn/defaultHistoryFunction.js +4 -1
  55. package/dist/fn/defaultLinkFunction.js +4 -1
  56. package/dist/fn/defaultPostLinkFunction.js +4 -1
  57. package/dist/fn/defaultPreLinkFunction.js +4 -1
  58. package/dist/fn/defaultResizeFunction.js +4 -1
  59. package/dist/fn/defaultStartLoadingFunction.js +4 -1
  60. package/dist/fn/deleteProp.js +7 -4
  61. package/dist/fn/diffObj.js +19 -16
  62. package/dist/fn/dirName.js +10 -7
  63. package/dist/fn/download.js +18 -15
  64. package/dist/fn/downloadContent.js +12 -9
  65. package/dist/fn/each.js +10 -7
  66. package/dist/fn/eraseCookie.js +4 -1
  67. package/dist/fn/error.js +6 -3
  68. package/dist/fn/escapeDquotes.js +6 -3
  69. package/dist/fn/escapeRegExp.js +4 -1
  70. package/dist/fn/escapeSquotes.js +6 -3
  71. package/dist/fn/escapeTicks.js +6 -3
  72. package/dist/fn/escapeUrl.js +11 -8
  73. package/dist/fn/extend.js +16 -13
  74. package/dist/fn/extendOut.js +7 -4
  75. package/dist/fn/fdate.js +13 -10
  76. package/dist/fn/fdatetime.js +11 -8
  77. package/dist/fn/fieldValue.js +4 -1
  78. package/dist/fn/fileExt.js +6 -3
  79. package/dist/fn/filter.js +15 -12
  80. package/dist/fn/filterToConditions.js +11 -8
  81. package/dist/fn/findAll.js +10 -7
  82. package/dist/fn/fori.js +9 -6
  83. package/dist/fn/forir.js +9 -6
  84. package/dist/fn/format.js +6 -3
  85. package/dist/fn/formatBytes.js +4 -1
  86. package/dist/fn/formatDate.d.ts +1 -1
  87. package/dist/fn/formatDate.js +5 -2
  88. package/dist/fn/formatSize.js +8 -5
  89. package/dist/fn/formdata.js +14 -11
  90. package/dist/fn/fromXml.js +4 -1
  91. package/dist/fn/ftime.js +12 -9
  92. package/dist/fn/getAllTags.js +6 -3
  93. package/dist/fn/getAncestors.js +4 -1
  94. package/dist/fn/getAttributes.js +6 -3
  95. package/dist/fn/getBrowserName.js +4 -1
  96. package/dist/fn/getBrowserVersion.js +4 -1
  97. package/dist/fn/getCookie.js +4 -1
  98. package/dist/fn/getCssVar.js +4 -1
  99. package/dist/fn/getDay.js +6 -3
  100. package/dist/fn/getDeviceType.js +4 -1
  101. package/dist/fn/getEventData.js +10 -7
  102. package/dist/fn/getField.js +6 -3
  103. package/dist/fn/getFieldValues.js +10 -7
  104. package/dist/fn/getHTMLOfSelection.js +7 -4
  105. package/dist/fn/getHtml.js +6 -3
  106. package/dist/fn/getLoader.js +6 -3
  107. package/dist/fn/getPath.js +6 -3
  108. package/dist/fn/getProp.js +7 -4
  109. package/dist/fn/getProperty.js +4 -1
  110. package/dist/fn/getRequestId.js +8 -5
  111. package/dist/fn/getRow.js +6 -3
  112. package/dist/fn/getScrollBarSize.js +4 -1
  113. package/dist/fn/getText.js +4 -1
  114. package/dist/fn/getTimeoff.js +4 -1
  115. package/dist/fn/happy.js +6 -3
  116. package/dist/fn/hash.js +14 -11
  117. package/dist/fn/hex2rgb.js +4 -1
  118. package/dist/fn/history.js +4 -1
  119. package/dist/fn/html2text.js +4 -1
  120. package/dist/fn/imageToCanvas.js +4 -1
  121. package/dist/fn/imgToBase64.js +6 -3
  122. package/dist/fn/info.js +6 -3
  123. package/dist/fn/init.js +35 -32
  124. package/dist/fn/isActiveInterface.js +4 -1
  125. package/dist/fn/isArray.js +4 -1
  126. package/dist/fn/isBlob.js +4 -1
  127. package/dist/fn/isBoolean.js +4 -1
  128. package/dist/fn/isCanvas.js +4 -1
  129. package/dist/fn/isColor.js +6 -3
  130. package/dist/fn/isComment.js +4 -1
  131. package/dist/fn/isCp.js +6 -3
  132. package/dist/fn/isDate.js +4 -1
  133. package/dist/fn/isDesktopDevice.js +4 -1
  134. package/dist/fn/isDimension.js +6 -3
  135. package/dist/fn/isDom.js +4 -1
  136. package/dist/fn/isEmail.js +6 -3
  137. package/dist/fn/isEmpty.js +8 -5
  138. package/dist/fn/isEvent.js +4 -1
  139. package/dist/fn/isFocused.js +4 -1
  140. package/dist/fn/isFunction.js +4 -1
  141. package/dist/fn/isHostname.js +8 -5
  142. package/dist/fn/isIP.js +6 -3
  143. package/dist/fn/isInside.js +10 -7
  144. package/dist/fn/isInt.js +4 -1
  145. package/dist/fn/isIterable.js +4 -1
  146. package/dist/fn/isMobile.js +7 -4
  147. package/dist/fn/isMobileDevice.js +4 -1
  148. package/dist/fn/isNull.js +4 -1
  149. package/dist/fn/isNumber.js +4 -1
  150. package/dist/fn/isObject.js +4 -1
  151. package/dist/fn/isPercent.js +4 -1
  152. package/dist/fn/isPrimitive.js +4 -1
  153. package/dist/fn/isPromise.js +4 -1
  154. package/dist/fn/isPropSize.js +6 -3
  155. package/dist/fn/isSQLDate.js +4 -1
  156. package/dist/fn/isSame.js +8 -5
  157. package/dist/fn/isString.js +4 -1
  158. package/dist/fn/isSymbol.js +4 -1
  159. package/dist/fn/isTabletDevice.js +4 -1
  160. package/dist/fn/isURL.js +4 -1
  161. package/dist/fn/isValidDimension.js +7 -4
  162. package/dist/fn/isValidName.js +6 -3
  163. package/dist/fn/isValue.js +6 -3
  164. package/dist/fn/isVue.js +4 -1
  165. package/dist/fn/iterate.js +8 -5
  166. package/dist/fn/lightenDarkenHex.js +4 -1
  167. package/dist/fn/link.js +22 -19
  168. package/dist/fn/log.js +6 -3
  169. package/dist/fn/makeReactive.js +31 -28
  170. package/dist/fn/map.js +6 -3
  171. package/dist/fn/md5.js +4 -1
  172. package/dist/fn/money.js +6 -3
  173. package/dist/fn/move.js +4 -1
  174. package/dist/fn/multiorder.js +6 -3
  175. package/dist/fn/nl2br.js +6 -3
  176. package/dist/fn/numProperties.js +4 -1
  177. package/dist/fn/objectToFormData.js +15 -12
  178. package/dist/fn/order.js +6 -3
  179. package/dist/fn/outerHeight.js +6 -3
  180. package/dist/fn/outerWidth.js +6 -3
  181. package/dist/fn/percent.js +4 -1
  182. package/dist/fn/pickValue.js +4 -1
  183. package/dist/fn/post.js +10 -7
  184. package/dist/fn/postOut.js +8 -5
  185. package/dist/fn/printf.js +4 -1
  186. package/dist/fn/quotes2html.js +7 -4
  187. package/dist/fn/randomInt.js +4 -1
  188. package/dist/fn/randomString.js +7 -4
  189. package/dist/fn/removeAccents.js +8 -5
  190. package/dist/fn/removeEmpty.js +11 -8
  191. package/dist/fn/removeExtraSpaces.js +4 -1
  192. package/dist/fn/removeHtmlComments.js +6 -3
  193. package/dist/fn/removePrivateProp.js +6 -3
  194. package/dist/fn/removeTrailingChars.js +9 -6
  195. package/dist/fn/repeat.js +4 -1
  196. package/dist/fn/replaceAll.js +7 -4
  197. package/dist/fn/replaceSelection.js +4 -1
  198. package/dist/fn/resize.js +10 -7
  199. package/dist/fn/rgb2hex.js +4 -1
  200. package/dist/fn/riterate.js +6 -3
  201. package/dist/fn/roundDecimal.js +4 -1
  202. package/dist/fn/sanitize.js +8 -5
  203. package/dist/fn/search.js +18 -15
  204. package/dist/fn/selectElementText.js +4 -1
  205. package/dist/fn/selector.js +4 -1
  206. package/dist/fn/setCookie.js +4 -1
  207. package/dist/fn/setCssVar.js +4 -1
  208. package/dist/fn/setNavigationVars.js +13 -10
  209. package/dist/fn/setProp.js +4 -1
  210. package/dist/fn/setProperty.js +6 -3
  211. package/dist/fn/shorten.js +8 -5
  212. package/dist/fn/shortenObj.js +12 -9
  213. package/dist/fn/shuffle.js +4 -1
  214. package/dist/fn/simpleHash.js +8 -5
  215. package/dist/fn/simpleHash1.js +4 -1
  216. package/dist/fn/simpleHash2.js +4 -1
  217. package/dist/fn/stat.js +4 -1
  218. package/dist/fn/string2ArrayBuffer.js +4 -1
  219. package/dist/fn/submit.js +9 -6
  220. package/dist/fn/substr.js +10 -7
  221. package/dist/fn/sum.js +7 -4
  222. package/dist/fn/timestamp.js +4 -1
  223. package/dist/fn/toCSV.js +11 -8
  224. package/dist/fn/toggleFullScreen.js +6 -3
  225. package/dist/fn/translate.js +6 -3
  226. package/dist/fn/treatAjaxArguments.js +13 -10
  227. package/dist/fn/trim.js +7 -4
  228. package/dist/fn/uniqString.js +10 -7
  229. package/dist/fn/unique.js +4 -1
  230. package/dist/fn/upload.js +10 -7
  231. package/dist/fn/warning.js +6 -3
  232. package/dist/index.d.ts +3 -3
  233. package/dist/index.js +471 -459
  234. package/package.json +1 -1
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.string2ArrayBuffer = void 0;
1
4
  const string2ArrayBuffer = function (str) {
2
5
  var buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char
3
6
  var bufView = new Uint16Array(buf);
@@ -6,4 +9,4 @@ const string2ArrayBuffer = function (str) {
6
9
  }
7
10
  return buf;
8
11
  };
9
- export { string2ArrayBuffer };
12
+ exports.string2ArrayBuffer = string2ArrayBuffer;
package/dist/fn/submit.js CHANGED
@@ -1,5 +1,8 @@
1
- import { formdata } from './formdata';
2
- import { post } from './post';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.submit = void 0;
4
+ const formdata_1 = require("./formdata");
5
+ const post_1 = require("./post");
3
6
  const submit = function (form, e, fn) {
4
7
  let url = form.getAttribute('action') || bbn.env.path;
5
8
  let data;
@@ -13,7 +16,7 @@ const submit = function (form, e, fn) {
13
16
  if (e) {
14
17
  e.preventDefault();
15
18
  }
16
- data = formdata(form);
19
+ data = (0, formdata_1.formdata)(form);
17
20
  if (data) {
18
21
  //$form.attr("action", null);
19
22
  form.setAttribute('action', null);
@@ -22,12 +25,12 @@ const submit = function (form, e, fn) {
22
25
  fn = form.getAttribute('data-script') ? eval(form.getAttribute('data-script')) : null;
23
26
  }
24
27
  if (fn) {
25
- post(url, data, fn);
28
+ (0, post_1.post)(url, data, fn);
26
29
  }
27
30
  else {
28
- post(url, data);
31
+ (0, post_1.post)(url, data);
29
32
  }
30
33
  }
31
34
  }
32
35
  };
33
- export { submit };
36
+ exports.submit = submit;
package/dist/fn/substr.js CHANGED
@@ -1,17 +1,20 @@
1
- import { isString } from './isString';
2
- import { isInt } from './isInt';
3
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.substr = void 0;
4
+ const isString_1 = require("./isString");
5
+ const isInt_1 = require("./isInt");
6
+ const log_1 = require("./log");
4
7
  const substr = function (str, from, length) {
5
- if (!isString(str) || !isInt(from)) {
6
- log(arguments);
8
+ if (!(0, isString_1.isString)(str) || !(0, isInt_1.isInt)(from)) {
9
+ (0, log_1.log)(arguments);
7
10
  throw new Error(bbn._('The substr function should be applied to a string and at least a `from` argument should be given'));
8
11
  }
9
12
  if (from < 0) {
10
13
  from = str.length + from;
11
14
  }
12
- if (!isInt(length)) {
15
+ if (!(0, isInt_1.isInt)(length)) {
13
16
  return str.substring(from);
14
17
  }
15
18
  return str.substring(from, (length < 0 ? str.length : from) + length);
16
19
  };
17
- export { substr };
20
+ exports.substr = substr;
package/dist/fn/sum.js CHANGED
@@ -1,8 +1,11 @@
1
- import { each } from './each';
2
- import { filter } from './filter';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sum = void 0;
4
+ const each_1 = require("./each");
5
+ const filter_1 = require("./filter");
3
6
  const sum = function (arr, numberProp, prop, val, operator) {
4
7
  let r = 0;
5
- each(filter(arr, prop, val, operator), (a) => {
8
+ (0, each_1.each)((0, filter_1.filter)(arr, prop, val, operator), (a) => {
6
9
  let tmp = typeof numberProp === 'function' ? numberProp(a) : a[numberProp];
7
10
  if (tmp) {
8
11
  r += parseFloat(tmp) || 0;
@@ -10,4 +13,4 @@ const sum = function (arr, numberProp, prop, val, operator) {
10
13
  });
11
14
  return r;
12
15
  };
13
- export { sum };
16
+ exports.sum = sum;
@@ -1,5 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timestamp = void 0;
1
4
  const timestamp = function (seconds) {
2
5
  var r = new Date().getTime();
3
6
  return seconds ? Math.round(r / 1000) : r;
4
7
  };
5
- export { timestamp };
8
+ exports.timestamp = timestamp;
package/dist/fn/toCSV.js CHANGED
@@ -1,6 +1,9 @@
1
- import { each } from './each';
2
- import { isArray } from './isArray';
3
- import { replaceAll } from './replaceAll';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCSV = void 0;
4
+ const each_1 = require("./each");
5
+ const isArray_1 = require("./isArray");
6
+ const replaceAll_1 = require("./replaceAll");
4
7
  const toCSV = function (arr, valSep = ',', rowSep = '', valEsc = '"') {
5
8
  if (!valSep) {
6
9
  valSep = ',';
@@ -10,12 +13,12 @@ const toCSV = function (arr, valSep = ',', rowSep = '', valEsc = '"') {
10
13
  }
11
14
  let csvContent = '';
12
15
  let total = arr.length;
13
- each(arr, (a, i) => {
14
- let num = isArray(a) ? a.length : Object.values(a).length;
16
+ (0, each_1.each)(arr, (a, i) => {
17
+ let num = (0, isArray_1.isArray)(a) ? a.length : Object.values(a).length;
15
18
  let j = 0;
16
- each(a, (b) => {
19
+ (0, each_1.each)(a, (b) => {
17
20
  if (typeof b === 'string') {
18
- csvContent += valEsc + replaceAll(valEsc, '\\' + valEsc, b) + valEsc;
21
+ csvContent += valEsc + (0, replaceAll_1.replaceAll)(valEsc, '\\' + valEsc, b) + valEsc;
19
22
  }
20
23
  else if (b === 0) {
21
24
  csvContent += '0';
@@ -37,4 +40,4 @@ const toCSV = function (arr, valSep = ',', rowSep = '', valEsc = '"') {
37
40
  });
38
41
  return csvContent;
39
42
  };
40
- export { toCSV };
43
+ exports.toCSV = toCSV;
@@ -1,4 +1,7 @@
1
- import { resize } from './resize';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toggleFullScreen = void 0;
4
+ const resize_1 = require("./resize");
2
5
  const toggleFullScreen = function () {
3
6
  if ('mozRequestFullScreen' in window.document.documentElement) {
4
7
  if (window.document['mozFullScreen']) {
@@ -33,7 +36,7 @@ const toggleFullScreen = function () {
33
36
  }
34
37
  }
35
38
  setTimeout(function () {
36
- resize();
39
+ (0, resize_1.resize)();
37
40
  }, 0);
38
41
  };
39
- export { toggleFullScreen };
42
+ exports.toggleFullScreen = toggleFullScreen;
@@ -1,8 +1,11 @@
1
- import { iterate } from './iterate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.translate = void 0;
4
+ const iterate_1 = require("./iterate");
2
5
  const translate = function (o, namespace) {
3
6
  let lng = namespace ? bbn.lng[namespace.indexOf('_') === 0 ? namespace : '_' + namespace] : bbn.lng;
4
- iterate(o, (v, k) => {
7
+ (0, iterate_1.iterate)(o, (v, k) => {
5
8
  lng[k] = v;
6
9
  });
7
10
  };
8
- export { translate };
11
+ exports.translate = translate;
@@ -1,19 +1,22 @@
1
- import { isObject } from './isObject';
2
- import { isFunction } from './isFunction';
3
- import { substr } from './substr';
4
- import { numProperties } from './numProperties';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.treatAjaxArguments = void 0;
4
+ const isObject_1 = require("./isObject");
5
+ const isFunction_1 = require("./isFunction");
6
+ const substr_1 = require("./substr");
7
+ const numProperties_1 = require("./numProperties");
5
8
  const treatAjaxArguments = function (args) {
6
9
  let cfg = {};
7
10
  let t;
8
11
  let i;
9
- if (isObject(args[0]) && args.length === 1) {
12
+ if ((0, isObject_1.isObject)(args[0]) && args.length === 1) {
10
13
  return args[0];
11
14
  }
12
15
  for (i = 0; i < args.length; i++) {
13
16
  t = typeof args[i];
14
17
  t = t.toLowerCase();
15
18
  /* Callbacks */
16
- if (isFunction(args[i])) {
19
+ if ((0, isFunction_1.isFunction)(args[i])) {
17
20
  if (cfg.errorFn && !cfg.abortFn) {
18
21
  cfg.abortFn = args[i];
19
22
  }
@@ -32,13 +35,13 @@ const treatAjaxArguments = function (args) {
32
35
  if (!cfg.url) {
33
36
  /* Hash */
34
37
  if (args[i].indexOf('#') === 0 || args[i].indexOf(bbn.env.root + '#') === 0) {
35
- cfg.url = substr(args[i], bbn.env.root.length);
38
+ cfg.url = (0, substr_1.substr)(args[i], bbn.env.root.length);
36
39
  }
37
40
  else {
38
41
  /* Link */
39
42
  cfg.url = args[i];
40
43
  if (cfg.url.indexOf(bbn.env.root) === 0) {
41
- cfg.url = substr(cfg.url, bbn.env.root.length);
44
+ cfg.url = (0, substr_1.substr)(cfg.url, bbn.env.root.length);
42
45
  }
43
46
  }
44
47
  }
@@ -62,7 +65,7 @@ const treatAjaxArguments = function (args) {
62
65
  }
63
66
  }
64
67
  }
65
- if (!cfg.url && numProperties(cfg)) {
68
+ if (!cfg.url && (0, numProperties_1.numProperties)(cfg)) {
66
69
  cfg.url = bbn.env.path;
67
70
  }
68
71
  if (cfg.obj === undefined) {
@@ -73,4 +76,4 @@ const treatAjaxArguments = function (args) {
73
76
  }
74
77
  return cfg;
75
78
  };
76
- export { treatAjaxArguments };
79
+ exports.treatAjaxArguments = treatAjaxArguments;
package/dist/fn/trim.js CHANGED
@@ -1,4 +1,7 @@
1
- import { substr } from './substr';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.trim = void 0;
4
+ const substr_1 = require("./substr");
2
5
  const trim = function (str, hair = ' ') {
3
6
  if (hair === ' ') {
4
7
  return str.trim();
@@ -10,11 +13,11 @@ const trim = function (str, hair = ' ') {
10
13
  return '';
11
14
  }
12
15
  while (str.indexOf(hair) === 0) {
13
- str = substr(str, hair.length);
16
+ str = (0, substr_1.substr)(str, hair.length);
14
17
  }
15
18
  while (str.lastIndexOf(hair) === str.length - hair.length) {
16
- str = substr(str, 0, str.length - hair.length);
19
+ str = (0, substr_1.substr)(str, 0, str.length - hair.length);
17
20
  }
18
21
  return str;
19
22
  };
20
- export { trim };
23
+ exports.trim = trim;
@@ -1,6 +1,9 @@
1
- import { isArray } from './isArray';
2
- import { each } from './each';
3
- import { md5 } from './md5';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uniqString = void 0;
4
+ const isArray_1 = require("./isArray");
5
+ const each_1 = require("./each");
6
+ const md5_1 = require("./md5");
4
7
  const uniqString = function (...args) {
5
8
  var st = '';
6
9
  for (var i = 0; i < args.length; i++) {
@@ -8,14 +11,14 @@ const uniqString = function (...args) {
8
11
  st += '__bbn_empty__';
9
12
  }
10
13
  else if (typeof args[i] === 'object') {
11
- if (isArray(args[i])) {
14
+ if ((0, isArray_1.isArray)(args[i])) {
12
15
  st += JSON.stringify(args[i]);
13
16
  }
14
17
  else {
15
18
  // An object with the same properties, even in different order, should produce the same answer
16
19
  let tmp = {};
17
20
  let ks = Object.keys(args[i]).sort();
18
- each(ks, (k) => {
21
+ (0, each_1.each)(ks, (k) => {
19
22
  tmp[k] = args[i][k];
20
23
  });
21
24
  st += JSON.stringify(tmp);
@@ -28,6 +31,6 @@ const uniqString = function (...args) {
28
31
  st += args[i];
29
32
  }
30
33
  }
31
- return md5(st);
34
+ return (0, md5_1.md5)(st);
32
35
  };
33
- export { uniqString };
36
+ exports.uniqString = uniqString;
package/dist/fn/unique.js CHANGED
@@ -1,6 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unique = void 0;
1
4
  const unique = function (arr) {
2
5
  return arr.filter(function (el, index, ar) {
3
6
  return index === ar.indexOf(el);
4
7
  });
5
8
  };
6
- export { unique };
9
+ exports.unique = unique;
package/dist/fn/upload.js CHANGED
@@ -1,9 +1,12 @@
1
- import * as axios from '../../node_modules/axios/dist/axios';
2
- import { objectToFormData } from './objectToFormData';
3
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.upload = void 0;
4
+ const axios = require("../../node_modules/axios/dist/axios");
5
+ const objectToFormData_1 = require("./objectToFormData");
6
+ const log_1 = require("./log");
4
7
  const upload = function (url, file, success, failure, progress) {
5
8
  let fn = () => {
6
- return axios.post(url || bbn.env.path, objectToFormData(file), {
9
+ return axios.post(url || bbn.env.path, (0, objectToFormData_1.objectToFormData)(file), {
7
10
  headers: {
8
11
  'Content-Type': 'multipart/form-data',
9
12
  },
@@ -22,16 +25,16 @@ const upload = function (url, file, success, failure, progress) {
22
25
  return fn()
23
26
  .then((res) => {
24
27
  if (success) {
25
- log('SUCCESS', res);
28
+ (0, log_1.log)('SUCCESS', res);
26
29
  success(res);
27
30
  }
28
31
  })
29
32
  .catch((err) => {
30
33
  if (failure) {
31
- log('ERROR', err);
34
+ (0, log_1.log)('ERROR', err);
32
35
  failure(err);
33
36
  }
34
37
  });
35
38
  }
36
39
  };
37
- export { upload };
40
+ exports.upload = upload;
@@ -1,4 +1,7 @@
1
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.warning = void 0;
4
+ const log_1 = require("./log");
2
5
  const warning = function (message) {
3
6
  const args = ['BBN: ' + message];
4
7
  const obj = {
@@ -7,6 +10,6 @@ const warning = function (message) {
7
10
  _bbn_console_style: 'color: #E64141; background: #F7E195; font-size: 14px',
8
11
  };
9
12
  args.unshift(obj);
10
- log.apply(this, args);
13
+ log_1.log.apply(this, args);
11
14
  };
12
- export { warning };
15
+ exports.warning = warning;
package/dist/index.d.ts CHANGED
@@ -176,8 +176,8 @@ declare const fn: {
176
176
  createObject: (...args: any[]) => any;
177
177
  cssExists: (f: any) => boolean;
178
178
  date: (v: any) => any;
179
- dateSQL: (v: any, dayOnly: any) => string;
180
- daysInMonth: (v: any) => number | false;
179
+ dateSQL: (v: any, dayOnly: any) => any;
180
+ daysInMonth: (v: any) => any;
181
181
  deepPath: (arr: any[], filter: object, deepProperty: string, res?: any[]) => false | any[];
182
182
  defaultAjaxAbortFunction: (message: string, url?: string) => void;
183
183
  defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: Error) => boolean;
@@ -217,7 +217,7 @@ declare const fn: {
217
217
  forir: (arr: any[], fn: (a: any, b: number) => any, max?: number, min?: number) => void;
218
218
  format: (str: any) => any;
219
219
  formatBytes: (bytes: any, decimals?: number) => string;
220
- formatDate: (date: any, format: any) => string;
220
+ formatDate: (date: any, format: any) => any;
221
221
  formatSize: (st: any, noValid: any) => any;
222
222
  formdata: (form: HTMLFormElement) => {};
223
223
  fromXml: (xml: any, arrayTags: any) => {};