@bbn/bbn 1.0.28 → 1.0.29

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 (231) hide show
  1. package/dist/bundle.d.ts +6 -6
  2. package/dist/fn/_addLoader.js +3 -6
  3. package/dist/fn/_compareValues.js +11 -14
  4. package/dist/fn/_deleteLoader.js +7 -10
  5. package/dist/fn/abort.js +3 -6
  6. package/dist/fn/abortURL.js +4 -7
  7. package/dist/fn/addColors.js +5 -8
  8. package/dist/fn/addInputs.js +3 -6
  9. package/dist/fn/addStyle.js +5 -8
  10. package/dist/fn/adjustHeight.js +5 -8
  11. package/dist/fn/adjustSize.js +5 -8
  12. package/dist/fn/adjustWidth.js +5 -8
  13. package/dist/fn/ajax.js +31 -34
  14. package/dist/fn/analyzeFunction.js +3 -6
  15. package/dist/fn/animateCss.js +1 -4
  16. package/dist/fn/arrayBuffer2String.js +1 -4
  17. package/dist/fn/arrayFromProp.js +5 -8
  18. package/dist/fn/autoExtend.js +4 -7
  19. package/dist/fn/baseName.js +6 -9
  20. package/dist/fn/br2nl.js +3 -6
  21. package/dist/fn/calendar.js +14 -20
  22. package/dist/fn/callback.js +16 -19
  23. package/dist/fn/camelToCss.js +1 -4
  24. package/dist/fn/camelize.js +1 -4
  25. package/dist/fn/canvasToImage.js +1 -4
  26. package/dist/fn/center.js +1 -4
  27. package/dist/fn/checkProps.js +3 -6
  28. package/dist/fn/checkPropsDetails.js +9 -12
  29. package/dist/fn/checkPropsOrDie.js +3 -6
  30. package/dist/fn/checkType.js +16 -19
  31. package/dist/fn/chrono.js +3 -7
  32. package/dist/fn/circularReplacer.js +7 -10
  33. package/dist/fn/clone.js +7 -10
  34. package/dist/fn/colorToHex.js +1 -4
  35. package/dist/fn/compare.js +18 -21
  36. package/dist/fn/compareConditions.js +10 -13
  37. package/dist/fn/copy.js +4 -7
  38. package/dist/fn/correctCase.js +1 -4
  39. package/dist/fn/count.js +3 -6
  40. package/dist/fn/crc32.js +1 -4
  41. package/dist/fn/createObject.js +3 -6
  42. package/dist/fn/cssExists.js +3 -6
  43. package/dist/fn/date.js +8 -11
  44. package/dist/fn/dateSQL.js +5 -11
  45. package/dist/fn/daysInMonth.js +5 -11
  46. package/dist/fn/deepPath.js +7 -10
  47. package/dist/fn/defaultAjaxAbortFunction.js +3 -6
  48. package/dist/fn/defaultAjaxErrorFunction.js +1 -4
  49. package/dist/fn/defaultAlertFunction.js +1 -4
  50. package/dist/fn/defaultConfirmFunction.js +4 -7
  51. package/dist/fn/defaultEndLoadingFunction.js +1 -4
  52. package/dist/fn/defaultErrorFunction.js +3 -6
  53. package/dist/fn/defaultHistoryFunction.js +1 -4
  54. package/dist/fn/defaultLinkFunction.js +1 -4
  55. package/dist/fn/defaultPostLinkFunction.js +1 -4
  56. package/dist/fn/defaultPreLinkFunction.js +1 -4
  57. package/dist/fn/defaultResizeFunction.js +1 -4
  58. package/dist/fn/defaultStartLoadingFunction.js +1 -4
  59. package/dist/fn/deleteProp.js +4 -7
  60. package/dist/fn/diffObj.js +16 -19
  61. package/dist/fn/dirName.js +7 -10
  62. package/dist/fn/download.js +15 -18
  63. package/dist/fn/downloadContent.js +9 -12
  64. package/dist/fn/each.js +7 -10
  65. package/dist/fn/eraseCookie.js +1 -4
  66. package/dist/fn/error.js +3 -6
  67. package/dist/fn/escapeDquotes.js +3 -6
  68. package/dist/fn/escapeRegExp.js +1 -4
  69. package/dist/fn/escapeSquotes.js +3 -6
  70. package/dist/fn/escapeTicks.js +3 -6
  71. package/dist/fn/escapeUrl.js +8 -11
  72. package/dist/fn/extend.js +13 -16
  73. package/dist/fn/extendOut.js +4 -7
  74. package/dist/fn/fdate.js +12 -18
  75. package/dist/fn/fdatetime.js +10 -16
  76. package/dist/fn/fieldValue.js +1 -4
  77. package/dist/fn/fileExt.js +3 -6
  78. package/dist/fn/filter.js +12 -15
  79. package/dist/fn/filterToConditions.js +8 -11
  80. package/dist/fn/findAll.js +7 -10
  81. package/dist/fn/fori.js +6 -9
  82. package/dist/fn/forir.js +6 -9
  83. package/dist/fn/format.js +3 -6
  84. package/dist/fn/formatBytes.js +1 -4
  85. package/dist/fn/formatDate.js +3 -9
  86. package/dist/fn/formatSize.js +5 -8
  87. package/dist/fn/formdata.js +11 -14
  88. package/dist/fn/fromXml.js +1 -4
  89. package/dist/fn/ftime.js +12 -18
  90. package/dist/fn/getAllTags.js +3 -6
  91. package/dist/fn/getAncestors.js +1 -4
  92. package/dist/fn/getAttributes.js +3 -6
  93. package/dist/fn/getBrowserName.js +1 -4
  94. package/dist/fn/getBrowserVersion.js +1 -4
  95. package/dist/fn/getCookie.js +1 -4
  96. package/dist/fn/getCssVar.js +1 -4
  97. package/dist/fn/getDay.js +3 -6
  98. package/dist/fn/getDeviceType.js +1 -4
  99. package/dist/fn/getEventData.js +7 -10
  100. package/dist/fn/getField.js +3 -6
  101. package/dist/fn/getFieldValues.js +7 -10
  102. package/dist/fn/getHTMLOfSelection.js +4 -7
  103. package/dist/fn/getHtml.js +3 -6
  104. package/dist/fn/getLoader.js +3 -6
  105. package/dist/fn/getPath.js +3 -6
  106. package/dist/fn/getProp.js +4 -7
  107. package/dist/fn/getProperty.js +1 -4
  108. package/dist/fn/getRequestId.js +5 -8
  109. package/dist/fn/getRow.js +3 -6
  110. package/dist/fn/getScrollBarSize.js +1 -4
  111. package/dist/fn/getText.js +1 -4
  112. package/dist/fn/getTimeoff.js +1 -4
  113. package/dist/fn/happy.js +3 -6
  114. package/dist/fn/hash.js +11 -14
  115. package/dist/fn/hex2rgb.js +1 -4
  116. package/dist/fn/history.js +1 -4
  117. package/dist/fn/html2text.js +1 -4
  118. package/dist/fn/imageToCanvas.js +1 -4
  119. package/dist/fn/imgToBase64.js +3 -6
  120. package/dist/fn/info.js +3 -6
  121. package/dist/fn/init.js +32 -58
  122. package/dist/fn/isActiveInterface.js +1 -4
  123. package/dist/fn/isArray.js +1 -4
  124. package/dist/fn/isBlob.js +1 -4
  125. package/dist/fn/isBoolean.js +1 -4
  126. package/dist/fn/isCanvas.js +1 -4
  127. package/dist/fn/isColor.js +3 -6
  128. package/dist/fn/isComment.js +1 -4
  129. package/dist/fn/isCp.js +3 -6
  130. package/dist/fn/isDate.js +1 -4
  131. package/dist/fn/isDesktopDevice.js +1 -4
  132. package/dist/fn/isDimension.js +3 -6
  133. package/dist/fn/isDom.js +1 -4
  134. package/dist/fn/isEmail.js +3 -6
  135. package/dist/fn/isEmpty.js +5 -8
  136. package/dist/fn/isEvent.js +1 -4
  137. package/dist/fn/isFocused.js +1 -4
  138. package/dist/fn/isFunction.js +1 -4
  139. package/dist/fn/isHostname.js +5 -8
  140. package/dist/fn/isIP.js +3 -6
  141. package/dist/fn/isInside.js +7 -10
  142. package/dist/fn/isInt.js +1 -4
  143. package/dist/fn/isIterable.js +1 -4
  144. package/dist/fn/isMobile.js +4 -7
  145. package/dist/fn/isMobileDevice.js +1 -4
  146. package/dist/fn/isNull.js +1 -4
  147. package/dist/fn/isNumber.js +1 -4
  148. package/dist/fn/isObject.js +1 -4
  149. package/dist/fn/isPercent.js +1 -4
  150. package/dist/fn/isPrimitive.js +1 -4
  151. package/dist/fn/isPromise.js +1 -4
  152. package/dist/fn/isPropSize.js +3 -6
  153. package/dist/fn/isSQLDate.js +1 -4
  154. package/dist/fn/isSame.js +5 -8
  155. package/dist/fn/isString.js +1 -4
  156. package/dist/fn/isSymbol.js +1 -4
  157. package/dist/fn/isTabletDevice.js +1 -4
  158. package/dist/fn/isURL.js +1 -4
  159. package/dist/fn/isValidDimension.js +4 -7
  160. package/dist/fn/isValidName.js +3 -6
  161. package/dist/fn/isValue.js +3 -6
  162. package/dist/fn/isVue.js +1 -4
  163. package/dist/fn/iterate.js +5 -8
  164. package/dist/fn/lightenDarkenHex.js +1 -4
  165. package/dist/fn/link.js +19 -22
  166. package/dist/fn/log.js +3 -6
  167. package/dist/fn/makeReactive.js +28 -31
  168. package/dist/fn/map.js +3 -6
  169. package/dist/fn/md5.js +1 -4
  170. package/dist/fn/money.js +3 -6
  171. package/dist/fn/move.js +1 -4
  172. package/dist/fn/multiorder.js +3 -6
  173. package/dist/fn/nl2br.js +3 -6
  174. package/dist/fn/numProperties.js +1 -4
  175. package/dist/fn/objectToFormData.js +12 -15
  176. package/dist/fn/order.js +3 -6
  177. package/dist/fn/outerHeight.js +3 -6
  178. package/dist/fn/outerWidth.js +3 -6
  179. package/dist/fn/percent.js +1 -4
  180. package/dist/fn/pickValue.js +1 -4
  181. package/dist/fn/post.js +7 -10
  182. package/dist/fn/postOut.js +5 -8
  183. package/dist/fn/printf.js +1 -4
  184. package/dist/fn/quotes2html.js +4 -7
  185. package/dist/fn/randomInt.js +1 -4
  186. package/dist/fn/randomString.js +4 -7
  187. package/dist/fn/removeAccents.js +5 -8
  188. package/dist/fn/removeEmpty.js +8 -11
  189. package/dist/fn/removeExtraSpaces.js +1 -4
  190. package/dist/fn/removeHtmlComments.js +3 -6
  191. package/dist/fn/removePrivateProp.js +3 -6
  192. package/dist/fn/removeTrailingChars.js +6 -9
  193. package/dist/fn/repeat.js +1 -4
  194. package/dist/fn/replaceAll.js +4 -7
  195. package/dist/fn/replaceSelection.js +1 -4
  196. package/dist/fn/resize.js +7 -10
  197. package/dist/fn/rgb2hex.js +1 -4
  198. package/dist/fn/riterate.js +3 -6
  199. package/dist/fn/roundDecimal.js +1 -4
  200. package/dist/fn/sanitize.js +5 -8
  201. package/dist/fn/search.js +15 -18
  202. package/dist/fn/selectElementText.js +1 -4
  203. package/dist/fn/selector.js +1 -4
  204. package/dist/fn/setCookie.js +1 -4
  205. package/dist/fn/setCssVar.js +1 -4
  206. package/dist/fn/setNavigationVars.js +10 -13
  207. package/dist/fn/setProp.js +1 -4
  208. package/dist/fn/setProperty.js +3 -6
  209. package/dist/fn/shorten.js +5 -8
  210. package/dist/fn/shortenObj.js +9 -12
  211. package/dist/fn/shuffle.js +1 -4
  212. package/dist/fn/simpleHash.js +5 -8
  213. package/dist/fn/simpleHash1.js +1 -4
  214. package/dist/fn/simpleHash2.js +1 -4
  215. package/dist/fn/stat.js +1 -4
  216. package/dist/fn/string2ArrayBuffer.js +1 -4
  217. package/dist/fn/submit.js +6 -9
  218. package/dist/fn/substr.js +7 -10
  219. package/dist/fn/sum.js +4 -7
  220. package/dist/fn/timestamp.js +1 -4
  221. package/dist/fn/toCSV.js +8 -11
  222. package/dist/fn/toggleFullScreen.js +3 -6
  223. package/dist/fn/translate.js +3 -6
  224. package/dist/fn/treatAjaxArguments.js +10 -13
  225. package/dist/fn/trim.js +4 -7
  226. package/dist/fn/uniqString.js +7 -10
  227. package/dist/fn/unique.js +1 -4
  228. package/dist/fn/upload.js +7 -33
  229. package/dist/fn/warning.js +3 -6
  230. package/dist/index.js +459 -471
  231. package/package.json +1 -1
