@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,16 +1,19 @@
1
- import { substr } from './substr';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.removeTrailingChars = void 0;
4
+ const substr_1 = require("./substr");
2
5
  const removeTrailingChars = function (st, char) {
3
6
  if (!char) {
4
7
  char = ' ';
5
8
  }
6
9
  if (char.length) {
7
- while (substr(st, -char.length) === char) {
8
- st = substr(st, 0, st.length - char.length);
10
+ while ((0, substr_1.substr)(st, -char.length) === char) {
11
+ st = (0, substr_1.substr)(st, 0, st.length - char.length);
9
12
  }
10
- while (substr(st, 0, char.length) === char) {
11
- st = substr(st, char.length);
13
+ while ((0, substr_1.substr)(st, 0, char.length) === char) {
14
+ st = (0, substr_1.substr)(st, char.length);
12
15
  }
13
16
  }
14
17
  return st;
15
18
  };
16
- export { removeTrailingChars };
19
+ exports.removeTrailingChars = removeTrailingChars;
package/dist/fn/repeat.js CHANGED
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.repeat = void 0;
1
4
  const repeat = function (st, num) {
2
5
  return st.repeat(num);
3
6
  };
4
- export { repeat };
7
+ exports.repeat = repeat;
@@ -1,6 +1,9 @@
1
- import { isObject } from './isObject';
2
- import { escapeRegExp } from './escapeRegExp';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceAll = void 0;
4
+ const isObject_1 = require("./isObject");
5
+ const escapeRegExp_1 = require("./escapeRegExp");
3
6
  const replaceAll = function (find, replace, str, flags = '') {
4
- return str.toString().replace(isObject(find) ? find : new RegExp(escapeRegExp(find), 'g' + flags), replace);
7
+ return str.toString().replace((0, isObject_1.isObject)(find) ? find : new RegExp((0, escapeRegExp_1.escapeRegExp)(find), 'g' + flags), replace);
5
8
  };
6
- export { replaceAll };
9
+ exports.replaceAll = replaceAll;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceSelection = void 0;
1
4
  const replaceSelection = function (html, selectInserted) {
2
5
  let sel, range, fragment;
3
6
  sel = window.getSelection();
@@ -39,4 +42,4 @@ const replaceSelection = function (html, selectInserted) {
39
42
  }
40
43
  }
41
44
  };
42
- export { replaceSelection };
45
+ exports.replaceSelection = replaceSelection;
package/dist/fn/resize.js CHANGED
@@ -1,6 +1,9 @@
1
- import { getCssVar } from './getCssVar';
2
- import { each } from './each';
3
- import { defaultResizeFunction } from './defaultResizeFunction';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resize = void 0;
4
+ const getCssVar_1 = require("./getCssVar");
5
+ const each_1 = require("./each");
6
+ const defaultResizeFunction_1 = require("./defaultResizeFunction");
4
7
  const resize = function () {
5
8
  let diffW = bbn.env.width !== window.innerWidth;
6
9
  let diffH = bbn.env.height !== window.innerHeight;
@@ -15,11 +18,11 @@ const resize = function () {
15
18
  window.innerHeight || window.document.documentElement.clientHeight || window.document.body.clientHeight;
16
19
  document.documentElement.style.setProperty('--vh', bbn.env.height * 0.01 + 'px');
17
20
  }
18
- let smallWidth = parseInt(getCssVar('mobile-limit')) || 650;
21
+ let smallWidth = parseInt((0, getCssVar_1.getCssVar)('mobile-limit')) || 650;
19
22
  let newCls = 'bbn-screen-' + (bbn.env.width < smallWidth ? 'small' : 'regular');
20
23
  let classes = (document.body.className || '').split(' ');
21
24
  let done = false;
22
- each(classes, (cls, idx) => {
25
+ (0, each_1.each)(classes, (cls, idx) => {
23
26
  let bits = cls.split('-');
24
27
  if (bits.length === 3 && cls.indexOf('bbn-screen-') === 0) {
25
28
  done = true;
@@ -33,7 +36,7 @@ const resize = function () {
33
36
  classes.push(newCls);
34
37
  }
35
38
  document.body.className = classes.join(' ');
36
- defaultResizeFunction();
39
+ (0, defaultResizeFunction_1.defaultResizeFunction)();
37
40
  }
38
41
  };
39
- export { resize };
42
+ exports.resize = resize;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rgb2hex = void 0;
1
4
  const rgb2hex = function (rgb) {
2
5
  rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
3
6
  return rgb && rgb.length === 4
@@ -7,4 +10,4 @@ const rgb2hex = function (rgb) {
7
10
  ('0' + parseInt(rgb[3], 10).toString(16)).slice(-2)
8
11
  : '';
9
12
  };
10
- export { rgb2hex };
13
+ exports.rgb2hex = rgb2hex;
@@ -1,5 +1,8 @@
1
- import { iterate } from './iterate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.riterate = void 0;
4
+ const iterate_1 = require("./iterate");
2
5
  const riterate = function (obj, fn, noPrivate) {
3
- return iterate(obj, fn, noPrivate, true);
6
+ return (0, iterate_1.iterate)(obj, fn, noPrivate, true);
4
7
  };
5
- export { riterate };
8
+ exports.riterate = riterate;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.roundDecimal = void 0;
1
4
  const roundDecimal = function (value, decimals) {
2
5
  return Math.round(Math.pow(Math.pow(value, decimals), -decimals));
3
6
  };
4
- export { roundDecimal };
7
+ exports.roundDecimal = roundDecimal;
@@ -1,5 +1,8 @@
1
- import { removeAccents } from './removeAccents';
2
- import { trim } from './trim';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sanitize = void 0;
4
+ const removeAccents_1 = require("./removeAccents");
5
+ const trim_1 = require("./trim");
3
6
  const sanitize = function (str, separator = '_') {
4
7
  let escaped = ['[', ']', '{', '}', '(', ')', '-', '+', '*', '/'];
5
8
  let exp = '[';
@@ -11,9 +14,9 @@ const sanitize = function (str, separator = '_') {
11
14
  }
12
15
  exp += ']+';
13
16
  let re = new RegExp(exp, 'g');
14
- let res = removeAccents(str)
17
+ let res = (0, removeAccents_1.removeAccents)(str)
15
18
  .replace(/[^a-z0-9]/gi, separator)
16
19
  .replace(re, separator);
17
- return trim(res, separator);
20
+ return (0, trim_1.trim)(res, separator);
18
21
  };
19
- export { sanitize };
22
+ exports.sanitize = sanitize;
package/dist/fn/search.js CHANGED
@@ -1,11 +1,14 @@
1
- import { isIterable } from './isIterable';
2
- import { compareConditions } from './compareConditions';
3
- import { filterToConditions } from './filterToConditions';
4
- import { isObject } from './isObject';
5
- import { numProperties } from './numProperties';
6
- import { isNumber } from './isNumber';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.search = void 0;
4
+ const isIterable_1 = require("./isIterable");
5
+ const compareConditions_1 = require("./compareConditions");
6
+ const filterToConditions_1 = require("./filterToConditions");
7
+ const isObject_1 = require("./isObject");
8
+ const numProperties_1 = require("./numProperties");
9
+ const isNumber_1 = require("./isNumber");
7
10
  const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
8
- if (!isIterable(arr)) {
11
+ if (!(0, isIterable_1.isIterable)(arr)) {
9
12
  throw new Error(bbn._('The first argument for a search should be iterable') + ' ' + typeof arr + ' ' + bbn._('given'));
10
13
  }
11
14
  if (!arr.length) {
@@ -27,7 +30,7 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
27
30
  else if (!prop) {
28
31
  isFn = true;
29
32
  filter = a => {
30
- return compareConditions({ value: a }, filterToConditions({
33
+ return (0, compareConditions_1.compareConditions)({ value: a }, (0, filterToConditions_1.filterToConditions)({
31
34
  logic: 'AND',
32
35
  conditions: [
33
36
  {
@@ -42,7 +45,7 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
42
45
  else {
43
46
  startFrom = typeof (operator) === 'number' ? operator : 0;
44
47
  operator = val;
45
- if (isObject(prop)) {
48
+ if ((0, isObject_1.isObject)(prop)) {
46
49
  filter = prop;
47
50
  }
48
51
  else if (typeof (prop) === 'function') {
@@ -50,12 +53,12 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
50
53
  filter = prop;
51
54
  }
52
55
  }
53
- if (isFn || (isObject(filter) && numProperties(filter))) {
54
- if (isNumber(operator)) {
56
+ if (isFn || ((0, isObject_1.isObject)(filter) && (0, numProperties_1.numProperties)(filter))) {
57
+ if ((0, isNumber_1.isNumber)(operator)) {
55
58
  startFrom = typeof (operator) === 'number' ? operator : 0;
56
59
  operator = undefined;
57
60
  }
58
- if (!isNumber(startFrom)) {
61
+ if (!(0, isNumber_1.isNumber)(startFrom)) {
59
62
  startFrom = 0;
60
63
  }
61
64
  if (typeof filter === 'function') {
@@ -66,9 +69,9 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
66
69
  }
67
70
  }
68
71
  else {
69
- filter = filterToConditions(filter);
72
+ filter = (0, filterToConditions_1.filterToConditions)(filter);
70
73
  for (let i = startFrom; i < arr.length; i++) {
71
- if (compareConditions(arr[i], filter)) {
74
+ if ((0, compareConditions_1.compareConditions)(arr[i], filter)) {
72
75
  return i;
73
76
  }
74
77
  }
@@ -76,4 +79,4 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
76
79
  }
77
80
  return -1;
78
81
  };
79
- export { search };
82
+ exports.search = search;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectElementText = void 0;
1
4
  const selectElementText = function (ele, win) {
2
5
  win = win || window;
3
6
  if (ele instanceof HTMLInputElement) {
@@ -20,4 +23,4 @@ const selectElementText = function (ele, win) {
20
23
  range.select();
21
24
  }
22
25
  };
23
- export { selectElementText };
26
+ exports.selectElementText = selectElementText;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selector = void 0;
1
4
  const selector = function (ele) {
2
5
  return typeof ele === 'string' ? document.querySelector(ele) : ele;
3
6
  };
4
- export { selector };
7
+ exports.selector = selector;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setCookie = void 0;
1
4
  const setCookie = function (name, value, days) {
2
5
  let expires = '';
3
6
  if (days) {
@@ -8,4 +11,4 @@ const setCookie = function (name, value, days) {
8
11
  let st = escape(JSON.stringify({ value: value }));
9
12
  document.cookie = name + '=' + st + expires + '; path=/';
10
13
  };
11
- export { setCookie };
14
+ exports.setCookie = setCookie;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setCssVar = void 0;
1
4
  const setCssVar = function (varname, value) {
2
5
  if (varname.indexOf('--') !== 0) {
3
6
  varname = '--' + varname;
@@ -5,4 +8,4 @@ const setCssVar = function (varname, value) {
5
8
  /** @todo To Fix */
6
9
  //document.documentElement.setProperty(varname, value);
7
10
  };
8
- export { setCssVar };
11
+ exports.setCssVar = setCssVar;
@@ -1,16 +1,19 @@
1
- import { substr } from './substr';
2
- import { filter } from './filter';
3
- import { extend } from './extend';
4
- import { html2text } from './html2text';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setNavigationVars = void 0;
4
+ const substr_1 = require("./substr");
5
+ const filter_1 = require("./filter");
6
+ const extend_1 = require("./extend");
7
+ const html2text_1 = require("./html2text");
5
8
  const setNavigationVars = function (url, title, data, repl) {
6
9
  // Current path becomes old path
7
10
  bbn.env.old_path = bbn.env.path;
8
11
  // URL includes the domain
9
- bbn.env.url = ['https:/', 'http://'].includes(substr(url, 0, 7)) ? url : bbn.env.root + url;
12
+ bbn.env.url = ['https:/', 'http://'].includes((0, substr_1.substr)(url, 0, 7)) ? url : bbn.env.root + url;
10
13
  // Path does not
11
- bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
14
+ bbn.env.path = (0, substr_1.substr)(bbn.env.url, bbn.env.root.length);
12
15
  // Params will include each part of the URL
13
- bbn.env.params = filter(bbn.env.path.split('/'), (v) => {
16
+ bbn.env.params = (0, filter_1.filter)(bbn.env.path.split('/'), (v) => {
14
17
  return v !== '';
15
18
  });
16
19
  // Managing history
@@ -28,7 +31,7 @@ const setNavigationVars = function (url, title, data, repl) {
28
31
  // If same URL we replace
29
32
  if (state && state.url === bbn.env.path) {
30
33
  if (state.data) {
31
- extend(obj.data, state.data);
34
+ (0, extend_1.extend)(obj.data, state.data);
32
35
  }
33
36
  if (state.title && !title) {
34
37
  title = state.title;
@@ -41,7 +44,7 @@ const setNavigationVars = function (url, title, data, repl) {
41
44
  }
42
45
  // Otherwise we add the global title at the end
43
46
  else {
44
- title = html2text(title);
47
+ title = (0, html2text_1.html2text)(title);
45
48
  }
46
49
  // Replacing state
47
50
  if (repl) {
@@ -54,4 +57,4 @@ const setNavigationVars = function (url, title, data, repl) {
54
57
  }
55
58
  }
56
59
  };
57
- export { setNavigationVars };
60
+ exports.setNavigationVars = setNavigationVars;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setProp = void 0;
1
4
  const setProp = function (obj, prop, value, writable = true, configurable = true) {
2
5
  Object.defineProperty(obj, prop, {
3
6
  value: value,
@@ -5,4 +8,4 @@ const setProp = function (obj, prop, value, writable = true, configurable = true
5
8
  configurable: configurable,
6
9
  });
7
10
  };
8
- export { setProp };
11
+ exports.setProp = setProp;
@@ -1,9 +1,12 @@
1
- import { each } from './each';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.setProperty = void 0;
4
+ const each_1 = require("./each");
2
5
  const setProperty = function (obj, prop, value, force) {
3
6
  if (typeof obj === 'object' && typeof prop === 'string') {
4
7
  let o = obj;
5
8
  const bits = prop.split('.');
6
- each(bits, (v, i) => {
9
+ (0, each_1.each)(bits, (v, i) => {
7
10
  if (!o) {
8
11
  if (!force) {
9
12
  throw new Error(bbn._('The object is invalid'));
@@ -19,4 +22,4 @@ const setProperty = function (obj, prop, value, force) {
19
22
  });
20
23
  }
21
24
  };
22
- export { setProperty };
25
+ exports.setProperty = setProperty;
@@ -1,17 +1,20 @@
1
- import { isString } from './isString';
2
- import { substr } from './substr';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shorten = void 0;
4
+ const isString_1 = require("./isString");
5
+ const substr_1 = require("./substr");
3
6
  const shorten = function (st, len, adj) {
4
7
  if (typeof st.toLowerCase() === 'string') {
5
8
  if (!len) {
6
9
  len = bbn.vars.shortenLen;
7
10
  }
8
- if (adj === undefined || !isString(adj)) {
11
+ if (adj === undefined || !(0, isString_1.isString)(adj)) {
9
12
  adj = '...';
10
13
  }
11
14
  if (st.length > len) {
12
- st = substr(st, 0, len) + adj;
15
+ st = (0, substr_1.substr)(st, 0, len) + adj;
13
16
  }
14
17
  }
15
18
  return st;
16
19
  };
17
- export { shorten };
20
+ exports.shorten = shorten;
@@ -1,12 +1,15 @@
1
- import { clone } from './clone';
2
- import { each } from './each';
3
- import { isString } from './isString';
4
- import { shorten } from './shorten';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shortenObj = void 0;
4
+ const clone_1 = require("./clone");
5
+ const each_1 = require("./each");
6
+ const isString_1 = require("./isString");
7
+ const shorten_1 = require("./shorten");
5
8
  const shortenObj = function (obj, max = 100) {
6
- let o = clone(obj);
7
- each(o, (a, n) => {
8
- if (isString(a) && a.length > max) {
9
- o[n] = shorten(a, max);
9
+ let o = (0, clone_1.clone)(obj);
10
+ (0, each_1.each)(o, (a, n) => {
11
+ if ((0, isString_1.isString)(a) && a.length > max) {
12
+ o[n] = (0, shorten_1.shorten)(a, max);
10
13
  }
11
14
  else if (a && typeof a === 'object') {
12
15
  o[n] = shortenObj(a);
@@ -14,4 +17,4 @@ const shortenObj = function (obj, max = 100) {
14
17
  });
15
18
  return o;
16
19
  };
17
- export { shortenObj };
20
+ exports.shortenObj = shortenObj;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.shuffle = void 0;
1
4
  const shuffle = function (array) {
2
5
  let currentIndex = array.length, randomIndex;
3
6
  // While there remain elements to shuffle.
@@ -10,4 +13,4 @@ const shuffle = function (array) {
10
13
  }
11
14
  return array;
12
15
  };
13
- export { shuffle };
16
+ exports.shuffle = shuffle;
@@ -1,8 +1,11 @@
1
- import { simpleHash1 } from './simpleHash1';
2
- import { simpleHash2 } from './simpleHash2';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.simpleHash = void 0;
4
+ const simpleHash1_1 = require("./simpleHash1");
5
+ const simpleHash2_1 = require("./simpleHash2");
3
6
  const simpleHash = function (str) {
4
- const part1 = simpleHash1(str).toString(16).padStart(8, '0');
5
- const part2 = simpleHash2(str).toString(16).padStart(8, '0');
7
+ const part1 = (0, simpleHash1_1.simpleHash1)(str).toString(16).padStart(8, '0');
8
+ const part2 = (0, simpleHash2_1.simpleHash2)(str).toString(16).padStart(8, '0');
6
9
  return part1 + part2;
7
10
  };
8
- export { simpleHash };
11
+ exports.simpleHash = simpleHash;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.simpleHash1 = void 0;
1
4
  const simpleHash1 = function (str) {
2
5
  let hash = 0;
3
6
  for (let i = 0; i < str.length; i++) {
@@ -7,4 +10,4 @@ const simpleHash1 = function (str) {
7
10
  }
8
11
  return hash;
9
12
  };
10
- export { simpleHash1 };
13
+ exports.simpleHash1 = simpleHash1;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.simpleHash2 = void 0;
1
4
  const simpleHash2 = function (str) {
2
5
  let hash = 0;
3
6
  for (let i = 0; i < str.length; i++) {
@@ -7,4 +10,4 @@ const simpleHash2 = function (str) {
7
10
  }
8
11
  return hash;
9
12
  };
10
- export { simpleHash2 };
13
+ exports.simpleHash2 = simpleHash2;
package/dist/fn/stat.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stat = void 0;
1
4
  const stat = function (returnStat) {
2
5
  return;
3
6
  /*
@@ -46,4 +49,4 @@ const stat = function (returnStat) {
46
49
  }
47
50
  */
48
51
  };
49
- export { stat };
52
+ exports.stat = stat;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.string2ArrayBuffer = void 0;
1
4
  const string2ArrayBuffer = function (str) {
2
5
  var buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char
3
6
  var bufView = new Uint16Array(buf);
@@ -6,4 +9,4 @@ const string2ArrayBuffer = function (str) {
6
9
  }
7
10
  return buf;
8
11
  };
9
- export { string2ArrayBuffer };
12
+ exports.string2ArrayBuffer = string2ArrayBuffer;
package/dist/fn/submit.js CHANGED
@@ -1,5 +1,8 @@
1
- import { formdata } from './formdata';
2
- import { post } from './post';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.submit = void 0;
4
+ const formdata_1 = require("./formdata");
5
+ const post_1 = require("./post");
3
6
  const submit = function (form, e, fn) {
4
7
  let url = form.getAttribute('action') || bbn.env.path;
5
8
  let data;
@@ -13,7 +16,7 @@ const submit = function (form, e, fn) {
13
16
  if (e) {
14
17
  e.preventDefault();
15
18
  }
16
- data = formdata(form);
19
+ data = (0, formdata_1.formdata)(form);
17
20
  if (data) {
18
21
  //$form.attr("action", null);
19
22
  form.setAttribute('action', null);
@@ -22,12 +25,12 @@ const submit = function (form, e, fn) {
22
25
  fn = form.getAttribute('data-script') ? eval(form.getAttribute('data-script')) : null;
23
26
  }
24
27
  if (fn) {
25
- post(url, data, fn);
28
+ (0, post_1.post)(url, data, fn);
26
29
  }
27
30
  else {
28
- post(url, data);
31
+ (0, post_1.post)(url, data);
29
32
  }
30
33
  }
31
34
  }
32
35
  };
33
- export { submit };
36
+ exports.submit = submit;
package/dist/fn/substr.js CHANGED
@@ -1,17 +1,20 @@
1
- import { isString } from './isString';
2
- import { isInt } from './isInt';
3
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.substr = void 0;
4
+ const isString_1 = require("./isString");
5
+ const isInt_1 = require("./isInt");
6
+ const log_1 = require("./log");
4
7
  const substr = function (str, from, length) {
5
- if (!isString(str) || !isInt(from)) {
6
- log(arguments);
8
+ if (!(0, isString_1.isString)(str) || !(0, isInt_1.isInt)(from)) {
9
+ (0, log_1.log)(arguments);
7
10
  throw new Error(bbn._('The substr function should be applied to a string and at least a `from` argument should be given'));
8
11
  }
9
12
  if (from < 0) {
10
13
  from = str.length + from;
11
14
  }
12
- if (!isInt(length)) {
15
+ if (!(0, isInt_1.isInt)(length)) {
13
16
  return str.substring(from);
14
17
  }
15
18
  return str.substring(from, (length < 0 ? str.length : from) + length);
16
19
  };
17
- export { substr };
20
+ exports.substr = substr;
package/dist/fn/sum.js CHANGED
@@ -1,8 +1,11 @@
1
- import { each } from './each';
2
- import { filter } from './filter';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sum = void 0;
4
+ const each_1 = require("./each");
5
+ const filter_1 = require("./filter");
3
6
  const sum = function (arr, numberProp, prop, val, operator) {
4
7
  let r = 0;
5
- each(filter(arr, prop, val, operator), (a) => {
8
+ (0, each_1.each)((0, filter_1.filter)(arr, prop, val, operator), (a) => {
6
9
  let tmp = typeof numberProp === 'function' ? numberProp(a) : a[numberProp];
7
10
  if (tmp) {
8
11
  r += parseFloat(tmp) || 0;
@@ -10,4 +13,4 @@ const sum = function (arr, numberProp, prop, val, operator) {
10
13
  });
11
14
  return r;
12
15
  };
13
- export { sum };
16
+ exports.sum = sum;
@@ -1,5 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.timestamp = void 0;
1
4
  const timestamp = function (seconds) {
2
5
  var r = new Date().getTime();
3
6
  return seconds ? Math.round(r / 1000) : r;
4
7
  };
5
- export { timestamp };
8
+ exports.timestamp = timestamp;