@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.
- package/dist/bundle.d.ts +6 -6
- package/dist/fn/_addLoader.js +3 -6
- package/dist/fn/_compareValues.js +11 -14
- package/dist/fn/_deleteLoader.js +7 -10
- package/dist/fn/abort.js +3 -6
- package/dist/fn/abortURL.js +4 -7
- package/dist/fn/addColors.js +5 -8
- package/dist/fn/addInputs.js +3 -6
- package/dist/fn/addStyle.js +5 -8
- package/dist/fn/adjustHeight.js +5 -8
- package/dist/fn/adjustSize.js +5 -8
- package/dist/fn/adjustWidth.js +5 -8
- package/dist/fn/ajax.js +31 -34
- package/dist/fn/analyzeFunction.js +3 -6
- package/dist/fn/animateCss.js +1 -4
- package/dist/fn/arrayBuffer2String.js +1 -4
- package/dist/fn/arrayFromProp.js +5 -8
- package/dist/fn/autoExtend.js +4 -7
- package/dist/fn/baseName.js +6 -9
- package/dist/fn/br2nl.js +3 -6
- package/dist/fn/calendar.js +14 -20
- package/dist/fn/callback.js +16 -19
- package/dist/fn/camelToCss.js +1 -4
- package/dist/fn/camelize.js +1 -4
- package/dist/fn/canvasToImage.js +1 -4
- package/dist/fn/center.js +1 -4
- package/dist/fn/checkProps.js +3 -6
- package/dist/fn/checkPropsDetails.js +9 -12
- package/dist/fn/checkPropsOrDie.js +3 -6
- package/dist/fn/checkType.js +16 -19
- package/dist/fn/chrono.js +3 -7
- package/dist/fn/circularReplacer.js +7 -10
- package/dist/fn/clone.js +7 -10
- package/dist/fn/colorToHex.js +1 -4
- package/dist/fn/compare.js +18 -21
- package/dist/fn/compareConditions.js +10 -13
- package/dist/fn/copy.js +4 -7
- package/dist/fn/correctCase.js +1 -4
- package/dist/fn/count.js +3 -6
- package/dist/fn/crc32.js +1 -4
- package/dist/fn/createObject.js +3 -6
- package/dist/fn/cssExists.js +3 -6
- package/dist/fn/date.js +8 -11
- package/dist/fn/dateSQL.js +5 -11
- package/dist/fn/daysInMonth.js +5 -11
- package/dist/fn/deepPath.js +7 -10
- package/dist/fn/defaultAjaxAbortFunction.js +3 -6
- package/dist/fn/defaultAjaxErrorFunction.js +1 -4
- package/dist/fn/defaultAlertFunction.js +1 -4
- package/dist/fn/defaultConfirmFunction.js +4 -7
- package/dist/fn/defaultEndLoadingFunction.js +1 -4
- package/dist/fn/defaultErrorFunction.js +3 -6
- package/dist/fn/defaultHistoryFunction.js +1 -4
- package/dist/fn/defaultLinkFunction.js +1 -4
- package/dist/fn/defaultPostLinkFunction.js +1 -4
- package/dist/fn/defaultPreLinkFunction.js +1 -4
- package/dist/fn/defaultResizeFunction.js +1 -4
- package/dist/fn/defaultStartLoadingFunction.js +1 -4
- package/dist/fn/deleteProp.js +4 -7
- package/dist/fn/diffObj.js +16 -19
- package/dist/fn/dirName.js +7 -10
- package/dist/fn/download.js +15 -18
- package/dist/fn/downloadContent.js +9 -12
- package/dist/fn/each.js +7 -10
- package/dist/fn/eraseCookie.js +1 -4
- package/dist/fn/error.js +3 -6
- package/dist/fn/escapeDquotes.js +3 -6
- package/dist/fn/escapeRegExp.js +1 -4
- package/dist/fn/escapeSquotes.js +3 -6
- package/dist/fn/escapeTicks.js +3 -6
- package/dist/fn/escapeUrl.js +8 -11
- package/dist/fn/extend.js +13 -16
- package/dist/fn/extendOut.js +4 -7
- package/dist/fn/fdate.js +12 -18
- package/dist/fn/fdatetime.js +10 -16
- package/dist/fn/fieldValue.js +1 -4
- package/dist/fn/fileExt.js +3 -6
- package/dist/fn/filter.js +12 -15
- package/dist/fn/filterToConditions.js +8 -11
- package/dist/fn/findAll.js +7 -10
- package/dist/fn/fori.js +6 -9
- package/dist/fn/forir.js +6 -9
- package/dist/fn/format.js +3 -6
- package/dist/fn/formatBytes.js +1 -4
- package/dist/fn/formatDate.js +3 -9
- package/dist/fn/formatSize.js +5 -8
- package/dist/fn/formdata.js +11 -14
- package/dist/fn/fromXml.js +1 -4
- package/dist/fn/ftime.js +12 -18
- package/dist/fn/getAllTags.js +3 -6
- package/dist/fn/getAncestors.js +1 -4
- package/dist/fn/getAttributes.js +3 -6
- package/dist/fn/getBrowserName.js +1 -4
- package/dist/fn/getBrowserVersion.js +1 -4
- package/dist/fn/getCookie.js +1 -4
- package/dist/fn/getCssVar.js +1 -4
- package/dist/fn/getDay.js +3 -6
- package/dist/fn/getDeviceType.js +1 -4
- package/dist/fn/getEventData.js +7 -10
- package/dist/fn/getField.js +3 -6
- package/dist/fn/getFieldValues.js +7 -10
- package/dist/fn/getHTMLOfSelection.js +4 -7
- package/dist/fn/getHtml.js +3 -6
- package/dist/fn/getLoader.js +3 -6
- package/dist/fn/getPath.js +3 -6
- package/dist/fn/getProp.js +4 -7
- package/dist/fn/getProperty.js +1 -4
- package/dist/fn/getRequestId.js +5 -8
- package/dist/fn/getRow.js +3 -6
- package/dist/fn/getScrollBarSize.js +1 -4
- package/dist/fn/getText.js +1 -4
- package/dist/fn/getTimeoff.js +1 -4
- package/dist/fn/happy.js +3 -6
- package/dist/fn/hash.js +11 -14
- package/dist/fn/hex2rgb.js +1 -4
- package/dist/fn/history.js +1 -4
- package/dist/fn/html2text.js +1 -4
- package/dist/fn/imageToCanvas.js +1 -4
- package/dist/fn/imgToBase64.js +3 -6
- package/dist/fn/info.js +3 -6
- package/dist/fn/init.js +32 -58
- package/dist/fn/isActiveInterface.js +1 -4
- package/dist/fn/isArray.js +1 -4
- package/dist/fn/isBlob.js +1 -4
- package/dist/fn/isBoolean.js +1 -4
- package/dist/fn/isCanvas.js +1 -4
- package/dist/fn/isColor.js +3 -6
- package/dist/fn/isComment.js +1 -4
- package/dist/fn/isCp.js +3 -6
- package/dist/fn/isDate.js +1 -4
- package/dist/fn/isDesktopDevice.js +1 -4
- package/dist/fn/isDimension.js +3 -6
- package/dist/fn/isDom.js +1 -4
- package/dist/fn/isEmail.js +3 -6
- package/dist/fn/isEmpty.js +5 -8
- package/dist/fn/isEvent.js +1 -4
- package/dist/fn/isFocused.js +1 -4
- package/dist/fn/isFunction.js +1 -4
- package/dist/fn/isHostname.js +5 -8
- package/dist/fn/isIP.js +3 -6
- package/dist/fn/isInside.js +7 -10
- package/dist/fn/isInt.js +1 -4
- package/dist/fn/isIterable.js +1 -4
- package/dist/fn/isMobile.js +4 -7
- package/dist/fn/isMobileDevice.js +1 -4
- package/dist/fn/isNull.js +1 -4
- package/dist/fn/isNumber.js +1 -4
- package/dist/fn/isObject.js +1 -4
- package/dist/fn/isPercent.js +1 -4
- package/dist/fn/isPrimitive.js +1 -4
- package/dist/fn/isPromise.js +1 -4
- package/dist/fn/isPropSize.js +3 -6
- package/dist/fn/isSQLDate.js +1 -4
- package/dist/fn/isSame.js +5 -8
- package/dist/fn/isString.js +1 -4
- package/dist/fn/isSymbol.js +1 -4
- package/dist/fn/isTabletDevice.js +1 -4
- package/dist/fn/isURL.js +1 -4
- package/dist/fn/isValidDimension.js +4 -7
- package/dist/fn/isValidName.js +3 -6
- package/dist/fn/isValue.js +3 -6
- package/dist/fn/isVue.js +1 -4
- package/dist/fn/iterate.js +5 -8
- package/dist/fn/lightenDarkenHex.js +1 -4
- package/dist/fn/link.js +19 -22
- package/dist/fn/log.js +3 -6
- package/dist/fn/makeReactive.js +28 -31
- package/dist/fn/map.js +3 -6
- package/dist/fn/md5.js +1 -4
- package/dist/fn/money.js +3 -6
- package/dist/fn/move.js +1 -4
- package/dist/fn/multiorder.js +3 -6
- package/dist/fn/nl2br.js +3 -6
- package/dist/fn/numProperties.js +1 -4
- package/dist/fn/objectToFormData.js +12 -15
- package/dist/fn/order.js +3 -6
- package/dist/fn/outerHeight.js +3 -6
- package/dist/fn/outerWidth.js +3 -6
- package/dist/fn/percent.js +1 -4
- package/dist/fn/pickValue.js +1 -4
- package/dist/fn/post.js +7 -10
- package/dist/fn/postOut.js +5 -8
- package/dist/fn/printf.js +1 -4
- package/dist/fn/quotes2html.js +4 -7
- package/dist/fn/randomInt.js +1 -4
- package/dist/fn/randomString.js +4 -7
- package/dist/fn/removeAccents.js +5 -8
- package/dist/fn/removeEmpty.js +8 -11
- package/dist/fn/removeExtraSpaces.js +1 -4
- package/dist/fn/removeHtmlComments.js +3 -6
- package/dist/fn/removePrivateProp.js +3 -6
- package/dist/fn/removeTrailingChars.js +6 -9
- package/dist/fn/repeat.js +1 -4
- package/dist/fn/replaceAll.js +4 -7
- package/dist/fn/replaceSelection.js +1 -4
- package/dist/fn/resize.js +7 -10
- package/dist/fn/rgb2hex.js +1 -4
- package/dist/fn/riterate.js +3 -6
- package/dist/fn/roundDecimal.js +1 -4
- package/dist/fn/sanitize.js +5 -8
- package/dist/fn/search.js +15 -18
- package/dist/fn/selectElementText.js +1 -4
- package/dist/fn/selector.js +1 -4
- package/dist/fn/setCookie.js +1 -4
- package/dist/fn/setCssVar.js +1 -4
- package/dist/fn/setNavigationVars.js +10 -13
- package/dist/fn/setProp.js +1 -4
- package/dist/fn/setProperty.js +3 -6
- package/dist/fn/shorten.js +5 -8
- package/dist/fn/shortenObj.js +9 -12
- package/dist/fn/shuffle.js +1 -4
- package/dist/fn/simpleHash.js +5 -8
- package/dist/fn/simpleHash1.js +1 -4
- package/dist/fn/simpleHash2.js +1 -4
- package/dist/fn/stat.js +1 -4
- package/dist/fn/string2ArrayBuffer.js +1 -4
- package/dist/fn/submit.js +6 -9
- package/dist/fn/substr.js +7 -10
- package/dist/fn/sum.js +4 -7
- package/dist/fn/timestamp.js +1 -4
- package/dist/fn/toCSV.js +8 -11
- package/dist/fn/toggleFullScreen.js +3 -6
- package/dist/fn/translate.js +3 -6
- package/dist/fn/treatAjaxArguments.js +10 -13
- package/dist/fn/trim.js +4 -7
- package/dist/fn/uniqString.js +7 -10
- package/dist/fn/unique.js +1 -4
- package/dist/fn/upload.js +7 -33
- package/dist/fn/warning.js +3 -6
- package/dist/index.js +459 -471
- 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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
1117
|
-
daysInMonth: (v: any) =>
|
|
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) =>
|
|
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) => {};
|
package/dist/fn/_addLoader.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
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 =
|
|
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
|
-
|
|
37
|
+
export { _addLoader };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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 =
|
|
10
|
-
if ((dir !== 'asc') &&
|
|
6
|
+
let va = getProperty(a, prop), vb = getProperty(b, prop), ta = (typeof (va)).toLowerCase(), tb = (typeof (vb)).toLowerCase();
|
|
7
|
+
if ((dir !== 'asc') && isString(dir) && (dir.toLowerCase() === 'desc')) {
|
|
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 =
|
|
21
|
-
vb =
|
|
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 (
|
|
25
|
+
if (isDate(va)) {
|
|
29
26
|
va = va.getTime();
|
|
30
|
-
vb =
|
|
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
|
-
|
|
40
|
+
export { _compareValues };
|
package/dist/fn/_deleteLoader.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 =
|
|
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 =
|
|
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 (
|
|
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
|
-
|
|
25
|
+
export { _deleteLoader };
|
package/dist/fn/abort.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
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 =
|
|
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
|
-
|
|
14
|
+
export { abort };
|
package/dist/fn/abortURL.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
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
|
-
|
|
13
|
+
export { abortURL };
|
package/dist/fn/addColors.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
41
|
+
export { addColors };
|
package/dist/fn/addInputs.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
40
|
+
export { addInputs };
|
package/dist/fn/addStyle.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 (
|
|
8
|
-
|
|
4
|
+
if (isObject(o)) {
|
|
5
|
+
iterate(o, (v, k) => {
|
|
9
6
|
ele.style[k] = v;
|
|
10
7
|
});
|
|
11
8
|
}
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { addStyle };
|
package/dist/fn/adjustHeight.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 &&
|
|
5
|
+
if (args.length === 1 && isIterable(args[0])) {
|
|
9
6
|
args = args[0];
|
|
10
7
|
}
|
|
11
|
-
return
|
|
8
|
+
return adjustSize('height', args);
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { adjustHeight };
|
package/dist/fn/adjustSize.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
4
|
+
each(eles, (el) => {
|
|
8
5
|
el.style[type] = 'auto';
|
|
9
6
|
});
|
|
10
|
-
|
|
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
|
-
|
|
15
|
+
each(eles, (el, i) => {
|
|
19
16
|
if (max) {
|
|
20
17
|
el.style[type] = max + 'px';
|
|
21
18
|
}
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
|
-
|
|
21
|
+
export { adjustSize };
|
package/dist/fn/adjustWidth.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 &&
|
|
5
|
+
if (args.length === 1 && isIterable(args[0])) {
|
|
9
6
|
args = args[0];
|
|
10
7
|
}
|
|
11
|
-
return
|
|
8
|
+
return adjustSize('width', args);
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { adjustWidth };
|
package/dist/fn/ajax.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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 =
|
|
39
|
+
url = replaceAll('//', '/', url);
|
|
43
40
|
}
|
|
44
41
|
if (!datatype) {
|
|
45
42
|
datatype = 'json';
|
|
46
43
|
}
|
|
47
|
-
let requestId =
|
|
48
|
-
let loaderObj =
|
|
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
|
-
|
|
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 (
|
|
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
|
-
|
|
77
|
-
|
|
73
|
+
_deleteLoader(requestId, res);
|
|
74
|
+
defaultEndLoadingFunction(url, tst, data, res);
|
|
78
75
|
switch (res.status) {
|
|
79
76
|
case 200:
|
|
80
|
-
if (
|
|
77
|
+
if (isFunction(success)) {
|
|
81
78
|
success(res.data, res.headers);
|
|
82
79
|
}
|
|
83
80
|
break;
|
|
84
81
|
default:
|
|
85
|
-
|
|
82
|
+
defaultAjaxErrorFunction(loader, res);
|
|
86
83
|
}
|
|
87
84
|
return res;
|
|
88
85
|
})
|
|
89
86
|
.catch((err) => {
|
|
90
87
|
let isAbort = axios.isCancel(err);
|
|
91
|
-
|
|
92
|
-
|
|
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 (
|
|
92
|
+
if (isFunction(abort)) {
|
|
96
93
|
ok = abort(err.message, url);
|
|
97
94
|
}
|
|
98
95
|
if (ok) {
|
|
99
|
-
|
|
96
|
+
defaultAjaxAbortFunction(err.message, url);
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
else {
|
|
103
100
|
let ok = 1;
|
|
104
|
-
if (
|
|
101
|
+
if (isFunction(failure)) {
|
|
105
102
|
ok = failure(err.request, err);
|
|
106
103
|
}
|
|
107
104
|
if (ok) {
|
|
108
|
-
|
|
105
|
+
defaultAjaxErrorFunction(err.request, err.response ? err.response.data : '', err.response ? err.response.status : err);
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
});
|
|
112
|
-
let tst =
|
|
113
|
-
|
|
109
|
+
let tst = _addLoader(requestId, loader, source);
|
|
110
|
+
defaultStartLoadingFunction(url, tst, data, requestId);
|
|
114
111
|
return loader;
|
|
115
112
|
}
|
|
116
113
|
};
|
|
117
|
-
|
|
114
|
+
export { ajax };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
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 =
|
|
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
|
-
|
|
141
|
+
export { analyzeFunction };
|
package/dist/fn/animateCss.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
4
|
+
export { arrayBuffer2String };
|
package/dist/fn/arrayFromProp.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
9
|
-
r.push(
|
|
5
|
+
each(arr, (a, i) => {
|
|
6
|
+
r.push(getProperty(a, prop));
|
|
10
7
|
});
|
|
11
8
|
return r;
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { arrayFromProp };
|
package/dist/fn/autoExtend.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
6
|
+
extend(bbn[namespace], obj);
|
|
10
7
|
}
|
|
11
8
|
else {
|
|
12
9
|
// $.extend(true, bbn[namespace], obj);
|
|
13
|
-
|
|
10
|
+
extend(bbn[namespace], obj);
|
|
14
11
|
}
|
|
15
12
|
};
|
|
16
|
-
|
|
13
|
+
export { autoExtend };
|
package/dist/fn/baseName.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 &&
|
|
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 &&
|
|
15
|
-
return
|
|
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
|
-
|
|
17
|
+
export { baseName };
|
package/dist/fn/br2nl.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
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
|
|
3
|
+
return replaceAll('<br />', '\n', replaceAll('<br/>', '\n', replaceAll('<br>', '\n', st)));
|
|
7
4
|
};
|
|
8
|
-
|
|
5
|
+
export { br2nl };
|
package/dist/fn/calendar.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 ===
|
|
16
|
-
return
|
|
9
|
+
if (undefined === dayjs) {
|
|
10
|
+
return fdate(d, wrong_result);
|
|
17
11
|
}
|
|
18
|
-
let r =
|
|
19
|
-
if (!
|
|
20
|
-
return wrong_result &&
|
|
12
|
+
let r = date(d);
|
|
13
|
+
if (!isDate(r)) {
|
|
14
|
+
return wrong_result && isString(wrong_result) ? wrong_result : '';
|
|
21
15
|
}
|
|
22
|
-
return (
|
|
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
|
-
|
|
25
|
+
export { calendar };
|