enigmatic 0.9.19 → 0.9.20
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/elements/alert-box/index.html +0 -0
- package/elements/block-maker/block-maker.js +0 -0
- package/elements/block-maker/index.html +0 -0
- package/elements/chart-progress-bar/chart-progress-bar.js +0 -0
- package/elements/chart-radial-progress/chart-radial-progress.css +0 -0
- package/elements/chart-radial-progress/chart-radial-progress.js +0 -0
- package/elements/chart-radial-progress/index.html +0 -0
- package/elements/chart-statistic/chart-statistic.js +0 -0
- package/elements/chart-statistic/index.html +0 -0
- package/elements/data-grid/data-grid.js +0 -0
- package/elements/data-grid/index.html +0 -0
- package/elements/data-source/data-source.js +0 -0
- package/elements/data-source/index.html +0 -0
- package/elements/data-stream/data-stream.js +0 -0
- package/elements/data-stream/index.html +0 -0
- package/elements/font-awesome/font-awesome.js +0 -0
- package/elements/for-list/for-list.js +0 -0
- package/elements/hello-world/hello-world.js +0 -0
- package/elements/hello-world/index.html +0 -0
- package/elements/index.mjs +0 -0
- package/elements/map-embed/index.html +0 -0
- package/elements/map-embed/map-embed.js +0 -0
- package/elements/monaco-editor/monaco-editor.mjs +0 -0
- package/elements/online-indicator/online-indicator.js +0 -0
- package/elements/side-menu/side-menu.js +0 -0
- package/elements/tailwind-css/index.html +0 -0
- package/elements/test-runner/index.html +0 -0
- package/elements/test-runner/test-runner.js +0 -0
- package/elements/time-ago/time-ago.js +0 -0
- package/elements/toggle-switch/toggle-switch.js +0 -0
- package/elements/view-panel/index.html +0 -0
- package/elements/you-tube/index.html +0 -0
- package/elements/you-tube/you-tube.js +0 -0
- package/enigmatic.css +0 -0
- package/enigmatic.js +0 -0
- package/package.json +1 -1
- package/readme.md +65 -71
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/elements/index.mjs
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/enigmatic.css
CHANGED
|
File without changes
|
package/enigmatic.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,99 +1,93 @@
|
|
|
1
|
-
<<<<<<< HEAD
|
|
2
|
-
# enigmatic
|
|
3
|
-

|
|
4
|
-

|
|
5
|
-
|
|
6
|
-
Enigmatic is a JavaScript micro-library for creating web applications using lightweight web components.
|
|
7
|
-
It aspires to enable faster web app peformance, better reliabilty, and faster development process.
|
|
8
|
-
|
|
9
|
-
Enigmatic uses HTML attributes (directives) with a simple component model and data binding - all on existing HTML, JS, and CSS functionality.
|
|
10
|
-
- No special tooling, compilation or preprocessing, or new languages to learn
|
|
11
|
-
- Minimal JS and CSS core, includes basic components and two way data binding
|
|
12
|
-
|
|
13
|
-
## Quick Start
|
|
14
|
-
Just create an HTML page
|
|
15
|
-
````
|
|
16
|
-
<script src='//unpkg.com/enigmatic'></script>
|
|
17
|
-
<link href='//unpkg.com/enigmatic.css' rel='stylesheet'>
|
|
18
|
-
````
|
|
19
|
-
|
|
20
|
-
## Enigmatic also includes some helpers
|
|
21
|
-
````
|
|
22
|
-
window.$ -- $([body])[0] // Query Selector All
|
|
23
|
-
window.load -- ('mycontrol.js') // Load JS or CSS
|
|
24
|
-
Element.css -- e.css('color:red') // Add css to an element
|
|
25
|
-
Element.child -- body.child('span') // Add a child element
|
|
26
|
-
|
|
27
|
-
````
|
|
28
|
-
|
|
29
|
-
## window.data
|
|
30
|
-
window.data is a single data object, that holds all the data for the app. It's a JS object, with each key being an identifier, or *channel* to use with controls that have the data attribute.
|
|
31
|
-
|
|
32
|
-
Controls interact with the data object to send and receive data, using a data attribute and .set() method.
|
|
33
|
-
````
|
|
34
|
-
<!-- Just use the *data* attribute
|
|
35
|
-
<hellodata data='mykey'></hellodata>
|
|
36
|
-
|
|
37
|
-
window.data.set('mykey', 'Hello world!')
|
|
38
|
-
````
|
|
39
|
-
|
|
40
|
-
One may also create a simple counter, interacting with plain ole (non-control) HTML elements.
|
|
41
|
-
In this example, the window.data object and control's data attribute take care of the binding.
|
|
42
|
-
````
|
|
43
|
-
<button onclick='data.count++'>Click me</button>
|
|
44
|
-
<counter data='count'></counter>
|
|
45
|
-
|
|
46
|
-
data.count = 0
|
|
47
|
-
const counter = e =>
|
|
48
|
-
e.innerHTML = 'Ready'
|
|
49
|
-
````
|
|
50
|
-
=======
|
|
51
1
|
# enigmatic
|
|
52
|
-
|
|
53
|
-
|
|
2
|
+

|
|
3
|
+

