ziko 0.0.23 → 0.0.25
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/ziko.cjs +78 -2817
- package/dist/ziko.js +78 -2817
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +76 -2755
- package/package.json +1 -1
- package/src/app/globals.js +4 -2
- package/src/data/converter/index.js +2 -6
- package/src/data/parser/index.js +1 -1
- package/src/graphics/canvas/index.js +176 -2
- package/src/graphics/canvas/utils/floodFill.js +0 -1
- package/src/graphics/svg/index.js +69 -2
- package/src/reactivity/hooks/index.js +1 -1
- package/src/ui/elements/{primitives/ZikoUIElement.js → ZikoUIElement.js} +8 -9
- package/src/ui/elements/{derived/flex → flex}/index.js +2 -2
- package/src/ui/elements/{derived/grid → grid}/index.js +2 -2
- package/src/ui/elements/{primitives/index.js → index.js} +3 -1
- package/src/ui/elements/{primitives/io → io}/Form/index.js +1 -1
- package/src/ui/elements/{primitives/io → io}/Inputs/__helpers__.js +1 -1
- package/src/ui/elements/{primitives/io → io}/Inputs/input/index.js +1 -1
- package/src/ui/elements/{primitives/list → list}/index.js +2 -3
- package/src/ui/elements/{primitives/misc → misc}/index.js +2 -3
- package/src/ui/elements/{primitives/semantic → semantic}/index.js +8 -8
- package/src/ui/elements/{primitives/table → table}/table.js +1 -1
- package/src/ui/elements/{primitives/text → text}/__ZikoUIText__.js +3 -4
- package/src/ui/index.js +21 -21
- package/src/ui/utils/index.js +1 -1
- package/src/data/parser/markdown.js +0 -0
- package/src/graphics/canvas/canvas.js +0 -176
- package/src/graphics/canvas/elements/Basic/arc.js +0 -43
- package/src/graphics/canvas/elements/Basic/image.js +0 -0
- package/src/graphics/canvas/elements/Basic/line.js +0 -26
- package/src/graphics/canvas/elements/Basic/path.js +0 -0
- package/src/graphics/canvas/elements/Basic/points.js +0 -48
- package/src/graphics/canvas/elements/Basic/polygon.js +0 -7
- package/src/graphics/canvas/elements/Basic/polyline.js +0 -0
- package/src/graphics/canvas/elements/Basic/rect.js +0 -46
- package/src/graphics/canvas/elements/Basic/text.js +0 -0
- package/src/graphics/canvas/elements/Chart/histogram.js +0 -0
- package/src/graphics/canvas/elements/Chart/plot.js +0 -0
- package/src/graphics/canvas/elements/Chart/scatter.js +0 -2
- package/src/graphics/canvas/elements/Chart/stem.js +0 -0
- package/src/graphics/canvas/elements/Element.js +0 -115
- package/src/graphics/canvas/elements/index.js +0 -13
- package/src/graphics/svg/Elements/Basic/circle.js +0 -29
- package/src/graphics/svg/Elements/Basic/ellipse.js +0 -24
- package/src/graphics/svg/Elements/Basic/foreign-object.js +0 -36
- package/src/graphics/svg/Elements/Basic/groupe.js +0 -32
- package/src/graphics/svg/Elements/Basic/image.js +0 -36
- package/src/graphics/svg/Elements/Basic/index.js +0 -11
- package/src/graphics/svg/Elements/Basic/line.js +0 -32
- package/src/graphics/svg/Elements/Basic/link.js +0 -33
- package/src/graphics/svg/Elements/Basic/path.js +0 -62
- package/src/graphics/svg/Elements/Basic/polygon.js +0 -32
- package/src/graphics/svg/Elements/Basic/polyline.js +0 -7
- package/src/graphics/svg/Elements/Basic/rect.js +0 -46
- package/src/graphics/svg/Elements/Basic/text.js +0 -29
- package/src/graphics/svg/Elements/Derived/grid.js +0 -9
- package/src/graphics/svg/Elements/Derived/index.js +0 -1
- package/src/graphics/svg/Elements/index.js +0 -2
- package/src/graphics/svg/Elements/ziko-svg-element.js +0 -48
- package/src/graphics/svg/svg.js +0 -69
- package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
- package/src/types.js +0 -73
- package/src/ui/elements/derived/accordion/accordion.js +0 -42
- package/src/ui/elements/derived/accordion/collapsible.js +0 -82
- package/src/ui/elements/derived/accordion/index.js +0 -2
- package/src/ui/elements/derived/alert/alert.js +0 -80
- package/src/ui/elements/derived/alert/index.js +0 -1
- package/src/ui/elements/derived/alert/palette.js +0 -52
- package/src/ui/elements/derived/carousel/index.js +0 -51
- package/src/ui/elements/derived/code-note/SubElements.js.txt +0 -105
- package/src/ui/elements/derived/code-note/code-cell.js +0 -195
- package/src/ui/elements/derived/code-note/code-note.js +0 -72
- package/src/ui/elements/derived/code-note/index.js +0 -2
- package/src/ui/elements/derived/code-note/sub-elements.js +0 -67
- package/src/ui/elements/derived/index.js +0 -12
- package/src/ui/elements/derived/menu/index.js +0 -1
- package/src/ui/elements/derived/menu/menu3d.js +0 -260
- package/src/ui/elements/derived/modal/index.js +0 -92
- package/src/ui/elements/derived/pagination/breadcrumbs.js +0 -54
- package/src/ui/elements/derived/pagination/index.js +0 -1
- package/src/ui/elements/derived/slider/__ZikoUISlider__.js +0 -112
- package/src/ui/elements/derived/slider/hSlider.js +0 -34
- package/src/ui/elements/derived/slider/index.js +0 -12
- package/src/ui/elements/derived/slider/vSlider.js +0 -27
- package/src/ui/elements/derived/splitter/__ZikoUISplitter__.js +0 -62
- package/src/ui/elements/derived/splitter/hsplitter.js +0 -40
- package/src/ui/elements/derived/splitter/index.js +0 -12
- package/src/ui/elements/derived/splitter/vsplitter.js +0 -40
- package/src/ui/elements/derived/tabs/index.js +0 -180
- package/src/ui/elements/primitives/ZikoUIContainerElement.js +0 -123
- /package/src/{global → _global (To Be Replaced )}/_themes/dark.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/_themes/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/_themes/light.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/app/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/component/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/globals/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/params/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/router/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/seo/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/style/index.js +0 -0
- /package/src/data/converter/{adoc.js → __(To Be Moved)adoc.js} +0 -0
- /package/src/data/converter/{markdown.js → __(To Be Moved)markdown.js} +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/index.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useBattery.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useCamera.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useGeolocation.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useMicro.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useOrientation.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/html.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/index.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/pdf.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/youtube.js +0 -0
- /package/src/ui/elements/{primitives/hydrate.js → hydrate.js} +0 -0
- /package/src/ui/elements/{primitives/io → io}/Form/index.js.txt +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-camera/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-checkbox/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-color/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date-time.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-time.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-email.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-password.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-file.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-image.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-number/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-radio/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-search/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-slider/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Select/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Textarea/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/index.js +0 -0
- /package/src/ui/elements/{primitives/list → list}/elements.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Audio/index.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Image/figure.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Image/image.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Image/index.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Video/index.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/__ZikoUIDynamicMediaELement__.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/index.js +0 -0
- /package/src/ui/elements/{primitives/misc → misc}/hyperscript.js +0 -0
- /package/src/ui/elements/{primitives/misc → misc}/suspense.js +0 -0
- /package/src/ui/elements/{primitives/misc → misc}/xml-wrapper.js +0 -0
- /package/src/ui/elements/{primitives/table → table}/elements.js +0 -0
- /package/src/ui/elements/{primitives/table → table}/index.js +0 -0
- /package/src/ui/elements/{primitives/table → table}/utils.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/heading.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/index.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/p.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/pre.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/text.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ziko",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "a versatile javaScript framework offering a rich set of UI components, advanced mathematical utilities, reactivity, animations, client side routing and graphics capabilities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"front-end",
|
package/src/app/globals.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __UI__={}
|
|
2
|
-
const __HYDRATION_MAP__ =
|
|
2
|
+
const __HYDRATION_MAP__ = new Map()
|
|
3
3
|
const __Config__={
|
|
4
4
|
default:{
|
|
5
5
|
target:null,
|
|
@@ -13,7 +13,9 @@ const __Config__={
|
|
|
13
13
|
const values=Object.values(pairs);
|
|
14
14
|
for(let i=0;i<keys.length;i++)this.default[keys[i]]=values[i];
|
|
15
15
|
},
|
|
16
|
-
init:()=>document.documentElement.setAttribute("data-engine","zikojs")
|
|
16
|
+
init:()=>document.documentElement.setAttribute("data-engine","zikojs"),
|
|
17
|
+
renderingMode :"spa",
|
|
18
|
+
isSSC : false,
|
|
17
19
|
}
|
|
18
20
|
export {
|
|
19
21
|
__UI__,
|
package/src/data/parser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./xml"
|
|
@@ -1,2 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ZikoUIElement } from "../../ui/index.js";
|
|
2
|
+
import {Matrix} from "../../math/matrix/index.js"
|
|
3
|
+
// import { convolute } from "../../math/signal/conv.js";
|
|
4
|
+
class ZikoUICanvas extends ZikoUIElement{
|
|
5
|
+
constructor(w,h){
|
|
6
|
+
super("canvas","canvas");
|
|
7
|
+
this.ctx = this.element?.getContext("2d");
|
|
8
|
+
this.style({
|
|
9
|
+
border:"1px red solid",
|
|
10
|
+
})
|
|
11
|
+
this.transformMatrix=new Matrix([
|
|
12
|
+
[1,0,0],
|
|
13
|
+
[0,1,0],
|
|
14
|
+
[0,0,1]
|
|
15
|
+
])
|
|
16
|
+
this.axisMatrix=new Matrix([
|
|
17
|
+
[-10,-10],
|
|
18
|
+
[10,10]
|
|
19
|
+
])
|
|
20
|
+
// setTimeout(()=>this.resize(w,h),0);
|
|
21
|
+
requestAnimationFrame(()=>this.resize(w,h),0);
|
|
22
|
+
this.on("sizeupdated",()=>this.adjust())
|
|
23
|
+
}
|
|
24
|
+
get Xmin(){
|
|
25
|
+
return this.axisMatrix[0][0];
|
|
26
|
+
}
|
|
27
|
+
get Ymin(){
|
|
28
|
+
return this.axisMatrix[0][1];
|
|
29
|
+
}
|
|
30
|
+
get Xmax(){
|
|
31
|
+
return this.axisMatrix[1][0];
|
|
32
|
+
}
|
|
33
|
+
get Ymax(){
|
|
34
|
+
return this.axisMatrix[1][1];
|
|
35
|
+
}
|
|
36
|
+
get ImageData(){
|
|
37
|
+
return this.ctx.getImageData(0,0,c.Width,c.Height);
|
|
38
|
+
}
|
|
39
|
+
draw(all=true){
|
|
40
|
+
if(all){
|
|
41
|
+
this.clear();
|
|
42
|
+
this.items.forEach(element => {
|
|
43
|
+
element.parent=this;
|
|
44
|
+
element.draw(this.ctx)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.items.at(-1).parent=this;
|
|
49
|
+
this.items.at(-1).draw(this.ctx);
|
|
50
|
+
}
|
|
51
|
+
this.maintain();
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
applyTransformMatrix(){
|
|
55
|
+
this.ctx.setTransform(
|
|
56
|
+
this.transformMatrix[0][0],
|
|
57
|
+
this.transformMatrix[1][0],
|
|
58
|
+
this.transformMatrix[0][1],
|
|
59
|
+
this.transformMatrix[1][1],
|
|
60
|
+
this.transformMatrix[0][2],
|
|
61
|
+
this.transformMatrix[1][2],
|
|
62
|
+
);
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
resize(w,h){
|
|
66
|
+
this.size(w,h)
|
|
67
|
+
this.lineWidth();
|
|
68
|
+
this.view(this.axisMatrix[0][0], this.axisMatrix[0][1], this.axisMatrix[1][0], this.axisMatrix[1][1]);
|
|
69
|
+
this.emit("sizeupdated");
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
adjust(){
|
|
73
|
+
this.element.width =this.element?.getBoundingClientRect().width;
|
|
74
|
+
this.element.height =this.element?.getBoundingClientRect().height;
|
|
75
|
+
this.view(this.axisMatrix[0][0], this.axisMatrix[0][1], this.axisMatrix[1][0], this.axisMatrix[1][1]);
|
|
76
|
+
return this;
|
|
77
|
+
}
|
|
78
|
+
view(xMin,yMin,xMax,yMax){
|
|
79
|
+
this.transformMatrix[0][0]=this.width/(xMax-xMin); // scaleX
|
|
80
|
+
this.transformMatrix[1][1]=-this.height/(yMax-yMin); // scaleY
|
|
81
|
+
this.transformMatrix[0][2]=this.width/2;
|
|
82
|
+
this.transformMatrix[1][2]=this.height/2;
|
|
83
|
+
this.axisMatrix=new Matrix([
|
|
84
|
+
[xMin,yMin],
|
|
85
|
+
[xMax,yMax]
|
|
86
|
+
])
|
|
87
|
+
|
|
88
|
+
this.applyTransformMatrix();
|
|
89
|
+
this.clear();
|
|
90
|
+
this.lineWidth(1);
|
|
91
|
+
this.draw();
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
reset(){
|
|
95
|
+
this.ctx.setTransform(1,0,0,0,0,0);
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
append(element){
|
|
99
|
+
this.items.push(element);
|
|
100
|
+
this.draw(false);
|
|
101
|
+
return this;
|
|
102
|
+
}
|
|
103
|
+
background(color){
|
|
104
|
+
this.ctx.fillStyle = color;
|
|
105
|
+
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
106
|
+
this.ctx.fillRect(0, 0, this.width, this.height);
|
|
107
|
+
this.applyTransformMatrix();
|
|
108
|
+
this.draw();
|
|
109
|
+
}
|
|
110
|
+
lineWidth(w){
|
|
111
|
+
this.ctx.lineWidth=w/this.transformMatrix[0][0];
|
|
112
|
+
return this
|
|
113
|
+
}
|
|
114
|
+
getImageData(x=0,y=0,w=this.width,h=this.height){
|
|
115
|
+
return this.ctx.getImageData(x,y,w,h);
|
|
116
|
+
}
|
|
117
|
+
clear(){
|
|
118
|
+
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
119
|
+
this.ctx.clearRect(0, 0, this.width, this.height);
|
|
120
|
+
this.applyTransformMatrix();
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
clone(){
|
|
124
|
+
console.log(this.width)
|
|
125
|
+
const canvas=new ZikoUICanvas();
|
|
126
|
+
canvas.items=this.items;
|
|
127
|
+
canvas.transformMatrix=this.transformMatrix;
|
|
128
|
+
canvas.axisMatrix=this.axisMatrix;
|
|
129
|
+
Object.assign(canvas.cache,{...this.cache});
|
|
130
|
+
//waitForUIElm(this)
|
|
131
|
+
//console.log(element)
|
|
132
|
+
this.size(this.element.style.width,this.element.style.width);
|
|
133
|
+
this.applyTransformMatrix();
|
|
134
|
+
this.draw();
|
|
135
|
+
this.adjust();
|
|
136
|
+
return canvas;
|
|
137
|
+
}
|
|
138
|
+
toImage() {
|
|
139
|
+
this.img = document?.createElement("img");
|
|
140
|
+
this.img.src = this.element?.toDataURL("image/png");
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
toBlob() {
|
|
144
|
+
var canvas = this.element;
|
|
145
|
+
canvas.toBlob(function (blob) {
|
|
146
|
+
var newImg = document?.createElement("img"),
|
|
147
|
+
url = URL.createObjectURL(blob);
|
|
148
|
+
newImg.onload = function () {
|
|
149
|
+
URL.revokeObjectURL(url);
|
|
150
|
+
};
|
|
151
|
+
newImg.src = url;
|
|
152
|
+
console.log(newImg);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
zoomIn(){
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
zoomOut(){
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
undo(n){
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
redo(n){
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
stream(){
|
|
168
|
+
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const Canvas=(w,h)=>new ZikoUICanvas(w,h);
|
|
173
|
+
export{
|
|
174
|
+
ZikoUICanvas,
|
|
175
|
+
Canvas
|
|
176
|
+
}
|
|
@@ -1,2 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ZikoUIElement } from "../../ui/index.js";
|
|
2
|
+
class ZikoUISvg extends ZikoUIElement {
|
|
3
|
+
constructor(w=360,h=300) {
|
|
4
|
+
super("svg","svg");
|
|
5
|
+
//this.cache={};
|
|
6
|
+
// this.setAttr("width",w);
|
|
7
|
+
// this.setAttr("height",h);
|
|
8
|
+
// this.setAttr({
|
|
9
|
+
// width : w,
|
|
10
|
+
// height : h
|
|
11
|
+
// })
|
|
12
|
+
this.style({border:"1px black solid"});
|
|
13
|
+
//this.view(-w/2,-h/2,w/2,h/2);
|
|
14
|
+
this.size(w, h)
|
|
15
|
+
this.view(-10,-10,10,10);
|
|
16
|
+
}
|
|
17
|
+
size(w, h){
|
|
18
|
+
this.setAttr({
|
|
19
|
+
width : w,
|
|
20
|
+
height : h
|
|
21
|
+
});
|
|
22
|
+
return this
|
|
23
|
+
}
|
|
24
|
+
view(x1,y1,x2,y2){
|
|
25
|
+
let width=Math.abs(x2-x1);
|
|
26
|
+
let height=Math.abs(y2-y1);
|
|
27
|
+
this.setAttr("viewBox",[x1,y1,width,height].join(" "));
|
|
28
|
+
this.st.scaleY(-1);
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
add(...svgElement){
|
|
32
|
+
for(let i=0;i<svgElement.length;i++){
|
|
33
|
+
this.element.append(svgElement[i].element);
|
|
34
|
+
this.items.push(svgElement[i])
|
|
35
|
+
}
|
|
36
|
+
this.maintain()
|
|
37
|
+
return this;
|
|
38
|
+
}
|
|
39
|
+
remove(...svgElement){
|
|
40
|
+
for(let i=0;i<svgElement.length;i++){
|
|
41
|
+
this.element?.removeChild(svgElement[i].element);
|
|
42
|
+
this.items=this.items.filter(n=>!svgElement)
|
|
43
|
+
}
|
|
44
|
+
this.maintain();
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
mask(){
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
toString(){
|
|
51
|
+
return (new XMLSerializer()).serializeToString(this.element);
|
|
52
|
+
}
|
|
53
|
+
btoa(){
|
|
54
|
+
return btoa(this.toString())
|
|
55
|
+
}
|
|
56
|
+
toImg(){
|
|
57
|
+
return 'data:image/svg+xml;base64,'+this.btoa()
|
|
58
|
+
}
|
|
59
|
+
toImg2(){
|
|
60
|
+
return "data:image/svg+xml;charset=utf8,"+this.toString().replaceAll("<","%3C").replaceAll(">","%3E").replaceAll("#","%23").replaceAll('"',"'");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const Svg =(w,h)=>new ZikoUISvg(w,h);
|
|
66
|
+
export{
|
|
67
|
+
Svg,
|
|
68
|
+
ZikoUISvg,
|
|
69
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZikoUseStyle } from "
|
|
2
|
-
import { ZikoUIElementStyle } from "
|
|
1
|
+
import { ZikoUseStyle } from "../../reactivity/hooks/UI/useStyle.js";
|
|
2
|
+
import { ZikoUIElementStyle } from "../style/index.js";
|
|
3
3
|
import {
|
|
4
4
|
usePointerEvent,
|
|
5
5
|
useMouseEvent,
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
watchSize,
|
|
17
17
|
watchAttr,
|
|
18
18
|
watchChildren
|
|
19
|
-
} from "
|
|
20
|
-
import { Random } from "
|
|
21
|
-
import { Str } from "
|
|
19
|
+
} from "../../reactivity/index.js"
|
|
20
|
+
import { Random } from "../../math/index.js";
|
|
21
|
+
import { Str } from "../../data/index.js";
|
|
22
22
|
import { text } from "./text/text.js";
|
|
23
23
|
class ZikoUIElement {
|
|
24
24
|
constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
|
|
@@ -78,10 +78,9 @@ class ZikoUIElement {
|
|
|
78
78
|
globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
|
|
79
79
|
element && globalThis.__Ziko__.__Config__.default.render && this.render()
|
|
80
80
|
this.setAttr("data-ref", this.uuid);
|
|
81
|
-
globalThis.__Ziko__.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
})
|
|
81
|
+
if(globalThis.__Ziko__.__Config__.renderingMode !== "spa" && !globalThis.__Ziko__.__Config__.isSSC) {
|
|
82
|
+
globalThis.__Ziko__.__HYDRATION_MAP__.set(this.uuid, ()=>this)
|
|
83
|
+
}
|
|
85
84
|
}
|
|
86
85
|
get element(){
|
|
87
86
|
return this.__ele__;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIFlex extends
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
class ZikoUIFlex extends ZikoUIElement {
|
|
3
3
|
constructor(tag = "div", w = "100%", h = "100%") {
|
|
4
4
|
super(tag ,"Flex");
|
|
5
5
|
this.direction = "cols";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIGrid extends
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement"
|
|
2
|
+
class ZikoUIGrid extends ZikoUIElement {
|
|
3
3
|
constructor(tag ="div", w = "50vw", h = "50vh") {
|
|
4
4
|
super(tag,"Grid");
|
|
5
5
|
this.direction = "cols";
|
|
@@ -5,4 +5,6 @@ export * from "./semantic/index.js";
|
|
|
5
5
|
export * from "./embaded/index.js";
|
|
6
6
|
export * from "./table/index.js";
|
|
7
7
|
export * from "./media/index.js";
|
|
8
|
-
export * from "./misc/index.js";
|
|
8
|
+
export * from "./misc/index.js";
|
|
9
|
+
export * from "./flex/index.js"
|
|
10
|
+
export * from "./grid/index.js"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ZikoUIElement from "../../../ZikoUIElement.js";
|
|
2
|
-
import { useInputEvent } from "
|
|
2
|
+
import { useInputEvent } from "../../../../../reactivity/index.js";
|
|
3
3
|
class ZikoUIInput extends ZikoUIElement {
|
|
4
4
|
constructor(type, name , value = "", datalist) {
|
|
5
5
|
super("input", "input");
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
-
import ZikoUIContainerElement from "../ZikoUIContainerElement.js";
|
|
3
2
|
import {text} from "../text/index.js";
|
|
4
|
-
class ZikoUILI extends
|
|
3
|
+
class ZikoUILI extends ZikoUIElement{
|
|
5
4
|
constructor(UI){
|
|
6
5
|
super("li","li");
|
|
7
6
|
this.append(UI);
|
|
@@ -10,7 +9,7 @@ class ZikoUILI extends ZikoUIContainerElement{
|
|
|
10
9
|
return true;
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
|
-
class ZikoUIList extends
|
|
12
|
+
class ZikoUIList extends ZikoUIElement {
|
|
14
13
|
constructor(element,name) {
|
|
15
14
|
super(element,name);
|
|
16
15
|
delete this.append;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
-
|
|
3
|
-
class ZikoUIHtmlTag extends ZikoUIContainerElement {
|
|
2
|
+
class ZikoUIHtmlTag extends ZikoUIElement {
|
|
4
3
|
constructor(element) {
|
|
5
4
|
super(element,"html");
|
|
6
5
|
}
|
|
@@ -53,7 +52,7 @@ class ZikoUIBr extends ZikoUIElement {
|
|
|
53
52
|
return true
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
|
-
class ZikoUILink extends
|
|
55
|
+
class ZikoUILink extends ZikoUIElement{
|
|
57
56
|
constructor(href){
|
|
58
57
|
super("a","link");
|
|
59
58
|
Object.assign(this.cache,{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
class ZikoUIMain extends
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement";
|
|
2
|
+
class ZikoUIMain extends ZikoUIElement{
|
|
3
3
|
constructor(){
|
|
4
4
|
super("main","Main");
|
|
5
5
|
}
|
|
@@ -7,7 +7,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
|
|
|
7
7
|
return true
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
class ZikoUIHeader extends
|
|
10
|
+
class ZikoUIHeader extends ZikoUIElement{
|
|
11
11
|
constructor(){
|
|
12
12
|
super("header","Header");
|
|
13
13
|
}
|
|
@@ -15,7 +15,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
|
|
|
15
15
|
return true
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
class ZikoUINav extends
|
|
18
|
+
class ZikoUINav extends ZikoUIElement{
|
|
19
19
|
constructor(){
|
|
20
20
|
super("nav","Nav");
|
|
21
21
|
}
|
|
@@ -23,7 +23,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
|
|
|
23
23
|
return true
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
class ZikoUISection extends
|
|
26
|
+
class ZikoUISection extends ZikoUIElement{
|
|
27
27
|
constructor(){
|
|
28
28
|
super("section","Section");
|
|
29
29
|
this.style({position:"relative"})
|
|
@@ -32,7 +32,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
|
|
|
32
32
|
return true
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
class ZikoUIArticle extends
|
|
35
|
+
class ZikoUIArticle extends ZikoUIElement{
|
|
36
36
|
constructor(){
|
|
37
37
|
super("article","Article");
|
|
38
38
|
}
|
|
@@ -40,7 +40,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
|
|
|
40
40
|
return true
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
class ZikoUIAside extends
|
|
43
|
+
class ZikoUIAside extends ZikoUIElement{
|
|
44
44
|
constructor(){
|
|
45
45
|
super("aside","Aside");
|
|
46
46
|
}
|
|
@@ -48,7 +48,7 @@ class ZikoUIMain extends ZikoUIContainerElement{
|
|
|
48
48
|
return true
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
class ZikoUIFooter extends
|
|
51
|
+
class ZikoUIFooter extends ZikoUIElement{
|
|
52
52
|
constructor(){
|
|
53
53
|
super("footer","Footer");
|
|
54
54
|
this.element=document?.createElement("footer");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ZikoUIElement from "../ZikoUIElement.js"
|
|
2
2
|
import { tbody,caption,ZikoUICaption,thead} from "./elements.js";
|
|
3
|
-
import { matrix } from "
|
|
3
|
+
import { matrix } from "../../../math/matrix/index.js";
|
|
4
4
|
import { MatrixToTableUI } from "./utils.js";
|
|
5
5
|
class ZikoUITable extends ZikoUIElement {
|
|
6
6
|
constructor(body,{caption=null,head=null,foot=null}={}){
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
-
import ZikoContainerElement from "../ZikoUIContainerElement.js";
|
|
3
2
|
import {
|
|
4
3
|
ZikoUISubText,
|
|
5
4
|
ZikoUISupText
|
|
@@ -7,12 +6,12 @@ import {
|
|
|
7
6
|
import {
|
|
8
7
|
Complex,
|
|
9
8
|
Matrix
|
|
10
|
-
} from "
|
|
9
|
+
} from "../../../math/index.js";
|
|
11
10
|
import {
|
|
12
11
|
arr2str,
|
|
13
12
|
obj2str
|
|
14
|
-
} from "
|
|
15
|
-
class __ZikoUIText__ extends
|
|
13
|
+
} from "../../../data/index.js";
|
|
14
|
+
class __ZikoUIText__ extends ZikoUIElement {
|
|
16
15
|
constructor(tag, name, lineBreak,...value) {
|
|
17
16
|
super(tag, name);
|
|
18
17
|
this.addValue(...value);
|
package/src/ui/index.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
export * from "./elements/
|
|
2
|
-
export * from "./elements/
|
|
3
|
-
export * from "./elements/
|
|
4
|
-
export * from "./elements/
|
|
5
|
-
export * from "./elements/
|
|
6
|
-
export * from "./elements/
|
|
7
|
-
export * from "./elements/
|
|
8
|
-
export * from "./elements/
|
|
1
|
+
export * from "./elements/text";
|
|
2
|
+
export * from "./elements/list";
|
|
3
|
+
export * from "./elements/io";
|
|
4
|
+
export * from "./elements/media";
|
|
5
|
+
export * from "./elements/table";
|
|
6
|
+
export * from "./elements/semantic";
|
|
7
|
+
export * from "./elements/misc";
|
|
8
|
+
export * from "./elements/flex";
|
|
9
|
+
export * from "./elements/grid";
|
|
9
10
|
|
|
10
|
-
import * as Text from "./elements/
|
|
11
|
-
import * as List from "./elements/
|
|
12
|
-
import * as Io from "./elements/
|
|
13
|
-
import * as Media from "./elements/
|
|
14
|
-
import * as Table from "./elements/
|
|
15
|
-
import * as Semantic from "./elements/
|
|
16
|
-
import * as Misc from "./elements/
|
|
17
|
-
import * as
|
|
11
|
+
import * as Text from "./elements/text";
|
|
12
|
+
import * as List from "./elements/list";
|
|
13
|
+
import * as Io from "./elements/io";
|
|
14
|
+
import * as Media from "./elements/media";
|
|
15
|
+
import * as Table from "./elements/table";
|
|
16
|
+
import * as Semantic from "./elements/semantic";
|
|
17
|
+
import * as Misc from "./elements/misc";
|
|
18
|
+
import * as Flex from "./elements/flex";
|
|
19
|
+
import * as Grid from "./elements/grid";
|
|
18
20
|
|
|
19
|
-
import ZikoUIElement from "./elements/
|
|
20
|
-
import ZikoUIContainerElement from "./elements/primitives/ZikoUIContainerElement";
|
|
21
|
+
import ZikoUIElement from "./elements/ZikoUIElement";
|
|
21
22
|
|
|
22
23
|
export{
|
|
23
|
-
ZikoUIContainerElement,
|
|
24
24
|
ZikoUIElement
|
|
25
25
|
}
|
|
26
26
|
const UI = {
|
|
@@ -31,8 +31,8 @@ const UI = {
|
|
|
31
31
|
...Table,
|
|
32
32
|
...Semantic,
|
|
33
33
|
...Misc,
|
|
34
|
-
...
|
|
34
|
+
...Flex,
|
|
35
|
+
...Grid,
|
|
35
36
|
ZikoUIElement,
|
|
36
|
-
ZikoUIContainerElement
|
|
37
37
|
}
|
|
38
38
|
export default UI;
|
package/src/ui/utils/index.js
CHANGED
|
File without changes
|