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/README.md +2 -2
- package/dist/ziko.cjs +463 -189
- package/dist/ziko.js +463 -189
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +457 -189
- package/package.json +1 -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 +126 -13
- package/src/ui/elements/primitives/misc/hyperscript.js +144 -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 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
|
|
@@ -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
|
};
|
|
@@ -4838,12 +4849,16 @@ const Reactivity={
|
|
|
4838
4849
|
};
|
|
4839
4850
|
|
|
4840
4851
|
class ZikoUIElement {
|
|
4841
|
-
constructor(element ,name="") {
|
|
4852
|
+
constructor(element ,name="", el_type="html") {
|
|
4842
4853
|
this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
|
|
4843
4854
|
if(typeof element === "string") {
|
|
4844
|
-
|
|
4855
|
+
switch(el_type){
|
|
4856
|
+
case "html" : element = globalThis?.document?.createElement(element); break;
|
|
4857
|
+
case "svg" : element = globalThis?.document?.createElementNS("http://www.w3.org/2000/svg", element);
|
|
4858
|
+
default : throw Error("Not supported")
|
|
4859
|
+
}
|
|
4845
4860
|
}
|
|
4846
|
-
if(element)this.
|
|
4861
|
+
if(element)this.__ele__ = element;
|
|
4847
4862
|
this.uuid=this.constructor.name+"-"+Random.string(10);
|
|
4848
4863
|
this.cache = {
|
|
4849
4864
|
name,
|
|
@@ -4879,14 +4894,17 @@ class ZikoUIElement {
|
|
|
4879
4894
|
this.style({
|
|
4880
4895
|
position: "relative",
|
|
4881
4896
|
boxSizing:"border-box",
|
|
4882
|
-
// fontFamily:"verdana",
|
|
4883
4897
|
margin:0,
|
|
4884
4898
|
padding:0,
|
|
4885
4899
|
});
|
|
4900
|
+
this.items = [];
|
|
4886
4901
|
this.size("auto", "auto");
|
|
4887
4902
|
globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
|
|
4888
4903
|
element && globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
4889
4904
|
}
|
|
4905
|
+
get element(){
|
|
4906
|
+
return this.__ele__
|
|
4907
|
+
}
|
|
4890
4908
|
get isZikoUIElement(){
|
|
4891
4909
|
return true
|
|
4892
4910
|
}
|
|
@@ -4908,15 +4926,6 @@ class ZikoUIElement {
|
|
|
4908
4926
|
get isBody(){
|
|
4909
4927
|
return this.element === globalThis?.document.body;
|
|
4910
4928
|
}
|
|
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
4929
|
get parent(){
|
|
4921
4930
|
return this.cache.parent;
|
|
4922
4931
|
}
|
|
@@ -4956,6 +4965,120 @@ class ZikoUIElement {
|
|
|
4956
4965
|
this.st.size(width,height);
|
|
4957
4966
|
return this;
|
|
4958
4967
|
}
|
|
4968
|
+
maintain() {
|
|
4969
|
+
for (let i = 0; i < this.items.length; i++)
|
|
4970
|
+
Object.assign(this, { [[i]]: this.items[i] });
|
|
4971
|
+
this.length = this.items.length;
|
|
4972
|
+
return this;
|
|
4973
|
+
}
|
|
4974
|
+
at(index) {
|
|
4975
|
+
return this.items.at(index);
|
|
4976
|
+
}
|
|
4977
|
+
#addItem(adder, pusher, ...ele) {
|
|
4978
|
+
if (this.cache.isFrozzen) {
|
|
4979
|
+
console.warn("You can't append new item to frozzen element");
|
|
4980
|
+
return this;
|
|
4981
|
+
}
|
|
4982
|
+
for (let i = 0; i < ele.length; i++) {
|
|
4983
|
+
if (["number", "string"].includes(typeof ele[i])) ele[i] = text$1(ele[i]);
|
|
4984
|
+
if (ele[i] instanceof ZikoUIElement) {
|
|
4985
|
+
ele[i].cache.parent = this;
|
|
4986
|
+
this.element[adder](ele[i].element);
|
|
4987
|
+
ele[i].target = this.element;
|
|
4988
|
+
this.items[pusher](ele[i]);
|
|
4989
|
+
} else if (ele[i] instanceof Object) {
|
|
4990
|
+
if (ele[i]?.style) this.style(ele[i]?.style);
|
|
4991
|
+
if (ele[i]?.attr) {
|
|
4992
|
+
Object.entries(ele[i].attr).forEach((n) =>
|
|
4993
|
+
this.setAttr("" + n[0], n[1]),
|
|
4994
|
+
);
|
|
4995
|
+
}
|
|
4996
|
+
}
|
|
4997
|
+
}
|
|
4998
|
+
this.maintain();
|
|
4999
|
+
return this;
|
|
5000
|
+
}
|
|
5001
|
+
append(...ele) {
|
|
5002
|
+
this.#addItem("append", "push", ...ele);
|
|
5003
|
+
return this;
|
|
5004
|
+
}
|
|
5005
|
+
prepend(...ele) {
|
|
5006
|
+
this.#addItem("prepend", "unshift", ...ele);
|
|
5007
|
+
return this;
|
|
5008
|
+
}
|
|
5009
|
+
insertAt(index, ...ele) {
|
|
5010
|
+
if (index >= this.element.children.length) this.append(...ele);
|
|
5011
|
+
else
|
|
5012
|
+
for (let i = 0; i < ele.length; i++) {
|
|
5013
|
+
if (["number", "string"].includes(typeof ele[i])) ele[i] = text$1(ele[i]);
|
|
5014
|
+
this.element?.insertBefore(ele[i].element, this.items[index].element);
|
|
5015
|
+
this.items.splice(index, 0, ele[i]);
|
|
5016
|
+
}
|
|
5017
|
+
return this;
|
|
5018
|
+
}
|
|
5019
|
+
remove(...ele) {
|
|
5020
|
+
const remove = (ele) => {
|
|
5021
|
+
if (typeof ele === "number") ele = this.items[ele];
|
|
5022
|
+
if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
|
|
5023
|
+
this.items = this.items.filter((n) => n !== ele);
|
|
5024
|
+
};
|
|
5025
|
+
for (let i = 0; i < ele.length; i++) remove(ele[i]);
|
|
5026
|
+
for (let i = 0; i < this.items.length; i++)
|
|
5027
|
+
Object.assign(this, { [[i]]: this.items[i] });
|
|
5028
|
+
// Remove from item
|
|
5029
|
+
return this;
|
|
5030
|
+
}
|
|
5031
|
+
forEach(callback) {
|
|
5032
|
+
this.items.forEach(callback);
|
|
5033
|
+
return this;
|
|
5034
|
+
}
|
|
5035
|
+
map(callback) {
|
|
5036
|
+
return this.items.map(callback);
|
|
5037
|
+
}
|
|
5038
|
+
find(condition) {
|
|
5039
|
+
return this.items.filter(condition);
|
|
5040
|
+
}
|
|
5041
|
+
filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
|
|
5042
|
+
const FilterItems = this.items.filter(condition_callback);
|
|
5043
|
+
FilterItems.forEach(if_callback);
|
|
5044
|
+
this.items
|
|
5045
|
+
.filter((item) => !FilterItems.includes(item))
|
|
5046
|
+
.forEach(else_callback);
|
|
5047
|
+
return this;
|
|
5048
|
+
}
|
|
5049
|
+
filterByTextContent(text, exactMatch = false) {
|
|
5050
|
+
this.items.forEach((n) => n.render());
|
|
5051
|
+
this.filter(
|
|
5052
|
+
(n) => !(exactMatch ? n.text === text : n.text.includes(text)),
|
|
5053
|
+
(e) => e.unrender(),
|
|
5054
|
+
);
|
|
5055
|
+
// this.items.filter(n=>{
|
|
5056
|
+
// const content=n.element.textContent;
|
|
5057
|
+
// return !(exactMatch?content===text:content.includes(text))
|
|
5058
|
+
// }).map(n=>n.unrender());
|
|
5059
|
+
// return this;
|
|
5060
|
+
}
|
|
5061
|
+
filterByClass(value) {
|
|
5062
|
+
this.items.map((n) => n.render());
|
|
5063
|
+
this.items
|
|
5064
|
+
.filter((n) => !n.classes.includes(value))
|
|
5065
|
+
.map((n) => n.unrender());
|
|
5066
|
+
return this;
|
|
5067
|
+
}
|
|
5068
|
+
sortByTextContent(value, displays) {
|
|
5069
|
+
let item = this.children;
|
|
5070
|
+
item
|
|
5071
|
+
.filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5072
|
+
.map((n) => {
|
|
5073
|
+
n.style.display = "none";
|
|
5074
|
+
});
|
|
5075
|
+
item
|
|
5076
|
+
.filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5077
|
+
.map((n, i) => (n.style.display = displays[i]));
|
|
5078
|
+
//return item.filter(n=>n.style.display!="none")
|
|
5079
|
+
item.filter((n) => n.style.display != "none");
|
|
5080
|
+
return this;
|
|
5081
|
+
}
|
|
4959
5082
|
get #SwitchedStyleRTL_LTR(){
|
|
4960
5083
|
const CalculedStyle = globalThis.getComputedStyle(this.element);
|
|
4961
5084
|
const SwitchedStyle = {};
|
|
@@ -5311,161 +5434,120 @@ class ZikoUIContainerElement extends ZikoUIElement {
|
|
|
5311
5434
|
super(element, name);
|
|
5312
5435
|
this.items = [];
|
|
5313
5436
|
}
|
|
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
|
-
// }
|
|
5437
|
+
// maintain() {
|
|
5438
|
+
// for (let i = 0; i < this.items.length; i++)
|
|
5439
|
+
// Object.assign(this, { [[i]]: this.items[i] });
|
|
5440
|
+
// this.length = this.items.length;
|
|
5441
|
+
// return this;
|
|
5442
|
+
// }
|
|
5443
|
+
// at(index) {
|
|
5444
|
+
// return this.items.at(index);
|
|
5445
|
+
// }
|
|
5446
|
+
// #addItem(adder, pusher, ...ele) {
|
|
5447
|
+
// if (this.cache.isFrozzen) {
|
|
5448
|
+
// console.warn("You can't append new item to frozzen element");
|
|
5449
|
+
// return this;
|
|
5450
|
+
// }
|
|
5451
|
+
// for (let i = 0; i < ele.length; i++) {
|
|
5452
|
+
// if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
|
|
5453
|
+
// if (ele[i] instanceof ZikoUIElement) {
|
|
5454
|
+
// ele[i].cache.parent = this;
|
|
5455
|
+
// this.element[adder](ele[i].element);
|
|
5456
|
+
// ele[i].target = this.element;
|
|
5457
|
+
// this.items[pusher](ele[i]);
|
|
5458
|
+
// } else if (ele[i] instanceof Object) {
|
|
5459
|
+
// if (ele[i]?.style) this.style(ele[i]?.style);
|
|
5460
|
+
// if (ele[i]?.attr) {
|
|
5461
|
+
// Object.entries(ele[i].attr).forEach((n) =>
|
|
5462
|
+
// this.setAttr("" + n[0], n[1]),
|
|
5463
|
+
// );
|
|
5374
5464
|
// }
|
|
5375
5465
|
// }
|
|
5376
|
-
// this.maintain();
|
|
5377
|
-
// return this;
|
|
5378
5466
|
// }
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5467
|
+
// this.maintain();
|
|
5468
|
+
// return this;
|
|
5469
|
+
// }
|
|
5470
|
+
// append(...ele) {
|
|
5471
|
+
// this.#addItem("append", "push", ...ele);
|
|
5472
|
+
// return this;
|
|
5473
|
+
// }
|
|
5474
|
+
// prepend(...ele) {
|
|
5475
|
+
// this.#addItem("prepend", "unshift", ...ele);
|
|
5476
|
+
// return this;
|
|
5477
|
+
// }
|
|
5478
|
+
// insertAt(index, ...ele) {
|
|
5479
|
+
// if (index >= this.element.children.length) this.append(...ele);
|
|
5480
|
+
// else
|
|
5481
|
+
// for (let i = 0; i < ele.length; i++) {
|
|
5482
|
+
// if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
|
|
5483
|
+
// this.element?.insertBefore(ele[i].element, this.items[index].element);
|
|
5484
|
+
// this.items.splice(index, 0, ele[i]);
|
|
5485
|
+
// }
|
|
5486
|
+
// return this;
|
|
5487
|
+
// }
|
|
5389
5488
|
// remove(...ele) {
|
|
5390
|
-
//
|
|
5391
|
-
// if(
|
|
5392
|
-
//
|
|
5393
|
-
//
|
|
5394
|
-
//
|
|
5395
|
-
//
|
|
5396
|
-
//
|
|
5397
|
-
//
|
|
5398
|
-
//
|
|
5399
|
-
//
|
|
5400
|
-
//
|
|
5401
|
-
//
|
|
5402
|
-
//
|
|
5403
|
-
//
|
|
5489
|
+
// const remove = (ele) => {
|
|
5490
|
+
// if (typeof ele === "number") ele = this.items[ele];
|
|
5491
|
+
// if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
|
|
5492
|
+
// this.items = this.items.filter((n) => n !== ele);
|
|
5493
|
+
// };
|
|
5494
|
+
// for (let i = 0; i < ele.length; i++) remove(ele[i]);
|
|
5495
|
+
// for (let i = 0; i < this.items.length; i++)
|
|
5496
|
+
// Object.assign(this, { [[i]]: this.items[i] });
|
|
5497
|
+
// // Remove from item
|
|
5498
|
+
// return this;
|
|
5499
|
+
// }
|
|
5500
|
+
// forEach(callback) {
|
|
5501
|
+
// this.items.forEach(callback);
|
|
5502
|
+
// return this;
|
|
5503
|
+
// }
|
|
5504
|
+
// map(callback) {
|
|
5505
|
+
// return this.items.map(callback);
|
|
5506
|
+
// }
|
|
5507
|
+
// find(condition) {
|
|
5508
|
+
// return this.items.filter(condition);
|
|
5509
|
+
// }
|
|
5510
|
+
// filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
|
|
5511
|
+
// const FilterItems = this.items.filter(condition_callback);
|
|
5512
|
+
// FilterItems.forEach(if_callback);
|
|
5513
|
+
// this.items
|
|
5514
|
+
// .filter((item) => !FilterItems.includes(item))
|
|
5515
|
+
// .forEach(else_callback);
|
|
5516
|
+
// return this;
|
|
5517
|
+
// }
|
|
5518
|
+
// filterByTextContent(text, exactMatch = false) {
|
|
5519
|
+
// this.items.forEach((n) => n.render());
|
|
5520
|
+
// this.filter(
|
|
5521
|
+
// (n) => !(exactMatch ? n.text === text : n.text.includes(text)),
|
|
5522
|
+
// (e) => e.unrender(),
|
|
5523
|
+
// );
|
|
5524
|
+
// // this.items.filter(n=>{
|
|
5525
|
+
// // const content=n.element.textContent;
|
|
5526
|
+
// // return !(exactMatch?content===text:content.includes(text))
|
|
5527
|
+
// // }).map(n=>n.unrender());
|
|
5528
|
+
// // return this;
|
|
5529
|
+
// }
|
|
5530
|
+
// filterByClass(value) {
|
|
5531
|
+
// this.items.map((n) => n.render());
|
|
5532
|
+
// this.items
|
|
5533
|
+
// .filter((n) => !n.classes.includes(value))
|
|
5534
|
+
// .map((n) => n.unrender());
|
|
5535
|
+
// return this;
|
|
5536
|
+
// }
|
|
5537
|
+
// sortByTextContent(value, displays) {
|
|
5538
|
+
// let item = this.children;
|
|
5539
|
+
// item
|
|
5540
|
+
// .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5541
|
+
// .map((n) => {
|
|
5542
|
+
// n.style.display = "none";
|
|
5543
|
+
// });
|
|
5544
|
+
// item
|
|
5545
|
+
// .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5546
|
+
// .map((n, i) => (n.style.display = displays[i]));
|
|
5547
|
+
// //return item.filter(n=>n.style.display!="none")
|
|
5548
|
+
// item.filter((n) => n.style.display != "none");
|
|
5404
5549
|
// return this;
|
|
5405
5550
|
// }
|
|
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
5551
|
}
|
|
5470
5552
|
|
|
5471
5553
|
class __ZikoUIText__ extends ZikoUIContainerElement {
|
|
@@ -6134,6 +6216,186 @@ class ZikoUISVGWrapper extends ZikoUIXMLWrapper{
|
|
|
6134
6216
|
const HTMLWrapper = (HTMLContent) => new ZikoUIHTMLWrapper(HTMLContent);
|
|
6135
6217
|
const SVGWrapper = (SVGContent) => new ZikoUISVGWrapper(SVGContent);
|
|
6136
6218
|
|
|
6219
|
+
// function loadComponent() {
|
|
6220
|
+
// return new Promise((resolve) => {
|
|
6221
|
+
// setTimeout(() => {
|
|
6222
|
+
// resolve(p(1000))
|
|
6223
|
+
// }, 500);
|
|
6224
|
+
// });
|
|
6225
|
+
// }
|
|
6226
|
+
|
|
6227
|
+
// Suspense(p("Loading ..."),()=>fetch('https://jsonplaceholder.typicode.com/todos/1')
|
|
6228
|
+
// .then(response => response.json())
|
|
6229
|
+
// .then(json => h2(json.title)))
|
|
6230
|
+
|
|
6231
|
+
|
|
6232
|
+
|
|
6233
|
+
class ZikoUISuspense extends ZikoUIElement{
|
|
6234
|
+
constructor(fallback_ui, callback){
|
|
6235
|
+
super("div", "suspense");
|
|
6236
|
+
this.setAttr({
|
|
6237
|
+
dataTemp : "suspense"
|
|
6238
|
+
});
|
|
6239
|
+
this.fallback_ui = fallback_ui;
|
|
6240
|
+
this.append(fallback_ui);
|
|
6241
|
+
(async ()=>{
|
|
6242
|
+
try{
|
|
6243
|
+
const ui = await callback();
|
|
6244
|
+
fallback_ui.unrender();
|
|
6245
|
+
this.append(ui);
|
|
6246
|
+
// console.log(content)
|
|
6247
|
+
}
|
|
6248
|
+
catch(error){
|
|
6249
|
+
console.log({error});
|
|
6250
|
+
}
|
|
6251
|
+
})();
|
|
6252
|
+
}
|
|
6253
|
+
}
|
|
6254
|
+
|
|
6255
|
+
const Suspense = (fallback_ui, callback) => new ZikoUISuspense(fallback_ui, callback);
|
|
6256
|
+
|
|
6257
|
+
const _h=(tag, type, attributes, ...children)=>{
|
|
6258
|
+
const { name, style, ...attrs } = attributes;
|
|
6259
|
+
let element = new ZikoUIElement(tag, name, type);
|
|
6260
|
+
style && element.style(style);
|
|
6261
|
+
attrs && element.setAttr(attrs);
|
|
6262
|
+
children && element.append(...children);
|
|
6263
|
+
return element;
|
|
6264
|
+
};
|
|
6265
|
+
const h=(tag, attributes = {}, ...children)=> _h(tag, "html", attributes, ...children);
|
|
6266
|
+
const s=(tag, attributes = {}, ...children)=> _h(tag, "svg", attributes, ...children);
|
|
6267
|
+
|
|
6268
|
+
const HTMLTags = [
|
|
6269
|
+
'a',
|
|
6270
|
+
'abb',
|
|
6271
|
+
'address',
|
|
6272
|
+
'area',
|
|
6273
|
+
'article',
|
|
6274
|
+
'aside',
|
|
6275
|
+
'audio',
|
|
6276
|
+
'b',
|
|
6277
|
+
'base',
|
|
6278
|
+
'bdi',
|
|
6279
|
+
'bdo',
|
|
6280
|
+
'blockquote',
|
|
6281
|
+
'br',
|
|
6282
|
+
'button',
|
|
6283
|
+
'canvas',
|
|
6284
|
+
'caption',
|
|
6285
|
+
'cite',
|
|
6286
|
+
'code',
|
|
6287
|
+
'col',
|
|
6288
|
+
'colgroup',
|
|
6289
|
+
'data',
|
|
6290
|
+
'datalist',
|
|
6291
|
+
'dd',
|
|
6292
|
+
'del',
|
|
6293
|
+
'details',
|
|
6294
|
+
'dfn',
|
|
6295
|
+
'dialog',
|
|
6296
|
+
'div',
|
|
6297
|
+
'dl',
|
|
6298
|
+
'dt',
|
|
6299
|
+
'em',
|
|
6300
|
+
'embed',
|
|
6301
|
+
'fieldset',
|
|
6302
|
+
'figcaption',
|
|
6303
|
+
'figure',
|
|
6304
|
+
'footer',
|
|
6305
|
+
'form',
|
|
6306
|
+
'h1',
|
|
6307
|
+
'h2',
|
|
6308
|
+
'h3',
|
|
6309
|
+
'h4',
|
|
6310
|
+
'h5',
|
|
6311
|
+
'h6',
|
|
6312
|
+
'header',
|
|
6313
|
+
'hgroup',
|
|
6314
|
+
'hr',
|
|
6315
|
+
'i',
|
|
6316
|
+
'iframe',
|
|
6317
|
+
'img',
|
|
6318
|
+
'ipnut',
|
|
6319
|
+
'ins',
|
|
6320
|
+
'kbd',
|
|
6321
|
+
'label',
|
|
6322
|
+
'legend',
|
|
6323
|
+
'li',
|
|
6324
|
+
'main',
|
|
6325
|
+
'map',
|
|
6326
|
+
'mark',
|
|
6327
|
+
'menu',
|
|
6328
|
+
'meter',
|
|
6329
|
+
'nav',
|
|
6330
|
+
'object',
|
|
6331
|
+
'ol',
|
|
6332
|
+
'optgroup',
|
|
6333
|
+
'option',
|
|
6334
|
+
'output',
|
|
6335
|
+
'p',
|
|
6336
|
+
'param',
|
|
6337
|
+
'picture',
|
|
6338
|
+
'pre',
|
|
6339
|
+
'progress',
|
|
6340
|
+
'q',
|
|
6341
|
+
'rp',
|
|
6342
|
+
'rt',
|
|
6343
|
+
'ruby',
|
|
6344
|
+
's',
|
|
6345
|
+
'samp',
|
|
6346
|
+
'search',
|
|
6347
|
+
'section',
|
|
6348
|
+
'select',
|
|
6349
|
+
'small',
|
|
6350
|
+
'source',
|
|
6351
|
+
'span',
|
|
6352
|
+
'strong',
|
|
6353
|
+
'sub',
|
|
6354
|
+
'summary',
|
|
6355
|
+
'sup',
|
|
6356
|
+
'svg',
|
|
6357
|
+
'table',
|
|
6358
|
+
'tbody',
|
|
6359
|
+
'td',
|
|
6360
|
+
'template',
|
|
6361
|
+
'textarea',
|
|
6362
|
+
'tfoot',
|
|
6363
|
+
'th',
|
|
6364
|
+
'thead',
|
|
6365
|
+
'time',
|
|
6366
|
+
'title',
|
|
6367
|
+
'tr',
|
|
6368
|
+
'track',
|
|
6369
|
+
'u',
|
|
6370
|
+
'ul',
|
|
6371
|
+
'var',
|
|
6372
|
+
'video',
|
|
6373
|
+
'wbr'
|
|
6374
|
+
];
|
|
6375
|
+
|
|
6376
|
+
const SVGTags = [
|
|
6377
|
+
"svg", "g", "defs", "symbol", "use", "image", "switch",
|
|
6378
|
+
"rect", "circle", "ellipse", "line", "polyline", "polygon", "path",
|
|
6379
|
+
"text", "tspan", "textPath", "altGlyph", "altGlyphDef", "altGlyphItem", "glyph", "glyphRef",
|
|
6380
|
+
"linearGradient", "radialGradient", "pattern", "solidColor",
|
|
6381
|
+
"filter", "feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix",
|
|
6382
|
+
"feDiffuseLighting", "feDisplacementMap", "feDropShadow", "feFlood", "feFuncA", "feFuncR", "feFuncG", "feFuncB",
|
|
6383
|
+
"feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "feSpecularLighting",
|
|
6384
|
+
"feTile", "feTurbulence",
|
|
6385
|
+
"animate", "animateMotion", "animateTransform", "set",
|
|
6386
|
+
"script",
|
|
6387
|
+
"desc", "title", "metadata", "foreignObject"
|
|
6388
|
+
];
|
|
6389
|
+
|
|
6390
|
+
const hTags = HTMLTags.reduce((acc, key) => {
|
|
6391
|
+
acc[key] = (attr, ...children) => h(key, attr, ...children);
|
|
6392
|
+
return acc;
|
|
6393
|
+
}, {});
|
|
6394
|
+
const sTags = SVGTags.reduce((acc, key) => {
|
|
6395
|
+
acc[key] = (attr, ...children) => h(key, attr, ...children);
|
|
6396
|
+
return acc;
|
|
6397
|
+
}, {});
|
|
6398
|
+
|
|
6137
6399
|
class ZikoUIHtmlTag extends ZikoUIContainerElement {
|
|
6138
6400
|
constructor(element) {
|
|
6139
6401
|
super(element,"html");
|
|
@@ -6224,20 +6486,26 @@ var Misc = /*#__PURE__*/Object.freeze({
|
|
|
6224
6486
|
__proto__: null,
|
|
6225
6487
|
HTMLWrapper: HTMLWrapper,
|
|
6226
6488
|
SVGWrapper: SVGWrapper,
|
|
6489
|
+
Suspense: Suspense,
|
|
6227
6490
|
ZikoUIBr: ZikoUIBr,
|
|
6228
6491
|
ZikoUIHTMLWrapper: ZikoUIHTMLWrapper,
|
|
6229
6492
|
ZikoUIHr: ZikoUIHr,
|
|
6230
6493
|
ZikoUIHtmlTag: ZikoUIHtmlTag,
|
|
6231
6494
|
ZikoUILink: ZikoUILink,
|
|
6232
6495
|
ZikoUISVGWrapper: ZikoUISVGWrapper,
|
|
6496
|
+
ZikoUISuspense: ZikoUISuspense,
|
|
6233
6497
|
ZikoUIXMLWrapper: ZikoUIXMLWrapper,
|
|
6234
6498
|
br: br,
|
|
6235
6499
|
brs: brs,
|
|
6236
6500
|
btn: btn,
|
|
6501
|
+
h: h,
|
|
6502
|
+
hTags: hTags,
|
|
6237
6503
|
hr: hr,
|
|
6238
6504
|
hrs: hrs,
|
|
6239
6505
|
html: html,
|
|
6240
|
-
link: link
|
|
6506
|
+
link: link,
|
|
6507
|
+
s: s,
|
|
6508
|
+
sTags: sTags
|
|
6241
6509
|
});
|
|
6242
6510
|
|
|
6243
6511
|
class ZikoUIInputImage extends ZikoUIElement {
|
|
@@ -11643,7 +11911,7 @@ exports.Main = Main;
|
|
|
11643
11911
|
exports.Matrix = Matrix;
|
|
11644
11912
|
exports.Modal = Modal;
|
|
11645
11913
|
exports.Nav = Nav;
|
|
11646
|
-
exports.PI = PI;
|
|
11914
|
+
exports.PI = PI$1;
|
|
11647
11915
|
exports.Permutation = Permutation;
|
|
11648
11916
|
exports.Random = Random;
|
|
11649
11917
|
exports.SPA = SPA;
|
|
@@ -11652,6 +11920,7 @@ exports.Section = Section;
|
|
|
11652
11920
|
exports.Slider = Slider;
|
|
11653
11921
|
exports.Splitter = Splitter;
|
|
11654
11922
|
exports.Str = Str;
|
|
11923
|
+
exports.Suspense = Suspense;
|
|
11655
11924
|
exports.Svg = Svg;
|
|
11656
11925
|
exports.Table = Table$1;
|
|
11657
11926
|
exports.Tabs = Tabs;
|
|
@@ -11737,6 +12006,7 @@ exports.ZikoUISection = ZikoUISection;
|
|
|
11737
12006
|
exports.ZikoUISelect = ZikoUISelect;
|
|
11738
12007
|
exports.ZikoUISubText = ZikoUISubText;
|
|
11739
12008
|
exports.ZikoUISupText = ZikoUISupText;
|
|
12009
|
+
exports.ZikoUISuspense = ZikoUISuspense;
|
|
11740
12010
|
exports.ZikoUISvg = ZikoUISvg;
|
|
11741
12011
|
exports.ZikoUIText = ZikoUIText;
|
|
11742
12012
|
exports.ZikoUITextArea = ZikoUITextArea;
|
|
@@ -11808,6 +12078,7 @@ exports.figure = figure;
|
|
|
11808
12078
|
exports.floor = floor;
|
|
11809
12079
|
exports.gamma = gamma;
|
|
11810
12080
|
exports.geomspace = geomspace;
|
|
12081
|
+
exports.h = h;
|
|
11811
12082
|
exports.h1 = h1;
|
|
11812
12083
|
exports.h2 = h2;
|
|
11813
12084
|
exports.h3 = h3;
|
|
@@ -11816,6 +12087,7 @@ exports.h5 = h5;
|
|
|
11816
12087
|
exports.h6 = h6;
|
|
11817
12088
|
exports.hSlider = hSlider;
|
|
11818
12089
|
exports.hSplitter = hSplitter;
|
|
12090
|
+
exports.hTags = hTags;
|
|
11819
12091
|
exports.hr = hr;
|
|
11820
12092
|
exports.hrs = hrs;
|
|
11821
12093
|
exports.html = html;
|
|
@@ -11880,6 +12152,8 @@ exports.rad2deg = rad2deg;
|
|
|
11880
12152
|
exports.radio = radio;
|
|
11881
12153
|
exports.removeExtraSpace = removeExtraSpace;
|
|
11882
12154
|
exports.round = round;
|
|
12155
|
+
exports.s = s;
|
|
12156
|
+
exports.sTags = sTags;
|
|
11883
12157
|
exports.search = search;
|
|
11884
12158
|
exports.sec = sec;
|
|
11885
12159
|
exports.select = select;
|