not-bulma 1.0.43 → 1.0.45
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/package.json +49 -49
- package/src/frame/components/table/notTableCell.svelte +59 -62
- package/src/frame/index.js +44 -40
- package/src/frame/stores.js +56 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "not-bulma",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
4
4
|
"description": "not-* family UI components on Bulma CSS Framework",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"svelte": "src/index.js",
|
|
@@ -55,82 +55,82 @@
|
|
|
55
55
|
"homepage": "https://github.com/interrupter/not-bulma#readme",
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"babel-polyfill": "^6.26.0",
|
|
58
|
-
"bulma": "^0.9.
|
|
58
|
+
"bulma": "^0.9.4",
|
|
59
59
|
"bulma-pageloader": "*",
|
|
60
60
|
"bulma-switch": "^2.0.4",
|
|
61
|
-
"core-js": "^3.
|
|
62
|
-
"mocha": "^
|
|
63
|
-
"not-path": "^1.0.
|
|
64
|
-
"not-validation": "^0.0.
|
|
65
|
-
"regenerator-runtime": "^0.13.
|
|
61
|
+
"core-js": "^3.27.2",
|
|
62
|
+
"mocha": "^10.2.0",
|
|
63
|
+
"not-path": "^1.0.4",
|
|
64
|
+
"not-validation": "^0.0.8",
|
|
65
|
+
"regenerator-runtime": "^0.13.11",
|
|
66
66
|
"simple-svelte-autocomplete": "*",
|
|
67
67
|
"wolfy87-eventemitter": "^5.2.9"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@babel/core": "^7.
|
|
71
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
72
|
-
"@babel/plugin-proposal-private-methods": "^7.
|
|
73
|
-
"@babel/plugin-transform-arrow-functions": "^7.
|
|
74
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
75
|
-
"@babel/preset-env": "^7.
|
|
76
|
-
"@cypress/code-coverage": "^3.
|
|
77
|
-
"autoprefixer": "^10.4.
|
|
70
|
+
"@babel/core": "^7.20.12",
|
|
71
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
72
|
+
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
73
|
+
"@babel/plugin-transform-arrow-functions": "^7.20.7",
|
|
74
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
75
|
+
"@babel/preset-env": "^7.20.2",
|
|
76
|
+
"@cypress/code-coverage": "^3.10.0",
|
|
77
|
+
"autoprefixer": "^10.4.13",
|
|
78
78
|
"babel-cli": "^6.26.0",
|
|
79
79
|
"babel-eslint": "^10.1.0",
|
|
80
|
-
"babel-loader": "^
|
|
80
|
+
"babel-loader": "^9.1.2",
|
|
81
81
|
"babel-plugin-istanbul": "^6.1.1",
|
|
82
82
|
"connect-mongo": "^4.6.0",
|
|
83
83
|
"connect-mongodb-session": "^3.1.1",
|
|
84
84
|
"cors": "^2.8.5",
|
|
85
85
|
"cypress": "*",
|
|
86
|
-
"eslint": "^8.
|
|
87
|
-
"eslint-plugin-storybook": "^0.
|
|
88
|
-
"eslint-plugin-svelte3": "^
|
|
89
|
-
"express": "^4.
|
|
90
|
-
"express-fileupload": "^1.
|
|
91
|
-
"express-session": "^1.17.
|
|
92
|
-
"helmet": "^
|
|
86
|
+
"eslint": "^8.33.0",
|
|
87
|
+
"eslint-plugin-storybook": "^0.6.10",
|
|
88
|
+
"eslint-plugin-svelte3": "^4.0.0",
|
|
89
|
+
"express": "^4.18.2",
|
|
90
|
+
"express-fileupload": "^1.4.0",
|
|
91
|
+
"express-session": "^1.17.3",
|
|
92
|
+
"helmet": "^6.0.1",
|
|
93
93
|
"ink-docstrap": "^1.3.2",
|
|
94
|
-
"ioredis": "^5.0
|
|
94
|
+
"ioredis": "^5.3.0",
|
|
95
95
|
"istanbul": "^0.4.5",
|
|
96
96
|
"istanbul-lib-coverage": "^3.2.0",
|
|
97
97
|
"method-override": "^3.0.0",
|
|
98
|
-
"mongodb-memory-server": "^8.4
|
|
99
|
-
"mongoose": "^6.
|
|
100
|
-
"node-sass": "^
|
|
98
|
+
"mongodb-memory-server": "^8.11.4",
|
|
99
|
+
"mongoose": "^6.9.0",
|
|
100
|
+
"node-sass": "^8.0.0",
|
|
101
101
|
"not-config": "^0.1.5",
|
|
102
|
-
"not-error": "^0.2.
|
|
103
|
-
"not-inform": "^0.0.
|
|
104
|
-
"not-key": "0.0.
|
|
105
|
-
"not-locale": "^0.0.
|
|
102
|
+
"not-error": "^0.2.9",
|
|
103
|
+
"not-inform": "^0.0.28",
|
|
104
|
+
"not-key": "0.0.64",
|
|
105
|
+
"not-locale": "^0.0.22",
|
|
106
106
|
"not-log": "0.0.20",
|
|
107
|
-
"not-node": "^
|
|
108
|
-
"not-options": "^0.
|
|
109
|
-
"not-user": "^0.2.
|
|
110
|
-
"not-ws": "0.1.
|
|
107
|
+
"not-node": "^6.1.9",
|
|
108
|
+
"not-options": "^0.2.0",
|
|
109
|
+
"not-user": "^0.2.131",
|
|
110
|
+
"not-ws": "0.1.19",
|
|
111
111
|
"npm-run-all": "^4.1.5",
|
|
112
112
|
"nyc": "^15.1.0",
|
|
113
|
-
"postcss-cli": "^
|
|
113
|
+
"postcss-cli": "^10.1.0",
|
|
114
114
|
"pug-cli": "^1.0.0-alpha6",
|
|
115
|
-
"redis": "^4.
|
|
116
|
-
"rollup": "^
|
|
115
|
+
"redis": "^4.6.4",
|
|
116
|
+
"rollup": "^3.12.1",
|
|
117
117
|
"rollup-plugin-babel": "^4.4.0",
|
|
118
118
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
119
119
|
"rollup-plugin-eslint": "^7.0.0",
|
|
120
120
|
"rollup-plugin-filesize": "^9.1.2",
|
|
121
|
-
"rollup-plugin-istanbul": "^
|
|
121
|
+
"rollup-plugin-istanbul": "^4.0.0",
|
|
122
122
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
123
123
|
"rollup-plugin-postcss": "^4.0.2",
|
|
124
|
-
"rollup-plugin-sass": "^1.
|
|
125
|
-
"rollup-plugin-sizes": "^1.0.
|
|
124
|
+
"rollup-plugin-sass": "^1.12.17",
|
|
125
|
+
"rollup-plugin-sizes": "^1.0.5",
|
|
126
126
|
"rollup-plugin-svelte": "^7.1.0",
|
|
127
|
-
"sass": "^1.
|
|
128
|
-
"sass-loader": "^
|
|
129
|
-
"serve": "^
|
|
130
|
-
"simple-svelte-autocomplete": "^2.
|
|
131
|
-
"svelte": "^3.
|
|
132
|
-
"svelte-loader": "^3.1.
|
|
133
|
-
"terser": "^5.
|
|
127
|
+
"sass": "^1.58.0",
|
|
128
|
+
"sass-loader": "^13.2.0",
|
|
129
|
+
"serve": "^14.2.0",
|
|
130
|
+
"simple-svelte-autocomplete": "^2.5.1",
|
|
131
|
+
"svelte": "^3.55.1",
|
|
132
|
+
"svelte-loader": "^3.1.5",
|
|
133
|
+
"terser": "^5.16.2"
|
|
134
134
|
},
|
|
135
135
|
"nyc": {
|
|
136
136
|
"include": [
|
|
@@ -170,4 +170,4 @@
|
|
|
170
170
|
]
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
}
|
|
173
|
+
}
|
|
@@ -1,73 +1,70 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
onMount
|
|
5
|
-
} from 'svelte';
|
|
2
|
+
import notPath from "not-path";
|
|
3
|
+
import { onMount } from "svelte";
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
let title = "";
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
onMount(() => {
|
|
8
|
+
if (typeof field.type === "undefined") {
|
|
9
|
+
title = notPath.get(field.path, item, helpers);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
import notCommon from "../../common";
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
LOCALE
|
|
19
|
-
} from '../../../locale';
|
|
15
|
+
import { LOCALE } from "../../../locale";
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
import UIButtons from "../../../elements/button/ui.buttons.svelte";
|
|
18
|
+
import UILinks from "../../../elements/link/ui.links.svelte";
|
|
19
|
+
import UIImages from "../../../elements/image/ui.images.svelte";
|
|
20
|
+
import UIBooleans from "../../../elements/various/ui.booleans.svelte";
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
import TableSwitch from "./controls/ui.switch.svelte";
|
|
23
|
+
import TableTags from "./controls/ui.tags.svelte";
|
|
28
24
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
export let getItemId = (item) => item._id;
|
|
26
|
+
export let field = {};
|
|
27
|
+
export let item = {};
|
|
28
|
+
export let helpers = {};
|
|
33
29
|
</script>
|
|
34
30
|
|
|
35
|
-
<td class=
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
31
|
+
<td class={field.hideOnMobile ? "is-hidden-touch" : ""} {title}>
|
|
32
|
+
{#if field.type === "link"}
|
|
33
|
+
<UILinks values={notPath.get(field.path, item, helpers)} />
|
|
34
|
+
{:else if field.type === "button"}
|
|
35
|
+
<UIButtons values={notPath.get(field.path, item, helpers)} />
|
|
36
|
+
{:else if field.type === "image"}
|
|
37
|
+
<UIImages values={notPath.get(field.path, item, helpers)} />
|
|
38
|
+
{:else if field.type === "boolean"}
|
|
39
|
+
<UIBooleans values={notPath.get(field.path, item, helpers)} />
|
|
40
|
+
{:else if field.type === "tag"}
|
|
41
|
+
<TableTags values={notPath.get(field.path, item, helpers)} />
|
|
42
|
+
{:else if field.type === "switch"}
|
|
43
|
+
<TableSwitch
|
|
44
|
+
id={getItemId(item)}
|
|
45
|
+
fieldname={field.path}
|
|
46
|
+
on:change={field.onChange}
|
|
47
|
+
value={notPath.get(field.path, item, helpers)}
|
|
48
|
+
disabled={field.disabled}
|
|
49
|
+
readonly={field.readonly}
|
|
50
|
+
/>
|
|
51
|
+
{:else if field.type === "component"}
|
|
52
|
+
<svelte:component
|
|
53
|
+
this={field.component}
|
|
54
|
+
id={getItemId(item)}
|
|
55
|
+
on:change={field.onChange}
|
|
56
|
+
fieldname={field.path}
|
|
57
|
+
disabled={field.disabled}
|
|
58
|
+
readonly={field.readonly}
|
|
59
|
+
value={notPath.get(field.path, item, helpers)}
|
|
60
|
+
{...field.options}
|
|
61
|
+
/>
|
|
62
|
+
{:else if field && typeof field !== "undefined" && !isNaN(field.maxLength) && field.maxLength}
|
|
63
|
+
{notCommon.strLengthCap(
|
|
64
|
+
notPath.get(field.path, item, helpers),
|
|
65
|
+
field.maxLength
|
|
66
|
+
)}
|
|
67
|
+
{:else}
|
|
68
|
+
{$LOCALE[notPath.get(field.path, item, helpers)]}
|
|
69
|
+
{/if}
|
|
73
70
|
</td>
|
package/src/frame/index.js
CHANGED
|
@@ -3,67 +3,71 @@
|
|
|
3
3
|
/*
|
|
4
4
|
Common functions
|
|
5
5
|
*/
|
|
6
|
-
import notCommon from
|
|
6
|
+
import notCommon from "./common.js";
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
framework wide parser for data access
|
|
10
10
|
*/
|
|
11
|
-
import notPath from
|
|
11
|
+
import notPath from "not-path";
|
|
12
12
|
|
|
13
|
+
import notRouter from "./router.js";
|
|
13
14
|
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
import * as notAPI from './api';
|
|
15
|
+
import * as notAPI from "./api";
|
|
16
|
+
import * as notStores from "./stores";
|
|
17
17
|
/*
|
|
18
18
|
basic event handlers and core data modifiers
|
|
19
19
|
*/
|
|
20
|
-
import notBase from
|
|
20
|
+
import notBase from "./base.js";
|
|
21
21
|
|
|
22
|
-
import {COMPONENTS, FIELDS, VARIANTS} from
|
|
22
|
+
import { COMPONENTS, FIELDS, VARIANTS } from "./LIB.js";
|
|
23
23
|
/*
|
|
24
24
|
application main infrastructure setter
|
|
25
25
|
*/
|
|
26
|
-
import notApp from
|
|
26
|
+
import notApp from "./app.js";
|
|
27
27
|
/*
|
|
28
28
|
user controllers
|
|
29
29
|
*/
|
|
30
|
-
import notController from
|
|
31
|
-
import notRecord from
|
|
32
|
-
import notInterface from
|
|
30
|
+
import notController from "./controller.js";
|
|
31
|
+
import notRecord from "./record.js"; // wrapper for data with server live interactions
|
|
32
|
+
import notInterface from "./interface.js"; // wrapper for data with server live interactions
|
|
33
33
|
|
|
34
34
|
import {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
} from
|
|
35
|
+
notTable,
|
|
36
|
+
UIForm,
|
|
37
|
+
notForm,
|
|
38
|
+
notFormSet,
|
|
39
|
+
notFormUtils,
|
|
40
|
+
notBreadcrumbs,
|
|
41
|
+
notTopMenu,
|
|
42
|
+
notSideMenu,
|
|
43
|
+
} from "./components";
|
|
44
44
|
|
|
45
|
-
import notCRUD from
|
|
45
|
+
import notCRUD from "./crud/controller.crud.js";
|
|
46
46
|
|
|
47
47
|
const ncCRUD = notCRUD; //legacy alias
|
|
48
48
|
|
|
49
49
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
notCommon,
|
|
51
|
+
notPath,
|
|
52
|
+
notController,
|
|
53
|
+
notBase,
|
|
54
|
+
notRouter,
|
|
55
|
+
notRecord,
|
|
56
|
+
notInterface,
|
|
57
|
+
notApp,
|
|
58
|
+
notAPI,
|
|
59
|
+
notStores,
|
|
60
|
+
notCRUD,
|
|
61
|
+
ncCRUD,
|
|
62
|
+
COMPONENTS,
|
|
63
|
+
FIELDS,
|
|
64
|
+
VARIANTS,
|
|
65
|
+
notTable,
|
|
66
|
+
UIForm,
|
|
67
|
+
notForm,
|
|
68
|
+
notFormSet,
|
|
69
|
+
notFormUtils,
|
|
70
|
+
notBreadcrumbs,
|
|
71
|
+
notTopMenu,
|
|
72
|
+
notSideMenu,
|
|
69
73
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { writable } from "svelte/store";
|
|
2
|
+
|
|
3
|
+
const ALL = {};
|
|
4
|
+
|
|
5
|
+
function exist(key) {
|
|
6
|
+
return Object.hasOwn(ALL, key);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function get(key) {
|
|
10
|
+
if (exist(key)) {
|
|
11
|
+
return ALL[key];
|
|
12
|
+
} else {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function create(
|
|
18
|
+
key,
|
|
19
|
+
props = {
|
|
20
|
+
raw: [],
|
|
21
|
+
filtered: [],
|
|
22
|
+
selected: {},
|
|
23
|
+
}
|
|
24
|
+
) {
|
|
25
|
+
if (!exist(key)) {
|
|
26
|
+
if (Object.keys(props).length > 0) {
|
|
27
|
+
ALL[key] = {};
|
|
28
|
+
Object.keys(props).forEach((name) => {
|
|
29
|
+
ALL[key][name] = writable(props[name]);
|
|
30
|
+
});
|
|
31
|
+
} else {
|
|
32
|
+
throw new Error("store's props wasn't specified");
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return ALL[key];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Creates object that is fake Store
|
|
40
|
+
* Some time this is useful when you need to initialize local var,
|
|
41
|
+
* before you could get actual Stores from central storage by its ID
|
|
42
|
+
* @params {mixed} val data of type that is actual storage will contain
|
|
43
|
+
* @returns {Object}
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
function fake(val) {
|
|
47
|
+
return {
|
|
48
|
+
subscribe(f) {
|
|
49
|
+
f(val);
|
|
50
|
+
return () => {};
|
|
51
|
+
},
|
|
52
|
+
set() {},
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export { create, get, fake };
|