@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/fn/isSQLDate.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSQLDate = void 0;
|
|
4
1
|
const isSQLDate = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -12,4 +9,4 @@ const isSQLDate = function (...args) {
|
|
|
12
9
|
}
|
|
13
10
|
return true;
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { isSQLDate };
|
package/dist/fn/isSame.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isSame = void 0;
|
|
4
|
-
const hash_1 = require("./hash");
|
|
5
|
-
const each_1 = require("./each");
|
|
1
|
+
import { hash } from './hash';
|
|
2
|
+
import { each } from './each';
|
|
6
3
|
const isSame = function (obj1, obj2, done) {
|
|
7
4
|
if (!done) {
|
|
8
5
|
done = [];
|
|
@@ -13,7 +10,7 @@ const isSame = function (obj1, obj2, done) {
|
|
|
13
10
|
if (obj1 && obj2 && typeof obj1 === 'object' && typeof obj2 === 'object') {
|
|
14
11
|
let tmp1 = Object.keys(obj1).sort(), tmp2 = Object.keys(obj2).sort();
|
|
15
12
|
// Case where the keys are different
|
|
16
|
-
if (
|
|
13
|
+
if (hash(tmp1) !== hash(tmp2)) {
|
|
17
14
|
return false;
|
|
18
15
|
}
|
|
19
16
|
let ok = true;
|
|
@@ -23,7 +20,7 @@ const isSame = function (obj1, obj2, done) {
|
|
|
23
20
|
}
|
|
24
21
|
done.push(obj1);
|
|
25
22
|
}
|
|
26
|
-
|
|
23
|
+
each(tmp1, (a) => {
|
|
27
24
|
if (!isSame(obj1[a], obj2[a])) {
|
|
28
25
|
ok = false;
|
|
29
26
|
return false;
|
|
@@ -33,4 +30,4 @@ const isSame = function (obj1, obj2, done) {
|
|
|
33
30
|
}
|
|
34
31
|
return false;
|
|
35
32
|
};
|
|
36
|
-
|
|
33
|
+
export { isSame };
|
package/dist/fn/isString.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isString = void 0;
|
|
4
1
|
const isString = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isString = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isString };
|
package/dist/fn/isSymbol.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSymbol = void 0;
|
|
4
1
|
const isSymbol = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isSymbol = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isSymbol };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTabletDevice = void 0;
|
|
4
1
|
const isTabletDevice = function () {
|
|
5
2
|
return this.getDeviceType() === 'tablet';
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { isTabletDevice };
|
package/dist/fn/isURL.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isURL = void 0;
|
|
4
1
|
const isURL = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isURL = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isURL };
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isValidDimension = void 0;
|
|
4
|
-
const isNumber_1 = require("./isNumber");
|
|
5
|
-
const substr_1 = require("./substr");
|
|
1
|
+
import { isNumber } from './isNumber';
|
|
2
|
+
import { substr } from './substr';
|
|
6
3
|
const isValidDimension = function (st) {
|
|
7
|
-
if (typeof st === 'string' && (st.length > 0) && ((st.indexOf('calc') === 0) ||
|
|
4
|
+
if (typeof st === 'string' && (st.length > 0) && ((st.indexOf('calc') === 0) || isNumber(substr(st, 0, 1)))) {
|
|
8
5
|
let el = document.createElement('div');
|
|
9
6
|
el.style.width = st;
|
|
10
7
|
let res = !!el.style.width.length;
|
|
@@ -13,4 +10,4 @@ const isValidDimension = function (st) {
|
|
|
13
10
|
}
|
|
14
11
|
return false;
|
|
15
12
|
};
|
|
16
|
-
|
|
13
|
+
export { isValidDimension };
|
package/dist/fn/isValidName.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidName = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const isValidName = function (...args) {
|
|
6
3
|
if (!args.length) {
|
|
7
4
|
return false;
|
|
8
5
|
}
|
|
9
6
|
for (let arg of args) {
|
|
10
|
-
if (!
|
|
7
|
+
if (!isString(arg) || !/^[$A-Z_][0-9A-Z_$]*$/i.test(arg)) {
|
|
11
8
|
return false;
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
return true;
|
|
15
12
|
};
|
|
16
|
-
|
|
13
|
+
export { isValidName };
|
package/dist/fn/isValue.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValue = void 0;
|
|
4
|
-
const isNull_1 = require("./isNull");
|
|
1
|
+
import { isNull } from './isNull';
|
|
5
2
|
const isValue = function (...args) {
|
|
6
3
|
if (!args.length)
|
|
7
4
|
return false;
|
|
8
5
|
for (let a of args) {
|
|
9
|
-
if (typeof a === 'object' && !
|
|
6
|
+
if (typeof a === 'object' && !isNull(a)) {
|
|
10
7
|
return false;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
10
|
return true;
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { isValue };
|
package/dist/fn/isVue.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isVue = void 0;
|
|
4
1
|
const isVue = function (...args) {
|
|
5
2
|
if (!args.length) {
|
|
6
3
|
return false;
|
|
@@ -26,4 +23,4 @@ const isVue = function (...args) {
|
|
|
26
23
|
}
|
|
27
24
|
return true;
|
|
28
25
|
};
|
|
29
|
-
|
|
26
|
+
export { isVue };
|
package/dist/fn/iterate.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.iterate = void 0;
|
|
4
|
-
const removePrivateProp_1 = require("./removePrivateProp");
|
|
5
|
-
const each_1 = require("./each");
|
|
1
|
+
import { removePrivateProp } from './removePrivateProp';
|
|
2
|
+
import { each } from './each';
|
|
6
3
|
const iterate = function (obj, fn, noPrivate = false, reverse = false) {
|
|
7
4
|
if (obj !== null && typeof obj === 'object') {
|
|
8
|
-
let iter = Object.keys(noPrivate ?
|
|
5
|
+
let iter = Object.keys(noPrivate ? removePrivateProp(obj) : obj);
|
|
9
6
|
if (reverse) {
|
|
10
7
|
iter.reverse();
|
|
11
8
|
}
|
|
12
|
-
|
|
9
|
+
each(iter, (prop) => {
|
|
13
10
|
if (fn(obj[prop], prop) === false) {
|
|
14
11
|
return false;
|
|
15
12
|
}
|
|
@@ -17,4 +14,4 @@ const iterate = function (obj, fn, noPrivate = false, reverse = false) {
|
|
|
17
14
|
}
|
|
18
15
|
return obj;
|
|
19
16
|
};
|
|
20
|
-
|
|
17
|
+
export { iterate };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.lightenDarkenHex = void 0;
|
|
4
1
|
const lightenDarkenHex = function (hex, amt) {
|
|
5
2
|
if (hex && amt) {
|
|
6
3
|
let ht = hex[0] === '#';
|
|
@@ -27,4 +24,4 @@ const lightenDarkenHex = function (hex, amt) {
|
|
|
27
24
|
return (ht ? '#' : '') + (g | (b << 8) | (r << 16)).toString(16);
|
|
28
25
|
}
|
|
29
26
|
};
|
|
30
|
-
|
|
27
|
+
export { lightenDarkenHex };
|
package/dist/fn/link.js
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const isObject_1 = require("./isObject");
|
|
10
|
-
const callback_1 = require("./callback");
|
|
11
|
-
const setNavigationVars_1 = require("./setNavigationVars");
|
|
1
|
+
import { treatAjaxArguments } from './treatAjaxArguments';
|
|
2
|
+
import { getLoader } from './getLoader';
|
|
3
|
+
import { defaultPreLinkFunction } from './defaultPreLinkFunction';
|
|
4
|
+
import { ajax } from './ajax';
|
|
5
|
+
import { log } from './log';
|
|
6
|
+
import { isObject } from './isObject';
|
|
7
|
+
import { callback } from './callback';
|
|
8
|
+
import { setNavigationVars } from './setNavigationVars';
|
|
12
9
|
const link = function (...args) {
|
|
13
|
-
let cfg =
|
|
10
|
+
let cfg = treatAjaxArguments(args);
|
|
14
11
|
let ok = true;
|
|
15
12
|
/* If we can't find a correct link we load the current URL */
|
|
16
13
|
if (!cfg) {
|
|
@@ -44,7 +41,7 @@ const link = function (...args) {
|
|
|
44
41
|
}, 0);
|
|
45
42
|
return false;
|
|
46
43
|
}
|
|
47
|
-
if (
|
|
44
|
+
if (getLoader(cfg.url)) {
|
|
48
45
|
return false;
|
|
49
46
|
}
|
|
50
47
|
/* Opens an external page in a new window */
|
|
@@ -62,8 +59,8 @@ const link = function (...args) {
|
|
|
62
59
|
if (cfg.successFn) {
|
|
63
60
|
ok = cfg.successFn(cfg.url);
|
|
64
61
|
}
|
|
65
|
-
else if (
|
|
66
|
-
ok =
|
|
62
|
+
else if (defaultPreLinkFunction) {
|
|
63
|
+
ok = defaultPreLinkFunction(cfg.url, cfg.force, cfg.ele);
|
|
67
64
|
/*
|
|
68
65
|
if (ok.data !== undefined) {
|
|
69
66
|
extend(cfg.obj, ok.data);
|
|
@@ -77,14 +74,14 @@ const link = function (...args) {
|
|
|
77
74
|
}
|
|
78
75
|
/** todo Do we keep obj in the unique string or do we make that only one concurrent connection to the same address can occur at the same time? */
|
|
79
76
|
let errSt = bbn._('The Ajax call to') + ' ' + cfg.url + ' ';
|
|
80
|
-
return
|
|
77
|
+
return ajax(cfg.url, cfg.datatype, cfg.obj, function (res) {
|
|
81
78
|
if (!res) {
|
|
82
|
-
|
|
79
|
+
log(errSt + bbn._('returned no answer'));
|
|
83
80
|
}
|
|
84
|
-
if (
|
|
81
|
+
if (isObject(res)) {
|
|
85
82
|
// If there's nothing in the result, just an empty object, the callback stops here and the URL is not changed
|
|
86
83
|
if (Object.keys(res).length === 0) {
|
|
87
|
-
|
|
84
|
+
log(errSt + bbn._('returned an empty object'));
|
|
88
85
|
}
|
|
89
86
|
if (res.new_url) {
|
|
90
87
|
res.old_path = cfg.url;
|
|
@@ -94,10 +91,10 @@ const link = function (...args) {
|
|
|
94
91
|
res.old_path = cfg.url;
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
|
-
if (
|
|
94
|
+
if (callback(cfg.url, res, cfg.successFn, null, cfg.ele) && res.noNav === undefined) {
|
|
98
95
|
// This solution is not very clean (we can't shorten a URL)
|
|
99
96
|
if (bbn.env.path.indexOf(cfg.url) !== 0) {
|
|
100
|
-
|
|
97
|
+
setNavigationVars(cfg.url, (res.title ? res.title + ' - ' : '') + bbn.env.siteTitle);
|
|
101
98
|
}
|
|
102
99
|
}
|
|
103
100
|
}, cfg.errorFn || null);
|
|
@@ -105,4 +102,4 @@ const link = function (...args) {
|
|
|
105
102
|
}
|
|
106
103
|
return true;
|
|
107
104
|
};
|
|
108
|
-
|
|
105
|
+
export { link };
|
package/dist/fn/log.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.log = void 0;
|
|
4
|
-
const isFunction_1 = require("./isFunction");
|
|
1
|
+
import { isFunction } from './isFunction';
|
|
5
2
|
const log = function (...args) {
|
|
6
3
|
if (window.console !== undefined) {
|
|
7
4
|
let cfg;
|
|
8
5
|
let level = 5;
|
|
9
6
|
let fn = 'log';
|
|
10
7
|
if (args[0] && typeof args[0] === 'object' && args[0]._bbn_console_style) {
|
|
11
|
-
if (args[0]._bbn_console_mode &&
|
|
8
|
+
if (args[0]._bbn_console_mode && isFunction(console[args[0]._bbn_console_mode])) {
|
|
12
9
|
fn = args[0]._bbn_console_mode;
|
|
13
10
|
}
|
|
14
11
|
else {
|
|
@@ -33,4 +30,4 @@ const log = function (...args) {
|
|
|
33
30
|
}
|
|
34
31
|
return this;
|
|
35
32
|
};
|
|
36
|
-
|
|
33
|
+
export { log };
|
package/dist/fn/makeReactive.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const warning_1 = require("./warning");
|
|
10
|
-
const isFunction_1 = require("./isFunction");
|
|
11
|
-
const isSame_1 = require("./isSame");
|
|
1
|
+
import { log } from './log';
|
|
2
|
+
import { createObject } from './createObject';
|
|
3
|
+
import { isSymbol } from './isSymbol';
|
|
4
|
+
import { isNumber } from './isNumber';
|
|
5
|
+
import { isArray } from './isArray';
|
|
6
|
+
import { warning } from './warning';
|
|
7
|
+
import { isFunction } from './isFunction';
|
|
8
|
+
import { isSame } from './isSame';
|
|
12
9
|
const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
13
10
|
const parentString = (parent === null || parent === void 0 ? void 0 : parent.$cid) || '';
|
|
14
11
|
const prefix = '__bbn_' + (parentString ? parentString + '_' : '');
|
|
@@ -17,11 +14,11 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
17
14
|
return obj;
|
|
18
15
|
}
|
|
19
16
|
if (parent && parent.$options && parent.$options.name === 'bbn-loadbar') {
|
|
20
|
-
|
|
17
|
+
log(['MAKING bbn-loadbar', obj]);
|
|
21
18
|
}
|
|
22
19
|
if (!obj.__bbnWatchers) {
|
|
23
20
|
Reflect.defineProperty(obj, '__bbnWatchers', {
|
|
24
|
-
value:
|
|
21
|
+
value: createObject(),
|
|
25
22
|
writable: true,
|
|
26
23
|
configurable: true,
|
|
27
24
|
enumerable: false,
|
|
@@ -31,22 +28,22 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
31
28
|
get(target, key) {
|
|
32
29
|
const realValue = Reflect.get(target, key);
|
|
33
30
|
const realTarget = target.__bbnRoot || target;
|
|
34
|
-
if (
|
|
31
|
+
if (isSymbol(key)) {
|
|
35
32
|
return Reflect.get(realTarget, key);
|
|
36
33
|
}
|
|
37
34
|
const propName = parentProp ? parentProp + '.' + key : key;
|
|
38
|
-
const hiddenKey = prefix + (
|
|
35
|
+
const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
|
|
39
36
|
if (['fill', 'pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'].includes(key) &&
|
|
40
|
-
|
|
37
|
+
isArray(target)) {
|
|
41
38
|
return function (...args) {
|
|
42
39
|
let res = realTarget[key](...args);
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
warning('DOING ARRAY STUFF');
|
|
41
|
+
log(target.__bbnParent);
|
|
45
42
|
onSet(target, 'length', parent);
|
|
46
43
|
return res;
|
|
47
44
|
};
|
|
48
45
|
}
|
|
49
|
-
if (
|
|
46
|
+
if (isFunction(realValue)) {
|
|
50
47
|
return realValue;
|
|
51
48
|
}
|
|
52
49
|
if (key === '__bbnRoot') {
|
|
@@ -71,7 +68,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
71
68
|
if (key.indexOf('__bbn_') === 0) {
|
|
72
69
|
return Reflect.get(target, key);
|
|
73
70
|
}
|
|
74
|
-
if (key === 'length' &&
|
|
71
|
+
if (key === 'length' && isArray(target.__bbnRoot || target)) {
|
|
75
72
|
return realTarget.length;
|
|
76
73
|
}
|
|
77
74
|
if (!(key in target)) {
|
|
@@ -99,18 +96,18 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
99
96
|
return realValue;
|
|
100
97
|
},
|
|
101
98
|
set(target, key, value) {
|
|
102
|
-
if (
|
|
99
|
+
if (isSymbol(key)) {
|
|
103
100
|
return Reflect.get(target, key, value);
|
|
104
101
|
}
|
|
105
102
|
const realTarget = target.__bbnRoot || target;
|
|
106
103
|
const propName = parentProp ? parentProp + '.' + key : key;
|
|
107
|
-
if (
|
|
104
|
+
if (isSymbol(key)) {
|
|
108
105
|
return Reflect.get(target, key);
|
|
109
106
|
}
|
|
110
107
|
if (parent && parent.$options && parent.$options.name === 'bbn-loadbar') {
|
|
111
|
-
|
|
108
|
+
log(['Setting proxy prop in ' + parent.$options.name, target, key, value]);
|
|
112
109
|
}
|
|
113
|
-
if (!
|
|
110
|
+
if (!isSame(realTarget[key], value)) {
|
|
114
111
|
if (key.indexOf('__bbn_') === 0) {
|
|
115
112
|
Reflect.defineProperty(realTarget, key, {
|
|
116
113
|
value: makeReactive(value, onSet, parent, propName),
|
|
@@ -123,7 +120,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
123
120
|
if (value &&
|
|
124
121
|
typeof value === 'object' &&
|
|
125
122
|
[undefined, Object, Array].includes(value.constructor)) {
|
|
126
|
-
const hiddenKey = prefix + (
|
|
123
|
+
const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
|
|
127
124
|
Reflect.defineProperty(realTarget, hiddenKey, {
|
|
128
125
|
value: makeReactive(value, onSet, parent, propName),
|
|
129
126
|
writable: true,
|
|
@@ -136,11 +133,11 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
136
133
|
}
|
|
137
134
|
}
|
|
138
135
|
if (parent && parent.$options && parent.$options.name === 'bbn-loadbar') {
|
|
139
|
-
|
|
136
|
+
log([
|
|
140
137
|
'Setting proxy prop in ' +
|
|
141
138
|
parent.$options.name +
|
|
142
139
|
' ' +
|
|
143
|
-
(
|
|
140
|
+
(isNumber(key) ? key.toString() : key),
|
|
144
141
|
value,
|
|
145
142
|
target,
|
|
146
143
|
]);
|
|
@@ -153,11 +150,11 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
153
150
|
defineProperty(target, key, description) {
|
|
154
151
|
const realTarget = target;
|
|
155
152
|
const propName = parentProp ? parentProp + '.' + key : key;
|
|
156
|
-
if (key === '__bbnWatchers' ||
|
|
153
|
+
if (key === '__bbnWatchers' || isSymbol(key) || key.indexOf('__bbn_') === 0) {
|
|
157
154
|
Reflect.defineProperty(realTarget, key, description);
|
|
158
155
|
}
|
|
159
156
|
else {
|
|
160
|
-
const hiddenKey = prefix + (
|
|
157
|
+
const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
|
|
161
158
|
Reflect.defineProperty(realTarget, hiddenKey, {
|
|
162
159
|
value: makeReactive(description.value, onSet, parent, propName),
|
|
163
160
|
writable: true,
|
|
@@ -174,7 +171,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
174
171
|
Reflect.deleteProperty(realTarget, key);
|
|
175
172
|
}
|
|
176
173
|
else {
|
|
177
|
-
const hiddenKey = prefix + (
|
|
174
|
+
const hiddenKey = prefix + (isNumber(key) ? key.toString() : key);
|
|
178
175
|
Reflect.deleteProperty(realTarget, hiddenKey);
|
|
179
176
|
Reflect.deleteProperty(target, key);
|
|
180
177
|
}
|
|
@@ -185,4 +182,4 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
185
182
|
}
|
|
186
183
|
return obj;
|
|
187
184
|
};
|
|
188
|
-
|
|
185
|
+
export { makeReactive };
|
package/dist/fn/map.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.map = void 0;
|
|
4
|
-
const isArray_1 = require("./isArray");
|
|
1
|
+
import { isArray } from './isArray';
|
|
5
2
|
const map = function (arr, fn, deepProp, level = 0) {
|
|
6
3
|
return arr.map((a, i) => {
|
|
7
4
|
a = fn(a, i, level);
|
|
8
|
-
if (deepProp && a[deepProp] &&
|
|
5
|
+
if (deepProp && a[deepProp] && isArray(a[deepProp])) {
|
|
9
6
|
a[deepProp] = map(a[deepProp], fn, deepProp, level + 1);
|
|
10
7
|
}
|
|
11
8
|
return a;
|
|
12
9
|
});
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { map };
|
package/dist/fn/md5.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.md5 = void 0;
|
|
4
1
|
const md5 = function (st) {
|
|
5
2
|
var hc = '0123456789abcdef';
|
|
6
3
|
function rh(n) {
|
|
@@ -121,4 +118,4 @@ const md5 = function (st) {
|
|
|
121
118
|
}
|
|
122
119
|
return rh(a) + rh(b) + rh(c) + rh(d);
|
|
123
120
|
};
|
|
124
|
-
|
|
121
|
+
export { md5 };
|
package/dist/fn/money.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.money = void 0;
|
|
4
|
-
const isNumber_1 = require("./isNumber");
|
|
1
|
+
import { isNumber } from './isNumber';
|
|
5
2
|
const money = function (val, kilo, currency, novalue, decimal, thousands, precision) {
|
|
6
3
|
/*
|
|
7
4
|
money(val, kilo){
|
|
@@ -60,7 +57,7 @@ const money = function (val, kilo, currency, novalue, decimal, thousands, precis
|
|
|
60
57
|
? bbn.env.money.novalue
|
|
61
58
|
: false;
|
|
62
59
|
}
|
|
63
|
-
if (!
|
|
60
|
+
if (!isNumber(precision)) {
|
|
64
61
|
precision = kilo ? 3 : 0;
|
|
65
62
|
}
|
|
66
63
|
if ((val === 0) && (typeof precision === 'number') && (precision > 0)) {
|
|
@@ -101,4 +98,4 @@ const money = function (val, kilo, currency, novalue, decimal, thousands, precis
|
|
|
101
98
|
return i && (a.length - i - decimalPosition) % 3 === 0 && i < decimalIdx ? thousands + c : c;
|
|
102
99
|
}) + (currency ? ' ' + currency : ''));
|
|
103
100
|
};
|
|
104
|
-
|
|
101
|
+
export { money };
|
package/dist/fn/move.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.move = void 0;
|
|
4
1
|
const move = function (arr, fromIndex, toIndex) {
|
|
5
2
|
if (toIndex >= arr.length) {
|
|
6
3
|
let k = toIndex - arr.length;
|
|
@@ -11,4 +8,4 @@ const move = function (arr, fromIndex, toIndex) {
|
|
|
11
8
|
arr.splice(toIndex, 0, arr.splice(fromIndex, 1)[0]);
|
|
12
9
|
return arr;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { move };
|
package/dist/fn/multiorder.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.multiorder = void 0;
|
|
4
|
-
const _compareValues_1 = require("./_compareValues");
|
|
1
|
+
import { _compareValues } from './_compareValues';
|
|
5
2
|
const multiorder = function (arr, orders) {
|
|
6
3
|
let currentOrders;
|
|
7
4
|
if (!Array.isArray(orders) && typeof orders === 'object') {
|
|
@@ -14,7 +11,7 @@ const multiorder = function (arr, orders) {
|
|
|
14
11
|
return r.sort((a, b) => {
|
|
15
12
|
let res;
|
|
16
13
|
for (let order of currentOrders) {
|
|
17
|
-
res =
|
|
14
|
+
res = _compareValues(a, b, order.field, order.dir);
|
|
18
15
|
if (res !== 0) {
|
|
19
16
|
return res;
|
|
20
17
|
}
|
|
@@ -22,4 +19,4 @@ const multiorder = function (arr, orders) {
|
|
|
22
19
|
return 0;
|
|
23
20
|
});
|
|
24
21
|
};
|
|
25
|
-
|
|
22
|
+
export { multiorder };
|
package/dist/fn/nl2br.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nl2br = void 0;
|
|
4
|
-
const replaceAll_1 = require("./replaceAll");
|
|
1
|
+
import { replaceAll } from './replaceAll';
|
|
5
2
|
const nl2br = function (st, keepNl) {
|
|
6
|
-
return
|
|
3
|
+
return replaceAll('\n', '<br>' + (keepNl ? '\n' : ''), st);
|
|
7
4
|
};
|
|
8
|
-
|
|
5
|
+
export { nl2br };
|
package/dist/fn/numProperties.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.numProperties = void 0;
|
|
4
1
|
const numProperties = function (obj) {
|
|
5
2
|
if (!obj || typeof obj !== 'object') {
|
|
6
3
|
return 0;
|
|
7
4
|
}
|
|
8
5
|
return Object.keys(obj).length;
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { numProperties };
|
|
@@ -1,32 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const isObject_1 = require("./isObject");
|
|
7
|
-
const iterate_1 = require("./iterate");
|
|
8
|
-
const isNull_1 = require("./isNull");
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { each } from './each';
|
|
3
|
+
import { isObject } from './isObject';
|
|
4
|
+
import { iterate } from './iterate';
|
|
5
|
+
import { isNull } from './isNull';
|
|
9
6
|
const objectToFormData = function (obj, key = '', ignoreList) {
|
|
10
7
|
let formData = new FormData();
|
|
11
8
|
let appendFormData = (data, key = '') => {
|
|
12
|
-
if (!ignoreList || (
|
|
9
|
+
if (!ignoreList || (isArray(ignoreList) && !ignoreList.includes(key))) {
|
|
13
10
|
if (data instanceof File) {
|
|
14
11
|
formData.append(key, data);
|
|
15
12
|
}
|
|
16
|
-
else if (
|
|
17
|
-
|
|
13
|
+
else if (isArray(data)) {
|
|
14
|
+
each(data, (v, i) => {
|
|
18
15
|
appendFormData(v, key + '[' + i + ']');
|
|
19
16
|
});
|
|
20
17
|
}
|
|
21
|
-
else if (
|
|
22
|
-
|
|
18
|
+
else if (isObject(data) && Object.keys(data).length) {
|
|
19
|
+
iterate(data, (v, i) => {
|
|
23
20
|
if (i in data) {
|
|
24
21
|
appendFormData(v, !key ? i : key + '[' + i + ']');
|
|
25
22
|
}
|
|
26
23
|
});
|
|
27
24
|
}
|
|
28
25
|
else {
|
|
29
|
-
if (!
|
|
26
|
+
if (!isNull(data) && data !== undefined) {
|
|
30
27
|
formData.append(key, data);
|
|
31
28
|
}
|
|
32
29
|
}
|
|
@@ -35,4 +32,4 @@ const objectToFormData = function (obj, key = '', ignoreList) {
|
|
|
35
32
|
appendFormData(obj, key);
|
|
36
33
|
return formData;
|
|
37
34
|
};
|
|
38
|
-
|
|
35
|
+
export { objectToFormData };
|