@bbn/bbn 1.0.29 → 1.0.30

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 (234) hide show
  1. package/dist/fn/_addLoader.js +6 -3
  2. package/dist/fn/_compareValues.js +14 -11
  3. package/dist/fn/_deleteLoader.js +10 -7
  4. package/dist/fn/abort.js +6 -3
  5. package/dist/fn/abortURL.js +7 -4
  6. package/dist/fn/addColors.js +8 -5
  7. package/dist/fn/addInputs.js +6 -3
  8. package/dist/fn/addStyle.js +8 -5
  9. package/dist/fn/adjustHeight.js +8 -5
  10. package/dist/fn/adjustSize.js +8 -5
  11. package/dist/fn/adjustWidth.js +8 -5
  12. package/dist/fn/ajax.js +34 -31
  13. package/dist/fn/analyzeFunction.js +6 -3
  14. package/dist/fn/animateCss.js +4 -1
  15. package/dist/fn/arrayBuffer2String.js +4 -1
  16. package/dist/fn/arrayFromProp.js +8 -5
  17. package/dist/fn/autoExtend.js +7 -4
  18. package/dist/fn/baseName.js +9 -6
  19. package/dist/fn/br2nl.js +6 -3
  20. package/dist/fn/calendar.js +14 -11
  21. package/dist/fn/callback.js +19 -16
  22. package/dist/fn/camelToCss.js +4 -1
  23. package/dist/fn/camelize.js +4 -1
  24. package/dist/fn/canvasToImage.js +4 -1
  25. package/dist/fn/center.js +4 -1
  26. package/dist/fn/checkProps.js +6 -3
  27. package/dist/fn/checkPropsDetails.js +12 -9
  28. package/dist/fn/checkPropsOrDie.js +6 -3
  29. package/dist/fn/checkType.js +19 -16
  30. package/dist/fn/chrono.js +7 -3
  31. package/dist/fn/circularReplacer.js +10 -7
  32. package/dist/fn/clone.js +10 -7
  33. package/dist/fn/colorToHex.js +4 -1
  34. package/dist/fn/compare.js +21 -18
  35. package/dist/fn/compareConditions.js +13 -10
  36. package/dist/fn/copy.js +7 -4
  37. package/dist/fn/correctCase.js +4 -1
  38. package/dist/fn/count.js +6 -3
  39. package/dist/fn/crc32.js +4 -1
  40. package/dist/fn/createObject.js +6 -3
  41. package/dist/fn/cssExists.js +6 -3
  42. package/dist/fn/date.js +11 -8
  43. package/dist/fn/dateSQL.d.ts +1 -1
  44. package/dist/fn/dateSQL.js +7 -4
  45. package/dist/fn/daysInMonth.d.ts +1 -1
  46. package/dist/fn/daysInMonth.js +7 -4
  47. package/dist/fn/deepPath.js +10 -7
  48. package/dist/fn/defaultAjaxAbortFunction.js +6 -3
  49. package/dist/fn/defaultAjaxErrorFunction.js +4 -1
  50. package/dist/fn/defaultAlertFunction.js +4 -1
  51. package/dist/fn/defaultConfirmFunction.js +7 -4
  52. package/dist/fn/defaultEndLoadingFunction.js +4 -1
  53. package/dist/fn/defaultErrorFunction.js +6 -3
  54. package/dist/fn/defaultHistoryFunction.js +4 -1
  55. package/dist/fn/defaultLinkFunction.js +4 -1
  56. package/dist/fn/defaultPostLinkFunction.js +4 -1
  57. package/dist/fn/defaultPreLinkFunction.js +4 -1
  58. package/dist/fn/defaultResizeFunction.js +4 -1
  59. package/dist/fn/defaultStartLoadingFunction.js +4 -1
  60. package/dist/fn/deleteProp.js +7 -4
  61. package/dist/fn/diffObj.js +19 -16
  62. package/dist/fn/dirName.js +10 -7
  63. package/dist/fn/download.js +18 -15
  64. package/dist/fn/downloadContent.js +12 -9
  65. package/dist/fn/each.js +10 -7
  66. package/dist/fn/eraseCookie.js +4 -1
  67. package/dist/fn/error.js +6 -3
  68. package/dist/fn/escapeDquotes.js +6 -3
  69. package/dist/fn/escapeRegExp.js +4 -1
  70. package/dist/fn/escapeSquotes.js +6 -3
  71. package/dist/fn/escapeTicks.js +6 -3
  72. package/dist/fn/escapeUrl.js +11 -8
  73. package/dist/fn/extend.js +16 -13
  74. package/dist/fn/extendOut.js +7 -4
  75. package/dist/fn/fdate.js +13 -10
  76. package/dist/fn/fdatetime.js +11 -8
  77. package/dist/fn/fieldValue.js +4 -1
  78. package/dist/fn/fileExt.js +6 -3
  79. package/dist/fn/filter.js +15 -12
  80. package/dist/fn/filterToConditions.js +11 -8
  81. package/dist/fn/findAll.js +10 -7
  82. package/dist/fn/fori.js +9 -6
  83. package/dist/fn/forir.js +9 -6
  84. package/dist/fn/format.js +6 -3
  85. package/dist/fn/formatBytes.js +4 -1
  86. package/dist/fn/formatDate.d.ts +1 -1
  87. package/dist/fn/formatDate.js +5 -2
  88. package/dist/fn/formatSize.js +8 -5
  89. package/dist/fn/formdata.js +14 -11
  90. package/dist/fn/fromXml.js +4 -1
  91. package/dist/fn/ftime.js +12 -9
  92. package/dist/fn/getAllTags.js +6 -3
  93. package/dist/fn/getAncestors.js +4 -1
  94. package/dist/fn/getAttributes.js +6 -3
  95. package/dist/fn/getBrowserName.js +4 -1
  96. package/dist/fn/getBrowserVersion.js +4 -1
  97. package/dist/fn/getCookie.js +4 -1
  98. package/dist/fn/getCssVar.js +4 -1
  99. package/dist/fn/getDay.js +6 -3
  100. package/dist/fn/getDeviceType.js +4 -1
  101. package/dist/fn/getEventData.js +10 -7
  102. package/dist/fn/getField.js +6 -3
  103. package/dist/fn/getFieldValues.js +10 -7
  104. package/dist/fn/getHTMLOfSelection.js +7 -4
  105. package/dist/fn/getHtml.js +6 -3
  106. package/dist/fn/getLoader.js +6 -3
  107. package/dist/fn/getPath.js +6 -3
  108. package/dist/fn/getProp.js +7 -4
  109. package/dist/fn/getProperty.js +4 -1
  110. package/dist/fn/getRequestId.js +8 -5
  111. package/dist/fn/getRow.js +6 -3
  112. package/dist/fn/getScrollBarSize.js +4 -1
  113. package/dist/fn/getText.js +4 -1
  114. package/dist/fn/getTimeoff.js +4 -1
  115. package/dist/fn/happy.js +6 -3
  116. package/dist/fn/hash.js +14 -11
  117. package/dist/fn/hex2rgb.js +4 -1
  118. package/dist/fn/history.js +4 -1
  119. package/dist/fn/html2text.js +4 -1
  120. package/dist/fn/imageToCanvas.js +4 -1
  121. package/dist/fn/imgToBase64.js +6 -3
  122. package/dist/fn/info.js +6 -3
  123. package/dist/fn/init.js +35 -32
  124. package/dist/fn/isActiveInterface.js +4 -1
  125. package/dist/fn/isArray.js +4 -1
  126. package/dist/fn/isBlob.js +4 -1
  127. package/dist/fn/isBoolean.js +4 -1
  128. package/dist/fn/isCanvas.js +4 -1
  129. package/dist/fn/isColor.js +6 -3
  130. package/dist/fn/isComment.js +4 -1
  131. package/dist/fn/isCp.js +6 -3
  132. package/dist/fn/isDate.js +4 -1
  133. package/dist/fn/isDesktopDevice.js +4 -1
  134. package/dist/fn/isDimension.js +6 -3
  135. package/dist/fn/isDom.js +4 -1
  136. package/dist/fn/isEmail.js +6 -3
  137. package/dist/fn/isEmpty.js +8 -5
  138. package/dist/fn/isEvent.js +4 -1
  139. package/dist/fn/isFocused.js +4 -1
  140. package/dist/fn/isFunction.js +4 -1
  141. package/dist/fn/isHostname.js +8 -5
  142. package/dist/fn/isIP.js +6 -3
  143. package/dist/fn/isInside.js +10 -7
  144. package/dist/fn/isInt.js +4 -1
  145. package/dist/fn/isIterable.js +4 -1
  146. package/dist/fn/isMobile.js +7 -4
  147. package/dist/fn/isMobileDevice.js +4 -1
  148. package/dist/fn/isNull.js +4 -1
  149. package/dist/fn/isNumber.js +4 -1
  150. package/dist/fn/isObject.js +4 -1
  151. package/dist/fn/isPercent.js +4 -1
  152. package/dist/fn/isPrimitive.js +4 -1
  153. package/dist/fn/isPromise.js +4 -1
  154. package/dist/fn/isPropSize.js +6 -3
  155. package/dist/fn/isSQLDate.js +4 -1
  156. package/dist/fn/isSame.js +8 -5
  157. package/dist/fn/isString.js +4 -1
  158. package/dist/fn/isSymbol.js +4 -1
  159. package/dist/fn/isTabletDevice.js +4 -1
  160. package/dist/fn/isURL.js +4 -1
  161. package/dist/fn/isValidDimension.js +7 -4
  162. package/dist/fn/isValidName.js +6 -3
  163. package/dist/fn/isValue.js +6 -3
  164. package/dist/fn/isVue.js +4 -1
  165. package/dist/fn/iterate.js +8 -5
  166. package/dist/fn/lightenDarkenHex.js +4 -1
  167. package/dist/fn/link.js +22 -19
  168. package/dist/fn/log.js +6 -3
  169. package/dist/fn/makeReactive.js +31 -28
  170. package/dist/fn/map.js +6 -3
  171. package/dist/fn/md5.js +4 -1
  172. package/dist/fn/money.js +6 -3
  173. package/dist/fn/move.js +4 -1
  174. package/dist/fn/multiorder.js +6 -3
  175. package/dist/fn/nl2br.js +6 -3
  176. package/dist/fn/numProperties.js +4 -1
  177. package/dist/fn/objectToFormData.js +15 -12
  178. package/dist/fn/order.js +6 -3
  179. package/dist/fn/outerHeight.js +6 -3
  180. package/dist/fn/outerWidth.js +6 -3
  181. package/dist/fn/percent.js +4 -1
  182. package/dist/fn/pickValue.js +4 -1
  183. package/dist/fn/post.js +10 -7
  184. package/dist/fn/postOut.js +8 -5
  185. package/dist/fn/printf.js +4 -1
  186. package/dist/fn/quotes2html.js +7 -4
  187. package/dist/fn/randomInt.js +4 -1
  188. package/dist/fn/randomString.js +7 -4
  189. package/dist/fn/removeAccents.js +8 -5
  190. package/dist/fn/removeEmpty.js +11 -8
  191. package/dist/fn/removeExtraSpaces.js +4 -1
  192. package/dist/fn/removeHtmlComments.js +6 -3
  193. package/dist/fn/removePrivateProp.js +6 -3
  194. package/dist/fn/removeTrailingChars.js +9 -6
  195. package/dist/fn/repeat.js +4 -1
  196. package/dist/fn/replaceAll.js +7 -4
  197. package/dist/fn/replaceSelection.js +4 -1
  198. package/dist/fn/resize.js +10 -7
  199. package/dist/fn/rgb2hex.js +4 -1
  200. package/dist/fn/riterate.js +6 -3
  201. package/dist/fn/roundDecimal.js +4 -1
  202. package/dist/fn/sanitize.js +8 -5
  203. package/dist/fn/search.js +18 -15
  204. package/dist/fn/selectElementText.js +4 -1
  205. package/dist/fn/selector.js +4 -1
  206. package/dist/fn/setCookie.js +4 -1
  207. package/dist/fn/setCssVar.js +4 -1
  208. package/dist/fn/setNavigationVars.js +13 -10
  209. package/dist/fn/setProp.js +4 -1
  210. package/dist/fn/setProperty.js +6 -3
  211. package/dist/fn/shorten.js +8 -5
  212. package/dist/fn/shortenObj.js +12 -9
  213. package/dist/fn/shuffle.js +4 -1
  214. package/dist/fn/simpleHash.js +8 -5
  215. package/dist/fn/simpleHash1.js +4 -1
  216. package/dist/fn/simpleHash2.js +4 -1
  217. package/dist/fn/stat.js +4 -1
  218. package/dist/fn/string2ArrayBuffer.js +4 -1
  219. package/dist/fn/submit.js +9 -6
  220. package/dist/fn/substr.js +10 -7
  221. package/dist/fn/sum.js +7 -4
  222. package/dist/fn/timestamp.js +4 -1
  223. package/dist/fn/toCSV.js +11 -8
  224. package/dist/fn/toggleFullScreen.js +6 -3
  225. package/dist/fn/translate.js +6 -3
  226. package/dist/fn/treatAjaxArguments.js +13 -10
  227. package/dist/fn/trim.js +7 -4
  228. package/dist/fn/uniqString.js +10 -7
  229. package/dist/fn/unique.js +4 -1
  230. package/dist/fn/upload.js +10 -7
  231. package/dist/fn/warning.js +6 -3
  232. package/dist/index.d.ts +3 -3
  233. package/dist/index.js +471 -459
  234. package/package.json +1 -1
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCssVar = void 0;
1
4
  const getCssVar = function (varname) {
2
5
  if (varname.indexOf('--') !== 0) {
3
6
  varname = '--' + varname;
4
7
  }
5
8
  return getComputedStyle(document.documentElement).getPropertyValue(varname);
6
9
  };
