@bbn/bbn 1.0.30 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/bundle.d.ts +8 -8
  2. package/dist/bundle.js +11 -11
  3. package/dist/fn/_addLoader.js +3 -6
  4. package/dist/fn/_compareValues.js +11 -14
  5. package/dist/fn/_deleteLoader.js +7 -10
  6. package/dist/fn/abort.js +3 -6
  7. package/dist/fn/abortURL.js +4 -7
  8. package/dist/fn/addColors.js +5 -8
  9. package/dist/fn/addInputs.js +3 -6
  10. package/dist/fn/addStyle.js +5 -8
  11. package/dist/fn/adjustHeight.js +5 -8
  12. package/dist/fn/adjustSize.js +5 -8
  13. package/dist/fn/adjustWidth.js +5 -8
  14. package/dist/fn/ajax.js +31 -34
  15. package/dist/fn/analyzeFunction.js +3 -6
  16. package/dist/fn/animateCss.js +1 -4
  17. package/dist/fn/arrayBuffer2String.js +1 -4
  18. package/dist/fn/arrayFromProp.js +5 -8
  19. package/dist/fn/autoExtend.js +4 -7
  20. package/dist/fn/baseName.js +6 -9
  21. package/dist/fn/br2nl.js +3 -6
  22. package/dist/fn/calendar.js +10 -15
  23. package/dist/fn/callback.js +16 -19
  24. package/dist/fn/camelToCss.js +1 -4
  25. package/dist/fn/camelize.js +1 -4
  26. package/dist/fn/canvasToImage.js +1 -4
  27. package/dist/fn/center.js +1 -4
  28. package/dist/fn/checkProps.js +3 -6
  29. package/dist/fn/checkPropsDetails.js +9 -12
  30. package/dist/fn/checkPropsOrDie.js +3 -6
  31. package/dist/fn/checkType.js +16 -19
  32. package/dist/fn/chrono.js +3 -7
  33. package/dist/fn/circularReplacer.js +7 -10
  34. package/dist/fn/clone.js +7 -10
  35. package/dist/fn/colorToHex.js +1 -4
  36. package/dist/fn/compare.js +18 -21
  37. package/dist/fn/compareConditions.js +10 -13
  38. package/dist/fn/copy.js +4 -7
  39. package/dist/fn/correctCase.js +1 -4
  40. package/dist/fn/count.js +3 -6
  41. package/dist/fn/crc32.js +1 -4
  42. package/dist/fn/createObject.js +3 -6
  43. package/dist/fn/cssExists.js +3 -6
  44. package/dist/fn/date.js +8 -11
  45. package/dist/fn/dateSQL.d.ts +1 -1
  46. package/dist/fn/dateSQL.js +3 -7
  47. package/dist/fn/daysInMonth.d.ts +1 -1
  48. package/dist/fn/daysInMonth.js +3 -7
  49. package/dist/fn/deepPath.js +7 -10
  50. package/dist/fn/defaultAjaxAbortFunction.js +3 -6
  51. package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
  52. package/dist/fn/defaultAjaxErrorFunction.js +1 -4
  53. package/dist/fn/defaultAlertFunction.js +1 -4
  54. package/dist/fn/defaultConfirmFunction.js +4 -7
  55. package/dist/fn/defaultEndLoadingFunction.js +1 -4
  56. package/dist/fn/defaultErrorFunction.js +3 -6
  57. package/dist/fn/defaultHistoryFunction.js +1 -4
  58. package/dist/fn/defaultLinkFunction.js +1 -4
  59. package/dist/fn/defaultPostLinkFunction.js +1 -4
  60. package/dist/fn/defaultPreLinkFunction.js +1 -4
  61. package/dist/fn/defaultResizeFunction.js +1 -4
  62. package/dist/fn/defaultStartLoadingFunction.js +1 -4
  63. package/dist/fn/deleteProp.js +4 -7
  64. package/dist/fn/diffObj.js +16 -19
  65. package/dist/fn/dirName.js +7 -10
  66. package/dist/fn/download.js +15 -18
  67. package/dist/fn/downloadContent.js +9 -12
  68. package/dist/fn/each.js +7 -10
  69. package/dist/fn/eraseCookie.js +1 -4
  70. package/dist/fn/error.js +3 -6
  71. package/dist/fn/escapeDquotes.js +3 -6
  72. package/dist/fn/escapeRegExp.js +1 -4
  73. package/dist/fn/escapeSquotes.js +3 -6
  74. package/dist/fn/escapeTicks.js +3 -6
  75. package/dist/fn/escapeUrl.js +8 -11
  76. package/dist/fn/extend.js +13 -16
  77. package/dist/fn/extendOut.js +4 -7
  78. package/dist/fn/fdate.js +9 -13
  79. package/dist/fn/fdatetime.js +7 -11
  80. package/dist/fn/fieldValue.js +1 -4
  81. package/dist/fn/fileExt.js +3 -6
  82. package/dist/fn/filter.js +12 -15
  83. package/dist/fn/filterToConditions.js +8 -11
  84. package/dist/fn/findAll.js +7 -10
  85. package/dist/fn/fori.js +6 -9
  86. package/dist/fn/forir.js +6 -9
  87. package/dist/fn/format.js +3 -6
  88. package/dist/fn/formatBytes.js +1 -4
  89. package/dist/fn/formatDate.d.ts +1 -1
  90. package/dist/fn/formatDate.js +1 -5
  91. package/dist/fn/formatSize.js +5 -8
  92. package/dist/fn/formdata.js +11 -14
  93. package/dist/fn/fromXml.js +1 -4
  94. package/dist/fn/ftime.js +8 -13
  95. package/dist/fn/getAllTags.js +3 -6
  96. package/dist/fn/getAncestors.js +1 -4
  97. package/dist/fn/getAttributes.js +3 -6
  98. package/dist/fn/getBrowserName.js +1 -4
  99. package/dist/fn/getBrowserVersion.js +1 -4
  100. package/dist/fn/getCookie.js +1 -4
  101. package/dist/fn/getCssVar.js +1 -4
  102. package/dist/fn/getDay.js +3 -6
  103. package/dist/fn/getDeviceType.js +1 -4
  104. package/dist/fn/getEventData.js +7 -10
  105. package/dist/fn/getField.js +3 -6
  106. package/dist/fn/getFieldValues.js +7 -10
  107. package/dist/fn/getHTMLOfSelection.js +4 -7
  108. package/dist/fn/getHtml.js +3 -6
  109. package/dist/fn/getLoader.js +3 -6
  110. package/dist/fn/getPath.js +3 -6
  111. package/dist/fn/getProp.js +4 -7
  112. package/dist/fn/getProperty.js +1 -4
  113. package/dist/fn/getRequestId.js +5 -8
  114. package/dist/fn/getRow.js +3 -6
  115. package/dist/fn/getScrollBarSize.js +1 -4
  116. package/dist/fn/getText.js +1 -4
  117. package/dist/fn/getTimeoff.js +1 -4
  118. package/dist/fn/happy.js +3 -6
  119. package/dist/fn/hash.js +11 -14
  120. package/dist/fn/hex2rgb.js +1 -4
  121. package/dist/fn/history.js +1 -4
  122. package/dist/fn/html2text.js +1 -4
  123. package/dist/fn/imageToCanvas.js +1 -4
  124. package/dist/fn/imgToBase64.js +3 -6
  125. package/dist/fn/info.js +3 -6
  126. package/dist/fn/init.js +31 -35
  127. package/dist/fn/isActiveInterface.js +1 -4
  128. package/dist/fn/isArray.js +1 -4
  129. package/dist/fn/isBlob.js +1 -4
  130. package/dist/fn/isBoolean.js +1 -4
  131. package/dist/fn/isCanvas.js +1 -4
  132. package/dist/fn/isColor.js +3 -6
  133. package/dist/fn/isComment.js +1 -4
  134. package/dist/fn/isCp.js +3 -6
  135. package/dist/fn/isDate.js +1 -4
  136. package/dist/fn/isDesktopDevice.js +1 -4
  137. package/dist/fn/isDimension.js +3 -6
  138. package/dist/fn/isDom.js +1 -4
  139. package/dist/fn/isEmail.js +3 -6
  140. package/dist/fn/isEmpty.js +5 -8
  141. package/dist/fn/isEvent.js +1 -4
  142. package/dist/fn/isFocused.js +1 -4
  143. package/dist/fn/isFunction.js +1 -4
  144. package/dist/fn/isHostname.js +5 -8
  145. package/dist/fn/isIP.js +3 -6
  146. package/dist/fn/isInside.js +7 -10
  147. package/dist/fn/isInt.js +1 -4
  148. package/dist/fn/isIterable.js +1 -4
  149. package/dist/fn/isMobile.js +4 -7
  150. package/dist/fn/isMobileDevice.js +1 -4
  151. package/dist/fn/isNull.js +1 -4
  152. package/dist/fn/isNumber.js +1 -4
  153. package/dist/fn/isObject.js +1 -4
  154. package/dist/fn/isPercent.js +1 -4
  155. package/dist/fn/isPrimitive.js +1 -4
  156. package/dist/fn/isPromise.js +1 -4
  157. package/dist/fn/isPropSize.js +3 -6
  158. package/dist/fn/isSQLDate.js +1 -4
  159. package/dist/fn/isSame.js +5 -8
  160. package/dist/fn/isString.js +1 -4
  161. package/dist/fn/isSymbol.js +1 -4
  162. package/dist/fn/isTabletDevice.js +1 -4
  163. package/dist/fn/isURL.js +1 -4
  164. package/dist/fn/isValidDimension.js +4 -7
  165. package/dist/fn/isValidName.js +3 -6
  166. package/dist/fn/isValue.js +3 -6
  167. package/dist/fn/isVue.js +1 -4
  168. package/dist/fn/iterate.js +5 -8
  169. package/dist/fn/lightenDarkenHex.js +1 -4
  170. package/dist/fn/link.js +19 -22
  171. package/dist/fn/log.js +3 -6
  172. package/dist/fn/makeReactive.js +28 -31
  173. package/dist/fn/map.js +3 -6
  174. package/dist/fn/md5.js +1 -4
  175. package/dist/fn/money.js +3 -6
  176. package/dist/fn/move.js +1 -4
  177. package/dist/fn/multiorder.js +3 -6
  178. package/dist/fn/nl2br.js +3 -6
  179. package/dist/fn/numProperties.js +1 -4
  180. package/dist/fn/objectToFormData.js +12 -15
  181. package/dist/fn/order.js +3 -6
  182. package/dist/fn/outerHeight.js +3 -6
  183. package/dist/fn/outerWidth.js +3 -6
  184. package/dist/fn/percent.js +1 -4
  185. package/dist/fn/pickValue.js +1 -4
  186. package/dist/fn/post.js +7 -10
  187. package/dist/fn/postOut.js +5 -8
  188. package/dist/fn/printf.js +1 -4
  189. package/dist/fn/quotes2html.js +4 -7
  190. package/dist/fn/randomInt.js +1 -4
  191. package/dist/fn/randomString.js +4 -7
  192. package/dist/fn/removeAccents.js +5 -8
  193. package/dist/fn/removeEmpty.js +8 -11
  194. package/dist/fn/removeExtraSpaces.js +1 -4
  195. package/dist/fn/removeHtmlComments.js +3 -6
  196. package/dist/fn/removePrivateProp.js +3 -6
  197. package/dist/fn/removeTrailingChars.js +6 -9
  198. package/dist/fn/repeat.js +1 -4
  199. package/dist/fn/replaceAll.js +4 -7
  200. package/dist/fn/replaceSelection.js +1 -4
  201. package/dist/fn/resize.js +7 -10
  202. package/dist/fn/rgb2hex.js +1 -4
  203. package/dist/fn/riterate.js +3 -6
  204. package/dist/fn/roundDecimal.js +1 -4
  205. package/dist/fn/sanitize.js +5 -8
  206. package/dist/fn/search.js +15 -18
  207. package/dist/fn/selectElementText.js +1 -4
  208. package/dist/fn/selector.js +1 -4
  209. package/dist/fn/setCookie.js +1 -4
  210. package/dist/fn/setCssVar.js +1 -4
  211. package/dist/fn/setNavigationVars.js +10 -13
  212. package/dist/fn/setProp.js +1 -4
  213. package/dist/fn/setProperty.js +3 -6
  214. package/dist/fn/shorten.js +5 -8
  215. package/dist/fn/shortenObj.js +9 -12
  216. package/dist/fn/shuffle.js +1 -4
  217. package/dist/fn/simpleHash.js +5 -8
  218. package/dist/fn/simpleHash1.js +1 -4
  219. package/dist/fn/simpleHash2.js +1 -4
  220. package/dist/fn/stat.js +1 -4
  221. package/dist/fn/string2ArrayBuffer.js +1 -4
  222. package/dist/fn/submit.js +6 -9
  223. package/dist/fn/substr.js +7 -10
  224. package/dist/fn/sum.js +4 -7
  225. package/dist/fn/timestamp.js +1 -4
  226. package/dist/fn/toCSV.js +8 -11
  227. package/dist/fn/toggleFullScreen.js +3 -6
  228. package/dist/fn/translate.js +3 -6
  229. package/dist/fn/treatAjaxArguments.js +10 -13
  230. package/dist/fn/trim.js +4 -7
  231. package/dist/fn/uniqString.js +7 -10
  232. package/dist/fn/unique.js +1 -4
  233. package/dist/fn/upload.js +6 -10
  234. package/dist/fn/warning.js +3 -6
  235. package/dist/index.d.ts +4 -4
  236. package/dist/index.js +459 -471
  237. package/package.json +1 -1
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.correctCase = void 0;
4
1
  const correctCase = function (str) {
5
2
  return str.replace(/[A-z]{1}/, (c) => c.toUpperCase());
6
3
  };
