ziko 0.0.4 → 0.0.6

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 (234) hide show
  1. package/dist/ziko.cjs +10000 -9874
  2. package/dist/ziko.js +10001 -9875
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +9998 -9873
  5. package/package.json +15 -5
  6. package/starter/bin/index.js +10 -0
  7. package/wrapper/react/README.md +26 -0
  8. package/wrapper/react/index.jsx +22 -0
  9. package/wrapper/svelte/ZikoUI.svelte +15 -0
  10. package/wrapper/vue/ZikoUI.vue +23 -0
  11. package/src/App/Accessibility/index.js +0 -0
  12. package/src/App/Globals/__Target__.js +0 -3
  13. package/src/App/Globals/__UI__.js +0 -38
  14. package/src/App/Globals/__init__.js +0 -8
  15. package/src/App/Globals/index.js +0 -3
  16. package/src/App/Router/index.js +0 -40
  17. package/src/App/Seo/index.js +0 -43
  18. package/src/App/Themes/dark.js +0 -885
  19. package/src/App/Themes/index.js +0 -11
  20. package/src/App/Themes/light.js +0 -255
  21. package/src/App/app.js +0 -46
  22. package/src/App/index.js +0 -11
  23. package/src/Data/Api/fetchdom.js +0 -14
  24. package/src/Data/Api/index.js +0 -4
  25. package/src/Data/Api/preload.js +0 -11
  26. package/src/Data/Converter/canvas.js +0 -25
  27. package/src/Data/Converter/csv.js +0 -33
  28. package/src/Data/Converter/index.js +0 -25
  29. package/src/Data/Converter/json.js +0 -80
  30. package/src/Data/Converter/markdown.js +0 -83
  31. package/src/Data/Converter/svg.js +0 -11
  32. package/src/Data/Parser/markdown.js +0 -0
  33. package/src/Data/Parser/xml.js +0 -47
  34. package/src/Data/Strings/index.js +0 -26
  35. package/src/Data/decorators.js +0 -0
  36. package/src/Data/index.js +0 -64
  37. package/src/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  38. package/src/Graphics/Canvas/Elements/Basic/image.js +0 -0
  39. package/src/Graphics/Canvas/Elements/Basic/line.js +0 -26
  40. package/src/Graphics/Canvas/Elements/Basic/path.js +0 -0
  41. package/src/Graphics/Canvas/Elements/Basic/points.js +0 -48
  42. package/src/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  43. package/src/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  44. package/src/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  45. package/src/Graphics/Canvas/Elements/Basic/text.js +0 -0
  46. package/src/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  47. package/src/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  48. package/src/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  49. package/src/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  50. package/src/Graphics/Canvas/Elements/Element.js +0 -115
  51. package/src/Graphics/Canvas/Elements/Groupe.js +0 -0
  52. package/src/Graphics/Canvas/Elements/grid.js +0 -0
  53. package/src/Graphics/Canvas/Elements/index.js +0 -13
  54. package/src/Graphics/Canvas/Filter/index.js +0 -0
  55. package/src/Graphics/Canvas/Paint/index.js +0 -0
  56. package/src/Graphics/Canvas/Utils/color.js +0 -8
  57. package/src/Graphics/Canvas/Utils/floodFill.js +0 -58
  58. package/src/Graphics/Canvas/_canvas_offscreen +0 -0
  59. package/src/Graphics/Canvas/canvas.js +0 -189
  60. package/src/Graphics/Canvas/index.js +0 -15
  61. package/src/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  62. package/src/Graphics/Svg/Elements/circle.js +0 -34
  63. package/src/Graphics/Svg/Elements/ellipse.js +0 -29
  64. package/src/Graphics/Svg/Elements/foreignObject.js +0 -46
  65. package/src/Graphics/Svg/Elements/grid.js +0 -9
  66. package/src/Graphics/Svg/Elements/groupe.js +0 -29
  67. package/src/Graphics/Svg/Elements/image.js +0 -33
  68. package/src/Graphics/Svg/Elements/line.js +0 -29
  69. package/src/Graphics/Svg/Elements/path.js +0 -59
  70. package/src/Graphics/Svg/Elements/polygon.js +0 -31
  71. package/src/Graphics/Svg/Elements/polyline.js +0 -4
  72. package/src/Graphics/Svg/Elements/rect.js +0 -43
  73. package/src/Graphics/Svg/Elements/text.js +0 -26
  74. package/src/Graphics/Svg/index.js +0 -1
  75. package/src/Graphics/Svg/svg.js +0 -117
  76. package/src/Graphics/index.js +0 -61
  77. package/src/Math/Calculus/Special Functions/bessel.js +0 -31
  78. package/src/Math/Calculus/Special Functions/beta.js +0 -38
  79. package/src/Math/Calculus/Special Functions/gamma.js +0 -30
  80. package/src/Math/Calculus/Special Functions/index.js +0 -4
  81. package/src/Math/Calculus/index.js +0 -1
  82. package/src/Math/Complex/Fractals/julia.js +0 -0
  83. package/src/Math/Complex/index.js +0 -191
  84. package/src/Math/Discret/Combinaison/index.js +0 -34
  85. package/src/Math/Discret/Conversion/index.js +0 -86
  86. package/src/Math/Discret/Logic/index.js +0 -46
  87. package/src/Math/Discret/Permutation/index.js +0 -31
  88. package/src/Math/Discret/Set/index.js +0 -2
  89. package/src/Math/Discret/Set/powerSet.js +0 -15
  90. package/src/Math/Discret/Set/subSet.js +0 -10
  91. package/src/Math/Discret/index.js +0 -23
  92. package/src/Math/Functions/index.js +0 -182
  93. package/src/Math/Matrix/Decomposition.js +0 -90
  94. package/src/Math/Matrix/LinearSystem.js +0 -10
  95. package/src/Math/Matrix/Matrix.js +0 -712
  96. package/src/Math/Matrix/index.js +0 -3
  97. package/src/Math/Numeric/index.js +0 -0
  98. package/src/Math/Random/index.js +0 -173
  99. package/src/Math/Signal/__np.py.txt +0 -40
  100. package/src/Math/Signal/conv.js +0 -175
  101. package/src/Math/Signal/fft.js +0 -55
  102. package/src/Math/Signal/filter.js +0 -39
  103. package/src/Math/Signal/functions.js +0 -146
  104. package/src/Math/Signal/index.js +0 -110
  105. package/src/Math/Statistics/Functions/index.js +0 -100
  106. package/src/Math/Statistics/index.js +0 -16
  107. package/src/Math/Utils/arithmetic.js +0 -139
  108. package/src/Math/Utils/checkers.js +0 -11
  109. package/src/Math/Utils/comparaison.js +0 -1
  110. package/src/Math/Utils/conversions.js +0 -7
  111. package/src/Math/Utils/discret.js +0 -28
  112. package/src/Math/Utils/index.js +0 -102
  113. package/src/Math/Utils/mapfun.js +0 -43
  114. package/src/Math/absract.js +0 -1
  115. package/src/Math/const.js +0 -3
  116. package/src/Math/index.js +0 -193
  117. package/src/Reactivity/Events/Global/Click.js +0 -56
  118. package/src/Reactivity/Events/Global/Clipboard.js +0 -84
  119. package/src/Reactivity/Events/Global/CustomEvent.js +0 -53
  120. package/src/Reactivity/Events/Global/Drag.js +0 -137
  121. package/src/Reactivity/Events/Global/Focus.js +0 -56
  122. package/src/Reactivity/Events/Global/Key.js +0 -104
  123. package/src/Reactivity/Events/Global/Mouse.js +0 -230
  124. package/src/Reactivity/Events/Global/Pointer.js +0 -214
  125. package/src/Reactivity/Events/Global/Touch.js +0 -0
  126. package/src/Reactivity/Events/Global/Wheel.js +0 -44
  127. package/src/Reactivity/Events/Partiel/Hash.js +0 -44
  128. package/src/Reactivity/Events/Partiel/Input.js +0 -59
  129. package/src/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  130. package/src/Reactivity/Events/ZikoEvent.js +0 -91
  131. package/src/Reactivity/Events/index.js +0 -60
  132. package/src/Reactivity/Observer/index.js +0 -3
  133. package/src/Reactivity/Observer/intersection.js +0 -40
  134. package/src/Reactivity/Observer/mutation.js +0 -90
  135. package/src/Reactivity/Observer/resize.js +0 -47
  136. package/src/Reactivity/Use/Contexte/index.js +0 -1
  137. package/src/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  138. package/src/Reactivity/Use/Decorators/index.js +0 -4
  139. package/src/Reactivity/Use/Interactions/index.js +0 -4
  140. package/src/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  141. package/src/Reactivity/Use/Interactions/useChannel.js +0 -50
  142. package/src/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  143. package/src/Reactivity/Use/Interactions/useSerial.js +0 -0
  144. package/src/Reactivity/Use/Interactions/useThread.js +0 -44
  145. package/src/Reactivity/Use/Interactions/useUsb.js +0 -0
  146. package/src/Reactivity/Use/Sensors/index.js +0 -2
  147. package/src/Reactivity/Use/Sensors/useBattery.js +0 -36
  148. package/src/Reactivity/Use/Sensors/useCamera.js +0 -0
  149. package/src/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  150. package/src/Reactivity/Use/Sensors/useMicro.js +0 -0
  151. package/src/Reactivity/Use/Sensors/useOrientation.js +0 -0
  152. package/src/Reactivity/Use/Storage/index.js +0 -1
  153. package/src/Reactivity/Use/Storage/useCookie.js +0 -0
  154. package/src/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  155. package/src/Reactivity/Use/Storage/useStorage.js +0 -74
  156. package/src/Reactivity/Use/UI/index.js +0 -4
  157. package/src/Reactivity/Use/UI/useCssLink.js +0 -0
  158. package/src/Reactivity/Use/UI/useCssText.js +0 -21
  159. package/src/Reactivity/Use/UI/useFavIcon.js +0 -38
  160. package/src/Reactivity/Use/UI/useLinearGradient.js +0 -0
  161. package/src/Reactivity/Use/UI/useMediaQuery.js +0 -1
  162. package/src/Reactivity/Use/UI/useRadialGradient.js +0 -0
  163. package/src/Reactivity/Use/UI/useStyle.js +0 -54
  164. package/src/Reactivity/Use/UI/useTheme.js +0 -62
  165. package/src/Reactivity/Use/UI/useTitle.js +0 -30
  166. package/src/Reactivity/Use/index.js +0 -82
  167. package/src/Reactivity/Use/todo.md +0 -26
  168. package/src/Reactivity/index.js +0 -3
  169. package/src/Time/animation.js +0 -76
  170. package/src/Time/index.js +0 -54
  171. package/src/Time/loop.js +0 -83
  172. package/src/Time/utils/decorators.js +0 -17
  173. package/src/Time/utils/ease.js +0 -144
  174. package/src/Time/utils/index.js +0 -18
  175. package/src/Time/utils/performance.js +0 -16
  176. package/src/Time/utils/ui.js +0 -26
  177. package/src/UI/CustomElement/Elements/Accordion/index.js +0 -62
  178. package/src/UI/CustomElement/Elements/Carousel/index.js +0 -47
  179. package/src/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  180. package/src/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  181. package/src/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  182. package/src/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  183. package/src/UI/CustomElement/Elements/Columns.js +0 -1
  184. package/src/UI/CustomElement/Elements/FAB.js +0 -0
  185. package/src/UI/CustomElement/Elements/Menu.js +0 -0
  186. package/src/UI/CustomElement/Elements/Notification.js +0 -0
  187. package/src/UI/CustomElement/Elements/Popover.js +0 -0
  188. package/src/UI/CustomElement/Elements/Popup.js +0 -0
  189. package/src/UI/CustomElement/Elements/Swipper.js +0 -4
  190. package/src/UI/CustomElement/Elements/Tabs/index.js +0 -111
  191. package/src/UI/CustomElement/Elements/Timeline.js +0 -0
  192. package/src/UI/CustomElement/Elements/Toast.js +0 -0
  193. package/src/UI/CustomElement/Elements/Treeview.js +0 -0
  194. package/src/UI/CustomElement/Elements/index.js +0 -4
  195. package/src/UI/CustomElement/Flex.js +0 -97
  196. package/src/UI/CustomElement/Grid.js +0 -30
  197. package/src/UI/CustomElement/index.js +0 -3
  198. package/src/UI/Embaded/index.js +0 -1
  199. package/src/UI/Inputs/Primitives/btn.js +0 -31
  200. package/src/UI/Inputs/Primitives/elements.js +0 -28
  201. package/src/UI/Inputs/Primitives/inputs.js +0 -334
  202. package/src/UI/Inputs/Primitives/select.js +0 -15
  203. package/src/UI/Inputs/Primitives/textarea.js +0 -16
  204. package/src/UI/Inputs/camera.js +0 -23
  205. package/src/UI/Inputs/index.js +0 -20
  206. package/src/UI/List/elements.js +0 -0
  207. package/src/UI/List/index.js +0 -130
  208. package/src/UI/Media/Audio/index.js +0 -39
  209. package/src/UI/Media/Image/figure.js +0 -17
  210. package/src/UI/Media/Image/image.js +0 -34
  211. package/src/UI/Media/Image/index.js +0 -2
  212. package/src/UI/Media/Video/index.js +0 -50
  213. package/src/UI/Media/index.js +0 -3
  214. package/src/UI/Misc/index.js +0 -49
  215. package/src/UI/Semantic/index.js +0 -68
  216. package/src/UI/Style/index.js +0 -499
  217. package/src/UI/Table/elements.js +0 -94
  218. package/src/UI/Table/index.js +0 -3
  219. package/src/UI/Table/table.js +0 -113
  220. package/src/UI/Table/utils.js +0 -12
  221. package/src/UI/Text/heading.js +0 -35
  222. package/src/UI/Text/index.js +0 -3
  223. package/src/UI/Text/p.js +0 -37
  224. package/src/UI/Text/pre.js +0 -0
  225. package/src/UI/Text/text.js +0 -66
  226. package/src/UI/Utils/index.js +0 -70
  227. package/src/UI/ZikoUIElement.js +0 -501
  228. package/src/UI/index.js +0 -154
  229. package/src/__proto__/Array.js +0 -74
  230. package/src/__proto__/Function.js +0 -0
  231. package/src/__proto__/Number.js +0 -76
  232. package/src/__proto__/Object.js +0 -0
  233. package/src/__proto__/String.js +0 -0
  234. package/src/index.js +0 -70
