@bbn/bbn 1.0.118 → 1.0.120

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 (244) hide show
  1. package/dist/$.js +1 -1
  2. package/dist/_.js +11 -7
  3. package/dist/bundle-webpack.js +17 -13549
  4. package/dist/bundle-webpack.js.map +1 -1
  5. package/dist/db.js +82 -81
  6. package/dist/env.js +1 -1
  7. package/dist/fn/ajax/_addLoader.js +6 -6
  8. package/dist/fn/ajax/_deleteLoader.js +16 -14
  9. package/dist/fn/ajax/abort.js +3 -3
  10. package/dist/fn/ajax/abortURL.js +4 -4
  11. package/dist/fn/ajax/ajax.js +36 -31
  12. package/dist/fn/ajax/callback.js +14 -10
  13. package/dist/fn/ajax/download.js +15 -13
  14. package/dist/fn/ajax/downloadContent.js +10 -9
  15. package/dist/fn/ajax/getLoader.js +3 -3
  16. package/dist/fn/ajax/getRequestId.js +5 -5
  17. package/dist/fn/ajax/link.js +20 -16
  18. package/dist/fn/ajax/post.js +10 -6
  19. package/dist/fn/ajax/postOut.js +7 -5
  20. package/dist/fn/ajax/setNavigationVars.js +11 -9
  21. package/dist/fn/ajax/treatAjaxArguments.js +8 -8
  22. package/dist/fn/ajax/upload.js +11 -8
  23. package/dist/fn/browser/copy.js +10 -8
  24. package/dist/fn/browser/eraseCookie.js +1 -1
  25. package/dist/fn/browser/error.js +4 -4
  26. package/dist/fn/browser/getBrowserName.js +2 -2
  27. package/dist/fn/browser/getBrowserVersion.js +2 -2
  28. package/dist/fn/browser/getCookie.js +6 -6
  29. package/dist/fn/browser/getDeviceType.js +2 -2
  30. package/dist/fn/browser/getEventData.js +33 -33
  31. package/dist/fn/browser/happy.js +6 -2
  32. package/dist/fn/browser/history.js +1 -1
  33. package/dist/fn/browser/info.js +6 -2
  34. package/dist/fn/browser/isActiveInterface.js +3 -2
  35. package/dist/fn/browser/isDesktopDevice.js +2 -2
  36. package/dist/fn/browser/isFocused.js +2 -1
  37. package/dist/fn/browser/isMobile.js +3 -3
  38. package/dist/fn/browser/isMobileDevice.js +2 -2
  39. package/dist/fn/browser/isTabletDevice.js +2 -2
  40. package/dist/fn/browser/log.js +13 -9
  41. package/dist/fn/browser/replaceSelection.js +6 -6
  42. package/dist/fn/browser/selectElementText.js +5 -4
  43. package/dist/fn/browser/setCookie.js +4 -4
  44. package/dist/fn/browser/toggleFullScreen.js +2 -2
  45. package/dist/fn/browser/warning.js +4 -4
  46. package/dist/fn/convert/arrayBuffer2String.js +1 -1
  47. package/dist/fn/convert/canvasToImage.js +2 -2
  48. package/dist/fn/convert/colorToHex.js +2 -2
  49. package/dist/fn/convert/fromXml.js +14 -8
  50. package/dist/fn/convert/hex2rgb.js +1 -1
  51. package/dist/fn/convert/imageToCanvas.js +2 -2
  52. package/dist/fn/convert/imgToBase64.js +4 -3
  53. package/dist/fn/convert/rgb2hex.js +1 -1
  54. package/dist/fn/convert/string2ArrayBuffer.js +1 -1
  55. package/dist/fn/convert/toCSV.js +13 -10
  56. package/dist/fn/datetime/calendar.js +11 -10
  57. package/dist/fn/datetime/chrono.js +9 -9
  58. package/dist/fn/datetime/date.js +5 -5
  59. package/dist/fn/datetime/dateSQL.d.ts +1 -1
  60. package/dist/fn/datetime/dateSQL.js +4 -4
  61. package/dist/fn/datetime/daysInMonth.js +3 -3
  62. package/dist/fn/datetime/fdate.js +7 -6
  63. package/dist/fn/datetime/fdatetime.js +6 -5
  64. package/dist/fn/datetime/formatDate.js +1 -1
  65. package/dist/fn/datetime/ftime.js +5 -5
  66. package/dist/fn/datetime/getDay.js +5 -5
  67. package/dist/fn/datetime/timestamp.js +3 -2
  68. package/dist/fn/default/defaultAjaxAbortFunction.js +3 -2
  69. package/dist/fn/default/defaultAjaxErrorFunction.js +4 -2
  70. package/dist/fn/default/defaultAlertFunction.js +2 -1
  71. package/dist/fn/default/defaultConfirmFunction.js +4 -3
  72. package/dist/fn/default/defaultEndLoadingFunction.js +3 -1
  73. package/dist/fn/default/defaultErrorFunction.js +2 -2
  74. package/dist/fn/default/defaultHistoryFunction.js +1 -1
  75. package/dist/fn/default/defaultLinkFunction.js +1 -1
  76. package/dist/fn/default/defaultPostLinkFunction.js +2 -1
  77. package/dist/fn/default/defaultPreLinkFunction.js +4 -2
  78. package/dist/fn/default/defaultResizeFunction.js +1 -1
  79. package/dist/fn/default/defaultStartLoadingFunction.js +3 -1
  80. package/dist/fn/form/addInputs.js +13 -11
  81. package/dist/fn/form/fieldValue.js +2 -2
  82. package/dist/fn/form/formdata.js +29 -29
  83. package/dist/fn/form/objectToFormData.js +13 -10
  84. package/dist/fn/form/submit.js +5 -5
  85. package/dist/fn/html/adjustHeight.js +4 -4
  86. package/dist/fn/html/adjustSize.js +7 -7
  87. package/dist/fn/html/adjustWidth.js +4 -4
  88. package/dist/fn/html/getAllTags.js +3 -3
  89. package/dist/fn/html/getAncestors.js +3 -2
  90. package/dist/fn/html/getAttributes.js +4 -4
  91. package/dist/fn/html/getHTMLOfSelection.js +6 -6
  92. package/dist/fn/html/getHtml.js +4 -3
  93. package/dist/fn/html/getPath.js +24 -17
  94. package/dist/fn/html/getText.js +1 -1
  95. package/dist/fn/html/html2text.js +2 -2
  96. package/dist/fn/html/isInside.js +9 -9
  97. package/dist/fn/html/makeReactive.js +35 -31
  98. package/dist/fn/html/selector.js +1 -1
  99. package/dist/fn/init.js +28 -28
  100. package/dist/fn/loop/each.js +6 -6
  101. package/dist/fn/loop/fori.js +7 -5
  102. package/dist/fn/loop/forir.js +7 -5
  103. package/dist/fn/loop/iterate.js +7 -4
  104. package/dist/fn/loop/riterate.js +3 -2
  105. package/dist/fn/misc/analyzeFunction.d.ts +1 -1
  106. package/dist/fn/misc/analyzeFunction.js +31 -31
  107. package/dist/fn/misc/getTimeoff.js +1 -1
  108. package/dist/fn/misc/money.js +6 -6
  109. package/dist/fn/misc/percent.js +1 -1
  110. package/dist/fn/misc/randomInt.js +1 -1
  111. package/dist/fn/misc/roundDecimal.js +1 -1
  112. package/dist/fn/misc/translate.js +4 -4
  113. package/dist/fn/object/_compareValues.js +7 -6
  114. package/dist/fn/object/arrayFromProp.js +5 -5
  115. package/dist/fn/object/autoExtend.js +2 -2
  116. package/dist/fn/object/checkProps.js +3 -2
  117. package/dist/fn/object/checkPropsDetails.js +13 -12
  118. package/dist/fn/object/checkPropsOrDie.js +4 -3
  119. package/dist/fn/object/circularReplacer.js +6 -6
  120. package/dist/fn/object/clone.js +6 -6
  121. package/dist/fn/object/compare.js +6 -6
  122. package/dist/fn/object/compareConditions.js +11 -11
  123. package/dist/fn/object/count.js +4 -2
  124. package/dist/fn/object/createObject.js +17 -4
  125. package/dist/fn/object/deepPath.js +10 -9
  126. package/dist/fn/object/deleteProp.js +2 -2
  127. package/dist/fn/object/diffObj.js +19 -17
  128. package/dist/fn/object/extend.js +17 -13
  129. package/dist/fn/object/extendOut.js +10 -5
  130. package/dist/fn/object/filter.d.ts +1 -1
  131. package/dist/fn/object/filter.js +12 -10
  132. package/dist/fn/object/filterToConditions.js +10 -9
  133. package/dist/fn/object/findAll.js +8 -7
  134. package/dist/fn/object/getField.js +6 -3
  135. package/dist/fn/object/getFieldValues.js +6 -6
  136. package/dist/fn/object/getProp.js +2 -2
  137. package/dist/fn/object/getProperty.js +2 -2
  138. package/dist/fn/object/getRow.js +4 -2
  139. package/dist/fn/object/map.js +4 -3
  140. package/dist/fn/object/move.js +2 -2
  141. package/dist/fn/object/multiorder.js +8 -7
  142. package/dist/fn/object/numProperties.js +1 -1
  143. package/dist/fn/object/order.js +3 -2
  144. package/dist/fn/object/pickValue.js +1 -1
  145. package/dist/fn/object/removeEmpty.js +6 -6
  146. package/dist/fn/object/removePrivateProp.js +4 -3
  147. package/dist/fn/object/search.d.ts +1 -1
  148. package/dist/fn/object/search.js +15 -12
  149. package/dist/fn/object/setProp.js +3 -1
  150. package/dist/fn/object/setProperty.js +10 -10
  151. package/dist/fn/object/shortenObj.js +8 -7
  152. package/dist/fn/object/shuffle.js +4 -3
  153. package/dist/fn/object/sum.js +6 -6
  154. package/dist/fn/object/unique.js +1 -1
  155. package/dist/fn/string/baseName.js +6 -6
  156. package/dist/fn/string/br2nl.js +2 -2
  157. package/dist/fn/string/camelToCss.js +1 -1
  158. package/dist/fn/string/camelize.js +1 -1
  159. package/dist/fn/string/correctCase.js +2 -2
  160. package/dist/fn/string/crc32.js +8 -8
  161. package/dist/fn/string/dirName.js +4 -4
  162. package/dist/fn/string/escapeDquotes.js +2 -2
  163. package/dist/fn/string/escapeRegExp.js +1 -1
  164. package/dist/fn/string/escapeSquotes.js +2 -2
  165. package/dist/fn/string/escapeTicks.js +2 -2
  166. package/dist/fn/string/escapeUrl.js +11 -11
  167. package/dist/fn/string/fileExt.js +3 -3
  168. package/dist/fn/string/format.js +6 -6
  169. package/dist/fn/string/formatBytes.js +3 -2
  170. package/dist/fn/string/formatSize.js +3 -3
  171. package/dist/fn/string/hash.js +9 -9
  172. package/dist/fn/string/md5.js +1 -1
  173. package/dist/fn/string/nl2br.js +2 -2
  174. package/dist/fn/string/printf.js +1 -1
  175. package/dist/fn/string/quotes2html.js +2 -2
  176. package/dist/fn/string/randomString.js +7 -7
  177. package/dist/fn/string/removeAccents.js +3 -3
  178. package/dist/fn/string/removeExtraSpaces.js +1 -1
  179. package/dist/fn/string/removeHtmlComments.js +2 -2
  180. package/dist/fn/string/removeTrailingChars.js +2 -2
  181. package/dist/fn/string/repeat.js +1 -1
  182. package/dist/fn/string/replaceAll.js +4 -3
  183. package/dist/fn/string/sanitize.js +9 -8
  184. package/dist/fn/string/shorten.js +3 -3
  185. package/dist/fn/string/simpleHash.js +5 -5
  186. package/dist/fn/string/simpleHash1.js +4 -4
  187. package/dist/fn/string/simpleHash2.js +4 -4
  188. package/dist/fn/string/substr.js +4 -4
  189. package/dist/fn/string/trim.js +3 -2
  190. package/dist/fn/string/uniqString.js +17 -10
  191. package/dist/fn/style/addColors.js +17 -17
  192. package/dist/fn/style/addStyle.js +4 -4
  193. package/dist/fn/style/animateCss.js +4 -4
  194. package/dist/fn/style/center.js +2 -2
  195. package/dist/fn/style/cssExists.js +8 -8
  196. package/dist/fn/style/getCssVar.js +1 -1
  197. package/dist/fn/style/getScrollBarSize.js +6 -6
  198. package/dist/fn/style/lightenDarkenHex.js +3 -3
  199. package/dist/fn/style/outerHeight.js +4 -4
  200. package/dist/fn/style/outerWidth.js +4 -4
  201. package/dist/fn/style/resize.js +17 -17
  202. package/dist/fn/style/setCssVar.js +1 -1
  203. package/dist/fn/type/checkType.js +16 -12
  204. package/dist/fn/type/isArray.js +7 -2
  205. package/dist/fn/type/isBlob.js +7 -2
  206. package/dist/fn/type/isBoolean.js +7 -2
  207. package/dist/fn/type/isCanvas.js +7 -2
  208. package/dist/fn/type/isColor.js +8 -3
  209. package/dist/fn/type/isComment.js +7 -2
  210. package/dist/fn/type/isCp.js +9 -4
  211. package/dist/fn/type/isDate.js +7 -2
  212. package/dist/fn/type/isDimension.js +8 -3
  213. package/dist/fn/type/isDom.js +7 -2
  214. package/dist/fn/type/isEmail.js +9 -4
  215. package/dist/fn/type/isEmpty.js +3 -3
  216. package/dist/fn/type/isEvent.js +7 -2
  217. package/dist/fn/type/isFunction.js +7 -2
  218. package/dist/fn/type/isHostname.js +9 -4
  219. package/dist/fn/type/isIP.js +8 -3
  220. package/dist/fn/type/isInt.js +7 -2
  221. package/dist/fn/type/isIterable.js +7 -2
  222. package/dist/fn/type/isNull.js +7 -2
  223. package/dist/fn/type/isNumber.js +7 -2
  224. package/dist/fn/type/isObject.js +7 -2
  225. package/dist/fn/type/isPercent.js +7 -2
  226. package/dist/fn/type/isPrimitive.js +7 -2
  227. package/dist/fn/type/isPromise.js +7 -2
  228. package/dist/fn/type/isPropSize.js +4 -4
  229. package/dist/fn/type/isSQLDate.js +7 -2
  230. package/dist/fn/type/isSame.js +9 -9
  231. package/dist/fn/type/isString.js +7 -2
  232. package/dist/fn/type/isSymbol.js +7 -2
  233. package/dist/fn/type/isURL.js +7 -2
  234. package/dist/fn/type/isValidDimension.js +5 -5
  235. package/dist/fn/type/isValidName.js +8 -3
  236. package/dist/fn/type/isValue.js +8 -3
  237. package/dist/fn/type/isVue.js +11 -4
  238. package/dist/fn.d.ts +5 -5
  239. package/dist/fn.js +456 -456
  240. package/dist/index.d.ts +7 -7
  241. package/dist/index.js +1922 -1604
  242. package/dist/lng.js +1 -1
  243. package/dist/vars.js +1 -1
  244. package/package.json +7 -6
