ziko 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ziko.cjs +10000 -9874
- package/dist/ziko.js +10001 -9875
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +9998 -9873
- package/package.json +15 -5
- package/starter/bin/index.js +10 -0
- package/wrapper/react/README.md +26 -0
- package/wrapper/react/index.jsx +22 -0
- package/wrapper/svelte/ZikoUI.svelte +15 -0
- package/wrapper/vue/ZikoUI.vue +23 -0
- package/src/App/Accessibility/index.js +0 -0
- package/src/App/Globals/__Target__.js +0 -3
- package/src/App/Globals/__UI__.js +0 -38
- package/src/App/Globals/__init__.js +0 -8
- package/src/App/Globals/index.js +0 -3
- package/src/App/Router/index.js +0 -40
- package/src/App/Seo/index.js +0 -43
- package/src/App/Themes/dark.js +0 -885
- package/src/App/Themes/index.js +0 -11
- package/src/App/Themes/light.js +0 -255
- package/src/App/app.js +0 -46
- package/src/App/index.js +0 -11
- package/src/Data/Api/fetchdom.js +0 -14
- package/src/Data/Api/index.js +0 -4
- package/src/Data/Api/preload.js +0 -11
- package/src/Data/Converter/canvas.js +0 -25
- package/src/Data/Converter/csv.js +0 -33
- package/src/Data/Converter/index.js +0 -25
- package/src/Data/Converter/json.js +0 -80
- package/src/Data/Converter/markdown.js +0 -83
- package/src/Data/Converter/svg.js +0 -11
- package/src/Data/Parser/markdown.js +0 -0
- package/src/Data/Parser/xml.js +0 -47
- package/src/Data/Strings/index.js +0 -26
- package/src/Data/decorators.js +0 -0
- package/src/Data/index.js +0 -64
- package/src/Graphics/Canvas/Elements/Basic/arc.js +0 -43
- package/src/Graphics/Canvas/Elements/Basic/image.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/line.js +0 -26
- package/src/Graphics/Canvas/Elements/Basic/path.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/points.js +0 -48
- package/src/Graphics/Canvas/Elements/Basic/polygon.js +0 -7
- package/src/Graphics/Canvas/Elements/Basic/polyline.js +0 -0
- package/src/Graphics/Canvas/Elements/Basic/rect.js +0 -46
- 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 +0 -2
- package/src/Graphics/Canvas/Elements/Chart/stem.js +0 -0
- package/src/Graphics/Canvas/Elements/Element.js +0 -115
- 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 +0 -13
- 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 +0 -8
- package/src/Graphics/Canvas/Utils/floodFill.js +0 -58
- package/src/Graphics/Canvas/_canvas_offscreen +0 -0
- package/src/Graphics/Canvas/canvas.js +0 -189
- package/src/Graphics/Canvas/index.js +0 -15
- package/src/Graphics/Svg/Elements/ZikoSvgElement.js +0 -28
- package/src/Graphics/Svg/Elements/circle.js +0 -34
- package/src/Graphics/Svg/Elements/ellipse.js +0 -29
- package/src/Graphics/Svg/Elements/foreignObject.js +0 -46
- package/src/Graphics/Svg/Elements/grid.js +0 -9
- package/src/Graphics/Svg/Elements/groupe.js +0 -29
- package/src/Graphics/Svg/Elements/image.js +0 -33
- package/src/Graphics/Svg/Elements/line.js +0 -29
- package/src/Graphics/Svg/Elements/path.js +0 -59
- package/src/Graphics/Svg/Elements/polygon.js +0 -31
- package/src/Graphics/Svg/Elements/polyline.js +0 -4
- package/src/Graphics/Svg/Elements/rect.js +0 -43
- package/src/Graphics/Svg/Elements/text.js +0 -26
- package/src/Graphics/Svg/index.js +0 -1
- package/src/Graphics/Svg/svg.js +0 -117
- package/src/Graphics/index.js +0 -61
- package/src/Math/Calculus/Special Functions/bessel.js +0 -31
- package/src/Math/Calculus/Special Functions/beta.js +0 -38
- package/src/Math/Calculus/Special Functions/gamma.js +0 -30
- package/src/Math/Calculus/Special Functions/index.js +0 -4
- package/src/Math/Calculus/index.js +0 -1
- package/src/Math/Complex/Fractals/julia.js +0 -0
- package/src/Math/Complex/index.js +0 -191
- package/src/Math/Discret/Combinaison/index.js +0 -34
- package/src/Math/Discret/Conversion/index.js +0 -86
- package/src/Math/Discret/Logic/index.js +0 -46
- package/src/Math/Discret/Permutation/index.js +0 -31
- package/src/Math/Discret/Set/index.js +0 -2
- package/src/Math/Discret/Set/powerSet.js +0 -15
- package/src/Math/Discret/Set/subSet.js +0 -10
- package/src/Math/Discret/index.js +0 -23
- package/src/Math/Functions/index.js +0 -182
- package/src/Math/Matrix/Decomposition.js +0 -90
- package/src/Math/Matrix/LinearSystem.js +0 -10
- package/src/Math/Matrix/Matrix.js +0 -712
- package/src/Math/Matrix/index.js +0 -3
- package/src/Math/Numeric/index.js +0 -0
- package/src/Math/Random/index.js +0 -173
- package/src/Math/Signal/__np.py.txt +0 -40
- package/src/Math/Signal/conv.js +0 -175
- package/src/Math/Signal/fft.js +0 -55
- package/src/Math/Signal/filter.js +0 -39
- package/src/Math/Signal/functions.js +0 -146
- package/src/Math/Signal/index.js +0 -110
- package/src/Math/Statistics/Functions/index.js +0 -100
- package/src/Math/Statistics/index.js +0 -16
- package/src/Math/Utils/arithmetic.js +0 -139
- package/src/Math/Utils/checkers.js +0 -11
- package/src/Math/Utils/comparaison.js +0 -1
- package/src/Math/Utils/conversions.js +0 -7
- package/src/Math/Utils/discret.js +0 -28
- package/src/Math/Utils/index.js +0 -102
- package/src/Math/Utils/mapfun.js +0 -43
- package/src/Math/absract.js +0 -1
- package/src/Math/const.js +0 -3
- package/src/Math/index.js +0 -193
- package/src/Reactivity/Events/Global/Click.js +0 -56
- package/src/Reactivity/Events/Global/Clipboard.js +0 -84
- package/src/Reactivity/Events/Global/CustomEvent.js +0 -53
- package/src/Reactivity/Events/Global/Drag.js +0 -137
- package/src/Reactivity/Events/Global/Focus.js +0 -56
- package/src/Reactivity/Events/Global/Key.js +0 -104
- package/src/Reactivity/Events/Global/Mouse.js +0 -230
- package/src/Reactivity/Events/Global/Pointer.js +0 -214
- package/src/Reactivity/Events/Global/Touch.js +0 -0
- package/src/Reactivity/Events/Global/Wheel.js +0 -44
- package/src/Reactivity/Events/Partiel/Hash.js +0 -44
- package/src/Reactivity/Events/Partiel/Input.js +0 -59
- package/src/Reactivity/Events/Partiel/MediaEvent.js +0 -1
- package/src/Reactivity/Events/ZikoEvent.js +0 -91
- package/src/Reactivity/Events/index.js +0 -60
- package/src/Reactivity/Observer/index.js +0 -3
- package/src/Reactivity/Observer/intersection.js +0 -40
- package/src/Reactivity/Observer/mutation.js +0 -90
- package/src/Reactivity/Observer/resize.js +0 -47
- package/src/Reactivity/Use/Contexte/index.js +0 -1
- package/src/Reactivity/Use/Contexte/useSuccesifKeys.js +0 -14
- package/src/Reactivity/Use/Decorators/index.js +0 -4
- package/src/Reactivity/Use/Interactions/index.js +0 -4
- package/src/Reactivity/Use/Interactions/useBluetooth.js +0 -48
- package/src/Reactivity/Use/Interactions/useChannel.js +0 -50
- package/src/Reactivity/Use/Interactions/useEventEmmiter.js +0 -64
- package/src/Reactivity/Use/Interactions/useSerial.js +0 -0
- package/src/Reactivity/Use/Interactions/useThread.js +0 -44
- package/src/Reactivity/Use/Interactions/useUsb.js +0 -0
- package/src/Reactivity/Use/Sensors/index.js +0 -2
- package/src/Reactivity/Use/Sensors/useBattery.js +0 -36
- package/src/Reactivity/Use/Sensors/useCamera.js +0 -0
- package/src/Reactivity/Use/Sensors/useGeolocation.js +0 -17
- 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 +0 -1
- 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 +0 -74
- package/src/Reactivity/Use/UI/index.js +0 -4
- package/src/Reactivity/Use/UI/useCssLink.js +0 -0
- package/src/Reactivity/Use/UI/useCssText.js +0 -21
- package/src/Reactivity/Use/UI/useFavIcon.js +0 -38
- package/src/Reactivity/Use/UI/useLinearGradient.js +0 -0
- package/src/Reactivity/Use/UI/useMediaQuery.js +0 -1
- package/src/Reactivity/Use/UI/useRadialGradient.js +0 -0
- package/src/Reactivity/Use/UI/useStyle.js +0 -54
- package/src/Reactivity/Use/UI/useTheme.js +0 -62
- package/src/Reactivity/Use/UI/useTitle.js +0 -30
- package/src/Reactivity/Use/index.js +0 -82
- package/src/Reactivity/Use/todo.md +0 -26
- package/src/Reactivity/index.js +0 -3
- package/src/Time/animation.js +0 -76
- package/src/Time/index.js +0 -54
- package/src/Time/loop.js +0 -83
- package/src/Time/utils/decorators.js +0 -17
- package/src/Time/utils/ease.js +0 -144
- package/src/Time/utils/index.js +0 -18
- package/src/Time/utils/performance.js +0 -16
- package/src/Time/utils/ui.js +0 -26
- package/src/UI/CustomElement/Elements/Accordion/index.js +0 -62
- package/src/UI/CustomElement/Elements/Carousel/index.js +0 -47
- package/src/UI/CustomElement/Elements/CodeNote/CodeCell.js +0 -176
- package/src/UI/CustomElement/Elements/CodeNote/CodeNote.js +0 -69
- package/src/UI/CustomElement/Elements/CodeNote/SubElements.js +0 -64
- package/src/UI/CustomElement/Elements/CodeNote/index.js +0 -2
- package/src/UI/CustomElement/Elements/Columns.js +0 -1
- 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 +0 -4
- package/src/UI/CustomElement/Elements/Tabs/index.js +0 -111
- 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 +0 -4
- package/src/UI/CustomElement/Flex.js +0 -97
- package/src/UI/CustomElement/Grid.js +0 -30
- package/src/UI/CustomElement/index.js +0 -3
- package/src/UI/Embaded/index.js +0 -1
- package/src/UI/Inputs/Primitives/btn.js +0 -31
- package/src/UI/Inputs/Primitives/elements.js +0 -28
- package/src/UI/Inputs/Primitives/inputs.js +0 -334
- package/src/UI/Inputs/Primitives/select.js +0 -15
- package/src/UI/Inputs/Primitives/textarea.js +0 -16
- package/src/UI/Inputs/camera.js +0 -23
- package/src/UI/Inputs/index.js +0 -20
- package/src/UI/List/elements.js +0 -0
- package/src/UI/List/index.js +0 -130
- package/src/UI/Media/Audio/index.js +0 -39
- package/src/UI/Media/Image/figure.js +0 -17
- package/src/UI/Media/Image/image.js +0 -34
- package/src/UI/Media/Image/index.js +0 -2
- package/src/UI/Media/Video/index.js +0 -50
- package/src/UI/Media/index.js +0 -3
- package/src/UI/Misc/index.js +0 -49
- package/src/UI/Semantic/index.js +0 -68
- package/src/UI/Style/index.js +0 -499
- package/src/UI/Table/elements.js +0 -94
- package/src/UI/Table/index.js +0 -3
- package/src/UI/Table/table.js +0 -113
- package/src/UI/Table/utils.js +0 -12
- package/src/UI/Text/heading.js +0 -35
- package/src/UI/Text/index.js +0 -3
- package/src/UI/Text/p.js +0 -37
- package/src/UI/Text/pre.js +0 -0
- package/src/UI/Text/text.js +0 -66
- package/src/UI/Utils/index.js +0 -70
- package/src/UI/ZikoUIElement.js +0 -501
- package/src/UI/index.js +0 -154
- package/src/__proto__/Array.js +0 -74
- package/src/__proto__/Function.js +0 -0
- package/src/__proto__/Number.js +0 -76
- package/src/__proto__/Object.js +0 -0
- package/src/__proto__/String.js +0 -0
- package/src/index.js +0 -70
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const time_memory_Taken = (callback) => {
|
|
2
|
-
const t0 = Date.now();
|
|
3
|
-
const m0 = performance.memory.usedJSHeapSize;
|
|
4
|
-
const result = callback();
|
|
5
|
-
const t1 = Date.now();
|
|
6
|
-
const m1 = performance.memory.usedJSHeapSize;
|
|
7
|
-
const elapsedTime = t1 - t0;
|
|
8
|
-
const usedMemory = m1 - m0;
|
|
9
|
-
return {
|
|
10
|
-
elapsedTime,
|
|
11
|
-
usedMemory,
|
|
12
|
-
result
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export {time_memory_Taken}
|
|
16
|
-
|
package/src/Time/utils/ui.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const waitForUIElm=(UIElement)=>{
|
|
2
|
-
return new Promise(resolve => {
|
|
3
|
-
if (UIElement.element) {
|
|
4
|
-
return resolve(UIElement.element);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
const observer = new MutationObserver(() => {
|
|
8
|
-
if (UIElement.element) {
|
|
9
|
-
resolve(UIElement.element);
|
|
10
|
-
observer.disconnect();
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
observer.observe(document.body, {
|
|
15
|
-
childList: true,
|
|
16
|
-
subtree: true
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
const waitForUIElmSync=(UIElement,timeout=2000)=>{
|
|
21
|
-
const t0=Date.now();
|
|
22
|
-
while(Date.now()-t0<timeout){
|
|
23
|
-
if(UIElement.element)return UIElement.element
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export {waitForUIElm,waitForUIElmSync}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../../ZikoUIElement";
|
|
2
|
-
import { ZikoUIFlex } from "../../Flex";
|
|
3
|
-
import { ZikoHtml } from "../../../Misc";
|
|
4
|
-
class ZikoUIAccordion extends ZikoUIElement{
|
|
5
|
-
constructor(summary,content,icon="😁"){
|
|
6
|
-
super("details","Accordion")
|
|
7
|
-
this.summary=ZikoHtml("summary",summary).style({
|
|
8
|
-
fontSize:"1.1em",
|
|
9
|
-
padding:"0.625rem",
|
|
10
|
-
fontWeight:"bold",
|
|
11
|
-
listStyleType:`"${icon}"`,
|
|
12
|
-
cursor:"pointer",
|
|
13
|
-
});
|
|
14
|
-
this.summary[0].style({
|
|
15
|
-
marginLeft:"0.5em",
|
|
16
|
-
})
|
|
17
|
-
this.content=content.style({
|
|
18
|
-
margin:"0.7em",
|
|
19
|
-
});
|
|
20
|
-
this.append(this.summary,this.content);
|
|
21
|
-
this.style({
|
|
22
|
-
marginBottom:"0.7em",
|
|
23
|
-
})
|
|
24
|
-
this.render();
|
|
25
|
-
}
|
|
26
|
-
get isOpen(){
|
|
27
|
-
return this.element.open;
|
|
28
|
-
}
|
|
29
|
-
open(){
|
|
30
|
-
this.element.open=true;
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
onOpen(callback){
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
close(){
|
|
37
|
-
this.element.open=true;
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
onClose(callback){
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
toggle(){
|
|
44
|
-
this.element.open=!this.element.open;
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
class ZikoUIAccordions extends ZikoUIFlex{
|
|
49
|
-
constructor(){
|
|
50
|
-
super();
|
|
51
|
-
}
|
|
52
|
-
addPair(controller,details){
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const Accordion=(summary,content,icon)=>new ZikoUIAccordion(summary,content,icon);
|
|
58
|
-
export{
|
|
59
|
-
Accordion
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Watch open using Mutation observer
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ZikoUIFlex } from "../../Flex";
|
|
2
|
-
class ZikoUICarousel extends ZikoUIFlex{
|
|
3
|
-
constructor(...ZikoUIElement){
|
|
4
|
-
super()
|
|
5
|
-
this.style({
|
|
6
|
-
position:"relative",
|
|
7
|
-
overflow:"hidden",
|
|
8
|
-
touchAction:"none",
|
|
9
|
-
userSelect:"none"
|
|
10
|
-
});
|
|
11
|
-
this.horizontal("space-around",0);
|
|
12
|
-
this.track = Section(...ZikoUIElement).style({ display: "inline-flex" });
|
|
13
|
-
this.track.size(this.track.children.length * 100 + "vw");
|
|
14
|
-
this.track.setTarget(this);
|
|
15
|
-
this.track.items.map((n) =>
|
|
16
|
-
n.style({ pointerEvents: "none", margin: "auto 10px" })
|
|
17
|
-
);
|
|
18
|
-
this.x0 = null;
|
|
19
|
-
this.tx = 0;
|
|
20
|
-
this.onPtrMove(e=>{
|
|
21
|
-
if(e.isDown){
|
|
22
|
-
let x = e.event.pageX;
|
|
23
|
-
let dx = x - this.x0;
|
|
24
|
-
this.track.st.translateX(
|
|
25
|
-
this.tx + dx,
|
|
26
|
-
0
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
this.onPtrDown(e=>{
|
|
31
|
-
console.log(e.event)
|
|
32
|
-
this.x0 = e.event.pageX;
|
|
33
|
-
const transformMatrix = window
|
|
34
|
-
.getComputedStyle(this.track.element)
|
|
35
|
-
.getPropertyValue("transform");
|
|
36
|
-
if (transformMatrix !== "none") {
|
|
37
|
-
this.tx = +transformMatrix.split(",")[4];
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
this.onPtrUp(e=>console.log(e.isDown));
|
|
41
|
-
this.onPtrLeave(e=>{
|
|
42
|
-
// Handle outside up
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const Carousel=(...ZikoUIElement)=>new ZikoUICarousel(...ZikoUIElement);
|
|
47
|
-
export {Carousel}
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { Flex, ZikoUIFlex } from "../../Flex";
|
|
2
|
-
import { ZikoUICodeNote } from "./CodeNote";
|
|
3
|
-
import {
|
|
4
|
-
Input,
|
|
5
|
-
Output,
|
|
6
|
-
Right,
|
|
7
|
-
Left
|
|
8
|
-
} from "./SubElements";
|
|
9
|
-
class ZikoUICodeCell extends ZikoUIFlex{
|
|
10
|
-
constructor(code="",{type="js",order=null}={}){
|
|
11
|
-
super("section")
|
|
12
|
-
Object.assign(this.cache,{
|
|
13
|
-
state:null,
|
|
14
|
-
order,
|
|
15
|
-
type,
|
|
16
|
-
metadata:{
|
|
17
|
-
created:Date.now(),
|
|
18
|
-
updated:null
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
this.Input=Input(code);
|
|
22
|
-
this.Output=Output();
|
|
23
|
-
this.InOut=Flex(
|
|
24
|
-
this.Input,
|
|
25
|
-
this.Output
|
|
26
|
-
).vertical().style({
|
|
27
|
-
width:"100%",
|
|
28
|
-
margin:"10px auto"
|
|
29
|
-
});
|
|
30
|
-
this.RightControl=Right(this);
|
|
31
|
-
this.LeftControl=Left(this)
|
|
32
|
-
this.append(
|
|
33
|
-
this.LeftControl,
|
|
34
|
-
this.InOut,
|
|
35
|
-
this.RightControl
|
|
36
|
-
)
|
|
37
|
-
this.horizontal(-1,1).style({
|
|
38
|
-
//background:"#444",
|
|
39
|
-
width:"95vw",
|
|
40
|
-
margin:"0 auto",
|
|
41
|
-
border:"1px darkblue dotted"
|
|
42
|
-
})
|
|
43
|
-
this.Input.onKeyDown(e=>{
|
|
44
|
-
if(e.kd==="Enter"){
|
|
45
|
-
if(e.event.shiftKey){
|
|
46
|
-
e.event.preventDefault();
|
|
47
|
-
this.execute(this.cache.order);
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
//console.log(this.Input.element.firstChild.firstChild.textContent.at(-1))
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
54
|
-
if(e.kd==="ArrowDown" && e.event.shiftKey ){
|
|
55
|
-
this.cache.parent.next();
|
|
56
|
-
}
|
|
57
|
-
if(e.kd==="ArrowUp" && e.event.shiftKey){
|
|
58
|
-
this.cache.parent.previous();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
this.Input.onFocus(()=>{
|
|
64
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
65
|
-
this.cache.parent.cache.currentNote=this;
|
|
66
|
-
this.cache.parent.setCurrentNote(this);
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
this.Input.onPaste((e)=>{
|
|
70
|
-
//e.event.preventDefault();
|
|
71
|
-
//this.setValue(this.codeText.trim())
|
|
72
|
-
})
|
|
73
|
-
// this.Input.onKeyPress(e=>{
|
|
74
|
-
// if(e.kp==="(")a.Input.element.textContent+=")";
|
|
75
|
-
// if(e.kp==="[")a.Input.element.textContent+="]";
|
|
76
|
-
// if(e.kp==="{")a.Input.element.textContent+="}";
|
|
77
|
-
// })
|
|
78
|
-
}
|
|
79
|
-
// space  
|
|
80
|
-
get codeText() {
|
|
81
|
-
return this.Input.element.innerText.trim();
|
|
82
|
-
}
|
|
83
|
-
get codeHTML() {
|
|
84
|
-
return this.Input.element.innerHTML;
|
|
85
|
-
}
|
|
86
|
-
get outputHTML(){
|
|
87
|
-
return this.Output.element.innerHTML;
|
|
88
|
-
}
|
|
89
|
-
setValue(codeText){
|
|
90
|
-
this.Input[0].setValue(codeText);
|
|
91
|
-
return this;
|
|
92
|
-
}
|
|
93
|
-
cellData(){
|
|
94
|
-
return {
|
|
95
|
-
input:this.codeText,
|
|
96
|
-
output:this.outputHTML,
|
|
97
|
-
order:this.cache.order,
|
|
98
|
-
type:this.cache.type
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
execute(order){
|
|
102
|
-
this.clearOutput();
|
|
103
|
-
this.evaluate(order);
|
|
104
|
-
this.cache.metadata.updated=Date.now();
|
|
105
|
-
return this;
|
|
106
|
-
}
|
|
107
|
-
#evaluateJs(order){
|
|
108
|
-
try{
|
|
109
|
-
this.LeftControl[0].setValue("pending");
|
|
110
|
-
this.cache.state="pending";
|
|
111
|
-
globalThis.eval(this.Input.element.innerText);
|
|
112
|
-
}
|
|
113
|
-
catch(err){
|
|
114
|
-
console.log(err)
|
|
115
|
-
text(`Error : ${err.message}`).style({
|
|
116
|
-
color:"red",
|
|
117
|
-
background:"gold",
|
|
118
|
-
border:"2px red solid",
|
|
119
|
-
padding:"10px",
|
|
120
|
-
margin:"10px 0",
|
|
121
|
-
display:"flex",
|
|
122
|
-
justifyContent: "center",
|
|
123
|
-
});
|
|
124
|
-
this.LeftControl[0].setValue("Err");
|
|
125
|
-
this.cache.state="Error";
|
|
126
|
-
}
|
|
127
|
-
finally{
|
|
128
|
-
if(this.cache.state==="pending"){
|
|
129
|
-
this.cache.state="success";
|
|
130
|
-
this.setOrder(order);
|
|
131
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
132
|
-
this.cache.parent.incrementOrder();
|
|
133
|
-
this.cache.parent.next();
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
#evaluateMd(){
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
#evaluateHtml(){
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
evaluate(order){
|
|
145
|
-
globalThis.__Target__=this.Output.element;
|
|
146
|
-
switch(this.cache.type){
|
|
147
|
-
case "js":this.#evaluateJs(order);break;
|
|
148
|
-
}
|
|
149
|
-
return this;
|
|
150
|
-
}
|
|
151
|
-
clearInput(){
|
|
152
|
-
this.Output.element.innerText="";
|
|
153
|
-
return this;
|
|
154
|
-
}
|
|
155
|
-
clearOutput(){
|
|
156
|
-
this.Output.element.innerText="";
|
|
157
|
-
return this;
|
|
158
|
-
}
|
|
159
|
-
setOrder(order,render=true){
|
|
160
|
-
this.cache.order=order;
|
|
161
|
-
if(render){
|
|
162
|
-
(typeof order === "number")?this.LeftControl[0].setValue(`[${order}]`):this.LeftControl[0].setValue("[-]");
|
|
163
|
-
}
|
|
164
|
-
return this;
|
|
165
|
-
}
|
|
166
|
-
focus(){
|
|
167
|
-
this.Input.element.focus();
|
|
168
|
-
return this;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
const CodeCell=(codeText,{type,order}={})=>new ZikoUICodeCell(codeText,{type,order});
|
|
174
|
-
export{
|
|
175
|
-
CodeCell
|
|
176
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { ZikoUIFlex } from "../../Flex";
|
|
2
|
-
import { CodeCell } from "./CodeCell";
|
|
3
|
-
class ZikoUICodeNote extends ZikoUIFlex{
|
|
4
|
-
constructor(){
|
|
5
|
-
super("section");
|
|
6
|
-
Object.assign(this.cache,{
|
|
7
|
-
order:0,
|
|
8
|
-
currentNote:null,
|
|
9
|
-
currentNoteIndex:null
|
|
10
|
-
})
|
|
11
|
-
this.vertical(0,0);
|
|
12
|
-
}
|
|
13
|
-
setCurrentNote(currentNote){
|
|
14
|
-
this.cache.currentNote=currentNote;
|
|
15
|
-
this.cache.currentNoteIndex=this.items.findIndex(n=>n===currentNote);
|
|
16
|
-
currentNote.focus();
|
|
17
|
-
this.items.forEach(n=>n.Input.style({
|
|
18
|
-
border: "1px solid #ccc"
|
|
19
|
-
}))
|
|
20
|
-
currentNote.Input.style({
|
|
21
|
-
border:"2px lightgreen solid"
|
|
22
|
-
});
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
addNote(text=""){
|
|
26
|
-
this.append(CodeCell(text));
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
execute(){
|
|
30
|
-
this.cache.currentNote.execute();
|
|
31
|
-
this.incrementOrder();
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
incrementOrder(){
|
|
35
|
-
this.cache.order++;
|
|
36
|
-
this.cache.currentNote.setOrder(this.cache.order);
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
next(){
|
|
40
|
-
if(this.cache.currentNote===this.items.at(-1)){
|
|
41
|
-
this.addNote();
|
|
42
|
-
this.setCurrentNote(this.items.at(-1));
|
|
43
|
-
}
|
|
44
|
-
else this.setCurrentNote(this.items[this.cache.currentNoteIndex+1]);
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
previous(){
|
|
48
|
-
// add append before
|
|
49
|
-
if(this.cache.currentNote!==this.items[0]){
|
|
50
|
-
this.setCurrentNote(this.items[this.cache.currentNoteIndex-1]);
|
|
51
|
-
}
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
data(){
|
|
55
|
-
return this.items.map(n=>n.cellData());
|
|
56
|
-
}
|
|
57
|
-
serialize(){
|
|
58
|
-
return JSON.stringify(this.data());
|
|
59
|
-
}
|
|
60
|
-
import(data=[]){
|
|
61
|
-
data.forEach((n,i)=>this.addNote(data[i].input));
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const CodeNote=()=>new ZikoUICodeNote();
|
|
66
|
-
export{
|
|
67
|
-
CodeNote,
|
|
68
|
-
ZikoUICodeNote
|
|
69
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ZikoHtml } from "../../../Misc";
|
|
2
|
-
import { Flex } from "../../Flex";
|
|
3
|
-
import { text } from "../../../Text";
|
|
4
|
-
import { ZikoUICodeNote } from "./CodeNote";
|
|
5
|
-
const Input=(codeText="")=>ZikoHtml("code",codeText).style({
|
|
6
|
-
width:"100%",
|
|
7
|
-
height:"auto",
|
|
8
|
-
padding:"10px",
|
|
9
|
-
boxSizing:"border-box",
|
|
10
|
-
border: "1px solid #ccc",
|
|
11
|
-
outline: "none",
|
|
12
|
-
fontSize: "1rem",
|
|
13
|
-
fontFamily: "Lucida Console, Courier New, monospace",
|
|
14
|
-
padding: "1rem 0.5rem",
|
|
15
|
-
wordBreak:"break-all",
|
|
16
|
-
background:"#f6f8fa",
|
|
17
|
-
color:"#0062C3"
|
|
18
|
-
}).setAttr("contenteditable",true).setAttr("spellcheck",false);
|
|
19
|
-
const Output=()=>ZikoHtml("output").style({
|
|
20
|
-
width:"100%",
|
|
21
|
-
height:"auto",
|
|
22
|
-
padding:"5px 0",
|
|
23
|
-
})
|
|
24
|
-
const Left=(ctx)=>Flex(
|
|
25
|
-
text("[ ]")
|
|
26
|
-
).style({
|
|
27
|
-
width:"50px",
|
|
28
|
-
//height:getComputedStyle(ctx.Input.element).height,
|
|
29
|
-
height:"50px",
|
|
30
|
-
margin:"10px 4px",
|
|
31
|
-
padding:"5px",
|
|
32
|
-
color:"darkblue",
|
|
33
|
-
borderBottom:"4px solid gold",
|
|
34
|
-
}).horizontal(0,0);
|
|
35
|
-
const BTN_STYLE={
|
|
36
|
-
background:"none",
|
|
37
|
-
width:"25px",
|
|
38
|
-
height:"25px",
|
|
39
|
-
fontSize:"1.2rem",
|
|
40
|
-
cursor:"pointer"
|
|
41
|
-
}
|
|
42
|
-
const Right=(ctx)=>Flex(
|
|
43
|
-
text('▶️').style(BTN_STYLE).onClick(e=>{
|
|
44
|
-
if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
|
|
45
|
-
ctx.execute();
|
|
46
|
-
globalThis.__Target__=e.target.parent.parent[1][1];
|
|
47
|
-
}),
|
|
48
|
-
text('📋').style(BTN_STYLE).onClick(()=>{
|
|
49
|
-
navigator.clipboard.writeText(ctx.codeText)
|
|
50
|
-
}),
|
|
51
|
-
text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
52
|
-
text('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
53
|
-
).style({
|
|
54
|
-
width:"70px",
|
|
55
|
-
height:"50px",
|
|
56
|
-
//background:"cyan",
|
|
57
|
-
margin:"10px 0"
|
|
58
|
-
}).horizontal(0,0).wrap(true);
|
|
59
|
-
export{
|
|
60
|
-
Input,
|
|
61
|
-
Output,
|
|
62
|
-
Right,
|
|
63
|
-
Left
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// dipslay table
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// Next
|
|
2
|
-
// Previous
|
|
3
|
-
// Vertical
|
|
4
|
-
// Horizontal
|
|
5
|
-
import { Flex, ZikoUIFlex } from "../../Flex";
|
|
6
|
-
class ZikoUITabs extends ZikoUIFlex{
|
|
7
|
-
#ACTIVE_ELEMENT_INDEX=0;
|
|
8
|
-
constructor(Controllers,Contents){
|
|
9
|
-
super("div","Tabs");
|
|
10
|
-
this.style({
|
|
11
|
-
boxSizing:"border-box",
|
|
12
|
-
backgroundColor: "blanchedalmond",
|
|
13
|
-
border:"1px red solid",
|
|
14
|
-
margin:"30px",
|
|
15
|
-
})
|
|
16
|
-
this.append(
|
|
17
|
-
Flex().size("auto","auto").style({
|
|
18
|
-
boxSizing:"border-box",
|
|
19
|
-
justifyContent:"center",
|
|
20
|
-
alignItems:"center",
|
|
21
|
-
textAlign:"center",
|
|
22
|
-
|
|
23
|
-
minWidth:"50px",
|
|
24
|
-
minHeight:"50px",
|
|
25
|
-
|
|
26
|
-
backgroundColor:"darkblue",
|
|
27
|
-
border:"1px darkblue solid",
|
|
28
|
-
|
|
29
|
-
}),
|
|
30
|
-
Flex().style({
|
|
31
|
-
boxSizing:"border-box",
|
|
32
|
-
justifyContent:"center",
|
|
33
|
-
alignItems:"center",
|
|
34
|
-
textAlign:"center",
|
|
35
|
-
|
|
36
|
-
width:"100%",
|
|
37
|
-
height:"100%",
|
|
38
|
-
backgroundColor:"darkslategrey",
|
|
39
|
-
})
|
|
40
|
-
)
|
|
41
|
-
this.Controller=this.items[0].setAttr("role","tablist");
|
|
42
|
-
this.Content=this.items[1];
|
|
43
|
-
if(Controllers.length!==Contents.length)console.error("")
|
|
44
|
-
else {
|
|
45
|
-
this.Controller.append(...Controllers);
|
|
46
|
-
this.Content.append(...Contents);
|
|
47
|
-
// Add transition
|
|
48
|
-
}
|
|
49
|
-
this.init()
|
|
50
|
-
this.display(0);
|
|
51
|
-
}
|
|
52
|
-
init(){
|
|
53
|
-
// Remove old listener
|
|
54
|
-
for(let i=0;i<this.Controller.length;i++){
|
|
55
|
-
this.Controller[i].setAttr("role","tab").setAttr("aria-controls",`tab${i}`);
|
|
56
|
-
this.Content[i].setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${i}`).setAttr("tabindex",-1);
|
|
57
|
-
}
|
|
58
|
-
this.Controller.forEach(item=>item.onClick(e=>{
|
|
59
|
-
const tab=e.target.element.getAttribute("aria-controls");
|
|
60
|
-
const index=+tab.slice(3)
|
|
61
|
-
this.Content.filter(n=>n.element.getAttribute("aria-labelledby")===tab,()=>{
|
|
62
|
-
if(this.#ACTIVE_ELEMENT_INDEX!==index)this.display(index);
|
|
63
|
-
})
|
|
64
|
-
}))
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
addPairs(ControllerItem,ContentItem){
|
|
68
|
-
this.Controller.append(ControllerItem);
|
|
69
|
-
this.Content.append(ContentItem);
|
|
70
|
-
const length=this.Controller.length;
|
|
71
|
-
this.Controller.at(-1).setAttr("role","tab").setAttr("aria-controls",`tab${length-1}`);
|
|
72
|
-
this.Content.at(-1).setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${length-1}`).setAttr("tabindex",-1);
|
|
73
|
-
// Add listener
|
|
74
|
-
return this;
|
|
75
|
-
}
|
|
76
|
-
removePairs(index){
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
display(index){
|
|
80
|
-
this.#ACTIVE_ELEMENT_INDEX=index%this.Content.length;
|
|
81
|
-
this.Controller.forEach(n=>n.setAttr("tabindex",-1).setAttr("aria-selected",false));
|
|
82
|
-
this.Controller.at(this.#ACTIVE_ELEMENT_INDEX).setAttr("tabindex",0).setAttr("aria-selected",true);
|
|
83
|
-
(async ()=>{
|
|
84
|
-
await this.Content.forEach(n=>n.st.hide());
|
|
85
|
-
await this.Content.at(this.#ACTIVE_ELEMENT_INDEX).setAttr("tabindex",0).st.show();
|
|
86
|
-
})()
|
|
87
|
-
|
|
88
|
-
return this;
|
|
89
|
-
}
|
|
90
|
-
next(i=1){
|
|
91
|
-
this.display(this.#ACTIVE_ELEMENT_INDEX+i);
|
|
92
|
-
return this;
|
|
93
|
-
}
|
|
94
|
-
previous(i=1){
|
|
95
|
-
this.display(this.#ACTIVE_ELEMENT_INDEX-i);
|
|
96
|
-
return this;
|
|
97
|
-
}
|
|
98
|
-
useHorizontalSwippe(){
|
|
99
|
-
this.onPtrDown();
|
|
100
|
-
this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_x)));
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
useVerticalSwippe(){
|
|
104
|
-
this.onPtrDown();
|
|
105
|
-
this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_y)));
|
|
106
|
-
return this;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const Tabs=(Controllers,Contents)=>new ZikoUITabs(Controllers,Contents)
|
|
111
|
-
export {Tabs}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|