package/dist/bundle.d.ts CHANGED
@@ -362,11 +362,11 @@ declare module "fn/cssExists" {
362
362
  export { cssExists };
363
363
  }
364
364
  declare module "fn/dateSQL" {
365
- const dateSQL: (v: any, dayOnly: any) => string;
365
+ const dateSQL: (v: any, dayOnly: any) => any;
366
366
  export { dateSQL };
367
367
  }
368
368
  declare module "fn/daysInMonth" {
369
- const daysInMonth: (v: any) => number | false;
369
+ const daysInMonth: (v: any) => any;
370
370
  export { daysInMonth };
371
371
  }
372
372
  declare module "fn/deepPath" {
@@ -478,7 +478,7 @@ declare module "fn/formatBytes" {
478
478
  export { formatBytes };
479
479
  }
480
480
  declare module "fn/formatDate" {
481
- const formatDate: (date: any, format: any) => string;
481
+ const formatDate: (date: any, format: any) => any;
482
482
  export { formatDate };
483
483
  }
484
484
  declare module "fn/formatSize" {
@@ -1113,8 +1113,8 @@ declare module "index" {
1113
1113
  createObject: (...args: any[]) => any;
1114
1114
  cssExists: (f: any) => boolean;
1115
1115
  date: (v: any) => any;
1116
- dateSQL: (v: any, dayOnly: any) => string;
1117
- daysInMonth: (v: any) => number | false;
1116
+ dateSQL: (v: any, dayOnly: any) => any;
1117
+ daysInMonth: (v: any) => any;
1118
1118
  deepPath: (arr: any[], filter: object, deepProperty: string, res?: any[]) => false | any[];
1119
1119
  defaultAjaxAbortFunction: (message: string, url?: string) => void;
1120
1120
  defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: Error) => boolean;
@@ -1154,7 +1154,7 @@ declare module "index" {
1154
1154
  forir: (arr: any[], fn: (a: any, b: number) => any, max?: number, min?: number) => void;
1155
1155
  format: (str: any) => any;
1156
1156
  formatBytes: (bytes: any, decimals?: number) => string;
1157
- formatDate: (date: any, format: any) => string;
1157
+ formatDate: (date: any, format: any) => any;
1158
1158
  formatSize: (st: any, noValid: any) => any;
1159
1159
  formdata: (form: HTMLFormElement) => {};
1160
1160
  fromXml: (xml: any, arrayTags: any) => {};
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._addLoader = void 0;
4
- const substr_1 = require("./substr");
1
+ import { substr } from './substr';
5
2
  const _addLoader = function (requestId, prom, source) {
6
3
  /** @var {Number} tst Current timestamp */
7
4
  let tst = (new Date()).getTime();
8
5
  /** @var {String} url The original URL (part of requestId before : and md5) */
9
- let url = (0, substr_1.substr)(requestId, 0, requestId.length - 33);
6
+ let url = substr(requestId, 0, requestId.length - 33);
10
7
  /** @var {Object} loader The loader object */
11
8
  let loader = {
12
9
  key: requestId,
@@ -37,4 +34,4 @@ const _addLoader = function (requestId, prom, source) {
37
34
  }
38
35
  return tst;
39
36
  };
40
- exports._addLoader = _addLoader;
37
+ export { _addLoader };
@@ -1,13 +1,10 @@
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");
1
+ import { getProperty } from './getProperty';
2
+ import { isString } from './isString';
3
+ import { removeAccents } from './removeAccents';
4
+ import { isDate } from './isDate';
8
5
  const _compareValues = function (a, b, prop, dir = 'asc') {
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')) {
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')) {
11
8
  dir = 'desc';
12
9
  }
13
10
  if (ta !== tb) {
@@ -17,17 +14,17 @@ const _compareValues = function (a, b, prop, dir = 'asc') {
17
14
  else {
18
15
  switch (ta) {
19
16
  case 'string':
20
- va = (0, removeAccents_1.removeAccents)(va).toLowerCase();
21
- vb = (0, removeAccents_1.removeAccents)(vb).toLowerCase();
17
+ va = removeAccents(va).toLowerCase();
18
+ vb = removeAccents(vb).toLowerCase();
22
19
  break;
23
20
  case 'boolean':
24
21
  va = va ? 1 : 0;
25
22
  vb = vb ? 1 : 0;
26
23
  break;
27
24
  case 'object':
28
- if ((0, isDate_1.isDate)(va)) {
25
+ if (isDate(va)) {
29
26
  va = va.getTime();
30
- vb = (0, isDate_1.isDate)(vb) ? vb.getTime() : 0;
27
+ vb = isDate(vb) ? vb.getTime() : 0;
31
28
  }
32
29
  break;
33
30
  }
@@ -40,4 +37,4 @@ const _compareValues = function (a, b, prop, dir = 'asc') {
40
37
  }
41
38
  return 0;
42
39
  };
43
- exports._compareValues = _compareValues;
40
+ export { _compareValues };
@@ -1,14 +1,11 @@
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");
1
+ import { search } from './search';
2
+ import { getRow } from './getRow';
3
+ import { isObject } from './isObject';
7
4
  const _deleteLoader = function (requestId, res = null, isAbort = false) {
8
- let idx = (0, search_1.search)(bbn.env.loaders, { key: requestId });
5
+ let idx = search(bbn.env.loaders, { key: requestId });
9
6
  if (idx > -1) {
10
7
  let loader = bbn.env.loaders.splice(idx, 1)[0];
11
- let history = (0, getRow_1.getRow)(bbn.env.loadersHistory, { key: requestId, start: loader.start });
8
+ let history = getRow(bbn.env.loadersHistory, { key: requestId, start: loader.start });
12
9
  if (history) {
13
10
  history.loading = false;
14
11
  history.duration = new Date().getTime() - loader.start;
@@ -17,7 +14,7 @@ const _deleteLoader = function (requestId, res = null, isAbort = false) {
17
14
  history.error = !isAbort;
18
15
  history.abort = isAbort;
19
16
  }
20
- else if ((0, isObject_1.isObject)(res)) {
17
+ else if (isObject(res)) {
21
18
  history.success = true;
22
19
  }
23
20
  }
@@ -25,4 +22,4 @@ const _deleteLoader = function (requestId, res = null, isAbort = false) {
25
22
  }
26
23
  return false;
27
24
  };
28
- exports._deleteLoader = _deleteLoader;
25
+ export { _deleteLoader };
package/dist/fn/abort.js CHANGED
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.abort = void 0;
4
- const getLoader_1 = require("./getLoader");
1
+ import { getLoader } from './getLoader';
5
2
  const abort = function (requestId) {
6
- let loader = (0, getLoader_1.getLoader)(requestId);
3
+ let loader = getLoader(requestId);
7
4
  if (loader && loader.source) {
8
5
  //this._deleteLoader(requestId);
9
6
  loader.source.cancel('Operation canceled by the user.');
@@ -14,4 +11,4 @@ const abort = function (requestId) {
14
11
  }
15
12
  */
16
13
  };
17
- exports.abort = abort;
14
+ export { abort };
@@ -1,10 +1,7 @@
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");
1
+ import { each } from './each';
2
+ import { filter } from './filter';
6
3
  const abortURL = function (url) {
7
- (0, each_1.each)((0, filter_1.filter)(bbn.env.loaders, { url: url }), (a) => {
4
+ each(filter(bbn.env.loaders, { url: url }), (a) => {
8
5
  if (a && a.source) {
9
6
  a.source.cancel('Operation canceled by the user.');
10
7
  }
@@ -13,4 +10,4 @@ const abortURL = function (url) {
13
10
  }
14
11
  });
15
12
  };
16
- exports.abortURL = abortURL;
13
+ export { abortURL };
@@ -1,10 +1,7 @@
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");
1
+ import { numProperties } from './numProperties';
2
+ import { iterate } from './iterate';
6
3
  const addColors = function (colors) {
7
- if ((0, numProperties_1.numProperties)(colors)) {
4
+ if (numProperties(colors)) {
8
5
  if (!bbn.vars.colors) {
9
6
  bbn.vars.colors = {};
10
7
  }
@@ -13,7 +10,7 @@ const addColors = function (colors) {
13
10
  let sheet = element.sheet;
14
11
  // Append style element to head
15
12
  let i = 0;
16
- (0, iterate_1.iterate)(colors, (v, n) => {
13
+ iterate(colors, (v, n) => {
17
14
  bbn.vars.colors[n] = v;
18
15
  sheet.insertRule('.bbn-' + n + ', .bbn-color-text-' + n + ' {color: ' + v + ' !important;}', i);
19
16
  sheet.insertRule('svg.bbn-' +
@@ -41,4 +38,4 @@ const addColors = function (colors) {
41
38
  });
42
39
  }
43
40
  };
44
- exports.addColors = addColors;
41
+ export { addColors };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addInputs = void 0;
4
- const iterate_1 = require("./iterate");
1
+ import { iterate } from './iterate';
5
2
  const addInputs = function (form, params = null, prefix = '') {
6
3
  if (form && form.tagName === 'FORM') {
7
4
  let appendToForm = (name, val) => {
@@ -14,7 +11,7 @@ const addInputs = function (form, params = null, prefix = '') {
14
11
  params = JSON.parse(JSON.stringify(params || {}));
15
12
  prefix = prefix || '';
16
13
  if (params) {
17
- (0, iterate_1.iterate)(params, (param, key) => {
14
+ iterate(params, (param, key) => {
18
15
  let name = prefix ? `${prefix}[${key}]` : key;
19
16
  if (param instanceof Date) {
20
17
  appendToForm(name, param.toISOString());
@@ -40,4 +37,4 @@ const addInputs = function (form, params = null, prefix = '') {
40
37
  }
41
38
  }
42
39
  };
43
- exports.addInputs = addInputs;
40
+ export { addInputs };
@@ -1,13 +1,10 @@
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");
1
+ import { isObject } from './isObject';
2
+ import { iterate } from './iterate';
6
3
  const addStyle = function (ele, o) {
7
- if ((0, isObject_1.isObject)(o)) {
8
- (0, iterate_1.iterate)(o, (v, k) => {
4
+ if (isObject(o)) {
5
+ iterate(o, (v, k) => {
9
6
  ele.style[k] = v;
10
7
  });
11
8
  }
12
9
  };
13
- exports.addStyle = addStyle;
10
+ export { addStyle };
@@ -1,13 +1,10 @@
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");
1
+ import { isIterable } from './isIterable';
2
+ import { adjustSize } from './adjustSize';
6
3
  const adjustHeight = function () {
7
4
  let args = arguments;
8
- if (args.length === 1 && (0, isIterable_1.isIterable)(args[0])) {
5
+ if (args.length === 1 && isIterable(args[0])) {
9
6
  args = args[0];
10
7
  }
11
- return (0, adjustSize_1.adjustSize)('height', args);
8
+ return adjustSize('height', args);
12
9
  };
13
- exports.adjustHeight = adjustHeight;
10
+ export { adjustHeight };
@@ -1,13 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adjustSize = void 0;
4
- const each_1 = require("./each");
1
+ import { each } from './each';
5
2
  const adjustSize = function (type, eles) {
6
3
  let max = 0, idx;
7
- (0, each_1.each)(eles, (el) => {
4
+ each(eles, (el) => {
8
5
  el.style[type] = 'auto';
9
6
  });
10
- (0, each_1.each)(eles, (el, i) => {
7
+ each(eles, (el, i) => {
11
8
  let rect = el.getBoundingClientRect(), s = rect[type] % 1 ? rect[type] - (rect[type] % 1) + 1 : rect[type];
12
9
  //s = rect[type];
13
10
  if (s > max) {
@@ -15,10 +12,10 @@ const adjustSize = function (type, eles) {
15
12
  idx = i;
16
13
  }
17
14
  });
18
- (0, each_1.each)(eles, (el, i) => {
15
+ each(eles, (el, i) => {
19
16
  if (max) {
20
17
  el.style[type] = max + 'px';
21
18
  }
22
19
  });
23
20
  };
24
- exports.adjustSize = adjustSize;
21
+ export { adjustSize };
@@ -1,13 +1,10 @@
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");
1
+ import { isIterable } from './isIterable';
2
+ import { adjustSize } from './adjustSize';
6
3
  const adjustWidth = function () {
7
4
  let args = arguments;
8
- if (args.length === 1 && (0, isIterable_1.isIterable)(args[0])) {
5
+ if (args.length === 1 && isIterable(args[0])) {
9
6
  args = args[0];
10
7
  }
11
- return (0, adjustSize_1.adjustSize)('width', args);
8
+ return adjustSize('width', args);
12
9
  };
13
- exports.adjustWidth = adjustWidth;
10
+ export { adjustWidth };
package/dist/fn/ajax.js CHANGED
@@ -1,19 +1,16 @@
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");
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';
17
14
  const ajax = function (url, datatype, data, success, failure, abort) {
18
15
  if (arguments.length === 1 && url && typeof url === 'object' && url.url) {
19
16
  if (url.abort) {
@@ -39,19 +36,19 @@ const ajax = function (url, datatype, data, success, failure, abort) {
39
36
  if (url && typeof url === 'string') {
40
37
  if (url.indexOf('://') === -1) {
41
38
  // Prevent protocol mismatch by Axios
42
- url = (0, replaceAll_1.replaceAll)('//', '/', url);
39
+ url = replaceAll('//', '/', url);
43
40
  }
44
41
  if (!datatype) {
45
42
  datatype = 'json';
46
43
  }
47
- let requestId = (0, getRequestId_1.getRequestId)(url, data, datatype);
48
- let loaderObj = (0, getLoader_1.getLoader)(requestId);
44
+ let requestId = getRequestId(url, data, datatype);
45
+ let loaderObj = getLoader(requestId);
49
46
  //log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
50
47
  if (loaderObj && loaderObj.loader) {
51
48
  return loaderObj.loader;
52
49
  }
53
50
  if (bbn.env.token) {
54
- (0, extend_1.extend)(data || {}, { _bbn_token: bbn.env.token });
51
+ extend(data || {}, { _bbn_token: bbn.env.token });
55
52
  }
56
53
  let cancelToken = axios.CancelToken;
57
54
  let source = cancelToken.source();
@@ -66,52 +63,52 @@ const ajax = function (url, datatype, data, success, failure, abort) {
66
63
  };
67
64
  }
68
65
  let args = [url];
69
- if ((0, isObject_1.isObject)(data) && (0, numProperties_1.numProperties)(data) > 0) {
66
+ if (isObject(data) && numProperties(data) > 0) {
70
67
  args.push(data);
71
68
  }
72
69
  args.push(options);
73
70
  let loader = axios[args.length === 2 ? 'get' : 'post']
74
71
  .apply(axios, args)
75
72
  .then((res) => {
76
- (0, _deleteLoader_1._deleteLoader)(requestId, res);
77
- (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, res);
73
+ _deleteLoader(requestId, res);
74
+ defaultEndLoadingFunction(url, tst, data, res);
78
75
  switch (res.status) {
79
76
  case 200:
80
- if ((0, isFunction_1.isFunction)(success)) {
77
+ if (isFunction(success)) {
81
78
  success(res.data, res.headers);
82
79
  }
83
80
  break;
84
81
  default:
85
- (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(loader, res);
82
+ defaultAjaxErrorFunction(loader, res);
86
83
  }
87
84
  return res;
88
85
  })
89
86
  .catch((err) => {
90
87
  let isAbort = axios.isCancel(err);
91
- (0, _deleteLoader_1._deleteLoader)(requestId, err.message || err.response.data, isAbort);
92
- (0, defaultEndLoadingFunction_1.defaultEndLoadingFunction)(url, tst, data, err);
88
+ _deleteLoader(requestId, err.message || err.response.data, isAbort);
89
+ defaultEndLoadingFunction(url, tst, data, err);
93
90
  if (isAbort) {
94
91
  let ok = 1;
95
- if ((0, isFunction_1.isFunction)(abort)) {
92
+ if (isFunction(abort)) {
96
93
  ok = abort(err.message, url);
97
94
  }
98
95
  if (ok) {
99
- (0, defaultAjaxAbortFunction_1.defaultAjaxAbortFunction)(err.message, url);
96
+ defaultAjaxAbortFunction(err.message, url);
100
97
  }
101
98
  }
102
99
  else {
103
100
  let ok = 1;
104
- if ((0, isFunction_1.isFunction)(failure)) {
101
+ if (isFunction(failure)) {
105
102
  ok = failure(err.request, err);
106
103
  }
107
104
  if (ok) {
108
- (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(err.request, err.response ? err.response.data : '', err.response ? err.response.status : err);
105
+ defaultAjaxErrorFunction(err.request, err.response ? err.response.data : '', err.response ? err.response.status : err);
109
106
  }
110
107
  }
111
108
  });
112
- let tst = (0, _addLoader_1._addLoader)(requestId, loader, source);
113
- (0, defaultStartLoadingFunction_1.defaultStartLoadingFunction)(url, tst, data, requestId);
109
+ let tst = _addLoader(requestId, loader, source);
110
+ defaultStartLoadingFunction(url, tst, data, requestId);
114
111
  return loader;
115
112
  }
116
113
  };
117
- exports.ajax = ajax;
114
+ export { ajax };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.analyzeFunction = void 0;
4
- const md5_1 = require("./md5");
1
+ import { md5 } from './md5';
5
2
  const analyzeFunction = function (fn) {
6
3
  const functionString = fn.toString();
7
4
  let all = functionString.split('');
@@ -129,7 +126,7 @@ const analyzeFunction = function (fn) {
129
126
  }
130
127
  }
131
128
  const argString = args.map((arg) => arg.name + (arg.default ? ' = ' + arg.default : '')).join(', ');
132
- const hash = (0, md5_1.md5)(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
129
+ const hash = md5(body + (name ? '-' + name : '') + (argString ? '-' + argString : ''));
133
130
  return {
134
131
  body,
135
132
  args,
@@ -141,4 +138,4 @@ const analyzeFunction = function (fn) {
141
138
  hash,
142
139
  };
143
140
  };
144
- exports.analyzeFunction = analyzeFunction;
141
+ export { analyzeFunction };
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.animateCss = void 0;
4
1
  const animateCss = function (ele, animationName, callback) {
5
2
  let animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
6
3
  /*$(ele).addClass('animated ' + animationName).one(animationEnd, function(){
@@ -20,4 +17,4 @@ const animateCss = function (ele, animationName, callback) {
20
17
  this.classList.remove(animationName);
21
18
  });
22
19
  };
23
- exports.animateCss = animateCss;
20
+ export { animateCss };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.arrayBuffer2String = void 0;
4
1
  const arrayBuffer2String = function (buf) {
5
2
  return String.fromCharCode.apply(null, new Uint16Array(buf));
6
3
  };
7
- exports.arrayBuffer2String = arrayBuffer2String;
4
+ export { arrayBuffer2String };
@@ -1,13 +1,10 @@
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");
1
+ import { each } from './each';
2
+ import { getProperty } from './getProperty';
6
3
  const arrayFromProp = function (arr, prop) {
7
4
  let r = [];
8
- (0, each_1.each)(arr, (a, i) => {
9
- r.push((0, getProperty_1.getProperty)(a, prop));
5
+ each(arr, (a, i) => {
6
+ r.push(getProperty(a, prop));
10
7
  });
11
8
  return r;
12
9
  };
13
- exports.arrayFromProp = arrayFromProp;
10
+ export { arrayFromProp };
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.autoExtend = void 0;
4
- const extend_1 = require("./extend");
1
+ import { extend } from './extend';
5
2
  const autoExtend = function (namespace, obj) {
6
3
  if (!bbn[namespace]) {
7
4
  bbn[namespace] = {};
8
5
  //$.extend(true, bbn[namespace], obj);
9
- (0, extend_1.extend)(bbn[namespace], obj);
6
+ extend(bbn[namespace], obj);
10
7
  }
11
8
  else {
12
9
  // $.extend(true, bbn[namespace], obj);
13
- (0, extend_1.extend)(bbn[namespace], obj);
10
+ extend(bbn[namespace], obj);
14
11
  }
15
12
  };
16
- exports.autoExtend = autoExtend;
13
+ export { autoExtend };
@@ -1,20 +1,17 @@
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");
1
+ import { isString } from './isString';
2
+ import { substr } from './substr';
6
3
  const baseName = function (path, suffix) {
7
- if (path && (0, isString_1.isString)(path)) {
4
+ if (path && isString(path)) {
8
5
  let bits = path.split('/');
9
6
  let res = bits.pop();
10
7
  if (!suffix) {
11
8
  return res;
12
9
  }
13
10
  let len = suffix.length;
14
- if (res && (0, substr_1.substr)(res, -len) === suffix) {
15
- return (0, substr_1.substr)(res, 0, res.length - len);
11
+ if (res && substr(res, -len) === suffix) {
12
+ return substr(res, 0, res.length - len);
16
13
  }
17
14
  }
18
15
  return '';
19
16
  };
20
- exports.baseName = baseName;
17
+ export { baseName };
package/dist/fn/br2nl.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.br2nl = void 0;
4
- const replaceAll_1 = require("./replaceAll");
1
+ import { replaceAll } from './replaceAll';
5
2
  const br2nl = function (st) {
6
- return (0, replaceAll_1.replaceAll)('<br />', '\n', (0, replaceAll_1.replaceAll)('<br/>', '\n', (0, replaceAll_1.replaceAll)('<br>', '\n', st)));
3
+ return replaceAll('<br />', '\n', replaceAll('<br/>', '\n', replaceAll('<br>', '\n', st)));
7
4
  };
8
- exports.br2nl = br2nl;
5
+ export { br2nl };
@@ -1,25 +1,19 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.calendar = void 0;
7
- const fdate_1 = require("./fdate");
8
- const date_1 = require("./date");
9
- const isDate_1 = require("./isDate");
10
- const isString_1 = require("./isString");
11
- const dayjs_1 = __importDefault(require("dayjs"));
12
- const calendar_1 = __importDefault(require("dayjs/plugin/calendar"));
13
- dayjs_1.default.extend(calendar_1.default);
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';
7
+ dayjs.extend(cal);
14
8
  const calendar = function (d, wrong_result) {
15
- if (undefined === dayjs_1.default) {
16
- return (0, fdate_1.fdate)(d, wrong_result);
9
+ if (undefined === dayjs) {
10
+ return fdate(d, wrong_result);
17
11
  }
18
- let r = (0, date_1.date)(d);
19
- if (!(0, isDate_1.isDate)(r)) {
20
- return wrong_result && (0, isString_1.isString)(wrong_result) ? wrong_result : '';
12
+ let r = date(d);
13
+ if (!isDate(r)) {
14
+ return wrong_result && isString(wrong_result) ? wrong_result : '';
21
15
  }
22
- return (0, dayjs_1.default)(r).calendar(null, {
16
+ return dayjs(r).calendar(null, {
23
17
  sameDay: '[' + bbn._('Today') + ']',
24
18
  nextDay: '[' + bbn._('Tomorrow') + ']',
25
19
  nextWeek: 'ddd D',
@@ -28,4 +22,4 @@ const calendar = function (d, wrong_result) {
28
22
  sameElse: 'L',
29
23
  });
30
24
  };
31
- exports.calendar = calendar;
25
+ export { calendar };