ziko 0.0.24 → 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.
Files changed (65) hide show
  1. package/dist/ziko.cjs +1 -1
  2. package/dist/ziko.js +1 -1
  3. package/dist/ziko.min.js +1 -1
  4. package/dist/ziko.mjs +1 -1
  5. package/package.json +1 -1
  6. package/src/data/parser/index.js +1 -1
  7. package/src/graphics/canvas/elements ( To Be Moved )/Basic/arc.js +0 -43
  8. package/src/graphics/canvas/elements ( To Be Moved )/Basic/image.js +0 -0
  9. package/src/graphics/canvas/elements ( To Be Moved )/Basic/line.js +0 -26
  10. package/src/graphics/canvas/elements ( To Be Moved )/Basic/path.js +0 -0
  11. package/src/graphics/canvas/elements ( To Be Moved )/Basic/points.js +0 -48
  12. package/src/graphics/canvas/elements ( To Be Moved )/Basic/polygon.js +0 -7
  13. package/src/graphics/canvas/elements ( To Be Moved )/Basic/polyline.js +0 -0
  14. package/src/graphics/canvas/elements ( To Be Moved )/Basic/rect.js +0 -46
  15. package/src/graphics/canvas/elements ( To Be Moved )/Basic/text.js +0 -0
  16. package/src/graphics/canvas/elements ( To Be Moved )/Chart/histogram.js +0 -0
  17. package/src/graphics/canvas/elements ( To Be Moved )/Chart/plot.js +0 -0
  18. package/src/graphics/canvas/elements ( To Be Moved )/Chart/scatter.js +0 -2
  19. package/src/graphics/canvas/elements ( To Be Moved )/Chart/stem.js +0 -0
  20. package/src/graphics/canvas/elements ( To Be Moved )/Element.js +0 -115
  21. package/src/graphics/canvas/elements ( To Be Moved )/index.js +0 -13
  22. package/src/graphics/svg/Elements ( To Be Moved )/Basic/circle.js +0 -29
  23. package/src/graphics/svg/Elements ( To Be Moved )/Basic/ellipse.js +0 -24
  24. package/src/graphics/svg/Elements ( To Be Moved )/Basic/foreign-object.js +0 -36
  25. package/src/graphics/svg/Elements ( To Be Moved )/Basic/groupe.js +0 -32
  26. package/src/graphics/svg/Elements ( To Be Moved )/Basic/image.js +0 -36
  27. package/src/graphics/svg/Elements ( To Be Moved )/Basic/index.js +0 -11
  28. package/src/graphics/svg/Elements ( To Be Moved )/Basic/line.js +0 -32
  29. package/src/graphics/svg/Elements ( To Be Moved )/Basic/link.js +0 -33
  30. package/src/graphics/svg/Elements ( To Be Moved )/Basic/path.js +0 -62
  31. package/src/graphics/svg/Elements ( To Be Moved )/Basic/polygon.js +0 -32
  32. package/src/graphics/svg/Elements ( To Be Moved )/Basic/polyline.js +0 -7
  33. package/src/graphics/svg/Elements ( To Be Moved )/Basic/rect.js +0 -46
  34. package/src/graphics/svg/Elements ( To Be Moved )/Basic/text.js +0 -29
  35. package/src/graphics/svg/Elements ( To Be Moved )/Derived/grid.js +0 -9
  36. package/src/graphics/svg/Elements ( To Be Moved )/Derived/index.js +0 -1
  37. package/src/graphics/svg/Elements ( To Be Moved )/index.js +0 -2
  38. package/src/graphics/svg/Elements ( To Be Moved )/ziko-svg-element.js +0 -48
  39. package/src/ui/elements/derived ( To Be Moved)/accordion/accordion.js +0 -42
  40. package/src/ui/elements/derived ( To Be Moved)/accordion/collapsible.js +0 -82
  41. package/src/ui/elements/derived ( To Be Moved)/accordion/index.js +0 -2
  42. package/src/ui/elements/derived ( To Be Moved)/alert/alert.js +0 -80
  43. package/src/ui/elements/derived ( To Be Moved)/alert/index.js +0 -1
  44. package/src/ui/elements/derived ( To Be Moved)/alert/palette.js +0 -52
  45. package/src/ui/elements/derived ( To Be Moved)/carousel/index.js +0 -51
  46. package/src/ui/elements/derived ( To Be Moved)/code-note/SubElements.js.txt +0 -105
  47. package/src/ui/elements/derived ( To Be Moved)/code-note/code-cell.js +0 -195
  48. package/src/ui/elements/derived ( To Be Moved)/code-note/code-note.js +0 -72
  49. package/src/ui/elements/derived ( To Be Moved)/code-note/index.js +0 -2
  50. package/src/ui/elements/derived ( To Be Moved)/code-note/sub-elements.js +0 -67
  51. package/src/ui/elements/derived ( To Be Moved)/index.js +0 -12
  52. package/src/ui/elements/derived ( To Be Moved)/menu/index.js +0 -1
  53. package/src/ui/elements/derived ( To Be Moved)/menu/menu3d.js +0 -260
  54. package/src/ui/elements/derived ( To Be Moved)/modal/index.js +0 -92
  55. package/src/ui/elements/derived ( To Be Moved)/pagination/breadcrumbs.js +0 -54
  56. package/src/ui/elements/derived ( To Be Moved)/pagination/index.js +0 -1
  57. package/src/ui/elements/derived ( To Be Moved)/slider/__ZikoUISlider__.js +0 -112
  58. package/src/ui/elements/derived ( To Be Moved)/slider/hSlider.js +0 -34
  59. package/src/ui/elements/derived ( To Be Moved)/slider/index.js +0 -12
  60. package/src/ui/elements/derived ( To Be Moved)/slider/vSlider.js +0 -27
  61. package/src/ui/elements/derived ( To Be Moved)/splitter/__ZikoUISplitter__.js +0 -62
  62. package/src/ui/elements/derived ( To Be Moved)/splitter/hsplitter.js +0 -40
  63. package/src/ui/elements/derived ( To Be Moved)/splitter/index.js +0 -12
  64. package/src/ui/elements/derived ( To Be Moved)/splitter/vsplitter.js +0 -40
  65. package/src/ui/elements/derived ( To Be Moved)/tabs/index.js +0 -180
