@bbn/bbn 1.0.30 → 1.0.31

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 +8 -8
  2. package/dist/bundle.js +11 -11
  3. package/dist/fn/_addLoader.js +3 -6
  4. package/dist/fn/_compareValues.js +11 -14
  5. package/dist/fn/_deleteLoader.js +7 -10
  6. package/dist/fn/abort.js +3 -6
  7. package/dist/fn/abortURL.js +4 -7
  8. package/dist/fn/addColors.js +5 -8
  9. package/dist/fn/addInputs.js +3 -6
  10. package/dist/fn/addStyle.js +5 -8
  11. package/dist/fn/adjustHeight.js +5 -8
  12. package/dist/fn/adjustSize.js +5 -8
  13. package/dist/fn/adjustWidth.js +5 -8
  14. package/dist/fn/ajax.js +31 -34
  15. package/dist/fn/analyzeFunction.js +3 -6
  16. package/dist/fn/animateCss.js +1 -4
  17. package/dist/fn/arrayBuffer2String.js +1 -4
  18. package/dist/fn/arrayFromProp.js +5 -8
  19. package/dist/fn/autoExtend.js +4 -7
  20. package/dist/fn/baseName.js +6 -9
  21. package/dist/fn/br2nl.js +3 -6
  22. package/dist/fn/calendar.js +10 -15
  23. package/dist/fn/callback.js +16 -19
  24. package/dist/fn/camelToCss.js +1 -4
  25. package/dist/fn/camelize.js +1 -4
  26. package/dist/fn/canvasToImage.js +1 -4
  27. package/dist/fn/center.js +1 -4
  28. package/dist/fn/checkProps.js +3 -6
  29. package/dist/fn/checkPropsDetails.js +9 -12
  30. package/dist/fn/checkPropsOrDie.js +3 -6
  31. package/dist/fn/checkType.js +16 -19
  32. package/dist/fn/chrono.js +3 -7
  33. package/dist/fn/circularReplacer.js +7 -10
  34. package/dist/fn/clone.js +7 -10
  35. package/dist/fn/colorToHex.js +1 -4
  36. package/dist/fn/compare.js +18 -21
  37. package/dist/fn/compareConditions.js +10 -13
  38. package/dist/fn/copy.js +4 -7
  39. package/dist/fn/correctCase.js +1 -4
  40. package/dist/fn/count.js +3 -6
  41. package/dist/fn/crc32.js +1 -4
  42. package/dist/fn/createObject.js +3 -6
  43. package/dist/fn/cssExists.js +3 -6
  44. package/dist/fn/date.js +8 -11
  45. package/dist/fn/dateSQL.d.ts +1 -1
  46. package/dist/fn/dateSQL.js +3 -7
  47. package/dist/fn/daysInMonth.d.ts +1 -1
  48. package/dist/fn/daysInMonth.js +3 -7
  49. package/dist/fn/deepPath.js +7 -10
  50. package/dist/fn/defaultAjaxAbortFunction.js +3 -6
  51. package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
  52. package/dist/fn/defaultAjaxErrorFunction.js +1 -4
  53. package/dist/fn/defaultAlertFunction.js +1 -4
  54. package/dist/fn/defaultConfirmFunction.js +4 -7
  55. package/dist/fn/defaultEndLoadingFunction.js +1 -4
  56. package/dist/fn/defaultErrorFunction.js +3 -6
  57. package/dist/fn/defaultHistoryFunction.js +1 -4
  58. package/dist/fn/defaultLinkFunction.js +1 -4
  59. package/dist/fn/defaultPostLinkFunction.js +1 -4
  60. package/dist/fn/defaultPreLinkFunction.js +1 -4
  61. package/dist/fn/defaultResizeFunction.js +1 -4
  62. package/dist/fn/defaultStartLoadingFunction.js +1 -4
  63. package/dist/fn/deleteProp.js +4 -7
  64. package/dist/fn/diffObj.js +16 -19
  65. package/dist/fn/dirName.js +7 -10
  66. package/dist/fn/download.js +15 -18
  67. package/dist/fn/downloadContent.js +9 -12
  68. package/dist/fn/each.js +7 -10
  69. package/dist/fn/eraseCookie.js +1 -4
  70. package/dist/fn/error.js +3 -6
  71. package/dist/fn/escapeDquotes.js +3 -6
  72. package/dist/fn/escapeRegExp.js +1 -4
  73. package/dist/fn/escapeSquotes.js +3 -6
  74. package/dist/fn/escapeTicks.js +3 -6
  75. package/dist/fn/escapeUrl.js +8 -11
  76. package/dist/fn/extend.js +13 -16
  77. package/dist/fn/extendOut.js +4 -7
  78. package/dist/fn/fdate.js +9 -13
  79. package/dist/fn/fdatetime.js +7 -11
  80. package/dist/fn/fieldValue.js +1 -4
  81. package/dist/fn/fileExt.js +3 -6
  82. package/dist/fn/filter.js +12 -15
  83. package/dist/fn/filterToConditions.js +8 -11
  84. package/dist/fn/findAll.js +7 -10
  85. package/dist/fn/fori.js +6 -9
  86. package/dist/fn/forir.js +6 -9
  87. package/dist/fn/format.js +3 -6
  88. package/dist/fn/formatBytes.js +1 -4
  89. package/dist/fn/formatDate.d.ts +1 -1
  90. package/dist/fn/formatDate.js +1 -5
  91. package/dist/fn/formatSize.js +5 -8
  92. package/dist/fn/formdata.js +11 -14
  93. package/dist/fn/fromXml.js +1 -4
  94. package/dist/fn/ftime.js +8 -13
  95. package/dist/fn/getAllTags.js +3 -6
  96. package/dist/fn/getAncestors.js +1 -4
  97. package/dist/fn/getAttributes.js +3 -6
  98. package/dist/fn/getBrowserName.js +1 -4
  99. package/dist/fn/getBrowserVersion.js +1 -4
  100. package/dist/fn/getCookie.js +1 -4
  101. package/dist/fn/getCssVar.js +1 -4
  102. package/dist/fn/getDay.js +3 -6
  103. package/dist/fn/getDeviceType.js +1 -4
  104. package/dist/fn/getEventData.js +7 -10
  105. package/dist/fn/getField.js +3 -6
  106. package/dist/fn/getFieldValues.js +7 -10
  107. package/dist/fn/getHTMLOfSelection.js +4 -7
  108. package/dist/fn/getHtml.js +3 -6
  109. package/dist/fn/getLoader.js +3 -6
  110. package/dist/fn/getPath.js +3 -6
  111. package/dist/fn/getProp.js +4 -7
  112. package/dist/fn/getProperty.js +1 -4
  113. package/dist/fn/getRequestId.js +5 -8
  114. package/dist/fn/getRow.js +3 -6
  115. package/dist/fn/getScrollBarSize.js +1 -4
  116. package/dist/fn/getText.js +1 -4
  117. package/dist/fn/getTimeoff.js +1 -4
  118. package/dist/fn/happy.js +3 -6
  119. package/dist/fn/hash.js +11 -14
  120. package/dist/fn/hex2rgb.js +1 -4
  121. package/dist/fn/history.js +1 -4
  122. package/dist/fn/html2text.js +1 -4
  123. package/dist/fn/imageToCanvas.js +1 -4
  124. package/dist/fn/imgToBase64.js +3 -6
  125. package/dist/fn/info.js +3 -6
  126. package/dist/fn/init.js +31 -35
  127. package/dist/fn/isActiveInterface.js +1 -4
  128. package/dist/fn/isArray.js +1 -4
  129. package/dist/fn/isBlob.js +1 -4
  130. package/dist/fn/isBoolean.js +1 -4
  131. package/dist/fn/isCanvas.js +1 -4
  132. package/dist/fn/isColor.js +3 -6
  133. package/dist/fn/isComment.js +1 -4
  134. package/dist/fn/isCp.js +3 -6
  135. package/dist/fn/isDate.js +1 -4
  136. package/dist/fn/isDesktopDevice.js +1 -4
  137. package/dist/fn/isDimension.js +3 -6
  138. package/dist/fn/isDom.js +1 -4
  139. package/dist/fn/isEmail.js +3 -6
  140. package/dist/fn/isEmpty.js +5 -8
  141. package/dist/fn/isEvent.js +1 -4
  142. package/dist/fn/isFocused.js +1 -4
  143. package/dist/fn/isFunction.js +1 -4
  144. package/dist/fn/isHostname.js +5 -8
  145. package/dist/fn/isIP.js +3 -6
  146. package/dist/fn/isInside.js +7 -10
  147. package/dist/fn/isInt.js +1 -4
  148. package/dist/fn/isIterable.js +1 -4
  149. package/dist/fn/isMobile.js +4 -7
  150. package/dist/fn/isMobileDevice.js +1 -4
  151. package/dist/fn/isNull.js +1 -4
  152. package/dist/fn/isNumber.js +1 -4
  153. package/dist/fn/isObject.js +1 -4
  154. package/dist/fn/isPercent.js +1 -4
  155. package/dist/fn/isPrimitive.js +1 -4
  156. package/dist/fn/isPromise.js +1 -4
  157. package/dist/fn/isPropSize.js +3 -6
  158. package/dist/fn/isSQLDate.js +1 -4
  159. package/dist/fn/isSame.js +5 -8
  160. package/dist/fn/isString.js +1 -4
  161. package/dist/fn/isSymbol.js +1 -4
  162. package/dist/fn/isTabletDevice.js +1 -4
  163. package/dist/fn/isURL.js +1 -4
  164. package/dist/fn/isValidDimension.js +4 -7
  165. package/dist/fn/isValidName.js +3 -6
  166. package/dist/fn/isValue.js +3 -6
  167. package/dist/fn/isVue.js +1 -4
  168. package/dist/fn/iterate.js +5 -8
  169. package/dist/fn/lightenDarkenHex.js +1 -4
  170. package/dist/fn/link.js +19 -22
  171. package/dist/fn/log.js +3 -6
  172. package/dist/fn/makeReactive.js +28 -31
  173. package/dist/fn/map.js +3 -6
  174. package/dist/fn/md5.js +1 -4
  175. package/dist/fn/money.js +3 -6
  176. package/dist/fn/move.js +1 -4
  177. package/dist/fn/multiorder.js +3 -6
  178. package/dist/fn/nl2br.js +3 -6
  179. package/dist/fn/numProperties.js +1 -4
  180. package/dist/fn/objectToFormData.js +12 -15
  181. package/dist/fn/order.js +3 -6
  182. package/dist/fn/outerHeight.js +3 -6
  183. package/dist/fn/outerWidth.js +3 -6
  184. package/dist/fn/percent.js +1 -4
  185. package/dist/fn/pickValue.js +1 -4
  186. package/dist/fn/post.js +7 -10
  187. package/dist/fn/postOut.js +5 -8
  188. package/dist/fn/printf.js +1 -4
  189. package/dist/fn/quotes2html.js +4 -7
  190. package/dist/fn/randomInt.js +1 -4
  191. package/dist/fn/randomString.js +4 -7
  192. package/dist/fn/removeAccents.js +5 -8
  193. package/dist/fn/removeEmpty.js +8 -11
  194. package/dist/fn/removeExtraSpaces.js +1 -4
  195. package/dist/fn/removeHtmlComments.js +3 -6
  196. package/dist/fn/removePrivateProp.js +3 -6
  197. package/dist/fn/removeTrailingChars.js +6 -9
  198. package/dist/fn/repeat.js +1 -4
  199. package/dist/fn/replaceAll.js +4 -7
  200. package/dist/fn/replaceSelection.js +1 -4
  201. package/dist/fn/resize.js +7 -10
  202. package/dist/fn/rgb2hex.js +1 -4
  203. package/dist/fn/riterate.js +3 -6
  204. package/dist/fn/roundDecimal.js +1 -4
  205. package/dist/fn/sanitize.js +5 -8
  206. package/dist/fn/search.js +15 -18
  207. package/dist/fn/selectElementText.js +1 -4
  208. package/dist/fn/selector.js +1 -4
  209. package/dist/fn/setCookie.js +1 -4
  210. package/dist/fn/setCssVar.js +1 -4
  211. package/dist/fn/setNavigationVars.js +10 -13
  212. package/dist/fn/setProp.js +1 -4
  213. package/dist/fn/setProperty.js +3 -6
  214. package/dist/fn/shorten.js +5 -8
  215. package/dist/fn/shortenObj.js +9 -12
  216. package/dist/fn/shuffle.js +1 -4
  217. package/dist/fn/simpleHash.js +5 -8
  218. package/dist/fn/simpleHash1.js +1 -4
  219. package/dist/fn/simpleHash2.js +1 -4
  220. package/dist/fn/stat.js +1 -4
  221. package/dist/fn/string2ArrayBuffer.js +1 -4
  222. package/dist/fn/submit.js +6 -9
  223. package/dist/fn/substr.js +7 -10
  224. package/dist/fn/sum.js +4 -7
  225. package/dist/fn/timestamp.js +1 -4
  226. package/dist/fn/toCSV.js +8 -11
  227. package/dist/fn/toggleFullScreen.js +3 -6
  228. package/dist/fn/translate.js +3 -6
  229. package/dist/fn/treatAjaxArguments.js +10 -13
  230. package/dist/fn/trim.js +4 -7
  231. package/dist/fn/uniqString.js +7 -10
  232. package/dist/fn/unique.js +1 -4
  233. package/dist/fn/upload.js +6 -10
  234. package/dist/fn/warning.js +3 -6
  235. package/dist/index.d.ts +4 -4
  236. package/dist/index.js +459 -471
  237. package/package.json +1 -1
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outerHeight = void 0;
4
- const selector_1 = require("./selector");
1
+ import { selector } from './selector';
5
2
  const outerHeight = function (ele) {
6
- ele = (0, selector_1.selector)(ele);
3
+ ele = selector(ele);
7
4
  if (ele && ('offsetHeight' in ele)) {
8
5
  let styles = window.getComputedStyle(ele);
9
6
  let margin = parseFloat(styles['marginTop']) + parseFloat(styles['marginBottom']);
10
7
  return Math.ceil(ele.offsetHeight + margin);
11
8
  }
12
9
  };
