@bbn/bbn 1.0.26 → 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 (237) hide show
  1. package/dist/bundle.d.ts +2 -2
  2. package/dist/bundle.js +24 -24
  3. package/dist/fn/_addLoader.js +6 -3
  4. package/dist/fn/_compareValues.js +14 -11
  5. package/dist/fn/_deleteLoader.js +10 -7
  6. package/dist/fn/abort.js +6 -3
  7. package/dist/fn/abortURL.js +7 -4
  8. package/dist/fn/addColors.js +8 -5
  9. package/dist/fn/addInputs.js +6 -3
  10. package/dist/fn/addStyle.js +8 -5
  11. package/dist/fn/adjustHeight.js +8 -5
  12. package/dist/fn/adjustSize.js +8 -5
  13. package/dist/fn/adjustWidth.js +8 -5
  14. package/dist/fn/ajax.js +34 -31
  15. package/dist/fn/analyzeFunction.js +6 -3
  16. package/dist/fn/animateCss.js +4 -1
  17. package/dist/fn/arrayBuffer2String.js +4 -1
  18. package/dist/fn/arrayFromProp.js +8 -5
  19. package/dist/fn/autoExtend.js +7 -4
  20. package/dist/fn/baseName.js +9 -6
  21. package/dist/fn/br2nl.js +6 -3
  22. package/dist/fn/calendar.d.ts +1 -1
  23. package/dist/fn/calendar.js +20 -11
  24. package/dist/fn/callback.js +19 -16
  25. package/dist/fn/camelToCss.js +4 -1
  26. package/dist/fn/camelize.js +4 -1
  27. package/dist/fn/canvasToImage.js +4 -1
  28. package/dist/fn/center.js +4 -1
  29. package/dist/fn/checkProps.js +6 -3
  30. package/dist/fn/checkPropsDetails.js +12 -9
  31. package/dist/fn/checkPropsOrDie.js +6 -3
  32. package/dist/fn/checkType.js +19 -16
  33. package/dist/fn/chrono.js +7 -3
  34. package/dist/fn/circularReplacer.js +10 -7
  35. package/dist/fn/clone.js +10 -7
  36. package/dist/fn/colorToHex.js +4 -1
  37. package/dist/fn/compare.js +21 -18
  38. package/dist/fn/compareConditions.js +13 -10
  39. package/dist/fn/copy.js +7 -4
  40. package/dist/fn/correctCase.js +4 -1
  41. package/dist/fn/count.js +6 -3
  42. package/dist/fn/crc32.js +4 -1
  43. package/dist/fn/createObject.js +6 -3
  44. package/dist/fn/cssExists.js +6 -3
  45. package/dist/fn/date.js +11 -8
  46. package/dist/fn/dateSQL.d.ts +1 -1
  47. package/dist/fn/dateSQL.js +11 -4
  48. package/dist/fn/daysInMonth.d.ts +1 -1
  49. package/dist/fn/daysInMonth.js +11 -4
  50. package/dist/fn/deepPath.js +10 -7
  51. package/dist/fn/defaultAjaxAbortFunction.js +6 -3
  52. package/dist/fn/defaultAjaxErrorFunction.js +4 -1
  53. package/dist/fn/defaultAlertFunction.js +4 -1
  54. package/dist/fn/defaultConfirmFunction.js +7 -4
  55. package/dist/fn/defaultEndLoadingFunction.js +4 -1
  56. package/dist/fn/defaultErrorFunction.js +6 -3
  57. package/dist/fn/defaultHistoryFunction.js +4 -1
  58. package/dist/fn/defaultLinkFunction.js +4 -1
  59. package/dist/fn/defaultPostLinkFunction.js +4 -1
  60. package/dist/fn/defaultPreLinkFunction.js +4 -1
  61. package/dist/fn/defaultResizeFunction.js +4 -1
  62. package/dist/fn/defaultStartLoadingFunction.js +4 -1
  63. package/dist/fn/deleteProp.js +7 -4
  64. package/dist/fn/diffObj.js +19 -16
  65. package/dist/fn/dirName.js +10 -7
  66. package/dist/fn/download.js +18 -15
  67. package/dist/fn/downloadContent.js +12 -9
  68. package/dist/fn/each.js +10 -7
  69. package/dist/fn/eraseCookie.js +4 -1
  70. package/dist/fn/error.js +6 -3
  71. package/dist/fn/escapeDquotes.js +6 -3
  72. package/dist/fn/escapeRegExp.js +4 -1
  73. package/dist/fn/escapeSquotes.js +6 -3
  74. package/dist/fn/escapeTicks.js +6 -3
  75. package/dist/fn/escapeUrl.js +11 -8
  76. package/dist/fn/extend.js +16 -13
  77. package/dist/fn/extendOut.js +7 -4
  78. package/dist/fn/fdate.js +18 -11
  79. package/dist/fn/fdatetime.js +16 -9
  80. package/dist/fn/fieldValue.js +4 -1
  81. package/dist/fn/fileExt.js +6 -3
  82. package/dist/fn/filter.js +15 -12
  83. package/dist/fn/filterToConditions.js +11 -8
  84. package/dist/fn/findAll.js +10 -7
  85. package/dist/fn/fori.js +9 -6
  86. package/dist/fn/forir.js +9 -6
  87. package/dist/fn/format.js +6 -3
  88. package/dist/fn/formatBytes.js +4 -1
  89. package/dist/fn/formatDate.d.ts +1 -1
  90. package/dist/fn/formatDate.js +9 -2
  91. package/dist/fn/formatSize.js +8 -5
  92. package/dist/fn/formdata.js +14 -11
  93. package/dist/fn/fromXml.js +4 -1
  94. package/dist/fn/ftime.js +18 -11
  95. package/dist/fn/getAllTags.js +6 -3
  96. package/dist/fn/getAncestors.js +4 -1
  97. package/dist/fn/getAttributes.js +6 -3
  98. package/dist/fn/getBrowserName.js +4 -1
  99. package/dist/fn/getBrowserVersion.js +4 -1
  100. package/dist/fn/getCookie.js +4 -1
  101. package/dist/fn/getCssVar.js +4 -1
  102. package/dist/fn/getDay.js +6 -3
  103. package/dist/fn/getDeviceType.js +4 -1
  104. package/dist/fn/getEventData.js +10 -7
  105. package/dist/fn/getField.js +6 -3
  106. package/dist/fn/getFieldValues.js +10 -7
  107. package/dist/fn/getHTMLOfSelection.js +7 -4
  108. package/dist/fn/getHtml.js +6 -3
  109. package/dist/fn/getLoader.js +6 -3
  110. package/dist/fn/getPath.js +6 -3
  111. package/dist/fn/getProp.js +7 -4
  112. package/dist/fn/getProperty.js +4 -1
  113. package/dist/fn/getRequestId.js +8 -5
  114. package/dist/fn/getRow.js +6 -3
  115. package/dist/fn/getScrollBarSize.js +4 -1
  116. package/dist/fn/getText.js +4 -1
  117. package/dist/fn/getTimeoff.js +4 -1
  118. package/dist/fn/happy.js +6 -3
  119. package/dist/fn/hash.js +14 -11
  120. package/dist/fn/hex2rgb.js +4 -1
  121. package/dist/fn/history.js +4 -1
  122. package/dist/fn/html2text.js +4 -1
  123. package/dist/fn/imageToCanvas.js +4 -1
  124. package/dist/fn/imgToBase64.js +6 -3
  125. package/dist/fn/info.js +6 -3
  126. package/dist/fn/init.js +58 -31
  127. package/dist/fn/isActiveInterface.js +4 -1
  128. package/dist/fn/isArray.js +4 -1
  129. package/dist/fn/isBlob.js +4 -1
  130. package/dist/fn/isBoolean.js +4 -1
  131. package/dist/fn/isCanvas.js +4 -1
  132. package/dist/fn/isColor.js +6 -3
  133. package/dist/fn/isComment.js +4 -1
  134. package/dist/fn/isCp.js +6 -3
  135. package/dist/fn/isDate.js +4 -1
  136. package/dist/fn/isDesktopDevice.js +4 -1
  137. package/dist/fn/isDimension.js +6 -3
  138. package/dist/fn/isDom.js +4 -1
  139. package/dist/fn/isEmail.js +6 -3
  140. package/dist/fn/isEmpty.js +8 -5
  141. package/dist/fn/isEvent.js +4 -1
  142. package/dist/fn/isFocused.js +4 -1
  143. package/dist/fn/isFunction.js +4 -1
  144. package/dist/fn/isHostname.js +8 -5
  145. package/dist/fn/isIP.js +6 -3
  146. package/dist/fn/isInside.js +10 -7
  147. package/dist/fn/isInt.js +4 -1
  148. package/dist/fn/isIterable.js +4 -1
  149. package/dist/fn/isMobile.js +7 -4
  150. package/dist/fn/isMobileDevice.js +4 -1
  151. package/dist/fn/isNull.js +4 -1
  152. package/dist/fn/isNumber.js +4 -1
  153. package/dist/fn/isObject.js +4 -1
  154. package/dist/fn/isPercent.js +4 -1
  155. package/dist/fn/isPrimitive.js +4 -1
  156. package/dist/fn/isPromise.js +4 -1
  157. package/dist/fn/isPropSize.js +6 -3
  158. package/dist/fn/isSQLDate.js +4 -1
  159. package/dist/fn/isSame.js +8 -5
  160. package/dist/fn/isString.js +4 -1
  161. package/dist/fn/isSymbol.js +4 -1
  162. package/dist/fn/isTabletDevice.js +4 -1
  163. package/dist/fn/isURL.js +4 -1
  164. package/dist/fn/isValidDimension.js +7 -4
  165. package/dist/fn/isValidName.js +6 -3
  166. package/dist/fn/isValue.js +6 -3
  167. package/dist/fn/isVue.js +4 -1
  168. package/dist/fn/iterate.js +8 -5
  169. package/dist/fn/lightenDarkenHex.js +4 -1
  170. package/dist/fn/link.js +22 -19
  171. package/dist/fn/log.js +6 -3
  172. package/dist/fn/makeReactive.js +31 -28
  173. package/dist/fn/map.js +6 -3
  174. package/dist/fn/md5.js +4 -1
  175. package/dist/fn/money.js +6 -3
  176. package/dist/fn/move.js +4 -1
  177. package/dist/fn/multiorder.js +6 -3
  178. package/dist/fn/nl2br.js +6 -3
  179. package/dist/fn/numProperties.js +4 -1
  180. package/dist/fn/objectToFormData.js +15 -12
  181. package/dist/fn/order.js +6 -3
  182. package/dist/fn/outerHeight.js +6 -3
  183. package/dist/fn/outerWidth.js +6 -3
  184. package/dist/fn/percent.js +4 -1
  185. package/dist/fn/pickValue.js +4 -1
  186. package/dist/fn/post.js +10 -7
  187. package/dist/fn/postOut.js +8 -5
  188. package/dist/fn/printf.js +4 -1
  189. package/dist/fn/quotes2html.js +7 -4
  190. package/dist/fn/randomInt.js +4 -1
  191. package/dist/fn/randomString.js +7 -4
  192. package/dist/fn/removeAccents.js +8 -5
  193. package/dist/fn/removeEmpty.js +11 -8
  194. package/dist/fn/removeExtraSpaces.js +4 -1
  195. package/dist/fn/removeHtmlComments.js +6 -3
  196. package/dist/fn/removePrivateProp.js +6 -3
  197. package/dist/fn/removeTrailingChars.js +9 -6
  198. package/dist/fn/repeat.js +4 -1
  199. package/dist/fn/replaceAll.js +7 -4
  200. package/dist/fn/replaceSelection.js +4 -1
  201. package/dist/fn/resize.js +10 -7
  202. package/dist/fn/rgb2hex.js +4 -1
  203. package/dist/fn/riterate.js +6 -3
  204. package/dist/fn/roundDecimal.js +4 -1
  205. package/dist/fn/sanitize.js +8 -5
  206. package/dist/fn/search.js +18 -15
  207. package/dist/fn/selectElementText.js +4 -1
  208. package/dist/fn/selector.js +4 -1
  209. package/dist/fn/setCookie.js +4 -1
  210. package/dist/fn/setCssVar.js +4 -1
  211. package/dist/fn/setNavigationVars.js +13 -10
  212. package/dist/fn/setProp.js +4 -1
  213. package/dist/fn/setProperty.js +6 -3
  214. package/dist/fn/shorten.js +8 -5
  215. package/dist/fn/shortenObj.js +12 -9
  216. package/dist/fn/shuffle.js +4 -1
  217. package/dist/fn/simpleHash.js +8 -5
  218. package/dist/fn/simpleHash1.js +4 -1
  219. package/dist/fn/simpleHash2.js +4 -1
  220. package/dist/fn/stat.js +4 -1
  221. package/dist/fn/string2ArrayBuffer.js +4 -1
  222. package/dist/fn/submit.js +9 -6
  223. package/dist/fn/substr.js +10 -7
  224. package/dist/fn/sum.js +7 -4
  225. package/dist/fn/timestamp.js +4 -1
  226. package/dist/fn/toCSV.js +11 -8
  227. package/dist/fn/toggleFullScreen.js +6 -3
  228. package/dist/fn/translate.js +6 -3
  229. package/dist/fn/treatAjaxArguments.js +13 -10
  230. package/dist/fn/trim.js +7 -4
  231. package/dist/fn/uniqString.js +10 -7
  232. package/dist/fn/unique.js +4 -1
  233. package/dist/fn/upload.js +33 -6
  234. package/dist/fn/warning.js +6 -3
  235. package/dist/index.d.ts +4 -4
  236. package/dist/index.js +471 -459
  237. package/package.json +1 -1
