ziko 0.0.1
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/LICENSE +21 -0
- package/README.md +316 -0
- package/dist/ziko.cjs +9786 -0
- package/dist/ziko.js +9792 -0
- package/dist/ziko.min.js +9 -0
- package/dist/ziko.mjs +9567 -0
- package/package.json +55 -0
- package/src/App/Accessibility/index.js +0 -0
- package/src/App/Globals/__Target__.js +3 -0
- package/src/App/Globals/__UI__.js +38 -0
- package/src/App/Globals/__init__.js +8 -0
- package/src/App/Globals/index.js +3 -0
- package/src/App/Router/index.js +40 -0
- package/src/App/Seo/index.js +43 -0
- package/src/App/Themes/dark.js +885 -0
- package/src/App/Themes/index.js +11 -0
- package/src/App/Themes/light.js +255 -0
- package/src/App/app.js +37 -0
- package/src/App/index.js +11 -0
- package/src/Data/Api/fetchdom.js +14 -0
- package/src/Data/Api/index.js +4 -0
- package/src/Data/Api/preload.js +11 -0
- package/src/Data/Converter/canvas.js +25 -0
- package/src/Data/Converter/csv.js +33 -0
- package/src/Data/Converter/index.js +25 -0
- package/src/Data/Converter/json.js +80 -0
- package/src/Data/Converter/markdown.js +83 -0
- package/src/Data/Converter/svg.js +11 -0
- package/src/Data/Parser/markdown.js +0 -0
- package/src/Data/Parser/xml.js +47 -0
- package/src/Data/Strings/index.js +26 -0
- package/src/Data/decorators.js +0 -0
- package/src/Data/index.js +64 -0
- package/src/Graphics/Canvas/Elements/Basic/arc.js +43 -0
- package/src/Graphics/Canvas/Elements/Basic/image.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/line.js +26 -0
- package/src/Graphics/Canvas/Elements/Basic/path.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/points.js +48 -0
- package/src/Graphics/Canvas/Elements/Basic/polygon.js +7 -0
- package/src/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/rect.js +46 -0
- package/src/Graphics/Canvas/Elements/Basic/text.js +0 -0
- package/src/Graphics/Canvas/Elements/Chart/histogram.js +0 -0
- package/src/Graphics/Canvas/Elements/Chart/plot.js +0 -0
- package/src/Graphics/Canvas/Elements/Chart/scatter.js +2 -0
- package/src/Graphics/Canvas/Elements/Chart/stem.js +0 -0
- package/src/Graphics/Canvas/Elements/Element.js +115 -0
- package/src/Graphics/Canvas/Elements/Groupe.js +0 -0
- package/src/Graphics/Canvas/Elements/grid.js +0 -0
- package/src/Graphics/Canvas/Elements/index.js +13 -0
- package/src/Graphics/Canvas/Filter/index.js +0 -0
- package/src/Graphics/Canvas/Paint/index.js +0 -0
- package/src/Graphics/Canvas/Utils/color.js +8 -0
- package/src/Graphics/Canvas/Utils/floodFill.js +58 -0
- package/src/Graphics/Canvas/_canvas_offscreen +0 -0
- package/src/Graphics/Canvas/canvas.js +189 -0
- package/src/Graphics/Canvas/index.js +15 -0
- package/src/Graphics/Svg/Elements/ZikoSvgElement.js +28 -0
- package/src/Graphics/Svg/Elements/circle.js +34 -0
- package/src/Graphics/Svg/Elements/ellipse.js +29 -0
- package/src/Graphics/Svg/Elements/foreignObject.js +46 -0
- package/src/Graphics/Svg/Elements/grid.js +9 -0
- package/src/Graphics/Svg/Elements/groupe.js +29 -0
- package/src/Graphics/Svg/Elements/image.js +33 -0
- package/src/Graphics/Svg/Elements/line.js +29 -0
- package/src/Graphics/Svg/Elements/path.js +59 -0
- package/src/Graphics/Svg/Elements/polygon.js +31 -0
- package/src/Graphics/Svg/Elements/polyline.js +4 -0
- package/src/Graphics/Svg/Elements/rect.js +43 -0
- package/src/Graphics/Svg/Elements/text.js +26 -0
- package/src/Graphics/Svg/index.js +1 -0
- package/src/Graphics/Svg/svg.js +117 -0
- package/src/Graphics/index.js +61 -0
- package/src/Math/Calculus/Special Functions/bessel.js +31 -0
- package/src/Math/Calculus/Special Functions/beta.js +38 -0
- package/src/Math/Calculus/Special Functions/gamma.js +30 -0
- package/src/Math/Calculus/Special Functions/index.js +4 -0
- package/src/Math/Calculus/index.js +1 -0
- package/src/Math/Complex/Fractals/julia.js +0 -0
- package/src/Math/Complex/index.js +191 -0
- package/src/Math/Discret/Combinaison/index.js +34 -0
- package/src/Math/Discret/Conversion/index.js +86 -0
- package/src/Math/Discret/Logic/index.js +46 -0
- package/src/Math/Discret/Permutation/index.js +31 -0
- package/src/Math/Discret/Set/index.js +2 -0
- package/src/Math/Discret/Set/powerSet.js +15 -0
- package/src/Math/Discret/Set/subSet.js +10 -0
- package/src/Math/Discret/index.js +23 -0
- package/src/Math/Functions/index.js +182 -0
- package/src/Math/Matrix/Decomposition.js +90 -0
- package/src/Math/Matrix/LinearSystem.js +10 -0
- package/src/Math/Matrix/Matrix.js +712 -0
- package/src/Math/Matrix/index.js +3 -0
- package/src/Math/Numeric/index.js +0 -0
- package/src/Math/Random/index.js +173 -0
- package/src/Math/Signal/__np.py.txt +40 -0
- package/src/Math/Signal/conv.js +175 -0
- package/src/Math/Signal/fft.js +55 -0
- package/src/Math/Signal/filter.js +39 -0
- package/src/Math/Signal/functions.js +146 -0
- package/src/Math/Signal/index.js +110 -0
- package/src/Math/Statistics/Functions/index.js +100 -0
- package/src/Math/Statistics/index.js +16 -0
- package/src/Math/Utils/arithmetic.js +139 -0
- package/src/Math/Utils/checkers.js +11 -0
- package/src/Math/Utils/comparaison.js +1 -0
- package/src/Math/Utils/conversions.js +7 -0
- package/src/Math/Utils/discret.js +28 -0
- package/src/Math/Utils/index.js +102 -0
- package/src/Math/Utils/mapfun.js +43 -0
- package/src/Math/absract.js +1 -0
- package/src/Math/const.js +3 -0
- package/src/Math/index.js +193 -0
- package/src/Reactivity/Events/Global/Click.js +56 -0
- package/src/Reactivity/Events/Global/Clipboard.js +84 -0
- package/src/Reactivity/Events/Global/CustomEvent.js +53 -0
- package/src/Reactivity/Events/Global/Drag.js +137 -0
- package/src/Reactivity/Events/Global/Focus.js +56 -0
- package/src/Reactivity/Events/Global/Key.js +104 -0
- package/src/Reactivity/Events/Global/Pointer.js +214 -0
- package/src/Reactivity/Events/Partiel/Input.js +59 -0
- package/src/Reactivity/Events/ZikoEvent.js +91 -0
- package/src/Reactivity/Events/index.js +51 -0
- package/src/Reactivity/Observer/index.js +3 -0
- package/src/Reactivity/Observer/intersection.js +40 -0
- package/src/Reactivity/Observer/mutation.js +90 -0
- package/src/Reactivity/Observer/resize.js +47 -0
- package/src/Reactivity/Use/Contexte/index.js +1 -0
- package/src/Reactivity/Use/Contexte/useSuccesifKeys.js +14 -0
- package/src/Reactivity/Use/Decorators/index.js +4 -0
- package/src/Reactivity/Use/Interactions/index.js +4 -0
- package/src/Reactivity/Use/Interactions/useBluetooth.js +48 -0
- package/src/Reactivity/Use/Interactions/useChannel.js +50 -0
- package/src/Reactivity/Use/Interactions/useEventEmmiter.js +64 -0
- package/src/Reactivity/Use/Interactions/useSerial.js +0 -0
- package/src/Reactivity/Use/Interactions/useThread.js +44 -0
- package/src/Reactivity/Use/Interactions/useUsb.js +0 -0
- package/src/Reactivity/Use/Sensors/index.js +2 -0
- package/src/Reactivity/Use/Sensors/useBattery.js +36 -0
- package/src/Reactivity/Use/Sensors/useCamera.js +0 -0
- package/src/Reactivity/Use/Sensors/useGeolocation.js +17 -0
- package/src/Reactivity/Use/Sensors/useMicro.js +0 -0
- package/src/Reactivity/Use/Sensors/useOrientation.js +0 -0
- package/src/Reactivity/Use/Storage/index.js +1 -0
- package/src/Reactivity/Use/Storage/useCookie.js +0 -0
- package/src/Reactivity/Use/Storage/useIndexedDb.js +0 -0
- package/src/Reactivity/Use/Storage/useStorage.js +74 -0
- package/src/Reactivity/Use/UI/index.js +4 -0
- package/src/Reactivity/Use/UI/useCssLink.js +0 -0
- package/src/Reactivity/Use/UI/useCssText.js +21 -0
- package/src/Reactivity/Use/UI/useFavIcon.js +38 -0
- package/src/Reactivity/Use/UI/useLinearGradient.js +0 -0
- package/src/Reactivity/Use/UI/useMediaQuery.js +1 -0
- package/src/Reactivity/Use/UI/useRadialGradient.js +0 -0
- package/src/Reactivity/Use/UI/useStyle.js +54 -0
- package/src/Reactivity/Use/UI/useTheme.js +62 -0
- package/src/Reactivity/Use/UI/useTitle.js +30 -0
- package/src/Reactivity/Use/index.js +82 -0
- package/src/Reactivity/Use/todo.md +26 -0
- package/src/Reactivity/index.js +3 -0
- package/src/Time/animation.js +76 -0
- package/src/Time/index.js +54 -0
- package/src/Time/loop.js +83 -0
- package/src/Time/utils/decorators.js +17 -0
- package/src/Time/utils/ease.js +144 -0
- package/src/Time/utils/index.js +18 -0
- package/src/Time/utils/performance.js +16 -0
- package/src/Time/utils/ui.js +26 -0
- package/src/UI/CustomElement/Elements/Accordion/index.js +62 -0
- package/src/UI/CustomElement/Elements/Carousel/index.js +47 -0
- package/src/UI/CustomElement/Elements/CodeNote/CodeCell.js +176 -0
- package/src/UI/CustomElement/Elements/CodeNote/CodeNote.js +69 -0
- package/src/UI/CustomElement/Elements/CodeNote/SubElements.js +64 -0
- package/src/UI/CustomElement/Elements/CodeNote/index.js +2 -0
- package/src/UI/CustomElement/Elements/Columns.js +1 -0
- package/src/UI/CustomElement/Elements/FAB.js +0 -0
- package/src/UI/CustomElement/Elements/Menu.js +0 -0
- package/src/UI/CustomElement/Elements/Notification.js +0 -0
- package/src/UI/CustomElement/Elements/Popover.js +0 -0
- package/src/UI/CustomElement/Elements/Popup.js +0 -0
- package/src/UI/CustomElement/Elements/Swipper.js +4 -0
- package/src/UI/CustomElement/Elements/Tabs/index.js +111 -0
- package/src/UI/CustomElement/Elements/Timeline.js +0 -0
- package/src/UI/CustomElement/Elements/Toast.js +0 -0
- package/src/UI/CustomElement/Elements/Treeview.js +0 -0
- package/src/UI/CustomElement/Elements/index.js +4 -0
- package/src/UI/CustomElement/Flex.js +97 -0
- package/src/UI/CustomElement/Grid.js +30 -0
- package/src/UI/CustomElement/index.js +3 -0
- package/src/UI/Embaded/index.js +1 -0
- package/src/UI/Inputs/Primitives/btn.js +31 -0
- package/src/UI/Inputs/Primitives/elements.js +28 -0
- package/src/UI/Inputs/Primitives/inputs.js +334 -0
- package/src/UI/Inputs/Primitives/select.js +15 -0
- package/src/UI/Inputs/Primitives/textarea.js +16 -0
- package/src/UI/Inputs/camera.js +23 -0
- package/src/UI/Inputs/index.js +20 -0
- package/src/UI/List/elements.js +0 -0
- package/src/UI/List/index.js +130 -0
- package/src/UI/Media/Audio/index.js +26 -0
- package/src/UI/Media/Image/figure.js +17 -0
- package/src/UI/Media/Image/image.js +34 -0
- package/src/UI/Media/Image/index.js +2 -0
- package/src/UI/Media/Video/index.js +37 -0
- package/src/UI/Media/index.js +3 -0
- package/src/UI/Misc/index.js +49 -0
- package/src/UI/Semantic/index.js +68 -0
- package/src/UI/Style/index.js +499 -0
- package/src/UI/Table/elements.js +94 -0
- package/src/UI/Table/index.js +3 -0
- package/src/UI/Table/table.js +113 -0
- package/src/UI/Table/utils.js +12 -0
- package/src/UI/Text/heading.js +35 -0
- package/src/UI/Text/index.js +3 -0
- package/src/UI/Text/p.js +37 -0
- package/src/UI/Text/pre.js +0 -0
- package/src/UI/Text/text.js +66 -0
- package/src/UI/Utils/index.js +70 -0
- package/src/UI/ZikoUIElement.js +478 -0
- package/src/UI/index.js +154 -0
- package/src/__proto__/Array.js +74 -0
- package/src/__proto__/Function.js +0 -0
- package/src/__proto__/Number.js +76 -0
- package/src/__proto__/Object.js +0 -0
- package/src/__proto__/String.js +0 -0
- package/src/index.js +69 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
class ZikoUIHtmlTag extends ZikoUIElement {
|
|
3
|
+
constructor(element) {
|
|
4
|
+
super(element,"ZikoHtml");
|
|
5
|
+
this.render();
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class ZikoUIBr extends ZikoUIElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super("br","br");
|
|
11
|
+
this.render();
|
|
12
|
+
delete this.append
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
class ZikoUIHr extends ZikoUIElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super("hr","hr");
|
|
18
|
+
this.render();
|
|
19
|
+
delete this.append
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class ZikoUILink extends ZikoUIElement{
|
|
23
|
+
constructor(href){
|
|
24
|
+
super("a","link");
|
|
25
|
+
this.setHref(href);
|
|
26
|
+
this.render();
|
|
27
|
+
}
|
|
28
|
+
setHref(href){
|
|
29
|
+
this.element.href=href;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const br = () => new ZikoUIBr();
|
|
33
|
+
const hr = () => new ZikoUIHr();
|
|
34
|
+
const brs = (n=1)=> new Array(n).fill(new ZikoUIBr());
|
|
35
|
+
const hrs = (n=1)=> new Array(n).fill(new ZikoUIHr());
|
|
36
|
+
const link=(href,...UIElement)=>new ZikoUILink(href).append(...UIElement);
|
|
37
|
+
const ZikoHtml=(tag,...UIElement)=>new ZikoUIHtmlTag(tag).append(...UIElement);
|
|
38
|
+
export{
|
|
39
|
+
ZikoHtml,
|
|
40
|
+
br,
|
|
41
|
+
hr,
|
|
42
|
+
brs,
|
|
43
|
+
hrs,
|
|
44
|
+
link,
|
|
45
|
+
ZikoUIHtmlTag,
|
|
46
|
+
ZikoUIBr,
|
|
47
|
+
ZikoUIHr,
|
|
48
|
+
ZikoUILink
|
|
49
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
class ZikoUIMain extends ZikoUIElement{
|
|
3
|
+
constructor(){
|
|
4
|
+
super("main","Main");
|
|
5
|
+
this.render();
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class ZikoUIHeader extends ZikoUIElement{
|
|
9
|
+
constructor(){
|
|
10
|
+
super("header","Header");
|
|
11
|
+
this.render();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class ZikoUINav extends ZikoUIElement{
|
|
15
|
+
constructor(){
|
|
16
|
+
super("nav","Nav");
|
|
17
|
+
this.render();
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class ZikoUISection extends ZikoUIElement{
|
|
21
|
+
constructor(){
|
|
22
|
+
super("section","Section");
|
|
23
|
+
this.style({position:"relative"})
|
|
24
|
+
this.render();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
class ZikoUIArticle extends ZikoUIElement{
|
|
28
|
+
constructor(){
|
|
29
|
+
super("article","Article");
|
|
30
|
+
this.render();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
class ZikoUIAside extends ZikoUIElement{
|
|
34
|
+
constructor(){
|
|
35
|
+
super("aside","Aside");
|
|
36
|
+
this.render();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class ZikoUIFooter extends ZikoUIElement{
|
|
40
|
+
constructor(){
|
|
41
|
+
super("footer","Footer");
|
|
42
|
+
this.element=document.createElement("footer");
|
|
43
|
+
this.render();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const Section = (...ZikoUIElement) => new ZikoUISection().append(...ZikoUIElement);
|
|
47
|
+
const Article = (...ZikoUIElement) => new ZikoUIArticle().append(...ZikoUIElement);
|
|
48
|
+
const Main = (...ZikoUIElement) => new ZikoUIMain().append(...ZikoUIElement);
|
|
49
|
+
const Header = (...ZikoUIElement) => new ZikoUIHeader().append(...ZikoUIElement);
|
|
50
|
+
const Footer = (...ZikoUIElement) => new ZikoUIFooter().append(...ZikoUIElement);
|
|
51
|
+
const Nav = (...ZikoUIElement) => new ZikoUINav().append(...ZikoUIElement);
|
|
52
|
+
const Aside = (...ZikoUIElement) => new ZikoUIAside().append(...ZikoUIElement);
|
|
53
|
+
export{
|
|
54
|
+
Header,
|
|
55
|
+
Main,
|
|
56
|
+
Section,
|
|
57
|
+
Article,
|
|
58
|
+
Aside,
|
|
59
|
+
Nav,
|
|
60
|
+
Footer,
|
|
61
|
+
ZikoUIHeader,
|
|
62
|
+
ZikoUIMain,
|
|
63
|
+
ZikoUISection,
|
|
64
|
+
ZikoUIArticle,
|
|
65
|
+
ZikoUIAside,
|
|
66
|
+
ZikoUINav,
|
|
67
|
+
ZikoUIFooter
|
|
68
|
+
}
|
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
import { style , addSuffixeToNumber } from "../Utils/index.js";
|
|
2
|
+
import { Matrix,cos,sin} from "../../Math/index.js";
|
|
3
|
+
class ZikoUIElementStyle{
|
|
4
|
+
constructor(defaultStyle={}){
|
|
5
|
+
this.target=null;
|
|
6
|
+
this.styles=new Map(
|
|
7
|
+
[["default",defaultStyle]]
|
|
8
|
+
);
|
|
9
|
+
this.cache={
|
|
10
|
+
isHidden:false,
|
|
11
|
+
isFaddedOut:false,
|
|
12
|
+
transformation:{
|
|
13
|
+
Flip:[0,0,0],
|
|
14
|
+
matrix:new Matrix([
|
|
15
|
+
[1,0,0,0],
|
|
16
|
+
[0,1,0,0],
|
|
17
|
+
[0,0,1,0],
|
|
18
|
+
[0,0,0,1]
|
|
19
|
+
])
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
style(styles,{target = "parent", maskVector = null } = {}){
|
|
24
|
+
if (target === "parent" || target === 0)style(this.target.element, styles);
|
|
25
|
+
else if(target === "parent" || target === 0){
|
|
26
|
+
if (maskVector) {
|
|
27
|
+
this.items.map((n, i) => maskVector[i] == 1 && n.style(styles));
|
|
28
|
+
}
|
|
29
|
+
else this.items.map((n) => n.style(styles));
|
|
30
|
+
}
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
linkTo(target){
|
|
34
|
+
this.target=target;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
use(name="default"){
|
|
38
|
+
this.style(this.styles.get(name));
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
update(name,styles){
|
|
42
|
+
const old=this.styles.get(name);
|
|
43
|
+
old?this.styles.set(name,Object.assign(old,styles)):this.styles.set(name,styles);
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
add(name,styles){
|
|
47
|
+
this.styles.set(name,styles);
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
replace(name,styles){
|
|
51
|
+
this.styles.set(name,styles);
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
delete(...names){
|
|
55
|
+
names.forEach(n=>this.styles.delete(n));
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
updateDefaultStyle(){
|
|
59
|
+
const defaultStyle=Object.fromEntries(
|
|
60
|
+
Object.entries(this.target.element.style).filter(n=>isNaN(+n[0]))
|
|
61
|
+
)
|
|
62
|
+
this.update("default",defaultStyle);
|
|
63
|
+
return this;
|
|
64
|
+
}
|
|
65
|
+
hover(styles){
|
|
66
|
+
//this.updateDefaultStyle()
|
|
67
|
+
if(styles)this.add("hover",styles)
|
|
68
|
+
this.target.element.addEventListener("pointerenter",()=>this.use("hover"));
|
|
69
|
+
this.target.element.addEventListener("pointerleave",()=>this.use("default"))
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
// Checkers
|
|
73
|
+
isInline(){
|
|
74
|
+
return getComputedStyle(this.target.element).display.includes("inline");
|
|
75
|
+
}
|
|
76
|
+
isBlock(){
|
|
77
|
+
return !(this.isInline());
|
|
78
|
+
}
|
|
79
|
+
// Size
|
|
80
|
+
size(width,height,{ target, maskVector } = {}){
|
|
81
|
+
this.style({
|
|
82
|
+
width,
|
|
83
|
+
height
|
|
84
|
+
},{ target, maskVector })
|
|
85
|
+
return this;
|
|
86
|
+
}
|
|
87
|
+
width(w,{ target, maskVector } = {}){
|
|
88
|
+
if(w instanceof Object){
|
|
89
|
+
if(w instanceof Array)w={min:w[0],max:w[1]}
|
|
90
|
+
if("min" in w || "max" in w){
|
|
91
|
+
let min= w.min ?? w.max;
|
|
92
|
+
let max= w.max ?? w.min;
|
|
93
|
+
min=addSuffixeToNumber(min,"px");
|
|
94
|
+
max=addSuffixeToNumber(max,"px");
|
|
95
|
+
this.style({ minWidth: min, maxWidth: max }, { target, maskVector });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
w=addSuffixeToNumber(w,"px");
|
|
100
|
+
this.style({width:w},{ target, maskVector });
|
|
101
|
+
}
|
|
102
|
+
return this
|
|
103
|
+
}
|
|
104
|
+
height(h,{ target, maskVector } = {}){
|
|
105
|
+
if(h instanceof Object){
|
|
106
|
+
if(h instanceof Array)h={min:h[0],max:h[1]}
|
|
107
|
+
if("min" in h || "max" in h){
|
|
108
|
+
let min= h.min ?? h.max;
|
|
109
|
+
let max= h.max ?? h.min;
|
|
110
|
+
min=addSuffixeToNumber(min,"px");
|
|
111
|
+
max=addSuffixeToNumber(max,"px");
|
|
112
|
+
this.style({ minHeight: min, maxHeight: max }, { target, maskVector });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
h=addSuffixeToNumber(h,"px");
|
|
117
|
+
this.style({height:h},{ target, maskVector });
|
|
118
|
+
}
|
|
119
|
+
return this
|
|
120
|
+
}
|
|
121
|
+
enableResize(h=false,v=false,{ target, maskVector } = {}){
|
|
122
|
+
let resize="none";
|
|
123
|
+
if(h)v?resize="both":resize="horizontal";
|
|
124
|
+
else v?resize="vertical":resize="none";
|
|
125
|
+
this.style({
|
|
126
|
+
resize,
|
|
127
|
+
overflow:"hidden"
|
|
128
|
+
},{ target, maskVector });
|
|
129
|
+
if(this.isInline()){
|
|
130
|
+
console.group("Ziko Issue : Temporarily Incompatible Method");
|
|
131
|
+
console.warn(".enableResize has no effect on inline elements!");
|
|
132
|
+
console.info("%cConsider using other display types such as block, inline-block, flex, or grid for proper resizing behavior.","color:gold;background-color:#3333cc;padding:5px");
|
|
133
|
+
console.groupEnd();
|
|
134
|
+
}
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
// Apparence
|
|
138
|
+
hide({after, target, maskVector } = {}){
|
|
139
|
+
if(typeof after==="number"){
|
|
140
|
+
const wrapper=()=>this.hide({target,maskVector})
|
|
141
|
+
setTimeout(wrapper, after);
|
|
142
|
+
clearTimeout(wrapper);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
this.cache.isHidden=true;
|
|
146
|
+
this.style({display:"none"},{target,maskVector});
|
|
147
|
+
}
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
show({after, target, maskVector } = {}){
|
|
151
|
+
if(typeof after==="number"){
|
|
152
|
+
const wrapper=()=>this.show({target,maskVector})
|
|
153
|
+
setTimeout(wrapper, after);
|
|
154
|
+
clearTimeout(wrapper);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
this.cache.isHidden=false;
|
|
158
|
+
this.style({display:""},{target,maskVector});
|
|
159
|
+
}
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
color(color,{ target, maskVector } = {}){
|
|
163
|
+
this.style({color},{ target, maskVector });
|
|
164
|
+
return this;
|
|
165
|
+
}
|
|
166
|
+
background(background,{ target, maskVector } = {}){
|
|
167
|
+
this.style({background},{ target, maskVector });
|
|
168
|
+
return this;
|
|
169
|
+
}
|
|
170
|
+
backgroundColor(backgroundColor,{ target, maskVector } = {}){
|
|
171
|
+
this.style({backgroundColor},{ target, maskVector });
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
opacity(opacity, { target, maskVector } = {}) {
|
|
175
|
+
this.style({ opacity }, { target, maskVector });
|
|
176
|
+
return this;
|
|
177
|
+
}
|
|
178
|
+
// Placement
|
|
179
|
+
position(position,{ target, maskVector } = {}){
|
|
180
|
+
this.style({position},{ target, maskVector });
|
|
181
|
+
return this
|
|
182
|
+
}
|
|
183
|
+
display(disp, { target, maskVector } = {}) {
|
|
184
|
+
this.style({ display: disp }, { target, maskVector });
|
|
185
|
+
return this;
|
|
186
|
+
}
|
|
187
|
+
zIndex(z,{ target, maskVector } = {}){
|
|
188
|
+
this.style({zIndex:z},{ target, maskVector });
|
|
189
|
+
return this;
|
|
190
|
+
}
|
|
191
|
+
float(float, { target, maskVector } = {}) {
|
|
192
|
+
this.style({ float: float }, { target, maskVector });
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
// Box Model
|
|
196
|
+
border(border = "1px solid red", { target, maskVector } = {}){
|
|
197
|
+
this.style({border}, { target, maskVector });
|
|
198
|
+
return this;
|
|
199
|
+
}
|
|
200
|
+
borderTop(borderTop = "1px solid red", { target, maskVector } = {}){
|
|
201
|
+
this.style({borderTop}, { target, maskVector });
|
|
202
|
+
return this;
|
|
203
|
+
}
|
|
204
|
+
borderRight(borderRight = "1px solid red", { target, maskVector } = {}){
|
|
205
|
+
this.style({borderRight}, { target, maskVector });
|
|
206
|
+
return this;
|
|
207
|
+
}
|
|
208
|
+
borderBottom(borderBottom = "1px solid red", { target, maskVector } = {}){
|
|
209
|
+
this.style({borderBottom}, { target, maskVector });
|
|
210
|
+
return this;
|
|
211
|
+
}
|
|
212
|
+
borderLeft(borderLeft = "1px solid red", { target, maskVector } = {}){
|
|
213
|
+
this.style({borderLeft}, { target, maskVector });
|
|
214
|
+
return this;
|
|
215
|
+
}
|
|
216
|
+
borderRadius(radius,{ target, maskVector } = {}){
|
|
217
|
+
radius=addSuffixeToNumber(radius,"px");
|
|
218
|
+
this.style({ borderRadius: radius }, { target, maskVector });
|
|
219
|
+
return this;
|
|
220
|
+
}
|
|
221
|
+
margin(margin,{ target, maskVector } = {}){
|
|
222
|
+
margin=addSuffixeToNumber(margin,"px");
|
|
223
|
+
this.style({ margin }, { target, maskVector });
|
|
224
|
+
return this;
|
|
225
|
+
}
|
|
226
|
+
marginTop(marginTop,{ target, maskVector } = {}){
|
|
227
|
+
marginTop=addSuffixeToNumber(marginTop,"px");
|
|
228
|
+
this.style({marginTop},{ target, maskVector });
|
|
229
|
+
return this;
|
|
230
|
+
}
|
|
231
|
+
marginRight(marginRight,{ target, maskVector } = {}){
|
|
232
|
+
marginRight=addSuffixeToNumber(marginRight,"px");
|
|
233
|
+
this.style({marginRight},{ target, maskVector });
|
|
234
|
+
return this;
|
|
235
|
+
}
|
|
236
|
+
marginBootom(marginBootom,{ target, maskVector } = {}){
|
|
237
|
+
marginBootom=addSuffixeToNumber(marginBootom,"px");
|
|
238
|
+
this.style({marginBootom},{ target, maskVector });
|
|
239
|
+
return this;
|
|
240
|
+
}
|
|
241
|
+
marginLeft(marginLeft,{ target, maskVector } = {}){
|
|
242
|
+
marginLeft=addSuffixeToNumber(marginLeft,"px");
|
|
243
|
+
this.style({marginLeft},{ target, maskVector });
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
246
|
+
padding(padding,{ target, maskVector } = {}){
|
|
247
|
+
padding=addSuffixeToNumber(padding,"px");
|
|
248
|
+
this.style({padding},{ target, maskVector });
|
|
249
|
+
return this;
|
|
250
|
+
}
|
|
251
|
+
paddingTop(paddingTop,{ target, maskVector } = {}){
|
|
252
|
+
paddingTop=addSuffixeToNumber(paddingTop,"px");
|
|
253
|
+
this.style({paddingTop},{ target, maskVector });
|
|
254
|
+
return this;
|
|
255
|
+
}
|
|
256
|
+
paddingRight(paddingRight,{ target, maskVector } = {}){
|
|
257
|
+
paddingRight=addSuffixeToNumber(paddingRight,"px");
|
|
258
|
+
this.style({paddingRight},{ target, maskVector });
|
|
259
|
+
return this;
|
|
260
|
+
}
|
|
261
|
+
paddingBootom(paddingBootom,{ target, maskVector } = {}){
|
|
262
|
+
paddingBootom=addSuffixeToNumber(paddingBootom,"px");
|
|
263
|
+
this.style({paddingBootom},{ target, maskVector });
|
|
264
|
+
return this;
|
|
265
|
+
}
|
|
266
|
+
paddingLeft(paddingLeft,{ target, maskVector } = {}){
|
|
267
|
+
paddingLeft=addSuffixeToNumber(paddingLeft,"px");
|
|
268
|
+
this.style({paddingLeft},{ target, maskVector });
|
|
269
|
+
return this;
|
|
270
|
+
}
|
|
271
|
+
// Typographie
|
|
272
|
+
font(font,{ target, maskVector } = {}){
|
|
273
|
+
this.style({font},{ target, maskVector });
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
fontFamily(fontFamily="",{ target, maskVector } = {}){
|
|
277
|
+
this.style({fontFamily},{ target, maskVector });
|
|
278
|
+
return this;
|
|
279
|
+
}
|
|
280
|
+
fontSize(fontSize,{ target, maskVector } = {}){
|
|
281
|
+
this.style({fontSize},{ target, maskVector });
|
|
282
|
+
return this;
|
|
283
|
+
}
|
|
284
|
+
// Misc
|
|
285
|
+
cursor(type="pointer"){
|
|
286
|
+
this.style({ cursor: type });
|
|
287
|
+
return this;
|
|
288
|
+
}
|
|
289
|
+
overflow(x,y,{ target, maskVector } = {}){
|
|
290
|
+
const values=["hidden","auto"];
|
|
291
|
+
this.style({
|
|
292
|
+
overflowX:typeof x==="number"?values[x]:x,
|
|
293
|
+
overflowY:typeof y==="number"?values[y]:y
|
|
294
|
+
},{target,maskVector})
|
|
295
|
+
return this;
|
|
296
|
+
}
|
|
297
|
+
clip(polygon, { target, maskVector } = {}) {
|
|
298
|
+
if (typeof polygon === "string") polygon = "polygon(" + polygon + ")";
|
|
299
|
+
this.style({ clipPath: polygon }, { target, maskVector });
|
|
300
|
+
return this;
|
|
301
|
+
}
|
|
302
|
+
// Transfromations
|
|
303
|
+
fadeOut(t = 1) {
|
|
304
|
+
this.style({
|
|
305
|
+
transition: t/1000 + "s",
|
|
306
|
+
opacity: 0
|
|
307
|
+
});
|
|
308
|
+
this.cache.isFaddedOut=true;
|
|
309
|
+
return this;
|
|
310
|
+
}
|
|
311
|
+
fadeIn(t = 1) {
|
|
312
|
+
this.style({
|
|
313
|
+
transition: t/1000 + "s",
|
|
314
|
+
opacity: 1
|
|
315
|
+
});
|
|
316
|
+
this.cache.isFaddedOut=false;
|
|
317
|
+
return this;
|
|
318
|
+
}
|
|
319
|
+
toggleFade(t_in = 1000,t_out=t_in){
|
|
320
|
+
this.cache.isFaddedOut?this.fadeIn(t_in):this.fadeOut(t_out);
|
|
321
|
+
return this;
|
|
322
|
+
}
|
|
323
|
+
#applyTransformMatrix(t){
|
|
324
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
325
|
+
this.style({
|
|
326
|
+
transform: `matrix3d(${transformMatrix})`,
|
|
327
|
+
"-webkit-transform": `matrix3d(${transformMatrix})`,
|
|
328
|
+
"-moz-transform": `matrix3d(${transformMatrix})`,
|
|
329
|
+
"-ms-transform": `matrix3d(${transformMatrix})`,
|
|
330
|
+
"-o-transform": `matrix3d(${transformMatrix})`
|
|
331
|
+
});
|
|
332
|
+
if (t != 0) this.style({ transition: `transform ${t/1000}s ease` });
|
|
333
|
+
}
|
|
334
|
+
translate(x, y = x ,z = 0, t = 0) {
|
|
335
|
+
this.cache.transformation.matrix.set(3,0,x);
|
|
336
|
+
this.cache.transformation.matrix.set(3,1,y);
|
|
337
|
+
this.cache.transformation.matrix.set(3,2,z);
|
|
338
|
+
this.#applyTransformMatrix(t);
|
|
339
|
+
return this;
|
|
340
|
+
}
|
|
341
|
+
translateX(x, t = 0) {
|
|
342
|
+
this.cache.transformation.matrix.set(3,0,x)
|
|
343
|
+
this.#applyTransformMatrix(t);
|
|
344
|
+
return this;
|
|
345
|
+
}
|
|
346
|
+
translateY(y, t = 0) {
|
|
347
|
+
this.cache.transformation.matrix.set(3,1,y)
|
|
348
|
+
this.#applyTransformMatrix(t);
|
|
349
|
+
return this;
|
|
350
|
+
}
|
|
351
|
+
translateZ(z, t = 0) {
|
|
352
|
+
const d=-1/this.cache.transformation.matrix[2][2];
|
|
353
|
+
this.cache.transformation.matrix.set(3,2,z);
|
|
354
|
+
this.cache.transformation.matrix.set(3,3,1-(z/d));
|
|
355
|
+
this.#applyTransformMatrix(t);
|
|
356
|
+
return this;
|
|
357
|
+
}
|
|
358
|
+
perspective(d,t=0){
|
|
359
|
+
const z=this.cache.transformation.matrix[3][2];
|
|
360
|
+
this.cache.transformation.matrix.set(2,2,-1/d);
|
|
361
|
+
this.cache.transformation.matrix.set(3,3,1-(z/d));
|
|
362
|
+
this.#applyTransformMatrix(t);
|
|
363
|
+
return this;
|
|
364
|
+
}
|
|
365
|
+
scale(x, y = x, t = 0) {
|
|
366
|
+
this.cache.transformation.matrix.set(0,0,x)
|
|
367
|
+
this.cache.transformation.matrix.set(1,1,y)
|
|
368
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
369
|
+
this.#applyTransformMatrix(t);
|
|
370
|
+
return this;
|
|
371
|
+
}
|
|
372
|
+
scaleX(x = 1 , t = 0) {
|
|
373
|
+
this.cache.transformation.matrix.set(0,0,x)
|
|
374
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
375
|
+
this.#applyTransformMatrix(t);
|
|
376
|
+
return this;
|
|
377
|
+
}
|
|
378
|
+
scaleY(y = 1, t = 0) {
|
|
379
|
+
this.cache.transformation.matrix.set(1,1,y)
|
|
380
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
381
|
+
this.#applyTransformMatrix(t);
|
|
382
|
+
return this;
|
|
383
|
+
}
|
|
384
|
+
skew(x, y = x, t = 0) {
|
|
385
|
+
this.cache.transformation.matrix.set(0,1,x)
|
|
386
|
+
this.cache.transformation.matrix.set(1,0,y)
|
|
387
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
388
|
+
this.#applyTransformMatrix(t);
|
|
389
|
+
return this;
|
|
390
|
+
}
|
|
391
|
+
skewX(x = 1 , t = 0) {
|
|
392
|
+
this.cache.transformation.matrix.set(0,1,x)
|
|
393
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
394
|
+
this.#applyTransformMatrix(t);
|
|
395
|
+
return this;
|
|
396
|
+
}
|
|
397
|
+
skewY(y = 1, t = 0) {
|
|
398
|
+
this.cache.transformation.matrix.set(1,0,y);
|
|
399
|
+
const transformMatrix = this.cache.transformation.matrix.arr.join(",");
|
|
400
|
+
this.#applyTransformMatrix(t);
|
|
401
|
+
return this;
|
|
402
|
+
}
|
|
403
|
+
rotateX(deg, t = 0) {
|
|
404
|
+
this.cache.transformation.matrix.set(1,1,cos(deg));
|
|
405
|
+
this.cache.transformation.matrix.set(1,2,-sin(deg));
|
|
406
|
+
this.cache.transformation.matrix.set(2,1,sin(deg));
|
|
407
|
+
this.cache.transformation.matrix.set(1,2,cos(deg));
|
|
408
|
+
this.#applyTransformMatrix(t);
|
|
409
|
+
return this;
|
|
410
|
+
}
|
|
411
|
+
rotateY(deg, t = 0) {
|
|
412
|
+
this.cache.transformation.matrix.set(0,0,cos(deg));
|
|
413
|
+
this.cache.transformation.matrix.set(0,2,sin(deg));
|
|
414
|
+
this.cache.transformation.matrix.set(2,0,-sin(deg));
|
|
415
|
+
this.cache.transformation.matrix.set(2,2,cos(deg));
|
|
416
|
+
this.#applyTransformMatrix(t);
|
|
417
|
+
return this;
|
|
418
|
+
}
|
|
419
|
+
rotateZ(deg, t = 0) {
|
|
420
|
+
this.cache.transformation.matrix.set(0,0,cos(deg));
|
|
421
|
+
this.cache.transformation.matrix.set(0,1,-sin(deg));
|
|
422
|
+
this.cache.transformation.matrix.set(1,0,sin(deg));
|
|
423
|
+
this.cache.transformation.matrix.set(1,1,cos(deg));
|
|
424
|
+
this.#applyTransformMatrix(t);
|
|
425
|
+
return this;
|
|
426
|
+
}
|
|
427
|
+
flipeX({ t = 1 } = {}) {
|
|
428
|
+
this.cache.transformation.Flip[0] += 180;
|
|
429
|
+
this.cache.transformation.Flip[0] %= 360;
|
|
430
|
+
this.rotateX(this.cache.transformation.Flip[0],t);
|
|
431
|
+
return this;
|
|
432
|
+
}
|
|
433
|
+
flipeY(t = 1) {
|
|
434
|
+
this.cache.transformation.Flip[1] += 180 ;
|
|
435
|
+
this.cache.transformation.Flip[1] %= 360;
|
|
436
|
+
this.rotateY(this.cache.transformation.Flip[1],t);
|
|
437
|
+
return this;
|
|
438
|
+
}
|
|
439
|
+
flipeZ(t = 1) {
|
|
440
|
+
this.cache.transformation.Flip[2] += 180;
|
|
441
|
+
this.cache.transformation.Flip[2] %= 360;
|
|
442
|
+
this.rotateZ(this.cache.transformation.Flip[2],t);
|
|
443
|
+
return this;
|
|
444
|
+
}
|
|
445
|
+
slideHeightIn(t = 1, h = this.h) {
|
|
446
|
+
this.style({ transition: t + "s", height: h });
|
|
447
|
+
return this;
|
|
448
|
+
}
|
|
449
|
+
slideHeightOut(t = 1) {
|
|
450
|
+
this.style({ transition: t + "s", height: 0 });
|
|
451
|
+
this.target.element.addEventListener("transitionend", () =>
|
|
452
|
+
this.style({ opacity: "none" }),
|
|
453
|
+
);
|
|
454
|
+
return this;
|
|
455
|
+
}
|
|
456
|
+
slideWidthIn(t = 1, w = this.w) {
|
|
457
|
+
this.style({ transition: t + "s", width: w });
|
|
458
|
+
return this;
|
|
459
|
+
}
|
|
460
|
+
slideWidthOut(t = 1) {
|
|
461
|
+
this.style({ transition: t + "s", width: 0 });
|
|
462
|
+
const wrapper=()=>{
|
|
463
|
+
this.style({ opacity: "none" })
|
|
464
|
+
}
|
|
465
|
+
this.target.element.addEventListener("transitionend",wrapper);
|
|
466
|
+
this.target.element.removeEventListener("transitionend",wrapper);
|
|
467
|
+
return this;
|
|
468
|
+
}
|
|
469
|
+
slideIn({ t = 1, w = "100%", h = "auto" } = {}) {
|
|
470
|
+
this.style({
|
|
471
|
+
transition: t + "s",
|
|
472
|
+
width: w,
|
|
473
|
+
height: h,
|
|
474
|
+
visibility: "visible",
|
|
475
|
+
});
|
|
476
|
+
return this;
|
|
477
|
+
}
|
|
478
|
+
slideOut({ t = 1, width = 0, height = 0 } = {}) {
|
|
479
|
+
this.style({
|
|
480
|
+
visibility: "hidden",
|
|
481
|
+
transition: t + "s",
|
|
482
|
+
opacity: "none",
|
|
483
|
+
width: width,
|
|
484
|
+
height: height,
|
|
485
|
+
});
|
|
486
|
+
const wrapper=()=>{
|
|
487
|
+
this.style({ opacity: "none" });
|
|
488
|
+
}
|
|
489
|
+
this.target.element.addEventListener("transitionend",wrapper);
|
|
490
|
+
this.target.element.removeEventListener("transitionend",wrapper);
|
|
491
|
+
return this;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const ZikoStyle=(defaultStyle)=>new ZikoUIElementStyle(defaultStyle);
|
|
497
|
+
export{
|
|
498
|
+
ZikoStyle
|
|
499
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js"
|
|
2
|
+
import { text } from "../Text/text.js";
|
|
3
|
+
class ZikoUITh extends ZikoUIElement{
|
|
4
|
+
constructor(...ZikoUIElement){
|
|
5
|
+
super()
|
|
6
|
+
this.element=document.createElement("Th");
|
|
7
|
+
this.append(...ZikoUIElement)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class ZikoUITr extends ZikoUIElement{
|
|
11
|
+
constructor(...ZikoUIElement){
|
|
12
|
+
super()
|
|
13
|
+
this.element=document.createElement("Tr");
|
|
14
|
+
this.append(...ZikoUIElement)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class ZikoUITd extends ZikoUIElement{
|
|
18
|
+
constructor(...ZikoUIElement){
|
|
19
|
+
super()
|
|
20
|
+
this.element=document.createElement("Td");
|
|
21
|
+
this.append(...ZikoUIElement)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
class ZikoUIThead extends ZikoUIElement{
|
|
25
|
+
constructor(...ZikoUITr){
|
|
26
|
+
super()
|
|
27
|
+
this.element=document.createElement("Thead");
|
|
28
|
+
this.append(...ZikoUITr)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
class ZikoUITbody extends ZikoUIElement{
|
|
32
|
+
constructor(...ZikoUITr){
|
|
33
|
+
super()
|
|
34
|
+
this.element=document.createElement("Tbody");
|
|
35
|
+
this.append(...ZikoUITr)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
class ZikoUITfoot extends ZikoUIElement{
|
|
39
|
+
constructor(...ZikoUITr){
|
|
40
|
+
super()
|
|
41
|
+
this.element=document.createElement("Tfoot");
|
|
42
|
+
this.append(...ZikoUITr)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export class ZikoUICaption extends ZikoUIElement{
|
|
46
|
+
constructor(ZikoUIElement){
|
|
47
|
+
super()
|
|
48
|
+
this.element=document.createElement("Caption");
|
|
49
|
+
this.append(ZikoUIElement)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
class ZikoUICol extends ZikoUIElement{
|
|
53
|
+
constructor(...ZikoUIElement){
|
|
54
|
+
super()
|
|
55
|
+
this.element=document.createElement("Col");
|
|
56
|
+
this.append(...ZikoUIElement)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class ZikoUIColgroup extends ZikoUIElement{
|
|
60
|
+
constructor(...ZikoUIElement){
|
|
61
|
+
super()
|
|
62
|
+
this.element=document.createElement("Colgroup");
|
|
63
|
+
this.append(...ZikoUIElement)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const tr=(...ZikoUIElement)=>new ZikoUITr(...ZikoUIElement)
|
|
68
|
+
const th=(...UI)=>{
|
|
69
|
+
UI=UI.map(n=>{
|
|
70
|
+
if(!(n instanceof ZikoUIElement))n=text(n)
|
|
71
|
+
return n
|
|
72
|
+
})
|
|
73
|
+
return new ZikoUITh(...UI)
|
|
74
|
+
}
|
|
75
|
+
const td=(...UI)=>{
|
|
76
|
+
UI=UI.map(n=>{
|
|
77
|
+
if(!(n instanceof ZikoUIElement))n=text(n)
|
|
78
|
+
return n
|
|
79
|
+
})
|
|
80
|
+
return new ZikoUITd(...UI)
|
|
81
|
+
}
|
|
82
|
+
const thead=(...ZikoUITd)=>{
|
|
83
|
+
ZikoUITd=ZikoUITd.map(n=>{
|
|
84
|
+
if(!(n instanceof ZikoUIElement))n=td(n)
|
|
85
|
+
return n
|
|
86
|
+
})
|
|
87
|
+
return new ZikoUIThead(...UI)
|
|
88
|
+
}
|
|
89
|
+
const tbody=(...ZikoUITr)=>new ZikoUITbody(...ZikoUITr)
|
|
90
|
+
const tfoot=(...ZikoUITr)=>new ZikoUITfoot(...ZikoUITr)
|
|
91
|
+
const caption=(ZikoUITr)=>new ZikoUICaption(ZikoUITr)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
export {th,tr,td,thead,tbody,tfoot,caption}
|