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,503 +0,0 @@
1
- import { ZikoStyle } from "./Style";
2
- import {
3
- Pointer,
4
- Mouse,
5
- Wheel,
6
- Key,
7
- Drag ,
8
- Drop,
9
- Click ,
10
- Clipboard ,
11
- Focus,
12
- customEvent,
13
- } from "../Reactivity/Events"
14
- import {
15
- WatchIntersection,
16
- WatchSize
17
- } from "../Reactivity";
18
- import { text } from "./Text";
19
- import { Random } from "../Math/Random";
20
- class ZikoUIElement {
21
- constructor(element,name="") {
22
- //this.target = globalThis.__Target__||globalThis.document.body;
23
- this.target = globalThis.__ZikoConfig__.default.target||globalThis.document.body
24
- if(typeof element === "string") element = globalThis.document.createElement(element);
25
- this.element = element;
26
- this.uuid=this.constructor.name+"-"+Random.string(10);
27
- this.cache = {
28
- name,
29
- parent:null,
30
- isRoot:false,
31
- isHidden: false,
32
- isFrozzen:false,
33
- style: ZikoStyle({}),
34
- attributes: {},
35
- filters: {},
36
- temp:{}
37
- };
38
- this.items = [];
39
- this.events = {
40
- ptr:null,
41
- mouse:null,
42
- Wheel:null,
43
- key:null,
44
- drag:null,
45
- drop:null,
46
- click:null,
47
- clipboard:null,
48
- focus:null,
49
- custom:null,
50
- }
51
- this.observer={
52
- resize:null,
53
- intersection:null
54
- }
55
- this.cache.style.linkTo(this);
56
- this.style({
57
- position: "relative",
58
- boxSizing:"border-box",
59
- fontFamily:"verdana",
60
- margin:0,
61
- padding:0,
62
- });
63
- this.size("auto", "auto");
64
- globalThis.__UI__[this.cache.name]?.push(this);
65
- this.render(globalThis.__ZikoConfig__.default.render);
66
- }
67
- get st(){
68
- return this.cache.style;
69
- }
70
- get attr(){
71
- return this.cache.attributes;
72
- }
73
- get evt(){
74
- return this.cache.events;
75
- }
76
- get html(){
77
- return this.element.innerHTML;
78
- }
79
- get __app__(){
80
- if(this.cache.isRoot)return this;
81
- let root=this.cache.parent;
82
- while(1){
83
- if(!root)return null;
84
- if(root.cache.isRoot)return root;
85
- root=root.parent;
86
- }
87
- }
88
- clone(render=false) {
89
- // Not working For Table
90
- const UI = new this.constructor();
91
- UI.__proto__=this.__proto__;
92
- if(this.items.length){
93
- const items = [...this.items].map(n=>n.clone());
94
- UI.append(...items);
95
- }
96
- else UI.element=this.element.cloneNode(true);
97
- return UI.render(render);
98
- }
99
- style(styles,{target = "parent", maskVector = null } = {}){
100
- this.st.style(styles,{target,maskVector});
101
- return this;
102
- }
103
- size(width,height,{ target, maskVector } = {}){
104
- this.st.size(width,height,{target,maskVector});
105
- return this;
106
- }
107
- get parent(){
108
- return this.cache.parent;
109
- }
110
- get Width(){
111
- return this.element.getBoundingClientRect().width;
112
- }
113
- get Height(){
114
- return this.element.getBoundingClientRect().height;
115
- }
116
- get Top(){
117
- return this.element.getBoundingClientRect().top;
118
- }
119
- get Right(){
120
- return this.element.getBoundingClientRect().right;
121
- }
122
- get Bottom(){
123
- return this.element.getBoundingClientRect().bottom;
124
- }
125
- get Left(){
126
- return this.element.getBoundingClientRect().left;
127
- }
128
- freeze(freeze){
129
- this.cache.isFrozzen=freeze;
130
- return this;
131
- }
132
- at(index) {
133
- return this.items.at(index);
134
- }
135
- maintain() {
136
- for (let i = 0; i < this.items.length; i++)
137
- Object.assign(this, { [[i]]: this.items[i] });
138
- this.length = this.items.length;
139
- return this;
140
- }
141
- setTarget(tg) {
142
- if (tg instanceof ZikoUIElement) tg = tg.element;
143
- this.remove();
144
- this.target = tg;
145
- this.render();
146
- return this;
147
- }
148
- render(render = true , target = this.target) {
149
- if(target instanceof ZikoUIElement)target=target.element;
150
- this.target=target;
151
- if(render) {
152
- this.target.appendChild(this.element);
153
- }
154
- else this.remove();
155
- return this;
156
- }
157
- append(...ele) {
158
- if(this.cache.isFrozzen){
159
- console.warn("You can't append new item to frozzen element");
160
- return this;
161
- }
162
- for (let i = 0; i < ele.length; i++){
163
- if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
164
- if (ele[i] instanceof ZikoUIElement) {
165
- ele[i].cache.parent=this;
166
- this.element.appendChild(ele[i].element);
167
- ele[i].Target = this.element;
168
- this.items.push(ele[i]);
169
- } else if (ele[i] instanceof Object) {
170
- if (ele[i]?.style) this.style(ele[i]?.style);
171
- if (ele[i]?.attr) {
172
- Object.entries(ele[i].attr).forEach((n) =>
173
- this.setAttr("" + n[0], n[1]),
174
- );
175
- }
176
- }
177
- }
178
- this.maintain();
179
- return this;
180
- }
181
- remove(...ele) {
182
- if(ele.length==0){
183
- if(this.cache.parent)this.cache.parent.remove(this);
184
- else if(this.target.children.length && [...this.target.children].includes(this.element)) this.target.removeChild(this.element);
185
- }
186
- else {
187
- const remove = (ele) => {
188
- if(typeof ele === "number") ele=this.items[ele];
189
- if(ele instanceof ZikoUIElement)this.element.removeChild(ele.element);
190
- this.items=this.items.filter(n=>n!==ele);
191
- };
192
- for (let i = 0; i < ele.length; i++) remove(ele[i]);
193
- for (let i = 0; i < this.items.length; i++)Object.assign(this, { [[i]]: this.items[i] });
194
- // Remove from item
195
- }
196
- return this;
197
- }
198
- removeAfter(t = 1) {
199
- setTimeout(() => this.remove(), t);
200
- return this;
201
- }
202
- removeItem(...ele) {
203
- const remove = (ele) => {
204
- if (ele instanceof ZikoUIElement) this.element.removeChild(ele.element);
205
- else if (typeof ele === "number")
206
- this.element.removeChild(this.element.children[ele]);
207
- };
208
- for (let i = 0; i < ele.length; i++) remove(ele[i]);
209
- for (let i = 0; i < this.items.length; i++)
210
- Object.assign(this, { [[i]]: this.items[i] });
211
- return this;
212
- }
213
- insertAt(index, ...ele) {
214
- if (index >= this.element.children.length) this.append(...ele);
215
- else
216
- for (let i = 0; i < ele.length; i++) {
217
- if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
218
- this.element.insertBefore(ele[i].element, this.items[index].element);
219
- this.items.splice(index, 0, ele[i]);
220
- }
221
- return this;
222
- }
223
- // Attributes
224
- setAttr(name, value) {
225
- this.element.setAttribute(name, value);
226
- Object.assign(this.cache.attributes, Object.fromEntries([[name, value]]));
227
- return this;
228
- }
229
- removeAttr(name) {
230
- this.element.removeAttribute(name);
231
- return this;
232
- }
233
- setContentEditable(bool = true) {
234
- this.setAttr("contenteditable", bool);
235
- return this;
236
- }
237
- get children() {
238
- return [...this.element.children];
239
- }
240
- get cloneElement() {
241
- return this.element.cloneNode(true);
242
- }
243
- setClasses(...value) {
244
- this.setAttr("class", value.join(" "));
245
- return this;
246
- }
247
- get Classes(){
248
- const classes=this.element.getAttribute("class");
249
- return classes===null?[]:classes.split(" ");
250
- }
251
- addClass() {
252
- /*this.setAttr("class", value);
253
- return this;*/
254
- }
255
- setId(Id) {
256
- this.element.setAttribute("id", Id);
257
- return this;
258
- }
259
- get Id() {
260
- return this.element.getAttribute("id");
261
- }
262
- forEach(callback){
263
- this.items.forEach(callback);
264
- return this;
265
- }
266
- where(condition_callback,if_callback,else_callback){
267
- this.items.filter(condition_callback).forEach(if_callback)
268
- return this;
269
- }
270
- filter(condition){
271
- return this.items.filter(condition);
272
- }
273
- filterByTextContent(text,exactMatch=false){
274
- this.items.map(n=>n.render());
275
- this.items.filter(n=>{
276
- const content=n.element.textContent;
277
- return !(exactMatch?content===text:content.includes(text))
278
- }).map(n=>n.render(false));
279
- return this;
280
- }
281
- filterByClass(value) {
282
- this.items.map(n=>n.render());
283
- this.items.filter(n=>!n.Classes.includes(value)).map(n=>n.render(false));
284
- return this;
285
- }
286
- sortByTextContent(value, displays) {
287
- let item = this.children;
288
- item
289
- .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
290
- .map((n) => {
291
- n.style.display = "none";
292
- });
293
- item
294
- .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
295
- .map((n, i) => (n.style.display = displays[i]));
296
- //return item.filter(n=>n.style.display!="none")
297
- item.filter((n) => n.style.display != "none");
298
- return this;
299
- }
300
- onPtrMove(...callbacks){
301
- if(!this.events.ptr)this.events.ptr = Pointer(this);
302
- this.events.ptr.onMove(...callbacks);
303
- return this;
304
- }
305
- onPtrDown(...callbacks){
306
- if(!this.events.ptr)this.events.ptr = Pointer(this);
307
- this.events.ptr.onDown(...callbacks);
308
- return this;
309
- }
310
- onPtrUp(...callbacks){
311
- if(!this.events.ptr)this.events.ptr = Pointer(this);
312
- this.events.ptr.onUp(...callbacks);
313
- return this;
314
- }
315
- onPtrEnter(...callbacks){
316
- if(!this.events.ptr)this.events.ptr = Pointer(this);
317
- this.events.ptr.onEnter(...callbacks);
318
- return this;
319
- }
320
- onPtrLeave(...callbacks){
321
- if(!this.events.ptr)this.events.ptr = Pointer(this);
322
- this.events.ptr.onLeave(...callbacks);
323
- return this;
324
- }
325
- onPtrOut(...callbacks){
326
- if(!this.events.ptr)this.events.ptr = Pointer(this);
327
- this.events.ptr.onOut(...callbacks);
328
- return this;
329
- }
330
- onMouseMove(...callbacks){
331
- if(!this.events.mouse)this.events.mouse = Mouse(this);
332
- this.events.mouse.onMove(...callbacks);
333
- return this;
334
- }
335
- onMouseDown(...callbacks){
336
- if(!this.events.mouse)this.events.mouse = Mouse(this);
337
- this.events.mouse.onDown(...callbacks);
338
- return this;
339
- }
340
- onMouseUp(...callbacks){
341
- if(!this.events.mouse)this.events.mouse = Mouse(this);
342
- this.events.mouse.onUp(...callbacks);
343
- return this;
344
- }
345
- onMouseEnter(...callbacks){
346
- if(!this.events.mouse)this.events.mouse = Mouse(this);
347
- this.events.mouse.onEnter(...callbacks);
348
- return this;
349
- }
350
- onMouseLeave(...callbacks){
351
- if(!this.events.mouse)this.events.mouse = Mouse(this);
352
- this.events.mouse.onLeave(...callbacks);
353
- return this;
354
- }
355
- onMouseOut(...callbacks){
356
- if(!this.events.mouse)this.events.mouse = Mouse(this);
357
- this.events.mouse.onOut(...callbacks);
358
- return this;
359
- }
360
- onWheel(...callbacks){
361
- if(!this.events.wheel)this.events.wheel = Wheel(this);
362
- this.events.wheel.onWheel(...callbacks);
363
- return this;
364
- }
365
- onKeyDown(...callbacks){
366
- if(!this.events.key)this.events.key = Key(this);
367
- this.events.key.onDown(...callbacks);
368
- return this;
369
- }
370
- onKeyPress(...callbacks){
371
- if(!this.events.key)this.events.key = Key(this);
372
- this.events.key.onPress(...callbacks);
373
- return this;
374
- }
375
- onKeyUp(...callbacks){
376
- if(!this.events.key)this.events.key = Key(this);
377
- this.events.key.onUp(...callbacks);
378
- return this;
379
- }
380
- onKeysDown({keys=[],callback}={}){
381
- if(!this.events.key)this.events.key = Key(this);
382
- this.events.key.handleSuccessifKeys({keys,callback});
383
- return this;
384
- }
385
- onDragStart(...callbacks){
386
- if(!this.events.drag)this.events.drag = Drag(this);
387
- this.events.drag.onStart(...callbacks);
388
- return this;
389
- }
390
- onDrag(...callbacks){
391
- if(!this.events.drag)this.events.drag = Drag(this);
392
- this.events.drag.onDrag(...callbacks);
393
- return this;
394
- }
395
- onDragEnd(...callbacks){
396
- if(!this.events.drag)this.events.drag = Drag(this);
397
- this.events.drag.onEnd(...callbacks);
398
- return this;
399
- }
400
- onDrop(...callbacks){
401
- if(!this.events.drop)this.events.drop = Drop(this);
402
- this.events.drop.onDrop(...callbacks);
403
- return this;
404
- }
405
- onClick(...callbacks){
406
- if(!this.events.click)this.events.click = Click(this);
407
- this.events.click.onClick(...callbacks);
408
- return this;
409
- }
410
- onDbClick(...callbacks){
411
- if(!this.events.click)this.events.click = Click(this);
412
- this.events.click.onDbClick(...callbacks);
413
- return this;
414
- }
415
- onCopy(...callbacks){
416
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
417
- this.events.clipboard.onCopy(...callbacks);
418
- return this;
419
- }
420
- onCut(...callbacks){
421
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
422
- this.events.clipboard.onCut(...callbacks);
423
- return this;
424
- }
425
- onPaste(...callbacks){
426
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
427
- this.events.clipboard.onPaste(...callbacks);
428
- return this;
429
- }
430
- onSelect(...callbacks){
431
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
432
- this.events.clipboard.onSelect(...callbacks);
433
- return this;
434
- }
435
- onFocus(...callbacks){
436
- if(!this.events.focus)this.events.focus = Focus(this);
437
- this.events.focus.onFocus(...callbacks);
438
- return this;
439
- }
440
- onBlur(...callbacks){
441
- if(!this.events.focus)this.events.focus = Focus(this);
442
- this.events.focus.onFocus(...callbacks);
443
- return this;
444
- }
445
- on(event_name,...callbacks){
446
- if(!this.events.custom)this.events.custom = customEvent(this);
447
- this.events.custom.on(event_name,...callbacks);
448
- return this;
449
- }
450
- emit(event_name,detail={}){
451
- if(!this.events.custom)this.events.custom = customEvent(this);
452
- this.events.custom.emit(event_name,detail);
453
- return this;
454
- }
455
- WatchAttributes(){
456
-
457
- }
458
- WatchChildren(){
459
-
460
- }
461
- WatchSize(callback){
462
- if(!this.observer.resize)this.observer.resize = WatchSize(this,callback);
463
- this.observer.resize.start();
464
- return this;
465
- }
466
- WatchIntersection(callback,config){
467
- if(!this.observer.intersection)this.observer.intersection = WatchIntersection(this,callback,config);
468
- this.observer.intersection.start();
469
- return this;
470
- }
471
- get VisibleArea() {
472
- let coords = this.element.getBoundingClientRect();
473
- let windowHeight = globalThis.document.documentElement.clientHeight;
474
- let windowWidth = globalThis.document.documentElement.clientWidth;
475
- let topVisible = coords.top > 0 && coords.top < windowHeight;
476
- let bottomVisible = coords.bottom < windowHeight && coords.bottom > 0;
477
- let leftVisible = coords.left > 0 && coords.left < windowWidth;
478
- let rightVisible = coords.right > 0 && coords.right < windowWidth;
479
- return {
480
- top: topVisible,
481
- bottom: bottomVisible,
482
- left: leftVisible,
483
- right: rightVisible,
484
- heightRatio: (coords.height + coords.y) / coords.height,
485
- isVisible: topVisible || bottomVisible || rightVisible || leftVisible,
486
- };
487
- }
488
- setFullScreen(set = true, e) {
489
- if(!this.element.requestFullscreen){
490
- console.error("Fullscreen API is not supported in this browser.");
491
- return this;
492
- }
493
- if (set) this.element.requestFullscreen(e);
494
- else globalThis.document.exitFullscreen();
495
- return this;
496
- }
497
- toggleFullScreen(e) {
498
- if (!globalThis.document.fullscreenElement) this.element.requestFullscreen(e);
499
- else globalThis.document.exitFullscreen();
500
- return this;
501
- }
502
- }
503
- export default ZikoUIElement;
package/core/UI/index.js DELETED
@@ -1,154 +0,0 @@
1
- import {
2
- text,
3
- p,
4
- h1,
5
- h2,
6
- h3,
7
- h4,
8
- h5,
9
- h6
10
- } from "./Text";
11
- import {
12
- br,
13
- hr,
14
- brs,
15
- hrs,
16
- link,
17
- html
18
- } from "./Misc";
19
- import {
20
- ol,
21
- ul
22
- } from "./List"
23
- import {
24
- btn,
25
- input,
26
- search,
27
- slider,
28
- checkbox,
29
- radio,
30
- datalist,
31
- inputNumber,
32
- inputColor,
33
- inputDate,
34
- inputDateTime,
35
- inputEmail,
36
- inputImage,
37
- inputPassword,
38
- inputTime,
39
- select,
40
- textarea,
41
- inputCamera
42
- } from "./Inputs";
43
- import {
44
- image,
45
- video,
46
- audio,
47
- figure
48
- } from "./Media"
49
- import{
50
- Flex,
51
- Grid,
52
- Carousel,
53
- CodeCell,
54
- CodeNote,
55
- Tabs,
56
- Accordion,
57
- } from "./CustomElement"
58
- import{
59
- Header,
60
- Main,
61
- Section,
62
- Article,
63
- Aside,
64
- Nav,
65
- Footer,
66
- } from "./Semantic";
67
- import { Table } from "./Table";
68
- const UI={
69
- html,
70
- text,
71
- p,
72
- h1,
73
- h2,
74
- h3,
75
- h4,
76
- h5,
77
- h6,
78
- btn,
79
- br,
80
- hr,
81
- brs,
82
- hrs,
83
- link,
84
- ol,
85
- ul,
86
- input,
87
- search,
88
- slider,
89
- checkbox,
90
- radio,
91
- datalist,
92
- inputNumber,
93
- inputColor,
94
- inputDate,
95
- inputDateTime,
96
- inputEmail,
97
- inputImage,
98
- inputPassword,
99
- inputTime,
100
- select,
101
- textarea,
102
- inputCamera,
103
- image,
104
- video,
105
- audio,
106
- figure,
107
- Flex,
108
- Carousel,
109
- Grid,
110
- Header,
111
- Main,
112
- Section,
113
- Article,
114
- Aside,
115
- Nav,
116
- Footer,
117
- Table,
118
- CodeCell,
119
- CodeNote,
120
- Tabs,
121
- Accordion,
122
- ExtractAll: function () {
123
- const keys = Object.keys(this);
124
- for (let i = 0; i < keys.length; i++) {
125
- const key = keys[i];
126
- if (key !== 'ExtractAll' && key !== 'RemoveAll') {
127
- globalThis[key] = this[key];
128
- }
129
- }
130
- return this;
131
- },
132
- RemoveAll: function () {
133
- const keys = Object.keys(this);
134
- for (let i = 0; i < keys.length; i++) {
135
- const key = keys[i];
136
- if (key !== 'RemoveAll') {
137
- delete globalThis[key];
138
- }
139
- }
140
- return this;
141
- }
142
- }
143
- export * from "./Text";
144
- export * from "./List";
145
- export * from "./Inputs";
146
- export * from "./Media";
147
- export * from "./Table";
148
- export * from "./Semantic";
149
- export * from "./Misc";
150
- export * from "./CustomElement";
151
- export {
152
- html
153
- }
154
- export default UI;
@@ -1,74 +0,0 @@
1
- import {
2
- add,
3
- sub,
4
- mul,
5
- div,
6
- modulo,
7
- inRange,
8
- mapfun
9
- } from "../Math/Utils";
10
- function __ArrayProto__(){
11
- Object.defineProperties(Array.prototype,{
12
- inRange:{
13
- value: function(a,b) {
14
- return inRange(this.valueOf(),a,b)
15
- }
16
- },
17
- add:{
18
- value: function(...n) {
19
- return add(this.valueOf(),...n)
20
- }
21
- },
22
- sub:{
23
- value: function(...n) {
24
- return sub(this.valueOf(),...n)
25
- }
26
- },
27
- mul:{
28
- value: function(...n) {
29
- return mul(this.valueOf(),...n)
30
- }
31
- },
32
- div:{
33
- value: function(...n) {
34
- return div(this.valueOf(),...n)
35
- }
36
- },
37
- modulo:{
38
- value: function(...n) {
39
- return modulo(this.valueOf(),...n)
40
- }
41
- },
42
- norm:{
43
- value: function(min,max) {
44
- return norm(this.valueOf(),min,max)
45
- }
46
- },
47
- lerp:{
48
- value: function(min,max) {
49
- return lerp(this.valueOf(),min,max)
50
- }
51
- },
52
- _map:{
53
- value: function(a,b,c,d) {
54
- return map(this.valueOf(),a,b,c,d)
55
- }
56
- },
57
- clamp:{
58
- value: function(min,max) {
59
- return clamp(this.valueOf(),min,max)
60
- }
61
- },
62
- deepMap:{
63
- value: function(callback) {
64
- return mapfun(callback,...this.valueOf())
65
- }
66
- },
67
- // chunk:{
68
- // value: function() {
69
- // }
70
- // },
71
-
72
- })
73
- }
74
- export {__ArrayProto__}