@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/escapeDquotes.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeDquotes = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const escapeDquotes = function (str) {
|
|
6
|
-
if (!
|
|
3
|
+
if (!isString(str)) {
|
|
7
4
|
return str;
|
|
8
5
|
}
|
|
9
6
|
return str.replace(/"/g, '\\"');
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { escapeDquotes };
|
package/dist/fn/escapeRegExp.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeRegExp = void 0;
|
|
4
1
|
const escapeRegExp = function (str) {
|
|
5
2
|
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { escapeRegExp };
|
package/dist/fn/escapeSquotes.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeSquotes = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const escapeSquotes = function (str) {
|
|
6
|
-
if (!
|
|
3
|
+
if (!isString(str)) {
|
|
7
4
|
return str;
|
|
8
5
|
}
|
|
9
6
|
return str.replace(/'/g, "\\'");
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { escapeSquotes };
|
package/dist/fn/escapeTicks.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.escapeTicks = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const escapeTicks = function (str) {
|
|
6
|
-
if (!
|
|
3
|
+
if (!isString(str)) {
|
|
7
4
|
return str;
|
|
8
5
|
}
|
|
9
6
|
return str.replace(/`/g, '\\`');
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { escapeTicks };
|
package/dist/fn/escapeUrl.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const dirName_1 = require("./dirName");
|
|
6
|
-
const baseName_1 = require("./baseName");
|
|
7
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { each } from './each';
|
|
2
|
+
import { dirName } from './dirName';
|
|
3
|
+
import { baseName } from './baseName';
|
|
4
|
+
import { isString } from './isString';
|
|
8
5
|
const escapeUrl = function (url, params) {
|
|
9
6
|
let st = '';
|
|
10
7
|
if (url.match('^(http|https)://')) {
|
|
@@ -17,10 +14,10 @@ const escapeUrl = function (url, params) {
|
|
|
17
14
|
st += '://';
|
|
18
15
|
url = url.substring(3);
|
|
19
16
|
}
|
|
20
|
-
|
|
17
|
+
each(dirName(url).split('/'), (a) => {
|
|
21
18
|
st += encodeURIComponent(a) + '/';
|
|
22
19
|
});
|
|
23
|
-
let base =
|
|
20
|
+
let base = baseName(url);
|
|
24
21
|
let sep = '?';
|
|
25
22
|
let existingParams = '';
|
|
26
23
|
if (base.indexOf(sep)) {
|
|
@@ -29,7 +26,7 @@ const escapeUrl = function (url, params) {
|
|
|
29
26
|
existingParams = '?' + tmp[1];
|
|
30
27
|
base = tmp[0];
|
|
31
28
|
}
|
|
32
|
-
if (params &&
|
|
29
|
+
if (params && isString(params)) {
|
|
33
30
|
if (params.match('^(\\&|\\?)')) {
|
|
34
31
|
params = params.substring(1);
|
|
35
32
|
}
|
|
@@ -40,4 +37,4 @@ const escapeUrl = function (url, params) {
|
|
|
40
37
|
}
|
|
41
38
|
return st + encodeURIComponent(base) + existingParams + params;
|
|
42
39
|
};
|
|
43
|
-
|
|
40
|
+
export { escapeUrl };
|
package/dist/fn/extend.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const isArray_1 = require("./isArray");
|
|
6
|
-
const each_1 = require("./each");
|
|
7
|
-
const isObject_1 = require("./isObject");
|
|
1
|
+
import { iterate } from './iterate';
|
|
2
|
+
import { isArray } from './isArray';
|
|
3
|
+
import { each } from './each';
|
|
4
|
+
import { isObject } from './isObject';
|
|
8
5
|
const extend = function (...originalArgs) {
|
|
9
6
|
let deep = false;
|
|
10
7
|
let args = [];
|
|
@@ -27,19 +24,19 @@ const extend = function (...originalArgs) {
|
|
|
27
24
|
}
|
|
28
25
|
let out = args[0];
|
|
29
26
|
for (let i = 1; i < args.length; i++) {
|
|
30
|
-
|
|
27
|
+
iterate(args[i], (a, key) => {
|
|
31
28
|
if (deep) {
|
|
32
|
-
if (
|
|
33
|
-
out[key] =
|
|
34
|
-
|
|
29
|
+
if (isArray(a)) {
|
|
30
|
+
out[key] = isArray(out[key]) ? out[key] : [];
|
|
31
|
+
each(a, (b, i) => {
|
|
35
32
|
if (b && typeof b === 'object') {
|
|
36
33
|
let tmp = out[key][i];
|
|
37
|
-
if (
|
|
38
|
-
if (!
|
|
34
|
+
if (isArray(b)) {
|
|
35
|
+
if (!isArray(tmp)) {
|
|
39
36
|
tmp = [];
|
|
40
37
|
}
|
|
41
38
|
}
|
|
42
|
-
else if (!
|
|
39
|
+
else if (!isObject(tmp)) {
|
|
43
40
|
tmp = {};
|
|
44
41
|
}
|
|
45
42
|
out[key][i] = extend(true, tmp, b);
|
|
@@ -49,7 +46,7 @@ const extend = function (...originalArgs) {
|
|
|
49
46
|
}
|
|
50
47
|
});
|
|
51
48
|
}
|
|
52
|
-
else if (
|
|
49
|
+
else if (isObject(a)) {
|
|
53
50
|
out[key] = extend(true, out[key] && typeof out[key] === 'object' ? out[key] : Object.create(Object.getPrototypeOf(a)), a);
|
|
54
51
|
}
|
|
55
52
|
else {
|
|
@@ -71,4 +68,4 @@ const extend = function (...originalArgs) {
|
|
|
71
68
|
}
|
|
72
69
|
return out;
|
|
73
70
|
};
|
|
74
|
-
|
|
71
|
+
export { extend };
|
package/dist/fn/extendOut.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.extendOut = void 0;
|
|
4
|
-
const isObject_1 = require("./isObject");
|
|
1
|
+
import { isObject } from './isObject';
|
|
5
2
|
const extendOut = function (...args) {
|
|
6
3
|
let r = null;
|
|
7
4
|
for (let a of args) {
|
|
8
|
-
if (!
|
|
5
|
+
if (!isObject(a)) {
|
|
9
6
|
throw new Error('Each argument for extendOut must be an object, ' + typeof a + ' given');
|
|
10
7
|
}
|
|
11
8
|
if (r === null) {
|
|
@@ -13,7 +10,7 @@ const extendOut = function (...args) {
|
|
|
13
10
|
}
|
|
14
11
|
else {
|
|
15
12
|
for (let n in a) {
|
|
16
|
-
if (
|
|
13
|
+
if (isObject(r[n], a[n])) {
|
|
17
14
|
extendOut(r[n], a[n]);
|
|
18
15
|
}
|
|
19
16
|
else if (r[n] === undefined) {
|
|
@@ -24,4 +21,4 @@ const extendOut = function (...args) {
|
|
|
24
21
|
}
|
|
25
22
|
return r;
|
|
26
23
|
};
|
|
27
|
-
|
|
24
|
+
export { extendOut };
|
package/dist/fn/fdate.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const date_1 = require("./date");
|
|
6
|
-
const isDate_1 = require("./isDate");
|
|
7
|
-
const isString_1 = require("./isString");
|
|
8
|
-
const dayjs = require("dayjs");
|
|
1
|
+
import { fdatetime } from './fdatetime';
|
|
2
|
+
import { date } from './date';
|
|
3
|
+
import { isDate } from './isDate';
|
|
4
|
+
import { isString } from './isString';
|
|
9
5
|
const fdate = function (d, wrong_result) {
|
|
10
6
|
// Retro compatibility
|
|
11
7
|
if (wrong_result === true) {
|
|
12
|
-
return
|
|
8
|
+
return fdatetime(d);
|
|
13
9
|
}
|
|
14
|
-
let r =
|
|
15
|
-
if (!
|
|
16
|
-
return wrong_result &&
|
|
10
|
+
let r = date(d);
|
|
11
|
+
if (!isDate(r)) {
|
|
12
|
+
return wrong_result && isString(wrong_result) ? wrong_result : '';
|
|
17
13
|
}
|
|
18
14
|
if (undefined !== dayjs) {
|
|
19
15
|
return dayjs(r).format('L');
|
|
20
16
|
}
|
|
21
17
|
return r.toLocaleDateString();
|
|
22
18
|
};
|
|
23
|
-
|
|
19
|
+
export { fdate };
|
package/dist/fn/fdatetime.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const date_1 = require("./date");
|
|
5
|
-
const isDate_1 = require("./isDate");
|
|
6
|
-
const isString_1 = require("./isString");
|
|
7
|
-
const dayjs = require("dayjs");
|
|
1
|
+
import { date } from './date';
|
|
2
|
+
import { isDate } from './isDate';
|
|
3
|
+
import { isString } from './isString';
|
|
8
4
|
const fdatetime = function (d, wrong_result) {
|
|
9
|
-
let r =
|
|
10
|
-
if (!
|
|
11
|
-
return wrong_result &&
|
|
5
|
+
let r = date(d);
|
|
6
|
+
if (!isDate(r)) {
|
|
7
|
+
return wrong_result && isString(wrong_result) ? wrong_result : '';
|
|
12
8
|
}
|
|
13
9
|
if (undefined !== dayjs) {
|
|
14
10
|
//return dayjs(r).format('lll');
|
|
@@ -24,4 +20,4 @@ const fdatetime = function (d, wrong_result) {
|
|
|
24
20
|
}
|
|
25
21
|
return r.toLocaleDateString();
|
|
26
22
|
};
|
|
27
|
-
|
|
23
|
+
export { fdatetime };
|
package/dist/fn/fieldValue.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fieldValue = void 0;
|
|
4
1
|
const fieldValue = function (field) {
|
|
5
2
|
let v;
|
|
6
3
|
if (field.type === 'checkbox') {
|
|
@@ -24,4 +21,4 @@ const fieldValue = function (field) {
|
|
|
24
21
|
}
|
|
25
22
|
return v;
|
|
26
23
|
};
|
|
27
|
-
|
|
24
|
+
export { fieldValue };
|
package/dist/fn/fileExt.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fileExt = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const fileExt = function (filename) {
|
|
6
|
-
if (filename &&
|
|
3
|
+
if (filename && isString(filename)) {
|
|
7
4
|
let bits = filename.split('.');
|
|
8
5
|
if (bits[0] && bits.length > 1) {
|
|
9
6
|
return bits[bits.length - 1].toLowerCase();
|
|
@@ -11,4 +8,4 @@ const fileExt = function (filename) {
|
|
|
11
8
|
}
|
|
12
9
|
return '';
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { fileExt };
|
package/dist/fn/filter.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const each_1 = require("./each");
|
|
7
|
-
const filterToConditions_1 = require("./filterToConditions");
|
|
8
|
-
const compareConditions_1 = require("./compareConditions");
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { isFunction } from './isFunction';
|
|
3
|
+
import { each } from './each';
|
|
4
|
+
import { filterToConditions } from './filterToConditions';
|
|
5
|
+
import { compareConditions } from './compareConditions';
|
|
9
6
|
const filter = function (arr, prop, val = null, operator = '=') {
|
|
10
|
-
if (!
|
|
7
|
+
if (!isArray(arr)) {
|
|
11
8
|
throw new Error('Error in filter: The first argument must be an array');
|
|
12
9
|
}
|
|
13
10
|
let cfg = {};
|
|
14
11
|
const res = [];
|
|
15
|
-
const isFn =
|
|
12
|
+
const isFn = isFunction(prop);
|
|
16
13
|
if (!prop || !arr.length) {
|
|
17
14
|
return arr;
|
|
18
15
|
}
|
|
@@ -28,17 +25,17 @@ const filter = function (arr, prop, val = null, operator = '=') {
|
|
|
28
25
|
throw new Error('Search function error: The prop argument should be a string or an object');
|
|
29
26
|
}
|
|
30
27
|
if (isFn) {
|
|
31
|
-
|
|
28
|
+
each(arr, (a, i) => {
|
|
32
29
|
if (filter(a, prop)) {
|
|
33
30
|
res.push(a);
|
|
34
31
|
}
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
34
|
else {
|
|
38
|
-
cfg =
|
|
35
|
+
cfg = filterToConditions(cfg, operator);
|
|
39
36
|
if (cfg.conditions && cfg.logic) {
|
|
40
|
-
|
|
41
|
-
if (
|
|
37
|
+
each(arr, (a) => {
|
|
38
|
+
if (compareConditions(a, filter)) {
|
|
42
39
|
res.push(a);
|
|
43
40
|
}
|
|
44
41
|
});
|
|
@@ -47,4 +44,4 @@ const filter = function (arr, prop, val = null, operator = '=') {
|
|
|
47
44
|
return res;
|
|
48
45
|
}
|
|
49
46
|
};
|
|
50
|
-
|
|
47
|
+
export { filter };
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const isObject_1 = require("./isObject");
|
|
5
|
-
const isArray_1 = require("./isArray");
|
|
6
|
-
const iterate_1 = require("./iterate");
|
|
1
|
+
import { isObject } from './isObject';
|
|
2
|
+
import { isArray } from './isArray';
|
|
3
|
+
import { iterate } from './iterate';
|
|
7
4
|
const filterToConditions = function (filter, operator = '=') {
|
|
8
|
-
if (!
|
|
5
|
+
if (!isObject(filter)) {
|
|
9
6
|
throw new Error('Error in filterToCondition: filter must be an object');
|
|
10
7
|
}
|
|
11
|
-
if (!filter.conditions || !
|
|
8
|
+
if (!filter.conditions || !isArray(filter.conditions)) {
|
|
12
9
|
let tmp = [];
|
|
13
|
-
|
|
14
|
-
if (
|
|
10
|
+
iterate(filter, (a, n) => {
|
|
11
|
+
if (isObject(a) && typeof a.conditions === 'object') {
|
|
15
12
|
tmp.push(filterToConditions(a));
|
|
16
13
|
}
|
|
17
14
|
else {
|
|
@@ -31,4 +28,4 @@ const filterToConditions = function (filter, operator = '=') {
|
|
|
31
28
|
}
|
|
32
29
|
return filter;
|
|
33
30
|
};
|
|
34
|
-
|
|
31
|
+
export { filterToConditions };
|
package/dist/fn/findAll.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const search_1 = require("./search");
|
|
5
|
-
const each_1 = require("./each");
|
|
6
|
-
const isArray_1 = require("./isArray");
|
|
1
|
+
import { search } from './search';
|
|
2
|
+
import { each } from './each';
|
|
3
|
+
import { isArray } from './isArray';
|
|
7
4
|
const findAll = function (arr, filter, deepProperty, res = []) {
|
|
8
5
|
let idx;
|
|
9
6
|
let start = 0;
|
|
10
|
-
while ((idx =
|
|
7
|
+
while ((idx = search(arr, filter, start)) > -1) {
|
|
11
8
|
res.push(arr[idx]);
|
|
12
9
|
start = idx + 1;
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
if (
|
|
11
|
+
each(arr, (it) => {
|
|
12
|
+
if (isArray(it[deepProperty])) {
|
|
16
13
|
findAll(it[deepProperty], filter, deepProperty, res);
|
|
17
14
|
}
|
|
18
15
|
});
|
|
19
16
|
return res;
|
|
20
17
|
};
|
|
21
|
-
|
|
18
|
+
export { findAll };
|
package/dist/fn/fori.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.fori = void 0;
|
|
4
|
-
const isArray_1 = require("./isArray");
|
|
5
|
-
const isNumber_1 = require("./isNumber");
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { isNumber } from './isNumber';
|
|
6
3
|
const fori = function (arr, fn, max = arr.length - 1, min = 0) {
|
|
7
|
-
if (
|
|
4
|
+
if (isArray(arr)) {
|
|
8
5
|
let realMax = arr.length - 1;
|
|
9
|
-
if (!
|
|
6
|
+
if (!isNumber(max) || !((0 < max) && (max <= realMax))) {
|
|
10
7
|
max = realMax;
|
|
11
8
|
}
|
|
12
|
-
if (!
|
|
9
|
+
if (!isNumber(min) || !((0 <= min) && (min < realMax)) || (min > max)) {
|
|
13
10
|
min = 0;
|
|
14
11
|
}
|
|
15
12
|
for (let i = min; i <= max; i++) {
|
|
@@ -19,4 +16,4 @@ const fori = function (arr, fn, max = arr.length - 1, min = 0) {
|
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
};
|
|
22
|
-
|
|
19
|
+
export { fori };
|
package/dist/fn/forir.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.forir = void 0;
|
|
4
|
-
const isArray_1 = require("./isArray");
|
|
5
|
-
const isNumber_1 = require("./isNumber");
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { isNumber } from './isNumber';
|
|
6
3
|
const forir = function (arr, fn, max = arr.length - 1, min = 0) {
|
|
7
|
-
if (
|
|
4
|
+
if (isArray(arr)) {
|
|
8
5
|
let realMax = arr.length - 1;
|
|
9
|
-
if (!
|
|
6
|
+
if (!isNumber(max) || !((0 < max) && (max <= realMax))) {
|
|
10
7
|
max = realMax;
|
|
11
8
|
}
|
|
12
|
-
if (!
|
|
9
|
+
if (!isNumber(min) || !((0 <= min) && (min < realMax)) || (min > max)) {
|
|
13
10
|
min = 0;
|
|
14
11
|
}
|
|
15
12
|
for (let i = max; i >= min; i--) {
|
|
@@ -19,4 +16,4 @@ const forir = function (arr, fn, max = arr.length - 1, min = 0) {
|
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
};
|
|
22
|
-
|
|
19
|
+
export { forir };
|
package/dist/fn/format.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.format = void 0;
|
|
4
|
-
const checkType_1 = require("./checkType");
|
|
1
|
+
import { checkType } from './checkType';
|
|
5
2
|
const format = function (str) {
|
|
6
3
|
let args = Array.prototype.slice.call(arguments, 1);
|
|
7
4
|
if (args.length) {
|
|
8
5
|
let i = 0;
|
|
9
6
|
return str.replace(/\%([d|s])/g, (match, type) => {
|
|
10
7
|
let tmp = args[i++];
|
|
11
|
-
|
|
8
|
+
checkType(tmp, type === 'd' ? 'number' : 'string', bbn._("The value doesn't correspond to the format"));
|
|
12
9
|
return tmp;
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
12
|
return str;
|
|
16
13
|
};
|
|
17
|
-
|
|
14
|
+
export { format };
|
package/dist/fn/formatBytes.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatBytes = void 0;
|
|
4
1
|
const formatBytes = function (bytes, decimals = 2) {
|
|
5
2
|
if (!bytes) {
|
|
6
3
|
return '0 B';
|
|
@@ -8,4 +5,4 @@ const formatBytes = function (bytes, decimals = 2) {
|
|
|
8
5
|
const k = 1024, s = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
9
6
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals < 0 ? 0 : decimals)) + ' ' + s[i];
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { formatBytes };
|
package/dist/fn/formatDate.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const formatDate: (date: any, format: any) =>
|
|
1
|
+
declare const formatDate: (date: any, format: any) => string;
|
|
2
2
|
export { formatDate };
|
package/dist/fn/formatDate.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatDate = void 0;
|
|
4
|
-
const dayjs = require("dayjs");
|
|
5
1
|
const formatDate = function (date, format) {
|
|
6
2
|
return dayjs(date).format(format);
|
|
7
3
|
};
|
|
8
|
-
|
|
4
|
+
export { formatDate };
|
package/dist/fn/formatSize.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.formatSize = void 0;
|
|
4
|
-
const isNumber_1 = require("./isNumber");
|
|
5
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isNumber } from './isNumber';
|
|
2
|
+
import { isString } from './isString';
|
|
6
3
|
const formatSize = function (st, noValid) {
|
|
7
|
-
if (
|
|
4
|
+
if (isNumber(st)) {
|
|
8
5
|
return st + 'px';
|
|
9
6
|
}
|
|
10
|
-
if (
|
|
7
|
+
if (isString(st)) {
|
|
11
8
|
return st;
|
|
12
9
|
}
|
|
13
10
|
return noValid ? false : 'auto';
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { formatSize };
|
package/dist/fn/formdata.js
CHANGED
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const fieldValue_1 = require("./fieldValue");
|
|
6
|
-
const replaceAll_1 = require("./replaceAll");
|
|
7
|
-
const substr_1 = require("./substr");
|
|
1
|
+
import { each } from './each';
|
|
2
|
+
import { fieldValue } from './fieldValue';
|
|
3
|
+
import { replaceAll } from './replaceAll';
|
|
4
|
+
import { substr } from './substr';
|
|
8
5
|
const formdata = function (form) {
|
|
9
6
|
let $inputs = form.querySelectorAll('input[name],select[name],textarea[name],button[name]');
|
|
10
7
|
let res = {};
|
|
11
8
|
let n;
|
|
12
9
|
let v;
|
|
13
|
-
|
|
14
|
-
v =
|
|
10
|
+
each($inputs, (input, i) => {
|
|
11
|
+
v = fieldValue(input);
|
|
15
12
|
if (v !== undefined && !input.disabled) {
|
|
16
13
|
let name = input.name;
|
|
17
14
|
if (name.indexOf('[]') === -1 &&
|
|
18
15
|
name.indexOf('[') > -1 &&
|
|
19
16
|
name.indexOf(']') > -1 &&
|
|
20
17
|
name.lastIndexOf(']') === name.length - 1) {
|
|
21
|
-
name =
|
|
22
|
-
name =
|
|
23
|
-
name =
|
|
18
|
+
name = replaceAll('][', '.', name);
|
|
19
|
+
name = replaceAll('[', '.', name);
|
|
20
|
+
name = replaceAll(']', '', name);
|
|
24
21
|
}
|
|
25
22
|
if (name.length > 2 && name.indexOf('[]') === name.length - 2) {
|
|
26
|
-
n =
|
|
23
|
+
n = substr(name, 0, name.length - 2);
|
|
27
24
|
if (res[n] === undefined) {
|
|
28
25
|
res[n] = [];
|
|
29
26
|
}
|
|
@@ -52,4 +49,4 @@ const formdata = function (form) {
|
|
|
52
49
|
// return num_changes ? res : false;
|
|
53
50
|
return res;
|
|
54
51
|
};
|
|
55
|
-
|
|
52
|
+
export { formdata };
|
package/dist/fn/fromXml.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fromXml = void 0;
|
|
4
1
|
const fromXml = function (xml, arrayTags) {
|
|
5
2
|
let dom = null;
|
|
6
3
|
if (window.DOMParser)
|
|
@@ -44,4 +41,4 @@ const fromXml = function (xml, arrayTags) {
|
|
|
44
41
|
parseNode(node, result);
|
|
45
42
|
return result;
|
|
46
43
|
};
|
|
47
|
-
|
|
44
|
+
export { fromXml };
|
package/dist/fn/ftime.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const isDate_1 = require("./isDate");
|
|
6
|
-
const isString_1 = require("./isString");
|
|
7
|
-
const dayjs = require("dayjs");
|
|
8
|
-
const cal = require("dayjs/plugin/calendar");
|
|
9
|
-
dayjs.extend(cal);
|
|
1
|
+
import { date } from './date';
|
|
2
|
+
import { isDate } from './isDate';
|
|
3
|
+
import { isString } from './isString';
|
|
4
|
+
dayjs.extend(window['dayjs_plugin_calendar']);
|
|
10
5
|
const ftime = function (d, wrong_result) {
|
|
11
|
-
let r =
|
|
12
|
-
if (!
|
|
13
|
-
return wrong_result &&
|
|
6
|
+
let r = date(d);
|
|
7
|
+
if (!isDate(r)) {
|
|
8
|
+
return wrong_result && isString(wrong_result) ? wrong_result : '';
|
|
14
9
|
}
|
|
15
10
|
if (undefined !== dayjs) {
|
|
16
11
|
return dayjs(r).calendar();
|
|
17
12
|
}
|
|
18
13
|
return r.toLocaleDateString();
|
|
19
14
|
};
|
|
20
|
-
|
|
15
|
+
export { ftime };
|
package/dist/fn/getAllTags.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAllTags = void 0;
|
|
4
|
-
const unique_1 = require("./unique");
|
|
1
|
+
import { unique } from './unique';
|
|
5
2
|
const getAllTags = function () {
|
|
6
|
-
return
|
|
3
|
+
return unique(Array.prototype.map.apply(document.all, [(a) => a.tagName.toLowerCase()]));
|
|
7
4
|
};
|
|
8
|
-
|
|
5
|
+
export { getAllTags };
|
package/dist/fn/getAncestors.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAncestors = void 0;
|
|
4
1
|
const getAncestors = function (ele, selector) {
|
|
5
2
|
let r = [];
|
|
6
3
|
if (typeof ele === 'string') {
|
|
@@ -25,4 +22,4 @@ const getAncestors = function (ele, selector) {
|
|
|
25
22
|
}
|
|
26
23
|
return r;
|
|
27
24
|
};
|
|
28
|
-
|
|
25
|
+
export { getAncestors };
|