@bbn/bbn 1.0.24 → 1.0.26

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 (276) hide show
  1. package/dist/bundle.d.ts +224 -238
  2. package/dist/bundle.js +940 -906
  3. package/dist/fn/_addLoader.js +1 -1
  4. package/dist/fn/_deleteLoader.d.ts +1 -1
  5. package/dist/fn/_deleteLoader.js +2 -2
  6. package/dist/fn/abort.js +4 -4
  7. package/dist/fn/abortURL.js +2 -2
  8. package/dist/fn/addColors.d.ts +1 -1
  9. package/dist/fn/addColors.js +23 -6
  10. package/dist/fn/addInputs.d.ts +1 -2
  11. package/dist/fn/addInputs.js +4 -5
  12. package/dist/fn/adjustHeight.js +1 -1
  13. package/dist/fn/adjustSize.js +1 -1
  14. package/dist/fn/adjustWidth.js +1 -1
  15. package/dist/fn/ajax.d.ts +1 -1
  16. package/dist/fn/ajax.js +8 -7
  17. package/dist/fn/analyzeFunction.js +5 -5
  18. package/dist/fn/animateCss.js +8 -7
  19. package/dist/fn/baseName.d.ts +1 -1
  20. package/dist/fn/baseName.js +1 -1
  21. package/dist/fn/br2nl.d.ts +1 -1
  22. package/dist/fn/br2nl.js +1 -1
  23. package/dist/fn/calendar.js +1 -1
  24. package/dist/fn/callback.d.ts +1 -1
  25. package/dist/fn/callback.js +5 -5
  26. package/dist/fn/camelToCss.js +4 -2
  27. package/dist/fn/canvasToImage.js +1 -1
  28. package/dist/fn/center.js +3 -5
  29. package/dist/fn/checkProps.d.ts +1 -1
  30. package/dist/fn/checkProps.js +1 -1
  31. package/dist/fn/checkPropsDetails.d.ts +1 -4
  32. package/dist/fn/checkPropsDetails.js +10 -11
  33. package/dist/fn/checkPropsOrDie.d.ts +1 -1
  34. package/dist/fn/checkPropsOrDie.js +1 -1
  35. package/dist/fn/checkType.d.ts +1 -1
  36. package/dist/fn/checkType.js +3 -3
  37. package/dist/fn/chrono.d.ts +3 -0
  38. package/dist/fn/chrono.js +23 -0
  39. package/dist/fn/circularReplacer.js +2 -2
  40. package/dist/fn/clone.d.ts +0 -1
  41. package/dist/fn/clone.js +1 -1
  42. package/dist/fn/colorToHex.js +1 -1
  43. package/dist/fn/compare.js +44 -44
  44. package/dist/fn/compareConditions.d.ts +0 -1
  45. package/dist/fn/compareConditions.js +3 -3
  46. package/dist/fn/copy.js +9 -9
  47. package/dist/fn/correctCase.js +1 -1
  48. package/dist/fn/count.d.ts +1 -1
  49. package/dist/fn/count.js +2 -2
  50. package/dist/fn/crc32.js +12 -3
  51. package/dist/fn/createObject.d.ts +1 -1
  52. package/dist/fn/createObject.js +3 -3
  53. package/dist/fn/cssExists.js +7 -4
  54. package/dist/fn/date.js +5 -5
  55. package/dist/fn/dateSQL.js +4 -3
  56. package/dist/fn/deepPath.d.ts +1 -2
  57. package/dist/fn/defaultAjaxAbortFunction.d.ts +1 -1
  58. package/dist/fn/defaultAjaxAbortFunction.js +1 -1
  59. package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
  60. package/dist/fn/defaultAjaxErrorFunction.js +0 -12
  61. package/dist/fn/defaultAlertFunction.d.ts +1 -1
  62. package/dist/fn/defaultAlertFunction.js +2 -3
  63. package/dist/fn/defaultConfirmFunction.d.ts +1 -1
  64. package/dist/fn/defaultEndLoadingFunction.d.ts +1 -1
  65. package/dist/fn/defaultEndLoadingFunction.js +1 -17
  66. package/dist/fn/defaultPostLinkFunction.d.ts +1 -1
  67. package/dist/fn/defaultPostLinkFunction.js +1 -1
  68. package/dist/fn/defaultPreLinkFunction.d.ts +1 -1
  69. package/dist/fn/defaultPreLinkFunction.js +2 -10
  70. package/dist/fn/defaultStartLoadingFunction.d.ts +1 -1
  71. package/dist/fn/defaultStartLoadingFunction.js +2 -13
  72. package/dist/fn/deleteProp.d.ts +1 -1
  73. package/dist/fn/deleteProp.js +3 -2
  74. package/dist/fn/diffObj.d.ts +1 -2
  75. package/dist/fn/diffObj.js +13 -14
  76. package/dist/fn/dirName.d.ts +1 -1
  77. package/dist/fn/download.d.ts +1 -1
  78. package/dist/fn/download.js +3 -5
  79. package/dist/fn/downloadContent.d.ts +1 -1
  80. package/dist/fn/each.js +1 -1
  81. package/dist/fn/error.js +2 -2
  82. package/dist/fn/escapeRegExp.js +1 -1
  83. package/dist/fn/escapeTicks.js +1 -1
  84. package/dist/fn/escapeUrl.js +1 -1
  85. package/dist/fn/extend.d.ts +1 -2
  86. package/dist/fn/extend.js +11 -11
  87. package/dist/fn/extendOut.d.ts +1 -2
  88. package/dist/fn/extendOut.js +3 -3
  89. package/dist/fn/fdate.d.ts +1 -1
  90. package/dist/fn/fdatetime.d.ts +1 -1
  91. package/dist/fn/fdatetime.js +1 -1
  92. package/dist/fn/fieldValue.js +2 -2
  93. package/dist/fn/fileExt.js +1 -1
  94. package/dist/fn/filter.d.ts +1 -2
  95. package/dist/fn/filter.js +13 -12
  96. package/dist/fn/filterToConditions.d.ts +11 -3
  97. package/dist/fn/filterToConditions.js +6 -6
  98. package/dist/fn/findAll.d.ts +0 -1
  99. package/dist/fn/findAll.js +1 -1
  100. package/dist/fn/fori.d.ts +1 -1
  101. package/dist/fn/fori.js +2 -2
  102. package/dist/fn/forir.d.ts +1 -1
  103. package/dist/fn/forir.js +2 -2
  104. package/dist/fn/formdata.d.ts +1 -1
  105. package/dist/fn/formdata.js +12 -13
  106. package/dist/fn/fromXml.js +6 -6
  107. package/dist/fn/ftime.js +1 -1
  108. package/dist/fn/getAllTags.d.ts +1 -1
  109. package/dist/fn/getAllTags.js +1 -1
  110. package/dist/fn/getAncestors.d.ts +1 -1
  111. package/dist/fn/getAncestors.js +7 -8
  112. package/dist/fn/getAttributes.js +2 -2
  113. package/dist/fn/getBrowserName.js +9 -9
  114. package/dist/fn/getBrowserVersion.js +2 -2
  115. package/dist/fn/getCookie.js +1 -1
  116. package/dist/fn/getDeviceType.js +3 -3
  117. package/dist/fn/getEventData.js +11 -8
  118. package/dist/fn/getField.d.ts +1 -1
  119. package/dist/fn/getField.js +4 -3
  120. package/dist/fn/getFieldValues.d.ts +1 -1
  121. package/dist/fn/getFieldValues.js +2 -2
  122. package/dist/fn/getHTMLOfSelection.d.ts +1 -1
  123. package/dist/fn/getHTMLOfSelection.js +9 -19
  124. package/dist/fn/getLoader.d.ts +1 -1
  125. package/dist/fn/getPath.d.ts +1 -1
  126. package/dist/fn/getPath.js +4 -4
  127. package/dist/fn/getProp.js +3 -2
  128. package/dist/fn/getProperty.js +1 -1
  129. package/dist/fn/getRow.d.ts +1 -1
  130. package/dist/fn/getRow.js +1 -1
  131. package/dist/fn/getScrollBarSize.js +9 -7
  132. package/dist/fn/getText.d.ts +1 -1
  133. package/dist/fn/getTimeoff.js +1 -1
  134. package/dist/fn/happy.js +1 -1
  135. package/dist/fn/hash.d.ts +1 -1
  136. package/dist/fn/hash.js +1 -1
  137. package/dist/fn/hex2rgb.js +7 -5
  138. package/dist/fn/html2text.d.ts +1 -1
  139. package/dist/fn/imageToCanvas.js +2 -2
  140. package/dist/fn/imgToBase64.d.ts +1 -1
  141. package/dist/fn/imgToBase64.js +3 -3
  142. package/dist/fn/info.js +1 -1
  143. package/dist/fn/init.js +29 -29
  144. package/dist/fn/isActiveInterface.js +2 -2
  145. package/dist/fn/isColor.d.ts +1 -1
  146. package/dist/fn/isColor.js +11 -4
  147. package/dist/fn/isCp.js +7 -7
  148. package/dist/fn/isDimension.d.ts +1 -1
  149. package/dist/fn/isDimension.js +11 -4
  150. package/dist/fn/isEmail.d.ts +1 -1
  151. package/dist/fn/isEmail.js +11 -4
  152. package/dist/fn/isEmpty.js +1 -1
  153. package/dist/fn/isFocused.d.ts +1 -1
  154. package/dist/fn/isFocused.js +1 -1
  155. package/dist/fn/isHostname.js +1 -1
  156. package/dist/fn/isIP.js +1 -1
  157. package/dist/fn/isInside.js +1 -1
  158. package/dist/fn/isIterable.js +1 -1
  159. package/dist/fn/isNumber.js +1 -1
  160. package/dist/fn/isPercent.js +1 -1
  161. package/dist/fn/isPrimitive.js +1 -1
  162. package/dist/fn/isPropSize.js +1 -1
  163. package/dist/fn/isSQLDate.js +1 -1
  164. package/dist/fn/isSame.d.ts +1 -2
  165. package/dist/fn/isSame.js +3 -3
  166. package/dist/fn/isURL.js +1 -1
  167. package/dist/fn/isValidDimension.js +2 -3
  168. package/dist/fn/isValue.js +1 -1
  169. package/dist/fn/isVue.d.ts +1 -1
  170. package/dist/fn/isVue.js +5 -5
  171. package/dist/fn/iterate.d.ts +1 -1
  172. package/dist/fn/iterate.js +3 -3
  173. package/dist/fn/lightenDarkenHex.js +2 -2
  174. package/dist/fn/link.d.ts +1 -2
  175. package/dist/fn/link.js +17 -19
  176. package/dist/fn/log.js +4 -4
  177. package/dist/fn/makeReactive.d.ts +0 -1
  178. package/dist/fn/makeReactive.js +35 -23
  179. package/dist/fn/map.d.ts +0 -1
  180. package/dist/fn/md5.js +30 -10
  181. package/dist/fn/money.d.ts +1 -1
  182. package/dist/fn/money.js +47 -34
  183. package/dist/fn/move.d.ts +1 -1
  184. package/dist/fn/move.js +1 -1
  185. package/dist/fn/multiorder.d.ts +1 -1
  186. package/dist/fn/multiorder.js +5 -5
  187. package/dist/fn/nl2br.d.ts +1 -1
  188. package/dist/fn/nl2br.js +1 -1
  189. package/dist/fn/numProperties.d.ts +1 -1
  190. package/dist/fn/numProperties.js +1 -1
  191. package/dist/fn/objectToFormData.d.ts +1 -1
  192. package/dist/fn/objectToFormData.js +3 -3
  193. package/dist/fn/outerHeight.d.ts +1 -1
  194. package/dist/fn/outerHeight.js +5 -4
  195. package/dist/fn/outerWidth.d.ts +1 -1
  196. package/dist/fn/outerWidth.js +1 -2
  197. package/dist/fn/pickValue.d.ts +1 -1
  198. package/dist/fn/post.d.ts +1 -1
  199. package/dist/fn/post.js +3 -3
  200. package/dist/fn/postOut.d.ts +1 -1
  201. package/dist/fn/postOut.js +2 -2
  202. package/dist/fn/printf.js +1 -3
  203. package/dist/fn/quotes2html.d.ts +1 -1
  204. package/dist/fn/quotes2html.js +3 -3
  205. package/dist/fn/randomInt.d.ts +1 -1
  206. package/dist/fn/randomString.d.ts +1 -1
  207. package/dist/fn/randomString.js +9 -8
  208. package/dist/fn/removeAccents.d.ts +1 -1
  209. package/dist/fn/removeAccents.js +1 -1
  210. package/dist/fn/removeEmpty.d.ts +1 -1
  211. package/dist/fn/removeExtraSpaces.d.ts +1 -1
  212. package/dist/fn/removeHtmlComments.d.ts +1 -1
  213. package/dist/fn/removePrivateProp.d.ts +1 -2
  214. package/dist/fn/removePrivateProp.js +6 -6
  215. package/dist/fn/removeTrailingChars.d.ts +1 -1
  216. package/dist/fn/repeat.d.ts +1 -1
  217. package/dist/fn/repeat.js +1 -6
  218. package/dist/fn/replaceAll.d.ts +1 -1
  219. package/dist/fn/replaceAll.js +1 -4
  220. package/dist/fn/replaceSelection.js +1 -1
  221. package/dist/fn/resize.js +9 -7
  222. package/dist/fn/rgb2hex.js +6 -4
  223. package/dist/fn/riterate.d.ts +1 -1
  224. package/dist/fn/roundDecimal.d.ts +1 -1
  225. package/dist/fn/roundDecimal.js +1 -1
  226. package/dist/fn/sanitize.js +3 -1
  227. package/dist/fn/search.d.ts +2 -1
  228. package/dist/fn/search.js +24 -21
  229. package/dist/fn/selectElementText.d.ts +1 -1
  230. package/dist/fn/selectElementText.js +1 -1
  231. package/dist/fn/selector.d.ts +1 -1
  232. package/dist/fn/selector.js +1 -1
  233. package/dist/fn/setCookie.js +4 -4
  234. package/dist/fn/setCssVar.js +2 -1
  235. package/dist/fn/setNavigationVars.d.ts +1 -1
  236. package/dist/fn/setNavigationVars.js +6 -5
  237. package/dist/fn/setProp.d.ts +1 -1
  238. package/dist/fn/setProp.js +1 -3
  239. package/dist/fn/setProperty.d.ts +1 -1
  240. package/dist/fn/setProperty.js +2 -2
  241. package/dist/fn/shorten.d.ts +1 -1
  242. package/dist/fn/shorten.js +3 -3
  243. package/dist/fn/shortenObj.d.ts +1 -2
  244. package/dist/fn/shortenObj.js +2 -2
  245. package/dist/fn/shuffle.d.ts +1 -1
  246. package/dist/fn/shuffle.js +1 -3
  247. package/dist/fn/simpleHash.d.ts +1 -1
  248. package/dist/fn/simpleHash1.d.ts +1 -1
  249. package/dist/fn/simpleHash1.js +1 -1
  250. package/dist/fn/simpleHash2.d.ts +1 -1
  251. package/dist/fn/stat.d.ts +1 -1
  252. package/dist/fn/stat.js +8 -8
  253. package/dist/fn/string2ArrayBuffer.d.ts +1 -1
  254. package/dist/fn/submit.d.ts +1 -1
  255. package/dist/fn/submit.js +6 -21
  256. package/dist/fn/substr.d.ts +1 -1
  257. package/dist/fn/substr.js +1 -1
  258. package/dist/fn/sum.d.ts +1 -1
  259. package/dist/fn/sum.js +2 -3
  260. package/dist/fn/timestamp.d.ts +1 -1
  261. package/dist/fn/timestamp.js +1 -1
  262. package/dist/fn/toCSV.d.ts +1 -1
  263. package/dist/fn/toCSV.js +1 -1
  264. package/dist/fn/toggleFullScreen.js +13 -13
  265. package/dist/fn/translate.d.ts +1 -1
  266. package/dist/fn/treatAjaxArguments.d.ts +1 -1
  267. package/dist/fn/treatAjaxArguments.js +16 -14
  268. package/dist/fn/uniqString.js +3 -3
  269. package/dist/fn/unique.d.ts +1 -1
  270. package/dist/fn/upload.d.ts +1 -1
  271. package/dist/fn/upload.js +6 -6
  272. package/dist/fn/warning.d.ts +1 -1
  273. package/dist/fn/warning.js +6 -6
  274. package/dist/index.d.ts +106 -108
  275. package/dist/index.js +5 -6
  276. package/package.json +3 -1
