ziko 0.0.5 → 0.0.7

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 (236) hide show
  1. package/README.md +171 -182
  2. package/dist/ziko.cjs +10022 -9853
  3. package/dist/ziko.js +10023 -9854
  4. package/dist/ziko.min.js +2 -2
  5. package/dist/ziko.mjs +10021 -9853
  6. package/package.json +12 -4
  7. package/starter/bin/index.js +11 -0
  8. package/wrapper/react/README.md +26 -0
  9. package/wrapper/react/index.jsx +7 -1
  10. package/wrapper/svelte/ZikoUI.svelte +15 -0
  11. package/wrapper/vue/ZikoUI.vue +8 -2
  12. package/core/App/Accessibility/index.js +0 -0
  13. package/core/App/Globals/__Target__.js +0 -3
  14. package/core/App/Globals/__UI__.js +0 -38
  15. package/core/App/Globals/__init__.js +0 -8
  16. package/core/App/Globals/index.js +0 -18
  17. package/core/App/Router/index.js +0 -40
  18. package/core/App/Seo/index.js +0 -43
  19. package/core/App/Themes/dark.js +0 -885
  20. package/core/App/Themes/index.js +0 -11
  21. package/core/App/Themes/light.js +0 -255
  22. package/core/App/app.js +0 -46
  23. package/core/App/index.js +0 -12
  24. package/core/Data/Api/fetchdom.js +0 -14
  25. package/core/Data/Api/index.js +0 -4
  26. package/core/Data/Api/preload.js +0 -11
  27. package/core/Data/Converter/canvas.js +0 -25
  28. package/core/Data/Converter/csv.js +0 -33
  29. package/core/Data/Converter/index.js +0 -25
  30. package/core/Data/Converter/json.js +0 -80
  31. package/core/Data/Converter/markdown.js +0 -83
  32. package/core/Data/Converter/svg.js +0 -11
  33. package/core/Data/Parser/markdown.js +0 -0
  34. package/core/Data/Parser/xml.js +0 -47
  35. package/core/Data/Strings/index.js +0 -26
  36. package/core/Data/decorators.js +0 -0
  37. package/core/Data/index.js +0 -64
  38. package/core/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  39. package/core/Graphics/Canvas/Elements/Basic/image.js +0 -0
  40. package/core/Graphics/Canvas/Elements/Basic/line.js +0 -26
  41. package/core/Graphics/Canvas/Elements/Basic/path.js +0 -0
  42. package/core/Graphics/Canvas/Elements/Basic/points.js +0 -48
  43. package/core/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  44. package/core/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  45. package/core/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  46. package/core/Graphics/Canvas/Elements/Basic/text.js +0 -0
  47. package/core/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  48. package/core/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  49. package/core/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  50. package/core/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  51. package/core/Graphics/Canvas/Elements/Element.js +0 -115
  52. package/core/Graphics/Canvas/Elements/Groupe.js +0 -0
  53. package/core/Graphics/Canvas/Elements/grid.js +0 -0
  54. package/core/Graphics/Canvas/Elements/index.js +0 -13
  55. package/core/Graphics/Canvas/Filter/index.js +0 -0
  56. package/core/Graphics/Canvas/Paint/index.js +0 -0
  57. package/core/Graphics/Canvas/Utils/color.js +0 -8
  58. package/core/Graphics/Canvas/Utils/floodFill.js +0 -58
  59. package/core/Graphics/Canvas/_canvas_offscreen +0 -0
  60. package/core/Graphics/Canvas/canvas.js +0 -189
  61. package/core/Graphics/Canvas/index.js +0 -15
  62. package/core/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  63. package/core/Graphics/Svg/Elements/circle.js +0 -34
  64. package/core/Graphics/Svg/Elements/ellipse.js +0 -29
  65. package/core/Graphics/Svg/Elements/foreignObject.js +0 -46
  66. package/core/Graphics/Svg/Elements/grid.js +0 -9
  67. package/core/Graphics/Svg/Elements/groupe.js +0 -29
  68. package/core/Graphics/Svg/Elements/image.js +0 -33
  69. package/core/Graphics/Svg/Elements/line.js +0 -29
  70. package/core/Graphics/Svg/Elements/path.js +0 -59
  71. package/core/Graphics/Svg/Elements/polygon.js +0 -31
  72. package/core/Graphics/Svg/Elements/polyline.js +0 -4
  73. package/core/Graphics/Svg/Elements/rect.js +0 -43
  74. package/core/Graphics/Svg/Elements/text.js +0 -26
  75. package/core/Graphics/Svg/index.js +0 -1
  76. package/core/Graphics/Svg/svg.js +0 -117
  77. package/core/Graphics/index.js +0 -61
  78. package/core/Math/Calculus/Special Functions/bessel.js +0 -31
  79. package/core/Math/Calculus/Special Functions/beta.js +0 -38
  80. package/core/Math/Calculus/Special Functions/gamma.js +0 -30
  81. package/core/Math/Calculus/Special Functions/index.js +0 -4
  82. package/core/Math/Calculus/index.js +0 -1
  83. package/core/Math/Complex/Fractals/julia.js +0 -0
  84. package/core/Math/Complex/index.js +0 -191
  85. package/core/Math/Discret/Combinaison/index.js +0 -34
  86. package/core/Math/Discret/Conversion/index.js +0 -86
  87. package/core/Math/Discret/Logic/index.js +0 -46
  88. package/core/Math/Discret/Permutation/index.js +0 -31
  89. package/core/Math/Discret/Set/index.js +0 -2
  90. package/core/Math/Discret/Set/powerSet.js +0 -15
  91. package/core/Math/Discret/Set/subSet.js +0 -10
  92. package/core/Math/Discret/index.js +0 -23
  93. package/core/Math/Functions/index.js +0 -182
  94. package/core/Math/Matrix/Decomposition.js +0 -90
  95. package/core/Math/Matrix/LinearSystem.js +0 -10
  96. package/core/Math/Matrix/Matrix.js +0 -712
  97. package/core/Math/Matrix/index.js +0 -3
  98. package/core/Math/Numeric/index.js +0 -0
  99. package/core/Math/Random/index.js +0 -173
  100. package/core/Math/Signal/__np.py.txt +0 -40
  101. package/core/Math/Signal/conv.js +0 -175
  102. package/core/Math/Signal/fft.js +0 -55
  103. package/core/Math/Signal/filter.js +0 -39
  104. package/core/Math/Signal/functions.js +0 -146
  105. package/core/Math/Signal/index.js +0 -110
  106. package/core/Math/Statistics/Functions/index.js +0 -100
  107. package/core/Math/Statistics/index.js +0 -16
  108. package/core/Math/Utils/arithmetic.js +0 -139
  109. package/core/Math/Utils/checkers.js +0 -11
  110. package/core/Math/Utils/comparaison.js +0 -1
  111. package/core/Math/Utils/conversions.js +0 -7
  112. package/core/Math/Utils/discret.js +0 -28
  113. package/core/Math/Utils/index.js +0 -102
  114. package/core/Math/Utils/mapfun.js +0 -43
  115. package/core/Math/absract.js +0 -1
  116. package/core/Math/const.js +0 -3
  117. package/core/Math/index.js +0 -193
  118. package/core/Reactivity/Events/Global/Click.js +0 -56
  119. package/core/Reactivity/Events/Global/Clipboard.js +0 -84
  120. package/core/Reactivity/Events/Global/CustomEvent.js +0 -53
  121. package/core/Reactivity/Events/Global/Drag.js +0 -137
  122. package/core/Reactivity/Events/Global/Focus.js +0 -56
  123. package/core/Reactivity/Events/Global/Key.js +0 -104
  124. package/core/Reactivity/Events/Global/Mouse.js +0 -230
  125. package/core/Reactivity/Events/Global/Pointer.js +0 -214
  126. package/core/Reactivity/Events/Global/Touch.js +0 -0
  127. package/core/Reactivity/Events/Global/Wheel.js +0 -44
  128. package/core/Reactivity/Events/Partiel/Hash.js +0 -44
  129. package/core/Reactivity/Events/Partiel/Input.js +0 -59
  130. package/core/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  131. package/core/Reactivity/Events/ZikoEvent.js +0 -91
  132. package/core/Reactivity/Events/index.js +0 -60
  133. package/core/Reactivity/Observer/index.js +0 -3
  134. package/core/Reactivity/Observer/intersection.js +0 -40
  135. package/core/Reactivity/Observer/mutation.js +0 -90
  136. package/core/Reactivity/Observer/resize.js +0 -47
  137. package/core/Reactivity/Use/Contexte/index.js +0 -1
  138. package/core/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  139. package/core/Reactivity/Use/Decorators/index.js +0 -4
  140. package/core/Reactivity/Use/Interactions/index.js +0 -4
  141. package/core/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  142. package/core/Reactivity/Use/Interactions/useChannel.js +0 -50
  143. package/core/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  144. package/core/Reactivity/Use/Interactions/useSerial.js +0 -0
  145. package/core/Reactivity/Use/Interactions/useThread.js +0 -44
  146. package/core/Reactivity/Use/Interactions/useUsb.js +0 -0
  147. package/core/Reactivity/Use/Sensors/index.js +0 -2
  148. package/core/Reactivity/Use/Sensors/useBattery.js +0 -36
  149. package/core/Reactivity/Use/Sensors/useCamera.js +0 -0
  150. package/core/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  151. package/core/Reactivity/Use/Sensors/useMicro.js +0 -0
  152. package/core/Reactivity/Use/Sensors/useOrientation.js +0 -0
  153. package/core/Reactivity/Use/Storage/index.js +0 -1
  154. package/core/Reactivity/Use/Storage/useCookie.js +0 -0
  155. package/core/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  156. package/core/Reactivity/Use/Storage/useStorage.js +0 -74
  157. package/core/Reactivity/Use/UI/index.js +0 -4
  158. package/core/Reactivity/Use/UI/useCssLink.js +0 -0
  159. package/core/Reactivity/Use/UI/useCssText.js +0 -21
  160. package/core/Reactivity/Use/UI/useFavIcon.js +0 -38
  161. package/core/Reactivity/Use/UI/useLinearGradient.js +0 -0
  162. package/core/Reactivity/Use/UI/useMediaQuery.js +0 -1
  163. package/core/Reactivity/Use/UI/useRadialGradient.js +0 -0
  164. package/core/Reactivity/Use/UI/useStyle.js +0 -54
  165. package/core/Reactivity/Use/UI/useTheme.js +0 -62
  166. package/core/Reactivity/Use/UI/useTitle.js +0 -30
  167. package/core/Reactivity/Use/index.js +0 -82
  168. package/core/Reactivity/Use/todo.md +0 -26
  169. package/core/Reactivity/index.js +0 -3
  170. package/core/Time/animation.js +0 -76
  171. package/core/Time/index.js +0 -54
  172. package/core/Time/loop.js +0 -83
  173. package/core/Time/utils/decorators.js +0 -17
  174. package/core/Time/utils/ease.js +0 -144
  175. package/core/Time/utils/index.js +0 -18
  176. package/core/Time/utils/performance.js +0 -16
  177. package/core/Time/utils/ui.js +0 -26
  178. package/core/UI/CustomElement/Elements/Accordion/index.js +0 -62
  179. package/core/UI/CustomElement/Elements/Carousel/index.js +0 -47
  180. package/core/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  181. package/core/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  182. package/core/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  183. package/core/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  184. package/core/UI/CustomElement/Elements/Columns.js +0 -1
  185. package/core/UI/CustomElement/Elements/FAB.js +0 -0
  186. package/core/UI/CustomElement/Elements/Menu.js +0 -0
  187. package/core/UI/CustomElement/Elements/Notification.js +0 -0
  188. package/core/UI/CustomElement/Elements/Popover.js +0 -0
  189. package/core/UI/CustomElement/Elements/Popup.js +0 -0
  190. package/core/UI/CustomElement/Elements/Swipper.js +0 -4
  191. package/core/UI/CustomElement/Elements/Tabs/index.js +0 -111
  192. package/core/UI/CustomElement/Elements/Timeline.js +0 -0
  193. package/core/UI/CustomElement/Elements/Toast.js +0 -0
  194. package/core/UI/CustomElement/Elements/Treeview.js +0 -0
  195. package/core/UI/CustomElement/Elements/index.js +0 -4
  196. package/core/UI/CustomElement/Flex.js +0 -97
  197. package/core/UI/CustomElement/Grid.js +0 -30
  198. package/core/UI/CustomElement/index.js +0 -3
  199. package/core/UI/Embaded/index.js +0 -1
  200. package/core/UI/Inputs/Primitives/btn.js +0 -30
  201. package/core/UI/Inputs/Primitives/elements.js +0 -28
  202. package/core/UI/Inputs/Primitives/inputs.js +0 -324
  203. package/core/UI/Inputs/Primitives/select.js +0 -14
  204. package/core/UI/Inputs/Primitives/textarea.js +0 -15
  205. package/core/UI/Inputs/camera.js +0 -23
  206. package/core/UI/Inputs/index.js +0 -20
  207. package/core/UI/List/elements.js +0 -0
  208. package/core/UI/List/index.js +0 -127
  209. package/core/UI/Media/Audio/index.js +0 -38
  210. package/core/UI/Media/Image/figure.js +0 -16
  211. package/core/UI/Media/Image/image.js +0 -33
  212. package/core/UI/Media/Image/index.js +0 -2
  213. package/core/UI/Media/Video/index.js +0 -49
  214. package/core/UI/Media/index.js +0 -3
  215. package/core/UI/Misc/index.js +0 -45
  216. package/core/UI/Semantic/index.js +0 -61
  217. package/core/UI/Style/index.js +0 -499
  218. package/core/UI/Table/elements.js +0 -94
  219. package/core/UI/Table/index.js +0 -3
  220. package/core/UI/Table/table.js +0 -112
  221. package/core/UI/Table/utils.js +0 -12
  222. package/core/UI/Text/heading.js +0 -34
  223. package/core/UI/Text/index.js +0 -3
  224. package/core/UI/Text/p.js +0 -36
  225. package/core/UI/Text/pre.js +0 -0
  226. package/core/UI/Text/text.js +0 -65
  227. package/core/UI/Utils/index.js +0 -70
  228. package/core/UI/ZikoUIElement.js +0 -503
  229. package/core/UI/index.js +0 -154
  230. package/core/__proto__/Array.js +0 -74
  231. package/core/__proto__/Function.js +0 -0
  232. package/core/__proto__/Number.js +0 -76
  233. package/core/__proto__/Object.js +0 -0
  234. package/core/__proto__/String.js +0 -0
  235. package/core/index.js +0 -72
  236. package/wrapper/react/readme.md +0 -19