13
- exports.outerHeight = outerHeight;
10
+ export { outerHeight };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.outerWidth = void 0;
4
- const selector_1 = require("./selector");
1
+ import { selector } from './selector';
5
2
  const outerWidth = function (ele) {
6
- ele = (0, selector_1.selector)(ele);
3
+ ele = selector(ele);
7
4
  let styles = window.getComputedStyle(ele);
8
5
  let margin = parseFloat(styles['marginLeft']) + parseFloat(styles['marginRight']);
9
6
  return Math.ceil(ele.offsetWidth + margin);
10
7
  };
11
- exports.outerWidth = outerWidth;
8
+ export { outerWidth };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.percent = void 0;
4
1
  const percent = function (percent, cent) {
5
2
  return (cent / 100) * percent;
6
3
  };
7
- exports.percent = percent;
4
+ export { percent };
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pickValue = void 0;
4
1
  const pickValue = function (arr) {
5
2
  if (Array.isArray(arr) && arr.length) {
6
3
  return arr[Math.floor(Math.random() * arr.length)];
7
4
  }
8
5
  };
9
- exports.pickValue = pickValue;
6
+ export { pickValue };
package/dist/fn/post.js CHANGED
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.post = void 0;
4
- const treatAjaxArguments_1 = require("./treatAjaxArguments");
5
- const ajax_1 = require("./ajax");
6
- const callback_1 = require("./callback");
1
+ import { treatAjaxArguments } from './treatAjaxArguments';
2
+ import { ajax } from './ajax';
3
+ import { callback } from './callback';
7
4
  const post = function (...args) {
8
- let cfg = (0, treatAjaxArguments_1.treatAjaxArguments)(args);
5
+ let cfg = treatAjaxArguments(args);
9
6
  if (cfg.url) {
10
- return (0, ajax_1.ajax)(cfg.url, cfg.datatype, cfg.obj, (res) => {
11
- (0, callback_1.callback)(cfg.url, res, cfg.successFn, null, cfg.ele);
7
+ return ajax(cfg.url, cfg.datatype, cfg.obj, (res) => {
8
+ callback(cfg.url, res, cfg.successFn, null, cfg.ele);
12
9
  }, cfg.errorFn, cfg.abortFn);
13
10
  }
14
11
  };
15
- exports.post = post;
12
+ export { post };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.postOut = void 0;
4
- const createObject_1 = require("./createObject");
5
- const addInputs_1 = require("./addInputs");
1
+ import { createObject } from './createObject';
2
+ import { addInputs } from './addInputs';
6
3
  const postOut = function (url, data, success, target) {
7
4
  let form = document.body.querySelector('form#bbn-form_out');
8
5
  if (!form) {
@@ -20,14 +17,14 @@ const postOut = function (url, data, success, target) {
20
17
  if (!data) {
21
18
  data = {};
22
19
  }
23
- data = (0, createObject_1.createObject)(data);
20
+ data = createObject(data);
24
21
  if (!data.bbn) {
25
22
  data.bbn = 'public';
26
23
  }
27
- (0, addInputs_1.addInputs)(form, data);
24
+ addInputs(form, data);
28
25
  form.submit();
29
26
  if (success) {
30
27
  success();
31
28
  }
32
29
  };
33
- exports.postOut = postOut;
30
+ export { postOut };
package/dist/fn/printf.js CHANGED
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printf = void 0;
4
1
  const printf = function (format) {
5
2
  var args = Array.prototype.slice.call(arguments, 1);
6
3
  return format.replace(/{(\d+)}/g, function (match, number) {
7
4
  return typeof args[number] != 'undefined' ? args[number] : match;
8
5
  });
9
6
  };
10
- exports.printf = printf;
7
+ export { printf };
@@ -1,14 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.quotes2html = void 0;
4
- const replaceAll_1 = require("./replaceAll");
1
+ import { replaceAll } from './replaceAll';
5
2
  const quotes2html = function (st, type) {
6
3
  if (!type || type.toLowerCase().indexOf('s') === 0) {
7
- st = (0, replaceAll_1.replaceAll)("'", ''', st);
4
+ st = replaceAll("'", ''', st);
8
5
  }
9
6
  if (!type || type.toLowerCase().indexOf('d') === 0) {
10
- st = (0, replaceAll_1.replaceAll)('"', '"', st);
7
+ st = replaceAll('"', '"', st);
11
8
  }
12
9
  return st;
13
10
  };
14
- exports.quotes2html = quotes2html;
11
+ export { quotes2html };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomInt = void 0;
4
1
  const randomInt = function (min, max) {
5
2
  return Math.floor(Math.random() * (max - min + 1) + min);
6
3
  };
7
- exports.randomInt = randomInt;
4
+ export { randomInt };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.randomString = void 0;
4
- const randomInt_1 = require("./randomInt");
1
+ import { randomInt } from './randomInt';
5
2
  const randomString = function (min, max, types) {
6
3
  let length;
7
4
  let type;
@@ -14,7 +11,7 @@ const randomString = function (min, max, types) {
14
11
  types = 'nlu';
15
12
  }
16
13
  if (!min) {
17
- length = (0, randomInt_1.randomInt)(8, 14);
14
+ length = randomInt(8, 14);
18
15
  }
19
16
  if (typeof max === 'string') {
20
17
  types = 'n';
@@ -26,7 +23,7 @@ const randomString = function (min, max, types) {
26
23
  }
27
24
  }
28
25
  else if (typeof max === 'number' && min < max) {
29
- length = (0, randomInt_1.randomInt)(min, max);
26
+ length = randomInt(min, max);
30
27
  }
31
28
  else if (min) {
32
29
  length = min;
@@ -46,4 +43,4 @@ const randomString = function (min, max, types) {
46
43
  }
47
44
  return result;
48
45
  };
49
- exports.randomString = randomString;
46
+ export { randomString };
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeAccents = void 0;
4
- const isString_1 = require("./isString");
5
- const log_1 = require("./log");
1
+ import { isString } from './isString';
2
+ import { log } from './log';
6
3
  const removeAccents = function (st) {
7
- if (!(0, isString_1.isString)(st)) {
4
+ if (!isString(st)) {
8
5
  if (st.toString) {
9
6
  st = st.toString();
10
7
  }
11
8
  else {
12
- (0, log_1.log)(st);
9
+ log(st);
13
10
  throw new Error(bbn._('removeAccent expects a string'));
14
11
  }
15
12
  }
16
13
  return st.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
17
14
  };
18
- exports.removeAccents = removeAccents;
15
+ export { removeAccents };
@@ -1,22 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeEmpty = void 0;
4
- const isArray_1 = require("./isArray");
5
- const isObject_1 = require("./isObject");
6
- const numProperties_1 = require("./numProperties");
1
+ import { isArray } from './isArray';
2
+ import { isObject } from './isObject';
3
+ import { numProperties } from './numProperties';
7
4
  const removeEmpty = function (arr) {
8
5
  var tmp = [];
9
- if ((0, isArray_1.isArray)(arr)) {
6
+ if (isArray(arr)) {
10
7
  for (let i = 0; i < arr.length; i++) {
11
8
  let ok = false;
12
9
  if (arr[i]) {
13
- if ((0, isArray_1.isArray)(arr[i])) {
10
+ if (isArray(arr[i])) {
14
11
  if (arr[i].length) {
15
12
  ok = true;
16
13
  }
17
14
  }
18
- else if ((0, isObject_1.isObject)(arr[i])) {
19
- if ((0, numProperties_1.numProperties)(arr[i])) {
15
+ else if (isObject(arr[i])) {
16
+ if (numProperties(arr[i])) {
20
17
  ok = true;
21
18
  }
22
19
  }
@@ -31,4 +28,4 @@ const removeEmpty = function (arr) {
31
28
  }
32
29
  return tmp;
33
30
  };
34
- exports.removeEmpty = removeEmpty;
31
+ export { removeEmpty };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeExtraSpaces = void 0;
4
1
  const removeExtraSpaces = function (str) {
5
2
  return str.replace(/\s+/g, ' ').trim();
6
3
  };
7
- exports.removeExtraSpaces = removeExtraSpaces;
4
+ export { removeExtraSpaces };
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeHtmlComments = void 0;
4
- const isString_1 = require("./isString");
1
+ import { isString } from './isString';
5
2
  const removeHtmlComments = function (str) {
6
- if (!(0, isString_1.isString)(str)) {
3
+ if (!isString(str)) {
7
4
  return str;
8
5
  }
9
6
  return str.replace(/<!--[\s\S]*?-->/g, '');
10
7
  };
11
- exports.removeHtmlComments = removeHtmlComments;
8
+ export { removeHtmlComments };
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removePrivateProp = void 0;
4
- const substr_1 = require("./substr");
1
+ import { substr } from './substr';
5
2
  const removePrivateProp = function (obj, deep = false) {
6
3
  let r = null;
7
4
  if (typeof obj === 'object') {
8
5
  r = {};
9
6
  for (var n in obj) {
10
- if ((0, substr_1.substr)(n, 0, 1).match(/^[A-z0-9]$/) && (n in obj)) {
7
+ if (substr(n, 0, 1).match(/^[A-z0-9]$/) && (n in obj)) {
11
8
  if (deep && typeof obj[n] === 'object') {
12
9
  r[n] = removePrivateProp(obj[n], true);
13
10
  }
@@ -19,4 +16,4 @@ const removePrivateProp = function (obj, deep = false) {
19
16
  }
20
17
  return r || false;
21
18
  };
22
- exports.removePrivateProp = removePrivateProp;
19
+ export { removePrivateProp };
@@ -1,19 +1,16 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeTrailingChars = void 0;
4
- const substr_1 = require("./substr");
1
+ import { substr } from './substr';
5
2
  const removeTrailingChars = function (st, char) {
6
3
  if (!char) {
7
4
  char = ' ';
8
5
  }
9
6
  if (char.length) {
10
- while ((0, substr_1.substr)(st, -char.length) === char) {
11
- st = (0, substr_1.substr)(st, 0, st.length - char.length);
7
+ while (substr(st, -char.length) === char) {
8
+ st = substr(st, 0, st.length - char.length);
12
9
  }
13
- while ((0, substr_1.substr)(st, 0, char.length) === char) {
14
- st = (0, substr_1.substr)(st, char.length);
10
+ while (substr(st, 0, char.length) === char) {
11
+ st = substr(st, char.length);
15
12
  }
16
13
  }
17
14
  return st;
18
15
  };
19
- exports.removeTrailingChars = removeTrailingChars;
16
+ export { removeTrailingChars };
package/dist/fn/repeat.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.repeat = void 0;
4
1
  const repeat = function (st, num) {
5
2
  return st.repeat(num);
6
3
  };
7
- exports.repeat = repeat;
4
+ export { repeat };
@@ -1,9 +1,6 @@
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");
1
+ import { isObject } from './isObject';
2
+ import { escapeRegExp } from './escapeRegExp';
6
3
  const replaceAll = function (find, replace, str, flags = '') {
7
- return str.toString().replace((0, isObject_1.isObject)(find) ? find : new RegExp((0, escapeRegExp_1.escapeRegExp)(find), 'g' + flags), replace);
4
+ return str.toString().replace(isObject(find) ? find : new RegExp(escapeRegExp(find), 'g' + flags), replace);
8
5
  };
9
- exports.replaceAll = replaceAll;
6
+ export { replaceAll };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.replaceSelection = void 0;
4
1
  const replaceSelection = function (html, selectInserted) {
5
2
  let sel, range, fragment;
6
3
  sel = window.getSelection();
@@ -42,4 +39,4 @@ const replaceSelection = function (html, selectInserted) {
42
39
  }
43
40
  }
44
41
  };
45
- exports.replaceSelection = replaceSelection;
42
+ export { replaceSelection };
package/dist/fn/resize.js CHANGED
@@ -1,9 +1,6 @@
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");
1
+ import { getCssVar } from './getCssVar';
2
+ import { each } from './each';
3
+ import { defaultResizeFunction } from './defaultResizeFunction';
7
4
  const resize = function () {
8
5
  let diffW = bbn.env.width !== window.innerWidth;
9
6
  let diffH = bbn.env.height !== window.innerHeight;
@@ -18,11 +15,11 @@ const resize = function () {
18
15
  window.innerHeight || window.document.documentElement.clientHeight || window.document.body.clientHeight;
19
16
  document.documentElement.style.setProperty('--vh', bbn.env.height * 0.01 + 'px');
20
17
  }
21
- let smallWidth = parseInt((0, getCssVar_1.getCssVar)('mobile-limit')) || 650;
18
+ let smallWidth = parseInt(getCssVar('mobile-limit')) || 650;
22
19
  let newCls = 'bbn-screen-' + (bbn.env.width < smallWidth ? 'small' : 'regular');
23
20
  let classes = (document.body.className || '').split(' ');
24
21
  let done = false;
25
- (0, each_1.each)(classes, (cls, idx) => {
22
+ each(classes, (cls, idx) => {
26
23
  let bits = cls.split('-');
27
24
  if (bits.length === 3 && cls.indexOf('bbn-screen-') === 0) {
28
25
  done = true;
@@ -36,7 +33,7 @@ const resize = function () {
36
33
  classes.push(newCls);
37
34
  }
38
35
  document.body.className = classes.join(' ');
39
- (0, defaultResizeFunction_1.defaultResizeFunction)();
36
+ defaultResizeFunction();
40
37
  }
41
38
  };
42
- exports.resize = resize;
39
+ export { resize };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rgb2hex = void 0;
4
1
  const rgb2hex = function (rgb) {
5
2
  rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
6
3
  return rgb && rgb.length === 4
@@ -10,4 +7,4 @@ const rgb2hex = function (rgb) {
10
7
  ('0' + parseInt(rgb[3], 10).toString(16)).slice(-2)
11
8
  : '';
12
9
  };
13
- exports.rgb2hex = rgb2hex;
10
+ export { rgb2hex };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.riterate = void 0;
4
- const iterate_1 = require("./iterate");
1
+ import { iterate } from './iterate';
5
2
  const riterate = function (obj, fn, noPrivate) {
6
- return (0, iterate_1.iterate)(obj, fn, noPrivate, true);
3
+ return iterate(obj, fn, noPrivate, true);
7
4
  };
8
- exports.riterate = riterate;
5
+ export { riterate };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.roundDecimal = void 0;
4
1
  const roundDecimal = function (value, decimals) {
5
2
  return Math.round(Math.pow(Math.pow(value, decimals), -decimals));
6
3
  };
7
- exports.roundDecimal = roundDecimal;
4
+ export { roundDecimal };
@@ -1,8 +1,5 @@
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");
1
+ import { removeAccents } from './removeAccents';
2
+ import { trim } from './trim';
6
3
  const sanitize = function (str, separator = '_') {
7
4
  let escaped = ['[', ']', '{', '}', '(', ')', '-', '+', '*', '/'];
8
5
  let exp = '[';
@@ -14,9 +11,9 @@ const sanitize = function (str, separator = '_') {
14
11
  }
15
12
  exp += ']+';
16
13
  let re = new RegExp(exp, 'g');
17
- let res = (0, removeAccents_1.removeAccents)(str)
14
+ let res = removeAccents(str)
18
15
  .replace(/[^a-z0-9]/gi, separator)
19
16
  .replace(re, separator);
20
- return (0, trim_1.trim)(res, separator);
17
+ return trim(res, separator);
21
18
  };
22
- exports.sanitize = sanitize;
19
+ export { sanitize };
package/dist/fn/search.js CHANGED
@@ -1,14 +1,11 @@
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");
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';
10
7
  const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
11
- if (!(0, isIterable_1.isIterable)(arr)) {
8
+ if (!isIterable(arr)) {
12
9
  throw new Error(bbn._('The first argument for a search should be iterable') + ' ' + typeof arr + ' ' + bbn._('given'));
13
10
  }
14
11
  if (!arr.length) {
@@ -30,7 +27,7 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
30
27
  else if (!prop) {
31
28
  isFn = true;
32
29
  filter = a => {
33
- return (0, compareConditions_1.compareConditions)({ value: a }, (0, filterToConditions_1.filterToConditions)({
30
+ return compareConditions({ value: a }, filterToConditions({
34
31
  logic: 'AND',
35
32
  conditions: [
36
33
  {
@@ -45,7 +42,7 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
45
42
  else {
46
43
  startFrom = typeof (operator) === 'number' ? operator : 0;
47
44
  operator = val;
48
- if ((0, isObject_1.isObject)(prop)) {
45
+ if (isObject(prop)) {
49
46
  filter = prop;
50
47
  }
51
48
  else if (typeof (prop) === 'function') {
@@ -53,12 +50,12 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
53
50
  filter = prop;
54
51
  }
55
52
  }
56
- if (isFn || ((0, isObject_1.isObject)(filter) && (0, numProperties_1.numProperties)(filter))) {
57
- if ((0, isNumber_1.isNumber)(operator)) {
53
+ if (isFn || (isObject(filter) && numProperties(filter))) {
54
+ if (isNumber(operator)) {
58
55
  startFrom = typeof (operator) === 'number' ? operator : 0;
59
56
  operator = undefined;
60
57
  }
61
- if (!(0, isNumber_1.isNumber)(startFrom)) {
58
+ if (!isNumber(startFrom)) {
62
59
  startFrom = 0;
63
60
  }
64
61
  if (typeof filter === 'function') {
@@ -69,9 +66,9 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
69
66
  }
70
67
  }
71
68
  else {
72
- filter = (0, filterToConditions_1.filterToConditions)(filter);
69
+ filter = filterToConditions(filter);
73
70
  for (let i = startFrom; i < arr.length; i++) {
74
- if ((0, compareConditions_1.compareConditions)(arr[i], filter)) {
71
+ if (compareConditions(arr[i], filter)) {
75
72
  return i;
76
73
  }
77
74
  }
@@ -79,4 +76,4 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
79
76
  }
80
77
  return -1;
81
78
  };
82
- exports.search = search;
79
+ export { search };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selectElementText = void 0;
4
1
  const selectElementText = function (ele, win) {
5
2
  win = win || window;
6
3
  if (ele instanceof HTMLInputElement) {
@@ -23,4 +20,4 @@ const selectElementText = function (ele, win) {
23
20
  range.select();
24
21
  }
25
22
  };
26
- exports.selectElementText = selectElementText;
23
+ export { selectElementText };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.selector = void 0;
4
1
  const selector = function (ele) {
5
2
  return typeof ele === 'string' ? document.querySelector(ele) : ele;
6
3
  };
7
- exports.selector = selector;
4
+ export { selector };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setCookie = void 0;
4
1
  const setCookie = function (name, value, days) {
5
2
  let expires = '';
6
3
  if (days) {
@@ -11,4 +8,4 @@ const setCookie = function (name, value, days) {
11
8
  let st = escape(JSON.stringify({ value: value }));
12
9
  document.cookie = name + '=' + st + expires + '; path=/';
13
10
  };
14
- exports.setCookie = setCookie;
11
+ export { setCookie };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setCssVar = void 0;
4
1
  const setCssVar = function (varname, value) {
5
2
  if (varname.indexOf('--') !== 0) {
6
3
  varname = '--' + varname;
@@ -8,4 +5,4 @@ const setCssVar = function (varname, value) {
8
5
  /** @todo To Fix */
9
6
  //document.documentElement.setProperty(varname, value);
10
7
  };
11
- exports.setCssVar = setCssVar;
8
+ export { setCssVar };
@@ -1,19 +1,16 @@
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");
1
+ import { substr } from './substr';
2
+ import { filter } from './filter';
3
+ import { extend } from './extend';
4
+ import { html2text } from './html2text';
8
5
  const setNavigationVars = function (url, title, data, repl) {
9
6
  // Current path becomes old path
10
7
  bbn.env.old_path = bbn.env.path;
11
8
  // URL includes the domain
12
- bbn.env.url = ['https:/', 'http://'].includes((0, substr_1.substr)(url, 0, 7)) ? url : bbn.env.root + url;
9
+ bbn.env.url = ['https:/', 'http://'].includes(substr(url, 0, 7)) ? url : bbn.env.root + url;
13
10
  // Path does not
14
- bbn.env.path = (0, substr_1.substr)(bbn.env.url, bbn.env.root.length);
11
+ bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
15
12
  // Params will include each part of the URL
16
- bbn.env.params = (0, filter_1.filter)(bbn.env.path.split('/'), (v) => {
13
+ bbn.env.params = filter(bbn.env.path.split('/'), (v) => {
17
14
  return v !== '';
18
15
  });
19
16
  // Managing history
@@ -31,7 +28,7 @@ const setNavigationVars = function (url, title, data, repl) {
31
28
  // If same URL we replace
32
29
  if (state && state.url === bbn.env.path) {
33
30
  if (state.data) {
34
- (0, extend_1.extend)(obj.data, state.data);
31
+ extend(obj.data, state.data);
35
32
  }
36
33
  if (state.title && !title) {
37
34
  title = state.title;
@@ -44,7 +41,7 @@ const setNavigationVars = function (url, title, data, repl) {
44
41
  }
45
42
  // Otherwise we add the global title at the end
46
43
  else {
47
- title = (0, html2text_1.html2text)(title);
44
+ title = html2text(title);
48
45
  }
49
46
  // Replacing state
50
47
  if (repl) {
@@ -57,4 +54,4 @@ const setNavigationVars = function (url, title, data, repl) {
57
54
  }
58
55
  }
59
56
  };
60
- exports.setNavigationVars = setNavigationVars;
57
+ export { setNavigationVars };