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,40 +0,0 @@
1
- import { __ZikoUISplitter__ } from "./__ZikoUISplitter__";
2
- class ZikoUIHorizontalSplitter extends __ZikoUISplitter__{
3
- constructor(leftPane, rightPane){
4
- super("row", "ew-resize", "width")
5
- this.leftPane = leftPane.style({
6
- width:"50%",
7
- flexGrow: 1,
8
- overflow: "hidden"
9
- });
10
- this.rightPane = rightPane.style({
11
- width:"50%",
12
- flexGrow: 1,
13
- overflow: "hidden"
14
- });
15
- this.element?.append(
16
- this.leftPane.element,
17
- this.resizer.element,
18
- this.rightPane.element
19
- );
20
- this.onPtrMove(e=>{
21
- if (!this.cache.isResizing) return;
22
- const containerWidth = this.element.getBoundingClientRect().width; // height
23
- const pointerRelativeXpos = e.event.clientX - this.element.getBoundingClientRect().x; // y
24
- let newLeftPaneWidth = (pointerRelativeXpos / containerWidth) * 100;
25
- let newRightPaneWidth = 100 - newLeftPaneWidth;
26
- if (newLeftPaneWidth < 0) newLeftPaneWidth = 0;
27
- if (newRightPaneWidth < 0) newRightPaneWidth = 0;
28
- this.leftPane.element.style.width = `${newLeftPaneWidth}%`;
29
- this.rightPane.element.style.width = `${newRightPaneWidth}%`;
30
- })
31
- }
32
- get isHorizontalSplitter(){
33
- return true;
34
- }
35
- }
36
- const hSplitter=(leftPane, rightPane)=>new ZikoUIHorizontalSplitter(leftPane, rightPane);
37
- export{
38
- ZikoUIHorizontalSplitter,
39
- hSplitter
40
- }
@@ -1,12 +0,0 @@
1
- export * from "./hsplitter.js"
2
- export * from "./vsplitter.js"
3
- import { hSplitter } from "./hsplitter.js"
4
- import { vSplitter } from "./vsplitter.js"
5
- const Splitter = ({orintation = "horizontal",slides = []}) =>{
6
- if(["v","vertical"].includes(orintation.toLowerCase())) return vSplitter(...slides);
7
- else if(["h","horizontal"].includes(orintation.toLowerCase())) return hSplitter(...slides);
8
- else Error(`{ orientation : ${orintation}} Not supported`)
9
- }
10
- export{
11
- Splitter
12
- }
@@ -1,40 +0,0 @@
1
- import { __ZikoUISplitter__ } from "./__ZikoUISplitter__";
2
- class ZikoUIVerticalSplitter extends __ZikoUISplitter__{
3
- constructor(topPane, bottomPane){
4
- super("column", "ns-resize", "height")
5
- this.topPane = topPane.style({
6
- height:"50%",
7
- flexGrow: 1,
8
- overflow: "hidden"
9
- });
10
- this.bottomPane = bottomPane.style({
11
- height:"50%",
12
- flexGrow: 1,
13
- overflow: "hidden"
14
- });
15
- this.element?.append(
16
- this.topPane.element,
17
- this.resizer.element,
18
- this.bottomPane.element
19
- );
20
- this.onPtrMove(e=>{
21
- if (!this.cache.isResizing) return;
22
- const containerHeight = this.element.getBoundingClientRect().height; // height
23
- const pointerRelativeYpos = e.event.clientY - this.element.getBoundingClientRect().y; // y
24
- let newTopPaneHeight = (pointerRelativeYpos / containerHeight) * 100;
25
- let newBottomPaneHeight = 100 - newTopPaneHeight;
26
- if (newTopPaneHeight < 0) newTopPaneHeight = 0;
27
- if (newBottomPaneHeight < 0) newBottomPaneHeight = 0;
28
- this.topPane.element.style.height = `${newTopPaneHeight}%`;
29
- this.bottomPane.element.style.height = `${newBottomPaneHeight}%`;
30
- })
31
- }
32
- get isHorizontalSplitter(){
33
- return true;
34
- }
35
- }
36
- const vSplitter=(topPane, bottomPane)=>new ZikoUIVerticalSplitter(topPane, bottomPane);
37
- export{
38
- ZikoUIVerticalSplitter,
39
- vSplitter
40
- }
@@ -1,180 +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
- Object.assign(this.cache,{
11
- config:{
12
- controllersPercent : .50
13
- }
14
- })
15
- this.style({
16
- boxSizing:"border-box",
17
- backgroundColor: "blanchedalmond",
18
- border:"1px red solid",
19
- margin:"30px",
20
- });
21
- this.controllersContainer = Flex().size("auto","auto").style({
22
- boxSizing:"border-box",
23
- justifyContent:"center",
24
- alignItems:"center",
25
- textAlign:"center",
26
-
27
- minWidth:"50px",
28
- minHeight:"50px",
29
-
30
- backgroundColor:"darkblue",
31
- border:"1px darkblue solid",
32
-
33
- }).setAttr("role","tablist")
34
- this.contentContainer = Flex().style({
35
- boxSizing:"border-box",
36
- justifyContent:"center",
37
- alignItems:"center",
38
- textAlign:"center",
39
-
40
- width:"100%",
41
- height:"100%",
42
- backgroundColor:"darkslategrey",
43
- })
44
- this.append(
45
- this.controllersContainer,
46
- this.contentContainer
47
- )
48
- if(Controllers.length!==Contents.length)console.error("")
49
- else {
50
- this.controllersContainer.append(...Controllers);
51
- this.contentContainer.append(...Contents);
52
- }
53
- this.init()
54
- this.display(0);
55
- this.useVertical()
56
- }
57
- get isTabs(){
58
- return true;
59
- }
60
- init(){
61
- // Remove old listener
62
- for(let i=0;i<this.controllersContainer.length;i++){
63
- this.controllersContainer[i].setAttr("role","tab").setAttr("aria-controls",`tab${i}`);
64
- this.contentContainer[i].setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${i}`).setAttr("tabindex",-1);
65
- }
66
- this.controllersContainer.forEach(item=>item.onClick(e=>{
67
- const tab=e.target.element.getAttribute("aria-controls");
68
- const index=+tab.slice(3)
69
- this.contentContainer.filter(n=>n.element.getAttribute("aria-labelledby")===tab,()=>{
70
- if(this.#ACTIVE_ELEMENT_INDEX!==index)this.display(index);
71
- })
72
- }))
73
- return this;
74
- }
75
- addPairs(ControllerItem,ContentItem){
76
- this.controllersContainer.append(ControllerItem);
77
- this.contentContainer.append(ContentItem);
78
- const length=this.controllersContainer.length;
79
- this.controllersContainer.at(-1).setAttr("role","tab").setAttr("aria-controls",`tab${length-1}`);
80
- this.contentContainer.at(-1).setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${length-1}`).setAttr("tabindex",-1);
81
- // Add listener
82
- return this;
83
- }
84
- removePairs(index){
85
-
86
- }
87
- display(index){
88
- this.#ACTIVE_ELEMENT_INDEX=index%this.contentContainer.length;
89
- const ActiveContent = this.contentContainer.at(this.#ACTIVE_ELEMENT_INDEX);
90
- this.controllersContainer.forEach(n=>n.setAttr("tabindex",-1).setAttr("aria-selected",false));
91
- this.controllersContainer.at(this.#ACTIVE_ELEMENT_INDEX).setAttr("tabindex",0).setAttr("aria-selected",true);
92
-
93
- this.contentContainer.forEach(n=>n.st.hide());
94
-
95
- ActiveContent.st.translateX(100,0)
96
- ActiveContent.setAttr("tabindex",0).st.show();
97
- ActiveContent.st.translateX(0,1000)
98
-
99
- return this;
100
- }
101
- next(i=1){
102
- this.display(this.#ACTIVE_ELEMENT_INDEX+i);
103
- return this;
104
- }
105
- previous(i=1){
106
- this.display(this.#ACTIVE_ELEMENT_INDEX-i);
107
- return this;
108
- }
109
- useVertical(){
110
- this.vertical(0,0);
111
- this.controllersContainer.horizontal(0,0)
112
- this.controllersContainer.style({
113
- width : "100%",
114
- height : `${this.cache.config.controllersPercent*100}%`
115
- });
116
- this.contentContainer.style({
117
- width : "100%",
118
- height : `${(1-this.cache.config.controllersPercent)*100}%`
119
- })
120
- return this;
121
- }
122
- useHorizontal(){
123
- this.horizontal(0,0);
124
- this.controllersContainer.vertical(0, 0)
125
- this.controllersContainer.style({
126
- height : "100%",
127
- width : `${this.cache.config.controllersPercent*100}%`
128
- });
129
- this.contentContainer.style({
130
- height : "100%",
131
- width : `${(1-this.cache.config.controllersPercent)*100}%`
132
- })
133
- return this;
134
- }
135
- // useHorizontalSwippe(){
136
- // this.onPtrDown();
137
- // this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_x)));
138
- // return this;
139
- // }
140
- // useVerticalSwippe(){
141
- // this.onPtrDown();
142
- // this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_y)));
143
- // return this;
144
- // }
145
- }
146
-
147
- const Tabs=(Controllers,Contents)=>new ZikoUITabs(Controllers,Contents)
148
- export {Tabs}
149
-
150
- /*
151
-
152
- const cont=(txt = "A")=>btn(txt).style({width:"170px"})
153
- a=Tabs(
154
- [cont("A1"),cont("A2"),cont("A3"),cont("A4")],
155
- [cont("A1"),cont("A2"),cont("A3"),cont("A4")]
156
- ).vertical().size("400px")
157
- a.controllersContainer.style({
158
- overflowX:"auto"
159
- })
160
- a.useHorizontal()
161
-
162
- */
163
-
164
- /*
165
-
166
- a=Flex().size("400px","400px").style({background:"red"})
167
- a.element.animate([
168
- { borderRadius: "0" , background : "red" },
169
- { borderRadius: "50% 0" },
170
- { borderRadius: "50% 50%" },
171
- { borderRadius: "0 50%" },
172
- { borderRadius: "0", background : "yellow" },
173
- ],
174
- {
175
- // temporisation
176
- duration: 2000,
177
- iterations: Infinity,
178
- })
179
-
180
- */
@@ -1,123 +0,0 @@
1
- import ZikoUIElement from "./ZikoUIElement";
2
- import { text } from "./text";
3
- class ZikoUIContainerElement extends ZikoUIElement {
4
- constructor(element, name = "") {
5
- super(element, name);
6
- this.items = [];
7
- }
8
- // maintain() {
9
- // for (let i = 0; i < this.items.length; i++)
10
- // Object.assign(this, { [[i]]: this.items[i] });
11
- // this.length = this.items.length;
12
- // return this;
13
- // }
14
- // at(index) {
15
- // return this.items.at(index);
16
- // }
17
- // #addItem(adder, pusher, ...ele) {
18
- // if (this.cache.isFrozzen) {
19
- // console.warn("You can't append new item to frozzen element");
20
- // return this;
21
- // }
22
- // for (let i = 0; i < ele.length; i++) {
23
- // if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
24
- // if (ele[i] instanceof ZikoUIElement) {
25
- // ele[i].cache.parent = this;
26
- // this.element[adder](ele[i].element);
27
- // ele[i].target = this.element;
28
- // this.items[pusher](ele[i]);
29
- // } else if (ele[i] instanceof Object) {
30
- // if (ele[i]?.style) this.style(ele[i]?.style);
31
- // if (ele[i]?.attr) {
32
- // Object.entries(ele[i].attr).forEach((n) =>
33
- // this.setAttr("" + n[0], n[1]),
34
- // );
35
- // }
36
- // }
37
- // }
38
- // this.maintain();
39
- // return this;
40
- // }
41
- // append(...ele) {
42
- // this.#addItem("append", "push", ...ele);
43
- // return this;
44
- // }
45
- // prepend(...ele) {
46
- // this.#addItem("prepend", "unshift", ...ele);
47
- // return this;
48
- // }
49
- // insertAt(index, ...ele) {
50
- // if (index >= this.element.children.length) this.append(...ele);
51
- // else
52
- // for (let i = 0; i < ele.length; i++) {
53
- // if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
54
- // this.element?.insertBefore(ele[i].element, this.items[index].element);
55
- // this.items.splice(index, 0, ele[i]);
56
- // }
57
- // return this;
58
- // }
59
- // remove(...ele) {
60
- // const remove = (ele) => {
61
- // if (typeof ele === "number") ele = this.items[ele];
62
- // if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
63
- // this.items = this.items.filter((n) => n !== ele);
64
- // };
65
- // for (let i = 0; i < ele.length; i++) remove(ele[i]);
66
- // for (let i = 0; i < this.items.length; i++)
67
- // Object.assign(this, { [[i]]: this.items[i] });
68
- // // Remove from item
69
- // return this;
70
- // }
71
- // forEach(callback) {
72
- // this.items.forEach(callback);
73
- // return this;
74
- // }
75
- // map(callback) {
76
- // return this.items.map(callback);
77
- // }
78
- // find(condition) {
79
- // return this.items.filter(condition);
80
- // }
81
- // filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
82
- // const FilterItems = this.items.filter(condition_callback);
83
- // FilterItems.forEach(if_callback);
84
- // this.items
85
- // .filter((item) => !FilterItems.includes(item))
86
- // .forEach(else_callback);
87
- // return this;
88
- // }
89
- // filterByTextContent(text, exactMatch = false) {
90
- // this.items.forEach((n) => n.render());
91
- // this.filter(
92
- // (n) => !(exactMatch ? n.text === text : n.text.includes(text)),
93
- // (e) => e.unrender(),
94
- // );
95
- // // this.items.filter(n=>{
96
- // // const content=n.element.textContent;
97
- // // return !(exactMatch?content===text:content.includes(text))
98
- // // }).map(n=>n.unrender());
99
- // // return this;
100
- // }
101
- // filterByClass(value) {
102
- // this.items.map((n) => n.render());
103
- // this.items
104
- // .filter((n) => !n.classes.includes(value))
105
- // .map((n) => n.unrender());
106
- // return this;
107
- // }
108
- // sortByTextContent(value, displays) {
109
- // let item = this.children;
110
- // item
111
- // .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
112
- // .map((n) => {
113
- // n.style.display = "none";
114
- // });
115
- // item
116
- // .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
117
- // .map((n, i) => (n.style.display = displays[i]));
118
- // //return item.filter(n=>n.style.display!="none")
119
- // item.filter((n) => n.style.display != "none");
120
- // return this;
121
- // }
122
- }
123
- export default ZikoUIContainerElement;
File without changes
File without changes