@@ -1,9 +1,12 @@
1
- import { isDate } from './isDate';
2
- import { createObject } from './createObject';
3
- import { isFunction } from './isFunction';
4
- import { isValue } from './isValue';
5
- import { isDom } from './isDom';
6
- import { numProperties } from './numProperties';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.diffObj = void 0;
4
+ const isDate_1 = require("./isDate");
5
+ const createObject_1 = require("./createObject");
6
+ const isFunction_1 = require("./isFunction");
7
+ const isValue_1 = require("./isValue");
8
+ const isDom_1 = require("./isDom");
9
+ const numProperties_1 = require("./numProperties");
7
10
  let diffObjProcessed = [];
8
11
  const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
9
12
  if (!notRoot) {
@@ -13,7 +16,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
13
16
  if (value1 === value2) {
14
17
  return VALUE_UNCHANGED;
15
18
  }
16
- if (isDate(value1) && isDate(value2) && value1.getTime() === value2.getTime()) {
19
+ if ((0, isDate_1.isDate)(value1) && (0, isDate_1.isDate)(value2) && value1.getTime() === value2.getTime()) {
17
20
  return VALUE_UNCHANGED;
18
21
  }
19
22
  if ('undefined' == typeof value1) {
@@ -27,12 +30,12 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
27
30
  if (notRoot === undefined) {
28
31
  notRoot = false;
29
32
  }
30
- let diff = createObject();
31
- if (!isFunction(obj1) && !isFunction(obj2)) {
32
- if (isValue(obj1) || isValue(obj2)) {
33
+ let diff = (0, createObject_1.createObject)();
34
+ if (!(0, isFunction_1.isFunction)(obj1) && !(0, isFunction_1.isFunction)(obj2)) {
35
+ if ((0, isValue_1.isValue)(obj1) || (0, isValue_1.isValue)(obj2)) {
33
36
  let res = _compareValues(obj1, obj2);
34
37
  if (unchanged || res !== VALUE_UNCHANGED) {
35
- let ret = createObject();
38
+ let ret = (0, createObject_1.createObject)();
36
39
  Object.defineProperty(ret, 'type', {
37
40
  value: res,
38
41
  enumerable: false,
@@ -55,7 +58,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
55
58
  }
56
59
  return false;
57
60
  }
58
- if (isDom(obj1) || isDom(obj2)) {
61
+ if ((0, isDom_1.isDom)(obj1) || (0, isDom_1.isDom)(obj2)) {
59
62
  return false;
60
63
  }
61
64
  if (diffObjProcessed.includes(obj1) || diffObjProcessed.includes(obj2)) {
@@ -64,7 +67,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
64
67
  }
65
68
  diffObjProcessed.push(obj1, obj2);
66
69
  for (let key in obj1) {
67
- if (isFunction(obj1[key])) {
70
+ if ((0, isFunction_1.isFunction)(obj1[key])) {
68
71
  continue;
69
72
  }
70
73
  let value2 = undefined;
@@ -77,7 +80,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
77
80
  }
78
81
  }
79
82
  for (let key in obj2) {
80
- if (isFunction(obj2[key]) || 'undefined' != typeof obj1[key]) {
83
+ if ((0, isFunction_1.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
81
84
  continue;
82
85
  }
83
86
  let res = diffObj(undefined, obj2[key], unchanged, true);
@@ -86,6 +89,6 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
86
89
  }
87
90
  }
88
91
  }
89
- return !notRoot || unchanged || numProperties(diff) ? diff : false;
92
+ return !notRoot || unchanged || (0, numProperties_1.numProperties)(diff) ? diff : false;
90
93
  };
91
- export { diffObj };
94
+ exports.diffObj = diffObj;
@@ -1,13 +1,16 @@
1
- import { isString } from './isString';
2
- import { substr } from './substr';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dirName = void 0;
4
+ const isString_1 = require("./isString");
5
+ const substr_1 = require("./substr");
3
6
  const dirName = function (path) {
4
- if (isString(path) && path) {
5
- while (substr(path, path.length - 1) === '/') {
6
- path = substr(path, 0, path.length - 1);
7
+ if ((0, isString_1.isString)(path) && path) {
8
+ while ((0, substr_1.substr)(path, path.length - 1) === '/') {
9
+ path = (0, substr_1.substr)(path, 0, path.length - 1);
7
10
  }
8
11
  let pos = path.lastIndexOf('/');
9
12
  if (pos > 0) {
10
- return substr(path, 0, pos);
13
+ return (0, substr_1.substr)(path, 0, pos);
11
14
  }
12
15
  if (pos === 0) {
13
16
  return '/';
@@ -15,4 +18,4 @@ const dirName = function (path) {
15
18
  }
16
19
  return '';
17
20
  };
18
- export { dirName };
21
+ exports.dirName = dirName;
@@ -1,36 +1,39 @@
1
- import { ajax } from './ajax';
2
- import { substr } from './substr';
3
- import { baseName } from './baseName';
4
- import { isBlob } from './isBlob';
5
- import { fileExt } from './fileExt';
6
- import { downloadContent } from './downloadContent';
7
- import { defaultAjaxErrorFunction } from './defaultAjaxErrorFunction';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.download = void 0;
4
+ const ajax_1 = require("./ajax");
5
+ const substr_1 = require("./substr");
6
+ const baseName_1 = require("./baseName");
7
+ const isBlob_1 = require("./isBlob");
8
+ const fileExt_1 = require("./fileExt");
9
+ const downloadContent_1 = require("./downloadContent");
10
+ const defaultAjaxErrorFunction_1 = require("./defaultAjaxErrorFunction");
8
11
  const download = function (url, filename, params) {
9
12
  // We can intervert the arguments
10
13
  if (filename && (typeof (filename) === 'object')) {
11
14
  params = filename;
12
15
  filename = null;
13
16
  }
14
- return ajax(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
17
+ return (0, ajax_1.ajax)(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
15
18
  if (!filename) {
16
19
  let cd = 'attachment; filename=';
17
20
  if (headers && headers['content-disposition'] && headers['content-disposition'].indexOf(cd) === 0) {
18
- filename = substr(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
21
+ filename = (0, substr_1.substr)(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
19
22
  }
20
23
  else {
21
- filename = baseName(url);
24
+ filename = (0, baseName_1.baseName)(url);
22
25
  }
23
26
  }
24
- if (isBlob(d)) {
25
- let extension = fileExt(filename);
27
+ if ((0, isBlob_1.isBlob)(d)) {
28
+ let extension = (0, fileExt_1.fileExt)(filename);
26
29
  let htmlExtensions = ['php', 'html'];
27
30
  if ((typeof filename === 'string') && ((('type' in d) && (d.type !== 'text/html')) || htmlExtensions.includes(extension))) {
28
- downloadContent(filename, d);
31
+ (0, downloadContent_1.downloadContent)(filename, d);
29
32
  return;
30
33
  }
31
34
  }
32
35
  }, e => {
33
- defaultAjaxErrorFunction(e);
36
+ (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(e);
34
37
  });
35
38
  };
36
- export { download };
39
+ exports.download = download;
@@ -1,9 +1,12 @@
1
- import { isCanvas } from './isCanvas';
2
- import { isObject } from './isObject';
3
- import { isString } from './isString';
4
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadContent = void 0;
4
+ const isCanvas_1 = require("./isCanvas");
5
+ const isObject_1 = require("./isObject");
6
+ const isString_1 = require("./isString");
7
+ const log_1 = require("./log");
5
8
  const downloadContent = function (filename, content, type) {
6
- if (isCanvas(content)) {
9
+ if ((0, isCanvas_1.isCanvas)(content)) {
7
10
  content.toBlob((blob) => {
8
11
  // blob ready, download it
9
12
  let a = document.createElement('a');
@@ -17,7 +20,7 @@ const downloadContent = function (filename, content, type) {
17
20
  return;
18
21
  }
19
22
  if (!type) {
20
- type = isObject(content) && content.type ? content.type : 'octet/stream';
23
+ type = (0, isObject_1.isObject)(content) && content.type ? content.type : 'octet/stream';
21
24
  }
22
25
  else if (type.indexOf('/') === -1) {
23
26
  type = 'text/' + type;
@@ -25,7 +28,7 @@ const downloadContent = function (filename, content, type) {
25
28
  let a = window.document.createElement('a');
26
29
  a.className = 'bbn-no';
27
30
  let src = null;
28
- if (isString(content)) {
31
+ if ((0, isString_1.isString)(content)) {
29
32
  src = new Blob([content], { type: type });
30
33
  }
31
34
  else {
@@ -33,7 +36,7 @@ const downloadContent = function (filename, content, type) {
33
36
  src = content;
34
37
  }
35
38
  catch (e) {
36
- log(e);
39
+ (0, log_1.log)(e);
37
40
  }
38
41
  }
39
42
  a.href = window.URL.createObjectURL(src);
@@ -45,4 +48,4 @@ const downloadContent = function (filename, content, type) {
45
48
  // Remove anchor from body
46
49
  document.body.removeChild(a);
47
50
  };
48
- export { downloadContent };
51
+ exports.downloadContent = downloadContent;
package/dist/fn/each.js CHANGED
@@ -1,8 +1,11 @@
1
- import { isNumber } from './isNumber';
2
- import { isIterable } from './isIterable';
3
- import { iterate } from './iterate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.each = void 0;
4
+ const isNumber_1 = require("./isNumber");
5
+ const isIterable_1 = require("./isIterable");
6
+ const iterate_1 = require("./iterate");
4
7
  const each = function (arr, fn) {
5
- if (isNumber(arr) && arr > 0) {
8
+ if ((0, isNumber_1.isNumber)(arr) && arr > 0) {
6
9
  for (let i = 0; i < arr; i++) {
7
10
  if (fn(i, i) === false) {
8
11
  return;
@@ -10,7 +13,7 @@ const each = function (arr, fn) {
10
13
  }
11
14
  return;
12
15
  }
13
- if (isIterable(arr)) {
16
+ if ((0, isIterable_1.isIterable)(arr)) {
14
17
  for (let i = 0; i < arr.length; i++) {
15
18
  if (fn(arr[i], i) === false) {
16
19
  return;
@@ -18,6 +21,6 @@ const each = function (arr, fn) {
18
21
  }
19
22
  return arr;
20
23
  }
21
- return iterate(arr, fn);
24
+ return (0, iterate_1.iterate)(arr, fn);
22
25
  };
23
- export { each };
26
+ exports.each = each;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eraseCookie = void 0;
1
4
  const eraseCookie = function (name) {
2
5
  document.cookie = name + '=; Max-Age=-99999999;';
3
6
  };
4
- export { eraseCookie };
7
+ exports.eraseCookie = eraseCookie;
package/dist/fn/error.js CHANGED
@@ -1,4 +1,7 @@
1
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.error = void 0;
4
+ const log_1 = require("./log");
2
5
  const error = function (errorMsg) {
3
6
  if (arguments.length > 1) {
4
7
  const args = [];
@@ -10,8 +13,8 @@ const error = function (errorMsg) {
10
13
  _bbn_console_level: 1,
11
14
  _bbn_console_style: 'color: #E64141; background: #F7E195; font-size: 14px',
12
15
  });
13
- log.apply(this, args);
16
+ log_1.log.apply(this, args);
14
17
  }
15
18
  throw new Error(errorMsg);
16
19
  };
17
- export { error };
20
+ exports.error = error;
@@ -1,8 +1,11 @@
1
- import { isString } from './isString';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeDquotes = void 0;
4
+ const isString_1 = require("./isString");
2
5
  const escapeDquotes = function (str) {
3
- if (!isString(str)) {
6
+ if (!(0, isString_1.isString)(str)) {
4
7
  return str;
5
8
  }
6
9
  return str.replace(/"/g, '\\"');
7
10
  };
8
- export { escapeDquotes };
11
+ exports.escapeDquotes = escapeDquotes;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeRegExp = void 0;
1
4
  const escapeRegExp = function (str) {
2
5
  return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
3
6
  };
4
- export { escapeRegExp };
7
+ exports.escapeRegExp = escapeRegExp;
@@ -1,8 +1,11 @@
1
- import { isString } from './isString';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeSquotes = void 0;
4
+ const isString_1 = require("./isString");
2
5
  const escapeSquotes = function (str) {
3
- if (!isString(str)) {
6
+ if (!(0, isString_1.isString)(str)) {
4
7
  return str;
5
8
  }
6
9
  return str.replace(/'/g, "\\'");
7
10
  };
8
- export { escapeSquotes };
11
+ exports.escapeSquotes = escapeSquotes;
@@ -1,8 +1,11 @@
1
- import { isString } from './isString';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeTicks = void 0;
4
+ const isString_1 = require("./isString");
2
5
  const escapeTicks = function (str) {
3
- if (!isString(str)) {
6
+ if (!(0, isString_1.isString)(str)) {
4
7
  return str;
5
8
  }
6
9
  return str.replace(/`/g, '\\`');
7
10
  };
8
- export { escapeTicks };
11
+ exports.escapeTicks = escapeTicks;
@@ -1,7 +1,10 @@
1
- import { each } from './each';
2
- import { dirName } from './dirName';
3
- import { baseName } from './baseName';
4
- import { isString } from './isString';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeUrl = void 0;
4
+ const each_1 = require("./each");
5
+ const dirName_1 = require("./dirName");
6
+ const baseName_1 = require("./baseName");
7
+ const isString_1 = require("./isString");
5
8
  const escapeUrl = function (url, params) {
6
9
  let st = '';
7
10
  if (url.match('^(http|https)://')) {
@@ -14,10 +17,10 @@ const escapeUrl = function (url, params) {
14
17
  st += '://';
15
18
  url = url.substring(3);
16
19
  }
17
- each(dirName(url).split('/'), (a) => {
20
+ (0, each_1.each)((0, dirName_1.dirName)(url).split('/'), (a) => {
18
21
  st += encodeURIComponent(a) + '/';
19
22
  });
20
- let base = baseName(url);
23
+ let base = (0, baseName_1.baseName)(url);
21
24
  let sep = '?';
22
25
  let existingParams = '';
23
26
  if (base.indexOf(sep)) {
@@ -26,7 +29,7 @@ const escapeUrl = function (url, params) {
26
29
  existingParams = '?' + tmp[1];
27
30
  base = tmp[0];
28
31
  }
29
- if (params && isString(params)) {
32
+ if (params && (0, isString_1.isString)(params)) {
30
33
  if (params.match('^(\\&|\\?)')) {
31
34
  params = params.substring(1);
32
35
  }
@@ -37,4 +40,4 @@ const escapeUrl = function (url, params) {
37
40
  }
38
41
  return st + encodeURIComponent(base) + existingParams + params;
39
42
  };
40
- export { escapeUrl };
43
+ exports.escapeUrl = escapeUrl;
package/dist/fn/extend.js CHANGED
@@ -1,7 +1,10 @@
1
- import { iterate } from './iterate';
2
- import { isArray } from './isArray';
3
- import { each } from './each';
4
- import { isObject } from './isObject';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extend = void 0;
4
+ const iterate_1 = require("./iterate");
5
+ const isArray_1 = require("./isArray");
6
+ const each_1 = require("./each");
7
+ const isObject_1 = require("./isObject");
5
8
  const extend = function (...originalArgs) {
6
9
  let deep = false;
7
10
  let args = [];
@@ -24,19 +27,19 @@ const extend = function (...originalArgs) {
24
27
  }
25
28
  let out = args[0];
26
29
  for (let i = 1; i < args.length; i++) {
27
- iterate(args[i], (a, key) => {
30
+ (0, iterate_1.iterate)(args[i], (a, key) => {
28
31
  if (deep) {
29
- if (isArray(a)) {
30
- out[key] = isArray(out[key]) ? out[key] : [];
31
- each(a, (b, i) => {
32
+ if ((0, isArray_1.isArray)(a)) {
33
+ out[key] = (0, isArray_1.isArray)(out[key]) ? out[key] : [];
34
+ (0, each_1.each)(a, (b, i) => {
32
35
  if (b && typeof b === 'object') {
33
36
  let tmp = out[key][i];
34
- if (isArray(b)) {
35
- if (!isArray(tmp)) {
37
+ if ((0, isArray_1.isArray)(b)) {
38
+ if (!(0, isArray_1.isArray)(tmp)) {
36
39
  tmp = [];
37
40
  }
38
41
  }
39
- else if (!isObject(tmp)) {
42
+ else if (!(0, isObject_1.isObject)(tmp)) {
40
43
  tmp = {};
41
44
  }
42
45
  out[key][i] = extend(true, tmp, b);
@@ -46,7 +49,7 @@ const extend = function (...originalArgs) {
46
49
  }
47
50
  });
48
51
  }
49
- else if (isObject(a)) {
52
+ else if ((0, isObject_1.isObject)(a)) {
50
53
  out[key] = extend(true, out[key] && typeof out[key] === 'object' ? out[key] : Object.create(Object.getPrototypeOf(a)), a);
51
54
  }
52
55
  else {
@@ -68,4 +71,4 @@ const extend = function (...originalArgs) {
68
71
  }
69
72
  return out;
70
73
  };
71
- export { extend };
74
+ exports.extend = extend;
@@ -1,8 +1,11 @@
1
- import { isObject } from './isObject';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extendOut = void 0;
4
+ const isObject_1 = require("./isObject");
2
5
  const extendOut = function (...args) {
3
6
  let r = null;
4
7
  for (let a of args) {
5
- if (!isObject(a)) {
8
+ if (!(0, isObject_1.isObject)(a)) {
6
9
  throw new Error('Each argument for extendOut must be an object, ' + typeof a + ' given');
7
10
  }
8
11
  if (r === null) {
@@ -10,7 +13,7 @@ const extendOut = function (...args) {
10
13
  }
11
14
  else {
12
15
  for (let n in a) {
13
- if (isObject(r[n], a[n])) {
16
+ if ((0, isObject_1.isObject)(r[n], a[n])) {
14
17
  extendOut(r[n], a[n]);
15
18
  }
16
19
  else if (r[n] === undefined) {
@@ -21,4 +24,4 @@ const extendOut = function (...args) {
21
24
  }
22
25
  return r;
23
26
  };
24
- export { extendOut };
27
+ exports.extendOut = extendOut;
package/dist/fn/fdate.js CHANGED
@@ -1,19 +1,26 @@
1
- import { fdatetime } from './fdatetime';
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.fdate = void 0;
7
+ const fdatetime_1 = require("./fdatetime");
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"));
5
12
  const fdate = function (d, wrong_result) {
6
13
  // Retro compatibility
7
14
  if (wrong_result === true) {
8
- return fdatetime(d);
15
+ return (0, fdatetime_1.fdatetime)(d);
9
16
  }
10
- let r = date(d);
11
- if (!isDate(r)) {
12
- return wrong_result && isString(wrong_result) ? wrong_result : '';
17
+ let r = (0, date_1.date)(d);
18
+ if (!(0, isDate_1.isDate)(r)) {
19
+ return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
13
20
  }
14
- if (undefined !== dayjs) {
15
- return dayjs(r).format('L');
21
+ if (undefined !== dayjs_1.default) {
22
+ return (0, dayjs_1.default)(r).format('L');
16
23
  }
17
24
  return r.toLocaleDateString();
18
25
  };
19
- export { fdate };
26
+ exports.fdate = fdate;
@@ -1,14 +1,21 @@
1
- import { date } from './date';
2
- import { isDate } from './isDate';
3
- 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.fdatetime = void 0;
7
+ const date_1 = require("./date");
8
+ const isDate_1 = require("./isDate");
9
+ const isString_1 = require("./isString");
10
+ const dayjs_1 = __importDefault(require("dayjs"));
4
11
  const fdatetime = function (d, wrong_result) {
5
- let r = date(d);
6
- if (!isDate(r)) {
7
- return wrong_result && isString(wrong_result) ? wrong_result : '';
12
+ let r = (0, date_1.date)(d);
13
+ if (!(0, isDate_1.isDate)(r)) {
14
+ return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
8
15
  }
9
- if (undefined !== dayjs) {
16
+ if (undefined !== dayjs_1.default) {
10
17
  //return dayjs(r).format('lll');
11
- return dayjs(r).calendar(null, {
18
+ return (0, dayjs_1.default)(r).calendar(null, {
12
19
  sameDay: '[' + bbn._('Today') + '] HH:mm',
13
20
  nextDay: '[' + bbn._('Tomorrow') + '] HH:mm',
14
21
  nextWeek: 'ddd D HH:mm',
@@ -20,4 +27,4 @@ const fdatetime = function (d, wrong_result) {
20
27
  }
21
28
  return r.toLocaleDateString();
22
29
  };
23
- export { fdatetime };
30
+ exports.fdatetime = fdatetime;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fieldValue = void 0;
1
4
  const fieldValue = function (field) {
2
5
  let v;
3
6
  if (field.type === 'checkbox') {
@@ -21,4 +24,4 @@ const fieldValue = function (field) {
21
24
  }
22
25
  return v;
23
26
  };
24
- export { fieldValue };
27
+ exports.fieldValue = fieldValue;
@@ -1,6 +1,9 @@
1
- import { isString } from './isString';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fileExt = void 0;
4
+ const isString_1 = require("./isString");
2
5
  const fileExt = function (filename) {
3
- if (filename && isString(filename)) {
6
+ if (filename && (0, isString_1.isString)(filename)) {
4
7
  let bits = filename.split('.');
5
8
  if (bits[0] && bits.length > 1) {
6
9
  return bits[bits.length - 1].toLowerCase();
@@ -8,4 +11,4 @@ const fileExt = function (filename) {
8
11
  }
9
12
  return '';
10
13
  };
11
- export { fileExt };
14
+ exports.fileExt = fileExt;
package/dist/fn/filter.js CHANGED
@@ -1,15 +1,18 @@
1
- import { isArray } from './isArray';
2
- import { isFunction } from './isFunction';
3
- import { each } from './each';
4
- import { filterToConditions } from './filterToConditions';
5
- import { compareConditions } from './compareConditions';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filter = void 0;
4
+ const isArray_1 = require("./isArray");
5
+ const isFunction_1 = require("./isFunction");
6
+ const each_1 = require("./each");
7
+ const filterToConditions_1 = require("./filterToConditions");
8
+ const compareConditions_1 = require("./compareConditions");
6
9
  const filter = function (arr, prop, val = null, operator = '=') {
7
- if (!isArray(arr)) {
10
+ if (!(0, isArray_1.isArray)(arr)) {
8
11
  throw new Error('Error in filter: The first argument must be an array');
9
12
  }
10
13
  let cfg = {};
11
14
  const res = [];
12
- const isFn = isFunction(prop);
15
+ const isFn = (0, isFunction_1.isFunction)(prop);
13
16
  if (!prop || !arr.length) {
14
17
  return arr;
15
18
  }
@@ -25,17 +28,17 @@ const filter = function (arr, prop, val = null, operator = '=') {
25
28
  throw new Error('Search function error: The prop argument should be a string or an object');
26
29
  }
27
30
  if (isFn) {
28
- each(arr, (a, i) => {
31
+ (0, each_1.each)(arr, (a, i) => {
29
32
  if (filter(a, prop)) {
30
33
  res.push(a);
31
34
  }
32
35
  });
33
36
  }
34
37
  else {
35
- cfg = filterToConditions(cfg, operator);
38
+ cfg = (0, filterToConditions_1.filterToConditions)(cfg, operator);
36
39
  if (cfg.conditions && cfg.logic) {
37
- each(arr, (a) => {
38
- if (compareConditions(a, filter)) {
40
+ (0, each_1.each)(arr, (a) => {
41
+ if ((0, compareConditions_1.compareConditions)(a, filter)) {
39
42
  res.push(a);
40
43
  }
41
44
  });
@@ -44,4 +47,4 @@ const filter = function (arr, prop, val = null, operator = '=') {
44
47
  return res;
45
48
  }
46
49
  };
47
- export { filter };
50
+ exports.filter = filter;