@@ -1,16 +0,0 @@
1
- const time_memory_Taken = (callback) => {
2
- const t0 = Date.now();
3
- const m0 = performance.memory.usedJSHeapSize;
4
- const result = callback();
5
- const t1 = Date.now();
6
- const m1 = performance.memory.usedJSHeapSize;
7
- const elapsedTime = t1 - t0;
8
- const usedMemory = m1 - m0;
9
- return {
10
- elapsedTime,
11
- usedMemory,
12
- result
13
- };
14
- };
15
- export {time_memory_Taken}
16
-
@@ -1,26 +0,0 @@
1
- const waitForUIElm=(UIElement)=>{
2
- return new Promise(resolve => {
3
- if (UIElement.element) {
4
- return resolve(UIElement.element);
5
- }
6
-
7
- const observer = new MutationObserver(() => {
8
- if (UIElement.element) {
9
- resolve(UIElement.element);
10
- observer.disconnect();
11
- }
12
- });
13
-
14
- observer.observe(document.body, {
15
- childList: true,
16
- subtree: true
17
- });
18
- });
19
- }
20
- const waitForUIElmSync=(UIElement,timeout=2000)=>{
21
- const t0=Date.now();
22
- while(Date.now()-t0<timeout){
23
- if(UIElement.element)return UIElement.element
24
- }
25
- }
26
- export {waitForUIElm,waitForUIElmSync}
@@ -1,62 +0,0 @@
1
- import ZikoUIElement from "../../../ZikoUIElement";
2
- import { ZikoUIFlex } from "../../Flex";
3
- import { html } from "../../../Misc";
4
- class ZikoUIAccordion extends ZikoUIElement{
5
- constructor(summary,content,icon="😁"){
6
- super("details","Accordion")
7
- this.summary=html("summary",summary).style({
8
- fontSize:"1.1em",
9
- padding:"0.625rem",
10
- fontWeight:"bold",
11
- listStyleType:`"${icon}"`,
12
- cursor:"pointer",
13
- });
14
- this.summary[0].style({
15
- marginLeft:"0.5em",
16
- })
17
- this.content=content.style({
18
- margin:"0.7em",
19
- });
20
- this.append(this.summary,this.content);
21
- this.style({
22
- marginBottom:"0.7em",
23
- })
24
- this.render();
25
- }
26
- get isOpen(){
27
- return this.element.open;
28
- }
29
- open(){
30
- this.element.open=true;
31
- return this;
32
- }
33
- onOpen(callback){
34
- return this;
35
- }
36
- close(){
37
- this.element.open=true;
38
- return this;
39
- }
40
- onClose(callback){
41
- return this;
42
- }
43
- toggle(){
44
- this.element.open=!this.element.open;
45
- return this;
46
- }
47
- }
48
- class ZikoUIAccordions extends ZikoUIFlex{
49
- constructor(){
50
- super();
51
- }
52
- addPair(controller,details){
53
-
54
- }
55
- }
56
-
57
- const Accordion=(summary,content,icon)=>new ZikoUIAccordion(summary,content,icon);
58
- export{
59
- Accordion
60
- }
61
-
62
- // Watch open using Mutation observer
@@ -1,47 +0,0 @@
1
- import { ZikoUIFlex } from "../../Flex";
2
- class ZikoUICarousel extends ZikoUIFlex{
3
- constructor(...ZikoUIElement){
4
- super()
5
- this.style({
6
- position:"relative",
7
- overflow:"hidden",
8
- touchAction:"none",
9
- userSelect:"none"
10
- });
11
- this.horizontal("space-around",0);
12
- this.track = Section(...ZikoUIElement).style({ display: "inline-flex" });
13
- this.track.size(this.track.children.length * 100 + "vw");
14
- this.track.setTarget(this);
15
- this.track.items.map((n) =>
16
- n.style({ pointerEvents: "none", margin: "auto 10px" })
17
- );
18
- this.x0 = null;
19
- this.tx = 0;
20
- this.onPtrMove(e=>{
21
- if(e.isDown){
22
- let x = e.event.pageX;
23
- let dx = x - this.x0;
24
- this.track.st.translateX(
25
- this.tx + dx,
26
- 0
27
- );
28
- }
29
- })
30
- this.onPtrDown(e=>{
31
- console.log(e.event)
32
- this.x0 = e.event.pageX;
33
- const transformMatrix = window
34
- .getComputedStyle(this.track.element)
35
- .getPropertyValue("transform");
36
- if (transformMatrix !== "none") {
37
- this.tx = +transformMatrix.split(",")[4];
38
- }
39
- })
40
- this.onPtrUp(e=>console.log(e.isDown));
41
- this.onPtrLeave(e=>{
42
- // Handle outside up
43
- });
44
- }
45
- }
46
- const Carousel=(...ZikoUIElement)=>new ZikoUICarousel(...ZikoUIElement);
47
- export {Carousel}
@@ -1,176 +0,0 @@
1
- import { Flex, ZikoUIFlex } from "../../Flex";
2
- import { ZikoUICodeNote } from "./CodeNote";
3
- import {
4
- Input,
5
- Output,
6
- Right,
7
- Left
8
- } from "./SubElements";
9
- class ZikoUICodeCell extends ZikoUIFlex{
10
- constructor(code="",{type="js",order=null}={}){
11
- super("section")
12
- Object.assign(this.cache,{
13
- state:null,
14
- order,
15
- type,
16
- metadata:{
17
- created:Date.now(),
18
- updated:null
19
- }
20
- })
21
- this.Input=Input(code);
22
- this.Output=Output();
23
- this.InOut=Flex(
24
- this.Input,
25
- this.Output
26
- ).vertical().style({
27
- width:"100%",
28
- margin:"10px auto"
29
- });
30
- this.RightControl=Right(this);
31
- this.LeftControl=Left(this)
32
- this.append(
33
- this.LeftControl,
34
- this.InOut,
35
- this.RightControl
36
- )
37
- this.horizontal(-1,1).style({
38
- //background:"#444",
39
- width:"95vw",
40
- margin:"0 auto",
41
- border:"1px darkblue dotted"
42
- })
43
- this.Input.onKeyDown(e=>{
44
- if(e.kd==="Enter"){
45
- if(e.event.shiftKey){
46
- e.event.preventDefault();
47
- this.execute(this.cache.order);
48
- }
49
- else {
50
- //console.log(this.Input.element.firstChild.firstChild.textContent.at(-1))
51
- }
52
- }
53
- if(this.cache.parent instanceof ZikoUICodeNote){
54
- if(e.kd==="ArrowDown" && e.event.shiftKey ){
55
- this.cache.parent.next();
56
- }
57
- if(e.kd==="ArrowUp" && e.event.shiftKey){
58
- this.cache.parent.previous();
59
- }
60
- }
61
- }
62
- )
63
- this.Input.onFocus(()=>{
64
- if(this.cache.parent instanceof ZikoUICodeNote){
65
- this.cache.parent.cache.currentNote=this;
66
- this.cache.parent.setCurrentNote(this);
67
- }
68
- })
69
- this.Input.onPaste((e)=>{
70
- //e.event.preventDefault();
71
- //this.setValue(this.codeText.trim())
72
- })
73
- // this.Input.onKeyPress(e=>{
74
- // if(e.kp==="(")a.Input.element.textContent+=")";
75
- // if(e.kp==="[")a.Input.element.textContent+="]";
76
- // if(e.kp==="{")a.Input.element.textContent+="}";
77
- // })
78
- }
79
- // space &nbsp
80
- get codeText() {
81
- return this.Input.element.innerText.trim();
82
- }
83
- get codeHTML() {
84
- return this.Input.element.innerHTML;
85
- }
86
- get outputHTML(){
87
- return this.Output.element.innerHTML;
88
- }
89
- setValue(codeText){
90
- this.Input[0].setValue(codeText);
91
- return this;
92
- }
93
- cellData(){
94
- return {
95
- input:this.codeText,
96
- output:this.outputHTML,
97
- order:this.cache.order,
98
- type:this.cache.type
99
- }
100
- }
101
- execute(order){
102
- this.clearOutput();
103
- this.evaluate(order);
104
- this.cache.metadata.updated=Date.now();
105
- return this;
106
- }
107
- #evaluateJs(order){
108
- try{
109
- this.LeftControl[0].setValue("pending");
110
- this.cache.state="pending";
111
- globalThis.eval(this.Input.element.innerText);
112
- }
113
- catch(err){
114
- console.log(err)
115
- text(`Error : ${err.message}`).style({
116
- color:"red",
117
- background:"gold",
118
- border:"2px red solid",
119
- padding:"10px",
120
- margin:"10px 0",
121
- display:"flex",
122
- justifyContent: "center",
123
- });
124
- this.LeftControl[0].setValue("Err");
125
- this.cache.state="Error";
126
- }
127
- finally{
128
- if(this.cache.state==="pending"){
129
- this.cache.state="success";
130
- this.setOrder(order);
131
- if(this.cache.parent instanceof ZikoUICodeNote){
132
- this.cache.parent.incrementOrder();
133
- this.cache.parent.next();
134
- }
135
- }
136
- }
137
- }
138
- #evaluateMd(){
139
-
140
- }
141
- #evaluateHtml(){
142
-
143
- }
144
- evaluate(order){
145
- globalThis.__ZikoConfig__.default.target=this.Output.element;
146
- switch(this.cache.type){
147
- case "js":this.#evaluateJs(order);break;
148
- }
149
- return this;
150
- }
151
- clearInput(){
152
- this.Output.element.innerText="";
153
- return this;
154
- }
155
- clearOutput(){
156
- this.Output.element.innerText="";
157
- return this;
158
- }
159
- setOrder(order,render=true){
160
- this.cache.order=order;
161
- if(render){
162
- (typeof order === "number")?this.LeftControl[0].setValue(`[${order}]`):this.LeftControl[0].setValue("[-]");
163
- }
164
- return this;
165
- }
166
- focus(){
167
- this.Input.element.focus();
168
- return this;
169
- }
170
- }
171
-
172
-
173
- const CodeCell=(codeText,{type,order}={})=>new ZikoUICodeCell(codeText,{type,order});
174
- export{
175
- CodeCell
176
- }
@@ -1,69 +0,0 @@
1
- import { ZikoUIFlex } from "../../Flex";
2
- import { CodeCell } from "./CodeCell";
3
- class ZikoUICodeNote extends ZikoUIFlex{
4
- constructor(){
5
- super("section");
6
- Object.assign(this.cache,{
7
- order:0,
8
- currentNote:null,
9
- currentNoteIndex:null
10
- })
11
- this.vertical(0,0);
12
- }
13
- setCurrentNote(currentNote){
14
- this.cache.currentNote=currentNote;
15
- this.cache.currentNoteIndex=this.items.findIndex(n=>n===currentNote);
16
- currentNote.focus();
17
- this.items.forEach(n=>n.Input.style({
18
- border: "1px solid #ccc"
19
- }))
20
- currentNote.Input.style({
21
- border:"2px lightgreen solid"
22
- });
23
- return this;
24
- }
25
- addNote(text=""){
26
- this.append(CodeCell(text));
27
- return this;
28
- }
29
- execute(){
30
- this.cache.currentNote.execute();
31
- this.incrementOrder();
32
- return this;
33
- }
34
- incrementOrder(){
35
- this.cache.order++;
36
- this.cache.currentNote.setOrder(this.cache.order);
37
- return this;
38
- }
39
- next(){
40
- if(this.cache.currentNote===this.items.at(-1)){
41
- this.addNote();
42
- this.setCurrentNote(this.items.at(-1));
43
- }
44
- else this.setCurrentNote(this.items[this.cache.currentNoteIndex+1]);
45
- return this;
46
- }
47
- previous(){
48
- // add append before
49
- if(this.cache.currentNote!==this.items[0]){
50
- this.setCurrentNote(this.items[this.cache.currentNoteIndex-1]);
51
- }
52
- return this;
53
- }
54
- data(){
55
- return this.items.map(n=>n.cellData());
56
- }
57
- serialize(){
58
- return JSON.stringify(this.data());
59
- }
60
- import(data=[]){
61
- data.forEach((n,i)=>this.addNote(data[i].input));
62
- return this;
63
- }
64
- }
65
- const CodeNote=()=>new ZikoUICodeNote();
66
- export{
67
- CodeNote,
68
- ZikoUICodeNote
69
- }
@@ -1,64 +0,0 @@
1
- import { html } from "../../../Misc";
2
- import { Flex } from "../../Flex";
3
- import { text } from "../../../Text";
4
- import { ZikoUICodeNote } from "./CodeNote";
5
- const Input=(codeText="")=>html("code",codeText).style({
6
- width:"100%",
7
- height:"auto",
8
- padding:"10px",
9
- boxSizing:"border-box",
10
- border: "1px solid #ccc",
11
- outline: "none",
12
- fontSize: "1rem",
13
- fontFamily: "Lucida Console, Courier New, monospace",
14
- padding: "1rem 0.5rem",
15
- wordBreak:"break-all",
16
- background:"#f6f8fa",
17
- color:"#0062C3"
18
- }).setAttr("contenteditable",true).setAttr("spellcheck",false);
19
- const Output=()=>html("output").style({
20
- width:"100%",
21
- height:"auto",
22
- padding:"5px 0",
23
- })
24
- const Left=(ctx)=>Flex(
25
- text("[ ]")
26
- ).style({
27
- width:"50px",
28
- //height:getComputedStyle(ctx.Input.element).height,
29
- height:"50px",
30
- margin:"10px 4px",
31
- padding:"5px",
32
- color:"darkblue",
33
- borderBottom:"4px solid gold",
34
- }).horizontal(0,0);
35
- const BTN_STYLE={
36
- background:"none",
37
- width:"25px",
38
- height:"25px",
39
- fontSize:"1.2rem",
40
- cursor:"pointer"
41
- }
42
- const Right=(ctx)=>Flex(
43
- text('▶️').style(BTN_STYLE).onClick(e=>{
44
- if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
45
- ctx.execute();
46
- globalThis.__ZikoConfig__.default.target=e.target.parent.parent[1][1];
47
- }),
48
- text('📋').style(BTN_STYLE).onClick(()=>{
49
- navigator.clipboard.writeText(ctx.codeText)
50
- }),
51
- text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
52
- text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
53
- ).style({
54
- width:"70px",
55
- height:"50px",
56
- //background:"cyan",
57
- margin:"10px 0"
58
- }).horizontal(0,0).wrap(true);
59
- export{
60
- Input,
61
- Output,
62
- Right,
63
- Left
64
- }
@@ -1,2 +0,0 @@
1
- export * from "./CodeCell";
2
- export * from "./CodeNote";
@@ -1 +0,0 @@
1
- // dipslay table
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,4 +0,0 @@
1
- // Next
2
- // Previous
3
- // Vertical
4
- // Horizontal
@@ -1,111 +0,0 @@
1
- // Next
2
- // Previous
3
- // Vertical
4
- // Horizontal
5
- import { Flex, ZikoUIFlex } from "../../Flex";
6
- class ZikoUITabs extends ZikoUIFlex{
7
- #ACTIVE_ELEMENT_INDEX=0;
8
- constructor(Controllers,Contents){
9
- super("div","Tabs");
10
- this.style({
11
- boxSizing:"border-box",
12
- backgroundColor: "blanchedalmond",
13
- border:"1px red solid",
14
- margin:"30px",
15
- })
16
- this.append(
17
- Flex().size("auto","auto").style({
18
- boxSizing:"border-box",
19
- justifyContent:"center",
20
- alignItems:"center",
21
- textAlign:"center",
22
-
23
- minWidth:"50px",
24
- minHeight:"50px",
25
-
26
- backgroundColor:"darkblue",
27
- border:"1px darkblue solid",
28
-
29
- }),
30
- Flex().style({
31
- boxSizing:"border-box",
32
- justifyContent:"center",
33
- alignItems:"center",
34
- textAlign:"center",
35
-
36
- width:"100%",
37
- height:"100%",
38
- backgroundColor:"darkslategrey",
39
- })
40
- )
41
- this.Controller=this.items[0].setAttr("role","tablist");
42
- this.Content=this.items[1];
43
- if(Controllers.length!==Contents.length)console.error("")
44
- else {
45
- this.Controller.append(...Controllers);
46
- this.Content.append(...Contents);
47
- // Add transition
48
- }
49
- this.init()
50
- this.display(0);
51
- }
52
- init(){
53
- // Remove old listener
54
- for(let i=0;i<this.Controller.length;i++){
55
- this.Controller[i].setAttr("role","tab").setAttr("aria-controls",`tab${i}`);
56
- this.Content[i].setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${i}`).setAttr("tabindex",-1);
57
- }
58
- this.Controller.forEach(item=>item.onClick(e=>{
59
- const tab=e.target.element.getAttribute("aria-controls");
60
- const index=+tab.slice(3)
61
- this.Content.filter(n=>n.element.getAttribute("aria-labelledby")===tab,()=>{
62
- if(this.#ACTIVE_ELEMENT_INDEX!==index)this.display(index);
63
- })
64
- }))
65
- return this;
66
- }
67
- addPairs(ControllerItem,ContentItem){
68
- this.Controller.append(ControllerItem);
69
- this.Content.append(ContentItem);
70
- const length=this.Controller.length;
71
- this.Controller.at(-1).setAttr("role","tab").setAttr("aria-controls",`tab${length-1}`);
72
- this.Content.at(-1).setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${length-1}`).setAttr("tabindex",-1);
73
- // Add listener
74
- return this;
75
- }
76
- removePairs(index){
77
-
78
- }
79
- display(index){
80
- this.#ACTIVE_ELEMENT_INDEX=index%this.Content.length;
81
- this.Controller.forEach(n=>n.setAttr("tabindex",-1).setAttr("aria-selected",false));
82
- this.Controller.at(this.#ACTIVE_ELEMENT_INDEX).setAttr("tabindex",0).setAttr("aria-selected",true);
83
- (async ()=>{
84
- await this.Content.forEach(n=>n.st.hide());
85
- await this.Content.at(this.#ACTIVE_ELEMENT_INDEX).setAttr("tabindex",0).st.show();
86
- })()
87
-
88
- return this;
89
- }
90
- next(i=1){
91
- this.display(this.#ACTIVE_ELEMENT_INDEX+i);
92
- return this;
93
- }
94
- previous(i=1){
95
- this.display(this.#ACTIVE_ELEMENT_INDEX-i);
96
- return this;
97
- }
98
- useHorizontalSwippe(){
99
- this.onPtrDown();
100
- this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_x)));
101
- return this;
102
- }
103
- useVerticalSwippe(){
104
- this.onPtrDown();
105
- this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_y)));
106
- return this;
107
- }
108
- }
109
-
110
- const Tabs=(Controllers,Contents)=>new ZikoUITabs(Controllers,Contents)
111
- export {Tabs}
File without changes
File without changes
File without changes
@@ -1,4 +0,0 @@
1
- export * from "./Accordion";
2
- export * from "./Carousel";
3
- export * from "./CodeNote";
4
- export * from "./Tabs";