ziko 0.0.20 → 0.0.22

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.
package/dist/ziko.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  Project: ziko.js
4
4
  Author: Zakaria Elalaoui
5
- Date : Sat Nov 16 2024 22:09:26 GMT+0100 (UTC+01:00)
5
+ Date : Sun Dec 08 2024 23:39:16 GMT+0100 (UTC+01:00)
6
6
  Git-Repo : https://github.com/zakarialaoui10/ziko.js
7
7
  Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
8
8
  Released under MIT License
@@ -27,36 +27,46 @@ const __RemoveAll__ =(obj)=> {
27
27
  }
28
28
  };
29
29
 
30
- const { PI, E } = Math;
30
+ const { PI: PI$1, E } = Math;
31
31
  const EPSILON=Number.EPSILON;
32
32
 
33
33
  var __Const__ = /*#__PURE__*/Object.freeze({
34
34
  __proto__: null,
35
35
  E: E,
36
36
  EPSILON: EPSILON,
37
- PI: PI
37
+ PI: PI$1
38
38
  });
39
39
 
40
- const Fixed={
41
- cos:x=>+Math.cos(x).toFixed(15),
42
- sin:x=>+Math.sin(x).toFixed(15),
43
- tan:x=>+Math.tan(x).toFixed(31),
44
- sinc:x=>+Math.sin(Math.PI*x)/(Math.PI*x),
45
- sec:x=>+1/Math.cos(x).toFixed(15),
46
- csc:x=>+1/Math.sin(x).toFixed(15),
47
- cot:x=>+1/Math.tan(x).toFixed(15),
48
- acos:x=>+Math.acos(x).toFixed(15),
49
- asin:x=>+Math.asin(x).toFixed(15),
50
- atan:x=>+Math.atan(x).toFixed(15),
51
- acot:x=>+Math.PI/2-Math.atan(x).toFixed(15),
52
- cosh:x=>+Math.cosh(x).toFixed(15),
53
- sinh:x=>+Math.sinh(x).toFixed(15),
54
- tanh:x=>+Math.tanh(x).toFixed(15),
55
- coth:n=>+(1/2*Math.log((1+n)/(1-n))).toFixed(15),
56
- acosh:x=>+Math.acosh(x).toFixed(15),
57
- asinh:x=>+Math.asinh(x).toFixed(15),
58
- atanh:x=>+Math.atanh(x).toFixed(15),
59
- };
40
+ const {PI, cos: cos$1, sin: sin$1, tan: tan$1, acos: acos$1, asin: asin$1, atan: atan$1, cosh: cosh$1, sinh: sinh$1, tanh: tanh$1, acosh: acosh$1, asinh: asinh$1, atanh: atanh$1, log} = Math;
41
+ let Fixed={
42
+ cos: cos$1,
43
+ sin: sin$1,
44
+ tan: tan$1,
45
+ sinc: x => sin$1(PI*x)/(PI*x),
46
+ sec: x => 1/cos$1(x),
47
+ csc: x => 1/sin$1(x),
48
+ cot: x => 1/tan$1(x),
49
+ acos: acos$1,
50
+ asin: asin$1,
51
+ atan: atan$1,
52
+ acot: x => PI/2-atan$1(x),
53
+ cosh: cosh$1,
54
+ sinh: sinh$1,
55
+ tanh: tanh$1,
56
+ coth: n => (1/2*log((1+n)/(1-n))),
57
+ acosh: acosh$1,
58
+ asinh: asinh$1,
59
+ atanh: atanh$1,
60
+ };
61
+
62
+ Fixed = new Proxy(Fixed, {
63
+ get(target, prop) {
64
+ if(prop in target){
65
+ return x => + target[prop](x).toFixed(15);
66
+ }
67
+ return undefined;
68
+ }
69
+ });
60
70
 
61
71
  class ZikoMath {}
62
72
 
@@ -100,8 +110,9 @@ const mapfun$1=(fun,...X)=>{
100
110
  default : return fun(x)
101
111
  }
102
112
  }
103
- else if(x instanceof Object)return Object.fromEntries(Object.entries(x).map(n=>n=[n[0],mapfun$1(fun,n[1])]))
104
-
113
+ else if(x instanceof Object){
114
+ return fun(Object) || Object.fromEntries(Object.entries(x).map(n=>n=[n[0],mapfun$1(fun,n[1])]))
115
+ }
105
116
  });
106
117
  return Y.length==1?Y[0]:Y;
107
118
  };
@@ -4834,12 +4845,16 @@ const Reactivity={
4834
4845
  };
4835
4846
 
