ziko 0.0.5 → 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 (235) hide show
  1. package/dist/ziko.cjs +9999 -9853
  2. package/dist/ziko.js +10000 -9854
  3. package/dist/ziko.min.js +2 -2
  4. package/dist/ziko.mjs +9999 -9853
  5. package/package.json +12 -4
  6. package/starter/bin/index.js +10 -0
  7. package/wrapper/react/README.md +26 -0
  8. package/wrapper/react/index.jsx +7 -1
  9. package/wrapper/svelte/ZikoUI.svelte +15 -0
  10. package/wrapper/vue/ZikoUI.vue +8 -2
  11. package/core/App/Accessibility/index.js +0 -0
  12. package/core/App/Globals/__Target__.js +0 -3
  13. package/core/App/Globals/__UI__.js +0 -38
  14. package/core/App/Globals/__init__.js +0 -8
  15. package/core/App/Globals/index.js +0 -18
  16. package/core/App/Router/index.js +0 -40
  17. package/core/App/Seo/index.js +0 -43
  18. package/core/App/Themes/dark.js +0 -885
  19. package/core/App/Themes/index.js +0 -11
  20. package/core/App/Themes/light.js +0 -255
  21. package/core/App/app.js +0 -46
  22. package/core/App/index.js +0 -12
  23. package/core/Data/Api/fetchdom.js +0 -14
  24. package/core/Data/Api/index.js +0 -4
  25. package/core/Data/Api/preload.js +0 -11
  26. package/core/Data/Converter/canvas.js +0 -25
  27. package/core/Data/Converter/csv.js +0 -33
  28. package/core/Data/Converter/index.js +0 -25
  29. package/core/Data/Converter/json.js +0 -80
  30. package/core/Data/Converter/markdown.js +0 -83
  31. package/core/Data/Converter/svg.js +0 -11
  32. package/core/Data/Parser/markdown.js +0 -0
  33. package/core/Data/Parser/xml.js +0 -47
  34. package/core/Data/Strings/index.js +0 -26
  35. package/core/Data/decorators.js +0 -0
  36. package/core/Data/index.js +0 -64
  37. package/core/Graphics/Canvas/Elements/Basic/arc.js +0 -43
  38. package/core/Graphics/Canvas/Elements/Basic/image.js +0 -0
  39. package/core/Graphics/Canvas/Elements/Basic/line.js +0 -26
  40. package/core/Graphics/Canvas/Elements/Basic/path.js +0 -0
  41. package/core/Graphics/Canvas/Elements/Basic/points.js +0 -48
  42. package/core/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
  43. package/core/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
  44. package/core/Graphics/Canvas/Elements/Basic/rect.js +0 -46
  45. package/core/Graphics/Canvas/Elements/Basic/text.js +0 -0
  46. package/core/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
  47. package/core/Graphics/Canvas/Elements/Chart/plot.js +0 -0
  48. package/core/Graphics/Canvas/Elements/Chart/scatter.js +0 -2
  49. package/core/Graphics/Canvas/Elements/Chart/stem.js +0 -0
  50. package/core/Graphics/Canvas/Elements/Element.js +0 -115
  51. package/core/Graphics/Canvas/Elements/Groupe.js +0 -0
  52. package/core/Graphics/Canvas/Elements/grid.js +0 -0
  53. package/core/Graphics/Canvas/Elements/index.js +0 -13
  54. package/core/Graphics/Canvas/Filter/index.js +0 -0
  55. package/core/Graphics/Canvas/Paint/index.js +0 -0
  56. package/core/Graphics/Canvas/Utils/color.js +0 -8
  57. package/core/Graphics/Canvas/Utils/floodFill.js +0 -58
  58. package/core/Graphics/Canvas/_canvas_offscreen +0 -0
  59. package/core/Graphics/Canvas/canvas.js +0 -189
  60. package/core/Graphics/Canvas/index.js +0 -15
  61. package/core/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
  62. package/core/Graphics/Svg/Elements/circle.js +0 -34
  63. package/core/Graphics/Svg/Elements/ellipse.js +0 -29
  64. package/core/Graphics/Svg/Elements/foreignObject.js +0 -46
  65. package/core/Graphics/Svg/Elements/grid.js +0 -9
  66. package/core/Graphics/Svg/Elements/groupe.js +0 -29
  67. package/core/Graphics/Svg/Elements/image.js +0 -33
  68. package/core/Graphics/Svg/Elements/line.js +0 -29
  69. package/core/Graphics/Svg/Elements/path.js +0 -59
  70. package/core/Graphics/Svg/Elements/polygon.js +0 -31
  71. package/core/Graphics/Svg/Elements/polyline.js +0 -4
  72. package/core/Graphics/Svg/Elements/rect.js +0 -43
  73. package/core/Graphics/Svg/Elements/text.js +0 -26
  74. package/core/Graphics/Svg/index.js +0 -1
  75. package/core/Graphics/Svg/svg.js +0 -117
  76. package/core/Graphics/index.js +0 -61
  77. package/core/Math/Calculus/Special Functions/bessel.js +0 -31
  78. package/core/Math/Calculus/Special Functions/beta.js +0 -38
  79. package/core/Math/Calculus/Special Functions/gamma.js +0 -30
  80. package/core/Math/Calculus/Special Functions/index.js +0 -4
  81. package/core/Math/Calculus/index.js +0 -1
  82. package/core/Math/Complex/Fractals/julia.js +0 -0
  83. package/core/Math/Complex/index.js +0 -191
  84. package/core/Math/Discret/Combinaison/index.js +0 -34
  85. package/core/Math/Discret/Conversion/index.js +0 -86
  86. package/core/Math/Discret/Logic/index.js +0 -46
  87. package/core/Math/Discret/Permutation/index.js +0 -31
  88. package/core/Math/Discret/Set/index.js +0 -2
  89. package/core/Math/Discret/Set/powerSet.js +0 -15
  90. package/core/Math/Discret/Set/subSet.js +0 -10
  91. package/core/Math/Discret/index.js +0 -23
  92. package/core/Math/Functions/index.js +0 -182
  93. package/core/Math/Matrix/Decomposition.js +0 -90
  94. package/core/Math/Matrix/LinearSystem.js +0 -10
  95. package/core/Math/Matrix/Matrix.js +0 -712
  96. package/core/Math/Matrix/index.js +0 -3
  97. package/core/Math/Numeric/index.js +0 -0
  98. package/core/Math/Random/index.js +0 -173
  99. package/core/Math/Signal/__np.py.txt +0 -40
  100. package/core/Math/Signal/conv.js +0 -175
  101. package/core/Math/Signal/fft.js +0 -55
  102. package/core/Math/Signal/filter.js +0 -39
  103. package/core/Math/Signal/functions.js +0 -146
  104. package/core/Math/Signal/index.js +0 -110
  105. package/core/Math/Statistics/Functions/index.js +0 -100
  106. package/core/Math/Statistics/index.js +0 -16
  107. package/core/Math/Utils/arithmetic.js +0 -139
  108. package/core/Math/Utils/checkers.js +0 -11
  109. package/core/Math/Utils/comparaison.js +0 -1
  110. package/core/Math/Utils/conversions.js +0 -7
  111. package/core/Math/Utils/discret.js +0 -28
  112. package/core/Math/Utils/index.js +0 -102
  113. package/core/Math/Utils/mapfun.js +0 -43
  114. package/core/Math/absract.js +0 -1
  115. package/core/Math/const.js +0 -3
  116. package/core/Math/index.js +0 -193
  117. package/core/Reactivity/Events/Global/Click.js +0 -56
  118. package/core/Reactivity/Events/Global/Clipboard.js +0 -84
  119. package/core/Reactivity/Events/Global/CustomEvent.js +0 -53
  120. package/core/Reactivity/Events/Global/Drag.js +0 -137
  121. package/core/Reactivity/Events/Global/Focus.js +0 -56
  122. package/core/Reactivity/Events/Global/Key.js +0 -104
  123. package/core/Reactivity/Events/Global/Mouse.js +0 -230
  124. package/core/Reactivity/Events/Global/Pointer.js +0 -214
  125. package/core/Reactivity/Events/Global/Touch.js +0 -0
  126. package/core/Reactivity/Events/Global/Wheel.js +0 -44
  127. package/core/Reactivity/Events/Partiel/Hash.js +0 -44
  128. package/core/Reactivity/Events/Partiel/Input.js +0 -59
  129. package/core/Reactivity/Events/Partiel/MediaEvent.js +0 -1
  130. package/core/Reactivity/Events/ZikoEvent.js +0 -91
  131. package/core/Reactivity/Events/index.js +0 -60
  132. package/core/Reactivity/Observer/index.js +0 -3
  133. package/core/Reactivity/Observer/intersection.js +0 -40
  134. package/core/Reactivity/Observer/mutation.js +0 -90
  135. package/core/Reactivity/Observer/resize.js +0 -47
  136. package/core/Reactivity/Use/Contexte/index.js +0 -1
  137. package/core/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
  138. package/core/Reactivity/Use/Decorators/index.js +0 -4
  139. package/core/Reactivity/Use/Interactions/index.js +0 -4
  140. package/core/Reactivity/Use/Interactions/useBluetooth.js +0 -48
  141. package/core/Reactivity/Use/Interactions/useChannel.js +0 -50
  142. package/core/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
  143. package/core/Reactivity/Use/Interactions/useSerial.js +0 -0
  144. package/core/Reactivity/Use/Interactions/useThread.js +0 -44
  145. package/core/Reactivity/Use/Interactions/useUsb.js +0 -0
  146. package/core/Reactivity/Use/Sensors/index.js +0 -2
  147. package/core/Reactivity/Use/Sensors/useBattery.js +0 -36
  148. package/core/Reactivity/Use/Sensors/useCamera.js +0 -0
  149. package/core/Reactivity/Use/Sensors/useGeolocation.js +0 -17
  150. package/core/Reactivity/Use/Sensors/useMicro.js +0 -0
  151. package/core/Reactivity/Use/Sensors/useOrientation.js +0 -0
  152. package/core/Reactivity/Use/Storage/index.js +0 -1
  153. package/core/Reactivity/Use/Storage/useCookie.js +0 -0
  154. package/core/Reactivity/Use/Storage/useIndexedDb.js +0 -0
  155. package/core/Reactivity/Use/Storage/useStorage.js +0 -74
  156. package/core/Reactivity/Use/UI/index.js +0 -4
  157. package/core/Reactivity/Use/UI/useCssLink.js +0 -0
  158. package/core/Reactivity/Use/UI/useCssText.js +0 -21
  159. package/core/Reactivity/Use/UI/useFavIcon.js +0 -38
  160. package/core/Reactivity/Use/UI/useLinearGradient.js +0 -0
  161. package/core/Reactivity/Use/UI/useMediaQuery.js +0 -1
  162. package/core/Reactivity/Use/UI/useRadialGradient.js +0 -0
  163. package/core/Reactivity/Use/UI/useStyle.js +0 -54
  164. package/core/Reactivity/Use/UI/useTheme.js +0 -62
  165. package/core/Reactivity/Use/UI/useTitle.js +0 -30
  166. package/core/Reactivity/Use/index.js +0 -82
  167. package/core/Reactivity/Use/todo.md +0 -26
  168. package/core/Reactivity/index.js +0 -3
  169. package/core/Time/animation.js +0 -76
  170. package/core/Time/index.js +0 -54
  171. package/core/Time/loop.js +0 -83
  172. package/core/Time/utils/decorators.js +0 -17
  173. package/core/Time/utils/ease.js +0 -144
  174. package/core/Time/utils/index.js +0 -18
  175. package/core/Time/utils/performance.js +0 -16
  176. package/core/Time/utils/ui.js +0 -26
  177. package/core/UI/CustomElement/Elements/Accordion/index.js +0 -62
  178. package/core/UI/CustomElement/Elements/Carousel/index.js +0 -47
  179. package/core/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
  180. package/core/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
  181. package/core/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
  182. package/core/UI/CustomElement/Elements/CodeNote/index.js +0 -2
  183. package/core/UI/CustomElement/Elements/Columns.js +0 -1
  184. package/core/UI/CustomElement/Elements/FAB.js +0 -0
  185. package/core/UI/CustomElement/Elements/Menu.js +0 -0
  186. package/core/UI/CustomElement/Elements/Notification.js +0 -0
  187. package/core/UI/CustomElement/Elements/Popover.js +0 -0
  188. package/core/UI/CustomElement/Elements/Popup.js +0 -0
  189. package/core/UI/CustomElement/Elements/Swipper.js +0 -4
  190. package/core/UI/CustomElement/Elements/Tabs/index.js +0 -111
  191. package/core/UI/CustomElement/Elements/Timeline.js +0 -0
  192. package/core/UI/CustomElement/Elements/Toast.js +0 -0
  193. package/core/UI/CustomElement/Elements/Treeview.js +0 -0
  194. package/core/UI/CustomElement/Elements/index.js +0 -4
  195. package/core/UI/CustomElement/Flex.js +0 -97
  196. package/core/UI/CustomElement/Grid.js +0 -30
  197. package/core/UI/CustomElement/index.js +0 -3
  198. package/core/UI/Embaded/index.js +0 -1
  199. package/core/UI/Inputs/Primitives/btn.js +0 -30
  200. package/core/UI/Inputs/Primitives/elements.js +0 -28
  201. package/core/UI/Inputs/Primitives/inputs.js +0 -324
  202. package/core/UI/Inputs/Primitives/select.js +0 -14
  203. package/core/UI/Inputs/Primitives/textarea.js +0 -15
  204. package/core/UI/Inputs/camera.js +0 -23
  205. package/core/UI/Inputs/index.js +0 -20
  206. package/core/UI/List/elements.js +0 -0
  207. package/core/UI/List/index.js +0 -127
  208. package/core/UI/Media/Audio/index.js +0 -38
  209. package/core/UI/Media/Image/figure.js +0 -16
  210. package/core/UI/Media/Image/image.js +0 -33
  211. package/core/UI/Media/Image/index.js +0 -2
  212. package/core/UI/Media/Video/index.js +0 -49
  213. package/core/UI/Media/index.js +0 -3
  214. package/core/UI/Misc/index.js +0 -45
  215. package/core/UI/Semantic/index.js +0 -61
  216. package/core/UI/Style/index.js +0 -499
  217. package/core/UI/Table/elements.js +0 -94
  218. package/core/UI/Table/index.js +0 -3
  219. package/core/UI/Table/table.js +0 -112
  220. package/core/UI/Table/utils.js +0 -12
  221. package/core/UI/Text/heading.js +0 -34
  222. package/core/UI/Text/index.js +0 -3
  223. package/core/UI/Text/p.js +0 -36
  224. package/core/UI/Text/pre.js +0 -0
  225. package/core/UI/Text/text.js +0 -65
  226. package/core/UI/Utils/index.js +0 -70
  227. package/core/UI/ZikoUIElement.js +0 -503
  228. package/core/UI/index.js +0 -154
  229. package/core/__proto__/Array.js +0 -74
  230. package/core/__proto__/Function.js +0 -0
  231. package/core/__proto__/Number.js +0 -76
  232. package/core/__proto__/Object.js +0 -0
  233. package/core/__proto__/String.js +0 -0
  234. package/core/index.js +0 -72
  235. package/wrapper/react/readme.md +0 -19