7
- exports.correctCase = correctCase;
4
+ export { correctCase };
package/dist/fn/count.js CHANGED
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.count = void 0;
4
- const filter_1 = require("./filter");
1
+ import { filter } from './filter';
5
2
  const count = function (arr, prop, val = null, operator = '=') {
6
- return (0, filter_1.filter)(arr, prop, val, operator).length || 0;
3
+ return filter(arr, prop, val, operator).length || 0;
7
4
  };
8
- exports.count = count;
5
+ export { count };
package/dist/fn/crc32.js CHANGED
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.crc32 = void 0;
4
1
  // this is a test
5
2
  const crc32Table = [];
6
3
  for (let i = 0; i < 256; i++) {
@@ -18,4 +15,4 @@ const crc32 = function (str) {
18
15
  }
19
16
  return (crc ^ -1) >>> 0; // Make sure the result is a 32-bit positive integer
20
17
  };
21
- exports.crc32 = crc32;
18
+ export { crc32 };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createObject = void 0;
4
- const extend_1 = require("./extend");
1
+ import { extend } from './extend';
5
2
  const createObject = function (...args) {
6
3
  const obj = Object.create(null);
7
4
  if (args.length) {
8
- (0, extend_1.extend)(obj, ...args);
5
+ extend(obj, ...args);
9
6
  }
10
7
  return obj;
11
8
  };
