@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,9 +1,12 @@
1
- import { substr } from './substr';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._addLoader = void 0;
4
+ const substr_1 = require("./substr");
2
5
  const _addLoader = function (requestId, prom, source) {
3
6
  /** @var {Number} tst Current timestamp */
4
7
  let tst = (new Date()).getTime();
5
8
  /** @var {String} url The original URL (part of requestId before : and md5) */
6
- let url = substr(requestId, 0, requestId.length - 33);
9
+ let url = (0, substr_1.substr)(requestId, 0, requestId.length - 33);
7
10
  /** @var {Object} loader The loader object */
8
11
  let loader = {
9
12
  key: requestId,
@@ -34,4 +37,4 @@ const _addLoader = function (requestId, prom, source) {
34
37
  }
35
38
  return tst;
36
39
  };
37
- export { _addLoader };
40
+ exports._addLoader = _addLoader;
@@ -1,10 +1,13 @@
1
- import { getProperty } from './getProperty';
2
- import { isString } from './isString';
3
- import { removeAccents } from './removeAccents';
4
- import { isDate } from './isDate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._compareValues = void 0;
4
+ const getProperty_1 = require("./getProperty");
5
+ const isString_1 = require("./isString");
6
+ const removeAccents_1 = require("./removeAccents");
7
+ const isDate_1 = require("./isDate");
5
8
  const _compareValues = function (a, b, prop, dir = 'asc') {
6
- let va = getProperty(a, prop), vb = getProperty(b, prop), ta = (typeof (va)).toLowerCase(), tb = (typeof (vb)).toLowerCase();
7
- if ((dir !== 'asc') && isString(dir) && (dir.toLowerCase() === 'desc')) {
9
+ let va = (0, getProperty_1.getProperty)(a, prop), vb = (0, getProperty_1.getProperty)(b, prop), ta = (typeof (va)).toLowerCase(), tb = (typeof (vb)).toLowerCase();
10
+ if ((dir !== 'asc') && (0, isString_1.isString)(dir) && (dir.toLowerCase() === 'desc')) {
8
11
  dir = 'desc';
9
12
  }
10
13
  if (ta !== tb) {
@@ -14,17 +17,17 @@ const _compareValues = function (a, b, prop, dir = 'asc') {
14
17
  else {
15
18
  switch (ta) {
16
19
  case 'string':
17
- va = removeAccents(va).toLowerCase();
18
- vb = removeAccents(vb).toLowerCase();
20
+ va = (0, removeAccents_1.removeAccents)(va).toLowerCase();
21
+ vb = (0, removeAccents_1.removeAccents)(vb).toLowerCase();
19
22
  break;
20
23
  case 'boolean':
21
24
  va = va ? 1 : 0;
22
25
  vb = vb ? 1 : 0;
23
26
  break;
24
27
  case 'object':
25
- if (isDate(va)) {
28
+ if ((0, isDate_1.isDate)(va)) {
26
29
  va = va.getTime();
27
- vb = isDate(vb) ? vb.getTime() : 0;
30
+ vb = (0, isDate_1.isDate)(vb) ? vb.getTime() : 0;
28
31
  }
29
32
  break;
30
33
  }
@@ -37,4 +40,4 @@ const _compareValues = function (a, b, prop, dir = 'asc') {
37
40
  }
38
41
  return 0;
39
42
  };
40
- export { _compareValues };
43
+ exports._compareValues = _compareValues;
@@ -1,11 +1,14 @@
1
- import { search } from './search';
2
- import { getRow } from './getRow';
3
- import { isObject } from './isObject';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports._deleteLoader = void 0;
4
+ const search_1 = require("./search");
5
+ const getRow_1 = require("./getRow");
6
+ const isObject_1 = require("./isObject");
4
7
  const _deleteLoader = function (requestId, res = null, isAbort = false) {
5
- let idx = search(bbn.env.loaders, { key: requestId });
8
+ let idx = (0, search_1.search)(bbn.env.loaders, { key: requestId });
6
9
  if (idx > -1) {
7
10
  let loader = bbn.env.loaders.splice(idx, 1)[0];
8
- let history = getRow(bbn.env.loadersHistory, { key: requestId, start: loader.start });
11
+ let history = (0, getRow_1.getRow)(bbn.env.loadersHistory, { key: requestId, start: loader.start });
9
12
  if (history) {
10
13
  history.loading = false;
11
14
  history.duration = new Date().getTime() - loader.start;
@@ -14,7 +17,7 @@ const _deleteLoader = function (requestId, res = null, isAbort = false) {
14
17
  history.error = !isAbort;
15
18
  history.abort = isAbort;
16
19
  }
17
- else if (isObject(res)) {
20
+ else if ((0, isObject_1.isObject)(res)) {
18
21
  history.success = true;
19
22
  }
20
23
  }
@@ -22,4 +25,4 @@ const _deleteLoader = function (requestId, res = null, isAbort = false) {
22
25
  }
23
26
  return false;
24
27
  };
25
- export { _deleteLoader };
28
+ exports._deleteLoader = _deleteLoader;
package/dist/fn/abort.js CHANGED
@@ -1,6 +1,9 @@
1
- import { getLoader } from './getLoader';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.abort = void 0;
4
+ const getLoader_1 = require("./getLoader");
2
5
  const abort = function (requestId) {
3
- let loader = getLoader(requestId);
6
+ let loader = (0, getLoader_1.getLoader)(requestId);
4
7
  if (loader && loader.source) {
5
8
  //this._deleteLoader(requestId);
6
9
  loader.source.cancel('Operation canceled by the user.');
@@ -11,4 +14,4 @@ const abort = function (requestId) {
11
14
  }
12
15
  */
13
16
  };
14
- export { abort };
17
+ exports.abort = abort;
@@ -1,7 +1,10 @@
1
- import { each } from './each';
2
- import { filter } from './filter';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.abortURL = void 0;
4
+ const each_1 = require("./each");
5
+ const filter_1 = require("./filter");
3
6
  const abortURL = function (url) {
4
- each(filter(bbn.env.loaders, { url: url }), (a) => {
7
+ (0, each_1.each)((0, filter_1.filter)(bbn.env.loaders, { url: url }), (a) => {
5
8
  if (a && a.source) {
6
9
  a.source.cancel('Operation canceled by the user.');
7
10
  }
@@ -10,4 +13,4 @@ const abortURL = function (url) {
10
13
  }
11
14
  });
12
15
  };
13
- export { abortURL };
16
+ exports.abortURL = abortURL;
@@ -1,7 +1,10 @@
1
- import { numProperties } from './numProperties';
2
- import { iterate } from './iterate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addColors = void 0;
4
+ const numProperties_1 = require("./numProperties");
5
+ const iterate_1 = require("./iterate");
3
6
  const addColors = function (colors) {
4
- if (numProperties(colors)) {
7
+ if ((0, numProperties_1.numProperties)(colors)) {
5
8
  if (!bbn.vars.colors) {
6
9
  bbn.vars.colors = {};
7
10
  }
@@ -10,7 +13,7 @@ const addColors = function (colors) {
10
13
  let sheet = element.sheet;
11
14
  // Append style element to head
12
15
  let i = 0;
13
- iterate(colors, (v, n) => {
16
+ (0, iterate_1.iterate)(colors, (v, n) => {
14
17
  bbn.vars.colors[n] = v;
15
18
  sheet.insertRule('.bbn-' + n + ', .bbn-color-text-' + n + ' {color: ' + v + ' !important;}', i);
16
19
  sheet.insertRule('svg.bbn-' +
@@ -38,4 +41,4 @@ const addColors = function (colors) {
38
41
  });
39
42
  }
40
43
  };
41
- export { addColors };
44
+ exports.addColors = addColors;
@@ -1,4 +1,7 @@
1
- import { iterate } from './iterate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addInputs = void 0;
4
+ const iterate_1 = require("./iterate");
2
5
  const addInputs = function (form, params = null, prefix = '') {
3
6
  if (form && form.tagName === 'FORM') {
4
7
  let appendToForm = (name, val) => {
@@ -11,7 +14,7 @@ const addInputs = function (form, params = null, prefix = '') {
11
14
  params = JSON.parse(JSON.stringify(params || {}));
12
15
  prefix = prefix || '';
13
16
  if (params) {
14
- iterate(params, (param, key) => {
17
+ (0, iterate_1.iterate)(params, (param, key) => {
15
18
  let name = prefix ? `${prefix}[${key}]` : key;
16
19
  if (param instanceof Date) {
17
20
  appendToForm(name, param.toISOString());
@@ -37,4 +40,4 @@ const addInputs = function (form, params = null, prefix = '') {
37
40
  }
38
41
  }
39
42
  };
40
- export { addInputs };
43
+ exports.addInputs = addInputs;
@@ -1,10 +1,13 @@
1
- import { isObject } from './isObject';
2
- import { iterate } from './iterate';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addStyle = void 0;
4
+ const isObject_1 = require("./isObject");
5
+ const iterate_1 = require("./iterate");
3
6
  const addStyle = function (ele, o) {
4
- if (isObject(o)) {
5
- iterate(o, (v, k) => {
7
+ if ((0, isObject_1.isObject)(o)) {
8
+ (0, iterate_1.iterate)(o, (v, k) => {
6
9
  ele.style[k] = v;
7
10
  });
8
11
  }
9
12
  };
10
- export { addStyle };
13
+ exports.addStyle = addStyle;
@@ -1,10 +1,13 @@
1
- import { isIterable } from './isIterable';
2
- import { adjustSize } from './adjustSize';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adjustHeight = void 0;
4
+ const isIterable_1 = require("./isIterable");
5
+ const adjustSize_1 = require("./adjustSize");
3
6
  const adjustHeight = function () {
4
7
  let args = arguments;
5
- if (args.length === 1 && isIterable(args[0])) {
8
+ if (args.length === 1 && (0, isIterable_1.isIterable)(args[0])) {
6
9
  args = args[0];
7
10
  }
8
- return adjustSize('height', args);
11
+ return (0, adjustSize_1.adjustSize)('height', args);
9
12
  };
10
- export { adjustHeight };
13
+ exports.adjustHeight = adjustHeight;
@@ -1,10 +1,13 @@
1
- import { each } from './each';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adjustSize = void 0;
4
+ const each_1 = require("./each");
2
5
  const adjustSize = function (type, eles) {
3
6
  let max = 0, idx;
4
- each(eles, (el) => {
7
+ (0, each_1.each)(eles, (el) => {
5
8
  el.style[type] = 'auto';
6
9
  });
7
- each(eles, (el, i) => {
10
+ (0, each_1.each)(eles, (el, i) => {
8
11
  let rect = el.getBoundingClientRect(), s = rect[type] % 1 ? rect[type] - (rect[type] % 1) + 1 : rect[type];
9
12
  //s = rect[type];
10
13
  if (s > max) {
@@ -12,10 +15,10 @@ const adjustSize = function (type, eles) {
12
15
  idx = i;
13
16
  }
14
17
  });
15
- each(eles, (el, i) => {
18
+ (0, each_1.each)(eles, (el, i) => {
16
19
  if (max) {
17
20
  el.style[type] = max + 'px';
18
21
  }
19
22
  });
20
23
  };
21
- export { adjustSize };
24
+ exports.adjustSize = adjustSize;
@@ -1,10 +1,13 @@
1
- import { isIterable } from './isIterable';
2
- import { adjustSize } from './adjustSize';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.adjustWidth = void 0;
4
+ const isIterable_1 = require("./isIterable");
5
+ const adjustSize_1 = require("./adjustSize");
3
6
  const adjustWidth = function () {
4
7
  let args = arguments;
5
- if (args.length === 1 && isIterable(args[0])) {
8
+ if (args.length === 1 && (0, isIterable_1.isIterable)(args[0])) {
6
9
  args = args[0];
7
10
  }
8
- return adjustSize('width', args);
11
+ return (0, adjustSize_1.adjustSize)('width', args);
9
12
  };
10
- export { adjustWidth };
13
+ exports.adjustWidth = adjustWidth;
package/dist/fn/ajax.js CHANGED
@@ -1,16 +1,19 @@
1
- import { isObject } from './isObject';
2
- import { replaceAll } from './replaceAll';
3
- import { getRequestId } from './getRequestId';
4
- import { getLoader } from './getLoader';
5
- import { extend } from './extend';
6
- import { numProperties } from './numProperties';
7
- import { _deleteLoader } from './_deleteLoader';
8
- import { defaultEndLoadingFunction } from './defaultEndLoadingFunction';
9
- import { isFunction } from './isFunction';
10
- import { defaultAjaxErrorFunction } from './defaultAjaxErrorFunction';
11
- import { defaultAjaxAbortFunction } from './defaultAjaxAbortFunction';
12
- import { _addLoader } from './_addLoader';
13
- import { defaultStartLoadingFunction } from './defaultStartLoadingFunction';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ajax = void 0;
4
+ const isObject_1 = require("./isObject");
5
+ const replaceAll_1 = require("./replaceAll");
6
+ const getRequestId_1 = require("./getRequestId");
7
+ const getLoader_1 = require("./getLoader");
8
+ const extend_1 = require("./extend");
9
+ const numProperties_1 = require("./numProperties");
10
+ const _deleteLoader_1 = require("./_deleteLoader");
11
+ const defaultEndLoadingFunction_1 = require("./defaultEndLoadingFunction");
12
+ const isFunction_1 = require("./isFunction");
13
+ const defaultAjaxErrorFunction_1 = require("./defaultAjaxErrorFunction");
14
+ const defaultAjaxAbortFunction_1 = require("./defaultAjaxAbortFunction");
15
+ const _addLoader_1 = require("./_addLoader");
16
+ const defaultStartLoadingFunction_1 = require("./defaultStartLoadingFunction");
14
17
  const ajax = function (url, datatype, data, success, failure, abort) {
15
18
  if (arguments.length === 1 && url && typeof url === 'object' && url.url) {
16
19
  if (url.abort) {
@@ -36,19 +39,19 @@ const ajax = function (url, datatype, data, success, failure, abort) {
36
39
  if (url && typeof url === 'string') {
37
40
  if (url.indexOf('://') === -1) {
38
41
  // Prevent protocol mismatch by Axios
39
- url = replaceAll('//', '/', url);
42
+ url = (0, replaceAll_1.replaceAll)('//', '/', url);
40
43
  }
41
44
  if (!datatype) {
42
45
  datatype = 'json';
43
46
  }
44
- let requestId = getRequestId(url, data, datatype);
45
- let loaderObj = getLoader(requestId);
47
+ let requestId = (0, getRequestId_1.getRequestId)(url, data, datatype);
48
+ let loaderObj = (0, getLoader_1.getLoader)(requestId);
46
49
  //log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
47
50
  if (loaderObj && loaderObj.loader) {
48
51
  return loaderObj.loader;
49
52
  }
50
53
  if (bbn.env.token) {
51
- extend(data || {}, { _bbn_token: bbn.env.token });
54
+ (0, extend_1.extend)(data || {}, { _bbn_token: bbn.env.token });
52
55
  }
53
56
  let cancelToken = axios.CancelToken;
54
57
  let source = cancelToken.source();
@@ -63,52 +66,52 @@ const ajax = function (url, datatype, data, success, failure, abort) {
63
66
  };
64
67
  }
65
68
  let args = [url];
66
- if (isObject(data) && numProperties(data) > 0) {
69
+ if ((0, isObject_1.isObject)(data) && (0, numProperties_1.numProperties)(data) > 0) {
67
70
  args.push(data);
68
71
  }
69
72
  args.push(options);
70
73
  let loader = axios[args.length === 2 ? 'get' : 'post']
71
74
  .apply(axios, args)
72
75
  .then((res) => {
73
- _deleteLoader(requestId, res);
74
- defaultEndLoadingFunction(url, tst, data, res);
76
+ (0, _deleteLoader_1._deleteLoader)(requestId, res);
77
+ (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, res);
75
78
  switch (res.status) {
76
79
  case 200:
77
- if (isFunction(success)) {
80
+ if ((0, isFunction_1.isFunction)(success)) {
78
81
  success(res.data, res.headers);
79
82
  }
80
83
  break;
81
84
  default:
82
- defaultAjaxErrorFunction(loader, res);
85
+ (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(loader, res);
83
86
  }
84
87
  return res;
85
88
  })
86
89
  .catch((err) => {
87
90
  let isAbort = axios.isCancel(err);
88
- _deleteLoader(requestId, err.message || err.response.data, isAbort);
89
- defaultEndLoadingFunction(url, tst, data, err);
91
+ (0, _deleteLoader_1._deleteLoader)(requestId, err.message || err.response.data, isAbort);
92
+ (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, err);
90
93
  if (isAbort) {
91
94
  let ok = 1;
92
- if (isFunction(abort)) {
95
+ if ((0, isFunction_1.isFunction)(abort)) {
93
96
  ok = abort(err.message, url);
94
97
  }
95
98
  if (ok) {
96
- defaultAjaxAbortFunction(err.message, url);
99
+ (0, defaultAjaxAbortFunction_1.defaultAjaxAbortFunction)(err.message, url);
97
100
  }
98
101
  }
99
102
  else {
100
103
  let ok = 1;
101
- if (isFunction(failure)) {
104
+ if ((0, isFunction_1.isFunction)(failure)) {
102
105
  ok = failure(err.request, err);
103
106
  }
104
107
  if (ok) {
105
- defaultAjaxErrorFunction(err.request, err.response ? err.response.data : '', err.response ? err.response.status : err);
108
+ (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(err.request, err.response ? err.response.data : '', err.response ? err.response.status : err);
106
109
  }
107
110
  }
108
111
  });
109
- let tst = _addLoader(requestId, loader, source);
110
- defaultStartLoadingFunction(url, tst, data, requestId);
112
+ let tst = (0, _addLoader_1._addLoader)(requestId, loader, source);
113
+ (0, defaultStartLoadingFunction_1.defaultStartLoadingFunction)(url, tst, data, requestId);
111
114
  return loader;
112
115
  }
113
116
  };
114
- export { ajax };
117
+ exports.ajax = ajax;
@@ -1,4 +1,7 @@
1
- import { md5 } from './md5';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.analyzeFunction = void 0;
4
+ const md5_1 = require("./md5");
2
5
  const analyzeFunction = function (fn) {
3
6
  const functionString = fn.toString();
4
7
  let all = functionString.split('');
@@ -126,7 +129,7 @@ const analyzeFunction = function (fn) {
126
129
  }
127
130
  }
128
131
  const argString = args.map((arg) => arg.name + (arg.default ? ' = ' + arg.default : '')).join(', ');
129
- const hash = md5(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
132
+ const hash = (0, md5_1.md5)(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
130
133
  return {
131
134
  body,
132
135
  args,
@@ -138,4 +141,4 @@ const analyzeFunction = function (fn) {
138
141
  hash,
139
142
  };
140
143
  };
141
- export { analyzeFunction };
144
+ exports.analyzeFunction = analyzeFunction;
@@ -1,3 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.animateCss = void 0;
1
4
  const animateCss = function (ele, animationName, callback) {
2
5
  let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
3
6
  /*$(ele).addClass('animated ' + animationName).one(animationEnd, function(){
@@ -17,4 +20,4 @@ const animateCss = function (ele, animationName, callback) {
17
20
  this.classList.remove(animationName);
18
21
  });
19
22
  };
20
- export { animateCss };
23
+ exports.animateCss = animateCss;
@@ -1,4 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arrayBuffer2String = void 0;
1
4
  const arrayBuffer2String = function (buf) {
2
5
  return String.fromCharCode.apply(null, new Uint16Array(buf));
3
6
  };
4
- export { arrayBuffer2String };
7
+ exports.arrayBuffer2String = arrayBuffer2String;
@@ -1,10 +1,13 @@
1
- import { each } from './each';
2
- import { getProperty } from './getProperty';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arrayFromProp = void 0;
4
+ const each_1 = require("./each");
5
+ const getProperty_1 = require("./getProperty");
3
6
  const arrayFromProp = function (arr, prop) {
4
7
  let r = [];
5
- each(arr, (a, i) => {
6
- r.push(getProperty(a, prop));
8
+ (0, each_1.each)(arr, (a, i) => {
9
+ r.push((0, getProperty_1.getProperty)(a, prop));
7
10
  });
8
11
  return r;
9
12
  };
10
- export { arrayFromProp };
13
+ exports.arrayFromProp = arrayFromProp;
@@ -1,13 +1,16 @@
1
- import { extend } from './extend';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.autoExtend = void 0;
4
+ const extend_1 = require("./extend");
2
5
  const autoExtend = function (namespace, obj) {
3
6
  if (!bbn[namespace]) {
4
7
  bbn[namespace] = {};
5
8
  //$.extend(true, bbn[namespace], obj);
6
- extend(bbn[namespace], obj);
9
+ (0, extend_1.extend)(bbn[namespace], obj);
7
10
  }
8
11
  else {
9
12
  // $.extend(true, bbn[namespace], obj);
10
- extend(bbn[namespace], obj);
13
+ (0, extend_1.extend)(bbn[namespace], obj);
11
14
  }
12
15
  };
13
- export { autoExtend };
16
+ exports.autoExtend = autoExtend;
@@ -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.baseName = void 0;
4
+ const isString_1 = require("./isString");
5
+ const substr_1 = require("./substr");
3
6
  const baseName = function (path, suffix) {
4
- if (path && isString(path)) {
7
+ if (path && (0, isString_1.isString)(path)) {
5
8
  let bits = path.split('/');
6
9
  let res = bits.pop();
7
10
  if (!suffix) {
8
11
  return res;
9
12
  }
10
13
  let len = suffix.length;
11
- if (res && substr(res, -len) === suffix) {
12
- return substr(res, 0, res.length - len);
14
+ if (res && (0, substr_1.substr)(res, -len) === suffix) {
15
+ return (0, substr_1.substr)(res, 0, res.length - len);
13
16
  }
14
17
  }
15
18
  return '';
16
19
  };
17
- export { baseName };
20
+ exports.baseName = baseName;
package/dist/fn/br2nl.js CHANGED
@@ -1,5 +1,8 @@
1
- import { replaceAll } from './replaceAll';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.br2nl = void 0;
4
+ const replaceAll_1 = require("./replaceAll");
2
5
  const br2nl = function (st) {
3
- return replaceAll('<br />', '\n', replaceAll('<br/>', '\n', replaceAll('<br>', '\n', st)));
6
+ return (0, replaceAll_1.replaceAll)('<br />', '\n', (0, replaceAll_1.replaceAll)('<br/>', '\n', (0, replaceAll_1.replaceAll)('<br>', '\n', st)));
4
7
  };
5
- export { br2nl };
8
+ exports.br2nl = br2nl;
@@ -1,17 +1,20 @@
1
- import { fdate } from './fdate';
2
- import { date } from './date';
3
- import { isDate } from './isDate';
4
- import { isString } from './isString';
5
- import * as dayjs from 'dayjs';
6
- import * as cal from 'dayjs/plugin/calendar';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calendar = void 0;
4
+ const fdate_1 = require("./fdate");
5
+ const date_1 = require("./date");
6
+ const isDate_1 = require("./isDate");
7
+ const isString_1 = require("./isString");
8
+ const dayjs = require("dayjs");
9
+ const cal = require("dayjs/plugin/calendar");
7
10
  dayjs.extend(cal);
8
11
  const calendar = function (d, wrong_result) {
9
12
  if (undefined === dayjs) {
10
- return fdate(d, wrong_result);
13
+ return (0, fdate_1.fdate)(d, wrong_result);
11
14
  }
12
- let r = date(d);
13
- if (!isDate(r)) {
14
- return wrong_result && isString(wrong_result) ? wrong_result : '';
15
+ let r = (0, date_1.date)(d);
16
+ if (!(0, isDate_1.isDate)(r)) {
17
+ return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
15
18
  }
16
19
  return dayjs(r).calendar(null, {
17
20
  sameDay: '[' + bbn._('Today') + ']',
@@ -22,4 +25,4 @@ const calendar = function (d, wrong_result) {
22
25
  sameElse: 'L',
23
26
  });
24
27
  };
25
- export { calendar };
28
+ exports.calendar = calendar;