ziko 0.0.20 → 0.0.22
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/README.md +2 -2
- package/dist/ziko.cjs +463 -189
- package/dist/ziko.js +463 -189
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +457 -189
- package/package.json +1 -1
- package/src/math/functions/helper.js +30 -20
- package/src/math/functions/index.js +2 -1
- package/src/math/index.js +2 -2
- package/src/math/utils/mapfun.js +3 -2
- package/src/ui/elements/primitives/ZikoUIContainerElement.js +108 -149
- package/src/ui/elements/primitives/ZikoUIElement.js +126 -13
- package/src/ui/elements/primitives/misc/hyperscript.js +144 -0
- package/src/ui/elements/primitives/misc/index.js +3 -1
- package/src/ui/elements/primitives/misc/suspense.js +42 -0
- package/starter/bin/index.js +1 -1
- package/src/math/complex/Fractals/julia.js +0 -0
- package/src/ui/elements/derived/elements/Notification.js +0 -0
- package/src/ui/elements/derived/elements/Popover.js +0 -0
- package/src/ui/elements/derived/elements/Popup.js +0 -0
- package/src/ui/elements/derived/elements/Swipper.js +0 -4
- package/src/ui/elements/derived/elements/Timeline.js +0 -0
- package/src/ui/elements/derived/elements/Toast.js +0 -0
- package/src/ui/elements/derived/elements/Treeview.js +0 -0
- package/src/ui/elements/derived/elements/columns.js +0 -1
- package/src/ui/elements/derived/elements/fab.js +0 -0
- package/src/ui/elements/derived/elements/index.js +0 -9
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import ZikoUIElement from '../ZikoUIElement.js';
|
|
2
|
+
const _h=(tag, type, attributes, ...children)=>{
|
|
3
|
+
const { name, style, ...attrs } = attributes;
|
|
4
|
+
let element = new ZikoUIElement(tag, name, type);
|
|
5
|
+
style && element.style(style);
|
|
6
|
+
attrs && element.setAttr(attrs);
|
|
7
|
+
children && element.append(...children);
|
|
8
|
+
return element;
|
|
9
|
+
}
|
|
10
|
+
const h=(tag, attributes = {}, ...children)=> _h(tag, "html", attributes, ...children);
|
|
11
|
+
const s=(tag, attributes = {}, ...children)=> _h(tag, "svg", attributes, ...children);
|
|
12
|
+
|
|
13
|
+
const HTMLTags = [
|
|
14
|
+
'a',
|
|
15
|
+
'abb',
|
|
16
|
+
'address',
|
|
17
|
+
'area',
|
|
18
|
+
'article',
|
|
19
|
+
'aside',
|
|
20
|
+
'audio',
|
|
21
|
+
'b',
|
|
22
|
+
'base',
|
|
23
|
+
'bdi',
|
|
24
|
+
'bdo',
|
|
25
|
+
'blockquote',
|
|
26
|
+
'br',
|
|
27
|
+
'button',
|
|
28
|
+
'canvas',
|
|
29
|
+
'caption',
|
|
30
|
+
'cite',
|
|
31
|
+
'code',
|
|
32
|
+
'col',
|
|
33
|
+
'colgroup',
|
|
34
|
+
'data',
|
|
35
|
+
'datalist',
|
|
36
|
+
'dd',
|
|
37
|
+
'del',
|
|
38
|
+
'details',
|
|
39
|
+
'dfn',
|
|
40
|
+
'dialog',
|
|
41
|
+
'div',
|
|
42
|
+
'dl',
|
|
43
|
+
'dt',
|
|
44
|
+
'em',
|
|
45
|
+
'embed',
|
|
46
|
+
'fieldset',
|
|
47
|
+
'figcaption',
|
|
48
|
+
'figure',
|
|
49
|
+
'footer',
|
|
50
|
+
'form',
|
|
51
|
+
'h1',
|
|
52
|
+
'h2',
|
|
53
|
+
'h3',
|
|
54
|
+
'h4',
|
|
55
|
+
'h5',
|
|
56
|
+
'h6',
|
|
57
|
+
'header',
|
|
58
|
+
'hgroup',
|
|
59
|
+
'hr',
|
|
60
|
+
'i',
|
|
61
|
+
'iframe',
|
|
62
|
+
'img',
|
|
63
|
+
'ipnut',
|
|
64
|
+
'ins',
|
|
65
|
+
'kbd',
|
|
66
|
+
'label',
|
|
67
|
+
'legend',
|
|
68
|
+
'li',
|
|
69
|
+
'main',
|
|
70
|
+
'map',
|
|
71
|
+
'mark',
|
|
72
|
+
'menu',
|
|
73
|
+
'meter',
|
|
74
|
+
'nav',
|
|
75
|
+
'object',
|
|
76
|
+
'ol',
|
|
77
|
+
'optgroup',
|
|
78
|
+
'option',
|
|
79
|
+
'output',
|
|
80
|
+
'p',
|
|
81
|
+
'param',
|
|
82
|
+
'picture',
|
|
83
|
+
'pre',
|
|
84
|
+
'progress',
|
|
85
|
+
'q',
|
|
86
|
+
'rp',
|
|
87
|
+
'rt',
|
|
88
|
+
'ruby',
|
|
89
|
+
's',
|
|
90
|
+
'samp',
|
|
91
|
+
'search',
|
|
92
|
+
'section',
|
|
93
|
+
'select',
|
|
94
|
+
'small',
|
|
95
|
+
'source',
|
|
96
|
+
'span',
|
|
97
|
+
'strong',
|
|
98
|
+
'sub',
|
|
99
|
+
'summary',
|
|
100
|
+
'sup',
|
|
101
|
+
'svg',
|
|
102
|
+
'table',
|
|
103
|
+
'tbody',
|
|
104
|
+
'td',
|
|
105
|
+
'template',
|
|
106
|
+
'textarea',
|
|
107
|
+
'tfoot',
|
|
108
|
+
'th',
|
|
109
|
+
'thead',
|
|
110
|
+
'time',
|
|
111
|
+
'title',
|
|
112
|
+
'tr',
|
|
113
|
+
'track',
|
|
114
|
+
'u',
|
|
115
|
+
'ul',
|
|
116
|
+
'var',
|
|
117
|
+
'video',
|
|
118
|
+
'wbr'
|
|
119
|
+
];
|
|
120
|
+
|
|
121
|
+
const SVGTags = [
|
|
122
|
+
"svg", "g", "defs", "symbol", "use", "image", "switch",
|
|
123
|
+
"rect", "circle", "ellipse", "line", "polyline", "polygon", "path",
|
|
124
|
+
"text", "tspan", "textPath", "altGlyph", "altGlyphDef", "altGlyphItem", "glyph", "glyphRef",
|
|
125
|
+
"linearGradient", "radialGradient", "pattern", "solidColor",
|
|
126
|
+
"filter", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix",
|
|
127
|
+
"feDiffuseLighting", "feDisplacementMap", "feDropShadow", "feFlood", "feFuncA", "feFuncR", "feFuncG", "feFuncB",
|
|
128
|
+
"feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "feSpecularLighting",
|
|
129
|
+
"feTile", "feTurbulence",
|
|
130
|
+
"animate", "animateMotion", "animateTransform", "set",
|
|
131
|
+
"script",
|
|
132
|
+
"desc", "title", "metadata", "foreignObject"
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
const hTags = HTMLTags.reduce((acc, key) => {
|
|
136
|
+
acc[key] = (attr, ...children) => h(key, attr, ...children);
|
|
137
|
+
return acc;
|
|
138
|
+
}, {});
|
|
139
|
+
const sTags = SVGTags.reduce((acc, key) => {
|
|
140
|
+
acc[key] = (attr, ...children) => h(key, attr, ...children);
|
|
141
|
+
return acc;
|
|
142
|
+
}, {});
|
|
143
|
+
|
|
144
|
+
export { h, s, hTags, sTags };
|
|
@@ -85,7 +85,9 @@ class ZikoUIBr extends ZikoUIElement {
|
|
|
85
85
|
const link=(href,...UIElement)=>new ZikoUILink(href).append(...UIElement);
|
|
86
86
|
const html=(tag,...UIElement)=>new ZikoUIHtmlTag(tag).append(...UIElement);
|
|
87
87
|
const btn = (value) => new ZikoUIBtn(value);
|
|
88
|
-
export * from "./xml-wrapper.js"
|
|
88
|
+
export * from "./xml-wrapper.js";
|
|
89
|
+
export * from "./suspense.js"
|
|
90
|
+
export * from "./hyperscript.js"
|
|
89
91
|
export{
|
|
90
92
|
html,
|
|
91
93
|
btn,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
// function loadComponent() {
|
|
3
|
+
// return new Promise((resolve) => {
|
|
4
|
+
// setTimeout(() => {
|
|
5
|
+
// resolve(p(1000))
|
|
6
|
+
// }, 500);
|
|
7
|
+
// });
|
|
8
|
+
// }
|
|
9
|
+
|
|
10
|
+
// Suspense(p("Loading ..."),()=>fetch('https://jsonplaceholder.typicode.com/todos/1')
|
|
11
|
+
// .then(response => response.json())
|
|
12
|
+
// .then(json => h2(json.title)))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ZikoUISuspense extends ZikoUIElement{
|
|
17
|
+
constructor(fallback_ui, callback){
|
|
18
|
+
super("div", "suspense")
|
|
19
|
+
this.setAttr({
|
|
20
|
+
dataTemp : "suspense"
|
|
21
|
+
})
|
|
22
|
+
this.fallback_ui = fallback_ui
|
|
23
|
+
this.append(fallback_ui);
|
|
24
|
+
(async ()=>{
|
|
25
|
+
try{
|
|
26
|
+
const ui = await callback()
|
|
27
|
+
fallback_ui.unrender()
|
|
28
|
+
this.append(ui)
|
|
29
|
+
// console.log(content)
|
|
30
|
+
}
|
|
31
|
+
catch(error){
|
|
32
|
+
console.log({error})
|
|
33
|
+
}
|
|
34
|
+
})()
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const Suspense = (fallback_ui, callback) => new ZikoUISuspense(fallback_ui, callback);
|
|
39
|
+
export{
|
|
40
|
+
ZikoUISuspense,
|
|
41
|
+
Suspense
|
|
42
|
+
}
|
package/starter/bin/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// dipslay table
|
|
File without changes
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from "./accordion/index.js";
|
|
2
|
-
export * from "./carousel/index.js";
|
|
3
|
-
export * from "./code-note/index.js";
|
|
4
|
-
export * from "./tabs/index.js";
|
|
5
|
-
export * from "./alert/index.js";
|
|
6
|
-
export * from "./splitter/index.js";
|
|
7
|
-
export * from "./pagination/index.js";
|
|
8
|
-
export * from "./menu/index.js";
|
|
9
|
-
export * from "./modal/index.js"
|