@bbn/bbn 1.0.30 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +8 -8
- package/dist/bundle.js +11 -11
- 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 +10 -15
- 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.d.ts +1 -1
- package/dist/fn/dateSQL.js +3 -7
- package/dist/fn/daysInMonth.d.ts +1 -1
- package/dist/fn/daysInMonth.js +3 -7
- package/dist/fn/deepPath.js +7 -10
- package/dist/fn/defaultAjaxAbortFunction.js +3 -6
- package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
- 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 +9 -13
- package/dist/fn/fdatetime.js +7 -11
- 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.d.ts +1 -1
- package/dist/fn/formatDate.js +1 -5
- 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 +8 -13
- 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 +31 -35
- 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 +6 -10
- package/dist/fn/warning.js +3 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.js +459 -471
- package/package.json +1 -1
package/dist/fn/outerHeight.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.outerHeight = void 0;
|
|
4
|
-
const selector_1 = require("./selector");
|
|
1
|
+
import { selector } from './selector';
|
|
5
2
|
const outerHeight = function (ele) {
|
|
6
|
-
ele =
|
|
3
|
+
ele = selector(ele);
|
|
7
4
|
if (ele && ('offsetHeight' in ele)) {
|
|
8
5
|
let styles = window.getComputedStyle(ele);
|
|
9
6
|
let margin = parseFloat(styles['marginTop']) + parseFloat(styles['marginBottom']);
|
|
10
7
|
return Math.ceil(ele.offsetHeight + margin);
|
|
11
8
|
}
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { outerHeight };
|
package/dist/fn/outerWidth.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.outerWidth = void 0;
|
|
4
|
-
const selector_1 = require("./selector");
|
|
1
|
+
import { selector } from './selector';
|
|
5
2
|
const outerWidth = function (ele) {
|
|
6
|
-
ele =
|
|
3
|
+
ele = selector(ele);
|
|
7
4
|
let styles = window.getComputedStyle(ele);
|
|
8
5
|
let margin = parseFloat(styles['marginLeft']) + parseFloat(styles['marginRight']);
|
|
9
6
|
return Math.ceil(ele.offsetWidth + margin);
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { outerWidth };
|
package/dist/fn/percent.js
CHANGED
package/dist/fn/pickValue.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pickValue = void 0;
|
|
4
1
|
const pickValue = function (arr) {
|
|
5
2
|
if (Array.isArray(arr) && arr.length) {
|
|
6
3
|
return arr[Math.floor(Math.random() * arr.length)];
|
|
7
4
|
}
|
|
8
5
|
};
|
|
9
|
-
|
|
6
|
+
export { pickValue };
|
package/dist/fn/post.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const treatAjaxArguments_1 = require("./treatAjaxArguments");
|
|
5
|
-
const ajax_1 = require("./ajax");
|
|
6
|
-
const callback_1 = require("./callback");
|
|
1
|
+
import { treatAjaxArguments } from './treatAjaxArguments';
|
|
2
|
+
import { ajax } from './ajax';
|
|
3
|
+
import { callback } from './callback';
|
|
7
4
|
const post = function (...args) {
|
|
8
|
-
let cfg =
|
|
5
|
+
let cfg = treatAjaxArguments(args);
|
|
9
6
|
if (cfg.url) {
|
|
10
|
-
return
|
|
11
|
-
|
|
7
|
+
return ajax(cfg.url, cfg.datatype, cfg.obj, (res) => {
|
|
8
|
+
callback(cfg.url, res, cfg.successFn, null, cfg.ele);
|
|
12
9
|
}, cfg.errorFn, cfg.abortFn);
|
|
13
10
|
}
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { post };
|
package/dist/fn/postOut.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.postOut = void 0;
|
|
4
|
-
const createObject_1 = require("./createObject");
|
|
5
|
-
const addInputs_1 = require("./addInputs");
|
|
1
|
+
import { createObject } from './createObject';
|
|
2
|
+
import { addInputs } from './addInputs';
|
|
6
3
|
const postOut = function (url, data, success, target) {
|
|
7
4
|
let form = document.body.querySelector('form#bbn-form_out');
|
|
8
5
|
if (!form) {
|
|
@@ -20,14 +17,14 @@ const postOut = function (url, data, success, target) {
|
|
|
20
17
|
if (!data) {
|
|
21
18
|
data = {};
|
|
22
19
|
}
|
|
23
|
-
data =
|
|
20
|
+
data = createObject(data);
|
|
24
21
|
if (!data.bbn) {
|
|
25
22
|
data.bbn = 'public';
|
|
26
23
|
}
|
|
27
|
-
|
|
24
|
+
addInputs(form, data);
|
|
28
25
|
form.submit();
|
|
29
26
|
if (success) {
|
|
30
27
|
success();
|
|
31
28
|
}
|
|
32
29
|
};
|
|
33
|
-
|
|
30
|
+
export { postOut };
|
package/dist/fn/printf.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.printf = void 0;
|
|
4
1
|
const printf = function (format) {
|
|
5
2
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
6
3
|
return format.replace(/{(\d+)}/g, function (match, number) {
|
|
7
4
|
return typeof args[number] != 'undefined' ? args[number] : match;
|
|
8
5
|
});
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { printf };
|
package/dist/fn/quotes2html.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.quotes2html = void 0;
|
|
4
|
-
const replaceAll_1 = require("./replaceAll");
|
|
1
|
+
import { replaceAll } from './replaceAll';
|
|
5
2
|
const quotes2html = function (st, type) {
|
|
6
3
|
if (!type || type.toLowerCase().indexOf('s') === 0) {
|
|
7
|
-
st =
|
|
4
|
+
st = replaceAll("'", ''', st);
|
|
8
5
|
}
|
|
9
6
|
if (!type || type.toLowerCase().indexOf('d') === 0) {
|
|
10
|
-
st =
|
|
7
|
+
st = replaceAll('"', '"', st);
|
|
11
8
|
}
|
|
12
9
|
return st;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { quotes2html };
|
package/dist/fn/randomInt.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.randomInt = void 0;
|
|
4
1
|
const randomInt = function (min, max) {
|
|
5
2
|
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { randomInt };
|
package/dist/fn/randomString.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.randomString = void 0;
|
|
4
|
-
const randomInt_1 = require("./randomInt");
|
|
1
|
+
import { randomInt } from './randomInt';
|
|
5
2
|
const randomString = function (min, max, types) {
|
|
6
3
|
let length;
|
|
7
4
|
let type;
|
|
@@ -14,7 +11,7 @@ const randomString = function (min, max, types) {
|
|
|
14
11
|
types = 'nlu';
|
|
15
12
|
}
|
|
16
13
|
if (!min) {
|
|
17
|
-
length =
|
|
14
|
+
length = randomInt(8, 14);
|
|
18
15
|
}
|
|
19
16
|
if (typeof max === 'string') {
|
|
20
17
|
types = 'n';
|
|
@@ -26,7 +23,7 @@ const randomString = function (min, max, types) {
|
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
25
|
else if (typeof max === 'number' && min < max) {
|
|
29
|
-
length =
|
|
26
|
+
length = randomInt(min, max);
|
|
30
27
|
}
|
|
31
28
|
else if (min) {
|
|
32
29
|
length = min;
|
|
@@ -46,4 +43,4 @@ const randomString = function (min, max, types) {
|
|
|
46
43
|
}
|
|
47
44
|
return result;
|
|
48
45
|
};
|
|
49
|
-
|
|
46
|
+
export { randomString };
|
package/dist/fn/removeAccents.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.removeAccents = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
5
|
-
const log_1 = require("./log");
|
|
1
|
+
import { isString } from './isString';
|
|
2
|
+
import { log } from './log';
|
|
6
3
|
const removeAccents = function (st) {
|
|
7
|
-
if (!
|
|
4
|
+
if (!isString(st)) {
|
|
8
5
|
if (st.toString) {
|
|
9
6
|
st = st.toString();
|
|
10
7
|
}
|
|
11
8
|
else {
|
|
12
|
-
|
|
9
|
+
log(st);
|
|
13
10
|
throw new Error(bbn._('removeAccent expects a string'));
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
return st.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
17
14
|
};
|
|
18
|
-
|
|
15
|
+
export { removeAccents };
|
package/dist/fn/removeEmpty.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const isArray_1 = require("./isArray");
|
|
5
|
-
const isObject_1 = require("./isObject");
|
|
6
|
-
const numProperties_1 = require("./numProperties");
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { isObject } from './isObject';
|
|
3
|
+
import { numProperties } from './numProperties';
|
|
7
4
|
const removeEmpty = function (arr) {
|
|
8
5
|
var tmp = [];
|
|
9
|
-
if (
|
|
6
|
+
if (isArray(arr)) {
|
|
10
7
|
for (let i = 0; i < arr.length; i++) {
|
|
11
8
|
let ok = false;
|
|
12
9
|
if (arr[i]) {
|
|
13
|
-
if (
|
|
10
|
+
if (isArray(arr[i])) {
|
|
14
11
|
if (arr[i].length) {
|
|
15
12
|
ok = true;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
else if (
|
|
19
|
-
if (
|
|
15
|
+
else if (isObject(arr[i])) {
|
|
16
|
+
if (numProperties(arr[i])) {
|
|
20
17
|
ok = true;
|
|
21
18
|
}
|
|
22
19
|
}
|
|
@@ -31,4 +28,4 @@ const removeEmpty = function (arr) {
|
|
|
31
28
|
}
|
|
32
29
|
return tmp;
|
|
33
30
|
};
|
|
34
|
-
|
|
31
|
+
export { removeEmpty };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeExtraSpaces = void 0;
|
|
4
1
|
const removeExtraSpaces = function (str) {
|
|
5
2
|
return str.replace(/\s+/g, ' ').trim();
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { removeExtraSpaces };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeHtmlComments = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const removeHtmlComments = function (str) {
|
|
6
|
-
if (!
|
|
3
|
+
if (!isString(str)) {
|
|
7
4
|
return str;
|
|
8
5
|
}
|
|
9
6
|
return str.replace(/<!--[\s\S]*?-->/g, '');
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { removeHtmlComments };
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removePrivateProp = void 0;
|
|
4
|
-
const substr_1 = require("./substr");
|
|
1
|
+
import { substr } from './substr';
|
|
5
2
|
const removePrivateProp = function (obj, deep = false) {
|
|
6
3
|
let r = null;
|
|
7
4
|
if (typeof obj === 'object') {
|
|
8
5
|
r = {};
|
|
9
6
|
for (var n in obj) {
|
|
10
|
-
if (
|
|
7
|
+
if (substr(n, 0, 1).match(/^[A-z0-9]$/) && (n in obj)) {
|
|
11
8
|
if (deep && typeof obj[n] === 'object') {
|
|
12
9
|
r[n] = removePrivateProp(obj[n], true);
|
|
13
10
|
}
|
|
@@ -19,4 +16,4 @@ const removePrivateProp = function (obj, deep = false) {
|
|
|
19
16
|
}
|
|
20
17
|
return r || false;
|
|
21
18
|
};
|
|
22
|
-
|
|
19
|
+
export { removePrivateProp };
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeTrailingChars = void 0;
|
|
4
|
-
const substr_1 = require("./substr");
|
|
1
|
+
import { substr } from './substr';
|
|
5
2
|
const removeTrailingChars = function (st, char) {
|
|
6
3
|
if (!char) {
|
|
7
4
|
char = ' ';
|
|
8
5
|
}
|
|
9
6
|
if (char.length) {
|
|
10
|
-
while (
|
|
11
|
-
st =
|
|
7
|
+
while (substr(st, -char.length) === char) {
|
|
8
|
+
st = substr(st, 0, st.length - char.length);
|
|
12
9
|
}
|
|
13
|
-
while (
|
|
14
|
-
st =
|
|
10
|
+
while (substr(st, 0, char.length) === char) {
|
|
11
|
+
st = substr(st, char.length);
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
return st;
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
export { removeTrailingChars };
|
package/dist/fn/repeat.js
CHANGED
package/dist/fn/replaceAll.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.replaceAll = void 0;
|
|
4
|
-
const isObject_1 = require("./isObject");
|
|
5
|
-
const escapeRegExp_1 = require("./escapeRegExp");
|
|
1
|
+
import { isObject } from './isObject';
|
|
2
|
+
import { escapeRegExp } from './escapeRegExp';
|
|
6
3
|
const replaceAll = function (find, replace, str, flags = '') {
|
|
7
|
-
return str.toString().replace(
|
|
4
|
+
return str.toString().replace(isObject(find) ? find : new RegExp(escapeRegExp(find), 'g' + flags), replace);
|
|
8
5
|
};
|
|
9
|
-
|
|
6
|
+
export { replaceAll };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.replaceSelection = void 0;
|
|
4
1
|
const replaceSelection = function (html, selectInserted) {
|
|
5
2
|
let sel, range, fragment;
|
|
6
3
|
sel = window.getSelection();
|
|
@@ -42,4 +39,4 @@ const replaceSelection = function (html, selectInserted) {
|
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
41
|
};
|
|
45
|
-
|
|
42
|
+
export { replaceSelection };
|
package/dist/fn/resize.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const getCssVar_1 = require("./getCssVar");
|
|
5
|
-
const each_1 = require("./each");
|
|
6
|
-
const defaultResizeFunction_1 = require("./defaultResizeFunction");
|
|
1
|
+
import { getCssVar } from './getCssVar';
|
|
2
|
+
import { each } from './each';
|
|
3
|
+
import { defaultResizeFunction } from './defaultResizeFunction';
|
|
7
4
|
const resize = function () {
|
|
8
5
|
let diffW = bbn.env.width !== window.innerWidth;
|
|
9
6
|
let diffH = bbn.env.height !== window.innerHeight;
|
|
@@ -18,11 +15,11 @@ const resize = function () {
|
|
|
18
15
|
window.innerHeight || window.document.documentElement.clientHeight || window.document.body.clientHeight;
|
|
19
16
|
document.documentElement.style.setProperty('--vh', bbn.env.height * 0.01 + 'px');
|
|
20
17
|
}
|
|
21
|
-
let smallWidth = parseInt(
|
|
18
|
+
let smallWidth = parseInt(getCssVar('mobile-limit')) || 650;
|
|
22
19
|
let newCls = 'bbn-screen-' + (bbn.env.width < smallWidth ? 'small' : 'regular');
|
|
23
20
|
let classes = (document.body.className || '').split(' ');
|
|
24
21
|
let done = false;
|
|
25
|
-
|
|
22
|
+
each(classes, (cls, idx) => {
|
|
26
23
|
let bits = cls.split('-');
|
|
27
24
|
if (bits.length === 3 && cls.indexOf('bbn-screen-') === 0) {
|
|
28
25
|
done = true;
|
|
@@ -36,7 +33,7 @@ const resize = function () {
|
|
|
36
33
|
classes.push(newCls);
|
|
37
34
|
}
|
|
38
35
|
document.body.className = classes.join(' ');
|
|
39
|
-
|
|
36
|
+
defaultResizeFunction();
|
|
40
37
|
}
|
|
41
38
|
};
|
|
42
|
-
|
|
39
|
+
export { resize };
|
package/dist/fn/rgb2hex.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rgb2hex = void 0;
|
|
4
1
|
const rgb2hex = function (rgb) {
|
|
5
2
|
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
|
6
3
|
return rgb && rgb.length === 4
|
|
@@ -10,4 +7,4 @@ const rgb2hex = function (rgb) {
|
|
|
10
7
|
('0' + parseInt(rgb[3], 10).toString(16)).slice(-2)
|
|
11
8
|
: '';
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { rgb2hex };
|
package/dist/fn/riterate.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.riterate = void 0;
|
|
4
|
-
const iterate_1 = require("./iterate");
|
|
1
|
+
import { iterate } from './iterate';
|
|
5
2
|
const riterate = function (obj, fn, noPrivate) {
|
|
6
|
-
return
|
|
3
|
+
return iterate(obj, fn, noPrivate, true);
|
|
7
4
|
};
|
|
8
|
-
|
|
5
|
+
export { riterate };
|
package/dist/fn/roundDecimal.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.roundDecimal = void 0;
|
|
4
1
|
const roundDecimal = function (value, decimals) {
|
|
5
2
|
return Math.round(Math.pow(Math.pow(value, decimals), -decimals));
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { roundDecimal };
|
package/dist/fn/sanitize.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.sanitize = void 0;
|
|
4
|
-
const removeAccents_1 = require("./removeAccents");
|
|
5
|
-
const trim_1 = require("./trim");
|
|
1
|
+
import { removeAccents } from './removeAccents';
|
|
2
|
+
import { trim } from './trim';
|
|
6
3
|
const sanitize = function (str, separator = '_') {
|
|
7
4
|
let escaped = ['[', ']', '{', '}', '(', ')', '-', '+', '*', '/'];
|
|
8
5
|
let exp = '[';
|
|
@@ -14,9 +11,9 @@ const sanitize = function (str, separator = '_') {
|
|
|
14
11
|
}
|
|
15
12
|
exp += ']+';
|
|
16
13
|
let re = new RegExp(exp, 'g');
|
|
17
|
-
let res =
|
|
14
|
+
let res = removeAccents(str)
|
|
18
15
|
.replace(/[^a-z0-9]/gi, separator)
|
|
19
16
|
.replace(re, separator);
|
|
20
|
-
return
|
|
17
|
+
return trim(res, separator);
|
|
21
18
|
};
|
|
22
|
-
|
|
19
|
+
export { sanitize };
|
package/dist/fn/search.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const isObject_1 = require("./isObject");
|
|
8
|
-
const numProperties_1 = require("./numProperties");
|
|
9
|
-
const isNumber_1 = require("./isNumber");
|
|
1
|
+
import { isIterable } from './isIterable';
|
|
2
|
+
import { compareConditions } from './compareConditions';
|
|
3
|
+
import { filterToConditions } from './filterToConditions';
|
|
4
|
+
import { isObject } from './isObject';
|
|
5
|
+
import { numProperties } from './numProperties';
|
|
6
|
+
import { isNumber } from './isNumber';
|
|
10
7
|
const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
11
|
-
if (!
|
|
8
|
+
if (!isIterable(arr)) {
|
|
12
9
|
throw new Error(bbn._('The first argument for a search should be iterable') + ' ' + typeof arr + ' ' + bbn._('given'));
|
|
13
10
|
}
|
|
14
11
|
if (!arr.length) {
|
|
@@ -30,7 +27,7 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
|
30
27
|
else if (!prop) {
|
|
31
28
|
isFn = true;
|
|
32
29
|
filter = a => {
|
|
33
|
-
return
|
|
30
|
+
return compareConditions({ value: a }, filterToConditions({
|
|
34
31
|
logic: 'AND',
|
|
35
32
|
conditions: [
|
|
36
33
|
{
|
|
@@ -45,7 +42,7 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
|
45
42
|
else {
|
|
46
43
|
startFrom = typeof (operator) === 'number' ? operator : 0;
|
|
47
44
|
operator = val;
|
|
48
|
-
if (
|
|
45
|
+
if (isObject(prop)) {
|
|
49
46
|
filter = prop;
|
|
50
47
|
}
|
|
51
48
|
else if (typeof (prop) === 'function') {
|
|
@@ -53,12 +50,12 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
|
53
50
|
filter = prop;
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
|
-
if (isFn || (
|
|
57
|
-
if (
|
|
53
|
+
if (isFn || (isObject(filter) && numProperties(filter))) {
|
|
54
|
+
if (isNumber(operator)) {
|
|
58
55
|
startFrom = typeof (operator) === 'number' ? operator : 0;
|
|
59
56
|
operator = undefined;
|
|
60
57
|
}
|
|
61
|
-
if (!
|
|
58
|
+
if (!isNumber(startFrom)) {
|
|
62
59
|
startFrom = 0;
|
|
63
60
|
}
|
|
64
61
|
if (typeof filter === 'function') {
|
|
@@ -69,9 +66,9 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
|
69
66
|
}
|
|
70
67
|
}
|
|
71
68
|
else {
|
|
72
|
-
filter =
|
|
69
|
+
filter = filterToConditions(filter);
|
|
73
70
|
for (let i = startFrom; i < arr.length; i++) {
|
|
74
|
-
if (
|
|
71
|
+
if (compareConditions(arr[i], filter)) {
|
|
75
72
|
return i;
|
|
76
73
|
}
|
|
77
74
|
}
|
|
@@ -79,4 +76,4 @@ const search = function (arr, prop, val = null, operator = '=', startFrom = 0) {
|
|
|
79
76
|
}
|
|
80
77
|
return -1;
|
|
81
78
|
};
|
|
82
|
-
|
|
79
|
+
export { search };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectElementText = void 0;
|
|
4
1
|
const selectElementText = function (ele, win) {
|
|
5
2
|
win = win || window;
|
|
6
3
|
if (ele instanceof HTMLInputElement) {
|
|
@@ -23,4 +20,4 @@ const selectElementText = function (ele, win) {
|
|
|
23
20
|
range.select();
|
|
24
21
|
}
|
|
25
22
|
};
|
|
26
|
-
|
|
23
|
+
export { selectElementText };
|
package/dist/fn/selector.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selector = void 0;
|
|
4
1
|
const selector = function (ele) {
|
|
5
2
|
return typeof ele === 'string' ? document.querySelector(ele) : ele;
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { selector };
|
package/dist/fn/setCookie.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setCookie = void 0;
|
|
4
1
|
const setCookie = function (name, value, days) {
|
|
5
2
|
let expires = '';
|
|
6
3
|
if (days) {
|
|
@@ -11,4 +8,4 @@ const setCookie = function (name, value, days) {
|
|
|
11
8
|
let st = escape(JSON.stringify({ value: value }));
|
|
12
9
|
document.cookie = name + '=' + st + expires + '; path=/';
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { setCookie };
|
package/dist/fn/setCssVar.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setCssVar = void 0;
|
|
4
1
|
const setCssVar = function (varname, value) {
|
|
5
2
|
if (varname.indexOf('--') !== 0) {
|
|
6
3
|
varname = '--' + varname;
|
|
@@ -8,4 +5,4 @@ const setCssVar = function (varname, value) {
|
|
|
8
5
|
/** @todo To Fix */
|
|
9
6
|
//document.documentElement.setProperty(varname, value);
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { setCssVar };
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const filter_1 = require("./filter");
|
|
6
|
-
const extend_1 = require("./extend");
|
|
7
|
-
const html2text_1 = require("./html2text");
|
|
1
|
+
import { substr } from './substr';
|
|
2
|
+
import { filter } from './filter';
|
|
3
|
+
import { extend } from './extend';
|
|
4
|
+
import { html2text } from './html2text';
|
|
8
5
|
const setNavigationVars = function (url, title, data, repl) {
|
|
9
6
|
// Current path becomes old path
|
|
10
7
|
bbn.env.old_path = bbn.env.path;
|
|
11
8
|
// URL includes the domain
|
|
12
|
-
bbn.env.url = ['https:/', 'http://'].includes(
|
|
9
|
+
bbn.env.url = ['https:/', 'http://'].includes(substr(url, 0, 7)) ? url : bbn.env.root + url;
|
|
13
10
|
// Path does not
|
|
14
|
-
bbn.env.path =
|
|
11
|
+
bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
|
|
15
12
|
// Params will include each part of the URL
|
|
16
|
-
bbn.env.params =
|
|
13
|
+
bbn.env.params = filter(bbn.env.path.split('/'), (v) => {
|
|
17
14
|
return v !== '';
|
|
18
15
|
});
|
|
19
16
|
// Managing history
|
|
@@ -31,7 +28,7 @@ const setNavigationVars = function (url, title, data, repl) {
|
|
|
31
28
|
// If same URL we replace
|
|
32
29
|
if (state && state.url === bbn.env.path) {
|
|
33
30
|
if (state.data) {
|
|
34
|
-
|
|
31
|
+
extend(obj.data, state.data);
|
|
35
32
|
}
|
|
36
33
|
if (state.title && !title) {
|
|
37
34
|
title = state.title;
|
|
@@ -44,7 +41,7 @@ const setNavigationVars = function (url, title, data, repl) {
|
|
|
44
41
|
}
|
|
45
42
|
// Otherwise we add the global title at the end
|
|
46
43
|
else {
|
|
47
|
-
title =
|
|
44
|
+
title = html2text(title);
|
|
48
45
|
}
|
|
49
46
|
// Replacing state
|
|
50
47
|
if (repl) {
|
|
@@ -57,4 +54,4 @@ const setNavigationVars = function (url, title, data, repl) {
|
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
56
|
};
|
|
60
|
-
|
|
57
|
+
export { setNavigationVars };
|