@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/init.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const isTabletDevice_1 = require("./isTabletDevice");
|
|
14
|
-
const defaultHistoryFunction_1 = require("./defaultHistoryFunction");
|
|
15
|
-
const isFunction_1 = require("./isFunction");
|
|
16
|
-
const log_1 = require("./log");
|
|
1
|
+
import { substr } from './substr';
|
|
2
|
+
import { each } from './each';
|
|
3
|
+
import { extend } from './extend';
|
|
4
|
+
import { addColors } from './addColors';
|
|
5
|
+
import { link } from './link';
|
|
6
|
+
import { submit } from './submit';
|
|
7
|
+
import { resize } from './resize';
|
|
8
|
+
import { isMobile } from './isMobile';
|
|
9
|
+
import { isTabletDevice } from './isTabletDevice';
|
|
10
|
+
import { defaultHistoryFunction } from './defaultHistoryFunction';
|
|
11
|
+
import { isFunction } from './isFunction';
|
|
12
|
+
import { log } from './log';
|
|
17
13
|
const init = function (cfg, force) {
|
|
18
14
|
let parts;
|
|
19
15
|
if (!bbn.env.isInit || force) {
|
|
20
16
|
bbn.env.root = document.baseURI.length > 0 ? document.baseURI : bbn.env.host;
|
|
21
|
-
if (bbn.env.root.length &&
|
|
17
|
+
if (bbn.env.root.length && substr(bbn.env.root, -1) !== '/') {
|
|
22
18
|
bbn.env.root += '/';
|
|
23
19
|
}
|
|
24
20
|
if (!bbn.env.isInit && typeof dayjs !== 'undefined') {
|
|
25
|
-
|
|
21
|
+
each([
|
|
26
22
|
'advancedFormat',
|
|
27
23
|
'arraySupport',
|
|
28
24
|
'badMutable',
|
|
@@ -64,19 +60,19 @@ const init = function (cfg, force) {
|
|
|
64
60
|
}
|
|
65
61
|
/* The server's path (difference between the host and the current dir */
|
|
66
62
|
if (typeof cfg === 'object') {
|
|
67
|
-
|
|
63
|
+
extend(true, bbn, cfg);
|
|
68
64
|
}
|
|
69
|
-
bbn.env.path =
|
|
65
|
+
bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
|
|
70
66
|
parts = bbn.env.path.split('/');
|
|
71
67
|
//$.each(parts, function(i, v){
|
|
72
|
-
|
|
68
|
+
each(parts, (v, i) => {
|
|
73
69
|
v = decodeURI(v.trim());
|
|
74
70
|
if (v !== '') {
|
|
75
71
|
bbn.env.params.push(v);
|
|
76
72
|
}
|
|
77
73
|
});
|
|
78
74
|
if (bbn.vars.colors) {
|
|
79
|
-
|
|
75
|
+
addColors(bbn.vars.colors);
|
|
80
76
|
}
|
|
81
77
|
if (bbn.env.lang && undefined !== dayjs) {
|
|
82
78
|
dayjs.locale(bbn.env.lang);
|
|
@@ -118,28 +114,28 @@ const init = function (cfg, force) {
|
|
|
118
114
|
if (target instanceof HTMLElement && target.hasAttribute('href') && !target.hasAttribute('target') && !target.classList.contains('bbn-no')) {
|
|
119
115
|
e.preventDefault();
|
|
120
116
|
e.stopPropagation();
|
|
121
|
-
|
|
117
|
+
link(target.getAttribute('href'));
|
|
122
118
|
return false;
|
|
123
119
|
}
|
|
124
120
|
});
|
|
125
|
-
|
|
121
|
+
each(document.querySelectorAll('form:not(.bbn-no), form:not(.bbn-form)'), (ele) => {
|
|
126
122
|
ele.addEventListener('submit', (e) => {
|
|
127
|
-
|
|
123
|
+
submit(ele, e);
|
|
128
124
|
});
|
|
129
125
|
});
|
|
130
126
|
window.addEventListener('hashchange', () => {
|
|
131
127
|
bbn.env.hashChanged = new Date().getTime();
|
|
132
128
|
}, false);
|
|
133
129
|
window.addEventListener('resize', () => {
|
|
134
|
-
|
|
130
|
+
resize();
|
|
135
131
|
});
|
|
136
132
|
window.addEventListener('orientationchange', () => {
|
|
137
|
-
|
|
133
|
+
resize();
|
|
138
134
|
});
|
|
139
|
-
|
|
140
|
-
if (
|
|
135
|
+
resize();
|
|
136
|
+
if (isMobile()) {
|
|
141
137
|
document.body.classList.add('bbn-mobile');
|
|
142
|
-
if (
|
|
138
|
+
if (isTabletDevice()) {
|
|
143
139
|
document.body.classList.add('bbn-tablet');
|
|
144
140
|
}
|
|
145
141
|
}
|
|
@@ -150,11 +146,11 @@ const init = function (cfg, force) {
|
|
|
150
146
|
//e.preventDefault();
|
|
151
147
|
let state = h.state;
|
|
152
148
|
if (state) {
|
|
153
|
-
if (
|
|
149
|
+
if (defaultHistoryFunction(state)) {
|
|
154
150
|
//link(substr(state.url, bbn.env.root.length), $.extend({title: state.title}, state.data));
|
|
155
|
-
|
|
151
|
+
link(state.url, extend({ title: state.title || bbn.env.siteTitle }, state.data || {}));
|
|
156
152
|
}
|
|
157
|
-
else if (state && state.data &&
|
|
153
|
+
else if (state && state.data && isFunction(state.data.script)) {
|
|
158
154
|
state.data.script();
|
|
159
155
|
}
|
|
160
156
|
}
|
|
@@ -164,8 +160,8 @@ const init = function (cfg, force) {
|
|
|
164
160
|
bbn.env.isInit = true;
|
|
165
161
|
document.dispatchEvent(new Event('bbninit'));
|
|
166
162
|
if (bbn.env.logging) {
|
|
167
|
-
|
|
163
|
+
log('Logging in bbn is enabled');
|
|
168
164
|
}
|
|
169
165
|
}
|
|
170
166
|
};
|
|
171
|
-
|
|
167
|
+
export { init };
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isActiveInterface = void 0;
|
|
4
1
|
const isActiveInterface = function (secs = 600) {
|
|
5
2
|
if (!bbn.env.last_focus) {
|
|
6
3
|
return false;
|
|
@@ -8,4 +5,4 @@ const isActiveInterface = function (secs = 600) {
|
|
|
8
5
|
let t = new Date().getTime();
|
|
9
6
|
return t - bbn.env.last_focus < secs * 1000;
|
|
10
7
|
};
|
|
11
|
-
|
|
8
|
+
export { isActiveInterface };
|
package/dist/fn/isArray.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isArray = void 0;
|
|
4
1
|
const isArray = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isArray = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isArray };
|
package/dist/fn/isBlob.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBlob = void 0;
|
|
4
1
|
const isBlob = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isBlob = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isBlob };
|
package/dist/fn/isBoolean.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBoolean = void 0;
|
|
4
1
|
const isBoolean = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isBoolean = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isBoolean };
|
package/dist/fn/isCanvas.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCanvas = void 0;
|
|
4
1
|
const isCanvas = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isCanvas = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isCanvas };
|
package/dist/fn/isColor.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isColor = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const isColor = function (...args) {
|
|
6
3
|
if (!args.length)
|
|
7
4
|
return false;
|
|
8
5
|
var reg = new RegExp('^(#[a-f0-9]{6}|#[a-f0-9]{3}|rgb *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|rgba *( *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *, *[0-9]{1,3}%? *)|black|green|silver|gray|olive|white|yellow|maroon|navy|red|blue|purple|teal|fuchsia|aqua)$', 'i');
|
|
9
6
|
for (let st of args) {
|
|
10
|
-
if (!
|
|
7
|
+
if (!isString(st)) {
|
|
11
8
|
return false;
|
|
12
9
|
}
|
|
13
10
|
if (!reg.test(st)) {
|
|
@@ -16,4 +13,4 @@ const isColor = function (...args) {
|
|
|
16
13
|
}
|
|
17
14
|
return true;
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
export { isColor };
|
package/dist/fn/isComment.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isComment = void 0;
|
|
4
1
|
const isComment = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isComment = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isComment };
|
package/dist/fn/isCp.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCp = void 0;
|
|
4
|
-
const isDom_1 = require("./isDom");
|
|
1
|
+
import { isDom } from './isDom';
|
|
5
2
|
const isCp = function (...args) {
|
|
6
3
|
if (!args.length) {
|
|
7
4
|
return false;
|
|
@@ -9,7 +6,7 @@ const isCp = function (...args) {
|
|
|
9
6
|
if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
|
|
10
7
|
for (let a of args) {
|
|
11
8
|
let res = bbn.cp.isComponent(a);
|
|
12
|
-
if (!res ||
|
|
9
|
+
if (!res || isDom(res) || !res.$el) {
|
|
13
10
|
return false;
|
|
14
11
|
}
|
|
15
12
|
}
|
|
@@ -17,4 +14,4 @@ const isCp = function (...args) {
|
|
|
17
14
|
}
|
|
18
15
|
return true;
|
|
19
16
|
};
|
|
20
|
-
|
|
17
|
+
export { isCp };
|
package/dist/fn/isDate.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDate = void 0;
|
|
4
1
|
const isDate = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isDate = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isDate };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDesktopDevice = void 0;
|
|
4
1
|
const isDesktopDevice = function () {
|
|
5
2
|
return this.getDeviceType() === 'desktop';
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { isDesktopDevice };
|
package/dist/fn/isDimension.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDimension = void 0;
|
|
4
|
-
const isValidDimension_1 = require("./isValidDimension");
|
|
1
|
+
import { isValidDimension } from './isValidDimension';
|
|
5
2
|
const isDimension = function (...args) {
|
|
6
3
|
if (!args.length)
|
|
7
4
|
return false;
|
|
@@ -9,10 +6,10 @@ const isDimension = function (...args) {
|
|
|
9
6
|
if ((typeof st !== 'number') || (st < 0)) {
|
|
10
7
|
return false;
|
|
11
8
|
}
|
|
12
|
-
if (!
|
|
9
|
+
if (!isValidDimension(st)) {
|
|
13
10
|
return false;
|
|
14
11
|
}
|
|
15
12
|
}
|
|
16
13
|
return true;
|
|
17
14
|
};
|
|
18
|
-
|
|
15
|
+
export { isDimension };
|
package/dist/fn/isDom.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDom = void 0;
|
|
4
1
|
const isDom = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isDom = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isDom };
|
package/dist/fn/isEmail.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEmail = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const isEmail = function (...args) {
|
|
6
3
|
if (!args.length)
|
|
7
4
|
return false;
|
|
8
5
|
let regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;
|
|
9
6
|
for (let st of args) {
|
|
10
|
-
if (!
|
|
7
|
+
if (!isString(st)) {
|
|
11
8
|
return false;
|
|
12
9
|
}
|
|
13
10
|
if (!regex.test(st)) {
|
|
@@ -16,4 +13,4 @@ const isEmail = function (...args) {
|
|
|
16
13
|
}
|
|
17
14
|
return true;
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
export { isEmail };
|
package/dist/fn/isEmpty.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isEmpty = void 0;
|
|
4
|
-
const isArray_1 = require("./isArray");
|
|
5
|
-
const numProperties_1 = require("./numProperties");
|
|
1
|
+
import { isArray } from './isArray';
|
|
2
|
+
import { numProperties } from './numProperties';
|
|
6
3
|
const isEmpty = function (obj) {
|
|
7
4
|
if (!obj) {
|
|
8
5
|
return true;
|
|
9
6
|
}
|
|
10
|
-
if (
|
|
7
|
+
if (isArray(obj)) {
|
|
11
8
|
return obj.length ? false : true;
|
|
12
9
|
}
|
|
13
10
|
if (typeof obj === 'object') {
|
|
14
|
-
if (
|
|
11
|
+
if (numProperties(obj)) {
|
|
15
12
|
return false;
|
|
16
13
|
}
|
|
17
14
|
return true;
|
|
18
15
|
}
|
|
19
16
|
return false;
|
|
20
17
|
};
|
|
21
|
-
|
|
18
|
+
export { isEmpty };
|
package/dist/fn/isEvent.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isEvent = void 0;
|
|
4
1
|
const isEvent = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isEvent = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isEvent };
|
package/dist/fn/isFocused.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFocused = void 0;
|
|
4
1
|
const isFocused = function (ele, contain) {
|
|
5
2
|
return ele === document.activeElement || (contain && ele.contains && ele.contains(document.activeElement));
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { isFocused };
|
package/dist/fn/isFunction.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isFunction = void 0;
|
|
4
1
|
const isFunction = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isFunction = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isFunction };
|
package/dist/fn/isHostname.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isHostname = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
5
|
-
const isIP_1 = require("./isIP");
|
|
1
|
+
import { isString } from './isString';
|
|
2
|
+
import { isIP } from './isIP';
|
|
6
3
|
const isHostname = function (...args) {
|
|
7
4
|
if (!args.length)
|
|
8
5
|
return false;
|
|
9
6
|
for (let st of args) {
|
|
10
|
-
if (!
|
|
7
|
+
if (!isString(st)) {
|
|
11
8
|
return false;
|
|
12
9
|
}
|
|
13
|
-
if (!
|
|
10
|
+
if (!isIP(st) && !bbn.vars.regexp.hostname.test(st)) {
|
|
14
11
|
return false;
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
14
|
return true;
|
|
18
15
|
};
|
|
19
|
-
|
|
16
|
+
export { isHostname };
|
package/dist/fn/isIP.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isIP = void 0;
|
|
4
|
-
const isString_1 = require("./isString");
|
|
1
|
+
import { isString } from './isString';
|
|
5
2
|
const isIP = function (...args) {
|
|
6
3
|
if (!args.length)
|
|
7
4
|
return false;
|
|
8
5
|
for (let st of args) {
|
|
9
|
-
if (!
|
|
6
|
+
if (!isString(st) || !bbn.vars.regexp.ip.test(st)) {
|
|
10
7
|
return false;
|
|
11
8
|
}
|
|
12
9
|
}
|
|
13
10
|
return true;
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { isIP };
|
package/dist/fn/isInside.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const getAncestors_1 = require("./getAncestors");
|
|
5
|
-
const isString_1 = require("./isString");
|
|
6
|
-
const each_1 = require("./each");
|
|
1
|
+
import { getAncestors } from './getAncestors';
|
|
2
|
+
import { isString } from './isString';
|
|
3
|
+
import { each } from './each';
|
|
7
4
|
const isInside = function (ele, ancestor) {
|
|
8
|
-
let ancestors =
|
|
5
|
+
let ancestors = getAncestors(ele);
|
|
9
6
|
if (ancestors.length) {
|
|
10
|
-
if (
|
|
7
|
+
if (isString(ancestor)) {
|
|
11
8
|
let ok = false;
|
|
12
|
-
|
|
9
|
+
each(ancestors, (a) => {
|
|
13
10
|
if (a.matches && a.matches(ancestor)) {
|
|
14
11
|
ok = true;
|
|
15
12
|
return false;
|
|
@@ -23,4 +20,4 @@ const isInside = function (ele, ancestor) {
|
|
|
23
20
|
}
|
|
24
21
|
return false;
|
|
25
22
|
};
|
|
26
|
-
|
|
23
|
+
export { isInside };
|
package/dist/fn/isInt.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isInt = void 0;
|
|
4
1
|
const isInt = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isInt = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isInt };
|
package/dist/fn/isIterable.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isIterable = void 0;
|
|
4
1
|
const isIterable = function (v) {
|
|
5
2
|
return v && typeof v === 'object' && Symbol.iterator in Object(v);
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { isIterable };
|
package/dist/fn/isMobile.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isMobile = void 0;
|
|
4
|
-
const isMobileDevice_1 = require("./isMobileDevice");
|
|
5
|
-
const isTabletDevice_1 = require("./isTabletDevice");
|
|
1
|
+
import { isMobileDevice } from './isMobileDevice';
|
|
2
|
+
import { isTabletDevice } from './isTabletDevice';
|
|
6
3
|
const isMobile = function () {
|
|
7
|
-
return
|
|
4
|
+
return isMobileDevice() || isTabletDevice();
|
|
8
5
|
};
|
|
9
|
-
|
|
6
|
+
export { isMobile };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isMobileDevice = void 0;
|
|
4
1
|
const isMobileDevice = function () {
|
|
5
2
|
return this.getDeviceType() === 'mobile';
|
|
6
3
|
};
|
|
7
|
-
|
|
4
|
+
export { isMobileDevice };
|
package/dist/fn/isNull.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNull = void 0;
|
|
4
1
|
const isNull = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isNull = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isNull };
|
package/dist/fn/isNumber.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isNumber = void 0;
|
|
4
1
|
const isNumber = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isNumber = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isNumber };
|
package/dist/fn/isObject.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isObject = void 0;
|
|
4
1
|
const isObject = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isObject = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isObject };
|
package/dist/fn/isPercent.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPercent = void 0;
|
|
4
1
|
const isPercent = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isPercent = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isPercent };
|
package/dist/fn/isPrimitive.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPrimitive = void 0;
|
|
4
1
|
const isPrimitive = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isPrimitive = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isPrimitive };
|
package/dist/fn/isPromise.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPromise = void 0;
|
|
4
1
|
const isPromise = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -11,4 +8,4 @@ const isPromise = function (...args) {
|
|
|
11
8
|
}
|
|
12
9
|
return true;
|
|
13
10
|
};
|
|
14
|
-
|
|
11
|
+
export { isPromise };
|
package/dist/fn/isPropSize.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPropSize = void 0;
|
|
4
|
-
const each_1 = require("./each");
|
|
1
|
+
import { each } from './each';
|
|
5
2
|
const isPropSize = function (name) {
|
|
6
3
|
let isTrue = false;
|
|
7
|
-
|
|
4
|
+
each(['width', 'height', 'gap', 'margin', 'padding', 'top', 'left', 'right', 'bottom'], (a) => {
|
|
8
5
|
if (name.indexOf(a) !== -1) {
|
|
9
6
|
isTrue = true;
|
|
10
7
|
return false;
|
|
@@ -12,4 +9,4 @@ const isPropSize = function (name) {
|
|
|
12
9
|
});
|
|
13
10
|
return isTrue;
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { isPropSize };
|
package/dist/fn/isSQLDate.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSQLDate = void 0;
|
|
4
1
|
const isSQLDate = function (...args) {
|
|
5
2
|
if (!args.length)
|
|
6
3
|
return false;
|
|
@@ -12,4 +9,4 @@ const isSQLDate = function (...args) {
|
|
|
12
9
|
}
|
|
13
10
|
return true;
|
|
14
11
|
};
|
|
15
|
-
|
|
12
|
+
export { isSQLDate };
|