7
- export { getCssVar };
10
+ exports.getCssVar = getCssVar;
package/dist/fn/getDay.js CHANGED
@@ -1,7 +1,10 @@
1
- import { date } from './date';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDay = void 0;
4
+ const date_1 = require("./date");
2
5
  const getDay = function (v) {
3
6
  const biss = 1972;
4
- let d = date(v);
7
+ let d = (0, date_1.date)(v);
5
8
  if (d) {
6
9
  let t = d.getTime(), y = d.getYear(), m = d.getMonth(), days = (y - 1970) * 365;
7
10
  if (m < 2) {
@@ -14,4 +17,4 @@ const getDay = function (v) {
14
17
  }
15
18
  return false;
16
19
  };
17
- export { getDay };
20
+ exports.getDay = getDay;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDeviceType = void 0;
1
4
  const getDeviceType = function () {
2
5
  const userAgent = navigator.userAgent.toLowerCase();
3
6
  if (/iPhone|Android/i.test(navigator.userAgent)) {
@@ -8,4 +11,4 @@ const getDeviceType = function () {
8
11
  }
9
12
  return 'desktop';
10
13
  };
11
- export { getDeviceType };
14
+ exports.getDeviceType = getDeviceType;
@@ -1,6 +1,9 @@
1
- import { getHTMLOfSelection } from './getHTMLOfSelection';
2
- import { each } from './each';
3
- import { defaultErrorFunction } from './defaultErrorFunction';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEventData = void 0;
4
+ const getHTMLOfSelection_1 = require("./getHTMLOfSelection");
5
+ const each_1 = require("./each");
6
+ const defaultErrorFunction_1 = require("./defaultErrorFunction");
4
7
  const getEventData = function (e) {
5
8
  let dt = e.dataTransfer || e.clipboardData;
6
9
  let t = dt.getData('Text');
@@ -10,7 +13,7 @@ const getEventData = function (e) {
10
13
  if (!t && e.type === 'copy') {
11
14
  let sel = window.getSelection();
12
15
  res.raw = sel.toString();
13
- let html = getHTMLOfSelection();
16
+ let html = (0, getHTMLOfSelection_1.getHTMLOfSelection)();
14
17
  res.str.push({
15
18
  type: 'text/plain',
16
19
  data: res.raw,
@@ -35,7 +38,7 @@ const getEventData = function (e) {
35
38
  if (!done) {
36
39
  let strings = [];
37
40
  let num = dt.items.length;
38
- each(dt.items, (item, idx) => {
41
+ (0, each_1.each)(dt.items, (item, idx) => {
39
42
  let kind = item.kind;
40
43
  let type = item.type;
41
44
  if (kind === 'file') {
@@ -67,7 +70,7 @@ const getEventData = function (e) {
67
70
  }
68
71
  }
69
72
  else {
70
- defaultErrorFunction(bbn._('Impossible to read the file') + ' ' + name);
73
+ (0, defaultErrorFunction_1.defaultErrorFunction)(bbn._('Impossible to read the file') + ' ' + name);
71
74
  }
72
75
  }
73
76
  else {
@@ -99,4 +102,4 @@ const getEventData = function (e) {
99
102
  });
100
103
  return p;
101
104
  };
102
- export { getEventData };
105
+ exports.getEventData = getEventData;
@@ -1,9 +1,12 @@
1
- import { getRow } from './getRow';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getField = void 0;
4
+ const getRow_1 = require("./getRow");
2
5
  const getField = function (arr, field, prop = '', val = null, operator = '=') {
3
6
  let r;
4
- if (field && (r = getRow(arr, prop, val, operator))) {
7
+ if (field && (r = (0, getRow_1.getRow)(arr, prop, val, operator))) {
5
8
  return r[field];
6
9
  }
7
10
  return undefined;
8
11
  };
9
- export { getField };
12
+ exports.getField = getField;
@@ -1,13 +1,16 @@
1
- import { checkType } from './checkType';
2
- import { filter } from './filter';
3
- import { each } from './each';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFieldValues = void 0;
4
+ const checkType_1 = require("./checkType");
5
+ const filter_1 = require("./filter");
6
+ const each_1 = require("./each");
4
7
  const getFieldValues = function (arr, field, prop, val, operator) {
5
- checkType(field, 'string');
8
+ (0, checkType_1.checkType)(field, 'string');
6
9
  if (prop) {
7
- arr = filter(arr, prop, val, operator);
10
+ arr = (0, filter_1.filter)(arr, prop, val, operator);
8
11
  }
9
12
  let res = [];
10
- each(arr, (a) => (res.indexOf(a[field]) === -1 ? res.push(a[field]) : null));
13
+ (0, each_1.each)(arr, (a) => (res.indexOf(a[field]) === -1 ? res.push(a[field]) : null));
11
14
  return res;
12
15
  };
13
- export { getFieldValues };
16
+ exports.getFieldValues = getFieldValues;
@@ -1,12 +1,15 @@
1
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHTMLOfSelection = void 0;
4
+ const log_1 = require("./log");
2
5
  const getHTMLOfSelection = function () {
3
6
  let range;
4
7
  let selection = window.getSelection();
5
8
  if (selection.rangeCount > 0) {
6
9
  range = selection.getRangeAt(0);
7
- log('RANGE', range);
10
+ (0, log_1.log)('RANGE', range);
8
11
  let clonedSelection = range.cloneContents();
9
- log('clonedSelection', clonedSelection);
12
+ (0, log_1.log)('clonedSelection', clonedSelection);
10
13
  let div = document.createElement('div');
11
14
  div.appendChild(clonedSelection);
12
15
  return div.innerHTML;
@@ -15,4 +18,4 @@ const getHTMLOfSelection = function () {
15
18
  return '';
16
19
  }
17
20
  };
18
- export { getHTMLOfSelection };
21
+ exports.getHTMLOfSelection = getHTMLOfSelection;
@@ -1,9 +1,12 @@
1
- import { removeHtmlComments } from './removeHtmlComments';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getHtml = void 0;
4
+ const removeHtmlComments_1 = require("./removeHtmlComments");
2
5
  const getHtml = function (ele, stripComments = false) {
3
6
  let st = ele.innerHTML();
4
7
  if (stripComments) {
5
- st = removeHtmlComments(st);
8
+ st = (0, removeHtmlComments_1.removeHtmlComments)(st);
6
9
  }
7
10
  return st.trim();
8
11
  };
9
- export { getHtml };
12
+ exports.getHtml = getHtml;
@@ -1,9 +1,12 @@
1
- import { search } from './search';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getLoader = void 0;
4
+ const search_1 = require("./search");
2
5
  const getLoader = function (requestId) {
3
- let idx = search(bbn.env.loaders, { key: requestId });
6
+ let idx = (0, search_1.search)(bbn.env.loaders, { key: requestId });
4
7
  if (idx > -1) {
5
8
  return bbn.env.loaders[idx];
6
9
  }
7
10
  return false;
8
11
  };
9
- export { getLoader };
12
+ exports.getLoader = getLoader;
@@ -1,4 +1,7 @@
1
- import { replaceAll } from './replaceAll';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPath = void 0;
4
+ const replaceAll_1 = require("./replaceAll");
2
5
  const getPath = function (element) {
3
6
  let path,
4
7
  //node = $(element),
@@ -15,7 +18,7 @@ const getPath = function (element) {
15
18
  }
16
19
  if (!done) {
17
20
  if (realNode.className && realNode.className !== ' ') {
18
- name += '.' + replaceAll(' ', '.', replaceAll(' ', ' ', realNode.className));
21
+ name += '.' + (0, replaceAll_1.replaceAll)(' ', '.', (0, replaceAll_1.replaceAll)(' ', ' ', realNode.className));
19
22
  }
20
23
  done = 1;
21
24
  }
@@ -39,4 +42,4 @@ const getPath = function (element) {
39
42
  }
40
43
  return path;
41
44
  };
42
- export { getPath };
45
+ exports.getPath = getPath;
@@ -1,7 +1,10 @@
1
- import { checkType } from './checkType';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProp = void 0;
4
+ const checkType_1 = require("./checkType");
2
5
  const getProp = function (obj, prop) {
3
- checkType(obj, 'object', bbn._('The obj must be an object in setProp'));
4
- checkType(prop, 'string', bbn._('The prop must be a string in setProp'));
6
+ (0, checkType_1.checkType)(obj, 'object', bbn._('The obj must be an object in setProp'));
7
+ (0, checkType_1.checkType)(prop, 'string', bbn._('The prop must be a string in setProp'));
5
8
  return obj[prop];
6
9
  };
7
- export { getProp };
10
+ exports.getProp = getProp;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProperty = void 0;
1
4
  const getProperty = function (obj, prop) {
2
5
  if (typeof obj === 'object' && typeof prop === 'string') {
3
6
  return prop.split('.').reduce((o, i) => {
@@ -8,4 +11,4 @@ const getProperty = function (obj, prop) {
8
11
  }, obj);
9
12
  }
10
13
  };
11
- export { getProperty };
14
+ exports.getProperty = getProperty;
@@ -1,14 +1,17 @@
1
- import { iterate } from './iterate';
2
- import { md5 } from './md5';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRequestId = void 0;
4
+ const iterate_1 = require("./iterate");
5
+ const md5_1 = require("./md5");
3
6
  const getRequestId = function (url, data, datatype) {
4
7
  let d = {};
5
8
  if (data) {
6
- iterate(data, (a, n) => {
9
+ (0, iterate_1.iterate)(data, (a, n) => {
7
10
  if (n.indexOf('_bbn') === -1) {
8
11
  d[n] = a;
9
12
  }
10
13
  });
11
14
  }
12
- return url + ':' + md5((datatype || 'json') + JSON.stringify(d));
15
+ return url + ':' + (0, md5_1.md5)((datatype || 'json') + JSON.stringify(d));
13
16
  };
14
- export { getRequestId };
17
+ exports.getRequestId = getRequestId;
package/dist/fn/getRow.js CHANGED
@@ -1,9 +1,12 @@
1
- import { search } from './search';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRow = void 0;
4
+ const search_1 = require("./search");
2
5
  const getRow = function (arr, prop, val = null, operator = '=') {
3
- var idx = search(arr, prop, val, operator);
6
+ var idx = (0, search_1.search)(arr, prop, val, operator);
4
7
  if (idx > -1) {
5
8
  return arr[idx];
6
9
  }
7
10
  return false;
8
11
  };
9
- export { getRow };
12
+ exports.getRow = getRow;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getScrollBarSize = void 0;
1
4
  const getScrollBarSize = function () {
2
5
  if (bbn.env.scrollBarSize === undefined) {
3
6
  let outer = document.createElement('div');
@@ -22,4 +25,4 @@ const getScrollBarSize = function () {
22
25
  }
23
26
  return bbn.env.scrollBarSize;
24
27
  };
25
- export { getScrollBarSize };
28
+ exports.getScrollBarSize = getScrollBarSize;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getText = void 0;
1
4
  const getText = function (ele) {
2
5
  return ele.innerText().trim();
3
6
  };
4
- export { getText };
7
+ exports.getText = getText;
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTimeoff = void 0;
1
4
  const getTimeoff = function () {
2
5
  if (!bbn.env.isFocused) {
3
6
  return Math.round(new Date().getTime() / 1000 - bbn.env.timeoff);
4
7
  }
5
8
  return 0;
6
9
  };
7
- export { getTimeoff };
10
+ exports.getTimeoff = getTimeoff;
package/dist/fn/happy.js CHANGED
@@ -1,10 +1,13 @@
1
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.happy = void 0;
4
+ const log_1 = require("./log");
2
5
  const happy = function (...args) {
3
6
  args.unshift({
4
7
  _bbn_console_level: 3,
5
8
  _bbn_console_style: 'color: white; background: green; font-size: 18px;',
6
9
  });
7
- log.apply(this, args);
10
+ log_1.log.apply(this, args);
8
11
  return this;
9
12
  };
10
- export { happy };
13
+ exports.happy = happy;
package/dist/fn/hash.js CHANGED
@@ -1,15 +1,18 @@
1
- import { log } from './log';
2
- import { isDom } from './isDom';
3
- import { isCp } from './isCp';
4
- import { circularReplacer } from './circularReplacer';
5
- import { simpleHash } from './simpleHash';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hash = void 0;
4
+ const log_1 = require("./log");
5
+ const isDom_1 = require("./isDom");
6
+ const isCp_1 = require("./isCp");
7
+ const circularReplacer_1 = require("./circularReplacer");
8
+ const simpleHash_1 = require("./simpleHash");
6
9
  const hash = function (obj) {
7
10
  //log(obj);
8
11
  let st = '__bbn__';
9
12
  for (let i in arguments) {
10
13
  if (arguments[i]) {
11
14
  let value = arguments[i];
12
- if (isDom(value)) {
15
+ if ((0, isDom_1.isDom)(value)) {
13
16
  if (value.bbnId) {
14
17
  st += '__BBN_DOM__' + value.tagName + '/' + value.bbnId + value.bbnHash;
15
18
  }
@@ -17,13 +20,13 @@ const hash = function (obj) {
17
20
  st += '__BBN_DOM__' + value.tagName + '/' + value.className;
18
21
  }
19
22
  }
20
- else if (isCp(value)) {
21
- log('IS CP');
23
+ else if ((0, isCp_1.isCp)(value)) {
24
+ (0, log_1.log)('IS CP');
22
25
  st += '__BBN_CP__' + value.$options.name + '/' + value.$cid;
23
26
  }
24
27
  else {
25
28
  try {
26
- st += JSON.stringify(arguments[i], circularReplacer());
29
+ st += JSON.stringify(arguments[i], (0, circularReplacer_1.circularReplacer)());
27
30
  }
28
31
  catch (e) {
29
32
  st += '.';
@@ -31,6 +34,6 @@ const hash = function (obj) {
31
34
  }
32
35
  }
33
36
  }
34
- return simpleHash(st);
37
+ return (0, simpleHash_1.simpleHash)(st);
35
38
  };
36
- export { hash };
39
+ exports.hash = hash;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hex2rgb = void 0;
1
4
  const hex2rgb = function (hex) {
2
5
  var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
3
6
  return result
@@ -8,4 +11,4 @@ const hex2rgb = function (hex) {
8
11
  }
9
12
  : null;
10
13
  };
11
- export { hex2rgb };
14
+ exports.hex2rgb = hex2rgb;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.history = void 0;
1
4
  const history = function () {
2
5
  return window.history || false;
3
6
  };
4
- export { history };
7
+ exports.history = history;
@@ -1,7 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.html2text = void 0;
1
4
  const html2text = function (st) {
2
5
  let $test = document.createElement('div');
3
6
  $test.innerHTML = st;
4
7
  st = $test.innerText;
5
8
  return st;
6
9
  };
7
- export { html2text };
10
+ exports.html2text = html2text;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.imageToCanvas = void 0;
1
4
  const imageToCanvas = function (img) {
2
5
  let canvas = document.createElement('canvas');
3
6
  canvas.width = img.width;
@@ -5,4 +8,4 @@ const imageToCanvas = function (img) {
5
8
  canvas.getContext('2d').drawImage(img, 0, 0);
6
9
  return canvas;
7
10
  };
8
- export { imageToCanvas };
11
+ exports.imageToCanvas = imageToCanvas;
@@ -1,7 +1,10 @@
1
- import { imageToCanvas } from './imageToCanvas';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.imgToBase64 = void 0;
4
+ const imageToCanvas_1 = require("./imageToCanvas");
2
5
  const imgToBase64 = function (img, type = 'image/png') {
3
- let canvas = imageToCanvas(img);
6
+ let canvas = (0, imageToCanvas_1.imageToCanvas)(img);
4
7
  //return canvasToImage(canvas);
5
8
  return canvas.toDataURL(type);
6
9
  };
7
- export { imgToBase64 };
10
+ exports.imgToBase64 = imgToBase64;
package/dist/fn/info.js CHANGED
@@ -1,11 +1,14 @@
1
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.info = void 0;
4
+ const log_1 = require("./log");
2
5
  const info = function (...args) {
3
6
  args.unshift({
4
7
  //_bbn_console_mode: "info",
5
8
  _bbn_console_level: 4,
6
9
  _bbn_console_style: 'color: #EEE; background: blue; font-size: 12px;',
7
10
  });
8
- log.apply(this, args);
11
+ log_1.log.apply(this, args);
9
12
  return this;
10
13
  };
11
- export { info };
14
+ exports.info = info;
package/dist/fn/init.js CHANGED
@@ -1,25 +1,28 @@
1
- import * as dayjs from '../../node_modules/dayjs/index';
2
- import { substr } from './substr';
3
- import { each } from './each';
4
- import { extend } from './extend';
5
- import { addColors } from './addColors';
6
- import { link } from './link';
7
- import { submit } from './submit';
8
- import { resize } from './resize';
9
- import { isMobile } from './isMobile';
10
- import { isTabletDevice } from './isTabletDevice';
11
- import { defaultHistoryFunction } from './defaultHistoryFunction';
12
- import { isFunction } from './isFunction';
13
- import { log } from './log';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.init = void 0;
4
+ const dayjs = require("../../node_modules/dayjs/index");
5
+ const substr_1 = require("./substr");
6
+ const each_1 = require("./each");
7
+ const extend_1 = require("./extend");
8
+ const addColors_1 = require("./addColors");
9
+ const link_1 = require("./link");
10
+ const submit_1 = require("./submit");
11
+ const resize_1 = require("./resize");
12
+ const isMobile_1 = require("./isMobile");
13
+ const isTabletDevice_1 = require("./isTabletDevice");
14
+ const defaultHistoryFunction_1 = require("./defaultHistoryFunction");
15
+ const isFunction_1 = require("./isFunction");
16
+ const log_1 = require("./log");
14
17
  const init = function (cfg, force) {
15
18
  let parts;
16
19
  if (!bbn.env.isInit || force) {
17
20
  bbn.env.root = document.baseURI.length > 0 ? document.baseURI : bbn.env.host;
18
- if (bbn.env.root.length && substr(bbn.env.root, -1) !== '/') {
21
+ if (bbn.env.root.length && (0, substr_1.substr)(bbn.env.root, -1) !== '/') {
19
22
  bbn.env.root += '/';
20
23
  }
21
24
  if (!bbn.env.isInit && typeof dayjs !== 'undefined') {
22
- each([
25
+ (0, each_1.each)([
23
26
  'advancedFormat',
24
27
  'arraySupport',
25
28
  'badMutable',
@@ -61,19 +64,19 @@ const init = function (cfg, force) {
61
64
  }
62
65
  /* The server's path (difference between the host and the current dir */
63
66
  if (typeof cfg === 'object') {
64
- extend(true, bbn, cfg);
67
+ (0, extend_1.extend)(true, bbn, cfg);
65
68
  }
66
- bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
69
+ bbn.env.path = (0, substr_1.substr)(bbn.env.url, bbn.env.root.length);
67
70
  parts = bbn.env.path.split('/');
68
71
  //$.each(parts, function(i, v){
69
- each(parts, (v, i) => {
72
+ (0, each_1.each)(parts, (v, i) => {
70
73
  v = decodeURI(v.trim());
71
74
  if (v !== '') {
72
75
  bbn.env.params.push(v);
73
76
  }
74
77
  });
75
78
  if (bbn.vars.colors) {
76
- addColors(bbn.vars.colors);
79
+ (0, addColors_1.addColors)(bbn.vars.colors);
77
80
  }
78
81
  if (bbn.env.lang && undefined !== dayjs) {
79
82
  dayjs.locale(bbn.env.lang);
@@ -115,28 +118,28 @@ const init = function (cfg, force) {
115
118
  if (target instanceof HTMLElement && target.hasAttribute('href') && !target.hasAttribute('target') && !target.classList.contains('bbn-no')) {
116
119
  e.preventDefault();
117
120
  e.stopPropagation();
118
- link(target.getAttribute('href'));
121
+ (0, link_1.link)(target.getAttribute('href'));
119
122
  return false;
120
123
  }
121
124
  });
122
- each(document.querySelectorAll('form:not(.bbn-no), form:not(.bbn-form)'), (ele) => {
125
+ (0, each_1.each)(document.querySelectorAll('form:not(.bbn-no), form:not(.bbn-form)'), (ele) => {
123
126
  ele.addEventListener('submit', (e) => {
124
- submit(ele, e);
127
+ (0, submit_1.submit)(ele, e);
125
128
  });
126
129
  });
127
130
  window.addEventListener('hashchange', () => {
128
131
  bbn.env.hashChanged = new Date().getTime();
129
132
  }, false);
130
133
  window.addEventListener('resize', () => {
131
- resize();
134
+ (0, resize_1.resize)();
132
135
  });
133
136
  window.addEventListener('orientationchange', () => {
134
- resize();
137
+ (0, resize_1.resize)();
135
138
  });
136
- resize();
137
- if (isMobile()) {
139
+ (0, resize_1.resize)();
140
+ if ((0, isMobile_1.isMobile)()) {
138
141
  document.body.classList.add('bbn-mobile');
139
- if (isTabletDevice()) {
142
+ if ((0, isTabletDevice_1.isTabletDevice)()) {
140
143
  document.body.classList.add('bbn-tablet');
141
144
  }
142
145
  }
@@ -147,11 +150,11 @@ const init = function (cfg, force) {
147
150
  //e.preventDefault();
148
151
  let state = h.state;
149
152
  if (state) {
150
- if (defaultHistoryFunction(state)) {
153
+ if ((0, defaultHistoryFunction_1.defaultHistoryFunction)(state)) {
151
154
  //link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
152
- link(state.url, extend({ title: state.title || bbn.env.siteTitle }, state.data || {}));
155
+ (0, link_1.link)(state.url, (0, extend_1.extend)({ title: state.title || bbn.env.siteTitle }, state.data || {}));
153
156
  }
154
- else if (state && state.data && isFunction(state.data.script)) {
157
+ else if (state && state.data && (0, isFunction_1.isFunction)(state.data.script)) {
155
158
  state.data.script();
156
159
  }
157
160
  }
@@ -161,8 +164,8 @@ const init = function (cfg, force) {
161
164
  bbn.env.isInit = true;
162
165
  document.dispatchEvent(new Event('bbninit'));
163
166
  if (bbn.env.logging) {
164
- log('Logging in bbn is enabled');
167
+ (0, log_1.log)('Logging in bbn is enabled');
165
168
  }
166
169
  }
167
170
  };
168
- export { init };
171
+ exports.init = init;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isActiveInterface = void 0;
1
4
  const isActiveInterface = function (secs = 600) {
2
5
  if (!bbn.env.last_focus) {
3
6
  return false;
@@ -5,4 +8,4 @@ const isActiveInterface = function (secs = 600) {
5
8
  let t = new Date().getTime();
6
9
  return t - bbn.env.last_focus < secs * 1000;
7
10
  };
8
- export { isActiveInterface };
11
+ exports.isActiveInterface = isActiveInterface;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isArray = void 0;
1
4
  const isArray = function (...args) {
2
5
  if (!args.length)
3
6
  return false;
@@ -8,4 +11,4 @@ const isArray = function (...args) {
8
11
  }
9
12
  return true;
10
13
  };
11
- export { isArray };
14
+ exports.isArray = isArray;
package/dist/fn/isBlob.js CHANGED
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isBlob = void 0;
1
4
  const isBlob = function (...args) {
2
5
  if (!args.length)
3
6
  return false;
@@ -8,4 +11,4 @@ const isBlob = function (...args) {
8
11
  }
9
12
  return true;
10
13
  };
11
- export { isBlob };
14
+ exports.isBlob = isBlob;