@@ -1,97 +0,0 @@
1
- import ZikoUIElement from "../ZikoUIElement.js"
2
- class ZikoUIFlex extends ZikoUIElement {
3
- constructor(tag = "div", w = "100%", h = "100%") {
4
- super(tag ,"Flex");
5
- this.direction = "cols";
6
- if (typeof w == "number") w += "%";
7
- if (typeof h == "number") h += "%";
8
- this.style({ width: w, height: h });
9
- this.style({ display: "flex" });
10
- this.render();
11
- }
12
- resp(px,wrap = true) {
13
- this.wrap(wrap);
14
- if (this.element.clientWidth < px) this.vertical();
15
- else this.horizontal();
16
- return this;
17
- }
18
- setSpaceAround() {
19
- this.style({ justifyContent: "space-around" });
20
- return this;
21
- }
22
- setSpaceBetween() {
23
- this.style({ justifyContent: "space-between" });
24
- return this;
25
- }
26
- setBaseline() {
27
- this.style({ alignItems: "baseline" });
28
- return this;
29
- }
30
- gap(g) {
31
- if (this.direction === "row") this.style({ columnGap: g });
32
- else if (this.direction === "column") this.style({ rowGap: g });
33
- return this;
34
- }
35
- wrap(value = "wrap") {
36
- const values = ["no-wrap", "wrap","wrap-reverse"];
37
- this.style({
38
- flexWrap: typeof value === "string" ? value : values[+value],
39
- });
40
- return this;
41
- }
42
- _justifyContent(align = "center") {
43
- this.style({ justifyContent: align });
44
- return this;
45
- }
46
- vertical(x, y, order=1) {
47
- set_vertical.call(this,order)
48
- this.style({
49
- alignItems: typeof(x)==="number"?map_pos_x.call(this,x):x,
50
- justifyContent: typeof(y)=="number"?map_pos_y.call(this,y):y
51
- });
52
- return this;
53
- }
54
- horizontal(x, y, order=1) {
55
- set_horizontal.call(this,order)
56
- this.style({
57
- alignItems: typeof(y)=="number"?map_pos_y.call(this,y):y,
58
- justifyContent: typeof(x)==="number"?map_pos_x.call(this,x):x
59
- });
60
- return this;
61
- }
62
- show() {
63
- this.isHidden = false;
64
- this.style({ display: "flex" });
65
- return this;
66
- }
67
- }
68
-
69
- const Flex = (...ZikoUIElement) =>{
70
- let tag="div";
71
- if(typeof ZikoUIElement[0]==="string"){
72
- tag=ZikoUIElement[0];
73
- ZikoUIElement.pop();
74
- }
75
- return new ZikoUIFlex(tag).append(...ZikoUIElement);
76
- }
77
- function set_vertical(direction){
78
- direction == 1
79
- ? this.style({ flexDirection: "column" })
80
- : direction == -1 && this.style({ flexDirection: "column-reverse" });
81
- return this;
82
- }
83
- function set_horizontal(direction){
84
- direction == 1
85
- ? this.style({ flexDirection: "row" })
86
- : direction == -1 && this.style({ flexDirection: "row-reverse" });
87
- return this;
88
- }
89
- function map_pos_x(align){
90
- let pos = ["flex-start", "center", "flex-end"];
91
- if (typeof align === "number") align = pos[align + 1];
92
- return align;
93
- }
94
- function map_pos_y(align){
95
- return map_pos_x(-align);
96
- }
97
- export{Flex,ZikoUIFlex}
@@ -1,30 +0,0 @@
1
- import ZikoUIElement from "../ZikoUIElement.js"
2
- class ZikoUIGrid extends ZikoUIElement {
3
- constructor(tag ="div", w = "50vw", h = "50vh") {
4
- super(tag,"Grid");
5
- this.direction = "cols";
6
- if (typeof w == "number") w += "%";
7
- if (typeof h == "number") h += "%";
8
- this.style({ border: "1px solid black", width: w, height: h });
9
- this.style({ display: "grid" });
10
- this.render();
11
- }
12
- columns(n) {
13
- let temp = "";
14
- for (let i = 0; i < n; i++) temp = temp.concat(" auto");
15
- this.#templateColumns(temp);
16
- return this;
17
- }
18
- #templateColumns(temp = "auto auto") {
19
- this.style({ gridTemplateColumns: temp });
20
- return this;
21
- }
22
- gap(w = 10, h = w) {
23
- if(typeof (w) === "number")w += "px";
24
- if(typeof (h) === "number")h += "px";
25
- this.style({gridColumnGap: w,gridRowGap: h});
26
- return this;
27
- }
28
- }
29
- const Grid = (...ZikoUIElement) => new ZikoUIGrid("div").append(...ZikoUIElement);
30
- export {Grid,ZikoUIGrid};
@@ -1,3 +0,0 @@
1
- export { Flex} from "./Flex.js";
2
- export { Grid} from "./Grid.js";
3
- export * from "./Elements"
@@ -1 +0,0 @@
1
-
@@ -1,30 +0,0 @@
1
- import ZikoUIElement from "../../ZikoUIElement.js";
2
- class ZikoUIBtn extends ZikoUIElement {
3
- constructor(value = "button") {
4
- super("button","btn");
5
- this.element = document.createElement("button");
6
- this.setValue(value);
7
- this.st.cursor("pointer");
8
- }
9
- setValue(value) {
10
- if (value instanceof ZikoUIElement) value.setTarget(this.element);
11
- else {
12
- this.element.appendChild(document.createTextNode(""));
13
- this.element.childNodes[0].data = value;
14
- }
15
- return this;
16
- }
17
- get value() {
18
- return this.element.innerText;
19
- }
20
- toggleValues(...values) {
21
- values = values.map((n) => "" + n);
22
- let index = values.indexOf("" + this.value);
23
- if (index != -1 && index != values.length - 1)
24
- this.setValue(values[index + 1]);
25
- else this.setValue(values[0]);
26
- return this;
27
- }
28
- }
29
- const btn = (value) => new ZikoUIBtn(value);
30
- export{btn}
@@ -1,28 +0,0 @@
1
- import ZikoUIElement from "../../ZikoUIElement.js";
2
- class ZikoUILabel extends ZikoUIElement{
3
- constructor(){
4
- super();
5
- this.element=document.createElement("label");
6
- }
7
- }
8
- class ZikoUIInputOption extends ZikoUIElement {
9
- constructor(value = "") {
10
- super();
11
- this.element = document.createElement("option");
12
- if(value instanceof Object&&"value" in value){
13
- this.setValue(value.value);
14
- this.setText(value?.text??value.value)
15
- }
16
- else this.setValue(value);
17
- }
18
- setValue(str = "") {
19
- this.element.value = str;
20
- return this;
21
- }
22
- setText(text=""){
23
- if(text)this.element.textContent=text;
24
- return this;
25
- }
26
- }
27
- //const op=(n)=>new ZikoUIInputOption(n)
28
- export{ZikoUILabel,ZikoUIInputOption}
@@ -1,324 +0,0 @@
1
- import ZikoUIElement from "../../ZikoUIElement.js";
2
- import { Input } from "../../../Reactivity/Events/index.js";
3
- import { ZikoUIInputOption,ZikoUILabel } from "./elements.js";
4
- import { btn } from "./btn.js";
5
- import { Random } from "../../../Math/Random/index.js";
6
- //import { select } from "./select.js";
7
- //import { debounce,throttle} from "../../Data/decorators.js";
8
-
9
- class ZikoUIInput extends ZikoUIElement {
10
- constructor(value = "",datalist) {
11
- super();
12
- this.element = document.createElement("input");
13
- Object.assign(this.events,{input:null})
14
- this.setValue(value);
15
- if(datalist)this.linkDatalist(datalist)
16
- }
17
- onInput(...callbacks){
18
- if(!this.events.input)this.events.input = Input(this);
19
- this.events.input.onInput(...callbacks);
20
- return this;
21
- }
22
- onChange(...callbacks){
23
- if(!this.events.input)this.events.input = Input(this);
24
- this.events.input.onChange(...callbacks);
25
- return this;
26
- }
27
- linkDatalist(datalist) {
28
- let id;
29
- if(datalist instanceof ZikoUIInputDatalist)id=datalist.Id
30
- else if(datalist instanceof Array){
31
- const Datalist=new ZikoUIInputDatalist(...datalist);
32
- id=Datalist.Id;
33
- console.log(Datalist)
34
- }
35
- else id=datalist;
36
- this.element.setAttribute("list", id);
37
- return this;
38
- }
39
- get value() {
40
- return this.element.value;
41
- }
42
- _setType(type) {
43
- this.element.type = type;
44
- return this;
45
- }
46
- setValue(value="") {
47
- this.element.value = value;
48
- return this;
49
- }
50
- useState(state){
51
- this.setValue(state)
52
- return [{value:this.value},e=>this.setValue(e)]
53
- }
54
- setPlaceholder(value) {
55
- if(value)this.element.placeholder = value;
56
- return this;
57
- }
58
- get isValide() {
59
- return this.element.checkValidity();
60
- }
61
- setRequired(required = true) {
62
- this.element.required = required;
63
- return this;
64
- }
65
- select() {
66
- this.element.select();
67
- return this;
68
- }
69
- copy() {
70
- this.element.select();
71
- document.execCommand("copy");
72
- return this;
73
- }
74
- cut() {
75
- this.element.select();
76
- document.execCommand("cut");
77
- return this;
78
- }
79
- accept(value) {
80
- this.element.accept = value;
81
- return this;
82
- }
83
- }
84
- class ZikoUIInputSearch extends ZikoUIInput {
85
- constructor() {
86
- super();
87
- this._setType("search");
88
- this.Length = 0;
89
- }
90
- onsearch(callback) {
91
- this.element.addEventListener("search", () => callback());
92
- return this;
93
- }
94
- connect(...UIElement) {
95
- /*
96
- let memory = new Array(UIElement.length).fill([]);
97
- UIElement.map((n, i) => {
98
- //console.log(n)
99
- n.items.map((m, j) => {
100
- memory[i][j] = m.element.style.display;
101
- });
102
- });
103
- UIElement.map((n, i) =>
104
- this.onInput(() => {
105
- n.filterByTextContent(this.value, memory[i]);
106
- this.Length = n.children.filter(
107
- (n) => n.style.display != "none"
108
- ).length;
109
- })
110
- );
111
- */
112
- return this;
113
- }
114
- displayLength(UIElement) {
115
- this.element.addEventListener("keyup", () =>
116
- UIElement.setValue(this.Length)
117
- );
118
- return this;
119
- }
120
- }
121
- class ZikoUIInputNumber extends ZikoUIInput {
122
- constructor(min, max ,step = 1) {
123
- super();
124
- this._setType("number");
125
- this.setMin(min).setMax(max).setStep(step);
126
- }
127
- get value() {
128
- return +this.element.value;
129
- }
130
- setMin(min) {
131
- this.element.min = min;
132
- return this;
133
- }
134
- setMax(max) {
135
- this.element.max = max;
136
- return this;
137
- }
138
- setStep(step) {
139
- this.element.step = step;
140
- return this;
141
- }
142
- }
143
- class ZikoUIInputSlider extends ZikoUIInputNumber {
144
- constructor(val = 0, min = 0, max = 10, step = 1) {
145
- super();
146
- this._setType("range");
147
- this.setMin(min).setMax(max).setValue(val).setStep(step);
148
- }
149
- }
150
- class ZikoUIInputColor extends ZikoUIInput {
151
- constructor() {
152
- super();
153
- this._setType("color");
154
- this.background(this.value);
155
- this.onInput(() => this.background(this.value));
156
- }
157
- }
158
- class ZikoUIInputPassword extends ZikoUIInput {
159
- constructor() {
160
- super();
161
- this._setType("password");
162
- }
163
- }
164
- class ZikoUIInputEmail extends ZikoUIInput {
165
- constructor() {
166
- super();
167
- this._setType("email");
168
- }
169
- }
170
- class ZikoUIInputTime extends ZikoUIInput {
171
- constructor() {
172
- super();
173
- this._setType("time");
174
- }
175
- }
176
- class ZikoUIInputDate extends ZikoUIInput {
177
- constructor() {
178
- super();
179
- this._setType("date");
180
- }
181
- }
182
- class ZikoUIInputDateTime extends ZikoUIInput {
183
- constructor() {
184
- super();
185
- this._setType("datetime-local");
186
- }
187
- }
188
- class ZikoUIInputCheckbox extends ZikoUIInput {
189
- constructor() {
190
- super();
191
- this._setType("checkbox");
192
- this.cursor("pointer");
193
- }
194
- get checked() {
195
- return this.element.checked;
196
- }
197
- check(checked = true) {
198
- this.element.checked = checked;
199
- return this;
200
- }
201
- color(color) {
202
- this.element.style.accentColor = color;
203
- return this;
204
- }
205
- }
206
- class ZikoUIInputRadio extends ZikoUIInput {
207
- constructor() {
208
- super();
209
- this._setType("radio");
210
- this.cursor("pointer");
211
- }
212
- get checked() {
213
- return this.element.checked;
214
- }
215
- check(checked = true) {
216
- this.element.checked = checked;
217
- return this;
218
- }
219
- color(color) {
220
- this.element.style.accentColor = color;
221
- return this;
222
- }
223
- }
224
-
225
-
226
- class ZikoUIInputImage extends ZikoUIElement {
227
- constructor(text = "File") {
228
- super();
229
- this._aux_element = btn(text).setTarget(this.Target);
230
- this.element = document.createElement("input");
231
- this.element.setAttribute("type", "file");
232
- this.element.setAttribute("accept", "image");
233
- this._aux_element.onClick(() => this.element.click());
234
- this.element.onChange = this.handleImage.bind(this);
235
- }
236
- handleImage(e) {
237
- const reader = new FileReader();
238
- const img = new Image();
239
- reader.onload = function (event) {
240
- img.src = event.target.result;
241
- console.log(img.src);
242
- };
243
- reader.readAsDataURL(e.target.files[0]);
244
- this.img = img;
245
- }
246
- get value() {
247
- return this.img;
248
- }
249
- render(bool = true) {
250
- if (bool) this.Target.appendChild(this._aux_element.element);
251
- else this.remove();
252
- return this;
253
- }
254
- remove() {
255
- if (this.Target.children.length) this.Target.removeChild(this._aux_element.element);
256
- return this;
257
- }
258
- }
259
-
260
- class ZikoUIInputDatalist extends ZikoUIElement {
261
- constructor(...options){
262
- super();
263
- this.element = document.createElement("datalist");
264
- this.addOptions(...options).setId("ziko-datalist-id"+Random.string(10));
265
- }
266
- addOptions(...options) {
267
- options.map((n) => this.append(new ZikoUIInputOption(n)));
268
- return this;
269
- }
270
- }
271
- const input = (value,datalist) => {
272
- if(value instanceof Object){
273
- const {datalist,placeholder}=value;
274
- value=value.value??"";
275
- return new ZikoUIInput(value,datalist).setPlaceholder(placeholder);
276
- }
277
- return new ZikoUIInput(value,datalist);
278
- }
279
- const datalist = (...options) => new ZikoUIInputDatalist(...options);
280
- const slider = (value, min, max, step) =>{
281
- if(value instanceof Object){
282
- const {min=0,max=10,step=1}=value;
283
- value=value?.value??5;
284
- return new ZikoUIInputSlider(value, min, max, step);
285
- }
286
- return new ZikoUIInputSlider(value, min, max, step);
287
- }
288
- const inputNumber = (min,max,step) =>{
289
- if(min instanceof Object){
290
- const {value,max=10,step=1,placeholder=""}=min;
291
- min=min?.min??0;
292
- return new ZikoUIInputSlider(min, max, step).setValue(value).setPlaceholder(placeholder);
293
- }
294
- return new ZikoUIInputNumber(min,max,step);
295
- }
296
- const search = (...a) => new ZikoUIInputSearch().connect(...a);
297
- const inputImage = (text) => new ZikoUIInputImage(text);
298
- const inputPassword = () => new ZikoUIInputPassword();
299
- const inputEmail = () => new ZikoUIInputEmail();
300
- const inputColor = () => new ZikoUIInputColor();
301
- const inputTime = () => new ZikoUIInputTime();
302
- const inputDate = () => new ZikoUIInputDate();
303
- const inputDateTime = () => new ZikoUIInputDateTime();
304
- const checkbox = () => new ZikoUIInputCheckbox();
305
- const radio = () => new ZikoUIInputRadio();
306
-
307
-
308
- export {
309
- input,
310
- search,
311
- slider,
312
- checkbox,
313
- radio,
314
- datalist,
315
- inputNumber,
316
- inputColor,
317
- inputDate,
318
- inputDateTime,
319
- inputEmail,
320
- inputImage,
321
- inputPassword,
322
- inputTime,
323
- };
324
- export {textarea} from "./textarea.js";
@@ -1,14 +0,0 @@
1
- import ZikoUIElement from "../../ZikoUIElement.js";
2
- import { ZikoUIInputOption } from "./elements.js";
3
- class ZikoUISelect extends ZikoUIElement {
4
- constructor(){
5
- super();
6
- this.element=document.createElement("select");
7
- }
8
- addOptions(...options) {
9
- options.map(n => this.append(new ZikoUIInputOption(n)));
10
- return this;
11
- }
12
- }
13
- const select=()=>new ZikoUISelect()
14
- export{select,ZikoUISelect}
@@ -1,15 +0,0 @@
1
- import ZikoUIElement from "../../ZikoUIElement.js";
2
-
3
- class ZikoUITextArea extends ZikoUIElement {
4
- constructor() {
5
- super();
6
- this.element = document.createElement("textarea");
7
- //Object.assign(this,inputComposer.call(this));
8
- }
9
- get value(){
10
- return this.element.textContent;
11
- }
12
- }
13
-
14
- const textarea =()=> new ZikoUITextArea();
15
- export {textarea}
@@ -1,23 +0,0 @@
1
- import { ZikoUIVideo } from "../Media";
2
- class ZikoUIWebcame extends ZikoUIVideo{
3
- constructor(){
4
- super()
5
- this.element.setAttribute("src", "");
6
- this.constraints = { audio: true, video: { width: 1280, height: 720 } };
7
- //this.video=this.element
8
- }
9
- start(){
10
- navigator.mediaDevices.getUserMedia(this.constraints).then((mediaStream)=>{
11
- this.element.srcObject = mediaStream;
12
- this.element.onloadedmetadata = () =>{
13
- this.element.play();
14
- };
15
- })
16
- .catch(function(err) { console.log(err.name + ": " + err.message); });
17
- return this;
18
- }
19
- }
20
- const inputCamera=()=>new ZikoUIWebcame();
21
- export{
22
- inputCamera
23
- }
@@ -1,20 +0,0 @@
1
- export {btn} from "./Primitives/btn.js"
2
- export {
3
- input,
4
- search,
5
- slider,
6
- checkbox,
7
- radio,
8
- datalist,
9
- inputNumber,
10
- inputColor,
11
- inputDate,
12
- inputDateTime,
13
- inputEmail,
14
- inputImage,
15
- inputPassword,
16
- inputTime,
17
- } from "./Primitives/inputs.js"
18
- export {textarea} from "./Primitives/textarea.js";
19
- export {select} from "./Primitives/select.js";
20
- export {inputCamera} from "./camera.js"
File without changes