ziko 0.0.11 → 0.0.13
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 +6 -3
- package/dist/ziko.cjs +5640 -4532
- package/dist/ziko.js +5640 -4532
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +5602 -4532
- package/package.json +39 -12
- package/src/__helpers__/index.js +41 -0
- package/src/app/accessibility/index.js +0 -0
- package/src/app/app.js +46 -0
- package/src/app/component/index.js +38 -0
- package/src/app/globals/index.js +20 -0
- package/src/app/index.js +12 -0
- package/src/app/params/index.js +40 -0
- package/src/app/router/index.js +67 -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/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/adoc.js +130 -0
- package/src/data/converter/array.js +43 -0
- package/src/data/converter/canvas.js +25 -0
- package/src/data/converter/csv.js +33 -0
- package/src/data/converter/idea.txt +10 -0
- package/src/data/converter/index.js +34 -0
- package/src/data/converter/json.js +80 -0
- package/src/data/converter/markdown.js +95 -0
- package/src/data/converter/object.js +70 -0
- package/src/data/converter/svg.js +11 -0
- package/src/data/decorators.js +0 -0
- package/src/data/index.js +74 -0
- package/src/data/parser/markdown.js +0 -0
- package/src/data/parser/xml.js +47 -0
- package/src/data/string/index.js +1 -0
- package/src/data/string/patterns.js +12 -0
- package/src/data/string/string.js +170 -0
- package/src/graphics/canvas/_canvas_offscreen +0 -0
- package/src/graphics/canvas/canvas.js +189 -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/index.js +15 -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/index.js +69 -0
- package/src/graphics/svg/Elements/Basic/circle.js +26 -0
- package/src/graphics/svg/Elements/Basic/ellipse.js +21 -0
- package/src/graphics/svg/Elements/Basic/foreignObject.js +33 -0
- package/src/graphics/svg/Elements/Basic/groupe.js +29 -0
- package/src/graphics/svg/Elements/Basic/image.js +33 -0
- package/src/graphics/svg/Elements/Basic/line.js +29 -0
- package/src/graphics/svg/Elements/Basic/link.js +30 -0
- package/src/graphics/svg/Elements/Basic/path.js +59 -0
- package/src/graphics/svg/Elements/Basic/polygon.js +32 -0
- package/src/graphics/svg/Elements/Basic/polyline.js +4 -0
- package/src/graphics/svg/Elements/Basic/rect.js +43 -0
- package/src/graphics/svg/Elements/Basic/text.js +26 -0
- package/src/graphics/svg/Elements/Derived/grid.js +9 -0
- package/src/graphics/svg/Elements/ZikoSvgElement.js +46 -0
- package/src/graphics/svg/Elements/index.js +14 -0
- package/src/graphics/svg/index.js +2 -0
- package/src/graphics/svg/svg.js +115 -0
- package/src/index.js +88 -0
- package/src/math/absract.js +1 -0
- package/src/math/calculus/index.js +1 -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/complex/Fractals/julia.js +0 -0
- package/src/math/complex/index.js +203 -0
- package/src/math/const.js +3 -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/power-set.js +15 -0
- package/src/math/discret/Set/sub-set.js +10 -0
- package/src/math/discret/index.js +23 -0
- package/src/math/functions/index.js +182 -0
- package/src/math/index.js +189 -0
- package/src/math/matrix/Decomposition.js +90 -0
- package/src/math/matrix/LinearSystem.js +10 -0
- package/src/math/matrix/Matrix.js +717 -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 +29 -0
- package/src/math/utils/comparaison.js +1 -0
- package/src/math/utils/conversions.js +19 -0
- package/src/math/utils/discret.js +51 -0
- package/src/math/utils/index.js +102 -0
- package/src/math/utils/mapfun.js +50 -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/Mouse.js +230 -0
- package/src/reactivity/events/Global/Pointer.js +234 -0
- package/src/reactivity/events/Global/Swipe.js +147 -0
- package/src/reactivity/events/Global/Touch.js +0 -0
- package/src/reactivity/events/Global/Wheel.js +44 -0
- package/src/reactivity/events/Partiel/Hash.js +44 -0
- package/src/reactivity/events/Partiel/Input.js +59 -0
- package/src/reactivity/events/Partiel/Media.js +1 -0
- package/src/reactivity/events/ZikoEvent.js +91 -0
- package/src/reactivity/events/index.js +63 -0
- package/src/reactivity/hooks/Contexte/index.js +1 -0
- package/src/reactivity/hooks/Contexte/useSuccesifKeys.js +14 -0
- package/src/reactivity/hooks/Decorators/index.js +6 -0
- package/src/reactivity/hooks/Decorators/time.js +17 -0
- package/src/reactivity/hooks/Decorators/type.js +88 -0
- package/src/reactivity/hooks/Interactions/index.js +4 -0
- package/src/reactivity/hooks/Interactions/useBluetooth.js +48 -0
- package/src/reactivity/hooks/Interactions/useChannel.js +50 -0
- package/src/reactivity/hooks/Interactions/useEventEmmiter.js +64 -0
- package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
- package/src/reactivity/hooks/Interactions/useThread.js +44 -0
- package/src/reactivity/hooks/Interactions/useUsb.js +0 -0
- package/src/reactivity/hooks/Sensors/index.js +2 -0
- package/src/reactivity/hooks/Sensors/useBattery.js +36 -0
- package/src/reactivity/hooks/Sensors/useCamera.js +0 -0
- package/src/reactivity/hooks/Sensors/useGeolocation.js +17 -0
- package/src/reactivity/hooks/Sensors/useMicro.js +0 -0
- package/src/reactivity/hooks/Sensors/useOrientation.js +0 -0
- package/src/reactivity/hooks/Storage/index.js +1 -0
- package/src/reactivity/hooks/Storage/useCookie.js +0 -0
- package/src/reactivity/hooks/Storage/useIndexedDb.js +0 -0
- package/src/reactivity/hooks/Storage/useStorage.js +73 -0
- package/src/reactivity/hooks/UI/index.js +5 -0
- package/src/reactivity/hooks/UI/useCssLink.js +0 -0
- package/src/reactivity/hooks/UI/useCssText.js +21 -0
- package/src/reactivity/hooks/UI/useFavIcon.js +38 -0
- package/src/reactivity/hooks/UI/useLinearGradient.js +0 -0
- package/src/reactivity/hooks/UI/useMediaQuery.js +43 -0
- package/src/reactivity/hooks/UI/useRadialGradient.js +0 -0
- package/src/reactivity/hooks/UI/useStyle.js +79 -0
- package/src/reactivity/hooks/UI/useTheme.js +62 -0
- package/src/reactivity/hooks/UI/useTitle.js +30 -0
- package/src/reactivity/hooks/index.js +85 -0
- package/src/reactivity/hooks/todo.md +26 -0
- package/src/reactivity/idea +2 -0
- package/src/reactivity/index.js +22 -0
- package/src/reactivity/observer/attributes.js +28 -0
- package/src/reactivity/observer/children.js +37 -0
- package/src/reactivity/observer/index.js +44 -0
- package/src/reactivity/observer/intersection.js +44 -0
- package/src/reactivity/observer/mutation.js +113 -0
- package/src/reactivity/observer/resize.js +47 -0
- package/src/reactivity/observer/screen.js +45 -0
- package/src/reactivity/observer/screen.js.txt +84 -0
- package/src/reactivity/observer/screen.txt +13 -0
- package/src/time/animation.js +76 -0
- package/src/time/index.js +54 -0
- package/src/time/loop.js +87 -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/user-interface/elements/derived/Flex.js +103 -0
- package/src/user-interface/elements/derived/Grid.js +33 -0
- package/src/user-interface/elements/derived/elements/Notification.js +0 -0
- package/src/user-interface/elements/derived/elements/Popover.js +0 -0
- package/src/user-interface/elements/derived/elements/Popup.js +0 -0
- package/src/user-interface/elements/derived/elements/Swipper.js +4 -0
- package/src/user-interface/elements/derived/elements/Timeline.js +0 -0
- package/src/user-interface/elements/derived/elements/Toast.js +0 -0
- package/src/user-interface/elements/derived/elements/Treeview.js +0 -0
- package/src/user-interface/elements/derived/elements/accordion/accordion.js +45 -0
- package/src/user-interface/elements/derived/elements/accordion/collapsible.js +82 -0
- package/src/user-interface/elements/derived/elements/accordion/index.js +2 -0
- package/src/user-interface/elements/derived/elements/alert/alert.js +80 -0
- package/src/user-interface/elements/derived/elements/alert/index.js +1 -0
- package/src/user-interface/elements/derived/elements/alert/palette.js +52 -0
- package/src/user-interface/elements/derived/elements/carousel/index.js +50 -0
- package/src/user-interface/elements/derived/elements/code-note/SubElements.js.txt +105 -0
- package/src/user-interface/elements/derived/elements/code-note/code-cell.js +195 -0
- package/src/user-interface/elements/derived/elements/code-note/code-note.js +72 -0
- package/src/user-interface/elements/derived/elements/code-note/index.js +2 -0
- package/src/user-interface/elements/derived/elements/code-note/sub-elements.js +67 -0
- package/src/user-interface/elements/derived/elements/columns.js +1 -0
- package/src/user-interface/elements/derived/elements/fab.js +0 -0
- package/src/user-interface/elements/derived/elements/index.js +9 -0
- package/src/user-interface/elements/derived/elements/menu/index.js +1 -0
- package/src/user-interface/elements/derived/elements/menu/menu3d.js +260 -0
- package/src/user-interface/elements/derived/elements/modal/index.js +92 -0
- package/src/user-interface/elements/derived/elements/pagination/breadcrumbs.js +54 -0
- package/src/user-interface/elements/derived/elements/pagination/index.js +1 -0
- package/src/user-interface/elements/derived/elements/splitter/__ZikoUISplitter__.js +62 -0
- package/src/user-interface/elements/derived/elements/splitter/hsplitter.js +40 -0
- package/src/user-interface/elements/derived/elements/splitter/index.js +2 -0
- package/src/user-interface/elements/derived/elements/splitter/vsplitter.js +40 -0
- package/src/user-interface/elements/derived/elements/tabs/index.js +180 -0
- package/src/user-interface/elements/derived/index.js +3 -0
- package/src/user-interface/elements/primitives/ZikoUIContainerElement.js +127 -0
- package/src/user-interface/elements/primitives/ZikoUIElement.js +478 -0
- package/src/user-interface/elements/primitives/embaded/index.js +1 -0
- package/src/user-interface/elements/primitives/index.js +8 -0
- package/src/user-interface/elements/primitives/io/Form/index.js +42 -0
- package/src/user-interface/elements/primitives/io/Form/index.js.txt +104 -0
- package/src/user-interface/elements/primitives/io/Inputs/__helpers__.js +52 -0
- package/src/user-interface/elements/primitives/io/Inputs/index.js +12 -0
- package/src/user-interface/elements/primitives/io/Inputs/input/index.js +98 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-camera/index.js +26 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-checkbox/index.js +26 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-color/index.js +16 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/index.js +3 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-date-time.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-date.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-date-time/input-time.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/index.js +2 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/input-email.js +15 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/input-password.js +14 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-file/index.js +1 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-file/input-file.js +0 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-file/input-image.js +43 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-number/index.js +37 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-radio/index.js +26 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-search/index.js +45 -0
- package/src/user-interface/elements/primitives/io/Inputs/input-slider/index.js +34 -0
- package/src/user-interface/elements/primitives/io/Select/index.js +20 -0
- package/src/user-interface/elements/primitives/io/Textarea/index.js +18 -0
- package/src/user-interface/elements/primitives/io/index.js +4 -0
- package/src/user-interface/elements/primitives/list/elements.js +0 -0
- package/src/user-interface/elements/primitives/list/index.js +139 -0
- package/src/user-interface/elements/primitives/media/Audio/index.js +17 -0
- package/src/user-interface/elements/primitives/media/Image/figure.js +19 -0
- package/src/user-interface/elements/primitives/media/Image/image.js +36 -0
- package/src/user-interface/elements/primitives/media/Image/index.js +2 -0
- package/src/user-interface/elements/primitives/media/Video/index.js +27 -0
- package/src/user-interface/elements/primitives/media/__ZikoUIDynamicMediaELement__.js +47 -0
- package/src/user-interface/elements/primitives/media/index.js +3 -0
- package/src/user-interface/elements/primitives/misc/index.js +99 -0
- package/src/user-interface/elements/primitives/semantic/index.js +82 -0
- package/src/user-interface/elements/primitives/table/elements.js +94 -0
- package/src/user-interface/elements/primitives/table/index.js +3 -0
- package/src/user-interface/elements/primitives/table/table.js +115 -0
- package/src/user-interface/elements/primitives/table/utils.js +12 -0
- package/src/user-interface/elements/primitives/text/__ZikoUIText__.js +71 -0
- package/src/user-interface/elements/primitives/text/heading.js +36 -0
- package/src/user-interface/elements/primitives/text/index.js +3 -0
- package/src/user-interface/elements/primitives/text/p.js +26 -0
- package/src/user-interface/elements/primitives/text/pre.js +0 -0
- package/src/user-interface/elements/primitives/text/text.js +81 -0
- package/src/user-interface/index.js +188 -0
- package/src/user-interface/style/index.js +510 -0
- package/src/user-interface/utils/index.js +70 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ZikoUIElement from "../../ZikoUIElement.js";
|
|
2
|
+
class ZikoUIImage extends ZikoUIElement {
|
|
3
|
+
constructor(src, w, h) {
|
|
4
|
+
super("img","image");
|
|
5
|
+
this.value=src;
|
|
6
|
+
if (src.nodeName === "IMG")this.element?.setAttribute("src", src.src);
|
|
7
|
+
else this.element?.setAttribute("src", src);
|
|
8
|
+
if (typeof w == "number") w += "%";
|
|
9
|
+
if (typeof h == "number") h += "%";
|
|
10
|
+
this.style({ border: "1px solid black", width: w, height: h });
|
|
11
|
+
}
|
|
12
|
+
get isImg(){
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
updateSrc(url){
|
|
16
|
+
this.value=url;
|
|
17
|
+
this.element.src=url;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
toggleSrc(...values){
|
|
21
|
+
values=values.map(n=>""+n);
|
|
22
|
+
let index=values.indexOf(""+this.value);
|
|
23
|
+
if(index!=-1&&index!=(values.length-1))this.updateSrc(values[index+1]);
|
|
24
|
+
else this.updateSrc(values[0]);
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
alt(alt){
|
|
28
|
+
this.element.alt=alt;
|
|
29
|
+
return this;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const image = (src, width, height) => new ZikoUIImage(src, width, height);
|
|
33
|
+
export{
|
|
34
|
+
image,
|
|
35
|
+
ZikoUIImage
|
|
36
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __ZikoUIDynamicMediaElement__ } from "../__ZikoUIDynamicMediaELement__.js";
|
|
2
|
+
class ZikoUIVideo extends __ZikoUIDynamicMediaElement__ {
|
|
3
|
+
constructor(src="", w = "100%", h = "50vh") {
|
|
4
|
+
super("video","video");
|
|
5
|
+
if (src.nodeName === "VIDEO") this.element?.setAttribute("src", src.src);
|
|
6
|
+
else this.element?.setAttribute("src", src);
|
|
7
|
+
if (typeof w == "number") w += "%";
|
|
8
|
+
if (typeof h == "number") h += "%";
|
|
9
|
+
this.style({ width: w, height: h });
|
|
10
|
+
}
|
|
11
|
+
get isVideo(){
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
usePoster(src=""){
|
|
15
|
+
this.element.poster=src;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
usePIP(e){
|
|
19
|
+
this.element.requestPictureInPicture(e);
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
const video = (src, width, height) => new ZikoUIVideo(src, width, height);
|
|
24
|
+
export {
|
|
25
|
+
video,
|
|
26
|
+
ZikoUIVideo
|
|
27
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
class __ZikoUIDynamicMediaElement__ extends ZikoUIElement {
|
|
3
|
+
constructor(element, name) {
|
|
4
|
+
super(element, name);
|
|
5
|
+
this.useControls();
|
|
6
|
+
}
|
|
7
|
+
get t(){
|
|
8
|
+
return this.element.currentTime;
|
|
9
|
+
}
|
|
10
|
+
useControls(enabled = true) {
|
|
11
|
+
this.element.controls = enabled;
|
|
12
|
+
return this;
|
|
13
|
+
}
|
|
14
|
+
enableControls(){
|
|
15
|
+
this.element.controls = true;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
disableControls(){
|
|
19
|
+
this.element.controls = true;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
toggleControls(){
|
|
23
|
+
this.element.controls = !this.element.controls;
|
|
24
|
+
return this;
|
|
25
|
+
}
|
|
26
|
+
play() {
|
|
27
|
+
this.element.play();
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
pause() {
|
|
31
|
+
this.element.pause();
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
34
|
+
seekTo(time) {
|
|
35
|
+
this.element.currentTime = time;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
onPlay(){
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
onPause(){
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
__ZikoUIDynamicMediaElement__
|
|
47
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
import ZikoUIContainerElement from "../ZikoUIContainerElement.js";
|
|
3
|
+
class ZikoUIHtmlTag extends ZikoUIContainerElement {
|
|
4
|
+
constructor(element) {
|
|
5
|
+
super(element,"html");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
class ZikoUIBtn extends ZikoUIElement {
|
|
9
|
+
constructor(value = "button") {
|
|
10
|
+
super("button","btn");
|
|
11
|
+
this.element = document?.createElement("button");
|
|
12
|
+
this.setValue(value);
|
|
13
|
+
this.st.cursor("pointer");
|
|
14
|
+
globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
15
|
+
}
|
|
16
|
+
get isBtn(){
|
|
17
|
+
return true
|
|
18
|
+
}
|
|
19
|
+
setValue(value) {
|
|
20
|
+
if (value instanceof ZikoUIElement) value.setTarget(this.element);
|
|
21
|
+
else {
|
|
22
|
+
this.element?.appendChild(document.createTextNode(""));
|
|
23
|
+
this.element.childNodes[0].data = value;
|
|
24
|
+
}
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
27
|
+
get value() {
|
|
28
|
+
return this.element.innerText;
|
|
29
|
+
}
|
|
30
|
+
toggleValues(...values) {
|
|
31
|
+
values = values.map((n) => "" + n);
|
|
32
|
+
let index = values.indexOf("" + this.value);
|
|
33
|
+
if (index != -1 && index != values.length - 1)
|
|
34
|
+
this.setValue(values[index + 1]);
|
|
35
|
+
else this.setValue(values[0]);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class ZikoUIBr extends ZikoUIElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super("br","br");
|
|
42
|
+
}
|
|
43
|
+
get isBr(){
|
|
44
|
+
return true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
class ZikoUIHr extends ZikoUIElement {
|
|
48
|
+
constructor() {
|
|
49
|
+
super("hr","hr");
|
|
50
|
+
}
|
|
51
|
+
get isHr(){
|
|
52
|
+
return true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class ZikoUILink extends ZikoUIContainerElement{
|
|
56
|
+
constructor(href){
|
|
57
|
+
super("a","link");
|
|
58
|
+
Object.assign(this.cache,{
|
|
59
|
+
defaultStyle:{
|
|
60
|
+
color:"#0275d8",
|
|
61
|
+
textDecoration: "none"
|
|
62
|
+
},
|
|
63
|
+
hoverStyle:{
|
|
64
|
+
color:"#01447e",
|
|
65
|
+
textDecoration: "underline"
|
|
66
|
+
},
|
|
67
|
+
})
|
|
68
|
+
this.setHref(href);
|
|
69
|
+
this.style(this.cache.defaultStyle);
|
|
70
|
+
this.onPtrEnter(()=>this.style(this.cache.hoverStyle));
|
|
71
|
+
this.onPtrLeave(()=>this.style(this.cache.defaultStyle));
|
|
72
|
+
}
|
|
73
|
+
setHref(href){
|
|
74
|
+
this.element.href=href;
|
|
75
|
+
}
|
|
76
|
+
get isLink(){
|
|
77
|
+
return true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const br = () => new ZikoUIBr();
|
|
81
|
+
const hr = () => new ZikoUIHr();
|
|
82
|
+
const brs = (n=1)=> new Array(n).fill(new ZikoUIBr());
|
|
83
|
+
const hrs = (n=1)=> new Array(n).fill(new ZikoUIHr());
|
|
84
|
+
const link=(href,...UIElement)=>new ZikoUILink(href).append(...UIElement);
|
|
85
|
+
const html=(tag,...UIElement)=>new ZikoUIHtmlTag(tag).append(...UIElement);
|
|
86
|
+
const btn = (value) => new ZikoUIBtn(value);
|
|
87
|
+
export{
|
|
88
|
+
html,
|
|
89
|
+
btn,
|
|
90
|
+
br,
|
|
91
|
+
hr,
|
|
92
|
+
brs,
|
|
93
|
+
hrs,
|
|
94
|
+
link,
|
|
95
|
+
ZikoUIHtmlTag,
|
|
96
|
+
ZikoUIBr,
|
|
97
|
+
ZikoUIHr,
|
|
98
|
+
ZikoUILink
|
|
99
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import ZikoUIContainerElement from "../ZikoUIContainerElement.js";
|
|
2
|
+
class ZikoUIMain extends ZikoUIContainerElement{
|
|
3
|
+
constructor(){
|
|
4
|
+
super("main","Main");
|
|
5
|
+
}
|
|
6
|
+
get isMain(){
|
|
7
|
+
return true
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class ZikoUIHeader extends ZikoUIContainerElement{
|
|
11
|
+
constructor(){
|
|
12
|
+
super("header","Header");
|
|
13
|
+
}
|
|
14
|
+
get isHeader(){
|
|
15
|
+
return true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
class ZikoUINav extends ZikoUIContainerElement{
|
|
19
|
+
constructor(){
|
|
20
|
+
super("nav","Nav");
|
|
21
|
+
}
|
|
22
|
+
get isNav(){
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
class ZikoUISection extends ZikoUIContainerElement{
|
|
27
|
+
constructor(){
|
|
28
|
+
super("section","Section");
|
|
29
|
+
this.style({position:"relative"})
|
|
30
|
+
}
|
|
31
|
+
get isSection(){
|
|
32
|
+
return true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
class ZikoUIArticle extends ZikoUIContainerElement{
|
|
36
|
+
constructor(){
|
|
37
|
+
super("article","Article");
|
|
38
|
+
}
|
|
39
|
+
get isArticle(){
|
|
40
|
+
return true
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class ZikoUIAside extends ZikoUIContainerElement{
|
|
44
|
+
constructor(){
|
|
45
|
+
super("aside","Aside");
|
|
46
|
+
}
|
|
47
|
+
get isAside(){
|
|
48
|
+
return true
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
class ZikoUIFooter extends ZikoUIContainerElement{
|
|
52
|
+
constructor(){
|
|
53
|
+
super("footer","Footer");
|
|
54
|
+
this.element=document?.createElement("footer");
|
|
55
|
+
}
|
|
56
|
+
get isFooter(){
|
|
57
|
+
return true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const Section = (...ZikoUIElement) => new ZikoUISection().append(...ZikoUIElement);
|
|
61
|
+
const Article = (...ZikoUIElement) => new ZikoUIArticle().append(...ZikoUIElement);
|
|
62
|
+
const Main = (...ZikoUIElement) => new ZikoUIMain().append(...ZikoUIElement);
|
|
63
|
+
const Header = (...ZikoUIElement) => new ZikoUIHeader().append(...ZikoUIElement);
|
|
64
|
+
const Footer = (...ZikoUIElement) => new ZikoUIFooter().append(...ZikoUIElement);
|
|
65
|
+
const Nav = (...ZikoUIElement) => new ZikoUINav().append(...ZikoUIElement);
|
|
66
|
+
const Aside = (...ZikoUIElement) => new ZikoUIAside().append(...ZikoUIElement);
|
|
67
|
+
export{
|
|
68
|
+
Header,
|
|
69
|
+
Main,
|
|
70
|
+
Section,
|
|
71
|
+
Article,
|
|
72
|
+
Aside,
|
|
73
|
+
Nav,
|
|
74
|
+
Footer,
|
|
75
|
+
ZikoUIHeader,
|
|
76
|
+
ZikoUIMain,
|
|
77
|
+
ZikoUISection,
|
|
78
|
+
ZikoUIArticle,
|
|
79
|
+
ZikoUIAside,
|
|
80
|
+
ZikoUINav,
|
|
81
|
+
ZikoUIFooter
|
|
82
|
+
}
|
|
@@ -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}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js"
|
|
2
|
+
import { tbody,caption,ZikoUICaption,thead} from "./elements.js";
|
|
3
|
+
import { matrix } from "../../../../math/matrix/index.js";
|
|
4
|
+
import { MatrixToTableUI } from "./utils.js";
|
|
5
|
+
class ZikoUITable extends ZikoUIElement {
|
|
6
|
+
constructor(body,{caption=null,head=null,foot=null}={}){
|
|
7
|
+
super("table","Table");
|
|
8
|
+
this.structure={
|
|
9
|
+
caption,
|
|
10
|
+
head,
|
|
11
|
+
body:null,
|
|
12
|
+
foot
|
|
13
|
+
}
|
|
14
|
+
if(body)this.fromMatrix(body);
|
|
15
|
+
if(caption)this.setCaption(caption)
|
|
16
|
+
}
|
|
17
|
+
get isTable(){
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
get caption(){
|
|
21
|
+
return this.structure.caption;
|
|
22
|
+
}
|
|
23
|
+
get header(){
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
get body(){
|
|
27
|
+
|
|
28
|
+
}
|
|
29
|
+
get footer(){
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
setCaption(c){
|
|
33
|
+
this.removeCaption();
|
|
34
|
+
this.structure.caption=caption(c);
|
|
35
|
+
this.append(this.structure.caption);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
removeCaption(){
|
|
39
|
+
if(this.structure.caption)this.removeItem(...this.items.filter(n=>n instanceof ZikoUICaption));
|
|
40
|
+
this.structure.caption=null;
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
setHeader(...c){
|
|
44
|
+
this.tHead=thead(...c);
|
|
45
|
+
this.append(this.tHead);
|
|
46
|
+
return this;
|
|
47
|
+
}
|
|
48
|
+
removeHeader(){
|
|
49
|
+
this.removeItem(...this.items.filter(n=>n instanceof ZikoUICaption));
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
setFooter(c){
|
|
53
|
+
this.structure.caption=caption(c);
|
|
54
|
+
this.append(this.structure.caption);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
removeFooter(){
|
|
58
|
+
this.removeItem(...this.items.filter(n=>n instanceof ZikoUICaption));
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
fromMatrix(bodyMatrix) {
|
|
62
|
+
(bodyMatrix instanceof Array)?this.bodyMatrix=matrix(bodyMatrix):this.bodyMatrix=bodyMatrix;
|
|
63
|
+
if(this.structure.body)this.remove(this.structure.body);
|
|
64
|
+
this.structure.body=tbody()
|
|
65
|
+
this.append(this.structure.body);
|
|
66
|
+
this.structure.body.append(...MatrixToTableUI(this.bodyMatrix))
|
|
67
|
+
//this.structure.body.append(...MatrixToTableUI(matrix))
|
|
68
|
+
//this.cellStyles({ padding: "0.2rem 0.4rem", textAlign: "center" });
|
|
69
|
+
return this;
|
|
70
|
+
}
|
|
71
|
+
transpose() {
|
|
72
|
+
this.fromMatrix(this.bodyMatrix.T);
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
hstack(m) {
|
|
76
|
+
if(m instanceof ZikoUITable)m=m.bodyMatrix
|
|
77
|
+
this.fromMatrix(this.bodyMatrix.clone.hstack(m));
|
|
78
|
+
return this;
|
|
79
|
+
}
|
|
80
|
+
vstack(m) {
|
|
81
|
+
if(m instanceof ZikoUITable)m=m.bodyMatrix
|
|
82
|
+
this.fromMatrix(this.bodyMatrix.clone.vstack(m));
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
slice(r0=0,c0=0,r1=this.bodyMatrix.rows-1,c1=this.bodyMatrix.cols-1) {
|
|
86
|
+
this.fromMatrix(this.bodyMatrix.slice(r0,c0,r1,c1));
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
sortByCols(n, config = { type: "num", order: "asc" }) {
|
|
90
|
+
this.fromMatrix(this.bodyMatrix.clone.sortTable(n, config));
|
|
91
|
+
return this;
|
|
92
|
+
}
|
|
93
|
+
sortByRows(n, config = { type: "num", order: "asc" }) {
|
|
94
|
+
this.fromMatrix(this.bodyMatrix.T.clone.sortTable(n, config).T);
|
|
95
|
+
return this;
|
|
96
|
+
}
|
|
97
|
+
filterByRows(item) {
|
|
98
|
+
this.fromMatrix(this.bodyMatrix.clone.filterByRows(item));
|
|
99
|
+
return this;
|
|
100
|
+
}
|
|
101
|
+
filterByCols(item) {
|
|
102
|
+
this.fromMatrix(this.bodyMatrix.clone.filterByCols(item));
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
forEachRow(callback){
|
|
106
|
+
this.structure.body.forEach(callback);
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
109
|
+
forEachItem(callback){
|
|
110
|
+
this.structure.body.forEach(n=>n.forEach(callback));
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const Table=(matrix,config)=>new ZikoUITable(matrix,config)
|
|
115
|
+
export {Table}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { td,tr } from "./elements.js";
|
|
2
|
+
export const MatrixToTableUI=matrix=>{
|
|
3
|
+
var Tr = new Array(matrix.rows).fill(null).map(() => tr());
|
|
4
|
+
var Td = matrix.arr.map((n) => n.map(() => null));
|
|
5
|
+
for (let i = 0; i < Td.length; i++) {
|
|
6
|
+
for (let j = 0; j < Td[0].length; j++) {
|
|
7
|
+
Td[i][j] = td(matrix.arr[i][j]);
|
|
8
|
+
Tr[i].append(Td[i][j]);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return Tr
|
|
12
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
import ZikoContainerElement from "../ZikoUIContainerElement.js";
|
|
3
|
+
import {
|
|
4
|
+
ZikoUISubText,
|
|
5
|
+
ZikoUISupText
|
|
6
|
+
} from "./text.js";
|
|
7
|
+
import {
|
|
8
|
+
Complex,
|
|
9
|
+
Matrix
|
|
10
|
+
} from "../../../../math/index.js";
|
|
11
|
+
import {
|
|
12
|
+
arr2str,
|
|
13
|
+
obj2str
|
|
14
|
+
} from "../../../../data/index.js";
|
|
15
|
+
class __ZikoUIText__ extends ZikoContainerElement {
|
|
16
|
+
constructor(tag, name, lineBreak,...value) {
|
|
17
|
+
super(tag, name);
|
|
18
|
+
this.addValue(...value);
|
|
19
|
+
this.style({margin:0,padding:0});
|
|
20
|
+
Object.assign(this.cache,{
|
|
21
|
+
lineBreak,
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
get isText(){
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
get value(){
|
|
28
|
+
return this.element.textContent;
|
|
29
|
+
}
|
|
30
|
+
clear() {
|
|
31
|
+
this.element.childNodes.forEach((e) => e.remove());
|
|
32
|
+
this.element.textContent = "";
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
addValue(...value) {
|
|
36
|
+
value.forEach((item,i) => {
|
|
37
|
+
if (typeof item === "string" || typeof item === "number") this.element?.appendChild(globalThis?.document.createTextNode(item));
|
|
38
|
+
else if (item instanceof ZikoUIElement) this.element?.appendChild(item.element);
|
|
39
|
+
else if (item instanceof Complex || item instanceof Matrix) this.element?.appendChild(new Text(item.toString()));
|
|
40
|
+
else if (item instanceof Array) this.element?.appendChild(new Text(arr2str(item)));
|
|
41
|
+
else if (item instanceof Object) this.element?.appendChild(new Text(obj2str(item)));
|
|
42
|
+
|
|
43
|
+
// if(
|
|
44
|
+
// (item !== value[value.length - 1])
|
|
45
|
+
// && !(value[i+1] instanceof ZikoUIElement)
|
|
46
|
+
// && !(value[i-1] instanceof ZikoUIElement)
|
|
47
|
+
// ) this.element?.appendChild(new Text(" "))
|
|
48
|
+
|
|
49
|
+
if(this.cache.lineBreak)this.element?.appendChild(globalThis.document?.createElement("br"));
|
|
50
|
+
});
|
|
51
|
+
if(this.element?.innerHTML){
|
|
52
|
+
this.element.innerHTML = this.element.innerHTML.replace(/\n/g, '<br>').replace(/(?<!<[^>]+) /g, ' ');
|
|
53
|
+
}
|
|
54
|
+
return this
|
|
55
|
+
}
|
|
56
|
+
setValue(...value) {
|
|
57
|
+
this.clear();
|
|
58
|
+
this.addValue(...value);
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class __ZikoUIInlineText__ extends __ZikoUIText__{
|
|
63
|
+
constructor(tag, name,...value){
|
|
64
|
+
super(tag, name, ...value)
|
|
65
|
+
this.cache.breakLine=false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
__ZikoUIText__,
|
|
70
|
+
__ZikoUIInlineText__
|
|
71
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ZikoUIElement from "../ZikoUIElement.js";
|
|
2
|
+
class ZikoUIHeading extends ZikoUIElement {
|
|
3
|
+
constructor(type = 1, value = "") {
|
|
4
|
+
super(`h${type}`,`h${type}`);
|
|
5
|
+
this.element.textContent = value;
|
|
6
|
+
}
|
|
7
|
+
get isHeading(){
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
get value() {
|
|
11
|
+
return this.element.innerText;
|
|
12
|
+
}
|
|
13
|
+
setValue(text = "") {
|
|
14
|
+
this.element.innerText = text;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
addValue(text = "") {
|
|
18
|
+
this.element.innerText += text;
|
|
19
|
+
return this;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const h1=(text="")=>new ZikoUIHeading(1, text);
|
|
23
|
+
const h2=(text="")=>new ZikoUIHeading(2, text);
|
|
24
|
+
const h3=(text="")=>new ZikoUIHeading(3, text);
|
|
25
|
+
const h4=(text="")=>new ZikoUIHeading(4, text);
|
|
26
|
+
const h5=(text="")=>new ZikoUIHeading(5, text);
|
|
27
|
+
const h6=(text="")=>new ZikoUIHeading(6, text);
|
|
28
|
+
export{
|
|
29
|
+
h1,
|
|
30
|
+
h2,
|
|
31
|
+
h3,
|
|
32
|
+
h4,
|
|
33
|
+
h5,
|
|
34
|
+
h6,
|
|
35
|
+
ZikoUIHeading
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { __ZikoUIText__ } from "./__ZikoUIText__.js";
|
|
2
|
+
class ZikoUIParagraphe extends __ZikoUIText__ {
|
|
3
|
+
constructor(...value) {
|
|
4
|
+
super("p", "p", true, ...value);
|
|
5
|
+
}
|
|
6
|
+
get isPara(){
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class ZikoUIBlockQuote extends __ZikoUIText__ {
|
|
11
|
+
constructor(cite,quote) {
|
|
12
|
+
super("blockquote", "blockquote", true, quote);
|
|
13
|
+
this.setAttr("cite", cite);
|
|
14
|
+
}
|
|
15
|
+
get isBlockQuote(){
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const p = (...ZikoUIElement) => new ZikoUIParagraphe(...ZikoUIElement);
|
|
20
|
+
const blockQuote = (cite, quote) => new ZikoUIBlockQuote(cite, quote);
|
|
21
|
+
export {
|
|
22
|
+
p,
|
|
23
|
+
blockQuote,
|
|
24
|
+
ZikoUIParagraphe,
|
|
25
|
+
ZikoUIBlockQuote
|
|
26
|
+
}
|
|
File without changes
|