4836
4847
  class ZikoUIElement {
4837
- constructor(element ,name="") {
4848
+ constructor(element ,name="", el_type="html") {
4838
4849
  this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
4839
4850
  if(typeof element === "string") {
4840
- element === "svg" ? element=globalThis?.document?.createElementNS("http://www.w3.org/2000/svg", "svg"): element = globalThis?.document?.createElement(element);
4851
+ switch(el_type){
4852
+ case "html" : element = globalThis?.document?.createElement(element); break;
4853
+ case "svg" : element = globalThis?.document?.createElementNS("http://www.w3.org/2000/svg", element);
4854
+ default : throw Error("Not supported")
4855
+ }
4841
4856
  }
4842
- if(element)this.element = element;
4857
+ if(element)this.__ele__ = element;
4843
4858
  this.uuid=this.constructor.name+"-"+Random.string(10);
4844
4859
  this.cache = {
4845
4860
  name,
@@ -4875,14 +4890,17 @@ class ZikoUIElement {
4875
4890
  this.style({
4876
4891
  position: "relative",
4877
4892
  boxSizing:"border-box",
4878
- // fontFamily:"verdana",
4879
4893
  margin:0,
4880
4894
  padding:0,
4881
4895
  });
4896
+ this.items = [];
4882
4897
  this.size("auto", "auto");
4883
4898
  globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
4884
4899
  element && globalThis.__Ziko__.__Config__.default.render && this.render();
4885
4900
  }
4901
+ get element(){
4902
+ return this.__ele__
4903
+ }
4886
4904
  get isZikoUIElement(){
4887
4905
  return true
4888
4906
  }
@@ -4904,15 +4922,6 @@ class ZikoUIElement {
4904
4922
  get isBody(){
4905
4923
  return this.element === globalThis?.document.body;
4906
4924
  }
4907
- get __app__(){
4908
- if(this.cache.isRoot)return this;
4909
- let root=this.cache.parent;
4910
- while(1){
4911
- if(!root)return null;
4912
- if(root.cache.isRoot)return root;
4913
- root=root.parent;
4914
- }
4915
- }
4916
4925
  get parent(){
4917
4926
  return this.cache.parent;
4918
4927
  }
@@ -4952,6 +4961,120 @@ class ZikoUIElement {
4952
4961
  this.st.size(width,height);
4953
4962
  return this;
4954
4963
  }
4964
+ maintain() {
4965
+ for (let i = 0; i < this.items.length; i++)
4966
+ Object.assign(this, { [[i]]: this.items[i] });
4967
+ this.length = this.items.length;
4968
+ return this;
4969
+ }
4970
+ at(index) {
4971
+ return this.items.at(index);
4972
+ }
4973
+ #addItem(adder, pusher, ...ele) {
4974
+ if (this.cache.isFrozzen) {
4975
+ console.warn("You can't append new item to frozzen element");
4976
+ return this;
4977
+ }
4978
+ for (let i = 0; i < ele.length; i++) {
4979
+ if (["number", "string"].includes(typeof ele[i])) ele[i] = text$1(ele[i]);
4980
+ if (ele[i] instanceof ZikoUIElement) {
4981
+ ele[i].cache.parent = this;
4982
+ this.element[adder](ele[i].element);
4983
+ ele[i].target = this.element;
4984
+ this.items[pusher](ele[i]);
4985
+ } else if (ele[i] instanceof Object) {
4986
+ if (ele[i]?.style) this.style(ele[i]?.style);
4987
+ if (ele[i]?.attr) {
4988
+ Object.entries(ele[i].attr).forEach((n) =>
4989
+ this.setAttr("" + n[0], n[1]),
4990
+ );
4991
+ }
4992
+ }
4993
+ }
4994
+ this.maintain();
4995
+ return this;
4996
+ }
4997
+ append(...ele) {
4998
+ this.#addItem("append", "push", ...ele);
4999
+ return this;
5000
+ }
5001
+ prepend(...ele) {
5002
+ this.#addItem("prepend", "unshift", ...ele);
5003
+ return this;
5004
+ }
5005
+ insertAt(index, ...ele) {
5006
+ if (index >= this.element.children.length) this.append(...ele);
5007
+ else
5008
+ for (let i = 0; i < ele.length; i++) {
5009
+ if (["number", "string"].includes(typeof ele[i])) ele[i] = text$1(ele[i]);
5010
+ this.element?.insertBefore(ele[i].element, this.items[index].element);
5011
+ this.items.splice(index, 0, ele[i]);
5012
+ }
5013
+ return this;
5014
+ }
5015
+ remove(...ele) {
5016
+ const remove = (ele) => {
5017
+ if (typeof ele === "number") ele = this.items[ele];
5018
+ if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
5019
+ this.items = this.items.filter((n) => n !== ele);
5020
+ };
5021
+ for (let i = 0; i < ele.length; i++) remove(ele[i]);
5022
+ for (let i = 0; i < this.items.length; i++)
5023
+ Object.assign(this, { [[i]]: this.items[i] });
5024
+ // Remove from item
5025
+ return this;
5026
+ }
5027
+ forEach(callback) {
5028
+ this.items.forEach(callback);
5029
+ return this;
5030
+ }
5031
+ map(callback) {
5032
+ return this.items.map(callback);
5033
+ }
5034
+ find(condition) {
5035
+ return this.items.filter(condition);
5036
+ }
5037
+ filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
5038
+ const FilterItems = this.items.filter(condition_callback);
5039
+ FilterItems.forEach(if_callback);
5040
+ this.items
5041
+ .filter((item) => !FilterItems.includes(item))
5042
+ .forEach(else_callback);
5043
+ return this;
5044
+ }
5045
+ filterByTextContent(text, exactMatch = false) {
5046
+ this.items.forEach((n) => n.render());
5047
+ this.filter(
5048
+ (n) => !(exactMatch ? n.text === text : n.text.includes(text)),
5049
+ (e) => e.unrender(),
5050
+ );
5051
+ // this.items.filter(n=>{
5052
+ // const content=n.element.textContent;
5053
+ // return !(exactMatch?content===text:content.includes(text))
5054
+ // }).map(n=>n.unrender());
5055
+ // return this;
5056
+ }
5057
+ filterByClass(value) {
5058
+ this.items.map((n) => n.render());
5059
+ this.items
5060
+ .filter((n) => !n.classes.includes(value))
5061
+ .map((n) => n.unrender());
5062
+ return this;
5063
+ }
5064
+ sortByTextContent(value, displays) {
5065
+ let item = this.children;
5066
+ item
5067
+ .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
5068
+ .map((n) => {
5069
+ n.style.display = "none";
5070
+ });
5071
+ item
5072
+ .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
5073
+ .map((n, i) => (n.style.display = displays[i]));
5074
+ //return item.filter(n=>n.style.display!="none")
5075
+ item.filter((n) => n.style.display != "none");
5076
+ return this;
5077
+ }
4955
5078
  get #SwitchedStyleRTL_LTR(){
4956
5079
  const CalculedStyle = globalThis.getComputedStyle(this.element);
4957
5080
  const SwitchedStyle = {};
@@ -5307,161 +5430,120 @@ class ZikoUIContainerElement extends ZikoUIElement {
5307
5430
  super(element, name);
5308
5431
  this.items = [];
5309
5432
  }
5310
- maintain() {
5311
- for (let i = 0; i < this.items.length; i++)
5312
- Object.assign(this, { [[i]]: this.items[i] });
5313
- this.length = this.items.length;
5314
- return this;
5315
- }
5316
- at(index) {
5317
- return this.items.at(index);
5318
- }
5319
- #addItem(adder, pusher, ...ele) {
5320
- if (this.cache.isFrozzen) {
5321
- console.warn("You can't append new item to frozzen element");
5322
- return this;
5323
- }
5324
- for (let i = 0; i < ele.length; i++) {
5325
- if (["number", "string"].includes(typeof ele[i])) ele[i] = text$1(ele[i]);
5326
- if (ele[i] instanceof ZikoUIElement) {
5327
- ele[i].cache.parent = this;
5328
- this.element[adder](ele[i].element);
5329
- ele[i].target = this.element;
5330
- this.items[pusher](ele[i]);
5331
- } else if (ele[i] instanceof Object) {
5332
- if (ele[i]?.style) this.style(ele[i]?.style);
5333
- if (ele[i]?.attr) {
5334
- Object.entries(ele[i].attr).forEach((n) =>
5335
- this.setAttr("" + n[0], n[1]),
5336
- );
5337
- }
5338
- }
5339
- }
5340
- this.maintain();
5341
- return this;
5342
- }
5343
- append(...ele) {
5344
- this.#addItem("append", "push", ...ele);
5345
- return this;
5346
- }
5347
- prepend(...ele) {
5348
- this.#addItem("prepend", "unshift", ...ele);
5349
- return this;
5350
- }
5351
- // append(...ele) {
5352
- // if(this.cache.isFrozzen){
5353
- // console.warn("You can't append new item to frozzen element");
5354
- // return this;
5355
- // }
5356
- // for (let i = 0; i < ele.length; i++){
5357
- // if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
5358
- // if (ele[i] instanceof ZikoUIElement) {
5359
- // ele[i].cache.parent=this;
5360
- // this.element?.appendChild(ele[i].element);
5361
- // ele[i].target = this.element;
5362
- // this.items.push(ele[i]);
5363
- // } else if (ele[i] instanceof Object) {
5364
- // if (ele[i]?.style) this.style(ele[i]?.style);
5365
- // if (ele[i]?.attr) {
5366
- // Object.entries(ele[i].attr).forEach((n) =>
5367
- // this.setAttr("" + n[0], n[1]),
5368
- // );
5369
- // }
5433
+ // maintain() {
5434
+ // for (let i = 0; i < this.items.length; i++)
5435
+ // Object.assign(this, { [[i]]: this.items[i] });
5436
+ // this.length = this.items.length;
5437
+ // return this;
5438
+ // }
5439
+ // at(index) {
5440
+ // return this.items.at(index);
5441
+ // }
5442
+ // #addItem(adder, pusher, ...ele) {
5443
+ // if (this.cache.isFrozzen) {
5444
+ // console.warn("You can't append new item to frozzen element");
5445
+ // return this;
5446
+ // }
5447
+ // for (let i = 0; i < ele.length; i++) {
5448
+ // if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
5449
+ // if (ele[i] instanceof ZikoUIElement) {
5450
+ // ele[i].cache.parent = this;
5451
+ // this.element[adder](ele[i].element);
5452
+ // ele[i].target = this.element;
5453
+ // this.items[pusher](ele[i]);
5454
+ // } else if (ele[i] instanceof Object) {
5455
+ // if (ele[i]?.style) this.style(ele[i]?.style);
5456
+ // if (ele[i]?.attr) {
5457
+ // Object.entries(ele[i].attr).forEach((n) =>
5458
+ // this.setAttr("" + n[0], n[1]),
5459
+ // );
5370
5460
  // }
5371
5461
  // }
5372
- // this.maintain();
5373
- // return this;
5374
5462
  // }
5375
- insertAt(index, ...ele) {
5376
- if (index >= this.element.children.length) this.append(...ele);
5377
- else
5378
- for (let i = 0; i < ele.length; i++) {
5379
- if (["number", "string"].includes(typeof ele[i])) ele[i] = text$1(ele[i]);
5380
- this.element?.insertBefore(ele[i].element, this.items[index].element);
5381
- this.items.splice(index, 0, ele[i]);
5382
- }
5383
- return this;
5384
- }
5463
+ // this.maintain();
5464
+ // return this;
5465
+ // }
5466
+ // append(...ele) {
5467
+ // this.#addItem("append", "push", ...ele);
5468
+ // return this;
5469
+ // }
5470
+ // prepend(...ele) {
5471
+ // this.#addItem("prepend", "unshift", ...ele);
5472
+ // return this;
5473
+ // }
5474
+ // insertAt(index, ...ele) {
5475
+ // if (index >= this.element.children.length) this.append(...ele);
5476
+ // else
5477
+ // for (let i = 0; i < ele.length; i++) {
5478
+ // if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
5479
+ // this.element?.insertBefore(ele[i].element, this.items[index].element);
5480
+ // this.items.splice(index, 0, ele[i]);
5481
+ // }
5482
+ // return this;
5483
+ // }
5385
5484
  // remove(...ele) {
5386
- // if(ele.length==0){
5387
- // if(this.cache.parent)this.cache.parent.remove(this);
5388
- // else if(this.target.children.length && [...this.target.children].includes(this.element)) this.target.removeChild(this.element);
5389
- // }
5390
- // else {
5391
- // const remove = (ele) => {
5392
- // if(typeof ele === "number") ele=this.items[ele];
5393
- // if(ele instanceof ZikoUIElement)this.element?.removeChild(ele.element);
5394
- // this.items=this.items.filter(n=>n!==ele);
5395
- // };
5396
- // for (let i = 0; i < ele.length; i++) remove(ele[i]);
5397
- // for (let i = 0; i < this.items.length; i++)Object.assign(this, { [[i]]: this.items[i] });
5398
- // // Remove from item
5399
- // }
5485
+ // const remove = (ele) => {
5486
+ // if (typeof ele === "number") ele = this.items[ele];
5487
+ // if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
5488
+ // this.items = this.items.filter((n) => n !== ele);
5489
+ // };
5490
+ // for (let i = 0; i < ele.length; i++) remove(ele[i]);
5491
+ // for (let i = 0; i < this.items.length; i++)
5492
+ // Object.assign(this, { [[i]]: this.items[i] });
5493
+ // // Remove from item
5494
+ // return this;
5495
+ // }
5496
+ // forEach(callback) {
5497
+ // this.items.forEach(callback);
5498
+ // return this;
5499
+ // }
5500
+ // map(callback) {
5501
+ // return this.items.map(callback);
5502
+ // }
5503
+ // find(condition) {
5504
+ // return this.items.filter(condition);
5505
+ // }
5506
+ // filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
5507
+ // const FilterItems = this.items.filter(condition_callback);
5508
+ // FilterItems.forEach(if_callback);
5509
+ // this.items
5510
+ // .filter((item) => !FilterItems.includes(item))
5511
+ // .forEach(else_callback);
5512
+ // return this;
5513
+ // }
5514
+ // filterByTextContent(text, exactMatch = false) {
5515
+ // this.items.forEach((n) => n.render());
5516
+ // this.filter(
5517
+ // (n) => !(exactMatch ? n.text === text : n.text.includes(text)),
5518
+ // (e) => e.unrender(),
5519
+ // );
5520
+ // // this.items.filter(n=>{
5521
+ // // const content=n.element.textContent;
5522
+ // // return !(exactMatch?content===text:content.includes(text))
5523
+ // // }).map(n=>n.unrender());
5524
+ // // return this;
5525
+ // }
5526
+ // filterByClass(value) {
5527
+ // this.items.map((n) => n.render());
5528
+ // this.items
5529
+ // .filter((n) => !n.classes.includes(value))
5530
+ // .map((n) => n.unrender());
5531
+ // return this;
5532
+ // }
5533
+ // sortByTextContent(value, displays) {
5534
+ // let item = this.children;
5535
+ // item
5536
+ // .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
5537
+ // .map((n) => {
5538
+ // n.style.display = "none";
5539
+ // });
5540
+ // item
5541
+ // .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
5542
+ // .map((n, i) => (n.style.display = displays[i]));
5543
+ // //return item.filter(n=>n.style.display!="none")
5544
+ // item.filter((n) => n.style.display != "none");
5400
5545
  // return this;
5401
5546
  // }
5402
- remove(...ele) {
5403
- const remove = (ele) => {
5404
- if (typeof ele === "number") ele = this.items[ele];
5405
- if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
5406
- this.items = this.items.filter((n) => n !== ele);
5407
- };
5408
- for (let i = 0; i < ele.length; i++) remove(ele[i]);
5409
- for (let i = 0; i < this.items.length; i++)
5410
- Object.assign(this, { [[i]]: this.items[i] });
5411
- // Remove from item
5412
- return this;
5413
- }
5414
- forEach(callback) {
5415
- this.items.forEach(callback);
5416
- return this;
5417
- }
5418
- map(callback) {
5419
- return this.items.map(callback);
5420
- }
5421
- find(condition) {
5422
- return this.items.filter(condition);
5423
- }
5424
- filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
5425
- const FilterItems = this.items.filter(condition_callback);
5426
- FilterItems.forEach(if_callback);
5427
- this.items
5428
- .filter((item) => !FilterItems.includes(item))
5429
- .forEach(else_callback);
5430
- return this;
5431
- }
5432
- filterByTextContent(text, exactMatch = false) {
5433
- this.items.forEach((n) => n.render());
5434
- this.filter(
5435
- (n) => !(exactMatch ? n.text === text : n.text.includes(text)),
5436
- (e) => e.unrender(),
5437
- );
5438
- // this.items.filter(n=>{
5439
- // const content=n.element.textContent;
5440
- // return !(exactMatch?content===text:content.includes(text))
5441
- // }).map(n=>n.unrender());
5442
- // return this;
5443
- }
5444
- filterByClass(value) {
5445
- this.items.map((n) => n.render());
5446
- this.items
5447
- .filter((n) => !n.classes.includes(value))
5448
- .map((n) => n.unrender());
5449
- return this;
5450
- }
5451
- sortByTextContent(value, displays) {
5452
- let item = this.children;
5453
- item
5454
- .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
5455
- .map((n) => {
5456
- n.style.display = "none";
5457
- });
5458
- item
5459
- .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
5460
- .map((n, i) => (n.style.display = displays[i]));
5461
- //return item.filter(n=>n.style.display!="none")
5462
- item.filter((n) => n.style.display != "none");
5463
- return this;
5464
- }
5465
5547
  }