|
|
54
4
|
|
|
55
5
|
Enigmatic is a JavaScript micro-library for creating web applications using lightweight web components.
|
|
56
6
|
It aspires to enable faster web app peformance, better reliabilty, and faster development process.
|
|
57
7
|
|
|
58
8
|
Enigmatic uses HTML attributes (directives) with a simple component model and data binding - all on existing HTML, JS, and CSS functionality.
|
|
59
|
-
- No special tooling, compilation or preprocessing, or new languages to learn
|
|
60
9
|
- Minimal JS and CSS core, includes basic components and two way data binding
|
|
61
10
|
|
|
62
11
|
## Quick Start
|
|
63
12
|
Just create an HTML page
|
|
64
13
|
````
|
|
65
14
|
<script src='//unpkg.com/enigmatic'></script>
|
|
15
|
+
<script src='//unpkg.com/enigmatic/elements/hello-world/hello-world.js'></script>
|
|
66
16
|
<link href='//unpkg.com/enigmatic.css' rel='stylesheet'>
|
|
67
17
|
````
|
|
68
18
|
|
|
69
19
|
## Enigmatic also includes some helpers
|
|
70
20
|
````
|
|
71
|
-
window.$ -- $([body])
|
|
72
|
-
window
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
21
|
+
window.$ -- $([body]) // Query Selector
|
|
22
|
+
window.$$ -- $$([div])[0] // Query Selector All
|
|
23
|
+
await window.loadJS('https://.../some.js')
|
|
24
|
+
await window.loadCSS('https://.../some.css')
|
|
25
|
+
await window.wait(1000) // Pause execution
|
|
26
|
+
await window.ready() // Pause until page loads
|
|
27
|
+
body.child(type, id) // Append an element to body
|
|
28
|
+
````
|
|
29
|
+
Encapsulated components make it possible to not have inlined JS
|
|
30
|
+
|
|
31
|
+
But, code can be inlined to run after the page is completely loaded
|
|
32
|
+
|
|
33
|
+
### window.main
|
|
34
|
+
````
|
|
35
|
+
<script>
|
|
36
|
+
main = () => {
|
|
37
|
+
// do something after page is loaded
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
76
40
|
````
|
|
77
41
|
|
|
78
42
|
## window.data
|
|
79
|
-
window.data is a single data object, that holds all the data for the app.
|
|
43
|
+
window.data is a single data object, that holds all the data/state for the app.
|
|
44
|
+
It's a simple object, with each key being an identifier, or *channel* to use with elements that specify the data attribute
|
|
80
45
|
|
|
81
|
-
Controls
|
|
46
|
+
Controls set the data object to send and receive data, using a data attribute and .set() method of a custom element
|
|
82
47
|
````
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
48
|
+
<hello-world data='mykey'></hello-world>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
main = () => data.mykey = 'Hello world!'
|
|
52
|
+
</script>
|
|
87
53
|
````
|
|
88
54
|
|
|
89
|
-
One may
|
|
90
|
-
In this example, the window.data object and control's data attribute take care of the binding.
|
|
55
|
+
One may create a simple counter. In this example, the window.data object takes care of the binding
|
|
91
56
|
````
|
|
92
57
|
<button onclick='data.count++'>Click me</button>
|
|
93
|
-
<counter data='count'
|
|
58
|
+
<simple-counter data='count'>0</simple-counter>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
main = () => data.count = 0
|
|
62
|
+
</script>
|
|
63
|
+
````
|
|
64
|
+
|
|
65
|
+
## Enigmatic element (e-e)
|
|
66
|
+
e-e is an element that may be extended to create custom elements
|
|
67
|
+
|
|
68
|
+
It includes some simple methods
|
|
69
|
+
````
|
|
70
|
+
hide()
|
|
71
|
+
show()
|
|
72
|
+
toggle([class1, class2]) - toggle any number of classes
|
|
73
|
+
set() = handles window.data object
|
|
74
|
+
child(type, id) - append a child element
|
|
75
|
+
````
|
|
76
|
+
|
|
77
|
+
## Simple page layout
|
|
78
|
+
Pages are simple grids, and cells may also be grids
|
|
79
|
+
Only a couple of directives to lay out the page
|
|
80
|
+
|
|
81
|
+
## enigmatic.css
|
|
82
|
+
Optional CSS with some helper classes
|
|
83
|
+
ie.. bg-red, red, center, fixed, margins, padding, etc..
|
|
84
|
+
|
|
85
|
+
## Custom Elements and the Data object
|
|
86
|
+
Custom elements can be created according to the HTML standard, and interact with data without the need for additinal abstractions and sugar
|
|
87
|
+
|
|
88
|
+
A JSON fetch element, data-source, handles the fetch of data
|
|
89
|
+
````
|
|
90
|
+
<my-list-element id='mye' data='users.results'></my-list-element>
|
|
94
91
|
|
|
95
|
-
data.
|
|
96
|
-
const counter = e =>
|
|
97
|
-
e.innerHTML = 'Ready'
|
|
92
|
+
<data-source href='https://randomuser.me/api' target='users'></data-source>
|
|
98
93
|
````
|
|
99
|
-
>>>>>>> 4f836882c656008703aad8afc30997772829f574
|