@bbn/bbn 1.0.28 → 1.0.29

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 (231) hide show
  1. package/dist/bundle.d.ts +6 -6
  2. package/dist/fn/_addLoader.js +3 -6
  3. package/dist/fn/_compareValues.js +11 -14
  4. package/dist/fn/_deleteLoader.js +7 -10
  5. package/dist/fn/abort.js +3 -6
  6. package/dist/fn/abortURL.js +4 -7
  7. package/dist/fn/addColors.js +5 -8
  8. package/dist/fn/addInputs.js +3 -6
  9. package/dist/fn/addStyle.js +5 -8
  10. package/dist/fn/adjustHeight.js +5 -8
  11. package/dist/fn/adjustSize.js +5 -8
  12. package/dist/fn/adjustWidth.js +5 -8
  13. package/dist/fn/ajax.js +31 -34
  14. package/dist/fn/analyzeFunction.js +3 -6
  15. package/dist/fn/animateCss.js +1 -4
  16. package/dist/fn/arrayBuffer2String.js +1 -4
  17. package/dist/fn/arrayFromProp.js +5 -8
  18. package/dist/fn/autoExtend.js +4 -7
  19. package/dist/fn/baseName.js +6 -9
  20. package/dist/fn/br2nl.js +3 -6
  21. package/dist/fn/calendar.js +14 -20
  22. package/dist/fn/callback.js +16 -19
  23. package/dist/fn/camelToCss.js +1 -4
  24. package/dist/fn/camelize.js +1 -4
  25. package/dist/fn/canvasToImage.js +1 -4
  26. package/dist/fn/center.js +1 -4
  27. package/dist/fn/checkProps.js +3 -6
  28. package/dist/fn/checkPropsDetails.js +9 -12
  29. package/dist/fn/checkPropsOrDie.js +3 -6
  30. package/dist/fn/checkType.js +16 -19
  31. package/dist/fn/chrono.js +3 -7
  32. package/dist/fn/circularReplacer.js +7 -10
  33. package/dist/fn/clone.js +7 -10
  34. package/dist/fn/colorToHex.js +1 -4
  35. package/dist/fn/compare.js +18 -21
  36. package/dist/fn/compareConditions.js +10 -13
  37. package/dist/fn/copy.js +4 -7
  38. package/dist/fn/correctCase.js +1 -4
  39. package/dist/fn/count.js +3 -6
  40. package/dist/fn/crc32.js +1 -4
  41. package/dist/fn/createObject.js +3 -6
  42. package/dist/fn/cssExists.js +3 -6
  43. package/dist/fn/date.js +8 -11
  44. package/dist/fn/dateSQL.js +5 -11
  45. package/dist/fn/daysInMonth.js +5 -11
  46. package/dist/fn/deepPath.js +7 -10
  47. package/dist/fn/defaultAjaxAbortFunction.js +3 -6
  48. package/dist/fn/defaultAjaxErrorFunction.js +1 -4
  49. package/dist/fn/defaultAlertFunction.js +1 -4
  50. package/dist/fn/defaultConfirmFunction.js +4 -7
  51. package/dist/fn/defaultEndLoadingFunction.js +1 -4
  52. package/dist/fn/defaultErrorFunction.js +3 -6
  53. package/dist/fn/defaultHistoryFunction.js +1 -4
  54. package/dist/fn/defaultLinkFunction.js +1 -4
  55. package/dist/fn/defaultPostLinkFunction.js +1 -4
  56. package/dist/fn/defaultPreLinkFunction.js +1 -4
  57. package/dist/fn/defaultResizeFunction.js +1 -4
  58. package/dist/fn/defaultStartLoadingFunction.js +1 -4
  59. package/dist/fn/deleteProp.js +4 -7
  60. package/dist/fn/diffObj.js +16 -19
  61. package/dist/fn/dirName.js +7 -10
  62. package/dist/fn/download.js +15 -18
  63. package/dist/fn/downloadContent.js +9 -12
  64. package/dist/fn/each.js +7 -10
  65. package/dist/fn/eraseCookie.js +1 -4
  66. package/dist/fn/error.js +3 -6
  67. package/dist/fn/escapeDquotes.js +3 -6
  68. package/dist/fn/escapeRegExp.js +1 -4
  69. package/dist/fn/escapeSquotes.js +3 -6
  70. package/dist/fn/escapeTicks.js +3 -6
  71. package/dist/fn/escapeUrl.js +8 -11
  72. package/dist/fn/extend.js +13 -16
  73. package/dist/fn/extendOut.js +4 -7
  74. package/dist/fn/fdate.js +12 -18
  75. package/dist/fn/fdatetime.js +10 -16
  76. package/dist/fn/fieldValue.js +1 -4
  77. package/dist/fn/fileExt.js +3 -6
  78. package/dist/fn/filter.js +12 -15
  79. package/dist/fn/filterToConditions.js +8 -11
  80. package/dist/fn/findAll.js +7 -10
  81. package/dist/fn/fori.js +6 -9
  82. package/dist/fn/forir.js +6 -9
  83. package/dist/fn/format.js +3 -6
  84. package/dist/fn/formatBytes.js +1 -4
  85. package/dist/fn/formatDate.js +3 -9
  86. package/dist/fn/formatSize.js +5 -8
  87. package/dist/fn/formdata.js +11 -14
  88. package/dist/fn/fromXml.js +1 -4
  89. package/dist/fn/ftime.js +12 -18
  90. package/dist/fn/getAllTags.js +3 -6
  91. package/dist/fn/getAncestors.js +1 -4
  92. package/dist/fn/getAttributes.js +3 -6
  93. package/dist/fn/getBrowserName.js +1 -4
  94. package/dist/fn/getBrowserVersion.js +1 -4
  95. package/dist/fn/getCookie.js +1 -4
  96. package/dist/fn/getCssVar.js +1 -4
  97. package/dist/fn/getDay.js +3 -6
  98. package/dist/fn/getDeviceType.js +1 -4
  99. package/dist/fn/getEventData.js +7 -10
  100. package/dist/fn/getField.js +3 -6
  101. package/dist/fn/getFieldValues.js +7 -10
  102. package/dist/fn/getHTMLOfSelection.js +4 -7
  103. package/dist/fn/getHtml.js +3 -6
  104. package/dist/fn/getLoader.js +3 -6
  105. package/dist/fn/getPath.js +3 -6
  106. package/dist/fn/getProp.js +4 -7
  107. package/dist/fn/getProperty.js +1 -4
  108. package/dist/fn/getRequestId.js +5 -8
  109. package/dist/fn/getRow.js +3 -6
  110. package/dist/fn/getScrollBarSize.js +1 -4
  111. package/dist/fn/getText.js +1 -4
  112. package/dist/fn/getTimeoff.js +1 -4
  113. package/dist/fn/happy.js +3 -6
  114. package/dist/fn/hash.js +11 -14
  115. package/dist/fn/hex2rgb.js +1 -4
  116. package/dist/fn/history.js +1 -4
  117. package/dist/fn/html2text.js +1 -4
  118. package/dist/fn/imageToCanvas.js +1 -4
  119. package/dist/fn/imgToBase64.js +3 -6
  120. package/dist/fn/info.js +3 -6
  121. package/dist/fn/init.js +32 -58
  122. package/dist/fn/isActiveInterface.js +1 -4
  123. package/dist/fn/isArray.js +1 -4
  124. package/dist/fn/isBlob.js +1 -4
  125. package/dist/fn/isBoolean.js +1 -4
  126. package/dist/fn/isCanvas.js +1 -4
  127. package/dist/fn/isColor.js +3 -6
  128. package/dist/fn/isComment.js +1 -4
  129. package/dist/fn/isCp.js +3 -6
  130. package/dist/fn/isDate.js +1 -4
  131. package/dist/fn/isDesktopDevice.js +1 -4
  132. package/dist/fn/isDimension.js +3 -6
  133. package/dist/fn/isDom.js +1 -4
  134. package/dist/fn/isEmail.js +3 -6
  135. package/dist/fn/isEmpty.js +5 -8
  136. package/dist/fn/isEvent.js +1 -4
  137. package/dist/fn/isFocused.js +1 -4
  138. package/dist/fn/isFunction.js +1 -4
  139. package/dist/fn/isHostname.js +5 -8
  140. package/dist/fn/isIP.js +3 -6
  141. package/dist/fn/isInside.js +7 -10
  142. package/dist/fn/isInt.js +1 -4
  143. package/dist/fn/isIterable.js +1 -4
  144. package/dist/fn/isMobile.js +4 -7
  145. package/dist/fn/isMobileDevice.js +1 -4
  146. package/dist/fn/isNull.js +1 -4
  147. package/dist/fn/isNumber.js +1 -4
  148. package/dist/fn/isObject.js +1 -4
  149. package/dist/fn/isPercent.js +1 -4
  150. package/dist/fn/isPrimitive.js +1 -4
  151. package/dist/fn/isPromise.js +1 -4
  152. package/dist/fn/isPropSize.js +3 -6
  153. package/dist/fn/isSQLDate.js +1 -4
  154. package/dist/fn/isSame.js +5 -8
  155. package/dist/fn/isString.js +1 -4
  156. package/dist/fn/isSymbol.js +1 -4
  157. package/dist/fn/isTabletDevice.js +1 -4
  158. package/dist/fn/isURL.js +1 -4
  159. package/dist/fn/isValidDimension.js +4 -7
  160. package/dist/fn/isValidName.js +3 -6
  161. package/dist/fn/isValue.js +3 -6
  162. package/dist/fn/isVue.js +1 -4
  163. package/dist/fn/iterate.js +5 -8
  164. package/dist/fn/lightenDarkenHex.js +1 -4
  165. package/dist/fn/link.js +19 -22
  166. package/dist/fn/log.js +3 -6
  167. package/dist/fn/makeReactive.js +28 -31
  168. package/dist/fn/map.js +3 -6
  169. package/dist/fn/md5.js +1 -4
  170. package/dist/fn/money.js +3 -6
  171. package/dist/fn/move.js +1 -4
  172. package/dist/fn/multiorder.js +3 -6
  173. package/dist/fn/nl2br.js +3 -6
  174. package/dist/fn/numProperties.js +1 -4
  175. package/dist/fn/objectToFormData.js +12 -15
  176. package/dist/fn/order.js +3 -6
  177. package/dist/fn/outerHeight.js +3 -6
  178. package/dist/fn/outerWidth.js +3 -6
  179. package/dist/fn/percent.js +1 -4
  180. package/dist/fn/pickValue.js +1 -4
  181. package/dist/fn/post.js +7 -10
  182. package/dist/fn/postOut.js +5 -8
  183. package/dist/fn/printf.js +1 -4
  184. package/dist/fn/quotes2html.js +4 -7
  185. package/dist/fn/randomInt.js +1 -4
  186. package/dist/fn/randomString.js +4 -7
  187. package/dist/fn/removeAccents.js +5 -8
  188. package/dist/fn/removeEmpty.js +8 -11
  189. package/dist/fn/removeExtraSpaces.js +1 -4
  190. package/dist/fn/removeHtmlComments.js +3 -6
  191. package/dist/fn/removePrivateProp.js +3 -6
  192. package/dist/fn/removeTrailingChars.js +6 -9
  193. package/dist/fn/repeat.js +1 -4
  194. package/dist/fn/replaceAll.js +4 -7
  195. package/dist/fn/replaceSelection.js +1 -4
  196. package/dist/fn/resize.js +7 -10
  197. package/dist/fn/rgb2hex.js +1 -4
  198. package/dist/fn/riterate.js +3 -6
  199. package/dist/fn/roundDecimal.js +1 -4
  200. package/dist/fn/sanitize.js +5 -8
  201. package/dist/fn/search.js +15 -18
  202. package/dist/fn/selectElementText.js +1 -4
  203. package/dist/fn/selector.js +1 -4
  204. package/dist/fn/setCookie.js +1 -4
  205. package/dist/fn/setCssVar.js +1 -4
  206. package/dist/fn/setNavigationVars.js +10 -13
  207. package/dist/fn/setProp.js +1 -4
  208. package/dist/fn/setProperty.js +3 -6
  209. package/dist/fn/shorten.js +5 -8
  210. package/dist/fn/shortenObj.js +9 -12
  211. package/dist/fn/shuffle.js +1 -4
  212. package/dist/fn/simpleHash.js +5 -8
  213. package/dist/fn/simpleHash1.js +1 -4
  214. package/dist/fn/simpleHash2.js +1 -4
  215. package/dist/fn/stat.js +1 -4
  216. package/dist/fn/string2ArrayBuffer.js +1 -4
  217. package/dist/fn/submit.js +6 -9
  218. package/dist/fn/substr.js +7 -10
  219. package/dist/fn/sum.js +4 -7
  220. package/dist/fn/timestamp.js +1 -4
  221. package/dist/fn/toCSV.js +8 -11
  222. package/dist/fn/toggleFullScreen.js +3 -6
  223. package/dist/fn/translate.js +3 -6
  224. package/dist/fn/treatAjaxArguments.js +10 -13
  225. package/dist/fn/trim.js +4 -7
  226. package/dist/fn/uniqString.js +7 -10
  227. package/dist/fn/unique.js +1 -4
  228. package/dist/fn/upload.js +7 -33
  229. package/dist/fn/warning.js +3 -6
  230. package/dist/index.js +459 -471
  231. package/package.json +1 -1
