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.
Files changed (156) hide show
  1. package/dist/ziko.cjs +78 -2817
  2. package/dist/ziko.js +78 -2817
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +76 -2755
  5. package/package.json +1 -1
  6. package/src/app/globals.js +4 -2
  7. package/src/data/converter/index.js +2 -6
  8. package/src/data/parser/index.js +1 -1
  9. package/src/graphics/canvas/index.js +176 -2
  10. package/src/graphics/canvas/utils/floodFill.js +0 -1
  11. package/src/graphics/svg/index.js +69 -2
  12. package/src/reactivity/hooks/index.js +1 -1
  13. package/src/ui/elements/{primitives/ZikoUIElement.js → ZikoUIElement.js} +8 -9
  14. package/src/ui/elements/{derived/flex → flex}/index.js +2 -2
  15. package/src/ui/elements/{derived/grid → grid}/index.js +2 -2
  16. package/src/ui/elements/{primitives/index.js → index.js} +3 -1
  17. package/src/ui/elements/{primitives/io → io}/Form/index.js +1 -1
  18. package/src/ui/elements/{primitives/io → io}/Inputs/__helpers__.js +1 -1
  19. package/src/ui/elements/{primitives/io → io}/Inputs/input/index.js +1 -1
  20. package/src/ui/elements/{primitives/list → list}/index.js +2 -3
  21. package/src/ui/elements/{primitives/misc → misc}/index.js +2 -3
  22. package/src/ui/elements/{primitives/semantic → semantic}/index.js +8 -8
  23. package/src/ui/elements/{primitives/table → table}/table.js +1 -1
  24. package/src/ui/elements/{primitives/text → text}/__ZikoUIText__.js +3 -4
  25. package/src/ui/index.js +21 -21
  26. package/src/ui/utils/index.js +1 -1
  27. package/src/data/parser/markdown.js +0 -0
  28. package/src/graphics/canvas/canvas.js +0 -176
  29. package/src/graphics/canvas/elements/Basic/arc.js +0 -43
  30. package/src/graphics/canvas/elements/Basic/image.js +0 -0
  31. package/src/graphics/canvas/elements/Basic/line.js +0 -26
  32. package/src/graphics/canvas/elements/Basic/path.js +0 -0
  33. package/src/graphics/canvas/elements/Basic/points.js +0 -48
  34. package/src/graphics/canvas/elements/Basic/polygon.js +0 -7
  35. package/src/graphics/canvas/elements/Basic/polyline.js +0 -0
  36. package/src/graphics/canvas/elements/Basic/rect.js +0 -46
  37. package/src/graphics/canvas/elements/Basic/text.js +0 -0
  38. package/src/graphics/canvas/elements/Chart/histogram.js +0 -0
  39. package/src/graphics/canvas/elements/Chart/plot.js +0 -0
  40. package/src/graphics/canvas/elements/Chart/scatter.js +0 -2
  41. package/src/graphics/canvas/elements/Chart/stem.js +0 -0
  42. package/src/graphics/canvas/elements/Element.js +0 -115
  43. package/src/graphics/canvas/elements/index.js +0 -13
  44. package/src/graphics/svg/Elements/Basic/circle.js +0 -29
  45. package/src/graphics/svg/Elements/Basic/ellipse.js +0 -24
  46. package/src/graphics/svg/Elements/Basic/foreign-object.js +0 -36
  47. package/src/graphics/svg/Elements/Basic/groupe.js +0 -32
  48. package/src/graphics/svg/Elements/Basic/image.js +0 -36
  49. package/src/graphics/svg/Elements/Basic/index.js +0 -11
  50. package/src/graphics/svg/Elements/Basic/line.js +0 -32
  51. package/src/graphics/svg/Elements/Basic/link.js +0 -33
  52. package/src/graphics/svg/Elements/Basic/path.js +0 -62
  53. package/src/graphics/svg/Elements/Basic/polygon.js +0 -32
  54. package/src/graphics/svg/Elements/Basic/polyline.js +0 -7
  55. package/src/graphics/svg/Elements/Basic/rect.js +0 -46
  56. package/src/graphics/svg/Elements/Basic/text.js +0 -29
  57. package/src/graphics/svg/Elements/Derived/grid.js +0 -9
  58. package/src/graphics/svg/Elements/Derived/index.js +0 -1
  59. package/src/graphics/svg/Elements/index.js +0 -2
  60. package/src/graphics/svg/Elements/ziko-svg-element.js +0 -48
  61. package/src/graphics/svg/svg.js +0 -69
  62. package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
  63. package/src/types.js +0 -73
  64. package/src/ui/elements/derived/accordion/accordion.js +0 -42
  65. package/src/ui/elements/derived/accordion/collapsible.js +0 -82
  66. package/src/ui/elements/derived/accordion/index.js +0 -2
  67. package/src/ui/elements/derived/alert/alert.js +0 -80
  68. package/src/ui/elements/derived/alert/index.js +0 -1
  69. package/src/ui/elements/derived/alert/palette.js +0 -52
  70. package/src/ui/elements/derived/carousel/index.js +0 -51
  71. package/src/ui/elements/derived/code-note/SubElements.js.txt +0 -105
  72. package/src/ui/elements/derived/code-note/code-cell.js +0 -195
  73. package/src/ui/elements/derived/code-note/code-note.js +0 -72
  74. package/src/ui/elements/derived/code-note/index.js +0 -2
  75. package/src/ui/elements/derived/code-note/sub-elements.js +0 -67
  76. package/src/ui/elements/derived/index.js +0 -12
  77. package/src/ui/elements/derived/menu/index.js +0 -1
  78. package/src/ui/elements/derived/menu/menu3d.js +0 -260
  79. package/src/ui/elements/derived/modal/index.js +0 -92
  80. package/src/ui/elements/derived/pagination/breadcrumbs.js +0 -54
  81. package/src/ui/elements/derived/pagination/index.js +0 -1
  82. package/src/ui/elements/derived/slider/__ZikoUISlider__.js +0 -112
  83. package/src/ui/elements/derived/slider/hSlider.js +0 -34
  84. package/src/ui/elements/derived/slider/index.js +0 -12
  85. package/src/ui/elements/derived/slider/vSlider.js +0 -27
  86. package/src/ui/elements/derived/splitter/__ZikoUISplitter__.js +0 -62
  87. package/src/ui/elements/derived/splitter/hsplitter.js +0 -40
  88. package/src/ui/elements/derived/splitter/index.js +0 -12
  89. package/src/ui/elements/derived/splitter/vsplitter.js +0 -40
  90. package/src/ui/elements/derived/tabs/index.js +0 -180
  91. package/src/ui/elements/primitives/ZikoUIContainerElement.js +0 -123
  92. /package/src/{global → _global (To Be Replaced )}/_themes/dark.js +0 -0
  93. /package/src/{global → _global (To Be Replaced )}/_themes/index.js +0 -0
  94. /package/src/{global → _global (To Be Replaced )}/_themes/light.js +0 -0
  95. /package/src/{global → _global (To Be Replaced )}/app/index.js +0 -0
  96. /package/src/{global → _global (To Be Replaced )}/component/index.js +0 -0
  97. /package/src/{global → _global (To Be Replaced )}/globals/index.js +0 -0
  98. /package/src/{global → _global (To Be Replaced )}/index.js +0 -0
  99. /package/src/{global → _global (To Be Replaced )}/params/index.js +0 -0
  100. /package/src/{global → _global (To Be Replaced )}/router/index.js +0 -0
  101. /package/src/{global → _global (To Be Replaced )}/seo/index.js +0 -0
  102. /package/src/{global → _global (To Be Replaced )}/style/index.js +0 -0
  103. /package/src/data/converter/{adoc.js → __(To Be Moved)adoc.js} +0 -0
  104. /package/src/data/converter/{markdown.js → __(To Be Moved)markdown.js} +0 -0
  105. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/index.js +0 -0
  106. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useBattery.js +0 -0
  107. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useCamera.js +0 -0
  108. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useGeolocation.js +0 -0
  109. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useMicro.js +0 -0
  110. /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useOrientation.js +0 -0
  111. /package/src/ui/elements/{primitives/embaded → embaded}/html.js +0 -0
  112. /package/src/ui/elements/{primitives/embaded → embaded}/index.js +0 -0
  113. /package/src/ui/elements/{primitives/embaded → embaded}/pdf.js +0 -0
  114. /package/src/ui/elements/{primitives/embaded → embaded}/youtube.js +0 -0
  115. /package/src/ui/elements/{primitives/hydrate.js → hydrate.js} +0 -0
  116. /package/src/ui/elements/{primitives/io → io}/Form/index.js.txt +0 -0
  117. /package/src/ui/elements/{primitives/io → io}/Inputs/index.js +0 -0
  118. /package/src/ui/elements/{primitives/io → io}/Inputs/input-camera/index.js +0 -0
  119. /package/src/ui/elements/{primitives/io → io}/Inputs/input-checkbox/index.js +0 -0
  120. /package/src/ui/elements/{primitives/io → io}/Inputs/input-color/index.js +0 -0
  121. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/index.js +0 -0
  122. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date-time.js +0 -0
  123. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date.js +0 -0
  124. /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-time.js +0 -0
  125. /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/index.js +0 -0
  126. /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-email.js +0 -0
  127. /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-password.js +0 -0
  128. /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/index.js +0 -0
  129. /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-file.js +0 -0
  130. /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-image.js +0 -0
  131. /package/src/ui/elements/{primitives/io → io}/Inputs/input-number/index.js +0 -0
  132. /package/src/ui/elements/{primitives/io → io}/Inputs/input-radio/index.js +0 -0
  133. /package/src/ui/elements/{primitives/io → io}/Inputs/input-search/index.js +0 -0
  134. /package/src/ui/elements/{primitives/io → io}/Inputs/input-slider/index.js +0 -0
  135. /package/src/ui/elements/{primitives/io → io}/Select/index.js +0 -0
  136. /package/src/ui/elements/{primitives/io → io}/Textarea/index.js +0 -0
  137. /package/src/ui/elements/{primitives/io → io}/index.js +0 -0
  138. /package/src/ui/elements/{primitives/list → list}/elements.js +0 -0
  139. /package/src/ui/elements/{primitives/media → media}/Audio/index.js +0 -0
  140. /package/src/ui/elements/{primitives/media → media}/Image/figure.js +0 -0
  141. /package/src/ui/elements/{primitives/media → media}/Image/image.js +0 -0
  142. /package/src/ui/elements/{primitives/media → media}/Image/index.js +0 -0
  143. /package/src/ui/elements/{primitives/media → media}/Video/index.js +0 -0
  144. /package/src/ui/elements/{primitives/media → media}/__ZikoUIDynamicMediaELement__.js +0 -0
  145. /package/src/ui/elements/{primitives/media → media}/index.js +0 -0
  146. /package/src/ui/elements/{primitives/misc → misc}/hyperscript.js +0 -0
  147. /package/src/ui/elements/{primitives/misc → misc}/suspense.js +0 -0
  148. /package/src/ui/elements/{primitives/misc → misc}/xml-wrapper.js +0 -0
  149. /package/src/ui/elements/{primitives/table → table}/elements.js +0 -0
  150. /package/src/ui/elements/{primitives/table → table}/index.js +0 -0
  151. /package/src/ui/elements/{primitives/table → table}/utils.js +0 -0
  152. /package/src/ui/elements/{primitives/text → text}/heading.js +0 -0
  153. /package/src/ui/elements/{primitives/text → text}/index.js +0 -0
  154. /package/src/ui/elements/{primitives/text → text}/p.js +0 -0
  155. /package/src/ui/elements/{primitives/text → text}/pre.js +0 -0
  156. /package/src/ui/elements/{primitives/text → text}/text.js +0 -0
