@bbn/bbn 1.0.15 → 1.0.16
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 +32 -32
- package/dist/bundle.js +1215 -418
- package/dist/fn/_addLoader.js +21 -1
- package/dist/fn/abort.js +12 -3
- package/dist/fn/addColors.js +11 -3
- package/dist/fn/addInputs.js +9 -2
- package/dist/fn/addStyle.js +7 -3
- package/dist/fn/adjustSize.js +19 -6
- package/dist/fn/ajax.js +16 -5
- package/dist/fn/analyzeFunction.js +10 -1
- package/dist/fn/animateCss.js +8 -2
- package/dist/fn/arrayBuffer2String.js +3 -1
- package/dist/fn/arrayFromProp.js +7 -1
- package/dist/fn/autoExtend.js +2 -0
- package/dist/fn/br2nl.js +3 -1
- package/dist/fn/calendar.js +8 -1
- package/dist/fn/callback.js +4 -2
- package/dist/fn/camelToCss.js +7 -1
- package/dist/fn/canvasToImage.js +5 -1
- package/dist/fn/center.js +12 -1
- package/dist/fn/checkProps.js +3 -1
- package/dist/fn/checkPropsDetails.js +4 -1
- package/dist/fn/clone.js +3 -1
- package/dist/fn/colorToHex.js +5 -1
- package/dist/fn/compare.js +28 -15
- package/dist/fn/compareConditions.js +1 -0
- package/dist/fn/copy.js +8 -2
- package/dist/fn/correctCase.js +3 -1
- package/dist/fn/count.js +3 -1
- package/dist/fn/crc32.js +1 -1
- package/dist/fn/cssExists.js +2 -0
- package/dist/fn/dateSQL.js +6 -3
- package/dist/fn/deepPath.js +9 -7
- package/dist/fn/defaultAjaxAbortFunction.js +3 -1
- package/dist/fn/defaultAjaxErrorFunction.d.ts +1 -1
- package/dist/fn/defaultAjaxErrorFunction.js +15 -2
- package/dist/fn/defaultAlertFunction.d.ts +1 -1
- package/dist/fn/defaultAlertFunction.js +5 -1
- package/dist/fn/defaultEndLoadingFunction.d.ts +1 -1
- package/dist/fn/defaultEndLoadingFunction.js +19 -1
- package/dist/fn/defaultErrorFunction.js +3 -1
- package/dist/fn/defaultHistoryFunction.js +3 -1
- package/dist/fn/defaultLinkFunction.js +3 -1
- package/dist/fn/defaultPostLinkFunction.js +3 -1
- package/dist/fn/defaultPreLinkFunction.d.ts +1 -1
- package/dist/fn/defaultPreLinkFunction.js +11 -1
- package/dist/fn/defaultResizeFunction.js +3 -1
- package/dist/fn/defaultStartLoadingFunction.d.ts +1 -1
- package/dist/fn/defaultStartLoadingFunction.js +14 -1
- package/dist/fn/deleteProp.js +5 -1
- package/dist/fn/diffObj.js +20 -5
- package/dist/fn/download.js +4 -1
- package/dist/fn/downloadContent.js +12 -1
- package/dist/fn/eraseCookie.js +3 -1
- package/dist/fn/error.js +5 -1
- package/dist/fn/escapeRegExp.js +3 -1
- package/dist/fn/escapeUrl.js +3 -1
- package/dist/fn/extend.js +6 -1
- package/dist/fn/fdate.js +1 -0
- package/dist/fn/fdatetime.js +10 -1
- package/dist/fn/filter.js +10 -6
- package/dist/fn/filterToConditions.js +8 -2
- package/dist/fn/findAll.js +5 -3
- package/dist/fn/format.js +5 -1
- package/dist/fn/formatDate.js +3 -1
- package/dist/fn/formdata.js +7 -2
- package/dist/fn/ftime.js +3 -1
- package/dist/fn/getAllTags.js +3 -1
- package/dist/fn/getAttributes.js +3 -1
- package/dist/fn/getBrowserName.js +20 -10
- package/dist/fn/getBrowserVersion.js +21 -10
- package/dist/fn/getEventData.js +26 -6
- package/dist/fn/getField.js +1 -2
- package/dist/fn/getPath.js +14 -3
- package/dist/fn/getProp.js +5 -1
- package/dist/fn/getRequestId.js +5 -3
- package/dist/fn/getScrollBarSize.js +4 -1
- package/dist/fn/getText.js +3 -1
- package/dist/fn/happy.js +8 -1
- package/dist/fn/hash.js +2 -1
- package/dist/fn/hex2rgb.js +8 -1
- package/dist/fn/history.js +3 -1
- package/dist/fn/html2text.js +6 -1
- package/dist/fn/imageToCanvas.js +7 -1
- package/dist/fn/imgToBase64.js +4 -1
- package/dist/fn/info.js +9 -1
- package/dist/fn/init.js +72 -14
- package/dist/fn/isArray.d.ts +1 -1
- package/dist/fn/isArray.js +3 -3
- package/dist/fn/isBlob.d.ts +1 -1
- package/dist/fn/isBlob.js +3 -3
- package/dist/fn/isBoolean.d.ts +1 -1
- package/dist/fn/isBoolean.js +3 -3
- package/dist/fn/isCanvas.d.ts +1 -1
- package/dist/fn/isCanvas.js +3 -3
- package/dist/fn/isComment.d.ts +1 -1
- package/dist/fn/isComment.js +3 -3
- package/dist/fn/isCp.d.ts +1 -1
- package/dist/fn/isCp.js +3 -3
- package/dist/fn/isDate.d.ts +1 -1
- package/dist/fn/isDate.js +3 -3
- package/dist/fn/isDesktopDevice.js +3 -1
- package/dist/fn/isDom.d.ts +1 -1
- package/dist/fn/isDom.js +3 -3
- package/dist/fn/isEvent.d.ts +1 -1
- package/dist/fn/isEvent.js +3 -3
- package/dist/fn/isFocused.js +3 -1
- package/dist/fn/isFunction.d.ts +1 -1
- package/dist/fn/isFunction.js +3 -3
- package/dist/fn/isHostname.d.ts +1 -1
- package/dist/fn/isHostname.js +10 -5
- package/dist/fn/isIP.d.ts +1 -1
- package/dist/fn/isIP.js +10 -3
- package/dist/fn/isInside.js +6 -4
- package/dist/fn/isInt.d.ts +1 -1
- package/dist/fn/isInt.js +3 -3
- package/dist/fn/isIterable.js +3 -1
- package/dist/fn/isMobile.js +3 -1
- package/dist/fn/isMobileDevice.js +3 -1
- package/dist/fn/isNull.d.ts +1 -1
- package/dist/fn/isNull.js +3 -3
- package/dist/fn/isNumber.d.ts +1 -1
- package/dist/fn/isNumber.js +3 -3
- package/dist/fn/isObject.d.ts +1 -1
- package/dist/fn/isObject.js +3 -3
- package/dist/fn/isPercent.d.ts +1 -1
- package/dist/fn/isPercent.js +3 -3
- package/dist/fn/isPrimitive.d.ts +1 -1
- package/dist/fn/isPrimitive.js +3 -3
- package/dist/fn/isPromise.d.ts +1 -1
- package/dist/fn/isPromise.js +3 -3
- package/dist/fn/isPropSize.js +10 -4
- package/dist/fn/isSQLDate.d.ts +1 -1
- package/dist/fn/isSQLDate.js +5 -4
- package/dist/fn/isSame.js +7 -4
- package/dist/fn/isString.d.ts +1 -1
- package/dist/fn/isString.js +3 -3
- package/dist/fn/isSymbol.d.ts +1 -1
- package/dist/fn/isSymbol.js +3 -3
- package/dist/fn/isTabletDevice.js +3 -1
- package/dist/fn/isURL.d.ts +1 -1
- package/dist/fn/isURL.js +10 -1
- package/dist/fn/isValidDimension.js +3 -1
- package/dist/fn/isValidName.d.ts +1 -1
- package/dist/fn/isValidName.js +3 -3
- package/dist/fn/isValue.d.ts +1 -1
- package/dist/fn/isValue.js +3 -3
- package/dist/fn/isVue.d.ts +1 -1
- package/dist/fn/isVue.js +5 -5
- package/dist/fn/iterate.js +5 -3
- package/dist/fn/link.js +24 -3
- package/dist/fn/makeReactive.js +47 -11
- package/dist/fn/md5.js +12 -3
- package/dist/fn/money.js +26 -0
- package/dist/fn/nl2br.js +3 -1
- package/dist/fn/objectToFormData.js +8 -4
- package/dist/fn/order.js +3 -1
- package/dist/fn/percent.js +3 -1
- package/dist/fn/pickValue.js +5 -3
- package/dist/fn/post.js +8 -3
- package/dist/fn/printf.js +8 -1
- package/dist/fn/randomInt.js +3 -1
- package/dist/fn/randomString.js +9 -2
- package/dist/fn/removeExtraSpaces.js +3 -1
- package/dist/fn/repeat.js +7 -1
- package/dist/fn/replaceSelection.js +6 -0
- package/dist/fn/riterate.js +3 -1
- package/dist/fn/roundDecimal.js +3 -1
- package/dist/fn/search.js +17 -2
- package/dist/fn/selector.js +3 -1
- package/dist/fn/setNavigationVars.js +20 -2
- package/dist/fn/setProp.js +9 -1
- package/dist/fn/shorten.js +1 -1
- package/dist/fn/shuffle.js +6 -1
- package/dist/fn/simpleHash.js +5 -1
- package/dist/fn/simpleHash1.js +1 -1
- package/dist/fn/simpleHash2.js +1 -1
- package/dist/fn/startChrono.js +5 -3
- package/dist/fn/stat.js +4 -2
- package/dist/fn/stopChrono.js +7 -5
- package/dist/fn/string2ArrayBuffer.js +1 -1
- package/dist/fn/submit.js +12 -1
- package/dist/fn/sum.js +11 -3
- package/dist/fn/timestamp.js +4 -1
- package/dist/fn/toggleFullScreen.js +3 -1
- package/dist/fn/translate.js +6 -1
- package/dist/fn/treatAjaxArguments.js +8 -0
- package/dist/fn/uniqString.d.ts +1 -1
- package/dist/fn/uniqString.js +14 -11
- package/dist/fn/unique.js +5 -1
- package/dist/fn/upload.js +20 -9
- package/dist/fn/warning.js +10 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/fn/getRequestId.js
CHANGED
|
@@ -3,9 +3,11 @@ import { md5 } from './md5';
|
|
|
3
3
|
const getRequestId = function (url, data, datatype) {
|
|
4
4
|
let d = {};
|
|
5
5
|
if (data) {
|
|
6
|
-
iterate(data, (a, n) => {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
iterate(data, (a, n) => {
|
|
7
|
+
if (n.indexOf('_bbn') === -1) {
|
|
8
|
+
d[n] = a;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
9
11
|
}
|
|
10
12
|
return url + ':' + md5((datatype || 'json') + JSON.stringify(d));
|
|
11
13
|
};
|
|
@@ -3,14 +3,17 @@ const getScrollBarSize = function () {
|
|
|
3
3
|
let outer = document.createElement("div");
|
|
4
4
|
outer.style.visibility = "hidden";
|
|
5
5
|
outer.style.width = "100px";
|
|
6
|
-
outer.style.msOverflowStyle = "scrollbar";
|
|
6
|
+
outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
|
|
7
7
|
document.body.appendChild(outer);
|
|
8
8
|
let widthNoScroll = outer.offsetWidth;
|
|
9
|
+
// force scrollbars
|
|
9
10
|
outer.style.overflow = "scroll";
|
|
11
|
+
// add innerdiv
|
|
10
12
|
let inner = document.createElement("div");
|
|
11
13
|
inner.style.width = "100%";
|
|
12
14
|
outer.appendChild(inner);
|
|
13
15
|
let widthWithScroll = inner.offsetWidth;
|
|
16
|
+
// remove divs
|
|
14
17
|
outer.parentNode.removeChild(outer);
|
|
15
18
|
let sz = widthNoScroll - widthWithScroll;
|
|
16
19
|
bbn.env.scrollBarSize = sz ? sz + 1 : 0;
|
package/dist/fn/getText.js
CHANGED
package/dist/fn/happy.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { log } from './log';
|
|
2
|
-
const happy = function (...args) {
|
|
2
|
+
const happy = function (...args) {
|
|
3
|
+
args.unshift({
|
|
4
|
+
_bbn_console_level: 3,
|
|
5
|
+
_bbn_console_style: "color: white; background: green; font-size: 18px;"
|
|
6
|
+
});
|
|
7
|
+
log.apply(this, args);
|
|
8
|
+
return this;
|
|
9
|
+
};
|
|
3
10
|
export { happy };
|
package/dist/fn/hash.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { log } from './log';
|
|
1
2
|
import { isDom } from './isDom';
|
|
2
3
|
import { isCp } from './isCp';
|
|
3
|
-
import { log } from './log';
|
|
4
4
|
import { circularReplacer } from './circularReplacer';
|
|
5
5
|
import { simpleHash } from './simpleHash';
|
|
6
6
|
const hash = function (obj) {
|
|
7
|
+
//log(obj);
|
|
7
8
|
let st = '__bbn__';
|
|
8
9
|
for (let i in arguments) {
|
|
9
10
|
if (arguments[i]) {
|
package/dist/fn/hex2rgb.js
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
const hex2rgb = function (hex) {
|
|
1
|
+
const hex2rgb = function (hex) {
|
|
2
|
+
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
3
|
+
return result ? {
|
|
4
|
+
r: parseInt(result[1], 16),
|
|
5
|
+
g: parseInt(result[2], 16),
|
|
6
|
+
b: parseInt(result[3], 16)
|
|
7
|
+
} : null;
|
|
8
|
+
};
|
|
2
9
|
export { hex2rgb };
|
package/dist/fn/history.js
CHANGED
package/dist/fn/html2text.js
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
const html2text = function (st) {
|
|
1
|
+
const html2text = function (st) {
|
|
2
|
+
let $test = document.createElement('div');
|
|
3
|
+
$test.innerHTML = st;
|
|
4
|
+
st = $test.innerText;
|
|
5
|
+
return st;
|
|
6
|
+
};
|
|
2
7
|
export { html2text };
|
package/dist/fn/imageToCanvas.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
const imageToCanvas = function (img) {
|
|
1
|
+
const imageToCanvas = function (img) {
|
|
2
|
+
let canvas = document.createElement("canvas");
|
|
3
|
+
canvas.width = img.width;
|
|
4
|
+
canvas.height = img.height;
|
|
5
|
+
canvas.getContext("2d").drawImage(img, 0, 0);
|
|
6
|
+
return canvas;
|
|
7
|
+
};
|
|
2
8
|
export { imageToCanvas };
|
package/dist/fn/imgToBase64.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { imageToCanvas } from './imageToCanvas';
|
|
2
2
|
import { canvasToImage } from './canvasToImage';
|
|
3
|
-
const imgToBase64 = function (img) {
|
|
3
|
+
const imgToBase64 = function (img) {
|
|
4
|
+
let canvas = imageToCanvas(img);
|
|
5
|
+
return canvasToImage(canvas);
|
|
6
|
+
};
|
|
4
7
|
export { imgToBase64 };
|
package/dist/fn/info.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { log } from './log';
|
|
2
|
-
const info = function (...args) {
|
|
2
|
+
const info = function (...args) {
|
|
3
|
+
args.unshift({
|
|
4
|
+
//_bbn_console_mode: "info",
|
|
5
|
+
_bbn_console_level: 4,
|
|
6
|
+
_bbn_console_style: "color: #EEE; background: blue; font-size: 12px;"
|
|
7
|
+
});
|
|
8
|
+
log.apply(this, args);
|
|
9
|
+
return this;
|
|
10
|
+
};
|
|
3
11
|
export { info };
|
package/dist/fn/init.js
CHANGED
|
@@ -18,26 +18,72 @@ const init = function (cfg, force) {
|
|
|
18
18
|
bbn.env.root += '/';
|
|
19
19
|
}
|
|
20
20
|
if (!bbn.env.isInit && (typeof dayjs !== 'undefined')) {
|
|
21
|
-
each([
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
each([
|
|
22
|
+
'advancedFormat',
|
|
23
|
+
'arraySupport',
|
|
24
|
+
'badMutable',
|
|
25
|
+
'buddhistEra',
|
|
26
|
+
'calendar',
|
|
27
|
+
'customParseFormat',
|
|
28
|
+
'dayOfYear',
|
|
29
|
+
'devHelper',
|
|
30
|
+
'duration',
|
|
31
|
+
'isBetween',
|
|
32
|
+
'isLeapYear',
|
|
33
|
+
'isSameOrAfter',
|
|
34
|
+
'isSameOrBefore',
|
|
35
|
+
'isToday',
|
|
36
|
+
'isTomorrow',
|
|
37
|
+
'isYesterday',
|
|
38
|
+
'isoWeek',
|
|
39
|
+
'isoWeeksInYear',
|
|
40
|
+
'localeData',
|
|
41
|
+
'localizedFormat',
|
|
42
|
+
'minMax',
|
|
43
|
+
'objectSupport',
|
|
44
|
+
'pluralGetSet',
|
|
45
|
+
'quarterOfYear',
|
|
46
|
+
'relativeTime',
|
|
47
|
+
'timezone',
|
|
48
|
+
'toArray',
|
|
49
|
+
'toObject',
|
|
50
|
+
'updateLocale',
|
|
51
|
+
'utc',
|
|
52
|
+
'weekOfYear',
|
|
53
|
+
'weekYear',
|
|
54
|
+
'weekday'
|
|
55
|
+
], plugin => {
|
|
56
|
+
if (window['dayjs_plugin_' + plugin]) {
|
|
57
|
+
dayjs.extend(window['dayjs_plugin_' + plugin]);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
24
60
|
}
|
|
61
|
+
/* The server's path (difference between the host and the current dir */
|
|
25
62
|
if (typeof (cfg) === 'object') {
|
|
26
63
|
extend(true, window.bbn, cfg);
|
|
27
64
|
}
|
|
28
65
|
bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
|
|
29
66
|
parts = bbn.env.path.split("/");
|
|
30
|
-
each(parts, (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
67
|
+
//$.each(parts, function(i, v){
|
|
68
|
+
each(parts, (v, i) => {
|
|
69
|
+
v = decodeURI(v.trim());
|
|
70
|
+
if (v !== "") {
|
|
71
|
+
bbn.env.params.push(v);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
if (bbn.var.colors) {
|
|
75
|
+
addColors(bbn.var.colors);
|
|
35
76
|
}
|
|
36
77
|
if (bbn.env.lang && (undefined !== dayjs)) {
|
|
37
78
|
dayjs.locale(bbn.env.lang);
|
|
38
79
|
}
|
|
39
|
-
window.onfocus = () => {
|
|
40
|
-
|
|
80
|
+
window.onfocus = () => {
|
|
81
|
+
bbn.env.isFocused = true;
|
|
82
|
+
};
|
|
83
|
+
window.onblur = () => {
|
|
84
|
+
bbn.env.isFocused = false;
|
|
85
|
+
bbn.env.timeoff = Math.round((new Date()).getTime() / 1000);
|
|
86
|
+
};
|
|
41
87
|
document.addEventListener("focusin", e => {
|
|
42
88
|
if (!e.target.classList.contains('bbn-no')) {
|
|
43
89
|
bbn.env.focused = e.target;
|
|
@@ -72,10 +118,20 @@ const init = function (cfg, force) {
|
|
|
72
118
|
return false;
|
|
73
119
|
}
|
|
74
120
|
});
|
|
75
|
-
each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele, i) => {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
121
|
+
each(document.querySelectorAll("form:not(.bbn-no), form:not(.bbn-form)"), (ele, i) => {
|
|
122
|
+
ele.addEventListener("submit", e => {
|
|
123
|
+
submit(ele, e);
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
window.addEventListener('hashchange', () => {
|
|
127
|
+
bbn.env.hashChanged = (new Date()).getTime();
|
|
128
|
+
}, false);
|
|
129
|
+
window.addEventListener("resize", () => {
|
|
130
|
+
resize();
|
|
131
|
+
});
|
|
132
|
+
window.addEventListener("orientationchange", () => {
|
|
133
|
+
resize();
|
|
134
|
+
});
|
|
79
135
|
resize();
|
|
80
136
|
if (isMobile()) {
|
|
81
137
|
document.body.classList.add('bbn-mobile');
|
|
@@ -87,9 +143,11 @@ const init = function (cfg, force) {
|
|
|
87
143
|
window.onpopstate = function (e) {
|
|
88
144
|
let h = window.history;
|
|
89
145
|
if (!bbn.env.historyDisabled && h) {
|
|
146
|
+
//e.preventDefault();
|
|
90
147
|
let state = h.state;
|
|
91
148
|
if (state) {
|
|
92
149
|
if (defaultHistoryFunction(state)) {
|
|
150
|
+
//link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
|
|
93
151
|
link(state.url, extend({ title: state.title || bbn.env.siteTitle }, state.data || {}));
|
|
94
152
|
}
|
|
95
153
|
else if (state && state.data && isFunction(state.data.script)) {
|
package/dist/fn/isArray.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isArray: () => boolean;
|
|
1
|
+
declare const isArray: (...args: any[]) => boolean;
|
|
2
2
|
export { isArray };
|
package/dist/fn/isArray.js
CHANGED
package/dist/fn/isBlob.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isBlob: () => boolean;
|
|
1
|
+
declare const isBlob: (...args: any[]) => boolean;
|
|
2
2
|
export { isBlob };
|
package/dist/fn/isBlob.js
CHANGED
package/dist/fn/isBoolean.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isBoolean: () => boolean;
|
|
1
|
+
declare const isBoolean: (...args: any[]) => boolean;
|
|
2
2
|
export { isBoolean };
|
package/dist/fn/isBoolean.js
CHANGED
package/dist/fn/isCanvas.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isCanvas: () => boolean;
|
|
1
|
+
declare const isCanvas: (...args: any[]) => boolean;
|
|
2
2
|
export { isCanvas };
|
package/dist/fn/isCanvas.js
CHANGED
package/dist/fn/isComment.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isComment: () => boolean;
|
|
1
|
+
declare const isComment: (...args: any[]) => boolean;
|
|
2
2
|
export { isComment };
|
package/dist/fn/isComment.js
CHANGED
package/dist/fn/isCp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isCp: () => boolean;
|
|
1
|
+
declare const isCp: (...args: any[]) => boolean;
|
|
2
2
|
export { isCp };
|
package/dist/fn/isCp.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isDom } from './isDom';
|
|
2
|
-
const isCp = function () {
|
|
3
|
-
if (!
|
|
2
|
+
const isCp = function (...args) {
|
|
3
|
+
if (!args.length) {
|
|
4
4
|
return false;
|
|
5
5
|
}
|
|
6
6
|
if (!Object.hasOwn(bbn, 'cp')) {
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
9
|
-
for (let a of
|
|
9
|
+
for (let a of args) {
|
|
10
10
|
let res = bbn.cp.isComponent(a);
|
|
11
11
|
if (!res || isDom(res) || !res.$el) {
|
|
12
12
|
return false;
|
package/dist/fn/isDate.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isDate: () => boolean;
|
|
1
|
+
declare const isDate: (...args: any[]) => boolean;
|
|
2
2
|
export { isDate };
|
package/dist/fn/isDate.js
CHANGED
package/dist/fn/isDom.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isDom: () => boolean;
|
|
1
|
+
declare const isDom: (...args: any[]) => boolean;
|
|
2
2
|
export { isDom };
|
package/dist/fn/isDom.js
CHANGED
package/dist/fn/isEvent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isEvent: () => boolean;
|
|
1
|
+
declare const isEvent: (...args: any[]) => boolean;
|
|
2
2
|
export { isEvent };
|
package/dist/fn/isEvent.js
CHANGED
package/dist/fn/isFocused.js
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
const isFocused = function (ele, contain) {
|
|
1
|
+
const isFocused = function (ele, contain) {
|
|
2
|
+
return (ele === document.activeElement) || (contain && ele.contains && (ele.contains(document.activeElement)));
|
|
3
|
+
};
|
|
2
4
|
export { isFocused };
|
package/dist/fn/isFunction.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isFunction: () => boolean;
|
|
1
|
+
declare const isFunction: (...args: any[]) => boolean;
|
|
2
2
|
export { isFunction };
|
package/dist/fn/isFunction.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const isFunction = function () {
|
|
2
|
-
if (!
|
|
1
|
+
const isFunction = function (...args) {
|
|
2
|
+
if (!args.length)
|
|
3
3
|
return false;
|
|
4
|
-
for (let obj of
|
|
4
|
+
for (let obj of args) {
|
|
5
5
|
if (!(obj && obj.constructor && obj.call && obj.apply)) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
package/dist/fn/isHostname.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isHostname: (
|
|
1
|
+
declare const isHostname: (...args: any[]) => boolean;
|
|
2
2
|
export { isHostname };
|
package/dist/fn/isHostname.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { isString } from './isString';
|
|
2
2
|
import { isIP } from './isIP';
|
|
3
|
-
const isHostname = function (
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const isHostname = function (...args) {
|
|
4
|
+
if (!args.length)
|
|
5
|
+
return false;
|
|
6
|
+
for (let st of args) {
|
|
7
|
+
if (!isString(st)) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
if (!isIP(st) && !bbn.var.regexp.hostname.test(st)) {
|
|
11
|
+
return false;
|
|
7
12
|
}
|
|
8
|
-
return bbn.vars.regexp.hostname.test(st);
|
|
9
13
|
}
|
|
14
|
+
return true;
|
|
10
15
|
};
|
|
11
16
|
export { isHostname };
|
package/dist/fn/isIP.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isIP: (
|
|
1
|
+
declare const isIP: (...args: any[]) => boolean;
|
|
2
2
|
export { isIP };
|
package/dist/fn/isIP.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { isString } from './isString';
|
|
2
|
-
const isIP = function (
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
const isIP = function (...args) {
|
|
3
|
+
if (!args.length)
|
|
4
|
+
return false;
|
|
5
|
+
for (let st of args) {
|
|
6
|
+
if (!isString(st) || !bbn.var.regexp.ip.test(st)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return true;
|
|
11
|
+
};
|
|
5
12
|
export { isIP };
|
package/dist/fn/isInside.js
CHANGED
|
@@ -6,10 +6,12 @@ const isInside = function (ele, ancestor) {
|
|
|
6
6
|
if (ancestors.length) {
|
|
7
7
|
if (isString(ancestor)) {
|
|
8
8
|
let ok = false;
|
|
9
|
-
each(ancestors, a => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
each(ancestors, a => {
|
|
10
|
+
if (a.matches && a.matches(ancestor)) {
|
|
11
|
+
ok = true;
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
13
15
|
return ok;
|
|
14
16
|
}
|
|
15
17
|
if (ancestor instanceof HTMLElement) {
|
package/dist/fn/isInt.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isInt: () => boolean;
|
|
1
|
+
declare const isInt: (...args: any[]) => boolean;
|
|
2
2
|
export { isInt };
|
package/dist/fn/isInt.js
CHANGED
package/dist/fn/isIterable.js
CHANGED
package/dist/fn/isMobile.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { isMobileDevice } from './isMobileDevice';
|
|
2
2
|
import { isTabletDevice } from './isTabletDevice';
|
|
3
|
-
const isMobile = function () {
|
|
3
|
+
const isMobile = function () {
|
|
4
|
+
return isMobileDevice() || isTabletDevice();
|
|
5
|
+
};
|
|
4
6
|
export { isMobile };
|
package/dist/fn/isNull.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isNull: () => boolean;
|
|
1
|
+
declare const isNull: (...args: any[]) => boolean;
|
|
2
2
|
export { isNull };
|
package/dist/fn/isNull.js
CHANGED
package/dist/fn/isNumber.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isNumber: () => boolean;
|
|
1
|
+
declare const isNumber: (...args: any[]) => boolean;
|
|
2
2
|
export { isNumber };
|
package/dist/fn/isNumber.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const isNumber = function () {
|
|
2
|
-
if (!
|
|
1
|
+
const isNumber = function (...args) {
|
|
2
|
+
if (!args.length)
|
|
3
3
|
return false;
|
|
4
|
-
for (let a of
|
|
4
|
+
for (let a of args) {
|
|
5
5
|
if (['boolean', 'object', 'symbol'].includes(typeof a) || (a === '') || isNaN(a)) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
package/dist/fn/isObject.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isObject: () => boolean;
|
|
1
|
+
declare const isObject: (...args: any[]) => boolean;
|
|
2
2
|
export { isObject };
|
package/dist/fn/isObject.js
CHANGED
package/dist/fn/isPercent.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isPercent: () => boolean;
|
|
1
|
+
declare const isPercent: (...args: any[]) => boolean;
|
|
2
2
|
export { isPercent };
|
package/dist/fn/isPercent.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const isPercent = function () {
|
|
2
|
-
if (!
|
|
1
|
+
const isPercent = function (...args) {
|
|
2
|
+
if (!args.length)
|
|
3
3
|
return false;
|
|
4
|
-
for (let a of
|
|
4
|
+
for (let a of args) {
|
|
5
5
|
if ((typeof a !== 'string') || !a.match(/^\d+(?:\.\d+)?%$/)) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
package/dist/fn/isPrimitive.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const isPrimitive: () => boolean;
|
|
1
|
+
declare const isPrimitive: (...args: any[]) => boolean;
|
|
2
2
|
export { isPrimitive };
|