@@ -1,14 +1,14 @@
1
- import { log } from '../browser/log';
2
- import { createObject } from '../object/createObject';
3
- import { isSymbol } from '../type/isSymbol';
4
- import { isNumber } from '../type/isNumber';
5
- import { isArray } from '../type/isArray';
6
- import { warning } from '../browser/warning';
7
- import { isFunction } from '../type/isFunction';
8
- import { isSame } from '../type/isSame';
9
- const makeReactive = function (obj, onSet, parent, parentProp) {
10
- const parentString = (parent === null || parent === void 0 ? void 0 : parent.$cid) || '';
11
- const prefix = '__bbn_' + (parentString ? parentString + '_' : '');
1
+ import { log } from '../browser/log.js';
2
+ import { createObject } from '../object/createObject.js';
3
+ import { isSymbol } from '../type/isSymbol.js';
4
+ import { isNumber } from '../type/isNumber.js';
5
+ import { isArray } from '../type/isArray.js';
6
+ import { warning } from '../browser/warning.js';
7
+ import { isFunction } from '../type/isFunction.js';
8
+ import { isSame } from '../type/isSame.js';
9
+ var makeReactive = function (obj, onSet, parent, parentProp) {
10
+ var parentString = (parent === null || parent === void 0 ? void 0 : parent.$cid) || '';
11
+ var prefix = '__bbn_' + (parentString ? parentString + '_' : '');
12
12
  if (obj && typeof obj === 'object' && [undefined, Object, Array].includes(obj.constructor)) {
13
13
  if (obj.__bbnIsProxy && obj.__bbnParent === parent) {
14
14
  return obj;
@@ -24,19 +24,23 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
24
24
  enumerable: false,
25
25
  });
26
26
  }
27
- const handler = {
28
- get(target, key) {
29
- const realValue = Reflect.get(target, key);
30
- const realTarget = target.__bbnRoot || target;
27
+ var handler = {
28
+ get: function (target, key) {
29
+ var realValue = Reflect.get(target, key);
30
+ var realTarget = target.__bbnRoot || target;
31
31
  if (isSymbol(key)) {
32
32
  return Reflect.get(realTarget, key);
33
33
  }
34
- const propName = parentProp ? parentProp + '.' + key : key;
35
- const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
34
+ var propName = parentProp ? parentProp + '.' + key : key;
35
+ var hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
36
36
  if (['fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].includes(key) &&
37
37
  isArray(target)) {
38
- return function (...args) {
39
- let res = realTarget[key](...args);
38
+ return function () {
39
+ var args = [];
40
+ for (var _i = 0; _i < arguments.length; _i++) {
41
+ args[_i] = arguments[_i];
42
+ }
43
+ var res = realTarget[key].apply(realTarget, args);
40
44
  warning('DOING ARRAY STUFF');
41
45
  log(target.__bbnParent);
42
46
  onSet(target, 'length', parent);
@@ -47,7 +51,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
47
51
  return realValue;
48
52
  }
49
53
  if (key === '__bbnRoot') {
50
- let root = obj;
54
+ var root = obj;
51
55
  while (root && (root === null || root === void 0 ? void 0 : root.__bbnTarget)) {
52
56
  root = root.__bbnTarget;
53
57
  }
@@ -95,12 +99,12 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
95
99
  }
96
100
  return realValue;
97
101
  },
98
- set(target, key, value) {
102
+ set: function (target, key, value) {
99
103
  if (isSymbol(key)) {
100
104
  return Reflect.get(target, key, value);
101
105
  }
102
- const realTarget = target.__bbnRoot || target;
103
- const propName = parentProp ? parentProp + '.' + key : key;
106
+ var realTarget = target.__bbnRoot || target;
107
+ var propName = parentProp ? parentProp + '.' + key : key;
104
108
  if (isSymbol(key)) {
105
109
  return Reflect.get(target, key);
106
110
  }
@@ -120,7 +124,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
120
124
  if (value &&
121
125
  typeof value === 'object' &&
122
126
  [undefined, Object, Array].includes(value.constructor)) {
123
- const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
127
+ var hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
124
128
  Reflect.defineProperty(realTarget, hiddenKey, {
125
129
  value: makeReactive(value, onSet, parent, propName),
126
130
  writable: true,
@@ -147,14 +151,14 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
147
151
  }
148
152
  return true;
149
153
  },
150
- defineProperty(target, key, description) {
151
- const realTarget = target;
152
- const propName = parentProp ? parentProp + '.' + key : key;
154
+ defineProperty: function (target, key, description) {
155
+ var realTarget = target;
156
+ var propName = parentProp ? parentProp + '.' + key : key;
153
157
  if (key === '__bbnWatchers' || isSymbol(key) || key.indexOf('__bbn_') === 0) {
154
158
  Reflect.defineProperty(realTarget, key, description);
155
159
  }
156
160
  else {
157
- const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
161
+ var hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
158
162
  Reflect.defineProperty(realTarget, hiddenKey, {
159
163
  value: makeReactive(description.value, onSet, parent, propName),
160
164
  writable: true,
@@ -165,13 +169,13 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
165
169
  onSet(target, key, parent);
166
170
  return true;
167
171
  },
168
- deleteProperty(target, key) {
169
- const realTarget = target;
172
+ deleteProperty: function (target, key) {
173
+ var realTarget = target;
170
174
  if (key.indexOf('__bbn_') === 0) {
171
175
  Reflect.deleteProperty(realTarget, key);
172
176
  }
173
177
  else {
174
- const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
178
+ var hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
175
179
  Reflect.deleteProperty(realTarget, hiddenKey);
176
180
  Reflect.deleteProperty(target, key);
177
181
  }
@@ -6,7 +6,7 @@
6
6
  * @memberof bbn.fn
7
7
  * @returns {HTMLElement | undefined}
8
8
  */
9
- const selector = function (ele) {
9
+ var selector = function (ele) {
10
10
  return typeof ele === "string" ? document.querySelector(ele) : ele;
11
11
  };
12
12
  export { selector };
package/dist/fn/init.js CHANGED
@@ -1,14 +1,14 @@
1
- import { substr } from './string/substr';
2
- import { each } from './loop/each';
3
- import { extend } from './object/extend';
4
- import { addColors } from './style/addColors';
5
- import { link } from './ajax/link';
6
- import { submit } from './form/submit';
7
- import { resize } from './style/resize';
8
- import { isMobile } from './browser/isMobile';
9
- import { isTabletDevice } from './browser/isTabletDevice';
10
- import { isFunction } from './type/isFunction';
11
- import { log } from './browser/log';
1
+ import { substr } from './string/substr.js';
2
+ import { each } from './loop/each.js';
3
+ import { extend } from './object/extend.js';
4
+ import { addColors } from './style/addColors.js';
5
+ import { link } from './ajax/link.js';
6
+ import { submit } from './form/submit.js';
7
+ import { resize } from './style/resize.js';
8
+ import { isMobile } from './browser/isMobile.js';
9
+ import { isTabletDevice } from './browser/isTabletDevice.js';
10
+ import { isFunction } from './type/isFunction.js';
11
+ import { log } from './browser/log.js';
12
12
  /**
13
13
  * Initializes the library bbn basing on the given configuration object.
14
14
  * - Gives to the environment the dimension of the window.innerWidth and window.innerHeight
@@ -22,8 +22,8 @@ import { log } from './browser/log';
22
22
  * @param {Object} cfg
23
23
  * @returns
24
24
  */
25
- const init = function (cfg, force) {
26
- let parts;
25
+ var init = function (cfg, force) {
26
+ var parts;
27
27
  if (!bbn.env.isInit || force) {
28
28
  bbn.env.root =
29
29
  document.baseURI.length > 0 ? document.baseURI : bbn.env.host;
@@ -65,7 +65,7 @@ const init = function (cfg, force) {
65
65
  "weekOfYear",
66
66
  "weekYear",
67
67
  "weekday",
68
- ], (plugin) => {
68
+ ], function (plugin) {
69
69
  if (window["dayjs_plugin_" + plugin]) {
70
70
  dayjs.extend(window["dayjs_plugin_" + plugin]);
71
71
  }
@@ -78,7 +78,7 @@ const init = function (cfg, force) {
78
78
  bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
79
79
  parts = bbn.env.path.split("/");
80
80
  //$.each(parts, function(i, v){
81
- each(parts, (v, i) => {
81
+ each(parts, function (v, i) {
82
82
  v = decodeURI(v.trim());
83
83
  if (v !== "") {
84
84
  bbn.env.params.push(v);
@@ -90,28 +90,28 @@ const init = function (cfg, force) {
90
90
  if (bbn.env.lang && undefined !== dayjs) {
91
91
  dayjs.locale(bbn.env.lang);
92
92
  }
93
- window.onfocus = () => {
93
+ window.onfocus = function () {
94
94
  bbn.env.isFocused = true;
95
95
  };
96
- window.onblur = () => {
96
+ window.onblur = function () {
97
97
  bbn.env.isFocused = false;
98
98
  bbn.env.timeoff = Math.round(new Date().getTime() / 1000);
99
99
  };
100
- document.addEventListener("focusin", (e) => {
100
+ document.addEventListener("focusin", function (e) {
101
101
  if (e.target instanceof HTMLElement &&
102
102
  !e.target.classList.contains("bbn-no")) {
103
103
  bbn.env.focused = e.target;
104
104
  }
105
105
  bbn.env.last_focus = new Date().getTime();
106
106
  });
107
- document.addEventListener("click", (e) => {
107
+ document.addEventListener("click", function (e) {
108
108
  bbn.env.last_focus = new Date().getTime();
109
109
  if (bbn.env.nav !== "ajax") {
110
110
  return;
111
111
  }
112
- let target = e.target;
112
+ var target = e.target;
113
113
  if (target instanceof HTMLElement && target.tagName !== "A") {
114
- let p = target;
114
+ var p = target;
115
115
  while (p && p.tagName !== "A") {
116
116
  if (p.tagName === "BODY") {
117
117
  break;
@@ -135,18 +135,18 @@ const init = function (cfg, force) {
135
135
  return false;
136
136
  }
137
137
  });
138
- each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele) => {
139
- ele.addEventListener("submit", (e) => {
138
+ each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), function (ele) {
139
+ ele.addEventListener("submit", function (e) {
140
140
  submit(ele, e);
141
141
  });
142
142
  });
143
- window.addEventListener("hashchange", () => {
143
+ window.addEventListener("hashchange", function () {
144
144
  bbn.env.hashChanged = new Date().getTime();
145
145
  }, false);
146
- window.addEventListener("resize", () => {
146
+ window.addEventListener("resize", function () {
147
147
  resize();
148
148
  });
149
- window.addEventListener("orientationchange", () => {
149
+ window.addEventListener("orientationchange", function () {
150
150
  resize();
151
151
  });
152
152
  resize();
@@ -158,11 +158,11 @@ const init = function (cfg, force) {
158
158
  }
159
159
  if (window.history) {
160
160
  window.onpopstate = function (e) {
161
- let h = window.history;
161
+ var h = window.history;
162
162
  if (!bbn.env.historyDisabled && h) {
163
163
  //e.preventDefault();
164
164
  if (bbn.fn.defaultHistoryFunction(h.state)) {
165
- let state = h.state;
165
+ var state = h.state;
166
166
  if (state) {
167
167
  //link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
168
168
  link(state.url, extend({ title: state.title || bbn.env.siteTitle }, state.data || {}));
@@ -1,6 +1,6 @@
1
- import { isNumber } from '../type/isNumber';
2
- import { isIterable } from '../type/isIterable';
3
- import { iterate } from './iterate';
1
+ import { isNumber } from '../type/isNumber.js';
2
+ import { isIterable } from '../type/isIterable.js';
3
+ import { iterate } from './iterate.js';
4
4
  /**
5
5
  * Executes the provided function on each element of the given array.
6
6
  *
@@ -32,9 +32,9 @@ import { iterate } from './iterate';
32
32
  * @param {Function} fn The function, gets the array's element and the index as arguments
33
33
  * @returns {[Array, Object, void]}
34
34
  */
35
- const each = function (arr, fn) {
35
+ var each = function (arr, fn) {
36
36
  if (isNumber(arr) && arr > 0) {
37
- for (let i = 0; i < arr; i++) {
37
+ for (var i = 0; i < arr; i++) {
38
38
  if (fn(i, i) === false) {
39
39
  return;
40
40
  }
@@ -42,7 +42,7 @@ const each = function (arr, fn) {
42
42
  return;
43
43
  }
44
44
  if (isIterable(arr)) {
45
- for (let i = 0; i < arr.length; i++) {
45
+ for (var i = 0; i < arr.length; i++) {
46
46
  if (fn(arr[i], i) === false) {
47
47
  return;
48
48
  }
@@ -1,5 +1,5 @@
1
- import { isArray } from '../type/isArray';
2
- import { isNumber } from '../type/isNumber';
1
+ import { isArray } from '../type/isArray.js';
2
+ import { isNumber } from '../type/isNumber.js';
3
3
  /**
4
4
  * Executes the provided function on each element of the given array.
5
5
  *
@@ -34,16 +34,18 @@ import { isNumber } from '../type/isNumber';
34
34
  * @param {Number} min The index at which the loop will start
35
35
  * @returns {undefined}
36
36
  */
37
- const fori = function (arr, fn, max = arr.length - 1, min = 0) {
37
+ var fori = function (arr, fn, max, min) {
38
+ if (max === void 0) { max = arr.length - 1; }
39
+ if (min === void 0) { min = 0; }
38
40
  if (isArray(arr)) {
39
- let realMax = arr.length - 1;
41
+ var realMax = arr.length - 1;
40
42
  if (!isNumber(max) || !(0 < max && max <= realMax)) {
41
43
  max = realMax;
42
44
  }
43
45
  if (!isNumber(min) || !(0 <= min && min < realMax) || min > max) {
44
46
  min = 0;
45
47
  }
46
- for (let i = min; i <= max; i++) {
48
+ for (var i = min; i <= max; i++) {
47
49
  if (fn(arr[i], i) === false) {
48
50
  return;
49
51
  }
@@ -1,5 +1,5 @@
1
- import { isArray } from '../type/isArray';
2
- import { isNumber } from '../type/isNumber';
1
+ import { isArray } from '../type/isArray.js';
2
+ import { isNumber } from '../type/isNumber.js';
3
3
  /**
4
4
  * Executes the provided function on each element of the given array, going backward.
5
5
  *
@@ -34,16 +34,18 @@ import { isNumber } from '../type/isNumber';
34
34
  * @param {Number} min The index at which the loop will start
35
35
  * @returns {undefined}
36
36
  */
37
- const forir = function (arr, fn, max = arr.length - 1, min = 0) {
37
+ var forir = function (arr, fn, max, min) {
38
+ if (max === void 0) { max = arr.length - 1; }
39
+ if (min === void 0) { min = 0; }
38
40
  if (isArray(arr)) {
39
- let realMax = arr.length - 1;
41
+ var realMax = arr.length - 1;
40
42
  if (!isNumber(max) || !(0 < max && max <= realMax)) {
41
43
  max = realMax;
42
44
  }
43
45
  if (!isNumber(min) || !(0 <= min && min < realMax) || min > max) {
44
46
  min = 0;
45
47
  }
46
- for (let i = max; i >= min; i--) {
48
+ for (var i = max; i >= min; i--) {
47
49
  if (fn(arr[i], i) === false) {
48
50
  return;
49
51
  }
@@ -1,4 +1,4 @@
1
- import { removePrivateProp } from '../object/removePrivateProp';
1
+ import { removePrivateProp } from '../object/removePrivateProp.js';
2
2
  /**
3
3
  * Executes the provided function on each property of the given object.
4
4
  *
@@ -19,13 +19,16 @@ import { removePrivateProp } from '../object/removePrivateProp';
19
19
  * @param {Boolean} reverse If set to true the order of the keys will be reversed
20
20
  * @returns {Object}
21
21
  */
22
- const iterate = function (obj, fn, noPrivate = false, reverse = false) {
22
+ var iterate = function (obj, fn, noPrivate, reverse) {
23
+ if (noPrivate === void 0) { noPrivate = false; }
24
+ if (reverse === void 0) { reverse = false; }
23
25
  if (obj !== null && typeof obj === "object") {
24
- let iter = Object.keys(noPrivate ? removePrivateProp(obj) : obj);
26
+ var iter = Object.keys(noPrivate ? removePrivateProp(obj) : obj);
25
27
  if (reverse) {
26
28
  iter.reverse();
27
29
  }
28
- for (let prop of iter) {
30
+ for (var _i = 0, iter_1 = iter; _i < iter_1.length; _i++) {
31
+ var prop = iter_1[_i];
29
32
  if (fn(obj[prop], prop) === false) {
30
33
  break;
31
34
  }
@@ -1,4 +1,4 @@
1
- import { iterate } from './iterate';
1
+ import { iterate } from './iterate.js';
2
2
  /**
3
3
  * Executes the provided function on each property of the given object.
4
4
  *
@@ -18,7 +18,8 @@ import { iterate } from './iterate';
18
18
  * @param {Boolean} noPrivate If set to true the _private_ properties won't be included
19
19
  * @returns {Object}
20
20
  */
21
- const riterate = function (obj, fn, noPrivate = false) {
21
+ var riterate = function (obj, fn, noPrivate) {
22
+ if (noPrivate === void 0) { noPrivate = false; }
22
23
  return iterate(obj, fn, noPrivate, true);
23
24
  };
24
25
  export { riterate };
@@ -12,7 +12,7 @@ declare const analyzeFunction: (fn: any) => {
12
12
  argString: string;
13
13
  isArrow: boolean;
14
14
  hasFunction: boolean;
15
- name: any;
15
+ name: string;
16
16
  isAsync: boolean;
17
17
  hash: string;
18
18
  };
@@ -1,4 +1,4 @@
1
- import { md5 } from '../string/md5';
1
+ import { md5 } from '../string/md5.js';
2
2
  /**
3
3
  * Analyzes the given function and extracts details about its structure.
4
4
  *
@@ -7,28 +7,28 @@ import { md5 } from '../string/md5';
7
7
  * @returns {Object} An object containing details about the function.
8
8
  * @throws {Error} When unexpected syntax is encountered while parsing.
9
9
  */
10
- const analyzeFunction = function (fn) {
11
- const all = typeof fn === 'function' ? fn.toString() : fn;
10
+ var analyzeFunction = function (fn) {
11
+ var all = typeof fn === 'function' ? fn.toString() : fn;
12
12
  if (typeof all !== 'string') {
13
13
  throw Error('Unexpected type ' + typeof fn + ' while parsing function');
14
14
  }
15
- let exp = '';
16
- let isArrow = false;
17
- let isAsync = false;
18
- let hasFunction = false;
19
- let name = null;
20
- let parOpened = 0;
21
- let parClosed = 0;
22
- let args = [];
23
- let currentArg = {};
24
- let body;
25
- let currentQuote = '';
26
- let escapable = ['"', "'", '`'];
27
- let isEscaped = false;
28
- let settingDefault = false;
29
- let isComment = false;
30
- let isCommentLine = false;
31
- for (let i = 0; i < all.length; i++) {
15
+ var exp = '';
16
+ var isArrow = false;
17
+ var isAsync = false;
18
+ var hasFunction = false;
19
+ var name = '';
20
+ var parOpened = 0;
21
+ var parClosed = 0;
22
+ var args = [];
23
+ var currentArg = {};
24
+ var body;
25
+ var currentQuote = '';
26
+ var escapable = ['"', "'", '`'];
27
+ var isEscaped = false;
28
+ var settingDefault = false;
29
+ var isComment = false;
30
+ var isCommentLine = false;
31
+ for (var i = 0; i < all.length; i++) {
32
32
  // Handle string literals
33
33
  if (!isComment && all[i] === '/' && all[i + 1] === '*') {
34
34
  isComment = true;
@@ -135,8 +135,8 @@ const analyzeFunction = function (fn) {
135
135
  if (exp.trim() !== '') {
136
136
  if (exp.trim() === 'async') {
137
137
  isAsync = true;
138
- exp = '';
139
138
  }
139
+ exp = '';
140
140
  }
141
141
  }
142
142
  else {
@@ -151,17 +151,17 @@ const analyzeFunction = function (fn) {
151
151
  throw Error('Unexpected end of function while parsing function');
152
152
  }
153
153
  }
154
- const argString = args.map((arg) => arg.name + (arg.default ? ' = ' + arg.default : '')).join(', ');
155
- const hash = md5(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
154
+ var argString = args.map(function (arg) { return arg.name + (arg.default ? ' = ' + arg.default : ''); }).join(', ');
155
+ var hash = md5(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
156
156
  return {
157
- body,
158
- args,
159
- argString,
160
- isArrow,
161
- hasFunction,
162
- name,
163
- isAsync,
164
- hash,
157
+ body: body,
158
+ args: args,
159
+ argString: argString,
160
+ isArrow: isArrow,
161
+ hasFunction: hasFunction,
162
+ name: name,
163
+ isAsync: isAsync,
164
+ hash: hash,
165
165
  };
166
166
  };
167
167
  export { analyzeFunction };
@@ -10,7 +10,7 @@
10
10
  * @memberof bbn.fn
11
11
  * @returns {Boolean}
12
12
  */
13
- const getTimeoff = function () {
13
+ var getTimeoff = function () {
14
14
  if (!bbn.env.isFocused) {
15
15
  return Math.round(new Date().getTime() / 1000 - bbn.env.timeoff);
16
16
  }
@@ -1,4 +1,4 @@
1
- import { isNumber } from '../type/isNumber';
1
+ import { isNumber } from '../type/isNumber.js';
2
2
  /**
3
3
  * Returns the given value to money format basing on the given configuration.
4
4
  *
@@ -20,7 +20,7 @@ import { isNumber } from '../type/isNumber';
20
20
  * @param {String} thousands The character to use to separate thounsands.
21
21
  * @param {Number} precision The number of decimals places.
22
22
  */
23
- const money = function (val, kilo, currency, novalue, decimal, thousands, precision) {
23
+ var money = function (val, kilo, currency, novalue, decimal, thousands, precision) {
24
24
  /*
25
25
  money(val, kilo){
26
26
  let decimal = ',',
@@ -82,7 +82,7 @@ const money = function (val, kilo, currency, novalue, decimal, thousands, precis
82
82
  precision = kilo ? 3 : 0;
83
83
  }
84
84
  if ((val === 0) && (typeof precision === 'number') && (precision > 0)) {
85
- let res = val.toFixed(precision).replace('.', decimal);
85
+ var res = val.toFixed(precision).replace('.', decimal);
86
86
  if (currency) {
87
87
  res += ' ' + (kilo ? 'K' + currency : currency);
88
88
  }
@@ -100,9 +100,9 @@ const money = function (val, kilo, currency, novalue, decimal, thousands, precis
100
100
  currency = 'K' + currency;
101
101
  }
102
102
  }
103
- let v = val.toFixed(precision);
104
- let decimalPosition = 0;
105
- let decimalIdx = 10000;
103
+ var v = val.toFixed(precision);
104
+ var decimalPosition = 0;
105
+ var decimalIdx = 10000;
106
106
  if (v) {
107
107
  decimalIdx = v.indexOf('.');
108
108
  if (decimalIdx <= 0) {
@@ -19,7 +19,7 @@
19
19
  * @param {Number|String} cent
20
20
  * @returns {Number}
21
21
  */
22
- const percent = function (percent, cent) {
22
+ var percent = function (percent, cent) {
23
23
  return (cent / 100) * percent;
24
24
  };
25
25
  export { percent };
@@ -18,7 +18,7 @@
18
18
  * @param {Number} max
19
19
  * @returns {Number}
20
20
  */
21
- const randomInt = function (min, max) {
21
+ var randomInt = function (min, max) {
22
22
  return Math.floor(Math.random() * (max - min + 1) + min);
23
23
  };
24
24
  export { randomInt };
@@ -7,7 +7,7 @@
7
7
  * @param {Number} decimals
8
8
  * @returns {}
9
9
  */
10
- const roundDecimal = function (value, decimals) {
10
+ var roundDecimal = function (value, decimals) {
11
11
  return Math.round(Math.pow(Math.pow(value, decimals), -decimals));
12
12
  };
13
13
  export { roundDecimal };
@@ -1,7 +1,7 @@
1
- import { iterate } from '../loop/iterate';
2
- const translate = function (o, namespace) {
3
- let lng = namespace ? bbn.lng[namespace.indexOf('_') === 0 ? namespace : '_' + namespace] : bbn.lng;
4
- iterate(o, (v, k) => {
1
+ import { iterate } from '../loop/iterate.js';
2
+ var translate = function (o, namespace) {
3
+ var lng = namespace ? bbn.lng[namespace.indexOf('_') === 0 ? namespace : '_' + namespace] : bbn.lng;
4
+ iterate(o, function (v, k) {
5
5
  lng[k] = v;
6
6
  });
7
7
  };
@@ -1,7 +1,7 @@
1
- import { getProperty } from './getProperty';
2
- import { isString } from '../type/isString';
3
- import { removeAccents } from '../string/removeAccents';
4
- import { isDate } from '../type/isDate';
1
+ import { getProperty } from './getProperty.js';
2
+ import { isString } from '../type/isString.js';
3
+ import { removeAccents } from '../string/removeAccents.js';
4
+ import { isDate } from '../type/isDate.js';
5
5
  /**
6
6
  * Compares the given property in the given objects and returns -1, 1, or 0 depending on their difference.
7
7
  *
@@ -40,8 +40,9 @@ import { isDate } from '../type/isDate';
40
40
  * @param {String} [dir=asc] Direction of comparison (desc or asc by default)
41
41
  * @returns {Number} Always either -1, 1, or 0
42
42
  */
43
- const _compareValues = function (a, b, prop, dir = "asc") {
44
- let va = getProperty(a, prop), vb = getProperty(b, prop), ta = (typeof va).toLowerCase(), tb = (typeof vb).toLowerCase();
43
+ var _compareValues = function (a, b, prop, dir) {
44
+ if (dir === void 0) { dir = "asc"; }
45
+ var va = getProperty(a, prop), vb = getProperty(b, prop), ta = (typeof va).toLowerCase(), tb = (typeof vb).toLowerCase();
45
46
  if (dir !== "asc" && isString(dir) && dir.toLowerCase() === "desc") {
46
47
  dir = "desc";
47
48
  }
@@ -1,5 +1,5 @@
1
- import { each } from '../loop/each';
2
- import { getProperty } from './getProperty';
1
+ import { each } from '../loop/each.js';
2
+ import { getProperty } from './getProperty.js';
3
3
  /**
4
4
  * Creates and returns a new array made of the given property's values from the given array of objects.
5
5
  *
@@ -31,9 +31,9 @@ import { getProperty } from './getProperty';
31
31
  * @param {String} prop
32
32
  * @returns {Array} The new array
33
33
  */
34
- const arrayFromProp = function (arr, prop) {
35
- let r = [];
36
- each(arr, (a, i) => {
34
+ var arrayFromProp = function (arr, prop) {
35
+ var r = [];
36
+ each(arr, function (a, i) {
37
37
  r.push(getProperty(a, prop));
38
38
  });
39
39
  return r;
@@ -1,4 +1,4 @@
1
- import { extend } from './extend';
1
+ import { extend } from './extend.js';
2
2
  /**
3
3
  * Extends the bbn object by passing the namespace and the object it will merge with.
4
4
  *
@@ -30,7 +30,7 @@ import { extend } from './extend';
30
30
  * @param {Object} obj The object to merge
31
31
  * @returns {undefined} No return value
32
32
  */
33
- const autoExtend = function (namespace, obj) {
33
+ var autoExtend = function (namespace, obj) {
34
34
  if (!bbn[namespace]) {
35
35
  bbn[namespace] = {};
36
36
  //$.extend(true, bbn[namespace], obj);