ziko 0.0.20 → 0.0.21
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.cjs +317 -186
- package/dist/ziko.js +317 -186
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +314 -186
- package/package.json +2 -1
- package/src/math/functions/helper.js +30 -20
- package/src/math/functions/index.js +2 -1
- package/src/math/index.js +2 -2
- package/src/math/utils/mapfun.js +3 -2
- package/src/ui/elements/primitives/ZikoUIContainerElement.js +108 -149
- package/src/ui/elements/primitives/ZikoUIElement.js +119 -11
- package/src/ui/elements/primitives/misc/hyperscript.js +11 -0
- package/src/ui/elements/primitives/misc/index.js +3 -1
- package/src/ui/elements/primitives/misc/suspense.js +42 -0
- package/starter/bin/index.js +1 -1
- package/src/math/complex/Fractals/julia.js +0 -0
- package/src/ui/elements/derived/elements/Notification.js +0 -0
- package/src/ui/elements/derived/elements/Popover.js +0 -0
- package/src/ui/elements/derived/elements/Popup.js +0 -0
- package/src/ui/elements/derived/elements/Swipper.js +0 -4
- package/src/ui/elements/derived/elements/Timeline.js +0 -0
- package/src/ui/elements/derived/elements/Toast.js +0 -0
- package/src/ui/elements/derived/elements/Treeview.js +0 -0
- package/src/ui/elements/derived/elements/columns.js +0 -1
- package/src/ui/elements/derived/elements/fab.js +0 -0
- package/src/ui/elements/derived/elements/index.js +0 -9
package/dist/ziko.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
5
|
+
Date : Sun Dec 08 2024 12:19:40 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
|
|
@@ -31,36 +31,46 @@ const __RemoveAll__ =(obj)=> {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const { PI, E } = Math;
|
|
34
|
+
const { PI: PI$1, E } = Math;
|
|
35
35
|
const EPSILON=Number.EPSILON;
|
|
36
36
|
|
|
37
37
|
var __Const__ = /*#__PURE__*/Object.freeze({
|
|
38
38
|
__proto__: null,
|
|
39
39
|
E: E,
|
|
40
40
|
EPSILON: EPSILON,
|
|
41
|
-
PI: PI
|
|
41
|
+
PI: PI$1
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
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;
|
|
45
|
+
let Fixed={
|
|
46
|
+
cos: cos$1,
|
|
47
|
+
sin: sin$1,
|
|
48
|
+
tan: tan$1,
|
|
49
|
+
sinc: x => sin$1(PI*x)/(PI*x),
|
|
50
|
+
sec: x => 1/cos$1(x),
|
|
51
|
+
csc: x => 1/sin$1(x),
|
|
52
|
+
cot: x => 1/tan$1(x),
|
|
53
|
+
acos: acos$1,
|
|
54
|
+
asin: asin$1,
|
|
55
|
+
atan: atan$1,
|
|
56
|
+
acot: x => PI/2-atan$1(x),
|
|
57
|
+
cosh: cosh$1,
|
|
58
|
+
sinh: sinh$1,
|
|
59
|
+
tanh: tanh$1,
|
|
60
|
+
coth: n => (1/2*log((1+n)/(1-n))),
|
|
61
|
+
acosh: acosh$1,
|
|
62
|
+
asinh: asinh$1,
|
|
63
|
+
atanh: atanh$1,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
Fixed = new Proxy(Fixed, {
|
|
67
|
+
get(target, prop) {
|
|
68
|
+
if(prop in target){
|
|
69
|
+
return x => + target[prop](x).toFixed(15);
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
64
74
|
|
|
65
75
|
class ZikoMath {}
|
|
66
76
|
|
|
@@ -104,8 +114,9 @@ const mapfun$1=(fun,...X)=>{
|
|
|
104
114
|
default : return fun(x)
|
|
105
115
|
}
|
|
106
116
|
}
|
|
107
|
-
else if(x instanceof Object)
|
|
108
|
-
|
|
117
|
+
else if(x instanceof Object){
|
|
118
|
+
return fun(Object) || Object.fromEntries(Object.entries(x).map(n=>n=[n[0],mapfun$1(fun,n[1])]))
|
|
119
|
+
}
|
|
109
120
|
});
|
|
110
121
|
return Y.length==1?Y[0]:Y;
|
|
111
122
|
};
|
|
@@ -4843,7 +4854,7 @@ class ZikoUIElement {
|
|
|
4843
4854
|
if(typeof element === "string") {
|
|
4844
4855
|
element === "svg" ? element=globalThis?.document?.createElementNS("http://www.w3.org/2000/svg", "svg"): element = globalThis?.document?.createElement(element);
|
|
4845
4856
|
}
|
|
4846
|
-
if(element)this.
|
|
4857
|
+
if(element)this.__ele__ = element;
|
|
4847
4858
|
this.uuid=this.constructor.name+"-"+Random.string(10);
|
|
4848
4859
|
this.cache = {
|
|
4849
4860
|
name,
|
|
@@ -4879,14 +4890,17 @@ class ZikoUIElement {
|
|
|
4879
4890
|
this.style({
|
|
4880
4891
|
position: "relative",
|
|
4881
4892
|
boxSizing:"border-box",
|
|
4882
|
-
// fontFamily:"verdana",
|
|
4883
4893
|
margin:0,
|
|
4884
4894
|
padding:0,
|
|
4885
4895
|
});
|
|
4896
|
+
this.items = [];
|
|
4886
4897
|
this.size("auto", "auto");
|
|
4887
4898
|
globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
|
|
4888
4899
|
element && globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
4889
4900
|
}
|
|
4901
|
+
get element(){
|
|
4902
|
+
return this.__ele__
|
|
4903
|
+
}
|
|
4890
4904
|
get isZikoUIElement(){
|
|
4891
4905
|
return true
|
|
4892
4906
|
}
|
|
@@ -4908,15 +4922,6 @@ class ZikoUIElement {
|
|
|
4908
4922
|
get isBody(){
|
|
4909
4923
|
return this.element === globalThis?.document.body;
|
|
4910
4924
|
}
|
|
4911
|
-
get __app__(){
|
|
4912
|
-
if(this.cache.isRoot)return this;
|
|
4913
|
-
let root=this.cache.parent;
|
|
4914
|
-
while(1){
|
|
4915
|
-
if(!root)return null;
|
|
4916
|
-
if(root.cache.isRoot)return root;
|
|
4917
|
-
root=root.parent;
|
|
4918
|
-
}
|
|
4919
|
-
}
|
|
4920
4925
|
get parent(){
|
|
4921
4926
|
return this.cache.parent;
|
|
4922
4927
|
}
|
|
@@ -4956,6 +4961,120 @@ class ZikoUIElement {
|
|
|
4956
4961
|
this.st.size(width,height);
|
|
4957
4962
|
return this;
|
|
4958
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(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(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
|
+
}
|
|
4959
5078
|
get #SwitchedStyleRTL_LTR(){
|
|
4960
5079
|
const CalculedStyle = globalThis.getComputedStyle(this.element);
|
|
4961
5080
|
const SwitchedStyle = {};
|
|
@@ -5311,161 +5430,120 @@ class ZikoUIContainerElement extends ZikoUIElement {
|
|
|
5311
5430
|
super(element, name);
|
|
5312
5431
|
this.items = [];
|
|
5313
5432
|
}
|
|
5314
|
-
maintain() {
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
}
|
|
5320
|
-
at(index) {
|
|
5321
|
-
|
|
5322
|
-
}
|
|
5323
|
-
#addItem(adder, pusher, ...ele) {
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
}
|
|
5342
|
-
}
|
|
5343
|
-
}
|
|
5344
|
-
this.maintain();
|
|
5345
|
-
return this;
|
|
5346
|
-
}
|
|
5347
|
-
append(...ele) {
|
|
5348
|
-
this.#addItem("append", "push", ...ele);
|
|
5349
|
-
return this;
|
|
5350
|
-
}
|
|
5351
|
-
prepend(...ele) {
|
|
5352
|
-
this.#addItem("prepend", "unshift", ...ele);
|
|
5353
|
-
return this;
|
|
5354
|
-
}
|
|
5355
|
-
// append(...ele) {
|
|
5356
|
-
// if(this.cache.isFrozzen){
|
|
5357
|
-
// console.warn("You can't append new item to frozzen element");
|
|
5358
|
-
// return this;
|
|
5359
|
-
// }
|
|
5360
|
-
// for (let i = 0; i < ele.length; i++){
|
|
5361
|
-
// if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
|
|
5362
|
-
// if (ele[i] instanceof ZikoUIElement) {
|
|
5363
|
-
// ele[i].cache.parent=this;
|
|
5364
|
-
// this.element?.appendChild(ele[i].element);
|
|
5365
|
-
// ele[i].target = this.element;
|
|
5366
|
-
// this.items.push(ele[i]);
|
|
5367
|
-
// } else if (ele[i] instanceof Object) {
|
|
5368
|
-
// if (ele[i]?.style) this.style(ele[i]?.style);
|
|
5369
|
-
// if (ele[i]?.attr) {
|
|
5370
|
-
// Object.entries(ele[i].attr).forEach((n) =>
|
|
5371
|
-
// this.setAttr("" + n[0], n[1]),
|
|
5372
|
-
// );
|
|
5373
|
-
// }
|
|
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
|
+
// );
|
|
5374
5460
|
// }
|
|
5375
5461
|
// }
|
|
5376
|
-
// this.maintain();
|
|
5377
|
-
// return this;
|
|
5378
5462
|
// }
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
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
|
+
// }
|
|
5389
5484
|
// remove(...ele) {
|
|
5390
|
-
//
|
|
5391
|
-
// if(
|
|
5392
|
-
//
|
|
5393
|
-
//
|
|
5394
|
-
//
|
|
5395
|
-
//
|
|
5396
|
-
//
|
|
5397
|
-
//
|
|
5398
|
-
//
|
|
5399
|
-
//
|
|
5400
|
-
//
|
|
5401
|
-
//
|
|
5402
|
-
//
|
|
5403
|
-
//
|
|
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");
|
|
5404
5545
|
// return this;
|
|
5405
5546
|
// }
|
|
5406
|
-
remove(...ele) {
|
|
5407
|
-
const remove = (ele) => {
|
|
5408
|
-
if (typeof ele === "number") ele = this.items[ele];
|
|
5409
|
-
if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
|
|
5410
|
-
this.items = this.items.filter((n) => n !== ele);
|
|
5411
|
-
};
|
|
5412
|
-
for (let i = 0; i < ele.length; i++) remove(ele[i]);
|
|
5413
|
-
for (let i = 0; i < this.items.length; i++)
|
|
5414
|
-
Object.assign(this, { [[i]]: this.items[i] });
|
|
5415
|
-
// Remove from item
|
|
5416
|
-
return this;
|
|
5417
|
-
}
|
|
5418
|
-
forEach(callback) {
|
|
5419
|
-
this.items.forEach(callback);
|
|
5420
|
-
return this;
|
|
5421
|
-
}
|
|
5422
|
-
map(callback) {
|
|
5423
|
-
return this.items.map(callback);
|
|
5424
|
-
}
|
|
5425
|
-
find(condition) {
|
|
5426
|
-
return this.items.filter(condition);
|
|
5427
|
-
}
|
|
5428
|
-
filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
|
|
5429
|
-
const FilterItems = this.items.filter(condition_callback);
|
|
5430
|
-
FilterItems.forEach(if_callback);
|
|
5431
|
-
this.items
|
|
5432
|
-
.filter((item) => !FilterItems.includes(item))
|
|
5433
|
-
.forEach(else_callback);
|
|
5434
|
-
return this;
|
|
5435
|
-
}
|
|
5436
|
-
filterByTextContent(text, exactMatch = false) {
|
|
5437
|
-
this.items.forEach((n) => n.render());
|
|
5438
|
-
this.filter(
|
|
5439
|
-
(n) => !(exactMatch ? n.text === text : n.text.includes(text)),
|
|
5440
|
-
(e) => e.unrender(),
|
|
5441
|
-
);
|
|
5442
|
-
// this.items.filter(n=>{
|
|
5443
|
-
// const content=n.element.textContent;
|
|
5444
|
-
// return !(exactMatch?content===text:content.includes(text))
|
|
5445
|
-
// }).map(n=>n.unrender());
|
|
5446
|
-
// return this;
|
|
5447
|
-
}
|
|
5448
|
-
filterByClass(value) {
|
|
5449
|
-
this.items.map((n) => n.render());
|
|
5450
|
-
this.items
|
|
5451
|
-
.filter((n) => !n.classes.includes(value))
|
|
5452
|
-
.map((n) => n.unrender());
|
|
5453
|
-
return this;
|
|
5454
|
-
}
|
|
5455
|
-
sortByTextContent(value, displays) {
|
|
5456
|
-
let item = this.children;
|
|
5457
|
-
item
|
|
5458
|
-
.filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5459
|
-
.map((n) => {
|
|
5460
|
-
n.style.display = "none";
|
|
5461
|
-
});
|
|
5462
|
-
item
|
|
5463
|
-
.filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5464
|
-
.map((n, i) => (n.style.display = displays[i]));
|
|
5465
|
-
//return item.filter(n=>n.style.display!="none")
|
|
5466
|
-
item.filter((n) => n.style.display != "none");
|
|
5467
|
-
return this;
|
|
5468
|
-
}
|
|
5469
5547
|
}
|
|
5470
5548
|
|
|
5471
5549
|
class __ZikoUIText__ extends ZikoUIContainerElement {
|
|
@@ -6134,6 +6212,53 @@ class ZikoUISVGWrapper extends ZikoUIXMLWrapper{
|
|
|
6134
6212
|
const HTMLWrapper = (HTMLContent) => new ZikoUIHTMLWrapper(HTMLContent);
|
|
6135
6213
|
const SVGWrapper = (SVGContent) => new ZikoUISVGWrapper(SVGContent);
|
|
6136
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
|
+
function h(tag, attributes = {}, ...children){
|
|
6254
|
+
const {name, style, ...attrs} = attributes;
|
|
6255
|
+
let element = new ZikoUIElement(tag,name);
|
|
6256
|
+
style && element.style(style);
|
|
6257
|
+
attrs && element.setAttr(attrs);
|
|
6258
|
+
children && element.append(...children);
|
|
6259
|
+
return element
|
|
6260
|
+
}
|
|
6261
|
+
|
|
6137
6262
|
class ZikoUIHtmlTag extends ZikoUIContainerElement {
|
|
6138
6263
|
constructor(element) {
|
|
6139
6264
|
super(element,"html");
|
|
@@ -6224,16 +6349,19 @@ var Misc = /*#__PURE__*/Object.freeze({
|
|
|
6224
6349
|
__proto__: null,
|
|
6225
6350
|
HTMLWrapper: HTMLWrapper,
|
|
6226
6351
|
SVGWrapper: SVGWrapper,
|
|
6352
|
+
Suspense: Suspense,
|
|
6227
6353
|
ZikoUIBr: ZikoUIBr,
|
|
6228
6354
|
ZikoUIHTMLWrapper: ZikoUIHTMLWrapper,
|
|
6229
6355
|
ZikoUIHr: ZikoUIHr,
|
|
6230
6356
|
ZikoUIHtmlTag: ZikoUIHtmlTag,
|
|
6231
6357
|
ZikoUILink: ZikoUILink,
|
|
6232
6358
|
ZikoUISVGWrapper: ZikoUISVGWrapper,
|
|
6359
|
+
ZikoUISuspense: ZikoUISuspense,
|
|
6233
6360
|
ZikoUIXMLWrapper: ZikoUIXMLWrapper,
|
|
6234
6361
|
br: br,
|
|
6235
6362
|
brs: brs,
|
|
6236
6363
|
btn: btn,
|
|
6364
|
+
h: h,
|
|
6237
6365
|
hr: hr,
|
|
6238
6366
|
hrs: hrs,
|
|
6239
6367
|
html: html,
|
|
@@ -11643,7 +11771,7 @@ exports.Main = Main;
|
|
|
11643
11771
|
exports.Matrix = Matrix;
|
|
11644
11772
|
exports.Modal = Modal;
|
|
11645
11773
|
exports.Nav = Nav;
|
|
11646
|
-
exports.PI = PI;
|
|
11774
|
+
exports.PI = PI$1;
|
|
11647
11775
|
exports.Permutation = Permutation;
|
|
11648
11776
|
exports.Random = Random;
|
|
11649
11777
|
exports.SPA = SPA;
|
|
@@ -11652,6 +11780,7 @@ exports.Section = Section;
|
|
|
11652
11780
|
exports.Slider = Slider;
|
|
11653
11781
|
exports.Splitter = Splitter;
|
|
11654
11782
|
exports.Str = Str;
|
|
11783
|
+
exports.Suspense = Suspense;
|
|
11655
11784
|
exports.Svg = Svg;
|
|
11656
11785
|
exports.Table = Table$1;
|
|
11657
11786
|
exports.Tabs = Tabs;
|
|
@@ -11737,6 +11866,7 @@ exports.ZikoUISection = ZikoUISection;
|
|
|
11737
11866
|
exports.ZikoUISelect = ZikoUISelect;
|
|
11738
11867
|
exports.ZikoUISubText = ZikoUISubText;
|
|
11739
11868
|
exports.ZikoUISupText = ZikoUISupText;
|
|
11869
|
+
exports.ZikoUISuspense = ZikoUISuspense;
|
|
11740
11870
|
exports.ZikoUISvg = ZikoUISvg;
|
|
11741
11871
|
exports.ZikoUIText = ZikoUIText;
|
|
11742
11872
|
exports.ZikoUITextArea = ZikoUITextArea;
|
|
@@ -11808,6 +11938,7 @@ exports.figure = figure;
|
|
|
11808
11938
|
exports.floor = floor;
|
|
11809
11939
|
exports.gamma = gamma;
|
|
11810
11940
|
exports.geomspace = geomspace;
|
|
11941
|
+
exports.h = h;
|
|
11811
11942
|
exports.h1 = h1;
|
|
11812
11943
|
exports.h2 = h2;
|
|
11813
11944
|
exports.h3 = h3;
|