package/dist/ziko.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Fri Jan 24 2025 23:58:20 GMT+0100 (UTC+01:00)
5
+ Date : Sun Feb 09 2025 19:26:57 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
package/dist/ziko.js CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Fri Jan 24 2025 23:58:20 GMT+0100 (UTC+01:00)
5
+ Date : Sun Feb 09 2025 19:26:57 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
package/dist/ziko.min.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Project: ziko.js
3
3
  Author: Zakaria Elalaoui
4
- Date : Fri Jan 24 2025 23:58:20 GMT+0100 (UTC+01:00)
4
+ Date : Sun Feb 09 2025 19:26:57 GMT+0100 (UTC+01:00)
5
5
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
6
6
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
7
7
  Released under MIT License
package/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Fri Jan 24 2025 23:58:20 GMT+0100 (UTC+01:00)
5
+ Date : Sun Feb 09 2025 19:26:57 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko",
3
- "version": "0.0.24",
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",
@@ -1 +1 @@
1
- export * from "./markdown"
1
+ export * from "./xml"
@@ -1,43 +0,0 @@
1
- import ZikoCanvasElement from "../element.js";
2
- class CanvasArc extends ZikoCanvasElement{
3
- constructor(x,y,r,angle){
4
- super(x,y);
5
- this.r=r;
6
- this.angle=angle;
7
- this.path=null;
8
- }
9
- draw(ctx){
10
- if(this.cache.config.rendered){
11
- ctx.save();
12
- this.applyNormalStyle(ctx);
13
- ctx.beginPath();
14
- this.path=new Path2D();
15
- this.path.arc(this.px, this.py, this.r, 0, this.angle);
16
- const{strokeEnabled,fillEnabled}=this.cache.style.normal;
17
- if(strokeEnabled)ctx.stroke(this.path);
18
- if(fillEnabled)ctx.fill(this.path);
19
- ctx.closePath();
20
- ctx.restore();
21
- }
22
- return this;
23
- }
24
- radius(r){
25
- this.r=r;
26
- if(this.parent)this.parent.draw();
27
- return this;
28
- }
29
- // distanceFromCenter(x,y){
30
- // return Math.sqrt(
31
- // (this._x-x)**2-(this._y-y)**2
32
- // )
33
- // }
34
- // isIn(x,y,strict=false){
35
- // return strict?this.distanceFromCenter(x,y)<this.r:this.distanceFromCenter(x,y)<=this.r;
36
- // }
37
- // isInEdges(x,y){
38
- // return this.distanceFromCenter(x,y)===this.r;
39
- // }
40
- }
41
- const canvasArc=(x,y,r,phi)=>new CanvasArc(x,y,r,phi);
42
- const canvasCircle=(x,y,r)=>new CanvasArc(x,y,r,2*Math.PI);
43
- export{canvasArc,canvasCircle}
@@ -1,26 +0,0 @@
1
- import ZikoCanvasElement from "../element.js";
2
- class CanvasLine extends ZikoCanvasElement{
3
- constructor(x0,y0,x1,y1){
4
- super();
5
- this.x0=x0;
6
- this.x1=x1;
7
- this.y0=y0;
8
- this.y1=y1;
9
- delete this.fill;
10
- }
11
- draw(ctx){
12
- if(this.cache.config.rendered){
13
- ctx.save();
14
- this.applyNormalStyle(ctx);
15
- ctx.beginPath();
16
- ctx.moveTo(this.x0+this._x,this.y0+this._y_);
17
- ctx.lineTo(this.x1+this._x,this.y1+this._y);
18
- ctx.stroke();
19
- if(this.cache.style.normal.strokeEnabled)ctx.stroke();
20
- ctx.restore();
21
- }
22
- return this;
23
- }
24
- }
25
- const canvasLine=(x0,y0,x1,y1)=>new CanvasLine(x0,y0,x1,y1)
26
- export{canvasLine}
@@ -1,48 +0,0 @@
1
- import ZikoCanvasElement from "../element.js";
2
- import { matrix } from "../../../../math/matrix/index.js";
3
- class CanvasPoints extends ZikoCanvasElement{
4
- constructor(ptsX,ptsY){
5
- super();
6
- this.pointsMatrix=null;
7
- this.path=new Path2D();
8
- this.fromXY(ptsX,ptsY);
9
- }
10
- get points(){
11
- return this.pointsMatrix.T.arr;
12
- }
13
- draw(ctx){
14
- if(this.cache.config.rendered){
15
- ctx.save();
16
- this.applyNormalStyle(ctx);
17
- ctx.beginPath();
18
- this.path.moveTo(this.points[1][0]+this._x,this.points[1][1]+this._y);
19
- for(let i=1;i<this.points.length;i++){
20
- this.path.lineTo(this.points[i][0]+this._x,this.points[i][1]+this._y)
21
- }
22
- ctx.stroke(this.path);
23
- ctx.restore();
24
- }
25
- return this;
26
- }
27
- fromXY(X,Y){
28
- this.pointsMatrix=matrix([X,Y]);
29
- return this;
30
- }
31
- push(ptsX,ptsY){
32
- this.pointsMatrix.hstack(matrix([ptsX,ptsY]))
33
- if(this.parent)this.parent.draw();
34
- return this;
35
- }
36
- isIn(x,y){
37
- let is;
38
- if(this.parent){
39
- this.parent.ctx.setTransform(1,0,0,1,0,0);
40
- is=this.parent.ctx.isPointInPath(this.path,x,y);
41
- this.parent.applyTransformMatrix();
42
- }
43
- return is;
44
- }
45
- }
46
-
47
- const canvasPoints=(ptsX=[],ptsY=[])=>new CanvasPoints(ptsX,ptsY);
48
- export{canvasPoints};
@@ -1,7 +0,0 @@
1
- import ZikoCanvasElement from "../_element.js";
2
- import { matrix } from "../../../../Math/Matrix/index.js";
3
- class ZikoCanvasPolygon extends ZikoCanvasElement{
4
- constructor(ptsX,ptsY){
5
- super()
6
- }
7
- }
@@ -1,46 +0,0 @@
1
- import ZikoCanvasElement from "../element.js";
2
- class CanvasRect extends ZikoCanvasElement{
3
- constructor(x,y,w,h){
4
- super(x,y);
5
- this.w=w;
6
- this.h=h;
7
- this.path=new Path2D();
8
- }
9
- draw(ctx){
10
- if(this.cache.config.rendered){
11
- ctx.save();
12
- this.applyNormalStyle(ctx);
13
- ctx.beginPath();
14
- this.path.rect(this.px, this.py,this.w,this.h);
15
- const{strokeEnabled,fillEnabled}=this.cache.style.normal;
16
- if(strokeEnabled)ctx.stroke(this.path);
17
- if(fillEnabled)ctx.fill(this.path);
18
- ctx.closePath();
19
- ctx.restore();
20
- }
21
- return this;
22
- }
23
- width(w){
24
- this.w=w;
25
- if(this.parent)this.parent.draw();
26
- return this;
27
- }
28
- height(h){
29
- this.h=h;
30
- if(this.parent)this.parent.draw();
31
- return this;
32
- }
33
- // distanceFromCenter(x,y){
34
- // return Math.sqrt(
35
- // (this.position.x-x)**2-(this.position.y-y)**2
36
- // )
37
- // }
38
- // isIn(x,y,strict=false){
39
- // return strict?this.distanceFromCenter(x,y)<this.r:this.distanceFromCenter(x,y)<=this.r;
40
- // }
41
- // isInEdges(x,y){
42
- // return this.distanceFromCenter(x,y)===this.r;
43
- // }
44
- }
45
- const canvasRect=(x,y,w,h)=>new CanvasRect(x,y,w,h)
46
- export{canvasRect}
@@ -1,2 +0,0 @@
1
- // Scatter = Circle[]
2
-
@@ -1,115 +0,0 @@
1
- class ZikoCanvasElement{
2
- constructor(x,y){
3
- this.parent=null;
4
- this.position={
5
- x,
6
- y
7
- }
8
- this.cache={
9
- interact:null/*avoid redraw*/,
10
- config:{
11
- draggable:false,
12
- selected:false,
13
- highlighted:false,
14
- rendered:false
15
- },
16
- style:{
17
- normal:{
18
- strokeEnabled:true,
19
- fillEnabled:false,
20
- strokeColor:"#111111",
21
- fillColor:"#777777",
22
- },
23
- highlighted:{
24
- strokeEnabled:true,
25
- fillEnabled:false,
26
- strokeColor:null,
27
- fillColor:null,
28
- }
29
- },
30
- }
31
- this.history={
32
- position:[],
33
- styles:[]
34
- }
35
- this.render();
36
- }
37
- get px(){
38
- //_x=====>px
39
- return (this.position.x??0)+(this.parent?.position?.x??0);
40
- }
41
- get py(){
42
- //_y=====>py
43
- return (this.position.y??0)+(this.parent?.position?.y??0);
44
- }
45
- isIntersectedWith(){
46
-
47
- }
48
- isInStroke(x,y){
49
- let is;
50
- if(this.parent){
51
- this.parent.ctx.setTransform(1,0,0,1,0,0);
52
- is=this.parent.ctx.isPointInStroke(this.path,x,y);
53
- this.parent.applyTransformMatrix();
54
- }
55
- return is;
56
- }
57
- isInPath(x,y){
58
- let is;
59
- if(this.parent){
60
- this.parent.ctx.setTransform(1,0,0,1,0,0);
61
- is=this.parent.ctx.isPointInPath(this.path,x,y);
62
- this.parent.applyTransformMatrix();
63
- }
64
- return is;
65
- }
66
- posX(x){
67
- this.position.x=x;
68
- if(this.parent)this.parent.draw()
69
- return this;
70
- }
71
- posY(y){
72
- this.position.y=y;
73
- if(this.parent)this.parent.draw()
74
- return this;
75
- }
76
- color({stroke=this.cache.style.normal.strokeColor,fill=this.cache.style.normal.fillColor}={stroke,fill}){
77
- this.cache.style.normal.strokeColor=stroke;
78
- this.cache.style.normal.fillColor=fill;
79
- if(this.parent)this.parent.draw()
80
- return this;
81
- }
82
- translate(dx=0,dy=0){
83
- this.position.x+=dx;
84
- this.position.y+=dy;
85
- if(this.parent)this.parent.draw();
86
- return;
87
- }
88
- applyNormalStyle(ctx){
89
- ctx.strokeStyle=this.cache.style.normal.strokeColor;
90
- ctx.fillStyle=this.cache.style.normal.fillColor;
91
- return this;
92
- }
93
- applyHighlightedStyle(ctx){
94
- ctx.strokeStyle=this.cache.style.highlighted.strokeColor;
95
- ctx.fillStyle=this.cache.style.highlighted.fillColor;
96
- return this;
97
- }
98
- stroke(color=this.cache.style.normal.strokeColor,enabled=true){
99
- this.cache.style.normal.strokeEnabled=enabled;
100
- this.cache.style.normal.strokeColor=color;
101
- if(this.parent)this.parent.draw();
102
- return this
103
- }
104
- fill(color=this.cache.style.normal.fillColor,enabled=true){
105
- this.cache.style.normal.fillEnabled=enabled;
106
- this.cache.style.normal.filleColor=color;
107
- if(this.parent)this.parent.draw();
108
- return this;
109
- }
110
- render(render=true){
111
- this.cache.config.rendered=render;
112
- return this;
113
- }
114
- }
115
- export default ZikoCanvasElement;
@@ -1,13 +0,0 @@
1
- export {
2
- canvasArc,
3
- canvasCircle
4
- } from "./basic/arc.js";
5
- export {
6
- canvasPoints
7
- } from "./basic/points.js";
8
- export {
9
- canvasLine
10
- }from "./basic/line.js"
11
- export {
12
- canvasRect
13
- } from "./basic/rect.js"
@@ -1,29 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgCircle extends ZikoSvgElement{
3
- constructor(cx,cy,r){
4
- super("circle")
5
- this.element=document.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "circle",
8
- );
9
- this.pos(cx,cy).setR(r);
10
- }
11
- setR(r){
12
- this.element.r.baseVal.value=r;
13
- return this;
14
- }
15
- get r(){
16
- return this.element.baseVal.value;
17
- }
18
- get cx(){
19
- return this.element.baseVal.value;
20
- }
21
- get cy(){
22
- return this.element.baseVal.value;
23
- }
24
- }
25
- const svgCircle=(x,y,r)=>new ZikoSvgCircle(x,y,r);
26
- export {
27
- svgCircle,
28
- ZikoSvgCircle
29
- }
@@ -1,24 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgEllipse extends ZikoSvgElement{
3
- constructor(cx,cy,rx,ry){
4
- super("ellipse")
5
- this.element=document?.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "ellipse",
8
- );
9
- this.pos(cx,cy).setRx(rx).setRy(ry);
10
- }
11
- setRx(rx){
12
- this.element.rx.baseVal.value=rx;
13
- return this;
14
- }
15
- setRy(ry){
16
- this.element.ry.baseVal.value=ry;
17
- return this;
18
- }
19
- }
20
- const svgEllipse=(x,y,rx,ry)=>new ZikoSvgEllipse(x,y,rx,ry);
21
- export{
22
- svgEllipse,
23
- ZikoSvgEllipse
24
- }
@@ -1,36 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- import { Flex } from "../../../../ui/index.js"
3
- class ZikoSvgForeignObject extends ZikoSvgElement{
4
- constructor(x=0,y=0,w="100%",h="100%",...ZikoUIElement){
5
- super("foreignObject")
6
- this.items=[];
7
- this.element=document?.createElementNS(
8
- "http://www.w3.org/2000/svg",
9
- "foreignObject",
10
- );
11
- this.container=Flex().setTarget(this.element).vertical(0,0).size("auto","auto");
12
- this.container.st.scaleY(-1);
13
- this.posX(x).posY(y).width(w).height(h);
14
- }
15
- width(w){
16
- this.element.etAttribute("width",w)
17
- return this;
18
- }
19
- height(h){
20
- this.element.etAttribute("height",h)
21
- return this;
22
- }
23
- add(...ZikoUIElement){
24
- this.container.append(...ZikoUIElement);
25
- return this;
26
- }
27
- remove(...ZikoUIElement){
28
- this.container.append(...ZikoUIElement);
29
- return this;
30
- }
31
- }
32
- const svgObject=(x, y, w, h)=>new ZikoSvgForeignObject(x, y, w, h);
33
- export {
34
- svgObject,
35
- ZikoSvgForeignObject
36
- }
@@ -1,32 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgGroupe extends ZikoSvgElement{
3
- constructor(...svgElement){
4
- super();
5
- this.items=[];
6
- this.element=document?.createElementNS(
7
- "http://www.w3.org/2000/svg",
8
- "g",
9
- );
10
- this.add(...svgElement)
11
- }
12
- add(...svgElement){
13
- for(let i=0;i<svgElement.length;i++){
14
- this.element?.appendChild(svgElement[i].element);
15
- this.items.push(svgElement[i])
16
- }
17
- if(svgElement.length===1)return svgElement[0]
18
- return svgElement;
19
- }
20
- remove(...svgElement){
21
- for(let i=0;i<svgElement.length;i++){
22
- this.element?.removeChild(svgElement[i].element);
23
- this.items=this.items.filter(n=>n!=svgElement)
24
- }
25
- return this;
26
- }
27
- }
28
- const svgGroupe=(...svgElement)=>new ZikoSvgGroupe(...svgElement)
29
- export {
30
- svgGroupe,
31
- ZikoSvgGroupe
32
- }
@@ -1,36 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgImage extends ZikoSvgElement{
3
- constructor(src="",w="100%",h="100%",x=0,y=0){
4
- super()
5
- this.element=document?.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "image",
8
- );
9
- this.setSrc(src).width(w).height(h).x(x).y(y);
10
- }
11
- x(x){
12
- this.element.x.baseVal.value=x;
13
- return this;
14
- }
15
- y(y){
16
- this.element.y.baseVal.value=y;
17
- return this;
18
- }
19
- width(w){
20
- this.element?.setAttribute("width",w);
21
- return this;
22
- }
23
- height(h){
24
- this.element?.setAttribute("height",h);
25
- return this;
26
- }
27
- setSrc(src=""){
28
- this.element?.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', src)
29
- return this;
30
- }
31
- }
32
- const svgImage=(src,w,h,x,y)=>new ZikoSvgImage(src,w,h,x,y);
33
- export {
34
- svgImage,
35
- ZikoSvgImage
36
- }
@@ -1,11 +0,0 @@
1
- export * from "./circle.js";
2
- export * from "./ellipse.js";
3
- export * from "./foreign-object.js";
4
- export * from "./groupe.js";
5
- export * from "./image.js";
6
- export * from "./line.js";
7
- export * from "./link.js";
8
- export * from "./path.js";
9
- export * from "./polygon.js";
10
- export * from "./rect.js";
11
- export * from "./text.js";
@@ -1,32 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgLine extends ZikoSvgElement{
3
- constructor(x1,y1,x2,y2){
4
- super()
5
- this.element=document?.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "line",
8
- );
9
- this.x1(x1).y1(y1).x2(x2).y2(y2).stroke("black");
10
- }
11
- x1(x1){
12
- this.element.x1.baseVal.value=x1;
13
- return this;
14
- }
15
- y1(y1){
16
- this.element.y1.baseVal.value=y1;
17
- return this;
18
- }
19
- x2(x2){
20
- this.element.x2.baseVal.value=x2;
21
- return this;
22
- }
23
- y2(y2){
24
- this.element.y2.baseVal.value=y2;
25
- return this;
26
- }
27
- }
28
- const svgLine=(x1,y1,x2,y2)=>new ZikoSvgLine(x1,y1,x2,y2);
29
- export{
30
- svgLine,
31
- ZikoSvgLine
32
- }
@@ -1,33 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgLink extends ZikoSvgElement{
3
- constructor(href,...svgElement){
4
- super();
5
- this.items=[];
6
- this.element=document?.createElementNS(
7
- "http://www.w3.org/2000/svg",
8
- "a",
9
- );
10
- this.element.etAttribute("href",href)
11
- this.add(...svgElement)
12
- }
13
- add(...svgElement){
14
- for(let i=0;i<svgElement.length;i++){
15
- this.element.ppendChild(svgElement[i].element);
16
- this.items.push(svgElement[i])
17
- }
18
- if(svgElement.length===1)return svgElement[0]
19
- return svgElement;
20
- }
21
- remove(...svgElement){
22
- for(let i=0;i<svgElement.length;i++){
23
- this.element.moveChild(svgElement[i].element);
24
- this.items=this.items.filter(n=>n!=svgElement)
25
- }
26
- return this;
27
- }
28
- }
29
- const svgLink=(href,...svgElement)=>new ZikoSvgLink(href,...svgElement)
30
- export{
31
- svgLink,
32
- ZikoSvgLink
33
- }