@bbn/bbn 1.0.71 → 1.0.72
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/$.js +1 -1
- package/dist/bundle.js +15 -11
- package/dist/db.js +4 -2
- package/dist/fn/ajax/ajax.js +1 -1
- package/dist/fn/ajax/download.js +1 -1
- package/dist/fn/default/defaultAjaxAbortFunction.js +2 -2
- package/dist/fn/html/makeReactive.js +2 -2
- package/dist/fn/type/checkType.js +2 -1
- package/dist/fn/type/isCp.js +2 -1
- package/package.json +3 -2
package/dist/$.js
CHANGED
package/dist/bundle.js
CHANGED
|
@@ -506,6 +506,7 @@
|
|
|
506
506
|
}
|
|
507
507
|
const typesList = [];
|
|
508
508
|
(0, each_1.each)(type, (t) => {
|
|
509
|
+
var _a;
|
|
509
510
|
if (t === String) {
|
|
510
511
|
t = 'string';
|
|
511
512
|
}
|
|
@@ -525,7 +526,7 @@
|
|
|
525
526
|
t = 'function';
|
|
526
527
|
}
|
|
527
528
|
if ((0, isFunction_2.isFunction)(t)) {
|
|
528
|
-
typesList.push(t.name || t.constructor
|
|
529
|
+
typesList.push(t.name || ((_a = t.constructor) === null || _a === void 0 ? void 0 : _a.name) || t.toString());
|
|
529
530
|
if (value instanceof t) {
|
|
530
531
|
ok = true;
|
|
531
532
|
return false;
|
|
@@ -585,7 +586,7 @@
|
|
|
585
586
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
586
587
|
exports.$ = void 0;
|
|
587
588
|
const $ = (selector, context) => {
|
|
588
|
-
if (context
|
|
589
|
+
if (context === null || context === void 0 ? void 0 : context.querySelectorAll) {
|
|
589
590
|
return context.querySelectorAll(selector);
|
|
590
591
|
}
|
|
591
592
|
return document.body.querySelectorAll(selector);
|
|
@@ -820,7 +821,8 @@
|
|
|
820
821
|
this.selectOne = (table, field, where, order, start, limit) => {
|
|
821
822
|
return new Promise(resolve => {
|
|
822
823
|
this.select(table, [field], where, order, start, limit).then(d => {
|
|
823
|
-
|
|
824
|
+
var _a;
|
|
825
|
+
resolve((_a = d[field]) !== null && _a !== void 0 ? _a : undefined);
|
|
824
826
|
});
|
|
825
827
|
});
|
|
826
828
|
};
|
|
@@ -910,7 +912,8 @@
|
|
|
910
912
|
});
|
|
911
913
|
},
|
|
912
914
|
add(database, name, structure) {
|
|
913
|
-
|
|
915
|
+
var _a;
|
|
916
|
+
if (((_a = structure === null || structure === void 0 ? void 0 : structure.keys) === null || _a === void 0 ? void 0 : _a.PRIMARY) && (structure === null || structure === void 0 ? void 0 : structure.fields)) {
|
|
914
917
|
if (!db._structures[database]) {
|
|
915
918
|
db._structures[database] = {};
|
|
916
919
|
}
|
|
@@ -1364,13 +1367,14 @@
|
|
|
1364
1367
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1365
1368
|
exports.isCp = void 0;
|
|
1366
1369
|
const isCp = function (...args) {
|
|
1370
|
+
var _a;
|
|
1367
1371
|
if (!args.length) {
|
|
1368
1372
|
return false;
|
|
1369
1373
|
}
|
|
1370
1374
|
if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
|
|
1371
1375
|
for (let a of args) {
|
|
1372
1376
|
let res = bbn.cp.isComponent(a);
|
|
1373
|
-
if (!res || (0, isDom_1.isDom)(a) || !a.$el
|
|
1377
|
+
if (!res || (0, isDom_1.isDom)(a) || !((_a = a.$el) === null || _a === void 0 ? void 0 : _a.bbnCid)) {
|
|
1374
1378
|
return false;
|
|
1375
1379
|
}
|
|
1376
1380
|
}
|
|
@@ -3064,7 +3068,7 @@
|
|
|
3064
3068
|
"use strict";
|
|
3065
3069
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3066
3070
|
exports.defaultAjaxAbortFunction = void 0;
|
|
3067
|
-
const defaultAjaxAbortFunction = function (message, url =
|
|
3071
|
+
const defaultAjaxAbortFunction = function (message, url = "") {
|
|
3068
3072
|
(0, log_10.log)(message);
|
|
3069
3073
|
};
|
|
3070
3074
|
exports.defaultAjaxAbortFunction = defaultAjaxAbortFunction;
|
|
@@ -3171,7 +3175,7 @@
|
|
|
3171
3175
|
let requestId = (0, getRequestId_1.getRequestId)(url, data, datatype);
|
|
3172
3176
|
let loaderObj = (0, getLoader_2.getLoader)(requestId);
|
|
3173
3177
|
//log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
|
|
3174
|
-
if (loaderObj
|
|
3178
|
+
if (loaderObj === null || loaderObj === void 0 ? void 0 : loaderObj.loader) {
|
|
3175
3179
|
return loaderObj.loader;
|
|
3176
3180
|
}
|
|
3177
3181
|
if (bbn.env.token) {
|
|
@@ -5008,7 +5012,7 @@
|
|
|
5008
5012
|
return (0, ajax_1.ajax)(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
|
|
5009
5013
|
if (!filename) {
|
|
5010
5014
|
let cd = 'attachment; filename=';
|
|
5011
|
-
if (headers
|
|
5015
|
+
if ((headers === null || headers === void 0 ? void 0 : headers['content-disposition']) && headers['content-disposition'].indexOf(cd) === 0) {
|
|
5012
5016
|
filename = (0, substr_7.substr)(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
|
|
5013
5017
|
}
|
|
5014
5018
|
else {
|
|
@@ -7869,7 +7873,7 @@
|
|
|
7869
7873
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7870
7874
|
exports.makeReactive = void 0;
|
|
7871
7875
|
const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
7872
|
-
const parentString = parent
|
|
7876
|
+
const parentString = (parent === null || parent === void 0 ? void 0 : parent.$cid) || '';
|
|
7873
7877
|
const prefix = '__bbn_' + (parentString ? parentString + '_' : '');
|
|
7874
7878
|
if (obj && typeof obj === 'object' && [undefined, Object, Array].includes(obj.constructor)) {
|
|
7875
7879
|
if (obj.__bbnIsProxy && obj.__bbnParent === parent) {
|
|
@@ -7910,7 +7914,7 @@
|
|
|
7910
7914
|
}
|
|
7911
7915
|
if (key === '__bbnRoot') {
|
|
7912
7916
|
let root = obj;
|
|
7913
|
-
while (root && root
|
|
7917
|
+
while (root && (root === null || root === void 0 ? void 0 : root.__bbnTarget)) {
|
|
7914
7918
|
root = root.__bbnTarget;
|
|
7915
7919
|
}
|
|
7916
7920
|
return root;
|
|
@@ -10027,7 +10031,7 @@
|
|
|
10027
10031
|
Object.defineProperty(exports, "__cjsModule", { value: true });
|
|
10028
10032
|
Object.defineProperty(exports, "default", { value: require(name) });
|
|
10029
10033
|
}
|
|
10030
|
-
catch {
|
|
10034
|
+
catch (_a) {
|
|
10031
10035
|
throw Error(['module "', name, '" not found.'].join(''));
|
|
10032
10036
|
}
|
|
10033
10037
|
};
|
package/dist/db.js
CHANGED
|
@@ -78,7 +78,8 @@ const dbObject = function (dbName) {
|
|
|
78
78
|
this.selectOne = (table, field, where, order, start, limit) => {
|
|
79
79
|
return new Promise(resolve => {
|
|
80
80
|
this.select(table, [field], where, order, start, limit).then(d => {
|
|
81
|
-
|
|
81
|
+
var _a;
|
|
82
|
+
resolve((_a = d[field]) !== null && _a !== void 0 ? _a : undefined);
|
|
82
83
|
});
|
|
83
84
|
});
|
|
84
85
|
};
|
|
@@ -168,7 +169,8 @@ const db = {
|
|
|
168
169
|
});
|
|
169
170
|
},
|
|
170
171
|
add(database, name, structure) {
|
|
171
|
-
|
|
172
|
+
var _a;
|
|
173
|
+
if (((_a = structure === null || structure === void 0 ? void 0 : structure.keys) === null || _a === void 0 ? void 0 : _a.PRIMARY) && (structure === null || structure === void 0 ? void 0 : structure.fields)) {
|
|
172
174
|
if (!db._structures[database]) {
|
|
173
175
|
db._structures[database] = {};
|
|
174
176
|
}
|
package/dist/fn/ajax/ajax.js
CHANGED
|
@@ -100,7 +100,7 @@ const ajax = function (url, datatype, data, success, failure, abort) {
|
|
|
100
100
|
let requestId = getRequestId(url, data, datatype);
|
|
101
101
|
let loaderObj = getLoader(requestId);
|
|
102
102
|
//log("IN AJAX", loaderObj? loaderObj.loader : "NO LOADER")
|
|
103
|
-
if (loaderObj
|
|
103
|
+
if (loaderObj === null || loaderObj === void 0 ? void 0 : loaderObj.loader) {
|
|
104
104
|
return loaderObj.loader;
|
|
105
105
|
}
|
|
106
106
|
if (bbn.env.token) {
|
package/dist/fn/ajax/download.js
CHANGED
|
@@ -42,7 +42,7 @@ const download = function (url, filename, params) {
|
|
|
42
42
|
return ajax(url, 'blob', params || { _bbn_download: 1 }, (d, headers) => {
|
|
43
43
|
if (!filename) {
|
|
44
44
|
let cd = 'attachment; filename=';
|
|
45
|
-
if (headers
|
|
45
|
+
if ((headers === null || headers === void 0 ? void 0 : headers['content-disposition']) && headers['content-disposition'].indexOf(cd) === 0) {
|
|
46
46
|
filename = substr(headers['content-disposition'], cd.length + 1, headers['content-disposition'].length - cd.length - 2);
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { log } from
|
|
2
|
-
const defaultAjaxAbortFunction = function (message, url =
|
|
1
|
+
import { log } from "../browser/log";
|
|
2
|
+
const defaultAjaxAbortFunction = function (message, url = "") {
|
|
3
3
|
log(message);
|
|
4
4
|
};
|
|
5
5
|
export { defaultAjaxAbortFunction };
|
|
@@ -7,7 +7,7 @@ import { warning } from '../browser/warning';
|
|
|
7
7
|
import { isFunction } from '../type/isFunction';
|
|
8
8
|
import { isSame } from '../type/isSame';
|
|
9
9
|
const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
10
|
-
const parentString = parent
|
|
10
|
+
const parentString = (parent === null || parent === void 0 ? void 0 : parent.$cid) || '';
|
|
11
11
|
const prefix = '__bbn_' + (parentString ? parentString + '_' : '');
|
|
12
12
|
if (obj && typeof obj === 'object' && [undefined, Object, Array].includes(obj.constructor)) {
|
|
13
13
|
if (obj.__bbnIsProxy && obj.__bbnParent === parent) {
|
|
@@ -48,7 +48,7 @@ const makeReactive = function (obj, onSet, parent, parentProp) {
|
|
|
48
48
|
}
|
|
49
49
|
if (key === '__bbnRoot') {
|
|
50
50
|
let root = obj;
|
|
51
|
-
while (root && root
|
|
51
|
+
while (root && (root === null || root === void 0 ? void 0 : root.__bbnTarget)) {
|
|
52
52
|
root = root.__bbnTarget;
|
|
53
53
|
}
|
|
54
54
|
return root;
|
|
@@ -12,6 +12,7 @@ const checkType = function (value, type, msg, ...logs) {
|
|
|
12
12
|
}
|
|
13
13
|
const typesList = [];
|
|
14
14
|
each(type, (t) => {
|
|
15
|
+
var _a;
|
|
15
16
|
if (t === String) {
|
|
16
17
|
t = 'string';
|
|
17
18
|
}
|
|
@@ -31,7 +32,7 @@ const checkType = function (value, type, msg, ...logs) {
|
|
|
31
32
|
t = 'function';
|
|
32
33
|
}
|
|
33
34
|
if (isFunction(t)) {
|
|
34
|
-
typesList.push(t.name || t.constructor
|
|
35
|
+
typesList.push(t.name || ((_a = t.constructor) === null || _a === void 0 ? void 0 : _a.name) || t.toString());
|
|
35
36
|
if (value instanceof t) {
|
|
36
37
|
ok = true;
|
|
37
38
|
return false;
|
package/dist/fn/type/isCp.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { isDom } from './isDom';
|
|
2
2
|
const isCp = function (...args) {
|
|
3
|
+
var _a;
|
|
3
4
|
if (!args.length) {
|
|
4
5
|
return false;
|
|
5
6
|
}
|
|
6
7
|
if ('cp' in bbn && 'isComponent' in bbn['cp'] && (typeof bbn['cp'].isComponent === 'function')) {
|
|
7
8
|
for (let a of args) {
|
|
8
9
|
let res = bbn.cp.isComponent(a);
|
|
9
|
-
if (!res || isDom(a) || !a.$el
|
|
10
|
+
if (!res || isDom(a) || !((_a = a.$el) === null || _a === void 0 ? void 0 : _a.bbnCid)) {
|
|
10
11
|
return false;
|
|
11
12
|
}
|
|
12
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbn/bbn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.72",
|
|
4
4
|
"description": "Javascript toolkit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
11
|
"bbn": "tsc && tsc-bundle tsconfig.json && git stage ./src/* && git stage ./*.ts && git stage ./*.json && git stage -f ./dist/bundle.js && git commit -m \"Latest changes\" && git push && npm version patch && npm publish",
|
|
12
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
13
|
+
"wtf": "echo \"Error: no test specified\" && exit 1"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
15
16
|
"toolkit"
|