not-bulma 1.0.43 → 1.0.44

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-bulma",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "not-* family UI components on Bulma CSS Framework",
5
5
  "main": "src/index.js",
6
6
  "svelte": "src/index.js",
@@ -170,4 +170,4 @@
170
170
  ]
171
171
  }
172
172
  }
173
- }
173
+ }
@@ -3,67 +3,71 @@
3
3
  /*
4
4
  Common functions
5
5
  */
6
- import notCommon from './common.js';
6
+ import notCommon from "./common.js";
7
7
 
8
8
  /*
9
9
  framework wide parser for data access
10
10
  */
11
- import notPath from 'not-path';
11
+ import notPath from "not-path";
12
12
 
13
+ import notRouter from "./router.js";
13
14
 
14
- import notRouter from './router.js';
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 './base.js';
20
+ import notBase from "./base.js";
21
21
 
22
- import {COMPONENTS, FIELDS, VARIANTS} from './LIB.js';
22
+ import { COMPONENTS, FIELDS, VARIANTS } from "./LIB.js";
23
23
  /*
24
24
  application main infrastructure setter
25
25
  */
26
- import notApp from './app.js';
26
+ import notApp from "./app.js";
27
27
  /*
28
28
  user controllers
29
29
  */
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
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
- notTable,
36
- UIForm,
37
- notForm,
38
- notFormSet,
39
- notFormUtils,
40
- notBreadcrumbs,
41
- notTopMenu,
42
- notSideMenu
43
- } from './components';
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 './crud/controller.crud.js';
45
+ import notCRUD from "./crud/controller.crud.js";
46
46
 
47
47
  const ncCRUD = notCRUD; //legacy alias
48
48
 
49
49
  export {
50
- notCommon,
51
- notPath,
52
- notController,
53
- notBase,
54
- notRouter,
55
- notRecord,
56
- notInterface,
57
- notApp,
58
- notAPI,
59
- notCRUD, ncCRUD,
60
- COMPONENTS, FIELDS, VARIANTS,
61
- notTable,
62
- UIForm,
63
- notForm,
64
- notFormSet,
65
- notFormUtils,
66
- notBreadcrumbs,
67
- notTopMenu,
68
- notSideMenu
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 };