@@ -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
- }
@@ -1,62 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgPath extends ZikoSvgElement{
3
- constructor(){
4
- super()
5
- this.element=document?.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "path",
8
- );
9
- this.path="";
10
-
11
- }
12
- setPath(){
13
- this.element.etAttribute("d",this.path);
14
- return this;
15
- }
16
- clear(){
17
- this.path="";
18
- this.setPath();
19
- return this;
20
- }
21
- moveTo(x,y){
22
- this.path+=`M${x} ${y} `;
23
- this.setPath();
24
- return this;
25
- }
26
- lineTo(x,y){
27
- this.path+=`L${x} ${y} `;
28
- this.setPath();
29
- return this;
30
- }
31
- hr(x){
32
- this.path+=`H${x} `;
33
- this.setPath();
34
- return this;
35
- }
36
- vr(y){
37
- this.path+=`V${y} `;
38
- this.setPath();
39
- return this;
40
- }
41
- bezier(x1,y1,x2,y2,x,y){
42
- this.path+=`C ${x1} ${y1},${x2} ${y2},${x} ${y} `;
43
- this.setPath();
44
- return this;
45
- }
46
- quadratic(x1,y1,x,y){
47
- this.path+=`Q ${x1} ${y1} ${x} ${y} `;
48
- this.setPath();
49
- return this;
50
- }
51
- close(){
52
- this.path+="Z";
53
- this.setPath();
54
- return this;
55
- }
56
- }
57
-
58
- const svgPath=()=>new ZikoSvgPath();
59
- export{
60
- svgPath,
61
- ZikoSvgPath
62
- }
@@ -1,32 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgPolygon extends ZikoSvgElement{
3
- constructor(X=[],Y=[]){
4
- super()
5
- this.X=X;
6
- this.Y=Y
7
- this.element=document?.createElementNS(
8
- "http://www.w3.org/2000/svg",
9
- "polygon",
10
- );
11
- this.element?.setAttribute("points","");
12
- this.addPoints(X,Y)
13
- }
14
- addPoint(x,y){
15
- let p=this.element.parentElement.createSVGPoint();
16
- p.x=x;
17
- p.y=y;
18
- this.element.points.appendItem(p);
19
- return this;
20
- }
21
- addPoints(X,Y){
22
- for(let i=0;i<X.length;i++){
23
- let p=this.element.parentElement.createSVGPoint();
24
- p.x=X[i];
25
- p.y=Y[i];
26
- this.element.oints.appendItem(p)
27
- }
28
- return this;
29
- }
30
- }
31
- const svgPolygon=(X,Y)=>new ZikoSvgPolygon(X,Y);
32
- export{ svgPolygon }
@@ -1,7 +0,0 @@
1
- import ZikoSvgElement from "../ZikoSvgElement.js";
2
- class ZikoSvgPolyLine extends ZikoSvgElement{}
3
- const svgPolyLine=(X,Y)=>new ZikoSvgPolyLine(X,Y);
4
- export {
5
- svgPolyLine,
6
- ZikoSvgPolyLine
7
- }
@@ -1,46 +0,0 @@
1
-
2
- import ZikoSvgELement from "../ziko-svg-element.js";
3
- class ZikoSvgRectangle extends ZikoSvgELement{
4
- constructor(x,y,w,h,center=true){
5
- super()
6
- this.element=document?.createElementNS(
7
- "http://www.w3.org/2000/svg",
8
- "rect",
9
- );
10
- this.setX(x).setY(y).width(w).height(h);
11
- this.rx=this.x+this.w/2;
12
- this.ty=this.y+this.h/2;
13
- }
14
- setX(x){
15
- this.element.x.baseVal.value=x;
16
- this.x=x;
17
- return this;
18
- }
19
- setY(y){
20
- this.element.y.baseVal.value=y;
21
- this.y=y;
22
- return this;
23
- }
24
- r(rx,ry){
25
- this.rx=rx;
26
- this.ry=ry;
27
- this.setX(this.rx-this.w/2);
28
- this.setY(this.ry-this.h/2);
29
- return this;
30
- }
31
- width(w){
32
- this.element.width.baseVal.value=w;
33
- this.w=w;
34
- return this;
35
- }
36
- height(h){
37
- this.element.height.baseVal.value=h;
38
- this.h=h;
39
- return this;
40
- }
41
- }
42
- const svgRect=(x,y,w,h,center)=>new ZikoSvgRectangle(x,y,w,h,center);
43
- export{
44
- svgRect,
45
- ZikoSvgRectangle
46
- }
@@ -1,29 +0,0 @@
1
- import ZikoSvgElement from "../ziko-svg-element.js";
2
- class ZikoSvgText extends ZikoSvgElement{
3
- constructor(text,x,y){
4
- super()
5
- this.element=document?.createElementNS(
6
- "http://www.w3.org/2000/svg",
7
- "text",
8
- );
9
- this.setText(text)
10
- this.x(x).y(y);
11
- }
12
- x(x){
13
- this.element?.setAttribute("x",x);
14
- return this;
15
- }
16
- y(y){
17
- this.element?.setAttribute("y",y);
18
- return this;
19
- }
20
- setText(text=""){
21
- this.element.textContent=text;
22
- return this;
23
- }
24
- }
25
- const svgText=(text,x,y)=>new ZikoSvgText(text,x,y);
26
- export{
27
- svgText,
28
- ZikoSvgText
29
- }
@@ -1,9 +0,0 @@
1
- import { svgPath } from "../basic/path"
2
- const svgGrid=(w,h,r=10,c=10)=>{
3
- let path=svgPath().fill("none").stroke("coral").strokeWidth(0.6)
4
- console.log({x:w/r,y:h/c})
5
- for(let i=0;i<w;i++) path.moveTo(0,i*w/r).hr(w)
6
- for(let j=0;j<h;j++) path.moveTo(j*h/c,0).vr(h)
7
- return path
8
- }
9
- export{ svgGrid };
@@ -1 +0,0 @@
1
- export * from "./grid.js"
@@ -1,2 +0,0 @@
1
- export * from "./basic/index.js"
2
- export { svgGrid } from "./derived/grid.js";
@@ -1,48 +0,0 @@
1
- import { ZikoUIElement } from "../../../ui";
2
- class ZikoSvgElement extends ZikoUIElement{
3
- constructor(type) {
4
- super()
5
- Object.assign(this.cache,{
6
- type
7
- })
8
- }
9
- pos(x,y){
10
- return this.posX(x).posY(y);
11
- }
12
- posX(x){
13
- if(["circle","ellipse"].includes(this.cache.type))this.element.cx.baseVal.value=x;
14
- else this.element.x.baseVal.value=x;
15
- return this;
16
- }
17
- posY(y){
18
- if(["circle","ellipse"].includes(this.cache.type))this.element.cy.baseVal.value=y;
19
- else this.element.y.baseVal.value=y;
20
- return this;
21
- }
22
- translate(x,y){
23
- return this;
24
- }
25
- color({ stroke, fill }) {
26
- this.element?.setAttribute("stroke", stroke);
27
- this.element?.setAttribute("fill", fill);
28
- return this;
29
- }
30
- fill(color = "none") {
31
- this.element?.setAttribute("fill", color);
32
- return this;
33
- }
34
- stroke(color = "none", width) {
35
- this.element?.setAttribute("stroke", color);
36
- width && this.strokeWidth(width);
37
- return this;
38
- }
39
- strokeWidth(width = 1) {
40
- this.element?.setAttribute("stroke-width", width);
41
- return this;
42
- }
43
- opacity(value = 1) {
44
- this.element?.setAttribute("opacity", value);
45
- return this;
46
- }
47
- }
48
- export default ZikoSvgElement;
@@ -1,69 +0,0 @@
1
- import { ZikoUIContainerElement } from "../../ui/index.js";
2
- class ZikoUISvg extends ZikoUIContainerElement {
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
- }
File without changes
package/src/types.js DELETED
@@ -1,73 +0,0 @@
1
- // import ZikoUIElement from "./ui/elements/primitives/ZikoUIElement";
2
- // import ZikoUIContainerElement from "./ui/elements/primitives/ZikoUIContainerElement";
3
-
4
- // export {
5
- // ZikoUIElement,
6
- // ZikoUIContainerElement
7
- // }
8
- // export {
9
- // ZikoUIAbbrText,
10
- // ZikoUIAccordion,
11
- // ZikoUIArticle,
12
- // ZikoUIAside,
13
- // ZikoUIAudio,
14
- // ZikoUIBlockQuote,
15
- // ZikoUIBr,
16
- // ZikoUIBreadcrumbs,
17
- // ZikoUICodeNote,
18
- // ZikoUICodeText,
19
- // ZikoUIDefintion,
20
- // ZikoUIFigure,
21
- // ZikoUIFlex,
22
- // ZikoUIFooter,
23
- // ZikoUIForm,
24
- // ZikoUIGrid,
25
- // ZikoUIHeader,
26
- // ZikoUIHeading,
27
- // ZikoUIHorizontalSplitter,
28
- // ZikoUIHorizontalSlider,
29
- // ZikoUIHr,
30
- // ZikoUIHtmlTag,
31
- // ZikoUIImage,
32
- // ZikoUIInput,
33
- // ZikoUIInputCheckbox,
34
- // ZikoUIInputColor,
35
- // ZikoUIInputDatalist,
36
- // ZikoUIInputDate,
37
- // ZikoUIInputDateTime,
38
- // ZikoUIInputEmail,
39
- // ZikoUIInputImage,
40
- // ZikoUIInputNumber,
41
- // ZikoUIInputOption,
42
- // ZikoUIInputPassword,
43
- // ZikoUIInputRadio,
44
- // ZikoUIInputSearch,
45
- // ZikoUIInputSlider,
46
- // ZikoUIInputTime,
47
- // ZikoUILabel,
48
- // ZikoUILink,
49
- // ZikoUIMain,
50
- // ZikoUIMenu3d,
51
- // ZikoUIModal,
52
- // ZikoUINav,
53
- // ZikoUIParagraphe,
54
- // ZikoUIQuote,
55
- // ZikoUISection,
56
- // ZikoUISelect,
57
- // ZikoUISubText,
58
- // ZikoUISupText,
59
- // ZikoUIText,
60
- // ZikoUITextArea,
61
- // ZikoUIVerticalSplitter,
62
- // ZikoUIVerticalSlider,
63
- // ZikoUIVideo,
64
- // } from "./ui/index.js"
65
-
66
- // export{
67
- // Matrix,
68
- // LinearSystem,
69
- // Complex,
70
- // Random,
71
- // } from "./math/index.js"
72
-
73
-
@@ -1,42 +0,0 @@
1
- import ZikoUIContainerElement from "../../primitives/ZikoUIContainerElement.js";
2
- class ZikoUIAccordion extends ZikoUIContainerElement{
3
- constructor(...Collapsible){
4
- super("div", "Accordion")
5
- this.append(...Collapsible);
6
- Object.assign(this.cache,{
7
- autoClose : true
8
- })
9
- }
10
- get isAccordion(){
11
- return true;
12
- }
13
- closeAll(){
14
- this.items.forEach(n=>n.close());
15
- return this;
16
- }
17
- closeExcept(...Collapsibles){
18
- this.items.filter(n=>!Collapsibles.includes(n)).forEach(n=>n.close())
19
- return this;
20
- }
21
- open(CollapsibleOrIndex){
22
- CollapsibleOrIndex.isCollapsible? CollapsibleOrIndex.open(): this.items[CollapsibleOrIndex].open();
23
- this.closeExcept(CollapsibleOrIndex.isCollapsible? CollapsibleOrIndex: this.items[CollapsibleOrIndex]);
24
- return this;
25
- }
26
- enableAutoClose(){
27
- this.cache.autoClose = true;
28
- return this;
29
- }
30
- disableAutoClose(){
31
- this.cache.autoClose = false;
32
- return this;
33
- }
34
- toggleAutoClose(){
35
- this.cache.autoClose = !this.cache.autoClose;
36
- }
37
- }
38
- const Accordion = (... Collapsible) => new ZikoUIAccordion(...Collapsible);
39
- export{
40
- Accordion,
41
- ZikoUIAccordion
42
- }
@@ -1,82 +0,0 @@
1
- import ZikoUIElement from "../../primitives/ZikoUIElement.js";
2
- import { html } from "../../primitives/misc/index.js";
3
- import { watchAttr } from "../../../../reactivity/index.js";
4
- class ZikoUICollapbsible extends ZikoUIElement{
5
- constructor(summary,content,openIcon="😁", closeIcon=openIcon){
6
- super("details","Collapsible")
7
- Object.assign(this.cache,{
8
- icons:{
9
- open : openIcon,
10
- close : closeIcon
11
- }
12
- })
13
- this.summary=html("summary",summary).style({
14
- fontSize:"1.1em",
15
- padding:"0.625rem",
16
- fontWeight:"bold",
17
- listStyleType:`"${openIcon}"`,
18
- cursor:"pointer",
19
- });
20
- this.summary[0].style({
21
- marginLeft:"0.5em",
22
- })
23
- this.content=content.style({
24
- margin:"0.7em",
25
- });
26
- this.element?.append(this.summary.element,this.content.element)
27
- this.style({
28
- marginBottom:"0.7em",
29
- })
30
- watchAttr(this, e=>{
31
- if(e.target.isOpen){
32
- e.target.emit("open");
33
- if(this?.parent?.isAccordion){
34
- if(this.parent.cache.autoClose)this.parent.closeExcept(this);
35
- }
36
- this.summary.style({
37
- listStyleType:`"${this.cache.icons.close}"`
38
- })
39
- }
40
- else{
41
- e.target.emit("close");
42
- this.summary.style({
43
- listStyleType:`"${this.cache.icons.open}"`
44
- })
45
- }
46
- })
47
- }
48
- get isCollapsible(){
49
- return true;
50
- }
51
- get isOpen(){
52
- return this.element.open;
53
- }
54
- open(details=this){
55
- this.element.open=true;
56
- this.emit("open",details)
57
- return this;
58
- }
59
- close(){
60
- this.element.open=false;
61
- return this;
62
- }
63
- onOpen(callback){
64
- this.on("open", callback)
65
- return this;
66
- }
67
- onClose(callback){
68
- this.on("close", callback)
69
- return this;
70
- }
71
- toggle(){
72
- this.element.open=!this.element.open;
73
- return this;
74
- }
75
- }
76
-
77
-
78
- const Collapsible=(summary, content, openIcon, closeIcon)=>new ZikoUICollapbsible(summary,content,openIcon, closeIcon);
79
- export{
80
- Collapsible
81
- }
82
-
@@ -1,2 +0,0 @@
1
- export * from "./collapsible.js"
2
- export * from "./accordion.js"
@@ -1,80 +0,0 @@
1
- import { Flex,ZikoUIFlex } from "../flex";
2
- import { palette } from "./palette.js";
3
- import { text, h3 } from "../../primitives/text/index";
4
- class ZikoUIAlert extends ZikoUIFlex{
5
- constructor(type, title, content){
6
- super()
7
- this.title = h3(title);
8
- this.icon = text(palette[type].icon).style({
9
- display: "flex",
10
- justifyContent:"center",
11
- borderRadius:"50%",
12
- minWidth:"30px",
13
- minHeight:"30px",
14
- });
15
- this.content = content;
16
- this.vertical()
17
- .size("200px", "auto")
18
- .style({
19
- borderRadius:"10px",
20
- padding:"10px"
21
- });
22
- this.append(
23
- Flex(
24
- this.title,
25
- this.icon
26
- ).size("100%", "40px").style({}).horizontal("space-between",0),
27
- this.content
28
- )
29
- this.useType(type);
30
- }
31
- get isAlert(){
32
- return true;
33
- }
34
- useType(type){
35
- this.style({
36
- color:palette[type].color,
37
- background:palette[type].bgColor,
38
- border: `1px darkblue solid`,
39
- borderLeft: `15px ${palette[type].borderColor} solid`,
40
- })
41
- this.title.style({
42
- color:palette[type].titleColor
43
- });
44
- this.content.st.color(palette[type].titleColor)
45
- this.icon.setValue(palette[type].icon).style({
46
- border:`2px ${palette[type].borderColor} solid`,
47
- alignItems: type==="warning"?"flex-start":"center",
48
- });
49
- return this;
50
- }
51
- useSuccess(){
52
- this.useType("success");
53
- return this;
54
- }
55
- useInfo(){
56
- this.useType("info");
57
- return this;
58
- }
59
- useWarning(){
60
- this.useType("warning");
61
- return this;
62
- }
63
- useDanger(){
64
- this.useType("danger");
65
- return this;
66
- }
67
- }
68
-
69
- const successAlert=(title, content)=>new ZikoUIAlert("success", title, content);
70
- const infoAlert=(title, content)=>new ZikoUIAlert("info", title, content);
71
- const warningAlert=(title, content)=>new ZikoUIAlert("warning", title, content);
72
- const dangerAlert=(title, content)=>new ZikoUIAlert("danger", title, content);
73
-
74
- export{
75
- successAlert,
76
- infoAlert,
77
- warningAlert,
78
- dangerAlert
79
- }
80
-
@@ -1 +0,0 @@
1
- export * from "./Alert.js"