5466
5548
 
5467
5549
  class __ZikoUIText__ extends ZikoUIContainerElement {
@@ -6130,6 +6212,186 @@ class ZikoUISVGWrapper extends ZikoUIXMLWrapper{
6130
6212
  const HTMLWrapper = (HTMLContent) => new ZikoUIHTMLWrapper(HTMLContent);
6131
6213
  const SVGWrapper = (SVGContent) => new ZikoUISVGWrapper(SVGContent);
6132
6214
 
6215
+ // function loadComponent() {
6216
+ // return new Promise((resolve) => {
6217
+ // setTimeout(() => {
6218
+ // resolve(p(1000))
6219
+ // }, 500);
6220
+ // });
6221
+ // }
6222
+
6223
+ // Suspense(p("Loading ..."),()=>fetch('https://jsonplaceholder.typicode.com/todos/1')
6224
+ // .then(response => response.json())
6225
+ // .then(json => h2(json.title)))
6226
+
6227
+
6228
+
6229
+ class ZikoUISuspense extends ZikoUIElement{
6230
+ constructor(fallback_ui, callback){
6231
+ super("div", "suspense");
6232
+ this.setAttr({
6233
+ dataTemp : "suspense"
6234
+ });
6235
+ this.fallback_ui = fallback_ui;
6236
+ this.append(fallback_ui);
6237
+ (async ()=>{
6238
+ try{
6239
+ const ui = await callback();
6240
+ fallback_ui.unrender();
6241
+ this.append(ui);
6242
+ // console.log(content)
6243
+ }
6244
+ catch(error){
6245
+ console.log({error});
6246
+ }
6247
+ })();
6248
+ }
6249
+ }
6250
+
6251
+ const Suspense = (fallback_ui, callback) => new ZikoUISuspense(fallback_ui, callback);
6252
+
6253
+ const _h=(tag, type, attributes, ...children)=>{
6254
+ const { name, style, ...attrs } = attributes;
6255
+ let element = new ZikoUIElement(tag, name, type);
6256
+ style && element.style(style);
6257
+ attrs && element.setAttr(attrs);
6258
+ children && element.append(...children);
6259
+ return element;
6260
+ };
6261
+ const h=(tag, attributes = {}, ...children)=> _h(tag, "html", attributes, ...children);
6262
+ const s=(tag, attributes = {}, ...children)=> _h(tag, "svg", attributes, ...children);
6263
+
6264
+ const HTMLTags = [
6265
+ 'a',
6266
+ 'abb',
6267
+ 'address',
6268
+ 'area',
6269
+ 'article',
6270
+ 'aside',
6271
+ 'audio',
6272
+ 'b',
6273
+ 'base',
6274
+ 'bdi',
6275
+ 'bdo',
6276
+ 'blockquote',
6277
+ 'br',
6278
+ 'button',
6279
+ 'canvas',
6280
+ 'caption',
6281
+ 'cite',
6282
+ 'code',
6283
+ 'col',
6284
+ 'colgroup',
6285
+ 'data',
6286
+ 'datalist',
6287
+ 'dd',
6288
+ 'del',
6289
+ 'details',
6290
+ 'dfn',
6291
+ 'dialog',
6292
+ 'div',
6293
+ 'dl',
6294
+ 'dt',
6295
+ 'em',
6296
+ 'embed',
6297
+ 'fieldset',
6298
+ 'figcaption',
6299
+ 'figure',
6300
+ 'footer',
6301
+ 'form',
6302
+ 'h1',
6303
+ 'h2',
6304
+ 'h3',
6305
+ 'h4',
6306
+ 'h5',
6307
+ 'h6',
6308
+ 'header',
6309
+ 'hgroup',
6310
+ 'hr',
6311
+ 'i',
6312
+ 'iframe',
6313
+ 'img',
6314
+ 'ipnut',
6315
+ 'ins',
6316
+ 'kbd',
6317
+ 'label',
6318
+ 'legend',
6319
+ 'li',
6320
+ 'main',
6321
+ 'map',
6322
+ 'mark',
6323
+ 'menu',
6324
+ 'meter',
6325
+ 'nav',
6326
+ 'object',
6327
+ 'ol',
6328
+ 'optgroup',
6329
+ 'option',
6330
+ 'output',
6331
+ 'p',
6332
+ 'param',
6333
+ 'picture',
6334
+ 'pre',
6335
+ 'progress',
6336
+ 'q',
6337
+ 'rp',
6338
+ 'rt',
6339
+ 'ruby',
6340
+ 's',
6341
+ 'samp',
6342
+ 'search',
6343
+ 'section',
6344
+ 'select',
6345
+ 'small',
6346
+ 'source',
6347
+ 'span',
6348
+ 'strong',
6349
+ 'sub',
6350
+ 'summary',
6351
+ 'sup',
6352
+ 'svg',
6353
+ 'table',
6354
+ 'tbody',
6355
+ 'td',
6356
+ 'template',
6357
+ 'textarea',
6358
+ 'tfoot',
6359
+ 'th',
6360
+ 'thead',
6361
+ 'time',
6362
+ 'title',
6363
+ 'tr',
6364
+ 'track',
6365
+ 'u',
6366
+ 'ul',
6367
+ 'var',
6368
+ 'video',
6369
+ 'wbr'
6370
+ ];
6371
+
6372
+ const SVGTags = [
6373
+ "svg", "g", "defs", "symbol", "use", "image", "switch",
6374
+ "rect", "circle", "ellipse", "line", "polyline", "polygon", "path",
6375
+ "text", "tspan", "textPath", "altGlyph", "altGlyphDef", "altGlyphItem", "glyph", "glyphRef",
6376
+ "linearGradient", "radialGradient", "pattern", "solidColor",
6377
+ "filter", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix",
6378
+ "feDiffuseLighting", "feDisplacementMap", "feDropShadow", "feFlood", "feFuncA", "feFuncR", "feFuncG", "feFuncB",
6379
+ "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "feSpecularLighting",
6380
+ "feTile", "feTurbulence",
6381
+ "animate", "animateMotion", "animateTransform", "set",
6382
+ "script",
6383
+ "desc", "title", "metadata", "foreignObject"
6384
+ ];
6385
+
6386
+ const hTags = HTMLTags.reduce((acc, key) => {
6387
+ acc[key] = (attr, ...children) => h(key, attr, ...children);
6388
+ return acc;
6389
+ }, {});
6390
+ const sTags = SVGTags.reduce((acc, key) => {
6391
+ acc[key] = (attr, ...children) => h(key, attr, ...children);
6392
+ return acc;
6393
+ }, {});
6394
+
6133
6395
  class ZikoUIHtmlTag extends ZikoUIContainerElement {
6134
6396
  constructor(element) {
6135
6397
  super(element,"html");
@@ -6220,20 +6482,26 @@ var Misc = /*#__PURE__*/Object.freeze({
6220
6482
  __proto__: null,
6221
6483
  HTMLWrapper: HTMLWrapper,
6222
6484
  SVGWrapper: SVGWrapper,
6485
+ Suspense: Suspense,
6223
6486
  ZikoUIBr: ZikoUIBr,
6224
6487
  ZikoUIHTMLWrapper: ZikoUIHTMLWrapper,
6225
6488
  ZikoUIHr: ZikoUIHr,
6226
6489
  ZikoUIHtmlTag: ZikoUIHtmlTag,
6227
6490
  ZikoUILink: ZikoUILink,
6228
6491
  ZikoUISVGWrapper: ZikoUISVGWrapper,
6492
+ ZikoUISuspense: ZikoUISuspense,
6229
6493
  ZikoUIXMLWrapper: ZikoUIXMLWrapper,
6230
6494
  br: br,
6231
6495
  brs: brs,
6232
6496
  btn: btn,
6497
+ h: h,
6498
+ hTags: hTags,
6233
6499
  hr: hr,
6234
6500
  hrs: hrs,
6235
6501
  html: html,
6236
- link: link
6502
+ link: link,
6503
+ s: s,
6504
+ sTags: sTags
6237
6505
  });
6238
6506
 
6239
6507
  class ZikoUIInputImage extends ZikoUIElement {
@@ -11610,4 +11878,4 @@ function RemoveAll(){
11610
11878
  Data.RemoveAll();
11611
11879
  }
11612
11880
 
11613
- export { Accordion, App$1 as App, Article, Aside, Base, Breadcrumbs, Canvas, Carousel, CodeCell, CodeNote, Collapsible, Combinaison, Complex, E, EPSILON, Ease, FileBasedRouting, Flex$1 as Flex, Footer, Form, Grid$1 as Grid, HTMLWrapper, Header, LinearSystem, Logic$1 as Logic, Main, Matrix, Modal, Nav, PI, Permutation, Random, SPA, SVGWrapper, Section, Slider, Splitter, Str, Svg, Table$1 as Table, Tabs, Utils$1 as Utils, ZikoApp, ZikoCustomEvent, ZikoEvent, ZikoEventClick, ZikoEventClipboard, ZikoEventHash, ZikoEventInput, ZikoEventKey, ZikoEventMouse, ZikoEventPointer, ZikoEventSwipe, ZikoEventWheel, ZikoHead$1 as ZikoHead, ZikoJsonStyleSheet, ZikoMutationObserver, ZikoSPA, ZikoSvgCircle, ZikoSvgEllipse, ZikoSvgForeignObject, ZikoSvgGroupe, ZikoSvgImage, ZikoSvgLine, ZikoSvgLink, ZikoSvgPath, ZikoSvgRectangle, ZikoSvgText, ZikoUIAbbrText, ZikoUIAccordion, ZikoUIArticle, ZikoUIAside, ZikoUIAudio, ZikoUIBlockQuote, ZikoUIBr, ZikoUIBreadcrumbs, ZikoUICanvas, ZikoUICodeNote, ZikoUICodeText, ZikoUIContainerElement, ZikoUIDefintion, ZikoUIElement, ZikoUIFigure, ZikoUIFlex$1 as ZikoUIFlex, ZikoUIFooter, ZikoUIForm, ZikoUIGrid, ZikoUIHTMLWrapper, ZikoUIHeader, ZikoUIHeading, ZikoUIHorizontalSlider, ZikoUIHorizontalSplitter, ZikoUIHr, ZikoUIHtmlTag, ZikoUIImage, ZikoUIInput, ZikoUIInputCheckbox, ZikoUIInputColor, ZikoUIInputDatalist$1 as ZikoUIInputDatalist, ZikoUIInputDate, ZikoUIInputDateTime, ZikoUIInputEmail, ZikoUIInputImage, ZikoUIInputNumber, ZikoUIInputOption, ZikoUIInputPassword, ZikoUIInputRadio, ZikoUIInputSearch, ZikoUIInputSlider$1 as ZikoUIInputSlider, ZikoUIInputTime, ZikoUILabel, ZikoUILink, ZikoUIMain, ZikoUIMenu3d, ZikoUIModal, ZikoUINav, ZikoUIParagraphe, ZikoUIQuote, ZikoUISVGWrapper, ZikoUISection, ZikoUISelect, ZikoUISubText, ZikoUISupText, ZikoUISvg, ZikoUIText, ZikoUITextArea, ZikoUIVerticalSlider, ZikoUIVerticalSplitter, ZikoUIVideo, ZikoUIXMLWrapper, ZikoUseRoot, ZikoUseStyle, __Config__, __UI__, abbrText, abs, accum, acos, acosh, acot, add, adoc2html, arange, arr2str, asin, asinh, atan, atan2, atanh, audio, bessel, beta, blockQuote, br, brs, btn, canvasArc, canvasCircle, canvasLine, canvasPoints, canvasRect, cartesianProduct, ceil, checkbox, choleskyDecomposition, clamp, codeText, combinaison, complex, cos, cosh, cot, coth, count, countWords, csc, csv2arr, csv2json, csv2matrix, csv2object, csv2sql, dangerAlert, datalist, Ziko as default, defineParamsGetter, deg2rad, dfnText, div, e, fact, figure, floor, gamma, geomspace, h1, h2, h3, h4, h5, h6, hSlider, hSplitter, hr, hrs, html, hypot, image, inRange, infoAlert, input, inputCamera, inputColor, inputDate, inputDateTime, inputEmail, inputImage, inputNumber, inputPassword, inputTime, isApproximatlyEqual, json2arr, json2css, json2csv, json2csvFile, json2xml, json2xmlFile, json2yml, json2ymlFile, jsonStyleSheet, lerp, li, link, linspace, ln, logspace, luDecomposition, map, mapfun$1 as mapfun, markdown2html, matrix, matrix2, matrix3, matrix4, max, menu3d, min, modulo, mul, norm, nums, obj2str, ol, ones, p, pgcd, pow, powerSet, ppcm, preload, prod, qrDecomposition, quote, rad2deg, radio, removeExtraSpace, round, search, sec, select, sig, sign, sin, sinc, sinh, slider, sqrt, sqrtn, str, sub, subSet, subText, successAlert, sum, supText, svg2ascii, svg2img, svg2imgUrl, svg2str, svgCircle, svgEllipse, svgGrid, svgGroupe, svgImage, svgLine, svgLink, svgObject, svgPath, svgPolygon, svgRect, svgText, tan, tanh, text$1 as text, textarea, timeTaken, time_memory_Taken, ul, useAnimation, useBattery, useChannel$1 as useChannel, useClickEvent, useClipboardEvent, useCustomEvent, useDebounce, useDragEvent, useDropEvent, useEventEmitter, useFavIcon$1 as useFavIcon, useFocusEvent, useFps, useGeolocation, useHashEvent, useHead$1 as useHead, useInputEvent, useKeyEvent, useLocaleStorage, useMediaQuery, useMeta$1 as useMeta, useMouseEvent, usePointerEvent, useRoot, useRootValue, useSessionStorage, useStyle, useSuccesifKeys, useSwipeEvent, useThread, useThrottle, useTimeLoop, useTitle$1 as useTitle, useType, useWheelEvent, vSlider, vSplitter, video, wait, waitForUIElm, waitForUIElmSync, warningAlert, watch, watchAttr, watchChildren, watchIntersection, watchScreen, watchSize, zeros };
11881
+ export { Accordion, App$1 as App, Article, Aside, Base, Breadcrumbs, Canvas, Carousel, CodeCell, CodeNote, Collapsible, Combinaison, Complex, E, EPSILON, Ease, FileBasedRouting, Flex$1 as Flex, Footer, Form, Grid$1 as Grid, HTMLWrapper, Header, LinearSystem, Logic$1 as Logic, Main, Matrix, Modal, Nav, PI$1 as PI, Permutation, Random, SPA, SVGWrapper, Section, Slider, Splitter, Str, Suspense, Svg, Table$1 as Table, Tabs, Utils$1 as Utils, ZikoApp, ZikoCustomEvent, ZikoEvent, ZikoEventClick, ZikoEventClipboard, ZikoEventHash, ZikoEventInput, ZikoEventKey, ZikoEventMouse, ZikoEventPointer, ZikoEventSwipe, ZikoEventWheel, ZikoHead$1 as ZikoHead, ZikoJsonStyleSheet, ZikoMutationObserver, ZikoSPA, ZikoSvgCircle, ZikoSvgEllipse, ZikoSvgForeignObject, ZikoSvgGroupe, ZikoSvgImage, ZikoSvgLine, ZikoSvgLink, ZikoSvgPath, ZikoSvgRectangle, ZikoSvgText, ZikoUIAbbrText, ZikoUIAccordion, ZikoUIArticle, ZikoUIAside, ZikoUIAudio, ZikoUIBlockQuote, ZikoUIBr, ZikoUIBreadcrumbs, ZikoUICanvas, ZikoUICodeNote, ZikoUICodeText, ZikoUIContainerElement, ZikoUIDefintion, ZikoUIElement, ZikoUIFigure, ZikoUIFlex$1 as ZikoUIFlex, ZikoUIFooter, ZikoUIForm, ZikoUIGrid, ZikoUIHTMLWrapper, ZikoUIHeader, ZikoUIHeading, ZikoUIHorizontalSlider, ZikoUIHorizontalSplitter, ZikoUIHr, ZikoUIHtmlTag, ZikoUIImage, ZikoUIInput, ZikoUIInputCheckbox, ZikoUIInputColor, ZikoUIInputDatalist$1 as ZikoUIInputDatalist, ZikoUIInputDate, ZikoUIInputDateTime, ZikoUIInputEmail, ZikoUIInputImage, ZikoUIInputNumber, ZikoUIInputOption, ZikoUIInputPassword, ZikoUIInputRadio, ZikoUIInputSearch, ZikoUIInputSlider$1 as ZikoUIInputSlider, ZikoUIInputTime, ZikoUILabel, ZikoUILink, ZikoUIMain, ZikoUIMenu3d, ZikoUIModal, ZikoUINav, ZikoUIParagraphe, ZikoUIQuote, ZikoUISVGWrapper, ZikoUISection, ZikoUISelect, ZikoUISubText, ZikoUISupText, ZikoUISuspense, ZikoUISvg, ZikoUIText, ZikoUITextArea, ZikoUIVerticalSlider, ZikoUIVerticalSplitter, ZikoUIVideo, ZikoUIXMLWrapper, ZikoUseRoot, ZikoUseStyle, __Config__, __UI__, abbrText, abs, accum, acos, acosh, acot, add, adoc2html, arange, arr2str, asin, asinh, atan, atan2, atanh, audio, bessel, beta, blockQuote, br, brs, btn, canvasArc, canvasCircle, canvasLine, canvasPoints, canvasRect, cartesianProduct, ceil, checkbox, choleskyDecomposition, clamp, codeText, combinaison, complex, cos, cosh, cot, coth, count, countWords, csc, csv2arr, csv2json, csv2matrix, csv2object, csv2sql, dangerAlert, datalist, Ziko as default, defineParamsGetter, deg2rad, dfnText, div, e, fact, figure, floor, gamma, geomspace, h, h1, h2, h3, h4, h5, h6, hSlider, hSplitter, hTags, hr, hrs, html, hypot, image, inRange, infoAlert, input, inputCamera, inputColor, inputDate, inputDateTime, inputEmail, inputImage, inputNumber, inputPassword, inputTime, isApproximatlyEqual, json2arr, json2css, json2csv, json2csvFile, json2xml, json2xmlFile, json2yml, json2ymlFile, jsonStyleSheet, lerp, li, link, linspace, ln, logspace, luDecomposition, map, mapfun$1 as mapfun, markdown2html, matrix, matrix2, matrix3, matrix4, max, menu3d, min, modulo, mul, norm, nums, obj2str, ol, ones, p, pgcd, pow, powerSet, ppcm, preload, prod, qrDecomposition, quote, rad2deg, radio, removeExtraSpace, round, s, sTags, search, sec, select, sig, sign, sin, sinc, sinh, slider, sqrt, sqrtn, str, sub, subSet, subText, successAlert, sum, supText, svg2ascii, svg2img, svg2imgUrl, svg2str, svgCircle, svgEllipse, svgGrid, svgGroupe, svgImage, svgLine, svgLink, svgObject, svgPath, svgPolygon, svgRect, svgText, tan, tanh, text$1 as text, textarea, timeTaken, time_memory_Taken, ul, useAnimation, useBattery, useChannel$1 as useChannel, useClickEvent, useClipboardEvent, useCustomEvent, useDebounce, useDragEvent, useDropEvent, useEventEmitter, useFavIcon$1 as useFavIcon, useFocusEvent, useFps, useGeolocation, useHashEvent, useHead$1 as useHead, useInputEvent, useKeyEvent, useLocaleStorage, useMediaQuery, useMeta$1 as useMeta, useMouseEvent, usePointerEvent, useRoot, useRootValue, useSessionStorage, useStyle, useSuccesifKeys, useSwipeEvent, useThread, useThrottle, useTimeLoop, useTitle$1 as useTitle, useType, useWheelEvent, vSlider, vSplitter, video, wait, waitForUIElm, waitForUIElmSync, warningAlert, watch, watchAttr, watchChildren, watchIntersection, watchScreen, watchSize, zeros };