@@ -1,501 +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
- if(typeof element === "string") element = globalThis.document.createElement(element);
24
- this.element = element;
25
- this.uuid=this.constructor.name+"-"+Random.string(10);
26
- this.cache = {
27
- name,
28
- parent:null,
29
- isRoot:false,
30
- isHidden: false,
31
- isFrozzen:false,
32
- style: ZikoStyle({}),
33
- attributes: {},
34
- filters: {},
35
- temp:{}
36
- };
37
- this.items = [];
38
- this.events = {
39
- ptr:null,
40
- mouse:null,
41
- Wheel:null,
42
- key:null,
43
- drag:null,
44
- drop:null,
45
- click:null,
46
- clipboard:null,
47
- focus:null,
48
- custom:null,
49
- }
50
- this.observer={
51
- resize:null,
52
- intersection:null
53
- }
54
- this.cache.style.linkTo(this);
55
- this.style({
56
- position: "relative",
57
- boxSizing:"border-box",
58
- fontFamily:"verdana",
59
- margin:0,
60
- padding:0,
61
- });
62
- this.size("auto", "auto");
63
- globalThis.__UI__[this.cache.name]?.push(this);
64
- }
65
- get st(){
66
- return this.cache.style;
67
- }
68
- get attr(){
69
- return this.cache.attributes;
70
- }
71
- get evt(){
72
- return this.cache.events;
73
- }
74
- get html(){
75
- return this.element.innerHTML;
76
- }
77
- get __app__(){
78
- if(this.cache.isRoot)return this;
79
- let root=this.cache.parent;
80
- while(1){
81
- if(!root)return null;
82
- if(root.cache.isRoot)return root;
83
- root=root.parent;
84
- }
85
- }
86
- clone(render=false) {
87
- // Not working For Table
88
- const UI = new this.constructor();
89
- UI.__proto__=this.__proto__;
90
- if(this.items.length){
91
- const items = [...this.items].map(n=>n.clone());
92
- UI.append(...items);
93
- }
94
- else UI.element=this.element.cloneNode(true);
95
- return UI.render(render);
96
- }
97
- style(styles,{target = "parent", maskVector = null } = {}){
98
- this.st.style(styles,{target,maskVector});
99
- return this;
100
- }
101
- size(width,height,{ target, maskVector } = {}){
102
- this.st.size(width,height,{target,maskVector});
103
- return this;
104
- }
105
- get parent(){
106
- return this.cache.parent;
107
- }
108
- get Width(){
109
- return this.element.getBoundingClientRect().width;
110
- }
111
- get Height(){
112
- return this.element.getBoundingClientRect().height;
113
- }
114
- get Top(){
115
- return this.element.getBoundingClientRect().top;
116
- }
117
- get Right(){
118
- return this.element.getBoundingClientRect().right;
119
- }
120
- get Bottom(){
121
- return this.element.getBoundingClientRect().bottom;
122
- }
123
- get Left(){
124
- return this.element.getBoundingClientRect().left;
125
- }
126
- freeze(freeze){
127
- this.cache.isFrozzen=freeze;
128
- return this;
129
- }
130
- at(index) {
131
- return this.items.at(index);
132
- }
133
- maintain() {
134
- for (let i = 0; i < this.items.length; i++)
135
- Object.assign(this, { [[i]]: this.items[i] });
136
- this.length = this.items.length;
137
- return this;
138
- }
139
- setTarget(tg) {
140
- if (tg instanceof ZikoUIElement) tg = tg.element;
141
- this.remove();
142
- this.target = tg;
143
- this.render();
144
- return this;
145
- }
146
- render(render = true , target = this.target) {
147
- if(target instanceof ZikoUIElement)target=target.element;
148
- this.target=target;
149
- if(render) {
150
- this.target.appendChild(this.element);
151
- }
152
- else this.remove();
153
- return this;
154
- }
155
- append(...ele) {
156
- if(this.cache.isFrozzen){
157
- console.warn("You can't append new item to frozzen element");
158
- return this;
159
- }
160
- for (let i = 0; i < ele.length; i++){
161
- if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
162
- if (ele[i] instanceof ZikoUIElement) {
163
- ele[i].cache.parent=this;
164
- this.element.appendChild(ele[i].element);
165
- ele[i].Target = this.element;
166
- this.items.push(ele[i]);
167
- } else if (ele[i] instanceof Object) {
168
- if (ele[i]?.style) this.style(ele[i]?.style);
169
- if (ele[i]?.attr) {
170
- Object.entries(ele[i].attr).forEach((n) =>
171
- this.setAttr("" + n[0], n[1]),
172
- );
173
- }
174
- }
175
- }
176
- this.maintain();
177
- return this;
178
- }
179
- remove(...ele) {
180
- if(ele.length==0){
181
- if(this.cache.parent)this.cache.parent.remove(this);
182
- else if(this.target.children.length && [...this.target.children].includes(this.element)) this.target.removeChild(this.element);
183
- }
184
- else {
185
- const remove = (ele) => {
186
- if(typeof ele === "number") ele=this.items[ele];
187
- if(ele instanceof ZikoUIElement)this.element.removeChild(ele.element);
188
- this.items=this.items.filter(n=>n!==ele);
189
- };
190
- for (let i = 0; i < ele.length; i++) remove(ele[i]);
191
- for (let i = 0; i < this.items.length; i++)Object.assign(this, { [[i]]: this.items[i] });
192
- // Remove from item
193
- }
194
- return this;
195
- }
196
- removeAfter(t = 1) {
197
- setTimeout(() => this.remove(), t);
198
- return this;
199
- }
200
- removeItem(...ele) {
201
- const remove = (ele) => {
202
- if (ele instanceof ZikoUIElement) this.element.removeChild(ele.element);
203
- else if (typeof ele === "number")
204
- this.element.removeChild(this.element.children[ele]);
205
- };
206
- for (let i = 0; i < ele.length; i++) remove(ele[i]);
207
- for (let i = 0; i < this.items.length; i++)
208
- Object.assign(this, { [[i]]: this.items[i] });
209
- return this;
210
- }
211
- insertAt(index, ...ele) {
212
- if (index >= this.element.children.length) this.append(...ele);
213
- else
214
- for (let i = 0; i < ele.length; i++) {
215
- if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
216
- this.element.insertBefore(ele[i].element, this.items[index].element);
217
- this.items.splice(index, 0, ele[i]);
218
- }
219
- return this;
220
- }
221
- // Attributes
222
- setAttr(name, value) {
223
- this.element.setAttribute(name, value);
224
- Object.assign(this.cache.attributes, Object.fromEntries([[name, value]]));
225
- return this;
226
- }
227
- removeAttr(name) {
228
- this.element.removeAttribute(name);
229
- return this;
230
- }
231
- setContentEditable(bool = true) {
232
- this.setAttr("contenteditable", bool);
233
- return this;
234
- }
235
- get children() {
236
- return [...this.element.children];
237
- }
238
- get cloneElement() {
239
- return this.element.cloneNode(true);
240
- }
241
- setClasses(...value) {
242
- this.setAttr("class", value.join(" "));
243
- return this;
244
- }
245
- get Classes(){
246
- const classes=this.element.getAttribute("class");
247
- return classes===null?[]:classes.split(" ");
248
- }
249
- addClass() {
250
- /*this.setAttr("class", value);
251
- return this;*/
252
- }
253
- setId(Id) {
254
- this.element.setAttribute("id", Id);
255
- return this;
256
- }
257
- get Id() {
258
- return this.element.getAttribute("id");
259
- }
260
- forEach(callback){
261
- this.items.forEach(callback);
262
- return this;
263
- }
264
- where(condition_callback,if_callback,else_callback){
265
- this.items.filter(condition_callback).forEach(if_callback)
266
- return this;
267
- }
268
- filter(condition){
269
- return this.items.filter(condition);
270
- }
271
- filterByTextContent(text,exactMatch=false){
272
- this.items.map(n=>n.render());
273
- this.items.filter(n=>{
274
- const content=n.element.textContent;
275
- return !(exactMatch?content===text:content.includes(text))
276
- }).map(n=>n.render(false));
277
- return this;
278
- }
279
- filterByClass(value) {
280
- this.items.map(n=>n.render());
281
- this.items.filter(n=>!n.Classes.includes(value)).map(n=>n.render(false));
282
- return this;
283
- }
284
- sortByTextContent(value, displays) {
285
- let item = this.children;
286
- item
287
- .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
288
- .map((n) => {
289
- n.style.display = "none";
290
- });
291
- item
292
- .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
293
- .map((n, i) => (n.style.display = displays[i]));
294
- //return item.filter(n=>n.style.display!="none")
295
- item.filter((n) => n.style.display != "none");
296
- return this;
297
- }
298
- onPtrMove(...callbacks){
299
- if(!this.events.ptr)this.events.ptr = Pointer(this);
300
- this.events.ptr.onMove(...callbacks);
301
- return this;
302
- }
303
- onPtrDown(...callbacks){
304
- if(!this.events.ptr)this.events.ptr = Pointer(this);
305
- this.events.ptr.onDown(...callbacks);
306
- return this;
307
- }
308
- onPtrUp(...callbacks){
309
- if(!this.events.ptr)this.events.ptr = Pointer(this);
310
- this.events.ptr.onUp(...callbacks);
311
- return this;
312
- }
313
- onPtrEnter(...callbacks){
314
- if(!this.events.ptr)this.events.ptr = Pointer(this);
315
- this.events.ptr.onEnter(...callbacks);
316
- return this;
317
- }
318
- onPtrLeave(...callbacks){
319
- if(!this.events.ptr)this.events.ptr = Pointer(this);
320
- this.events.ptr.onLeave(...callbacks);
321
- return this;
322
- }
323
- onPtrOut(...callbacks){
324
- if(!this.events.ptr)this.events.ptr = Pointer(this);
325
- this.events.ptr.onOut(...callbacks);
326
- return this;
327
- }
328
- onMouseMove(...callbacks){
329
- if(!this.events.mouse)this.events.mouse = Mouse(this);
330
- this.events.mouse.onMove(...callbacks);
331
- return this;
332
- }
333
- onMouseDown(...callbacks){
334
- if(!this.events.mouse)this.events.mouse = Mouse(this);
335
- this.events.mouse.onDown(...callbacks);
336
- return this;
337
- }
338
- onMouseUp(...callbacks){
339
- if(!this.events.mouse)this.events.mouse = Mouse(this);
340
- this.events.mouse.onUp(...callbacks);
341
- return this;
342
- }
343
- onMouseEnter(...callbacks){
344
- if(!this.events.mouse)this.events.mouse = Mouse(this);
345
- this.events.mouse.onEnter(...callbacks);
346
- return this;
347
- }
348
- onMouseLeave(...callbacks){
349
- if(!this.events.mouse)this.events.mouse = Mouse(this);
350
- this.events.mouse.onLeave(...callbacks);
351
- return this;
352
- }
353
- onMouseOut(...callbacks){
354
- if(!this.events.mouse)this.events.mouse = Mouse(this);
355
- this.events.mouse.onOut(...callbacks);
356
- return this;
357
- }
358
- onWheel(...callbacks){
359
- if(!this.events.wheel)this.events.wheel = Wheel(this);
360
- this.events.wheel.onWheel(...callbacks);
361
- return this;
362
- }
363
- onKeyDown(...callbacks){
364
- if(!this.events.key)this.events.key = Key(this);
365
- this.events.key.onDown(...callbacks);
366
- return this;
367
- }
368
- onKeyPress(...callbacks){
369
- if(!this.events.key)this.events.key = Key(this);
370
- this.events.key.onPress(...callbacks);
371
- return this;
372
- }
373
- onKeyUp(...callbacks){
374
- if(!this.events.key)this.events.key = Key(this);
375
- this.events.key.onUp(...callbacks);
376
- return this;
377
- }
378
- onKeysDown({keys=[],callback}={}){
379
- if(!this.events.key)this.events.key = Key(this);
380
- this.events.key.handleSuccessifKeys({keys,callback});
381
- return this;
382
- }
383
- onDragStart(...callbacks){
384
- if(!this.events.drag)this.events.drag = Drag(this);
385
- this.events.drag.onStart(...callbacks);
386
- return this;
387
- }
388
- onDrag(...callbacks){
389
- if(!this.events.drag)this.events.drag = Drag(this);
390
- this.events.drag.onDrag(...callbacks);
391
- return this;
392
- }
393
- onDragEnd(...callbacks){
394
- if(!this.events.drag)this.events.drag = Drag(this);
395
- this.events.drag.onEnd(...callbacks);
396
- return this;
397
- }
398
- onDrop(...callbacks){
399
- if(!this.events.drop)this.events.drop = Drop(this);
400
- this.events.drop.onDrop(...callbacks);
401
- return this;
402
- }
403
- onClick(...callbacks){
404
- if(!this.events.click)this.events.click = Click(this);
405
- this.events.click.onClick(...callbacks);
406
- return this;
407
- }
408
- onDbClick(...callbacks){
409
- if(!this.events.click)this.events.click = Click(this);
410
- this.events.click.onDbClick(...callbacks);
411
- return this;
412
- }
413
- onCopy(...callbacks){
414
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
415
- this.events.clipboard.onCopy(...callbacks);
416
- return this;
417
- }
418
- onCut(...callbacks){
419
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
420
- this.events.clipboard.onCut(...callbacks);
421
- return this;
422
- }
423
- onPaste(...callbacks){
424
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
425
- this.events.clipboard.onPaste(...callbacks);
426
- return this;
427
- }
428
- onSelect(...callbacks){
429
- if(!this.events.clipboard)this.events.clipboard = Clipboard(this);
430
- this.events.clipboard.onSelect(...callbacks);
431
- return this;
432
- }
433
- onFocus(...callbacks){
434
- if(!this.events.focus)this.events.focus = Focus(this);
435
- this.events.focus.onFocus(...callbacks);
436
- return this;
437
- }
438
- onBlur(...callbacks){
439
- if(!this.events.focus)this.events.focus = Focus(this);
440
- this.events.focus.onFocus(...callbacks);
441
- return this;
442
- }
443
- on(event_name,...callbacks){
444
- if(!this.events.custom)this.events.custom = customEvent(this);
445
- this.events.custom.on(event_name,...callbacks);
446
- return this;
447
- }
448
- emit(event_name,detail={}){
449
- if(!this.events.custom)this.events.custom = customEvent(this);
450
- this.events.custom.emit(event_name,detail);
451
- return this;
452
- }
453
- WatchAttributes(){
454
-
455
- }
456
- WatchChildren(){
457
-
458
- }
459
- WatchSize(callback){
460
- if(!this.observer.resize)this.observer.resize = WatchSize(this,callback);
461
- this.observer.resize.start();
462
- return this;
463
- }
464
- WatchIntersection(callback,config){
465
- if(!this.observer.intersection)this.observer.intersection = WatchIntersection(this,callback,config);
466
- this.observer.intersection.start();
467
- return this;
468
- }
469
- get VisibleArea() {
470
- let coords = this.element.getBoundingClientRect();
471
- let windowHeight = globalThis.document.documentElement.clientHeight;
472
- let windowWidth = globalThis.document.documentElement.clientWidth;
473
- let topVisible = coords.top > 0 && coords.top < windowHeight;
474
- let bottomVisible = coords.bottom < windowHeight && coords.bottom > 0;
475
- let leftVisible = coords.left > 0 && coords.left < windowWidth;
476
- let rightVisible = coords.right > 0 && coords.right < windowWidth;
477
- return {
478
- top: topVisible,
479
- bottom: bottomVisible,
480
- left: leftVisible,
481
- right: rightVisible,
482
- heightRatio: (coords.height + coords.y) / coords.height,
483
- isVisible: topVisible || bottomVisible || rightVisible || leftVisible,
484
- };
485
- }
486
- setFullScreen(set = true, e) {
487
- if(!this.element.requestFullscreen){
488
- console.error("Fullscreen API is not supported in this browser.");
489
- return this;
490
- }
491
- if (set) this.element.requestFullscreen(e);
492
- else globalThis.document.exitFullscreen();
493
- return this;
494
- }
495
- toggleFullScreen(e) {
496
- if (!globalThis.document.fullscreenElement) this.element.requestFullscreen(e);
497
- else globalThis.document.exitFullscreen();
498
- return this;
499
- }
500
- }
501
- export default ZikoUIElement;
package/src/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
- ZikoHtml
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
- ZikoHtml,
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
- ZikoHtml
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__}
File without changes