@bbn/bbn 1.0.209 → 1.0.211
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/bbn.js +2 -18479
- package/dist/bbn.js.map +1 -1
- package/dist/fn/ajax/callback.js +2 -1
- package/dist/fn/form/submit.js +6 -6
- package/package.json +14 -6
package/dist/fn/ajax/callback.js
CHANGED
|
@@ -50,7 +50,8 @@ export default function callback(url, res, fn, fn2, ele) {
|
|
|
50
50
|
if (isObj && res.prescript) {
|
|
51
51
|
/* var ok can be changed to false in prescript execution */
|
|
52
52
|
try {
|
|
53
|
-
|
|
53
|
+
var preFn = new Function(res.prescript);
|
|
54
|
+
preFn();
|
|
54
55
|
}
|
|
55
56
|
catch (e) {
|
|
56
57
|
error(e.message || '');
|
package/dist/fn/form/submit.js
CHANGED
|
@@ -36,15 +36,15 @@ export default function submit(form, e, fn) {
|
|
|
36
36
|
//$form.attr("action", null);
|
|
37
37
|
form.setAttribute('action', null);
|
|
38
38
|
//$form.data("bbnSubmit", 1);
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
var args = [url, data];
|
|
40
|
+
if (!fn && form.getAttribute('data-script')) {
|
|
41
|
+
fn = new Function(form.getAttribute('data-script'));
|
|
42
|
+
fn = fn();
|
|
41
43
|
}
|
|
42
44
|
if (fn) {
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
post(url, data);
|
|
45
|
+
args.push(fn);
|
|
47
46
|
}
|
|
47
|
+
post.apply(void 0, args);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbn/bbn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.211",
|
|
4
4
|
"description": "Javascript toolkit",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"gitauto": "git stage ./src/* ./*.ts ./*.json ./*.config.js ./test/*.mjs && git stage -f ./dist/* && git commit -m \"Latest changes\"",
|
|
14
14
|
"gitend": "git stage ./package.json && git stage -f ./dist/* && git commit -m \"Latest changes\" && git push",
|
|
15
15
|
"pub": "npm version patch && npm publish",
|
|
16
|
-
"build": "./node_modules/.bin/
|
|
16
|
+
"build": "./node_modules/.bin/rollup -c",
|
|
17
17
|
"all": "npm run type && npm run test && npm run gitauto && npm version patch && npm run build && npm run gitend && npm publish",
|
|
18
18
|
"test": "IS_TESTING=true ./node_modules/.bin/mocha -r jsdom-global/register",
|
|
19
19
|
"wtf": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -24,22 +24,30 @@
|
|
|
24
24
|
"author": "Thomas Nabet <thomas.nabet@gmail.com>",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"devDependencies": {
|
|
27
|
+
"chai": "^4.3.10",
|
|
27
28
|
"jsdom": "22.1.0",
|
|
28
29
|
"jsdom-global": "3.0.2",
|
|
29
30
|
"mocha": "^10.2.0",
|
|
30
31
|
"ts-loader": "^9.5.0",
|
|
32
|
+
"typescript": "^5.4.5",
|
|
31
33
|
"webpack": "^5.88.2",
|
|
32
|
-
"webpack-cli": "^5.1.4"
|
|
33
|
-
"chai": "^4.3.10",
|
|
34
|
-
"typescript": "5.1.6"
|
|
34
|
+
"webpack-cli": "^5.1.4"
|
|
35
35
|
},
|
|
36
36
|
"bugs": {
|
|
37
37
|
"url": "https://github.com/nabab/bbn-js/issues"
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/nabab/bbn-js#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
42
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
43
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
44
|
+
"@rollup/plugin-replace": "^5.0.5",
|
|
45
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
41
46
|
"axios": "^1.5.1",
|
|
42
|
-
"dayjs": "^1.11.10"
|
|
47
|
+
"dayjs": "^1.11.10",
|
|
48
|
+
"rollup": "^4.16.2",
|
|
49
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
50
|
+
"tslib": "^2.6.2"
|
|
43
51
|
},
|
|
44
52
|
"directories": {
|
|
45
53
|
"doc": "doc",
|