package/dist/fn/isIP.js CHANGED
@@ -3,7 +3,7 @@ const isIP = function (...args) {
3
3
  if (!args.length)
4
4
  return false;
5
5
  for (let st of args) {
6
- if (!isString(st) || !bbn.var.regexp.ip.test(st)) {
6
+ if (!isString(st) || !bbn.vars.regexp.ip.test(st)) {
7
7
  return false;
8
8
  }
9
9
  }
@@ -6,7 +6,7 @@ const isInside = function (ele, ancestor) {
6
6
  if (ancestors.length) {
7
7
  if (isString(ancestor)) {
8
8
  let ok = false;
9
- each(ancestors, a => {
9
+ each(ancestors, (a) => {
10
10
  if (a.matches && a.matches(ancestor)) {
11
11
  ok = true;
12
12
  return false;
@@ -1,4 +1,4 @@
1
1
  const isIterable = function (v) {
2
- return v && (typeof v === 'object') && (Symbol.iterator in Object(v));
2
+ return v && typeof v === 'object' && Symbol.iterator in Object(v);
3
3
  };
4
4
  export { isIterable };
@@ -2,7 +2,7 @@ const isNumber = function (...args) {
2
2
  if (!args.length)
3
3
  return false;
4
4
  for (let a of args) {
5
- if (['boolean', 'object', 'symbol'].includes(typeof a) || (a === '') || isNaN(a)) {
5
+ if (['boolean', 'object', 'symbol'].includes(typeof a) || a === '' || isNaN(a)) {
6
6
  return false;
7
7
  }
8
8
  }
@@ -2,7 +2,7 @@ const isPercent = function (...args) {
2
2
  if (!args.length)
3
3
  return false;
4
4
  for (let a of args) {
5
- if ((typeof a !== 'string') || !a.match(/^\d+(?:\.\d+)?%$/)) {
5
+ if (typeof a !== 'string' || !a.match(/^\d+(?:\.\d+)?%$/)) {
6
6
  return false;
7
7
  }
8
8
  }
@@ -2,7 +2,7 @@ const isPrimitive = function (...args) {
2
2
  if (!args.length)
3
3
  return false;
4
4
  for (let a of args) {
5
- if ((a !== null) && ((typeof a == "object") || (typeof a == "function"))) {
5
+ if (a !== null && (typeof a == 'object' || typeof a == 'function')) {
6
6
  return false;
7
7
  }
8
8
  }
@@ -1,7 +1,7 @@
1
1
  import { each } from './each';
2
2
  const isPropSize = function (name) {
3
3
  let isTrue = false;
4
- each(['width', 'height', 'gap', 'margin', 'padding', 'top', 'left', 'right', 'bottom'], a => {
4
+ each(['width', 'height', 'gap', 'margin', 'padding', 'top', 'left', 'right', 'bottom'], (a) => {
5
5
  if (name.indexOf(a) !== -1) {
6
6
  isTrue = true;
7
7
  return false;
@@ -2,7 +2,7 @@ const isSQLDate = function (...args) {
2
2
  if (!args.length)
3
3
  return false;
4
4
  for (let a of args) {
5
- if ((typeof a !== 'string') ||
5
+ if (typeof a !== 'string' ||
6
6
  !a.match(/^([1-2]\d{3})-((0[0-9])|(1[12]))-(([0-2][0-9])|(3[01]))(?:( [0-2][0-9]):([0-5][0-9]):([0-5][0-9]))?$/)) {
7
7
  return false;
8
8
  }
@@ -1,3 +1,2 @@
1
- import { isSame } from './isSame';
2
- declare const isSame: (obj1: any, obj2: any, done: any) => boolean;
1
+ declare const isSame: (obj1: any, obj2: any, done?: any[]) => boolean;
3
2
  export { isSame };
package/dist/fn/isSame.js CHANGED
@@ -7,20 +7,20 @@ const isSame = function (obj1, obj2, done) {
7
7
  if (obj1 === obj2) {
8
8
  return true;
9
9
  }
10
- if (obj1 && obj2 && (typeof (obj1) === 'object') && (typeof (obj2) === 'object')) {
10
+ if (obj1 && obj2 && typeof obj1 === 'object' && typeof obj2 === 'object') {
11
11
  let tmp1 = Object.keys(obj1).sort(), tmp2 = Object.keys(obj2).sort();
12
12
  // Case where the keys are different
13
13
  if (hash(tmp1) !== hash(tmp2)) {
14
14
  return false;
15
15
  }
16
16
  let ok = true;
17
- if (obj1 && (typeof obj1 === 'object')) {
17
+ if (obj1 && typeof obj1 === 'object') {
18
18
  if (done.includes(obj1)) {
19
19
  return ok;
20
20
  }
21
21
  done.push(obj1);
22
22
  }
23
- each(tmp1, a => {
23
+ each(tmp1, (a) => {
24
24
  if (!isSame(obj1[a], obj2[a])) {
25
25
  ok = false;
26
26
  return false;
package/dist/fn/isURL.js CHANGED
@@ -2,7 +2,7 @@ const isURL = function (...args) {
2
2
  if (!args.length)
3
3
  return false;
4
4
  for (let str of args) {
5
- if (!bbn.var.regexp.url.test(str)) {
5
+ if (!bbn.vars.regexp.url.test(str)) {
6
6
  return false;
7
7
  }
8
8
  }
@@ -1,8 +1,7 @@
1
+ import { isNumber } from './isNumber';
1
2
  import { substr } from './substr';
2
3
  const isValidDimension = function (st) {
3
- if ((typeof (st) === 'string') &&
4
- (st.length > 0) && ((st.indexOf('calc') === 0) ||
5
- (!isNaN(substr(st, 0, 1))))) {
4
+ if (typeof st === 'string' && (st.length > 0) && ((st.indexOf('calc') === 0) || isNumber(substr(st, 0, 1)))) {
6
5
  let el = document.createElement('div');
7
6
  el.style.width = st;
8
7
  let res = !!el.style.width.length;
@@ -3,7 +3,7 @@ const isValue = function (...args) {
3
3
  if (!args.length)
4
4
  return false;
5
5
  for (let a of args) {
6
- if ((typeof a === 'object') && !isNull(a)) {
6
+ if (typeof a === 'object' && !isNull(a)) {
7
7
  return false;
8
8
  }
9
9
  }
@@ -1,2 +1,2 @@
1
- declare const isVue: (...args: any[]) => any;
1
+ declare const isVue: (...args: any[]) => boolean;
2
2
  export { isVue };
package/dist/fn/isVue.js CHANGED
@@ -2,23 +2,23 @@ const isVue = function (...args) {
2
2
  if (!args.length) {
3
3
  return false;
4
4
  }
5
- if (Object.hasOwn(bbn, 'vue')) {
6
- if (bbn.vue.app) {
5
+ if ('vue' in bbn && window['Vue']) {
6
+ if ('app' in bbn.vue) {
7
7
  for (let a of args) {
8
- if (!a || (typeof a.render !== 'function')) {
8
+ if (!a || typeof a.render !== 'function') {
9
9
  return false;
10
10
  }
11
11
  }
12
12
  }
13
13
  else {
14
14
  for (let a of args) {
15
- if (!(a instanceof Vue)) {
15
+ if (!(a instanceof window['Vue'])) {
16
16
  return false;
17
17
  }
18
18
  }
19
19
  }
20
20
  }
21
- if (Object.hasOwn(bbn, 'cp')) {
21
+ if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
22
22
  return bbn.cp.isComponent(...args);
23
23
  }
24
24
  return true;
@@ -1,2 +1,2 @@
1
- declare const iterate: (obj: any, fn: any, noPrivate: any, reverse: any) => any;
1
+ declare const iterate: (obj: object, fn: (a: any, b: string) => any, noPrivate?: boolean, reverse?: boolean) => object;
2
2
  export { iterate };
@@ -1,12 +1,12 @@
1
1
  import { removePrivateProp } from './removePrivateProp';
2
2
  import { each } from './each';
3
- const iterate = function (obj, fn, noPrivate, reverse) {
4
- if ((obj !== null) && (typeof obj === 'object')) {
3
+ const iterate = function (obj, fn, noPrivate = false, reverse = false) {
4
+ if (obj !== null && typeof obj === 'object') {
5
5
  let iter = Object.keys(noPrivate ? removePrivateProp(obj) : obj);
6
6
  if (reverse) {
7
7
  iter.reverse();
8
8
  }
9
- each(iter, prop => {
9
+ each(iter, (prop) => {
10
10
  if (fn(obj[prop], prop) === false) {
11
11
  return false;
12
12
  }
@@ -1,8 +1,8 @@
1
1
  const lightenDarkenHex = function (hex, amt) {
2
2
  if (hex && amt) {
3
- let ht = hex[0] === "#";
3
+ let ht = hex[0] === '#';
4
4
  hex = ht ? hex.slice(1) : hex;
5
- let num = parseInt(hex, 16), r = (num >> 16) + amt, b = ((num >> 8) & 0x00FF) + amt, g = (num & 0x0000FF) + amt;
5
+ let num = parseInt(hex, 16), r = (num >> 16) + amt, b = ((num >> 8) & 0x00ff) + amt, g = (num & 0x0000ff) + amt;
6
6
  if (r > 255) {
7
7
  r = 255;
8
8
  }
package/dist/fn/link.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import { link } from './link';
2
- declare const link: () => any;
1
+ declare const link: (...args: any[]) => any;
3
2
  export { link };
package/dist/fn/link.js CHANGED
@@ -1,17 +1,14 @@
1
1
  import { treatAjaxArguments } from './treatAjaxArguments';
2
2
  import { getLoader } from './getLoader';
3
3
  import { defaultPreLinkFunction } from './defaultPreLinkFunction';
4
- import { extend } from './extend';
5
4
  import { ajax } from './ajax';
6
5
  import { log } from './log';
7
6
  import { isObject } from './isObject';
8
7
  import { callback } from './callback';
9
8
  import { setNavigationVars } from './setNavigationVars';
10
- const link = function () {
11
- let cfg = treatAjaxArguments(arguments), ok = 1;
12
- if (cfg === true) {
13
- return true;
14
- }
9
+ const link = function (...args) {
10
+ let cfg = treatAjaxArguments(args);
11
+ let ok = true;
15
12
  /* If we can't find a correct link we load the current URL */
16
13
  if (!cfg) {
17
14
  return link(window.location.href);
@@ -35,8 +32,8 @@ const link = function () {
35
32
  */
36
33
  return true;
37
34
  }
38
- /* Mail link */
39
35
  else if (cfg.url.indexOf('mailto:') === 0) {
36
+ /* Mail link */
40
37
  bbn.env.ignoreUnload = true;
41
38
  window.location.href = cfg.url;
42
39
  setTimeout(() => {
@@ -48,52 +45,53 @@ const link = function () {
48
45
  return false;
49
46
  }
50
47
  /* Opens an external page in a new window */
51
- if (((cfg.url.indexOf("http://") === 0) || (cfg.url.indexOf("https://") === 0)) &&
52
- (cfg.url.indexOf(bbn.env.host) !== 0)) {
48
+ if ((cfg.url.indexOf('http://') === 0 || cfg.url.indexOf('https://') === 0) &&
49
+ cfg.url.indexOf(bbn.env.host) !== 0) {
53
50
  if (cfg.e) {
54
51
  cfg.e.preventDefault();
55
52
  }
56
53
  window.open(cfg.url);
57
54
  return false;
58
55
  }
59
- /* The URL is fine so go ahead if something is not already loading */
60
- else if ((cfg.url !== bbn.env.params.join("/")) || (cfg.force === 1)) {
56
+ else if (cfg.url !== bbn.env.params.join('/') || cfg.force) {
57
+ /* The URL is fine so go ahead if something is not already loading */
61
58
  /* If a second callback is defined, it is triggered instead of defaultPreLinkFunction */
62
59
  if (cfg.successFn) {
63
60
  ok = cfg.successFn(cfg.url);
64
61
  }
65
62
  else if (defaultPreLinkFunction) {
66
63
  ok = defaultPreLinkFunction(cfg.url, cfg.force, cfg.ele);
64
+ /*
67
65
  if (ok.data !== undefined) {
68
66
  extend(cfg.obj, ok.data);
69
67
  ok = 1;
70
68
  }
69
+ */
71
70
  }
72
71
  if (ok) {
73
- if (ok !== 1 && (typeof ok === 'string')) {
72
+ if (ok !== 1 && typeof ok === 'string') {
74
73
  cfg.url = ok;
75
74
  }
76
75
  /** todo Do we keep obj in the unique string or do we make that only one concurrent connection to the same address can occur at the same time? */
77
- let errSt = bbn._("The Ajax call to") + ' ' + cfg.url + ' ';
76
+ let errSt = bbn._('The Ajax call to') + ' ' + cfg.url + ' ';
78
77
  return ajax(cfg.url, cfg.datatype, cfg.obj, function (res) {
79
78
  if (!res) {
80
- log(errSt + bbn._("returned no answer"));
79
+ log(errSt + bbn._('returned no answer'));
81
80
  }
82
81
  if (isObject(res)) {
83
82
  // If there's nothing in the result, just an empty object, the callback stops here and the URL is not changed
84
- if ((Object.keys(res).length === 0)) {
85
- log(errSt + bbn._("returned an empty object"));
83
+ if (Object.keys(res).length === 0) {
84
+ log(errSt + bbn._('returned an empty object'));
86
85
  }
87
86
  if (res.new_url) {
88
87
  res.old_path = cfg.url;
89
88
  cfg.url = res.new_url;
90
89
  }
91
- else if (res.url && (cfg.url !== res.url)) {
90
+ else if (res.url && cfg.url !== res.url) {
92
91
  res.old_path = cfg.url;
93
92
  }
94
93
  }
95
- if (callback(cfg.url, res, cfg.successFn, null, cfg.ele) &&
96
- res.noNav === undefined) {
94
+ if (callback(cfg.url, res, cfg.successFn, null, cfg.ele) && res.noNav === undefined) {
97
95
  // This solution is not very clean (we can't shorten a URL)
98
96
  if (bbn.env.path.indexOf(cfg.url) !== 0) {
99
97
  setNavigationVars(cfg.url, (res.title ? res.title + ' - ' : '') + bbn.env.siteTitle);
package/dist/fn/log.js CHANGED
@@ -3,8 +3,8 @@ const log = function (...args) {
3
3
  if (window.console !== undefined) {
4
4
  let cfg;
5
5
  let level = 5;
6
- let fn = "log";
7
- if (args[0] && (typeof args[0] === 'object') && args[0]._bbn_console_style) {
6
+ let fn = 'log';
7
+ if (args[0] && typeof args[0] === 'object' && args[0]._bbn_console_style) {
8
8
  if (args[0]._bbn_console_mode && isFunction(console[args[0]._bbn_console_mode])) {
9
9
  fn = args[0]._bbn_console_mode;
10
10
  }
@@ -18,8 +18,8 @@ const log = function (...args) {
18
18
  let i = 0;
19
19
  while (i < args.length) {
20
20
  let t = typeof args[i];
21
- if ((t === 'string') || (t === 'number')) {
22
- window.console[fn]("%c %s ", cfg, args[i]);
21
+ if (t === 'string' || t === 'number') {
22
+ window.console[fn]('%c %s ', cfg, args[i]);
23
23
  }
24
24
  else {
25
25
  window.console[fn](args[i]);
@@ -1,3 +1,2 @@
1
- import { makeReactive } from './makeReactive';
2
1
  declare const makeReactive: (obj: any, onSet: any, parent: any, parentProp: any) => any;
3
2
  export { makeReactive };
@@ -9,19 +9,19 @@ import { isSame } from './isSame';
9
9
  const makeReactive = function (obj, onSet, parent, parentProp) {
10
10
  const parentString = (parent === null || parent === void 0 ? void 0 : parent.$cid) || '';
11
11
  const prefix = '__bbn_' + (parentString ? parentString + '_' : '');
12
- if (obj && (typeof obj === 'object') && [undefined, Object, Array].includes(obj.constructor)) {
13
- if (obj.__bbnIsProxy && (obj.__bbnParent === parent)) {
12
+ if (obj && typeof obj === 'object' && [undefined, Object, Array].includes(obj.constructor)) {
13
+ if (obj.__bbnIsProxy && obj.__bbnParent === parent) {
14
14
  return obj;
15
15
  }
16
- if (parent && parent.$options && (parent.$options.name === 'bbn-loadbar')) {
17
- log(["MAKING bbn-loadbar", obj]);
16
+ if (parent && parent.$options && parent.$options.name === 'bbn-loadbar') {
17
+ log(['MAKING bbn-loadbar', obj]);
18
18
  }
19
19
  if (!obj.__bbnWatchers) {
20
20
  Reflect.defineProperty(obj, '__bbnWatchers', {
21
21
  value: createObject(),
22
22
  writable: true,
23
23
  configurable: true,
24
- enumerable: false
24
+ enumerable: false,
25
25
  });
26
26
  }
27
27
  const handler = {
@@ -33,10 +33,11 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
33
33
  }
34
34
  const propName = parentProp ? parentProp + '.' + key : key;
35
35
  const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
36
- if (['fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].includes(key) && isArray(target)) {
36
+ if (['fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].includes(key) &&
37
+ isArray(target)) {
37
38
  return function (...args) {
38
39
  let res = realTarget[key](...args);
39
- warning("DOING ARRAY STUFF");
40
+ warning('DOING ARRAY STUFF');
40
41
  log(target.__bbnParent);
41
42
  onSet(target, 'length', parent);
42
43
  return res;
@@ -67,22 +68,24 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
67
68
  if (key.indexOf('__bbn_') === 0) {
68
69
  return Reflect.get(target, key);
69
70
  }
70
- if ((key === 'length') && isArray(target.__bbnRoot || target)) {
71
+ if (key === 'length' && isArray(target.__bbnRoot || target)) {
71
72
  return realTarget.length;
72
73
  }
73
- if (!Object.hasOwn(target, key)) {
74
+ if (!(key in target)) {
74
75
  return realValue;
75
76
  }
76
- if (realValue && (typeof realValue === 'object') && [undefined, Object, Array].includes(realValue.constructor)) {
77
- if (realValue.__bbnIsProxy && (realValue.__bbnParent === parent)) {
77
+ if (realValue &&
78
+ typeof realValue === 'object' &&
79
+ [undefined, Object, Array].includes(realValue.constructor)) {
80
+ if (realValue.__bbnIsProxy && realValue.__bbnParent === parent) {
78
81
  return realTarget[hiddenKey];
79
82
  }
80
- if (!Object.hasOwn(realTarget, hiddenKey)) {
83
+ if (!(hiddenKey in realTarget)) {
81
84
  Reflect.defineProperty(realTarget, hiddenKey, {
82
85
  value: makeReactive(realValue, onSet, parent, propName),
83
86
  writable: true,
84
87
  configurable: true,
85
- enumerable: false
88
+ enumerable: false,
86
89
  });
87
90
  }
88
91
  if (realTarget[hiddenKey].__bbnIsProxy && !realTarget.__bbnWatchers[parentString]) {
@@ -101,7 +104,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
101
104
  if (isSymbol(key)) {
102
105
  return Reflect.get(target, key);
103
106
  }
104
- if (parent && parent.$options && (parent.$options.name === 'bbn-loadbar')) {
107
+ if (parent && parent.$options && parent.$options.name === 'bbn-loadbar') {
105
108
  log(['Setting proxy prop in ' + parent.$options.name, target, key, value]);
106
109
  }
107
110
  if (!isSame(realTarget[key], value)) {
@@ -110,25 +113,34 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
110
113
  value: makeReactive(value, onSet, parent, propName),
111
114
  writable: true,
112
115
  configurable: true,
113
- enumerable: false
116
+ enumerable: false,
114
117
  });
115
118
  }
116
119
  else {
117
- if (value && (typeof value === 'object') && [undefined, Object, Array].includes(value.constructor)) {
120
+ if (value &&
121
+ typeof value === 'object' &&
122
+ [undefined, Object, Array].includes(value.constructor)) {
118
123
  const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
119
124
  Reflect.defineProperty(realTarget, hiddenKey, {
120
125
  value: makeReactive(value, onSet, parent, propName),
121
126
  writable: true,
122
127
  configurable: true,
123
- enumerable: false
128
+ enumerable: false,
124
129
  });
125
130
  if (realTarget[hiddenKey].__bbnIsProxy && !realTarget.__bbnWatchers[parentString]) {
126
131
  realTarget.__bbnWatchers[parentString] = propName;
127
132
  }
128
133
  }
129
134
  }
130
- if (parent && parent.$options && (parent.$options.name === 'bbn-loadbar')) {
131
- log(['Setting proxy prop in ' + parent.$options.name + ' ' + (isNumber(key) ? key.toString() : key), value, target]);
135
+ if (parent && parent.$options && parent.$options.name === 'bbn-loadbar') {
136
+ log([
137
+ 'Setting proxy prop in ' +
138
+ parent.$options.name +
139
+ ' ' +
140
+ (isNumber(key) ? key.toString() : key),
141
+ value,
142
+ target,
143
+ ]);
132
144
  }
133
145
  Reflect.set(realTarget, key, value);
134
146
  onSet(target, key, parent);
@@ -138,7 +150,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
138
150
  defineProperty(target, key, description) {
139
151
  const realTarget = target;
140
152
  const propName = parentProp ? parentProp + '.' + key : key;
141
- if ((key === '__bbnWatchers') || isSymbol(key) || (key.indexOf('__bbn_') === 0)) {
153
+ if (key === '__bbnWatchers' || isSymbol(key) || key.indexOf('__bbn_') === 0) {
142
154
  Reflect.defineProperty(realTarget, key, description);
143
155
  }
144
156
  else {
@@ -147,7 +159,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
147
159
  value: makeReactive(description.value, onSet, parent, propName),
148
160
  writable: true,
149
161
  configurable: true,
150
- enumerable: false
162
+ enumerable: false,
151
163
  });
152
164
  }
153
165
  onSet(target, key, parent);
@@ -164,9 +176,9 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
164
176
  Reflect.deleteProperty(target, key);
165
177
  }
166
178
  return true;
167
- }
179
+ },
168
180
  };
169
- return (new Proxy(obj, handler));
181
+ return new Proxy(obj, handler);
170
182
  }
171
183
  return obj;
172
184
  };
package/dist/fn/map.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import { map } from './map';
2
1
  declare const map: (arr: any, fn: any, deepProp: any, level?: number) => any;
3
2
  export { map };
package/dist/fn/md5.js CHANGED
@@ -1,14 +1,34 @@
1
1
  const md5 = function (st) {
2
- var hc = "0123456789abcdef";
3
- function rh(n) { var j, s = ""; for (j = 0; j <= 3; j++)
4
- s += hc.charAt((n >> (j * 8 + 4)) & 0x0F) + hc.charAt((n >> (j * 8)) & 0x0F); return s; }
5
- function ad(x, y) { var l = (x & 0xFFFF) + (y & 0xFFFF); var m = (x >> 16) + (y >> 16) + (l >> 16); return (m << 16) | (l & 0xFFFF); }
6
- function rl(n, c) { return (n << c) | (n >>> (32 - c)); }
7
- function cm(q, a, b, x, s, t) { return ad(rl(ad(ad(a, q), ad(x, t)), s), b); }
8
- function ff(a, b, c, d, x, s, t) { return cm((b & c) | ((~b) & d), a, b, x, s, t); }
9
- function gg(a, b, c, d, x, s, t) { return cm((b & d) | (c & (~d)), a, b, x, s, t); }
10
- function hh(a, b, c, d, x, s, t) { return cm(b ^ c ^ d, a, b, x, s, t); }
11
- function ii(a, b, c, d, x, s, t) { return cm(c ^ (b | (~d)), a, b, x, s, t); }
2
+ var hc = '0123456789abcdef';
3
+ function rh(n) {
4
+ var j, s = '';
5
+ for (j = 0; j <= 3; j++)
6
+ s += hc.charAt((n >> (j * 8 + 4)) & 0x0f) + hc.charAt((n >> (j * 8)) & 0x0f);
7
+ return s;
8
+ }
9
+ function ad(x, y) {
10
+ var l = (x & 0xffff) + (y & 0xffff);
11
+ var m = (x >> 16) + (y >> 16) + (l >> 16);
12
+ return (m << 16) | (l & 0xffff);
13
+ }
14
+ function rl(n, c) {
15
+ return (n << c) | (n >>> (32 - c));
16
+ }
17
+ function cm(q, a, b, x, s, t) {
18
+ return ad(rl(ad(ad(a, q), ad(x, t)), s), b);
19
+ }
20
+ function ff(a, b, c, d, x, s, t) {
21
+ return cm((b & c) | (~b & d), a, b, x, s, t);
22
+ }
23
+ function gg(a, b, c, d, x, s, t) {
24
+ return cm((b & d) | (c & ~d), a, b, x, s, t);
25
+ }
26
+ function hh(a, b, c, d, x, s, t) {
27
+ return cm(b ^ c ^ d, a, b, x, s, t);
28
+ }
29
+ function ii(a, b, c, d, x, s, t) {
30
+ return cm(c ^ (b | ~d), a, b, x, s, t);
31
+ }
12
32
  function sb(x) {
13
33
  var i;
14
34
  var nblk = ((x.length + 8) >> 6) + 1;
@@ -1,2 +1,2 @@
1
- declare const money: (val: any, kilo: any, currency: any, novalue: any, decimal: any, thousands: any, precision: any) => any;
1
+ declare const money: (val: number, kilo?: boolean, currency?: string, novalue?: string | false, decimal?: string, thousands?: string, precision?: number) => string;
2
2
  export { money };