@bbn/bbn 1.0.84 → 1.0.85

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.
package/dist/bundle.d.ts CHANGED
@@ -3117,7 +3117,7 @@ declare module "fn/convert/imageToCanvas" {
3117
3117
  * @global
3118
3118
  * @memberof bbn.fn
3119
3119
  * @param {HTMLElement} img
3120
- * @returns
3120
+ * @returns {HTMLCanvasElement}
3121
3121
  */
3122
3122
  const imageToCanvas: (img: any) => HTMLCanvasElement;
3123
3123
  export { imageToCanvas };
@@ -3190,7 +3190,7 @@ declare module "fn/ajax/treatAjaxArguments" {
3190
3190
  *
3191
3191
  * @returns {Object} The configuration object
3192
3192
  */
3193
- const treatAjaxArguments: (args: any) => BbnAjaxCfg;
3193
+ const treatAjaxArguments: (args: any) => any;
3194
3194
  export { treatAjaxArguments };
3195
3195
  }
3196
3196
  declare module "fn/ajax/setNavigationVars" {
@@ -3215,9 +3215,9 @@ declare module "fn/ajax/setNavigationVars" {
3215
3215
  * @param {Object} data The data if any
3216
3216
  * @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
3217
3217
  *
3218
- * @returns {undefined}
3218
+ * @returns {void}
3219
3219
  */
3220
- const setNavigationVars: (url: any, title: any, data?: object, repl?: boolean) => void;
3220
+ const setNavigationVars: (url: any, title: any, data?: any, repl?: boolean) => void;
3221
3221
  export { setNavigationVars };
3222
3222
  }
3223
3223
  declare module "fn/ajax/link" {
@@ -3545,7 +3545,7 @@ declare module "fn/browser/isFocused" {
3545
3545
  *
3546
3546
  * @returns {Boolean} True if focused
3547
3547
  */
3548
- const isFocused: (ele: HTMLElement, contain?: boolean) => boolean;
3548
+ const isFocused: (ele: any, contain?: boolean) => boolean;
3549
3549
  export { isFocused };
3550
3550
  }
3551
3551
  declare module "fn/type/isIP" {
@@ -3735,7 +3735,7 @@ declare module "fn/browser/warning" {
3735
3735
  * @param {...any} args
3736
3736
  * @returns
3737
3737
  */
3738
- const warning: (message: string) => void;
3738
+ const warning: (message: any) => void;
3739
3739
  export { warning };
3740
3740
  }
3741
3741
  declare module "fn/html/makeReactive" {
@@ -4050,6 +4050,38 @@ declare module "fn/object/pickValue" {
4050
4050
  const pickValue: (arr: any[]) => any;
4051
4051
  export { pickValue };
4052
4052
  }
4053
+ declare module "fn/object/setProperty" {
4054
+ /**
4055
+ * Returns the value of the given property from the given object.
4056
+ *
4057
+ * Looks for the given property in the given object, accepting dot (.) separator
4058
+ * for deep property access, and returns its value if found and undefined otherwise.
4059
+ *
4060
+ * @method getProperty
4061
+ * @global
4062
+ * @example
4063
+ * ```javascript
4064
+ * bbn.fn.getProperty({a: 1, b: 2}, 'b');
4065
+ * // 2
4066
+ * ```
4067
+ * @example
4068
+ * ```javascript
4069
+ * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.o.a');
4070
+ * // 33
4071
+ * ```
4072
+ * @example
4073
+ * ```javascript
4074
+ * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.h.a');
4075
+ * // undefined
4076
+ * ```
4077
+ * @memberof bbn.fn
4078
+ * @param {Object} obj
4079
+ * @param {String} prop
4080
+ * @returns {*} The property's value or undefined
4081
+ */
4082
+ const setProperty: (obj: object, prop: string, value: any, force?: boolean) => void;
4083
+ export { setProperty };
4084
+ }
4053
4085
  declare module "fn/ajax/postOut" {
4054
4086
  /**
4055
4087
  * Posts a request in a new window.
@@ -4068,9 +4100,9 @@ declare module "fn/ajax/postOut" {
4068
4100
  * @param {Function} success A function to execute in case of success
4069
4101
  * @param {String} target The target attribute of the form
4070
4102
  *
4071
- * @returns {undefined}
4103
+ * @returns {void}
4072
4104
  */
4073
- const postOut: (url: string, data: BbnBasicObject, success?: () => any, target?: string) => void;
4105
+ const postOut: (url: any, data: any, success?: any, target?: string) => void;
4074
4106
  export { postOut };
4075
4107
  }
4076
4108
  declare module "fn/string/printf" {
@@ -4336,7 +4368,7 @@ declare module "fn/browser/selectElementText" {
4336
4368
  *
4337
4369
  * @returns {Boolean} True if focused
4338
4370
  */
4339
- const selectElementText: (ele: HTMLElement, win?: Window) => void;
4371
+ const selectElementText: (ele: any, win?: any) => void;
4340
4372
  export { selectElementText };
4341
4373
  }
4342
4374
  declare module "fn/browser/setCookie" {
@@ -4380,38 +4412,6 @@ declare module "fn/object/setProp" {
4380
4412
  const setProp: (obj: object, prop: string, value: any, writable?: boolean, configurable?: boolean) => void;
4381
4413
  export { setProp };
4382
4414
  }
4383
- declare module "fn/object/setProperty" {
4384
- /**
4385
- * Returns the value of the given property from the given object.
4386
- *
4387
- * Looks for the given property in the given object, accepting dot (.) separator
4388
- * for deep property access, and returns its value if found and undefined otherwise.
4389
- *
4390
- * @method getProperty
4391
- * @global
4392
- * @example
4393
- * ```javascript
4394
- * bbn.fn.getProperty({a: 1, b: 2}, 'b');
4395
- * // 2
4396
- * ```
4397
- * @example
4398
- * ```javascript
4399
- * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.o.a');
4400
- * // 33
4401
- * ```
4402
- * @example
4403
- * ```javascript
4404
- * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.h.a');
4405
- * // undefined
4406
- * ```
4407
- * @memberof bbn.fn
4408
- * @param {Object} obj
4409
- * @param {String} prop
4410
- * @returns {*} The property's value or undefined
4411
- */
4412
- const setProperty: (obj: object, prop: string, value: any, force?: boolean) => void;
4413
- export { setProperty };
4414
- }
4415
4415
  declare module "fn/string/shorten" {
4416
4416
  /**
4417
4417
  * Shortens the given string after *len* characters.
@@ -4593,7 +4593,7 @@ declare module "fn/convert/toCSV" {
4593
4593
  * @param {String} [valEsc="] The string escaper character
4594
4594
  * @returns {String} A CSV string
4595
4595
  */
4596
- const toCSV: (arr: any[], valSep?: string, rowSep?: string, valEsc?: string) => string;
4596
+ const toCSV: (arr: any, valSep?: string, rowSep?: string, valEsc?: string) => string;
4597
4597
  export { toCSV };
4598
4598
  }
4599
4599
  declare module "fn/browser/toggleFullScreen" {
@@ -4641,7 +4641,7 @@ declare module "fn/ajax/upload" {
4641
4641
  *
4642
4642
  * @returns {Promise}
4643
4643
  */
4644
- const upload: (url: string, file: any, success?: (d: any) => any, failure?: (d: any) => any, progress?: (d: any, l: any, t: any) => any) => any;
4644
+ const upload: (url: any, file: any, success?: any, failure?: any, progress?: any) => any;
4645
4645
  export { upload };
4646
4646
  }
4647
4647
  declare module "fn" {
@@ -4793,7 +4793,7 @@ declare module "fn" {
4793
4793
  isEmail: (...args: any[]) => boolean;
4794
4794
  isEmpty: (obj: any) => boolean;
4795
4795
  isEvent: (...args: any[]) => boolean;
4796
- isFocused: (ele: HTMLElement, contain?: boolean) => boolean;
4796
+ isFocused: (ele: any, contain?: boolean) => boolean;
4797
4797
  isFunction: (...args: any[]) => boolean;
4798
4798
  isHostname: (...args: any[]) => boolean;
4799
4799
  isInside: (ele: any, ancestor: any) => boolean;
@@ -4838,7 +4838,7 @@ declare module "fn" {
4838
4838
  percent: (percent: any, cent: any) => number;
4839
4839
  pickValue: (arr: any[]) => any;
4840
4840
  post: (...args: any[]) => any;
4841
- postOut: (url: string, data: BbnBasicObject, success?: () => any, target?: string) => void;
4841
+ postOut: (url: any, data: any, success?: any, target?: string) => void;
4842
4842
  printf: (format: any) => any;
4843
4843
  quotes2html: (st: string, type?: string) => string;
4844
4844
  randomInt: (min: number, max: number) => number;
@@ -4858,11 +4858,11 @@ declare module "fn" {
4858
4858
  roundDecimal: (value: number, decimals: number) => number;
4859
4859
  sanitize: (str: any, separator?: string) => any;
4860
4860
  search: (arr: any[], prop: string | object | import("fn/object/filterToConditions").Filter | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: string | number, startFrom?: number) => number;
4861
- selectElementText: (ele: HTMLElement, win?: Window) => void;
4861
+ selectElementText: (ele: any, win?: any) => void;
4862
4862
  selector: (ele: string | HTMLElement) => HTMLElement;
4863
4863
  setCookie: (name: any, value: any, days: any) => void;
4864
4864
  setCssVar: (varname: any, value: any) => void;
4865
- setNavigationVars: (url: any, title: any, data?: object, repl?: boolean) => void;
4865
+ setNavigationVars: (url: any, title: any, data?: any, repl?: boolean) => void;
4866
4866
  setProp: (obj: object, prop: string, value: any, writable?: boolean, configurable?: boolean) => void;
4867
4867
  setProperty: (obj: object, prop: string, value: any, force?: boolean) => void;
4868
4868
  shorten: (st: string, len?: number, adj?: string) => string;
@@ -4878,15 +4878,15 @@ declare module "fn" {
4878
4878
  substr: (str: string, from: number, length?: number) => string;
4879
4879
  sum: (arr: object[], numberProp: string | ((a: any) => any), prop: string | object, val?: any, operator?: string) => number;
4880
4880
  timestamp: (seconds?: boolean) => number;
4881
- toCSV: (arr: any[], valSep?: string, rowSep?: string, valEsc?: string) => string;
4881
+ toCSV: (arr: any, valSep?: string, rowSep?: string, valEsc?: string) => string;
4882
4882
  toggleFullScreen: () => void;
4883
4883
  translate: (o: object, namespace?: string) => void;
4884
- treatAjaxArguments: (args: any) => BbnAjaxCfg;
4884
+ treatAjaxArguments: (args: any) => any;
4885
4885
  trim: (str: any, hair?: string) => any;
4886
4886
  uniqString: (...args: any[]) => string;
4887
4887
  unique: (arr: any[]) => any[];
4888
- upload: (url: string, file: any, success?: (d: any) => any, failure?: (d: any) => any, progress?: (d: any, l: any, t: any) => any) => any;
4889
- warning: (message: string) => void;
4888
+ upload: (url: any, file: any, success?: any, failure?: any, progress?: any) => any;
4889
+ warning: (message: any) => void;
4890
4890
  };
4891
4891
  export { fn };
4892
4892
  }
package/dist/bundle.js CHANGED
@@ -6420,7 +6420,7 @@
6420
6420
  * @global
6421
6421
  * @memberof bbn.fn
6422
6422
  * @param {HTMLElement} img
6423
- * @returns
6423
+ * @returns {HTMLCanvasElement}
6424
6424
  */
6425
6425
  const imageToCanvas = function (img) {
6426
6426
  let canvas = document.createElement('canvas');
@@ -6437,7 +6437,6 @@
6437
6437
  exports.imgToBase64 = void 0;
6438
6438
  const imgToBase64 = function (img, type = 'image/png') {
6439
6439
  let canvas = (0, imageToCanvas_1.imageToCanvas)(img);
6440
- //return canvasToImage(canvas);
6441
6440
  return canvas.toDataURL(type);
6442
6441
  };
6443
6442
  exports.imgToBase64 = imgToBase64;
@@ -6532,62 +6531,63 @@
6532
6531
  t = t.toLowerCase();
6533
6532
  /* Callbacks */
6534
6533
  if ((0, isFunction_8.isFunction)(args[i])) {
6535
- if (cfg.errorFn && !cfg.abortFn) {
6536
- cfg.abortFn = args[i];
6534
+ if (cfg["errorFn"] && !cfg["abortFn"]) {
6535
+ cfg["abortFn"] = args[i];
6537
6536
  }
6538
- if (cfg.successFn && !cfg.errorFn) {
6539
- cfg.errorFn = args[i];
6537
+ if (cfg["successFn"] && !cfg["errorFn"]) {
6538
+ cfg["errorFn"] = args[i];
6540
6539
  }
6541
- else if (!cfg.successFn) {
6542
- cfg.successFn = args[i];
6540
+ else if (!cfg["successFn"]) {
6541
+ cfg["successFn"] = args[i];
6543
6542
  }
6544
6543
  }
6545
6544
  else if (args[i] === 1 || args[i] === true) {
6546
6545
  /* Force */
6547
- cfg.force = true;
6546
+ cfg["force"] = true;
6548
6547
  }
6549
- else if (t === 'string') {
6550
- if (!cfg.url) {
6548
+ else if (t === "string") {
6549
+ if (!cfg["url"]) {
6551
6550
  /* Hash */
6552
- if (args[i].indexOf('#') === 0 || args[i].indexOf(bbn.env.root + '#') === 0) {
6553
- cfg.url = (0, substr_9.substr)(args[i], bbn.env.root.length);
6551
+ if (args[i].indexOf("#") === 0 ||
6552
+ args[i].indexOf(bbn.env.root + "#") === 0) {
6553
+ cfg["url"] = (0, substr_9.substr)(args[i], bbn.env.root.length);
6554
6554
  }
6555
6555
  else {
6556
6556
  /* Link */
6557
- cfg.url = args[i];
6558
- if (cfg.url.indexOf(bbn.env.root) === 0) {
6559
- cfg.url = (0, substr_9.substr)(cfg.url, bbn.env.root.length);
6557
+ cfg["url"] = args[i];
6558
+ if (cfg["url"].indexOf(bbn.env.root) === 0) {
6559
+ cfg["url"] = (0, substr_9.substr)(cfg["url"], bbn.env.root.length);
6560
6560
  }
6561
6561
  }
6562
6562
  }
6563
6563
  else {
6564
6564
  /* Ajax datatype */
6565
- cfg.datatype = args[i];
6565
+ cfg["datatype"] = args[i];
6566
6566
  }
6567
6567
  }
6568
- else if (args[i] && t === 'object') {
6568
+ else if (args[i] && t === "object") {
6569
6569
  /* Event */
6570
6570
  if (args[i] instanceof Event) {
6571
- cfg.e = args[i];
6571
+ cfg["e"] = args[i];
6572
6572
  }
6573
- else if (!cfg.ele && args[i].nodeType === 1) {
6573
+ else if (!cfg["ele"] && args[i].nodeType === 1) {
6574
6574
  /* HTML Element */
6575
- cfg.ele = args[i];
6575
+ cfg["ele"] = args[i];
6576
6576
  }
6577
- else if (t.toLowerCase() === 'object') {
6577
+ else if (t.toLowerCase() === "object") {
6578
6578
  /* An object to post */
6579
- cfg.obj = args[i];
6579
+ cfg["obj"] = args[i];
6580
6580
  }
6581
6581
  }
6582
6582
  }
6583
- if (!cfg.url && (0, numProperties_6.numProperties)(cfg)) {
6584
- cfg.url = bbn.env.path;
6583
+ if (!cfg["url"] && (0, numProperties_6.numProperties)(cfg)) {
6584
+ cfg["url"] = bbn.env.path;
6585
6585
  }
6586
- if (cfg.obj === undefined) {
6587
- cfg.obj = { _bbn: 'public' };
6586
+ if (cfg["obj"] === undefined) {
6587
+ cfg["obj"] = { _bbn: "public" };
6588
6588
  }
6589
- if (!cfg.datatype) {
6590
- cfg.datatype = 'json';
6589
+ if (!cfg["datatype"]) {
6590
+ cfg["datatype"] = "json";
6591
6591
  }
6592
6592
  return cfg;
6593
6593
  };
@@ -6618,9 +6618,9 @@
6618
6618
  * @param {Object} data The data if any
6619
6619
  * @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
6620
6620
  *
6621
- * @returns {undefined}
6621
+ * @returns {void}
6622
6622
  */
6623
- const setNavigationVars = function (url, title, data, repl) {
6623
+ const setNavigationVars = function (url, title, data = null, repl = false) {
6624
6624
  // Current path becomes old path
6625
6625
  bbn.env.old_path = bbn.env.path;
6626
6626
  // URL includes the domain
@@ -7459,7 +7459,7 @@
7459
7459
  *
7460
7460
  * @returns {Boolean} True if focused
7461
7461
  */
7462
- const isFocused = function (ele, contain) {
7462
+ const isFocused = function (ele, contain = false) {
7463
7463
  return ele === document.activeElement || (contain && ele.contains && ele.contains(document.activeElement));
7464
7464
  };
7465
7465
  exports.isFocused = isFocused;
@@ -8595,7 +8595,61 @@
8595
8595
  };
8596
8596
  exports.pickValue = pickValue;
8597
8597
  });
8598
- define("fn/ajax/postOut", ["require", "exports", "fn/object/createObject", "fn/form/addInputs"], function (require, exports, createObject_3, addInputs_1) {
8598
+ define("fn/object/setProperty", ["require", "exports", "fn/loop/each"], function (require, exports, each_22) {
8599
+ "use strict";
8600
+ Object.defineProperty(exports, "__esModule", { value: true });
8601
+ exports.setProperty = void 0;
8602
+ /**
8603
+ * Returns the value of the given property from the given object.
8604
+ *
8605
+ * Looks for the given property in the given object, accepting dot (.) separator
8606
+ * for deep property access, and returns its value if found and undefined otherwise.
8607
+ *
8608
+ * @method getProperty
8609
+ * @global
8610
+ * @example
8611
+ * ```javascript
8612
+ * bbn.fn.getProperty({a: 1, b: 2}, 'b');
8613
+ * // 2
8614
+ * ```
8615
+ * @example
8616
+ * ```javascript
8617
+ * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.o.a');
8618
+ * // 33
8619
+ * ```
8620
+ * @example
8621
+ * ```javascript
8622
+ * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.h.a');
8623
+ * // undefined
8624
+ * ```
8625
+ * @memberof bbn.fn
8626
+ * @param {Object} obj
8627
+ * @param {String} prop
8628
+ * @returns {*} The property's value or undefined
8629
+ */
8630
+ const setProperty = function (obj, prop, value, force) {
8631
+ if (typeof obj === 'object' && typeof prop === 'string') {
8632
+ let o = obj;
8633
+ const bits = prop.split('.');
8634
+ (0, each_22.each)(bits, (v, i) => {
8635
+ if (!o) {
8636
+ if (!force) {
8637
+ throw new Error(bbn._('The object is invalid'));
8638
+ }
8639
+ o = {};
8640
+ }
8641
+ if (bits.length - 1 === i) {
8642
+ o[v] = value;
8643
+ }
8644
+ else {
8645
+ o = o[v];
8646
+ }
8647
+ });
8648
+ }
8649
+ };
8650
+ exports.setProperty = setProperty;
8651
+ });
8652
+ define("fn/ajax/postOut", ["require", "exports", "fn/object/createObject", "fn/form/addInputs", "fn/object/setProperty"], function (require, exports, createObject_3, addInputs_1, setProperty_1) {
8599
8653
  "use strict";
8600
8654
  Object.defineProperty(exports, "__esModule", { value: true });
8601
8655
  exports.postOut = void 0;
@@ -8616,33 +8670,35 @@
8616
8670
  * @param {Function} success A function to execute in case of success
8617
8671
  * @param {String} target The target attribute of the form
8618
8672
  *
8619
- * @returns {undefined}
8673
+ * @returns {void}
8620
8674
  */
8621
- const postOut = function (url, data, success, target) {
8622
- let form = document.body.querySelector('form#bbn-form_out');
8675
+ const postOut = function (url, data, success = null, target = "") {
8676
+ let form = document.body.querySelector("form#bbn-form_out");
8623
8677
  if (!form) {
8624
- form = document.createElement('form');
8625
- form.classList.add('bbn-no');
8626
- form.setAttribute('id', 'bbn-form_out');
8627
- form.setAttribute('method', 'post');
8628
- form.setAttribute('enctype', 'multipart/form-data-encoded');
8629
- form.style.display = 'none';
8678
+ form = document.createElement("form");
8679
+ form.classList.add("bbn-no");
8680
+ form.setAttribute("id", "bbn-form_out");
8681
+ form.setAttribute("method", "post");
8682
+ form.setAttribute("enctype", "multipart/form-data-encoded");
8683
+ (0, setProperty_1.setProperty)(form, "style.display", "none");
8630
8684
  document.body.appendChild(form);
8631
8685
  }
8632
- form.innerHTML = '';
8633
- form.setAttribute('action', url);
8634
- form.setAttribute('target', target || '_blank');
8635
- if (!data) {
8636
- data = {};
8637
- }
8638
- data = (0, createObject_3.createObject)(data);
8639
- if (!data.bbn) {
8640
- data.bbn = 'public';
8641
- }
8642
- (0, addInputs_1.addInputs)(form, data);
8643
- form.submit();
8644
- if (success) {
8645
- success();
8686
+ if (form instanceof HTMLFormElement) {
8687
+ form.innerHTML = "";
8688
+ form.setAttribute("action", url);
8689
+ form.setAttribute("target", target || "_blank");
8690
+ if (!data) {
8691
+ data = {};
8692
+ }
8693
+ data = (0, createObject_3.createObject)(data);
8694
+ if (!data.bbn) {
8695
+ data.bbn = "public";
8696
+ }
8697
+ (0, addInputs_1.addInputs)(form, data);
8698
+ form.submit();
8699
+ if (success) {
8700
+ success();
8701
+ }
8646
8702
  }
8647
8703
  };
8648
8704
  exports.postOut = postOut;
@@ -9140,7 +9196,7 @@
9140
9196
  *
9141
9197
  * @returns {Boolean} True if focused
9142
9198
  */
9143
- const selectElementText = function (ele, win) {
9199
+ const selectElementText = function (ele, win = null) {
9144
9200
  win = win || window;
9145
9201
  if (ele instanceof HTMLInputElement) {
9146
9202
  ele.select();
@@ -9235,60 +9291,6 @@
9235
9291
  };
9236
9292
  exports.setProp = setProp;
9237
9293
  });
9238
- define("fn/object/setProperty", ["require", "exports", "fn/loop/each"], function (require, exports, each_22) {
9239
- "use strict";
9240
- Object.defineProperty(exports, "__esModule", { value: true });
9241
- exports.setProperty = void 0;
9242
- /**
9243
- * Returns the value of the given property from the given object.
9244
- *
9245
- * Looks for the given property in the given object, accepting dot (.) separator
9246
- * for deep property access, and returns its value if found and undefined otherwise.
9247
- *
9248
- * @method getProperty
9249
- * @global
9250
- * @example
9251
- * ```javascript
9252
- * bbn.fn.getProperty({a: 1, b: 2}, 'b');
9253
- * // 2
9254
- * ```
9255
- * @example
9256
- * ```javascript
9257
- * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.o.a');
9258
- * // 33
9259
- * ```
9260
- * @example
9261
- * ```javascript
9262
- * bbn.fn.getProperty({a: 1, b: {o: {a: 33, h: 5}}}, 'b.h.a');
9263
- * // undefined
9264
- * ```
9265
- * @memberof bbn.fn
9266
- * @param {Object} obj
9267
- * @param {String} prop
9268
- * @returns {*} The property's value or undefined
9269
- */
9270
- const setProperty = function (obj, prop, value, force) {
9271
- if (typeof obj === 'object' && typeof prop === 'string') {
9272
- let o = obj;
9273
- const bits = prop.split('.');
9274
- (0, each_22.each)(bits, (v, i) => {
9275
- if (!o) {
9276
- if (!force) {
9277
- throw new Error(bbn._('The object is invalid'));
9278
- }
9279
- o = {};
9280
- }
9281
- if (bits.length - 1 === i) {
9282
- o[v] = value;
9283
- }
9284
- else {
9285
- o = o[v];
9286
- }
9287
- });
9288
- }
9289
- };
9290
- exports.setProperty = setProperty;
9291
- });
9292
9294
  define("fn/string/shorten", ["require", "exports", "fn/type/isString", "fn/string/substr"], function (require, exports, isString_25, substr_15) {
9293
9295
  "use strict";
9294
9296
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -9732,7 +9734,7 @@
9732
9734
  *
9733
9735
  * @returns {Promise}
9734
9736
  */
9735
- const upload = function (url, file, success, failure, progress) {
9737
+ const upload = function (url, file, success = null, failure = null, progress = null) {
9736
9738
  let fn = () => {
9737
9739
  return axios.post(url || bbn.env.path, (0, objectToFormData_1.objectToFormData)(file), {
9738
9740
  headers: {
@@ -9767,7 +9769,7 @@
9767
9769
  };
9768
9770
  exports.upload = upload;
9769
9771
  });
9770
- define("fn", ["require", "exports", "fn/ajax/_addLoader", "fn/object/_compareValues", "fn/ajax/_deleteLoader", "fn/ajax/abort", "fn/ajax/abortURL", "fn/style/addColors", "fn/form/addInputs", "fn/style/addStyle", "fn/html/adjustHeight", "fn/html/adjustSize", "fn/html/adjustWidth", "fn/ajax/ajax", "fn/misc/analyzeFunction", "fn/style/animateCss", "fn/convert/arrayBuffer2String", "fn/object/arrayFromProp", "fn/object/autoExtend", "fn/string/baseName", "fn/string/br2nl", "fn/datetime/calendar", "fn/ajax/callback", "fn/string/camelize", "fn/string/camelToCss", "fn/convert/canvasToImage", "fn/style/center", "fn/object/checkProps", "fn/object/checkPropsDetails", "fn/object/checkPropsOrDie", "fn/type/checkType", "fn/object/circularReplacer", "fn/object/clone", "fn/convert/colorToHex", "fn/object/compare", "fn/object/compareConditions", "fn/browser/copy", "fn/string/correctCase", "fn/object/count", "fn/string/crc32", "fn/object/createObject", "fn/style/cssExists", "fn/datetime/date", "fn/datetime/dateSQL", "fn/datetime/daysInMonth", "fn/object/deepPath", "fn/default/defaultAjaxAbortFunction", "fn/default/defaultAjaxErrorFunction", "fn/default/defaultAlertFunction", "fn/default/defaultConfirmFunction", "fn/default/defaultEndLoadingFunction", "fn/default/defaultErrorFunction", "fn/default/defaultHistoryFunction", "fn/default/defaultLinkFunction", "fn/default/defaultPostLinkFunction", "fn/default/defaultPreLinkFunction", "fn/default/defaultResizeFunction", "fn/default/defaultStartLoadingFunction", "fn/object/deleteProp", "fn/object/diffObj", "fn/string/dirName", "fn/ajax/download", "fn/ajax/downloadContent", "fn/loop/each", "fn/browser/eraseCookie", "fn/browser/error", "fn/string/escapeDquotes", "fn/string/escapeRegExp", "fn/string/escapeSquotes", "fn/string/escapeTicks", "fn/string/escapeUrl", "fn/object/extend", "fn/object/extendOut", "fn/datetime/fdate", "fn/datetime/fdatetime", "fn/form/fieldValue", "fn/string/fileExt", "fn/object/filter", "fn/object/filterToConditions", "fn/object/findAll", "fn/loop/fori", "fn/loop/forir", "fn/string/format", "fn/string/formatBytes", "fn/datetime/formatDate", "fn/string/formatSize", "fn/form/formdata", "fn/convert/fromXml", "fn/datetime/ftime", "fn/html/getAllTags", "fn/html/getAncestors", "fn/html/getAttributes", "fn/browser/getBrowserName", "fn/browser/getBrowserVersion", "fn/browser/getCookie", "fn/style/getCssVar", "fn/datetime/getDay", "fn/browser/getDeviceType", "fn/browser/getEventData", "fn/object/getField", "fn/object/getFieldValues", "fn/html/getHtml", "fn/html/getHTMLOfSelection", "fn/ajax/getLoader", "fn/html/getPath", "fn/object/getProp", "fn/object/getProperty", "fn/ajax/getRequestId", "fn/object/getRow", "fn/style/getScrollBarSize", "fn/html/getText", "fn/misc/getTimeoff", "fn/browser/happy", "fn/string/hash", "fn/convert/hex2rgb", "fn/browser/history", "fn/html/html2text", "fn/convert/imageToCanvas", "fn/convert/imgToBase64", "fn/browser/info", "fn/init", "fn/browser/isActiveInterface", "fn/type/isArray", "fn/type/isBlob", "fn/type/isBoolean", "fn/type/isCanvas", "fn/type/isColor", "fn/type/isComment", "fn/type/isCp", "fn/type/isDate", "fn/browser/isDesktopDevice", "fn/type/isDimension", "fn/type/isDom", "fn/type/isEmail", "fn/type/isEmpty", "fn/type/isEvent", "fn/browser/isFocused", "fn/type/isFunction", "fn/type/isHostname", "fn/html/isInside", "fn/type/isInt", "fn/type/isIP", "fn/type/isIterable", "fn/browser/isMobile", "fn/browser/isMobileDevice", "fn/type/isNull", "fn/type/isNumber", "fn/type/isObject", "fn/type/isPercent", "fn/type/isPrimitive", "fn/type/isPromise", "fn/type/isPropSize", "fn/type/isSame", "fn/type/isSQLDate", "fn/type/isString", "fn/type/isSymbol", "fn/browser/isTabletDevice", "fn/type/isURL", "fn/type/isValidDimension", "fn/type/isValidName", "fn/type/isValue", "fn/type/isVue", "fn/loop/iterate", "fn/style/lightenDarkenHex", "fn/ajax/link", "fn/browser/log", "fn/html/makeReactive", "fn/object/map", "fn/string/md5", "fn/misc/money", "fn/object/move", "fn/object/multiorder", "fn/string/nl2br", "fn/object/numProperties", "fn/form/objectToFormData", "fn/object/order", "fn/style/outerHeight", "fn/style/outerWidth", "fn/misc/percent", "fn/object/pickValue", "fn/ajax/post", "fn/ajax/postOut", "fn/string/printf", "fn/string/quotes2html", "fn/misc/randomInt", "fn/string/randomString", "fn/string/removeAccents", "fn/object/removeEmpty", "fn/string/removeExtraSpaces", "fn/string/removeHtmlComments", "fn/object/removePrivateProp", "fn/string/removeTrailingChars", "fn/string/repeat", "fn/string/replaceAll", "fn/browser/replaceSelection", "fn/style/resize", "fn/convert/rgb2hex", "fn/loop/riterate", "fn/misc/roundDecimal", "fn/string/sanitize", "fn/object/search", "fn/browser/selectElementText", "fn/html/selector", "fn/browser/setCookie", "fn/style/setCssVar", "fn/ajax/setNavigationVars", "fn/object/setProp", "fn/object/setProperty", "fn/string/shorten", "fn/object/shortenObj", "fn/object/shuffle", "fn/string/simpleHash", "fn/string/simpleHash1", "fn/string/simpleHash2", "fn/datetime/chrono", "fn/convert/string2ArrayBuffer", "fn/form/submit", "fn/string/substr", "fn/object/sum", "fn/datetime/timestamp", "fn/convert/toCSV", "fn/browser/toggleFullScreen", "fn/misc/translate", "fn/ajax/treatAjaxArguments", "fn/string/trim", "fn/string/uniqString", "fn/object/unique", "fn/ajax/upload", "fn/browser/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_6, circularReplacer_2, clone_2, colorToHex_1, compare_2, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_1, defaultAjaxErrorFunction_1, defaultAlertFunction_1, defaultConfirmFunction_1, defaultEndLoadingFunction_1, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_1, defaultPostLinkFunction_1, defaultPreLinkFunction_1, defaultResizeFunction_2, defaultStartLoadingFunction_1, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_28, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_8, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_4, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1, isFunction_11, isHostname_1, isInside_1, isInt_2, isIP_2, isIterable_5, isMobile_2, isMobileDevice_2, isNull_4, isNumber_10, isObject_18, isPercent_1, isPrimitive_1, isPromise_1, isPropSize_1, isSame_3, isSQLDate_1, isString_27, isSymbol_2, isTabletDevice_3, isURL_1, isValidDimension_2, isValidName_1, isValue_2, isVue_1, iterate_12, lightenDarkenHex_1, link_2, log_22, makeReactive_1, map_1, md5_4, money_1, move_1, multiorder_1, nl2br_1, numProperties_8, objectToFormData_2, order_1, outerHeight_1, outerWidth_1, percent_1, pickValue_1, post_2, postOut_1, printf_1, quotes2html_1, randomInt_2, randomString_1, removeAccents_4, removeEmpty_1, removeExtraSpaces_1, removeHtmlComments_2, removePrivateProp_2, removeTrailingChars_1, repeat_1, replaceAll_8, replaceSelection_1, resize_3, rgb2hex_1, riterate_1, roundDecimal_1, sanitize_1, search_6, selectElementText_1, selector_3, setCookie_1, setCssVar_1, setNavigationVars_2, setProp_1, setProperty_1, shorten_2, shortenObj_1, shuffle_1, simpleHash_2, simpleHash1_2, simpleHash2_2, chrono_1, string2ArrayBuffer_1, submit_2, substr_16, sum_1, timestamp_1, toCSV_1, toggleFullScreen_1, translate_1, treatAjaxArguments_3, trim_2, uniqString_1, unique_2, upload_1, warning_2) {
9772
+ define("fn", ["require", "exports", "fn/ajax/_addLoader", "fn/object/_compareValues", "fn/ajax/_deleteLoader", "fn/ajax/abort", "fn/ajax/abortURL", "fn/style/addColors", "fn/form/addInputs", "fn/style/addStyle", "fn/html/adjustHeight", "fn/html/adjustSize", "fn/html/adjustWidth", "fn/ajax/ajax", "fn/misc/analyzeFunction", "fn/style/animateCss", "fn/convert/arrayBuffer2String", "fn/object/arrayFromProp", "fn/object/autoExtend", "fn/string/baseName", "fn/string/br2nl", "fn/datetime/calendar", "fn/ajax/callback", "fn/string/camelize", "fn/string/camelToCss", "fn/convert/canvasToImage", "fn/style/center", "fn/object/checkProps", "fn/object/checkPropsDetails", "fn/object/checkPropsOrDie", "fn/type/checkType", "fn/object/circularReplacer", "fn/object/clone", "fn/convert/colorToHex", "fn/object/compare", "fn/object/compareConditions", "fn/browser/copy", "fn/string/correctCase", "fn/object/count", "fn/string/crc32", "fn/object/createObject", "fn/style/cssExists", "fn/datetime/date", "fn/datetime/dateSQL", "fn/datetime/daysInMonth", "fn/object/deepPath", "fn/default/defaultAjaxAbortFunction", "fn/default/defaultAjaxErrorFunction", "fn/default/defaultAlertFunction", "fn/default/defaultConfirmFunction", "fn/default/defaultEndLoadingFunction", "fn/default/defaultErrorFunction", "fn/default/defaultHistoryFunction", "fn/default/defaultLinkFunction", "fn/default/defaultPostLinkFunction", "fn/default/defaultPreLinkFunction", "fn/default/defaultResizeFunction", "fn/default/defaultStartLoadingFunction", "fn/object/deleteProp", "fn/object/diffObj", "fn/string/dirName", "fn/ajax/download", "fn/ajax/downloadContent", "fn/loop/each", "fn/browser/eraseCookie", "fn/browser/error", "fn/string/escapeDquotes", "fn/string/escapeRegExp", "fn/string/escapeSquotes", "fn/string/escapeTicks", "fn/string/escapeUrl", "fn/object/extend", "fn/object/extendOut", "fn/datetime/fdate", "fn/datetime/fdatetime", "fn/form/fieldValue", "fn/string/fileExt", "fn/object/filter", "fn/object/filterToConditions", "fn/object/findAll", "fn/loop/fori", "fn/loop/forir", "fn/string/format", "fn/string/formatBytes", "fn/datetime/formatDate", "fn/string/formatSize", "fn/form/formdata", "fn/convert/fromXml", "fn/datetime/ftime", "fn/html/getAllTags", "fn/html/getAncestors", "fn/html/getAttributes", "fn/browser/getBrowserName", "fn/browser/getBrowserVersion", "fn/browser/getCookie", "fn/style/getCssVar", "fn/datetime/getDay", "fn/browser/getDeviceType", "fn/browser/getEventData", "fn/object/getField", "fn/object/getFieldValues", "fn/html/getHtml", "fn/html/getHTMLOfSelection", "fn/ajax/getLoader", "fn/html/getPath", "fn/object/getProp", "fn/object/getProperty", "fn/ajax/getRequestId", "fn/object/getRow", "fn/style/getScrollBarSize", "fn/html/getText", "fn/misc/getTimeoff", "fn/browser/happy", "fn/string/hash", "fn/convert/hex2rgb", "fn/browser/history", "fn/html/html2text", "fn/convert/imageToCanvas", "fn/convert/imgToBase64", "fn/browser/info", "fn/init", "fn/browser/isActiveInterface", "fn/type/isArray", "fn/type/isBlob", "fn/type/isBoolean", "fn/type/isCanvas", "fn/type/isColor", "fn/type/isComment", "fn/type/isCp", "fn/type/isDate", "fn/browser/isDesktopDevice", "fn/type/isDimension", "fn/type/isDom", "fn/type/isEmail", "fn/type/isEmpty", "fn/type/isEvent", "fn/browser/isFocused", "fn/type/isFunction", "fn/type/isHostname", "fn/html/isInside", "fn/type/isInt", "fn/type/isIP", "fn/type/isIterable", "fn/browser/isMobile", "fn/browser/isMobileDevice", "fn/type/isNull", "fn/type/isNumber", "fn/type/isObject", "fn/type/isPercent", "fn/type/isPrimitive", "fn/type/isPromise", "fn/type/isPropSize", "fn/type/isSame", "fn/type/isSQLDate", "fn/type/isString", "fn/type/isSymbol", "fn/browser/isTabletDevice", "fn/type/isURL", "fn/type/isValidDimension", "fn/type/isValidName", "fn/type/isValue", "fn/type/isVue", "fn/loop/iterate", "fn/style/lightenDarkenHex", "fn/ajax/link", "fn/browser/log", "fn/html/makeReactive", "fn/object/map", "fn/string/md5", "fn/misc/money", "fn/object/move", "fn/object/multiorder", "fn/string/nl2br", "fn/object/numProperties", "fn/form/objectToFormData", "fn/object/order", "fn/style/outerHeight", "fn/style/outerWidth", "fn/misc/percent", "fn/object/pickValue", "fn/ajax/post", "fn/ajax/postOut", "fn/string/printf", "fn/string/quotes2html", "fn/misc/randomInt", "fn/string/randomString", "fn/string/removeAccents", "fn/object/removeEmpty", "fn/string/removeExtraSpaces", "fn/string/removeHtmlComments", "fn/object/removePrivateProp", "fn/string/removeTrailingChars", "fn/string/repeat", "fn/string/replaceAll", "fn/browser/replaceSelection", "fn/style/resize", "fn/convert/rgb2hex", "fn/loop/riterate", "fn/misc/roundDecimal", "fn/string/sanitize", "fn/object/search", "fn/browser/selectElementText", "fn/html/selector", "fn/browser/setCookie", "fn/style/setCssVar", "fn/ajax/setNavigationVars", "fn/object/setProp", "fn/object/setProperty", "fn/string/shorten", "fn/object/shortenObj", "fn/object/shuffle", "fn/string/simpleHash", "fn/string/simpleHash1", "fn/string/simpleHash2", "fn/datetime/chrono", "fn/convert/string2ArrayBuffer", "fn/form/submit", "fn/string/substr", "fn/object/sum", "fn/datetime/timestamp", "fn/convert/toCSV", "fn/browser/toggleFullScreen", "fn/misc/translate", "fn/ajax/treatAjaxArguments", "fn/string/trim", "fn/string/uniqString", "fn/object/unique", "fn/ajax/upload", "fn/browser/warning"], function (require, exports, _addLoader_2, _compareValues_3, _deleteLoader_2, abort_1, abortURL_1, addColors_2, addInputs_2, addStyle_1, adjustHeight_1, adjustSize_3, adjustWidth_1, ajax_4, analyzeFunction_1, animateCss_1, arrayBuffer2String_1, arrayFromProp_1, autoExtend_1, baseName_3, br2nl_1, calendar_1, callback_3, camelize_1, camelToCss_1, canvasToImage_1, center_1, checkProps_1, checkPropsDetails_3, checkPropsOrDie_1, checkType_6, circularReplacer_2, clone_2, colorToHex_1, compare_2, compareConditions_3, copy_1, correctCase_2, count_1, crc32_1, createObject_4, cssExists_1, date_8, dateSQL_1, daysInMonth_1, deepPath_1, defaultAjaxAbortFunction_1, defaultAjaxErrorFunction_1, defaultAlertFunction_1, defaultConfirmFunction_1, defaultEndLoadingFunction_1, defaultErrorFunction_2, defaultHistoryFunction_2, defaultLinkFunction_1, defaultPostLinkFunction_1, defaultPreLinkFunction_1, defaultResizeFunction_2, defaultStartLoadingFunction_1, deleteProp_1, diffObj_1, dirName_2, download_1, downloadContent_2, each_28, eraseCookie_1, error_4, escapeDquotes_1, escapeRegExp_3, escapeSquotes_1, escapeTicks_1, escapeUrl_1, extend_8, extendOut_1, fdate_2, fdatetime_2, fieldValue_2, fileExt_2, filter_6, filterToConditions_3, findAll_1, fori_1, forir_1, format_1, formatBytes_1, formatDate_1, formatSize_1, formdata_2, fromXml_1, ftime_1, getAllTags_1, getAncestors_2, getAttributes_1, getBrowserName_1, getBrowserVersion_1, getCookie_1, getCssVar_2, getDay_1, getDeviceType_4, getEventData_1, getField_1, getFieldValues_1, getHtml_1, getHTMLOfSelection_2, getLoader_4, getPath_1, getProp_1, getProperty_4, getRequestId_2, getRow_3, getScrollBarSize_1, getText_1, getTimeoff_1, happy_1, hash_2, hex2rgb_1, history_1, html2text_2, imageToCanvas_2, imgToBase64_1, info_1, init_1, isActiveInterface_1, isArray_19, isBlob_2, isBoolean_1, isCanvas_2, isColor_1, isComment_1, isCp_3, isDate_8, isDesktopDevice_1, isDimension_1, isDom_5, isEmail_1, isEmpty_2, isEvent_1, isFocused_1, isFunction_11, isHostname_1, isInside_1, isInt_2, isIP_2, isIterable_5, isMobile_2, isMobileDevice_2, isNull_4, isNumber_10, isObject_18, isPercent_1, isPrimitive_1, isPromise_1, isPropSize_1, isSame_3, isSQLDate_1, isString_27, isSymbol_2, isTabletDevice_3, isURL_1, isValidDimension_2, isValidName_1, isValue_2, isVue_1, iterate_12, lightenDarkenHex_1, link_2, log_22, makeReactive_1, map_1, md5_4, money_1, move_1, multiorder_1, nl2br_1, numProperties_8, objectToFormData_2, order_1, outerHeight_1, outerWidth_1, percent_1, pickValue_1, post_2, postOut_1, printf_1, quotes2html_1, randomInt_2, randomString_1, removeAccents_4, removeEmpty_1, removeExtraSpaces_1, removeHtmlComments_2, removePrivateProp_2, removeTrailingChars_1, repeat_1, replaceAll_8, replaceSelection_1, resize_3, rgb2hex_1, riterate_1, roundDecimal_1, sanitize_1, search_6, selectElementText_1, selector_3, setCookie_1, setCssVar_1, setNavigationVars_2, setProp_1, setProperty_2, shorten_2, shortenObj_1, shuffle_1, simpleHash_2, simpleHash1_2, simpleHash2_2, chrono_1, string2ArrayBuffer_1, submit_2, substr_16, sum_1, timestamp_1, toCSV_1, toggleFullScreen_1, translate_1, treatAjaxArguments_3, trim_2, uniqString_1, unique_2, upload_1, warning_2) {
9771
9773
  "use strict";
9772
9774
  Object.defineProperty(exports, "__esModule", { value: true });
9773
9775
  exports.fn = void 0;
@@ -9977,7 +9979,7 @@
9977
9979
  setCssVar: setCssVar_1.setCssVar,
9978
9980
  setNavigationVars: setNavigationVars_2.setNavigationVars,
9979
9981
  setProp: setProp_1.setProp,
9980
- setProperty: setProperty_1.setProperty,
9982
+ setProperty: setProperty_2.setProperty,
9981
9983
  shorten: shorten_2.shorten,
9982
9984
  shortenObj: shortenObj_1.shortenObj,
9983
9985
  shuffle: shuffle_1.shuffle,
@@ -15,7 +15,7 @@
15
15
  * @param {Function} success A function to execute in case of success
16
16
  * @param {String} target The target attribute of the form
17
17
  *
18
- * @returns {undefined}
18
+ * @returns {void}
19
19
  */
20
- declare const postOut: (url: string, data: BbnBasicObject, success?: () => any, target?: string) => void;
20
+ declare const postOut: (url: any, data: any, success?: any, target?: string) => void;
21
21
  export { postOut };
@@ -1,5 +1,6 @@
1
- import { createObject } from '../object/createObject';
2
- import { addInputs } from '../form/addInputs';
1
+ import { createObject } from "../object/createObject";
2
+ import { addInputs } from "../form/addInputs";
3
+ import { setProperty } from "../object/setProperty";
3
4
  /**
4
5
  * Posts a request in a new window.
5
6
  *
@@ -17,33 +18,35 @@ import { addInputs } from '../form/addInputs';
17
18
  * @param {Function} success A function to execute in case of success
18
19
  * @param {String} target The target attribute of the form
19
20
  *
20
- * @returns {undefined}
21
+ * @returns {void}
21
22
  */
22
- const postOut = function (url, data, success, target) {
23
- let form = document.body.querySelector('form#bbn-form_out');
23
+ const postOut = function (url, data, success = null, target = "") {
24
+ let form = document.body.querySelector("form#bbn-form_out");
24
25
  if (!form) {
25
- form = document.createElement('form');
26
- form.classList.add('bbn-no');
27
- form.setAttribute('id', 'bbn-form_out');
28
- form.setAttribute('method', 'post');
29
- form.setAttribute('enctype', 'multipart/form-data-encoded');
30
- form.style.display = 'none';
26
+ form = document.createElement("form");
27
+ form.classList.add("bbn-no");
28
+ form.setAttribute("id", "bbn-form_out");
29
+ form.setAttribute("method", "post");
30
+ form.setAttribute("enctype", "multipart/form-data-encoded");
31
+ setProperty(form, "style.display", "none");
31
32
  document.body.appendChild(form);
32
33
  }
33
- form.innerHTML = '';
34
- form.setAttribute('action', url);
35
- form.setAttribute('target', target || '_blank');
36
- if (!data) {
37
- data = {};
38
- }
39
- data = createObject(data);
40
- if (!data.bbn) {
41
- data.bbn = 'public';
42
- }
43
- addInputs(form, data);
44
- form.submit();
45
- if (success) {
46
- success();
34
+ if (form instanceof HTMLFormElement) {
35
+ form.innerHTML = "";
36
+ form.setAttribute("action", url);
37
+ form.setAttribute("target", target || "_blank");
38
+ if (!data) {
39
+ data = {};
40
+ }
41
+ data = createObject(data);
42
+ if (!data.bbn) {
43
+ data.bbn = "public";
44
+ }
45
+ addInputs(form, data);
46
+ form.submit();
47
+ if (success) {
48
+ success();
49
+ }
47
50
  }
48
51
  };
49
52
  export { postOut };
@@ -19,7 +19,7 @@
19
19
  * @param {Object} data The data if any
20
20
  * @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
21
21
  *
22
- * @returns {undefined}
22
+ * @returns {void}
23
23
  */
24
- declare const setNavigationVars: (url: any, title: any, data?: object, repl?: boolean) => void;
24
+ declare const setNavigationVars: (url: any, title: any, data?: any, repl?: boolean) => void;
25
25
  export { setNavigationVars };
@@ -23,9 +23,9 @@ import { html2text } from '../html/html2text';
23
23
  * @param {Object} data The data if any
24
24
  * @param {Boolean} repl If true the history state object will replace the current one, will be added otherwise
25
25
  *
26
- * @returns {undefined}
26
+ * @returns {void}
27
27
  */
28
- const setNavigationVars = function (url, title, data, repl) {
28
+ const setNavigationVars = function (url, title, data = null, repl = false) {
29
29
  // Current path becomes old path
30
30
  bbn.env.old_path = bbn.env.path;
31
31
  // URL includes the domain
@@ -49,5 +49,5 @@
49
49
  *
50
50
  * @returns {Object} The configuration object
51
51
  */
52
- declare const treatAjaxArguments: (args: any) => BbnAjaxCfg;
52
+ declare const treatAjaxArguments: (args: any) => any;
53
53
  export { treatAjaxArguments };
@@ -1,7 +1,7 @@
1
- import { isObject } from '../type/isObject';
2
- import { isFunction } from '../type/isFunction';
3
- import { substr } from '../string/substr';
4
- import { numProperties } from '../object/numProperties';
1
+ import { isObject } from "../type/isObject";
2
+ import { isFunction } from "../type/isFunction";
3
+ import { substr } from "../string/substr";
4
+ import { numProperties } from "../object/numProperties";
5
5
  /**
6
6
  * Transforms unordered arguments into a configuratiuon object for Ajax shortcut functions.
7
7
  *
@@ -65,62 +65,63 @@ const treatAjaxArguments = function (args) {
65
65
  t = t.toLowerCase();
66
66
  /* Callbacks */
67
67
  if (isFunction(args[i])) {
68
- if (cfg.errorFn && !cfg.abortFn) {
69
- cfg.abortFn = args[i];
68
+ if (cfg["errorFn"] && !cfg["abortFn"]) {
69
+ cfg["abortFn"] = args[i];
70
70
  }
71
- if (cfg.successFn && !cfg.errorFn) {
72
- cfg.errorFn = args[i];
71
+ if (cfg["successFn"] && !cfg["errorFn"]) {
72
+ cfg["errorFn"] = args[i];
73
73
  }
74
- else if (!cfg.successFn) {
75
- cfg.successFn = args[i];
74
+ else if (!cfg["successFn"]) {
75
+ cfg["successFn"] = args[i];
76
76
  }
77
77
  }
78
78
  else if (args[i] === 1 || args[i] === true) {
79
79
  /* Force */
80
- cfg.force = true;
80
+ cfg["force"] = true;
81
81
  }
82
- else if (t === 'string') {
83
- if (!cfg.url) {
82
+ else if (t === "string") {
83
+ if (!cfg["url"]) {
84
84
  /* Hash */
85
- if (args[i].indexOf('#') === 0 || args[i].indexOf(bbn.env.root + '#') === 0) {
86
- cfg.url = substr(args[i], bbn.env.root.length);
85
+ if (args[i].indexOf("#") === 0 ||
86
+ args[i].indexOf(bbn.env.root + "#") === 0) {
87
+ cfg["url"] = substr(args[i], bbn.env.root.length);
87
88
  }
88
89
  else {
89
90
  /* Link */
90
- cfg.url = args[i];
91
- if (cfg.url.indexOf(bbn.env.root) === 0) {
92
- cfg.url = substr(cfg.url, bbn.env.root.length);
91
+ cfg["url"] = args[i];
92
+ if (cfg["url"].indexOf(bbn.env.root) === 0) {
93
+ cfg["url"] = substr(cfg["url"], bbn.env.root.length);
93
94
  }
94
95
  }
95
96
  }
96
97
  else {
97
98
  /* Ajax datatype */
98
- cfg.datatype = args[i];
99
+ cfg["datatype"] = args[i];
99
100
  }
100
101
  }
101
- else if (args[i] && t === 'object') {
102
+ else if (args[i] && t === "object") {
102
103
  /* Event */
103
104
  if (args[i] instanceof Event) {
104
- cfg.e = args[i];
105
+ cfg["e"] = args[i];
105
106
  }
106
- else if (!cfg.ele && args[i].nodeType === 1) {
107
+ else if (!cfg["ele"] && args[i].nodeType === 1) {
107
108
  /* HTML Element */
108
- cfg.ele = args[i];
109
+ cfg["ele"] = args[i];
109
110
  }
110
- else if (t.toLowerCase() === 'object') {
111
+ else if (t.toLowerCase() === "object") {
111
112
  /* An object to post */
112
- cfg.obj = args[i];
113
+ cfg["obj"] = args[i];
113
114
  }
114
115
  }
115
116
  }
116
- if (!cfg.url && numProperties(cfg)) {
117
- cfg.url = bbn.env.path;
117
+ if (!cfg["url"] && numProperties(cfg)) {
118
+ cfg["url"] = bbn.env.path;
118
119
  }
119
- if (cfg.obj === undefined) {
120
- cfg.obj = { _bbn: 'public' };
120
+ if (cfg["obj"] === undefined) {
121
+ cfg["obj"] = { _bbn: "public" };
121
122
  }
122
- if (!cfg.datatype) {
123
- cfg.datatype = 'json';
123
+ if (!cfg["datatype"]) {
124
+ cfg["datatype"] = "json";
124
125
  }
125
126
  return cfg;
126
127
  };
@@ -14,5 +14,5 @@
14
14
  *
15
15
  * @returns {Promise}
16
16
  */
17
- declare const upload: (url: string, file: any, success?: (d: any) => any, failure?: (d: any) => any, progress?: (d: any, l: any, t: any) => any) => any;
17
+ declare const upload: (url: any, file: any, success?: any, failure?: any, progress?: any) => any;
18
18
  export { upload };
@@ -16,7 +16,7 @@ import { log } from '../browser/log';
16
16
  *
17
17
  * @returns {Promise}
18
18
  */
19
- const upload = function (url, file, success, failure, progress) {
19
+ const upload = function (url, file, success = null, failure = null, progress = null) {
20
20
  let fn = () => {
21
21
  return axios.post(url || bbn.env.path, objectToFormData(file), {
22
22
  headers: {
@@ -17,5 +17,5 @@
17
17
  *
18
18
  * @returns {Boolean} True if focused
19
19
  */
20
- declare const isFocused: (ele: HTMLElement, contain?: boolean) => boolean;
20
+ declare const isFocused: (ele: any, contain?: boolean) => boolean;
21
21
  export { isFocused };
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * @returns {Boolean} True if focused
19
19
  */
20
- const isFocused = function (ele, contain) {
20
+ const isFocused = function (ele, contain = false) {
21
21
  return ele === document.activeElement || (contain && ele.contains && ele.contains(document.activeElement));
22
22
  };
23
23
  export { isFocused };
@@ -17,5 +17,5 @@
17
17
  *
18
18
  * @returns {Boolean} True if focused
19
19
  */
20
- declare const selectElementText: (ele: HTMLElement, win?: Window) => void;
20
+ declare const selectElementText: (ele: any, win?: any) => void;
21
21
  export { selectElementText };
@@ -17,7 +17,7 @@
17
17
  *
18
18
  * @returns {Boolean} True if focused
19
19
  */
20
- const selectElementText = function (ele, win) {
20
+ const selectElementText = function (ele, win = null) {
21
21
  win = win || window;
22
22
  if (ele instanceof HTMLInputElement) {
23
23
  ele.select();
@@ -10,5 +10,5 @@
10
10
  * @param {...any} args
11
11
  * @returns
12
12
  */
13
- declare const warning: (message: string) => void;
13
+ declare const warning: (message: any) => void;
14
14
  export { warning };
@@ -9,7 +9,7 @@
9
9
  * @global
10
10
  * @memberof bbn.fn
11
11
  * @param {HTMLElement} img
12
- * @returns
12
+ * @returns {HTMLCanvasElement}
13
13
  */
14
14
  declare const imageToCanvas: (img: any) => HTMLCanvasElement;
15
15
  export { imageToCanvas };
@@ -9,7 +9,7 @@
9
9
  * @global
10
10
  * @memberof bbn.fn
11
11
  * @param {HTMLElement} img
12
- * @returns
12
+ * @returns {HTMLCanvasElement}
13
13
  */
14
14
  const imageToCanvas = function (img) {
15
15
  let canvas = document.createElement('canvas');
@@ -1,7 +1,6 @@
1
1
  import { imageToCanvas } from './imageToCanvas';
2
2
  const imgToBase64 = function (img, type = 'image/png') {
3
3
  let canvas = imageToCanvas(img);
4
- //return canvasToImage(canvas);
5
4
  return canvas.toDataURL(type);
6
5
  };
7
6
  export { imgToBase64 };
@@ -22,5 +22,5 @@
22
22
  * @param {String} [valEsc="] The string escaper character
23
23
  * @returns {String} A CSV string
24
24
  */
25
- declare const toCSV: (arr: any[], valSep?: string, rowSep?: string, valEsc?: string) => string;
25
+ declare const toCSV: (arr: any, valSep?: string, rowSep?: string, valEsc?: string) => string;
26
26
  export { toCSV };
package/dist/fn.d.ts CHANGED
@@ -146,7 +146,7 @@ declare const fn: {
146
146
  isEmail: (...args: any[]) => boolean;
147
147
  isEmpty: (obj: any) => boolean;
148
148
  isEvent: (...args: any[]) => boolean;
149
- isFocused: (ele: HTMLElement, contain?: boolean) => boolean;
149
+ isFocused: (ele: any, contain?: boolean) => boolean;
150
150
  isFunction: (...args: any[]) => boolean;
151
151
  isHostname: (...args: any[]) => boolean;
152
152
  isInside: (ele: any, ancestor: any) => boolean;
@@ -191,7 +191,7 @@ declare const fn: {
191
191
  percent: (percent: any, cent: any) => number;
192
192
  pickValue: (arr: any[]) => any;
193
193
  post: (...args: any[]) => any;
194
- postOut: (url: string, data: BbnBasicObject, success?: () => any, target?: string) => void;
194
+ postOut: (url: any, data: any, success?: any, target?: string) => void;
195
195
  printf: (format: any) => any;
196
196
  quotes2html: (st: string, type?: string) => string;
197
197
  randomInt: (min: number, max: number) => number;
@@ -211,11 +211,11 @@ declare const fn: {
211
211
  roundDecimal: (value: number, decimals: number) => number;
212
212
  sanitize: (str: any, separator?: string) => any;
213
213
  search: (arr: any[], prop: string | object | import("./fn/object/filterToConditions").Filter | ((a: any, i: string | number | symbol) => boolean), val?: any, operator?: string | number, startFrom?: number) => number;
214
- selectElementText: (ele: HTMLElement, win?: Window) => void;
214
+ selectElementText: (ele: any, win?: any) => void;
215
215
  selector: (ele: string | HTMLElement) => HTMLElement;
216
216
  setCookie: (name: any, value: any, days: any) => void;
217
217
  setCssVar: (varname: any, value: any) => void;
218
- setNavigationVars: (url: any, title: any, data?: object, repl?: boolean) => void;
218
+ setNavigationVars: (url: any, title: any, data?: any, repl?: boolean) => void;
219
219
  setProp: (obj: object, prop: string, value: any, writable?: boolean, configurable?: boolean) => void;
220
220
  setProperty: (obj: object, prop: string, value: any, force?: boolean) => void;
221
221
  shorten: (st: string, len?: number, adj?: string) => string;
@@ -231,14 +231,14 @@ declare const fn: {
231
231
  substr: (str: string, from: number, length?: number) => string;
232
232
  sum: (arr: object[], numberProp: string | ((a: any) => any), prop: string | object, val?: any, operator?: string) => number;
233
233
  timestamp: (seconds?: boolean) => number;
234
- toCSV: (arr: any[], valSep?: string, rowSep?: string, valEsc?: string) => string;
234
+ toCSV: (arr: any, valSep?: string, rowSep?: string, valEsc?: string) => string;
235
235
  toggleFullScreen: () => void;
236
236
  translate: (o: object, namespace?: string) => void;
237
- treatAjaxArguments: (args: any) => BbnAjaxCfg;
237
+ treatAjaxArguments: (args: any) => any;
238
238
  trim: (str: any, hair?: string) => any;
239
239
  uniqString: (...args: any[]) => string;
240
240
  unique: (arr: any[]) => any[];
241
- upload: (url: string, file: any, success?: (d: any) => any, failure?: (d: any) => any, progress?: (d: any, l: any, t: any) => any) => any;
242
- warning: (message: string) => void;
241
+ upload: (url: any, file: any, success?: any, failure?: any, progress?: any) => any;
242
+ warning: (message: any) => void;
243
243
  };
244
244
  export { fn };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.84",
3
+ "version": "1.0.85",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",