@bbn/bbn 1.0.30 → 1.0.32
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 +12 -12
- 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/getAttributes.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAttributes = void 0;
|
|
4
|
-
const error_1 = require("./error");
|
|
1
|
+
import { error } from './error';
|
|
5
2
|
const getAttributes = function (ele) {
|
|
6
3
|
if (!ele.getAttributeNames) {
|
|
7
|
-
|
|
4
|
+
error('The element is not a proper HTML Element');
|
|
8
5
|
}
|
|
9
6
|
let res = Object.create(null);
|
|
10
7
|
ele.getAttributeNames().forEach((name) => {
|
|
@@ -12,4 +9,4 @@ const getAttributes = function (ele) {
|
|
|
12
9
|
});
|
|
13
10
|
return res;
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { getAttributes };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBrowserName = void 0;
|
|
4
1
|
const getBrowserName = function () {
|
|
5
2
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
6
3
|
switch (true) {
|
|
@@ -21,4 +18,4 @@ const getBrowserName = function () {
|
|
|
21
18
|
return 'Other';
|
|
22
19
|
}
|
|
23
20
|
};
|
|
24
|
-
|
|
21
|
+
export { getBrowserName };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getBrowserVersion = void 0;
|
|
4
1
|
const getBrowserVersion = function () {
|
|
5
2
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
6
3
|
switch (true) {
|
|
@@ -22,4 +19,4 @@ const getBrowserVersion = function () {
|
|
|
22
19
|
return '';
|
|
23
20
|
}
|
|
24
21
|
};
|
|
25
|
-
|
|
22
|
+
export { getBrowserVersion };
|
package/dist/fn/getCookie.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCookie = void 0;
|
|
4
1
|
const getCookie = function (name) {
|
|
5
2
|
let nameEqual = name + '=';
|
|
6
3
|
let ca = document.cookie.split(';');
|
|
@@ -18,4 +15,4 @@ const getCookie = function (name) {
|
|
|
18
15
|
}
|
|
19
16
|
return null;
|
|
20
17
|
};
|
|
21
|
-
|
|
18
|
+
export { getCookie };
|
package/dist/fn/getCssVar.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCssVar = void 0;
|
|
4
1
|
const getCssVar = function (varname) {
|
|
5
2
|
if (varname.indexOf('--') !== 0) {
|
|
6
3
|
varname = '--' + varname;
|
|
7
4
|
}
|
|
8
5
|
return getComputedStyle(document.documentElement).getPropertyValue(varname);
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { getCssVar };
|
package/dist/fn/getDay.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDay = void 0;
|
|
4
|
-
const date_1 = require("./date");
|
|
1
|
+
import { date } from './date';
|
|
5
2
|
const getDay = function (v) {
|
|
6
3
|
const biss = 1972;
|
|
7
|
-
let d =
|
|
4
|
+
let d = date(v);
|
|
8
5
|
if (d) {
|
|
9
6
|
let t = d.getTime(), y = d.getYear(), m = d.getMonth(), days = (y - 1970) * 365;
|
|
10
7
|
if (m < 2) {
|
|
@@ -17,4 +14,4 @@ const getDay = function (v) {
|
|
|
17
14
|
}
|
|
18
15
|
return false;
|
|
19
16
|
};
|
|
20
|
-
|
|
17
|
+
export { getDay };
|
package/dist/fn/getDeviceType.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDeviceType = void 0;
|
|
4
1
|
const getDeviceType = function () {
|
|
5
2
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
6
3
|
if (/iPhone|Android/i.test(navigator.userAgent)) {
|
|
@@ -11,4 +8,4 @@ const getDeviceType = function () {
|
|
|
11
8
|
}
|
|
12
9
|
return 'desktop';
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { getDeviceType };
|
package/dist/fn/getEventData.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const getHTMLOfSelection_1 = require("./getHTMLOfSelection");
|
|
5
|
-
const each_1 = require("./each");
|
|
6
|
-
const defaultErrorFunction_1 = require("./defaultErrorFunction");
|
|
1
|
+
import { getHTMLOfSelection } from './getHTMLOfSelection';
|
|
2
|
+
import { each } from './each';
|
|
3
|
+
import { defaultErrorFunction } from './defaultErrorFunction';
|
|
7
4
|
const getEventData = function (e) {
|
|
8
5
|
let dt = e.dataTransfer || e.clipboardData;
|
|
9
6
|
let t = dt.getData('Text');
|
|
@@ -13,7 +10,7 @@ const getEventData = function (e) {
|
|
|
13
10
|
if (!t && e.type === 'copy') {
|
|
14
11
|
let sel = window.getSelection();
|
|
15
12
|
res.raw = sel.toString();
|
|
16
|
-
let html =
|
|
13
|
+
let html = getHTMLOfSelection();
|
|
17
14
|
res.str.push({
|
|
18
15
|
type: 'text/plain',
|
|
19
16
|
data: res.raw,
|
|
@@ -38,7 +35,7 @@ const getEventData = function (e) {
|
|
|
38
35
|
if (!done) {
|
|
39
36
|
let strings = [];
|
|
40
37
|
let num = dt.items.length;
|
|
41
|
-
|
|
38
|
+
each(dt.items, (item, idx) => {
|
|
42
39
|
let kind = item.kind;
|
|
43
40
|
let type = item.type;
|
|
44
41
|
if (kind === 'file') {
|
|
@@ -70,7 +67,7 @@ const getEventData = function (e) {
|
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
69
|
else {
|
|
73
|
-
|
|
70
|
+
defaultErrorFunction(bbn._('Impossible to read the file') + ' ' + name);
|
|
74
71
|
}
|
|
75
72
|
}
|
|
76
73
|
else {
|
|
@@ -102,4 +99,4 @@ const getEventData = function (e) {
|
|
|
102
99
|
});
|
|
103
100
|
return p;
|
|
104
101
|
};
|
|
105
|
-
|
|
102
|
+
export { getEventData };
|
package/dist/fn/getField.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getField = void 0;
|
|
4
|
-
const getRow_1 = require("./getRow");
|
|
1
|
+
import { getRow } from './getRow';
|
|
5
2
|
const getField = function (arr, field, prop = '', val = null, operator = '=') {
|
|
6
3
|
let r;
|
|
7
|
-
if (field && (r =
|
|
4
|
+
if (field && (r = getRow(arr, prop, val, operator))) {
|
|
8
5
|
return r[field];
|
|
9
6
|
}
|
|
10
7
|
return undefined;
|
|
11
8
|
};
|
|
12
|
-
|
|
9
|
+
export { getField };
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const checkType_1 = require("./checkType");
|
|
5
|
-
const filter_1 = require("./filter");
|
|
6
|
-
const each_1 = require("./each");
|
|
1
|
+
import { checkType } from './checkType';
|
|
2
|
+
import { filter } from './filter';
|
|
3
|
+
import { each } from './each';
|
|
7
4
|
const getFieldValues = function (arr, field, prop, val, operator) {
|
|
8
|
-
|
|
5
|
+
checkType(field, 'string');
|
|
9
6
|
if (prop) {
|
|
10
|
-
arr =
|
|
7
|
+
arr = filter(arr, prop, val, operator);
|
|
11
8
|
}
|
|
12
9
|
let res = [];
|
|
13
|
-
|
|
10
|
+
each(arr, (a) => (res.indexOf(a[field]) === -1 ? res.push(a[field]) : null));
|
|
14
11
|
return res;
|
|
15
12
|
};
|
|
16
|
-
|
|
13
|
+
export { getFieldValues };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHTMLOfSelection = void 0;
|
|
4
|
-
const log_1 = require("./log");
|
|
1
|
+
import { log } from './log';
|
|
5
2
|
const getHTMLOfSelection = function () {
|
|
6
3
|
let range;
|
|
7
4
|
let selection = window.getSelection();
|
|
8
5
|
if (selection.rangeCount > 0) {
|
|
9
6
|
range = selection.getRangeAt(0);
|
|
10
|
-
|
|
7
|
+
log('RANGE', range);
|
|
11
8
|
let clonedSelection = range.cloneContents();
|
|
12
|
-
|
|
9
|
+
log('clonedSelection', clonedSelection);
|
|
13
10
|
let div = document.createElement('div');
|
|
14
11
|
div.appendChild(clonedSelection);
|
|
15
12
|
return div.innerHTML;
|
|
@@ -18,4 +15,4 @@ const getHTMLOfSelection = function () {
|
|
|
18
15
|
return '';
|
|
19
16
|
}
|
|
20
17
|
};
|
|
21
|
-
|
|
18
|
+
export { getHTMLOfSelection };
|
package/dist/fn/getHtml.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHtml = void 0;
|
|
4
|
-
const removeHtmlComments_1 = require("./removeHtmlComments");
|
|
1
|
+
import { removeHtmlComments } from './removeHtmlComments';
|
|
5
2
|
const getHtml = function (ele, stripComments = false) {
|
|
6
3
|
let st = ele.innerHTML();
|
|
7
4
|
if (stripComments) {
|
|
8
|
-
st =
|
|
5
|
+
st = removeHtmlComments(st);
|
|
9
6
|
}
|
|
10
7
|
return st.trim();
|
|
11
8
|
};
|
|
12
|
-
|
|
9
|
+
export { getHtml };
|
package/dist/fn/getLoader.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLoader = void 0;
|
|
4
|
-
const search_1 = require("./search");
|
|
1
|
+
import { search } from './search';
|
|
5
2
|
const getLoader = function (requestId) {
|
|
6
|
-
let idx =
|
|
3
|
+
let idx = search(bbn.env.loaders, { key: requestId });
|
|
7
4
|
if (idx > -1) {
|
|
8
5
|
return bbn.env.loaders[idx];
|
|
9
6
|
}
|
|
10
7
|
return false;
|
|
11
8
|
};
|
|
12
|
-
|
|
9
|
+
export { getLoader };
|
package/dist/fn/getPath.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPath = void 0;
|
|
4
|
-
const replaceAll_1 = require("./replaceAll");
|
|
1
|
+
import { replaceAll } from './replaceAll';
|
|
5
2
|
const getPath = function (element) {
|
|
6
3
|
let path,
|
|
7
4
|
//node = $(element),
|
|
@@ -18,7 +15,7 @@ const getPath = function (element) {
|
|
|
18
15
|
}
|
|
19
16
|
if (!done) {
|
|
20
17
|
if (realNode.className && realNode.className !== ' ') {
|
|
21
|
-
name += '.' +
|
|
18
|
+
name += '.' + replaceAll(' ', '.', replaceAll(' ', ' ', realNode.className));
|
|
22
19
|
}
|
|
23
20
|
done = 1;
|
|
24
21
|
}
|
|
@@ -42,4 +39,4 @@ const getPath = function (element) {
|
|
|
42
39
|
}
|
|
43
40
|
return path;
|
|
44
41
|
};
|
|
45
|
-
|
|
42
|
+
export { getPath };
|
package/dist/fn/getProp.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProp = void 0;
|
|
4
|
-
const checkType_1 = require("./checkType");
|
|
1
|
+
import { checkType } from './checkType';
|
|
5
2
|
const getProp = function (obj, prop) {
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
checkType(obj, 'object', bbn._('The obj must be an object in setProp'));
|
|
4
|
+
checkType(prop, 'string', bbn._('The prop must be a string in setProp'));
|
|
8
5
|
return obj[prop];
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { getProp };
|
package/dist/fn/getProperty.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getProperty = void 0;
|
|
4
1
|
const getProperty = function (obj, prop) {
|
|
5
2
|
if (typeof obj === 'object' && typeof prop === 'string') {
|
|
6
3
|
return prop.split('.').reduce((o, i) => {
|
|
@@ -11,4 +8,4 @@ const getProperty = function (obj, prop) {
|
|
|
11
8
|
}, obj);
|
|
12
9
|
}
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { getProperty };
|
package/dist/fn/getRequestId.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getRequestId = void 0;
|
|
4
|
-
const iterate_1 = require("./iterate");
|
|
5
|
-
const md5_1 = require("./md5");
|
|
1
|
+
import { iterate } from './iterate';
|
|
2
|
+
import { md5 } from './md5';
|
|
6
3
|
const getRequestId = function (url, data, datatype) {
|
|
7
4
|
let d = {};
|
|
8
5
|
if (data) {
|
|
9
|
-
|
|
6
|
+
iterate(data, (a, n) => {
|
|
10
7
|
if (n.indexOf('_bbn') === -1) {
|
|
11
8
|
d[n] = a;
|
|
12
9
|
}
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
|
-
return url + ':' +
|
|
12
|
+
return url + ':' + md5((datatype || 'json') + JSON.stringify(d));
|
|
16
13
|
};
|
|
17
|
-
|
|
14
|
+
export { getRequestId };
|
package/dist/fn/getRow.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRow = void 0;
|
|
4
|
-
const search_1 = require("./search");
|
|
1
|
+
import { search } from './search';
|
|
5
2
|
const getRow = function (arr, prop, val = null, operator = '=') {
|
|
6
|
-
var idx =
|
|
3
|
+
var idx = search(arr, prop, val, operator);
|
|
7
4
|
if (idx > -1) {
|
|
8
5
|
return arr[idx];
|
|
9
6
|
}
|
|
10
7
|
return false;
|
|
11
8
|
};
|
|
12
|
-
|
|
9
|
+
export { getRow };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getScrollBarSize = void 0;
|
|
4
1
|
const getScrollBarSize = function () {
|
|
5
2
|
if (bbn.env.scrollBarSize === undefined) {
|
|
6
3
|
let outer = document.createElement('div');
|
|
@@ -25,4 +22,4 @@ const getScrollBarSize = function () {
|
|
|
25
22
|
}
|
|
26
23
|
return bbn.env.scrollBarSize;
|
|
27
24
|
};
|
|
28
|
-
|
|
25
|
+
export { getScrollBarSize };
|
package/dist/fn/getText.js
CHANGED
package/dist/fn/getTimeoff.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTimeoff = void 0;
|
|
4
1
|
const getTimeoff = function () {
|
|
5
2
|
if (!bbn.env.isFocused) {
|
|
6
3
|
return Math.round(new Date().getTime() / 1000 - bbn.env.timeoff);
|
|
7
4
|
}
|
|
8
5
|
return 0;
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { getTimeoff };
|
package/dist/fn/happy.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.happy = void 0;
|
|
4
|
-
const log_1 = require("./log");
|
|
1
|
+
import { log } from './log';
|
|
5
2
|
const happy = function (...args) {
|
|
6
3
|
args.unshift({
|
|
7
4
|
_bbn_console_level: 3,
|
|
8
5
|
_bbn_console_style: 'color: white; background: green; font-size: 18px;',
|
|
9
6
|
});
|
|
10
|
-
|
|
7
|
+
log.apply(this, args);
|
|
11
8
|
return this;
|
|
12
9
|
};
|
|
13
|
-
|
|
10
|
+
export { happy };
|
package/dist/fn/hash.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const isCp_1 = require("./isCp");
|
|
7
|
-
const circularReplacer_1 = require("./circularReplacer");
|
|
8
|
-
const simpleHash_1 = require("./simpleHash");
|
|
1
|
+
import { log } from './log';
|
|
2
|
+
import { isDom } from './isDom';
|
|
3
|
+
import { isCp } from './isCp';
|
|
4
|
+
import { circularReplacer } from './circularReplacer';
|
|
5
|
+
import { simpleHash } from './simpleHash';
|
|
9
6
|
const hash = function (obj) {
|
|
10
7
|
//log(obj);
|
|
11
8
|
let st = '__bbn__';
|
|
12
9
|
for (let i in arguments) {
|
|
13
10
|
if (arguments[i]) {
|
|
14
11
|
let value = arguments[i];
|
|
15
|
-
if (
|
|
12
|
+
if (isDom(value)) {
|
|
16
13
|
if (value.bbnId) {
|
|
17
14
|
st += '__BBN_DOM__' + value.tagName + '/' + value.bbnId + value.bbnHash;
|
|
18
15
|
}
|
|
@@ -20,13 +17,13 @@ const hash = function (obj) {
|
|
|
20
17
|
st += '__BBN_DOM__' + value.tagName + '/' + value.className;
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
|
-
else if (
|
|
24
|
-
|
|
20
|
+
else if (isCp(value)) {
|
|
21
|
+
log('IS CP');
|
|
25
22
|
st += '__BBN_CP__' + value.$options.name + '/' + value.$cid;
|
|
26
23
|
}
|
|
27
24
|
else {
|
|
28
25
|
try {
|
|
29
|
-
st += JSON.stringify(arguments[i],
|
|
26
|
+
st += JSON.stringify(arguments[i], circularReplacer());
|
|
30
27
|
}
|
|
31
28
|
catch (e) {
|
|
32
29
|
st += '.';
|
|
@@ -34,6 +31,6 @@ const hash = function (obj) {
|
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
}
|
|
37
|
-
return
|
|
34
|
+
return simpleHash(st);
|
|
38
35
|
};
|
|
39
|
-
|
|
36
|
+
export { hash };
|
package/dist/fn/hex2rgb.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hex2rgb = void 0;
|
|
4
1
|
const hex2rgb = function (hex) {
|
|
5
2
|
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
6
3
|
return result
|
|
@@ -11,4 +8,4 @@ const hex2rgb = function (hex) {
|
|
|
11
8
|
}
|
|
12
9
|
: null;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { hex2rgb };
|
package/dist/fn/history.js
CHANGED
package/dist/fn/html2text.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.html2text = void 0;
|
|
4
1
|
const html2text = function (st) {
|
|
5
2
|
let $test = document.createElement('div');
|
|
6
3
|
$test.innerHTML = st;
|
|
7
4
|
st = $test.innerText;
|
|
8
5
|
return st;
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { html2text };
|
package/dist/fn/imageToCanvas.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.imageToCanvas = void 0;
|
|
4
1
|
const imageToCanvas = function (img) {
|
|
5
2
|
let canvas = document.createElement('canvas');
|
|
6
3
|
canvas.width = img.width;
|
|
@@ -8,4 +5,4 @@ const imageToCanvas = function (img) {
|
|
|
8
5
|
canvas.getContext('2d').drawImage(img, 0, 0);
|
|
9
6
|
return canvas;
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { imageToCanvas };
|
package/dist/fn/imgToBase64.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.imgToBase64 = void 0;
|
|
4
|
-
const imageToCanvas_1 = require("./imageToCanvas");
|
|
1
|
+
import { imageToCanvas } from './imageToCanvas';
|
|
5
2
|
const imgToBase64 = function (img, type = 'image/png') {
|
|
6
|
-
let canvas =
|
|
3
|
+
let canvas = imageToCanvas(img);
|
|
7
4
|
//return canvasToImage(canvas);
|
|
8
5
|
return canvas.toDataURL(type);
|
|
9
6
|
};
|
|
10
|
-
|
|
7
|
+
export { imgToBase64 };
|
package/dist/fn/info.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.info = void 0;
|
|
4
|
-
const log_1 = require("./log");
|
|
1
|
+
import { log } from './log';
|
|
5
2
|
const info = function (...args) {
|
|
6
3
|
args.unshift({
|
|
7
4
|
//_bbn_console_mode: "info",
|
|
8
5
|
_bbn_console_level: 4,
|
|
9
6
|
_bbn_console_style: 'color: #EEE; background: blue; font-size: 12px;',
|
|
10
7
|
});
|
|
11
|
-
|
|
8
|
+
log.apply(this, args);
|
|
12
9
|
return this;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { info };
|