@@ -1,12 +1,9 @@
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");
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';
10
7
  const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
11
8
  let tmp = false;
12
9
  if (res) {
@@ -20,7 +17,7 @@ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
20
17
  eval(res.prescript);
21
18
  }
22
19
  catch (e) {
23
- (0, error_1.error)(e.message || '');
20
+ error(e.message || '');
24
21
  }
25
22
  }
26
23
  if (isObj && res.url === undefined) {
@@ -31,7 +28,7 @@ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
31
28
  tmp = fn(res, ele);
32
29
  }
33
30
  else {
34
- tmp = (0, defaultLinkFunction_1.defaultLinkFunction)(res, ele);
31
+ tmp = defaultLinkFunction(res, ele);
35
32
  }
36
33
  if (ele && isObj && (res.content !== undefined)) {
37
34
  if ('value' in ele) {
@@ -50,13 +47,13 @@ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
50
47
  let r = null;
51
48
  try {
52
49
  r = eval(res.script);
53
- if ((0, isFunction_1.isFunction)(r)) {
50
+ if (isFunction(r)) {
54
51
  r = r(data, ele);
55
52
  }
56
53
  }
57
54
  catch (e) {
58
- (0, log_1.log)(e, res);
59
- (0, error_1.error)((0, isFunction_1.isFunction)(e.getMessage) ? e.getMessage() : null);
55
+ log(e, res);
56
+ error(isFunction(e.getMessage) ? e.getMessage() : null);
60
57
  }
61
58
  return r;
62
59
  })(res.data ? res.data : {}, ele ? ele : false);
@@ -66,20 +63,20 @@ const callback = function (url, res = null, fn = null, fn2 = null, ele = null) {
66
63
  if (tmp && fn2) {
67
64
  fn2(res);
68
65
  }
69
- else if (isObj && defaultPostLinkFunction_1.defaultPostLinkFunction) {
70
- (0, defaultPostLinkFunction_1.defaultPostLinkFunction)(res, ele);
66
+ else if (isObj && defaultPostLinkFunction) {
67
+ defaultPostLinkFunction(res, ele);
71
68
  }
72
69
  if (tmp && isObj && res.postscript) {
73
70
  eval(res.postscript);
74
71
  }
75
72
  if (isObj && res.error) {
76
73
  errTitle = res.errorTitle || bbn.lng.server_response;
77
- (0, defaultAlertFunction_1.defaultAlertFunction)(res.error, errTitle);
74
+ defaultAlertFunction(res.error, errTitle);
78
75
  }
79
76
  }
80
77
  else {
81
- (0, defaultAlertFunction_1.defaultAlertFunction)(bbn.lng.errorText, bbn.lng.error);
78
+ defaultAlertFunction(bbn.lng.errorText, bbn.lng.error);
82
79
  }
83
80
  return tmp;
84
81
  };
85
- exports.callback = callback;
82
+ export { callback };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.camelToCss = void 0;
4
1
  const camelToCss = function (str) {
5
2
  return str
6
3
  .replace(/([A-Z])/g, function (st) {
@@ -10,4 +7,4 @@ const camelToCss = function (str) {
10
7
  return st.toLowerCase();
11
8
  });
12
9
  };
13
- exports.camelToCss = camelToCss;
10
+ export { camelToCss };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.camelize = void 0;
4
1
  const camelize = function (str) {
5
2
  return str.replace(/^([A-Z])|[\s-](\w)/g, function (match, p1, p2, offset) {
6
3
  if (p2) {
@@ -9,4 +6,4 @@ const camelize = function (str) {
9
6
  return p1.toLowerCase();
10
7
  });
11
8
  };
12
- exports.camelize = camelize;
9
+ export { camelize };
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.canvasToImage = void 0;
4
1
  const canvasToImage = function (canvas) {
5
2
  let img = new Image();
6
3
  img.src = canvas.toDataURL('image/png');
7
4
  return img;
8
5
  };
9
- exports.canvasToImage = canvasToImage;
6
+ export { canvasToImage };
package/dist/fn/center.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.center = void 0;
4
1
  const center = function (ele) {
5
2
  //ele = $(ele);
6
3
  let parent = ele.parentNode,
@@ -24,4 +21,4 @@ const center = function (ele) {
24
21
  ele.style.left = Math.max(0, (h - ele.offsetWidth) / 2 + parent.scrollLeft) + 'px';
25
22
  return ele;
26
23
  };
27
- exports.center = center;
24
+ export { center };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkProps = void 0;
4
- const checkPropsDetails_1 = require("./checkPropsDetails");
1
+ import { checkPropsDetails } from './checkPropsDetails';
5
2
  const checkProps = function (obj, props, checkEmpty = false) {
6
- return (0, checkPropsDetails_1.checkPropsDetails)(obj, props, checkEmpty).result;
3
+ return checkPropsDetails(obj, props, checkEmpty).result;
7
4
  };
8
- exports.checkProps = checkProps;
5
+ export { checkProps };
@@ -1,10 +1,7 @@
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");
1
+ import { isArray } from './isArray';
2
+ import { isObject } from './isObject';
3
+ import { each } from './each';
4
+ import { substr } from './substr';
8
5
  const checkPropsDetails = function (obj, props, checkEmpty = false) {
9
6
  let res = {
10
7
  error: false,
@@ -13,15 +10,15 @@ const checkPropsDetails = function (obj, props, checkEmpty = false) {
13
10
  if (typeof (props) === 'string') {
14
11
  props = [props];
15
12
  }
16
- if (!(0, isArray_1.isArray)(props)) {
13
+ if (!isArray(props)) {
17
14
  res.error = bbn._('checkProps must receive a string or an array as props argument');
18
15
  }
19
- if (!(0, isObject_1.isObject)(obj)) {
16
+ if (!isObject(obj)) {
20
17
  res.error = bbn._('checkProps must receive an object as obj argument');
21
18
  }
22
19
  if (!res.error) {
23
20
  let check;
24
- (0, each_1.each)(props, (varName) => {
21
+ each(props, (varName) => {
25
22
  varName = varName.trim().split(':');
26
23
  let type = varName[1] || false;
27
24
  varName = varName[0];
@@ -29,7 +26,7 @@ const checkPropsDetails = function (obj, props, checkEmpty = false) {
29
26
  res.error = varName + ' ' + bbn._('is not defined');
30
27
  }
31
28
  else if (type) {
32
- check = 'is' + (0, substr_1.substr)(type, 0, 1).toUpperCase() + (0, substr_1.substr)(type, 1).toLowerCase();
29
+ check = 'is' + substr(type, 0, 1).toUpperCase() + substr(type, 1).toLowerCase();
33
30
  if (bbn.fn[check] === undefined) {
34
31
  res.error = type + ' ' + bbn._('is not a valid type');
35
32
  }
@@ -50,4 +47,4 @@ const checkPropsDetails = function (obj, props, checkEmpty = false) {
50
47
  }
51
48
  return res;
52
49
  };
53
- exports.checkPropsDetails = checkPropsDetails;
50
+ export { checkPropsDetails };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkPropsOrDie = void 0;
4
- const checkPropsDetails_1 = require("./checkPropsDetails");
1
+ import { checkPropsDetails } from './checkPropsDetails';
5
2
  const checkPropsOrDie = function (obj, props, checkEmpty = false) {
6
- let res = (0, checkPropsDetails_1.checkPropsDetails)(obj, props, checkEmpty);
3
+ let res = checkPropsDetails(obj, props, checkEmpty);
7
4
  if (res.error) {
8
5
  throw new Error(res.error);
9
6
  }
10
7
  return true;
11
8
  };
12
- exports.checkPropsOrDie = checkPropsOrDie;
9
+ export { checkPropsOrDie };
@@ -1,20 +1,17 @@
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");
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';
11
8
  const checkType = function (value, type, msg, ...logs) {
12
9
  let ok = false;
13
- if (!(0, isArray_1.isArray)(type)) {
10
+ if (!isArray(type)) {
14
11
  type = [type];
15
12
  }
16
13
  const typesList = [];
17
- (0, each_1.each)(type, (t) => {
14
+ each(type, (t) => {
18
15
  var _a;
19
16
  if (t === String) {
20
17
  t = 'string';
@@ -34,17 +31,17 @@ const checkType = function (value, type, msg, ...logs) {
34
31
  else if (t === Function) {
35
32
  t = 'function';
36
33
  }
37
- if ((0, isFunction_1.isFunction)(t)) {
34
+ if (isFunction(t)) {
38
35
  typesList.push(t.name || ((_a = t.constructor) === null || _a === void 0 ? void 0 : _a.name) || t.toString());
39
36
  if (value instanceof t) {
40
37
  ok = true;
41
38
  return false;
42
39
  }
43
40
  }
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`);
41
+ else if (!isString(t) || !isFunction(bbn.fn['is' + correctCase(t)])) {
42
+ error(`The type ${t} is not recognized`);
46
43
  }
47
- else if (bbn.fn['is' + (0, correctCase_1.correctCase)(t)](value)) {
44
+ else if (bbn.fn['is' + correctCase(t)](value)) {
48
45
  ok = true;
49
46
  return false;
50
47
  }
@@ -53,11 +50,11 @@ const checkType = function (value, type, msg, ...logs) {
53
50
  }
54
51
  });
55
52
  if (!ok) {
56
- (0, log_1.log)(['Value given', value, 'type', typeof value, 'expected', typesList.join(' or ')]);
53
+ log(['Value given', value, 'type', typeof value, 'expected', typesList.join(' or ')]);
57
54
  if (logs.length) {
58
- (0, log_1.log)(logs);
55
+ log(logs);
59
56
  }
60
57
  throw new Error((msg ? msg + ' - ' : '') + bbn._('The value should be a %s', typesList.join(' ' + bbn._('or a') + ' ')));
61
58
  }
62
59
  };
63
- exports.checkType = checkType;
60
+ export { checkType };
package/dist/fn/chrono.js CHANGED
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stopChrono = exports.startChrono = void 0;
4
- const each_1 = require("./each");
1
+ import { each } from './each';
5
2
  const _private = [];
6
3
  const startChrono = function (name) {
7
4
  let now = new Date().getTime();
8
5
  let h1 = 3600 * 1000;
9
6
  if (_private.length) {
10
- (0, each_1.each)(_private, (t, n) => {
7
+ each(_private, (t, n) => {
11
8
  if (now - t > h1) {
12
9
  delete _private[n];
13
10
  }
@@ -16,7 +13,6 @@ const startChrono = function (name) {
16
13
  }
17
14
  _private[name] = now;
18
15
  };
19
- exports.startChrono = startChrono;
20
16
  const stopChrono = function (name) {
21
17
  if (_private[name]) {
22
18
  let now = new Date().getTime();
@@ -24,4 +20,4 @@ const stopChrono = function (name) {
24
20
  return diff;
25
21
  }
26
22
  };
27
- exports.stopChrono = stopChrono;
23
+ export { startChrono, stopChrono };
@@ -1,9 +1,6 @@
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");
1
+ import { isDom } from './isDom';
2
+ import { isCp } from './isCp';
3
+ import { log } from './log';
7
4
  const circularReplacer = function () {
8
5
  const visited = new WeakSet();
9
6
  return (key, value) => {
@@ -13,7 +10,7 @@ const circularReplacer = function () {
13
10
  }
14
11
  visited.add(value);
15
12
  if (![undefined, Object, Array, null].includes(value.constructor)) {
16
- if ((0, isDom_1.isDom)(value)) {
13
+ if (isDom(value)) {
17
14
  if (value.bbnId) {
18
15
  value = '__BBN_DOM__' + value.tagName + '/' + value.bbnId + value.bbnHash;
19
16
  }
@@ -21,8 +18,8 @@ const circularReplacer = function () {
21
18
  value = '__BBN_DOM__' + value.tagName + '/' + value.className;
22
19
  }
23
20
  }
24
- else if ((0, isCp_1.isCp)(value)) {
25
- (0, log_1.log)('IS CP');
21
+ else if (isCp(value)) {
22
+ log('IS CP');
26
23
  value = '__BBN_CP__' + value.$options.name + '/' + value.$cid;
27
24
  }
28
25
  else {
@@ -33,4 +30,4 @@ const circularReplacer = function () {
33
30
  return value;
34
31
  };
35
32
  };
36
- exports.circularReplacer = circularReplacer;
33
+ export { circularReplacer };
package/dist/fn/clone.js CHANGED
@@ -1,19 +1,16 @@
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");
1
+ import { isArray } from './isArray';
2
+ import { isObject } from './isObject';
3
+ import { extend } from './extend';
7
4
  const clone = function (obj) {
8
- if ((0, isArray_1.isArray)(obj)) {
5
+ if (isArray(obj)) {
9
6
  return obj.slice().map((a) => {
10
7
  return typeof a === 'object' ? clone(a) : a;
11
8
  });
12
9
  }
13
- if ((0, isObject_1.isObject)(obj)) {
10
+ if (isObject(obj)) {
14
11
  const o = Object.create(Object.getPrototypeOf(obj));
15
- return (0, extend_1.extend)(true, o, obj);
12
+ return extend(true, o, obj);
16
13
  }
17
14
  return obj;
18
15
  };
19
- exports.clone = clone;
16
+ export { clone };
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.colorToHex = void 0;
4
1
  const colorToHex = function (color) {
5
2
  let canvas = document.createElement('canvas').getContext('2d');
6
3
  canvas.fillStyle = color;
7
4
  return canvas.fillStyle;
8
5
  };
9
- exports.colorToHex = colorToHex;
6
+ export { colorToHex };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compare = void 0;
4
- const isEmpty_1 = require("./isEmpty");
5
- const removeAccents_1 = require("./removeAccents");
6
- const isNull_1 = require("./isNull");
7
- const isObject_1 = require("./isObject");
8
- const isSame_1 = require("./isSame");
1
+ import { isEmpty } from './isEmpty';
2
+ import { removeAccents } from './removeAccents';
3
+ import { isNull } from './isNull';
4
+ import { isObject } from './isObject';
5
+ import { isSame } from './isSame';
9
6
  const compare = function (v1, v2, operator) {
10
7
  switch (operator) {
11
8
  case '===':
@@ -26,19 +23,19 @@ const compare = function (v1, v2, operator) {
26
23
  case 'contain':
27
24
  case 'icontains':
28
25
  case 'icontain':
29
- if ((0, isEmpty_1.isEmpty)(v1) || (0, isEmpty_1.isEmpty)(v2)) {
26
+ if (isEmpty(v1) || isEmpty(v2)) {
30
27
  return false;
31
28
  }
32
- return (0, removeAccents_1.removeAccents)(v1).toLowerCase().indexOf((0, removeAccents_1.removeAccents)(v2).toLowerCase()) !== -1;
29
+ return removeAccents(v1).toLowerCase().indexOf(removeAccents(v2).toLowerCase()) !== -1;
33
30
  case 'doesnotcontain':
34
31
  case 'donotcontain':
35
- if ((0, isNull_1.isNull)(v1) || (0, isNull_1.isNull)(v2)) {
32
+ if (isNull(v1) || isNull(v2)) {
36
33
  return true;
37
34
  }
38
- return (0, removeAccents_1.removeAccents)(v1.toLowerCase()).indexOf((0, removeAccents_1.removeAccents)(v2.toLowerCase())) === -1;
35
+ return removeAccents(v1.toLowerCase()).indexOf(removeAccents(v2.toLowerCase())) === -1;
39
36
  case 'starts':
40
37
  case 'start':
41
- if ((0, isNull_1.isNull)(v1) || (0, isNull_1.isNull)(v2)) {
38
+ if (isNull(v1) || isNull(v2)) {
42
39
  return false;
43
40
  }
44
41
  if (typeof v1 !== 'string') {
@@ -53,24 +50,24 @@ const compare = function (v1, v2, operator) {
53
50
  case 'starti':
54
51
  case 'istarts':
55
52
  case 'istart':
56
- if ((0, isNull_1.isNull)(v1) || (0, isNull_1.isNull)(v2)) {
53
+ if (isNull(v1) || isNull(v2)) {
57
54
  return false;
58
55
  }
59
- return (0, removeAccents_1.removeAccents)(v1).toLowerCase().indexOf((0, removeAccents_1.removeAccents)(v2).toLowerCase()) === 0;
56
+ return removeAccents(v1).toLowerCase().indexOf(removeAccents(v2).toLowerCase()) === 0;
60
57
  case 'endswith':
61
58
  case 'endsi':
62
59
  case 'endi':
63
60
  case 'iends':
64
61
  case 'iend':
65
- if ((0, isNull_1.isNull)(v1) || (0, isNull_1.isNull)(v2)) {
62
+ if (isNull(v1) || isNull(v2)) {
66
63
  return false;
67
64
  }
68
65
  return v1.lastIndexOf(v2) === v1.length - v2.length;
69
66
  case 'like':
70
- if ((0, isNull_1.isNull)(v1) || (0, isNull_1.isNull)(v2)) {
67
+ if (isNull(v1) || isNull(v2)) {
71
68
  return false;
72
69
  }
73
- return (0, removeAccents_1.removeAccents)(v1).toLowerCase() === (0, removeAccents_1.removeAccents)(v2).toLowerCase();
70
+ return removeAccents(v1).toLowerCase() === removeAccents(v2).toLowerCase();
74
71
  case 'gt':
75
72
  case '>':
76
73
  return v1 > v2;
@@ -92,11 +89,11 @@ const compare = function (v1, v2, operator) {
92
89
  case 'isnotempty':
93
90
  return v1 !== '';
94
91
  case '==':
95
- if ((0, isObject_1.isObject)(v1, v2)) {
96
- return (0, isSame_1.isSame)(v1, v2);
92
+ if (isObject(v1, v2)) {
93
+ return isSame(v1, v2);
97
94
  }
98
95
  default:
99
96
  return v1 == v2;
100
97
  }
101
98
  };
102
- exports.compare = compare;
99
+ export { compare };
@@ -1,29 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compareConditions = void 0;
4
- const isArray_1 = require("./isArray");
5
- const each_1 = require("./each");
6
- const getProperty_1 = require("./getProperty");
1
+ import { isArray } from './isArray';
2
+ import { each } from './each';
3
+ import { getProperty } from './getProperty';
7
4
  const compareConditions = function (data, filter) {
8
- if (!filter.conditions || !filter.logic || !(0, isArray_1.isArray)(filter.conditions)) {
5
+ if (!filter.conditions || !filter.logic || !isArray(filter.conditions)) {
9
6
  throw new Error('Error in compareConditions: the filter should an abject with conditions and logic properties and conditions should be an array of objects');
10
7
  }
11
8
  let ok = filter.logic === 'AND' ? true : false;
12
- (0, each_1.each)(filter.conditions, (a) => {
9
+ each(filter.conditions, (a) => {
13
10
  let compare;
14
- if (a.conditions && (0, isArray_1.isArray)(a.conditions)) {
11
+ if (a.conditions && isArray(a.conditions)) {
15
12
  compare = compareConditions(data, a);
16
13
  }
17
14
  else {
18
- compare = compare((0, getProperty_1.getProperty)(data, a.field), a.value, a.operator);
15
+ compare = compare(getProperty(data, a.field), a.value, a.operator);
19
16
  if (compare) {
20
17
  let bits = a.field.split('.');
21
18
  let prop = bits.pop();
22
19
  if (bits.length) {
23
- (0, each_1.each)(bits, (b) => (data = data[b]));
20
+ each(bits, (b) => (data = data[b]));
24
21
  }
25
22
  // Case where both are undefined: value and prop which doesn't exist; they are not the same!
26
- if ((0, getProperty_1.getProperty)(data, prop) === undefined && a.value !== undefined) {
23
+ if (getProperty(data, prop) === undefined && a.value !== undefined) {
27
24
  compare = false;
28
25
  }
29
26
  }
@@ -41,4 +38,4 @@ const compareConditions = function (data, filter) {
41
38
  });
42
39
  return ok;
43
40
  };
44
- exports.compareConditions = compareConditions;
41
+ export { compareConditions };
package/dist/fn/copy.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copy = void 0;
4
- const isObject_1 = require("./isObject");
5
- const isFunction_1 = require("./isFunction");
1
+ import { isObject } from './isObject';
2
+ import { isFunction } from './isFunction';
6
3
  const copy = function (st) {
7
4
  return new Promise((resolve) => {
8
5
  if (st) {
@@ -12,7 +9,7 @@ const copy = function (st) {
12
9
  resolve(true);
13
10
  });
14
11
  }
15
- else if ((0, isObject_1.isObject)(st) && (0, isFunction_1.isFunction)(st.toBlob)) {
12
+ else if (isObject(st) && isFunction(st.toBlob)) {
16
13
  st.toBlob((blob) => {
17
14
  navigator.clipboard.write([new ClipboardItem({ [blob.type.toString()]: blob })]).then(() => {
18
15
  resolve(true);
@@ -37,4 +34,4 @@ const copy = function (st) {
37
34
  resolve(false);
38
35
  });
39
36
  };
40
- exports.copy = copy;
37
+ export { copy };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.correctCase = void 0;
4
1
  const correctCase = function (str) {
5
2
  return str.replace(/[A-z]{1}/, (c) => c.toUpperCase());
6
3
  };
7
- exports.correctCase = correctCase;
4
+ export { correctCase };
package/dist/fn/count.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.count = void 0;
4
- const filter_1 = require("./filter");
1
+ import { filter } from './filter';
5
2
  const count = function (arr, prop, val = null, operator = '=') {
6
- return (0, filter_1.filter)(arr, prop, val, operator).length || 0;
3
+ return filter(arr, prop, val, operator).length || 0;
7
4
  };
8
- exports.count = count;
5
+ export { count };
package/dist/fn/crc32.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.crc32 = void 0;
4
1
  // this is a test
5
2
  const crc32Table = [];
6
3
  for (let i = 0; i < 256; i++) {
@@ -18,4 +15,4 @@ const crc32 = function (str) {
18
15
  }
19
16
  return (crc ^ -1) >>> 0; // Make sure the result is a 32-bit positive integer
20
17
  };
21
- exports.crc32 = crc32;
18
+ export { crc32 };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createObject = void 0;
4
- const extend_1 = require("./extend");
1
+ import { extend } from './extend';
5
2
  const createObject = function (...args) {
6
3
  const obj = Object.create(null);
7
4
  if (args.length) {
8
- (0, extend_1.extend)(obj, ...args);
5
+ extend(obj, ...args);
9
6
  }
10
7
  return obj;
11
8
  };
12
- exports.createObject = createObject;
9
+ export { createObject };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cssExists = void 0;
4
1
  //import { log } from './log';
5
- const escapeRegExp_1 = require("./escapeRegExp");
2
+ import { escapeRegExp } from './escapeRegExp';
6
3
  const cssExists = function (f) {
7
4
  let ok;
8
5
  let rules;
@@ -22,7 +19,7 @@ const cssExists = function (f) {
22
19
  //log(rules);
23
20
  for (let cx = 0; cx < rules.length; cx++) {
24
21
  //log(rules[cx].selectorText);
25
- if (new RegExp('(^|\\s)' + (0, escapeRegExp_1.escapeRegExp)(f) + '(\\{|\\s)', 'g').test(rules[cx].selectorText)) {
22
+ if (new RegExp('(^|\\s)' + escapeRegExp(f) + '(\\{|\\s)', 'g').test(rules[cx].selectorText)) {
26
23
  return true;
27
24
  }
28
25
  }
@@ -30,4 +27,4 @@ const cssExists = function (f) {
30
27
  }
31
28
  return false;
32
29
  };
33
- exports.cssExists = cssExists;
30
+ export { cssExists };