12
- exports.createObject = createObject;
9
+ export { createObject };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cssExists = void 0;
4
1
  //import { log } from './log';
5
- const escapeRegExp_1 = require("./escapeRegExp");
2
+ import { escapeRegExp } from './escapeRegExp';
6
3
  const cssExists = function (f) {
7
4
  let ok;
8
5
  let rules;
@@ -22,7 +19,7 @@ const cssExists = function (f) {
22
19
  //log(rules);
23
20
  for (let cx = 0; cx < rules.length; cx++) {
24
21
  //log(rules[cx].selectorText);
25
- if (new RegExp('(^|\\s)' + (0, escapeRegExp_1.escapeRegExp)(f) + '(\\{|\\s)', 'g').test(rules[cx].selectorText)) {
22
+ if (new RegExp('(^|\\s)' + escapeRegExp(f) + '(\\{|\\s)', 'g').test(rules[cx].selectorText)) {
26
23
  return true;
27
24
  }
28
25
  }
@@ -30,4 +27,4 @@ const cssExists = function (f) {
30
27
  }
31
28
  return false;
32
29
  };
33
- exports.cssExists = cssExists;
30
+ export { cssExists };
package/dist/fn/date.js CHANGED
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.date = void 0;
4
- const isNumber_1 = require("./isNumber");
5
- const substr_1 = require("./substr");
6
- const isDate_1 = require("./isDate");
1
+ import { isNumber } from './isNumber';
2
+ import { substr } from './substr';
3
+ import { isDate } from './isDate';
7
4
  const date = function (v) {
8
5
  let d = false, t = typeof v;
9
6
  if (v === undefined) {
10
7
  return new Date();
11
8
  }
12
- if (t === 'number' || ((0, isNumber_1.isNumber)(v) && v !== '')) {
9
+ if (t === 'number' || (isNumber(v) && v !== '')) {
13
10
  if (v < 10000000000) {
14
11
  v = v * 1000;
15
12
  }
@@ -17,15 +14,15 @@ const date = function (v) {
17
14
  }
18
15
  if (t === 'string') {
19
16
  if (v.length === 10) {
20
- return new Date(parseInt((0, substr_1.substr)(v, 0, 4)), parseInt((0, substr_1.substr)(v, 5, 2)) - 1, parseInt((0, substr_1.substr)(v, 8, 2)), 12);
17
+ return new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), 12);
21
18
  }
22
19
  else if (v.length === 19) {
23
- return new Date(parseInt((0, substr_1.substr)(v, 0, 4)), parseInt((0, substr_1.substr)(v, 5, 2)) - 1, parseInt((0, substr_1.substr)(v, 8, 2)), parseInt((0, substr_1.substr)(v, 11, 2)), parseInt((0, substr_1.substr)(v, 14, 2)), parseInt((0, substr_1.substr)(v, 17, 2)));
20
+ return new Date(parseInt(substr(v, 0, 4)), parseInt(substr(v, 5, 2)) - 1, parseInt(substr(v, 8, 2)), parseInt(substr(v, 11, 2)), parseInt(substr(v, 14, 2)), parseInt(substr(v, 17, 2)));
24
21
  }
25
22
  }
26
- else if ((0, isDate_1.isDate)(v)) {
23
+ else if (isDate(v)) {
27
24
  return v;
28
25
  }
29
26
  return d;
30
27
  };
31
- exports.date = date;
28
+ export { date };
@@ -1,2 +1,2 @@
1
- declare const dateSQL: (v: any, dayOnly: any) => any;
1
+ declare const dateSQL: (v: any, dayOnly: any) => string;
2
2
  export { dateSQL };
@@ -1,12 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateSQL = void 0;
4
- const date_1 = require("./date");
5
- const dayjs = require("dayjs");
1
+ import { date } from './date';
6
2
  const dateSQL = function (v, dayOnly) {
7
- let value = (0, date_1.date)(v);
3
+ let value = date(v);
8
4
  if (value) {
9
5
  return dayjs(value).format('YYYY-MM-DD' + (dayOnly ? '' : ' HH:mm:ss'));
10
6
  }
11
7
  };
12
- exports.dateSQL = dateSQL;
8
+ export { dateSQL };
@@ -1,2 +1,2 @@
1
- declare const daysInMonth: (v: any) => any;
1
+ declare const daysInMonth: (v: any) => number | false;
2
2
  export { daysInMonth };
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.daysInMonth = void 0;
4
- const date_1 = require("./date");
5
- const dayjs = require("dayjs");
1
+ import { date } from './date';
6
2
  const daysInMonth = function (v) {
7
- let d = (0, date_1.date)(v);
3
+ let d = date(v);
8
4
  if (d) {
9
5
  return dayjs(d).daysInMonth();
10
6
  }
11
7
  return false;
12
8
  };
13
- exports.daysInMonth = daysInMonth;
9
+ export { daysInMonth };
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deepPath = void 0;
4
- const search_1 = require("./search");
5
- const each_1 = require("./each");
6
- const isArray_1 = require("./isArray");
1
+ import { search } from './search';
2
+ import { each } from './each';
3
+ import { isArray } from './isArray';
7
4
  const deepPath = function (arr, filter, deepProperty, res = []) {
8
5
  let idx;
9
6
  let start = 0;
10
- if ((idx = (0, search_1.search)(arr, filter, start)) > -1) {
7
+ if ((idx = search(arr, filter, start)) > -1) {
11
8
  res.push(idx);
12
9
  return res;
13
10
  }
14
- (0, each_1.each)(arr, (it, i) => {
15
- if ((0, isArray_1.isArray)(it[deepProperty])) {
11
+ each(arr, (it, i) => {
12
+ if (isArray(it[deepProperty])) {
16
13
  let r = res.slice();
17
14
  r.push(i);
18
15
  let tmp = deepPath(it[deepProperty], filter, deepProperty, r);
@@ -23,4 +20,4 @@ const deepPath = function (arr, filter, deepProperty, res = []) {
23
20
  });
24
21
  return false;
25
22
  };
26
- exports.deepPath = deepPath;
23
+ export { deepPath };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultAjaxAbortFunction = void 0;
4
- const log_1 = require("./log");
1
+ import { log } from './log';
5
2
  const defaultAjaxAbortFunction = function (message, url = '') {
6
- (0, log_1.log)(message);
3
+ log(message);
7
4
  };
8
- exports.defaultAjaxAbortFunction = defaultAjaxAbortFunction;
5
+ export { defaultAjaxAbortFunction };
@@ -1,2 +1,2 @@
1
- declare const defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: Error) => boolean;
1
+ declare const defaultAjaxErrorFunction: (jqXHR: any, textStatus?: string, errorThrown?: object) => boolean;
2
2
  export { defaultAjaxErrorFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultAjaxErrorFunction = void 0;
4
1
  const defaultAjaxErrorFunction = function (jqXHR, textStatus, errorThrown) {
5
2
  return false;
6
3
  };
7
- exports.defaultAjaxErrorFunction = defaultAjaxErrorFunction;
4
+ export { defaultAjaxErrorFunction };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultAlertFunction = void 0;
4
1
  const defaultAlertFunction = function (msg, title) {
5
2
  /** @todo */
6
3
  alert(msg);
7
4
  };
8
- exports.defaultAlertFunction = defaultAlertFunction;
5
+ export { defaultAlertFunction };
@@ -1,17 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultConfirmFunction = void 0;
4
- const isFunction_1 = require("./isFunction");
1
+ import { isFunction } from './isFunction';
5
2
  const defaultConfirmFunction = function (text, yesFn, noFn) {
6
3
  let ok = 0;
7
4
  if (confirm(text)) {
8
- if ((0, isFunction_1.isFunction)(yesFn)) {
5
+ if (isFunction(yesFn)) {
9
6
  yesFn();
10
7
  ok = 1;
11
8
  }
12
9
  }
13
- if (!ok && (0, isFunction_1.isFunction)(noFn)) {
10
+ if (!ok && isFunction(noFn)) {
14
11
  noFn();
15
12
  }
16
13
  };
17
- exports.defaultConfirmFunction = defaultConfirmFunction;
14
+ export { defaultConfirmFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultEndLoadingFunction = void 0;
4
1
  const defaultEndLoadingFunction = function (url, timestamp, data, res) {
5
2
  return true;
6
3
  };
7
- exports.defaultEndLoadingFunction = defaultEndLoadingFunction;
4
+ export { defaultEndLoadingFunction };
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultErrorFunction = void 0;
4
- const log_1 = require("./log");
1
+ import { log } from './log';
5
2
  const defaultErrorFunction = function (message) {
6
- (0, log_1.log)(message);
3
+ log(message);
7
4
  };
8
- exports.defaultErrorFunction = defaultErrorFunction;
5
+ export { defaultErrorFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultHistoryFunction = void 0;
4
1
  const defaultHistoryFunction = function (obj) {
5
2
  return true;
6
3
  };
7
- exports.defaultHistoryFunction = defaultHistoryFunction;
4
+ export { defaultHistoryFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultLinkFunction = void 0;
4
1
  const defaultLinkFunction = function (responseObj, ele) {
5
2
  return true;
6
3
  };
7
- exports.defaultLinkFunction = defaultLinkFunction;
4
+ export { defaultLinkFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultPostLinkFunction = void 0;
4
1
  const defaultPostLinkFunction = function (r, ele) {
5
2
  return true;
6
3
  };
7
- exports.defaultPostLinkFunction = defaultPostLinkFunction;
4
+ export { defaultPostLinkFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultPreLinkFunction = void 0;
4
1
  const defaultPreLinkFunction = function (url, force, ele) {
5
2
  return url;
6
3
  };
7
- exports.defaultPreLinkFunction = defaultPreLinkFunction;
4
+ export { defaultPreLinkFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultResizeFunction = void 0;
4
1
  const defaultResizeFunction = function () {
5
2
  return true;
6
3
  };
7
- exports.defaultResizeFunction = defaultResizeFunction;
4
+ export { defaultResizeFunction };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultStartLoadingFunction = void 0;
4
1
  const defaultStartLoadingFunction = function (url, tst, data, requestId = null) {
5
2
  return true;
6
3
  };
7
- exports.defaultStartLoadingFunction = defaultStartLoadingFunction;
4
+ export { defaultStartLoadingFunction };
@@ -1,10 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deleteProp = void 0;
4
- const checkType_1 = require("./checkType");
1
+ import { checkType } from './checkType';
5
2
  const deleteProp = function (obj, prop) {
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'));
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'));
8
5
  delete obj[prop];
9
6
  };
10
- exports.deleteProp = deleteProp;
7
+ export { deleteProp };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.diffObj = void 0;
4
- const isDate_1 = require("./isDate");
5
- const createObject_1 = require("./createObject");
6
- const isFunction_1 = require("./isFunction");
7
- const isValue_1 = require("./isValue");
8
- const isDom_1 = require("./isDom");
9
- const numProperties_1 = require("./numProperties");
1
+ import { isDate } from './isDate';
2
+ import { createObject } from './createObject';
3
+ import { isFunction } from './isFunction';
4
+ import { isValue } from './isValue';
5
+ import { isDom } from './isDom';
6
+ import { numProperties } from './numProperties';
10
7
  let diffObjProcessed = [];
11
8
  const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
12
9
  if (!notRoot) {
@@ -16,7 +13,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
16
13
  if (value1 === value2) {
17
14
  return VALUE_UNCHANGED;
18
15
  }
19
- if ((0, isDate_1.isDate)(value1) && (0, isDate_1.isDate)(value2) && value1.getTime() === value2.getTime()) {
16
+ if (isDate(value1) && isDate(value2) && value1.getTime() === value2.getTime()) {
20
17
  return VALUE_UNCHANGED;
21
18
  }
22
19
  if ('undefined' == typeof value1) {
@@ -30,12 +27,12 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
30
27
  if (notRoot === undefined) {
31
28
  notRoot = false;
32
29
  }
33
- let diff = (0, createObject_1.createObject)();
34
- if (!(0, isFunction_1.isFunction)(obj1) && !(0, isFunction_1.isFunction)(obj2)) {
35
- if ((0, isValue_1.isValue)(obj1) || (0, isValue_1.isValue)(obj2)) {
30
+ let diff = createObject();
31
+ if (!isFunction(obj1) && !isFunction(obj2)) {
32
+ if (isValue(obj1) || isValue(obj2)) {
36
33
  let res = _compareValues(obj1, obj2);
37
34
  if (unchanged || res !== VALUE_UNCHANGED) {
38
- let ret = (0, createObject_1.createObject)();
35
+ let ret = createObject();
39
36
  Object.defineProperty(ret, 'type', {
40
37
  value: res,
41
38
  enumerable: false,
@@ -58,7 +55,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
58
55
  }
59
56
  return false;
60
57
  }
61
- if ((0, isDom_1.isDom)(obj1) || (0, isDom_1.isDom)(obj2)) {
58
+ if (isDom(obj1) || isDom(obj2)) {
62
59
  return false;
63
60
  }
64
61
  if (diffObjProcessed.includes(obj1) || diffObjProcessed.includes(obj2)) {
@@ -67,7 +64,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
67
64
  }
68
65
  diffObjProcessed.push(obj1, obj2);
69
66
  for (let key in obj1) {
70
- if ((0, isFunction_1.isFunction)(obj1[key])) {
67
+ if (isFunction(obj1[key])) {
71
68
  continue;
72
69
  }
73
70
  let value2 = undefined;
@@ -80,7 +77,7 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
80
77
  }
81
78
  }
82
79
  for (let key in obj2) {
83
- if ((0, isFunction_1.isFunction)(obj2[key]) || 'undefined' != typeof obj1[key]) {
80
+ if (isFunction(obj2[key]) || 'undefined' != typeof obj1[key]) {
84
81
  continue;
85
82
  }
86
83
  let res = diffObj(undefined, obj2[key], unchanged, true);
@@ -89,6 +86,6 @@ const diffObj = function (obj1, obj2, unchanged = false, notRoot = false) {
89
86
  }
90
87
  }
91
88
  }
92
- return !notRoot || unchanged || (0, numProperties_1.numProperties)(diff) ? diff : false;
89
+ return !notRoot || unchanged || numProperties(diff) ? diff : false;
93
90
  };
94
- exports.diffObj = diffObj;
91
+ export { diffObj };
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dirName = 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 dirName = function (path) {
7
- if ((0, isString_1.isString)(path) && path) {
8
- while ((0, substr_1.substr)(path, path.length - 1) === '/') {
9
- path = (0, substr_1.substr)(path, 0, path.length - 1);
4
+ if (isString(path) && path) {
5
+ while (substr(path, path.length - 1) === '/') {
6
+ path = substr(path, 0, path.length - 1);
10
7
  }
11
8
  let pos = path.lastIndexOf('/');
12
9
  if (pos > 0) {
13
- return (0, substr_1.substr)(path, 0, pos);
10
+ return substr(path, 0, pos);
14
11
  }
15
12
  if (pos === 0) {
16
13
  return '/';
@@ -18,4 +15,4 @@ const dirName = function (path) {
18
15
  }
19
16
  return '';
20
17
  };
21
- exports.dirName = dirName;
18
+ export { dirName };
@@ -1,39 +1,36 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.download = void 0;
4
- const ajax_1 = require("./ajax");
5
- const substr_1 = require("./substr");
6
- const baseName_1 = require("./baseName");
7
- const isBlob_1 = require("./isBlob");
8
- const fileExt_1 = require("./fileExt");
9
- const downloadContent_1 = require("./downloadContent");
10
- const defaultAjaxErrorFunction_1 = require("./defaultAjaxErrorFunction");
1
+ import { ajax } from './ajax';
2
+ import { substr } from './substr';
3
+ import { baseName } from './baseName';
4
+ import { isBlob } from './isBlob';
5
+ import { fileExt } from './fileExt';
6
+ import { downloadContent } from './downloadContent';
7
+ import { defaultAjaxErrorFunction } from './defaultAjaxErrorFunction';
11
8
  const download = function (url, filename, params) {
12
9
  // We can intervert the arguments
13
10
  if (filename && (typeof (filename) === 'object')) {
14
11
  params = filename;
15
12
  filename = null;
16
13
  }
17
- return (0, ajax_1.ajax)(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
14
+ return ajax(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
18
15
  if (!filename) {
19
16
  let cd = 'attachment; filename=';
20
17
  if (headers && headers['content-disposition'] && headers['content-disposition'].indexOf(cd) === 0) {
21
- filename = (0, substr_1.substr)(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
18
+ filename = substr(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
22
19
  }
23
20
  else {
24
- filename = (0, baseName_1.baseName)(url);
21
+ filename = baseName(url);
25
22
  }
26
23
  }
27
- if ((0, isBlob_1.isBlob)(d)) {
28
- let extension = (0, fileExt_1.fileExt)(filename);
24
+ if (isBlob(d)) {
25
+ let extension = fileExt(filename);
29
26
  let htmlExtensions = ['php', 'html'];
30
27
  if ((typeof filename === 'string') && ((('type' in d) && (d.type !== 'text/html')) || htmlExtensions.includes(extension))) {
31
- (0, downloadContent_1.downloadContent)(filename, d);
28
+ downloadContent(filename, d);
32
29
  return;
33
30
  }
34
31
  }
35
32
  }, e => {
36
- (0, defaultAjaxErrorFunction_1.defaultAjaxErrorFunction)(e);
33
+ defaultAjaxErrorFunction(e);
37
34
  });
38
35
  };
39
- exports.download = download;
36
+ export { download };
@@ -1,12 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.downloadContent = void 0;
4
- const isCanvas_1 = require("./isCanvas");
5
- const isObject_1 = require("./isObject");
6
- const isString_1 = require("./isString");
7
- const log_1 = require("./log");
1
+ import { isCanvas } from './isCanvas';
2
+ import { isObject } from './isObject';
3
+ import { isString } from './isString';
4
+ import { log } from './log';
8
5
  const downloadContent = function (filename, content, type) {
9
- if ((0, isCanvas_1.isCanvas)(content)) {
6
+ if (isCanvas(content)) {
10
7
  content.toBlob((blob) => {
11
8
  // blob ready, download it
12
9
  let a = document.createElement('a');
@@ -20,7 +17,7 @@ const downloadContent = function (filename, content, type) {
20
17
  return;
21
18
  }
22
19
  if (!type) {
23
- type = (0, isObject_1.isObject)(content) && content.type ? content.type : 'octet/stream';
20
+ type = isObject(content) && content.type ? content.type : 'octet/stream';
24
21
  }
25
22
  else if (type.indexOf('/') === -1) {
26
23
  type = 'text/' + type;
@@ -28,7 +25,7 @@ const downloadContent = function (filename, content, type) {
28
25
  let a = window.document.createElement('a');
29
26
  a.className = 'bbn-no';
30
27
  let src = null;
31
- if ((0, isString_1.isString)(content)) {
28
+ if (isString(content)) {
32
29
  src = new Blob([content], { type: type });
33
30
  }
34
31
  else {
@@ -36,7 +33,7 @@ const downloadContent = function (filename, content, type) {
36
33
  src = content;
37
34
  }
38
35
  catch (e) {
39
- (0, log_1.log)(e);
36
+ log(e);
40
37
  }
41
38
  }
42
39
  a.href = window.URL.createObjectURL(src);
@@ -48,4 +45,4 @@ const downloadContent = function (filename, content, type) {
48
45
  // Remove anchor from body
49
46
  document.body.removeChild(a);
50
47
  };
51
- exports.downloadContent = downloadContent;
48
+ export { downloadContent };
package/dist/fn/each.js CHANGED
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.each = void 0;
4
- const isNumber_1 = require("./isNumber");
5
- const isIterable_1 = require("./isIterable");
6
- const iterate_1 = require("./iterate");
1
+ import { isNumber } from './isNumber';
2
+ import { isIterable } from './isIterable';
3
+ import { iterate } from './iterate';
7
4
  const each = function (arr, fn) {
8
- if ((0, isNumber_1.isNumber)(arr) && arr > 0) {
5
+ if (isNumber(arr) && arr > 0) {
9
6
  for (let i = 0; i < arr; i++) {
10
7
  if (fn(i, i) === false) {
11
8
  return;
@@ -13,7 +10,7 @@ const each = function (arr, fn) {
13
10
  }
14
11
  return;
15
12
  }
16
- if ((0, isIterable_1.isIterable)(arr)) {
13
+ if (isIterable(arr)) {
17
14
  for (let i = 0; i < arr.length; i++) {
18
15
  if (fn(arr[i], i) === false) {
19
16
  return;
@@ -21,6 +18,6 @@ const each = function (arr, fn) {
21
18
  }
22
19
  return arr;
23
20
  }
24
- return (0, iterate_1.iterate)(arr, fn);
21
+ return iterate(arr, fn);
25
22
  };
26
- exports.each = each;
23
+ export { each };
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.eraseCookie = void 0;
4
1
  const eraseCookie = function (name) {
5
2
  document.cookie = name + '=; Max-Age=-99999999;';
6
3
  };
7
- exports.eraseCookie = eraseCookie;
4
+ export { eraseCookie };
package/dist/fn/error.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.error = void 0;
4
- const log_1 = require("./log");
1
+ import { log } from './log';
5
2
  const error = function (errorMsg) {
6
3
  if (arguments.length > 1) {
7
4
  const args = [];
@@ -13,8 +10,8 @@ const error = function (errorMsg) {
13
10
  _bbn_console_level: 1,
14
11
  _bbn_console_style: 'color: #E64141; background: #F7E195; font-size: 14px',
15
12
  });
16
- log_1.log.apply(this, args);
13
+ log.apply(this, args);
17
14
  }
18
15
  throw new Error(errorMsg);
19
16
  };
20
- exports.error = error;
17
+ export { error };