ziko 0.37.0 → 0.38.0
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 +1160 -3365
- package/dist/ziko.js +6179 -8384
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +1153 -3251
- package/package.json +15 -13
- package/readme.md +79 -5
- package/src/__ziko__/__cache__.js +6 -0
- package/src/__ziko__/__config__.js +19 -0
- package/src/__ziko__/__hydration__.js +8 -0
- package/src/__ziko__/__ui__.js +22 -0
- package/src/__ziko__/index.js +16 -0
- package/src/__ziko__/params.js +40 -0
- package/src/app/globals.js +14 -0
- package/src/app/index.js +4 -4
- package/src/app/spa-file-based-routing.js +2 -2
- package/src/app/ziko-app.js +1 -1
- package/src/data/converter/svg.js +2 -2
- package/src/hooks/index.js +3 -0
- package/src/hooks/use-derived.js +61 -0
- package/src/hooks/use-reactive.js +7 -0
- package/src/hooks/use-state.js +47 -0
- package/src/index.js +1 -78
- package/src/math/complex/index.js +3 -0
- package/src/math/functions/index.js +23 -23
- package/src/math/functions/proxy.js +58 -0
- package/src/math/utils/mapfun.js +17 -21
- package/src/no-module.js +32 -0
- package/src/time/{animation.js → animation/index.js} +2 -2
- package/src/time/decorators/index.js +17 -0
- package/src/time/index.js +11 -12
- package/src/time/utils/index.js +0 -1
- package/src/ui/{methods → __methods__}/dom.js +15 -14
- package/src/ui/{utils → __utils__}/index.js +1 -1
- package/src/ui/constructors/{ziko-ui-element.js → ZikoUIElement.js} +9 -98
- package/src/ui/constructors/ZikoUIElementMethodesToBeMoved.js +96 -0
- package/src/ui/{style → constructors/style}/index.js +3 -3
- package/src/ui/{elements/flex → flex}/index.js +1 -1
- package/src/{graphics/canvas/index.js → ui/graphics/canvas.js} +4 -5
- package/src/ui/graphics/index.js +2 -0
- package/src/{graphics/svg/index.js → ui/graphics/svg.js} +1 -1
- package/src/ui/{elements/grid → grid}/index.js +1 -1
- package/src/ui/index.js +9 -40
- package/src/ui/{elements/misc/suspense.js → suspense/index.js} +1 -15
- package/src/ui/tags/index.js +3 -3
- package/src/ui/text/index.js +15 -0
- package/src/ui/{elements/misc/xml-wrapper.js → wrapper/index.js} +1 -1
- package/src/use/index.js +3 -7
- package/src/graphics/canvas/_canvas_offscreen +0 -0
- package/src/graphics/canvas/utils/color.js +0 -8
- package/src/graphics/canvas/utils/floodFill.js +0 -57
- package/src/graphics/index.js +0 -10
- package/src/time/utils/decorators.js +0 -17
- package/src/ui/elements/embaded/html.js +0 -20
- package/src/ui/elements/embaded/index.js +0 -3
- package/src/ui/elements/embaded/pdf.js +0 -17
- package/src/ui/elements/embaded/youtube.js +0 -24
- package/src/ui/elements/hydrate.js +0 -0
- package/src/ui/elements/index.js +0 -10
- package/src/ui/elements/io/Form/index.js +0 -42
- package/src/ui/elements/io/Form/index.js.txt +0 -104
- package/src/ui/elements/io/Inputs/__helpers__.js +0 -52
- package/src/ui/elements/io/Inputs/index.js +0 -12
- package/src/ui/elements/io/Inputs/input/index.js +0 -99
- package/src/ui/elements/io/Inputs/input-camera/index.js +0 -26
- package/src/ui/elements/io/Inputs/input-checkbox/index.js +0 -26
- package/src/ui/elements/io/Inputs/input-color/index.js +0 -16
- package/src/ui/elements/io/Inputs/input-date-time/index.js +0 -3
- package/src/ui/elements/io/Inputs/input-date-time/input-date-time.js +0 -14
- package/src/ui/elements/io/Inputs/input-date-time/input-date.js +0 -14
- package/src/ui/elements/io/Inputs/input-date-time/input-time.js +0 -14
- package/src/ui/elements/io/Inputs/input-email-password/index.js +0 -2
- package/src/ui/elements/io/Inputs/input-email-password/input-email.js +0 -15
- package/src/ui/elements/io/Inputs/input-email-password/input-password.js +0 -14
- package/src/ui/elements/io/Inputs/input-file/index.js +0 -1
- package/src/ui/elements/io/Inputs/input-file/input-file.js +0 -0
- package/src/ui/elements/io/Inputs/input-file/input-image.js +0 -43
- package/src/ui/elements/io/Inputs/input-number/index.js +0 -37
- package/src/ui/elements/io/Inputs/input-radio/index.js +0 -26
- package/src/ui/elements/io/Inputs/input-search/index.js +0 -45
- package/src/ui/elements/io/Inputs/input-slider/index.js +0 -34
- package/src/ui/elements/io/Select/index.js +0 -20
- package/src/ui/elements/io/Textarea/index.js +0 -18
- package/src/ui/elements/io/index.js +0 -4
- package/src/ui/elements/list/elements.js +0 -0
- package/src/ui/elements/list/index.js +0 -138
- package/src/ui/elements/media/Audio/index.js +0 -17
- package/src/ui/elements/media/Image/figure.js +0 -19
- package/src/ui/elements/media/Image/image.js +0 -37
- package/src/ui/elements/media/Image/index.js +0 -2
- package/src/ui/elements/media/Video/index.js +0 -27
- package/src/ui/elements/media/__ZikoUIDynamicMediaELement__.js +0 -47
- package/src/ui/elements/media/index.js +0 -3
- package/src/ui/elements/misc/hyperscript.js +0 -144
- package/src/ui/elements/misc/index.js +0 -101
- package/src/ui/elements/semantic/index.js +0 -42
- package/src/ui/elements/table/elements.js +0 -94
- package/src/ui/elements/table/index.js +0 -3
- package/src/ui/elements/table/table.js +0 -115
- package/src/ui/elements/table/utils.js +0 -12
- package/src/ui/elements/text/__ZikoUIText__.js +0 -70
- package/src/ui/elements/text/heading.js +0 -36
- package/src/ui/elements/text/index.js +0 -3
- package/src/ui/elements/text/p.js +0 -26
- package/src/ui/elements/text/pre.js +0 -0
- package/src/ui/elements/text/text.js +0 -81
- package/src/use/use-debounce.js +0 -4
- package/src/use/use-state.js +0 -22
- package/src/use/use-throttle.js +0 -9
- /package/src/reactivity/hooks/{Head → head}/_useCssText.js +0 -0
- /package/src/reactivity/hooks/{Head → head}/index.js +0 -0
- /package/src/reactivity/hooks/{Head → head}/useFavIcon.js +0 -0
- /package/src/reactivity/hooks/{Head → head}/useHead.js +0 -0
- /package/src/reactivity/hooks/{Head → head}/useMeta.js +0 -0
- /package/src/reactivity/hooks/{Head → head}/useTitle.js +0 -0
- /package/src/time/{loop.js → loop/index.js} +0 -0
- /package/src/ui/{methods → __methods__}/events.js +0 -0
- /package/src/ui/{methods → __methods__}/indexing.js +0 -0
- /package/src/ui/{methods → __methods__}/observer.js +0 -0
- /package/src/ui/{methods → __methods__}/style.js +0 -0
- /package/src/ui/constructors/{ziko-ui-node.js → ZikoUINode.js} +0 -0
- /package/src/ui/tags/{tags.js → tags-list.js} +0 -0
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ZikoUIInput } from "../input";
|
|
2
|
-
class ZikoUIInputPassword extends ZikoUIInput {
|
|
3
|
-
constructor() {
|
|
4
|
-
super("password", "inputPassword");
|
|
5
|
-
}
|
|
6
|
-
get isInputPassword(){
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
const inputPassword = () => new ZikoUIInputPassword();
|
|
11
|
-
export{
|
|
12
|
-
ZikoUIInputPassword,
|
|
13
|
-
inputPassword
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./input-image"
|
|
File without changes
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../../../constructors/ziko-ui-element.js";
|
|
2
|
-
import { btn } from "../../../misc";
|
|
3
|
-
class ZikoUIInputImage extends ZikoUIElement {
|
|
4
|
-
constructor(text = "File") {
|
|
5
|
-
super("inputImage");
|
|
6
|
-
this._aux_element = btn(text).setTarget(this.target);
|
|
7
|
-
this.element = document?.createElement("input");
|
|
8
|
-
this.element?.setAttribute("type", "file");
|
|
9
|
-
this.element?.setAttribute("accept", "image");
|
|
10
|
-
this._aux_element.onClick(() => this.element.click());
|
|
11
|
-
this.element.onChange = this.handleImage.bind(this);
|
|
12
|
-
}
|
|
13
|
-
get isInputImage(){
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
handleImage(e) {
|
|
17
|
-
const reader = new FileReader();
|
|
18
|
-
const img = new Image();
|
|
19
|
-
reader.onload = function (event) {
|
|
20
|
-
img.src = event.target.result;
|
|
21
|
-
console.log(img.src);
|
|
22
|
-
};
|
|
23
|
-
reader.readAsDataURL(e.target.files[0]);
|
|
24
|
-
this.img = img;
|
|
25
|
-
}
|
|
26
|
-
get value() {
|
|
27
|
-
return this.img;
|
|
28
|
-
}
|
|
29
|
-
render(bool = true) {
|
|
30
|
-
if (bool) this.target.appendChild(this._aux_element.element);
|
|
31
|
-
else this.remove();
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
remove() {
|
|
35
|
-
if (this.target.children.length) this.target.removeChild(this._aux_element.element);
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const inputImage = (text) => new ZikoUIInputImage(text);
|
|
40
|
-
export{
|
|
41
|
-
ZikoUIInputImage,
|
|
42
|
-
inputImage
|
|
43
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ZikoUIInput } from "../input";
|
|
2
|
-
class ZikoUIInputNumber extends ZikoUIInput {
|
|
3
|
-
constructor(min, max, step = 1) {
|
|
4
|
-
super("number", "inpuNumber");
|
|
5
|
-
this.setMin(min).setMax(max).setStep(step);
|
|
6
|
-
}
|
|
7
|
-
get isInputNumber() {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
get value() {
|
|
11
|
-
return +this.element.value;
|
|
12
|
-
}
|
|
13
|
-
setMin(min) {
|
|
14
|
-
this.element.min = min;
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
setMax(max) {
|
|
18
|
-
this.element.max = max;
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
setStep(step) {
|
|
22
|
-
this.element.step = step;
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const inputNumber = (min, max, step) => {
|
|
27
|
-
if (min instanceof Object) {
|
|
28
|
-
const { value, max = 10, step = 1, placeholder = "" } = min;
|
|
29
|
-
min = min?.min ?? 0;
|
|
30
|
-
return new ZikoUIInputSlider(min, max, step)
|
|
31
|
-
.setValue(value)
|
|
32
|
-
.setPlaceholder(placeholder);
|
|
33
|
-
}
|
|
34
|
-
return new ZikoUIInputNumber(min, max, step);
|
|
35
|
-
};
|
|
36
|
-
export { inputNumber, ZikoUIInputNumber };
|
|
37
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ZikoUIInput } from "../input";
|
|
2
|
-
class ZikoUIInputRadio extends ZikoUIInput {
|
|
3
|
-
constructor() {
|
|
4
|
-
super("radio", "inputRadio");
|
|
5
|
-
this.cursor("pointer");
|
|
6
|
-
}
|
|
7
|
-
get isInputRadio(){
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
get checked() {
|
|
11
|
-
return this.element.checked;
|
|
12
|
-
}
|
|
13
|
-
check(checked = true) {
|
|
14
|
-
this.element.checked = checked;
|
|
15
|
-
return this;
|
|
16
|
-
}
|
|
17
|
-
color(color) {
|
|
18
|
-
this.element.style.accentColor = color;
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const radio = () => new ZikoUIInputRadio();
|
|
23
|
-
export{
|
|
24
|
-
ZikoUIInputRadio,
|
|
25
|
-
radio
|
|
26
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { ZikoUIInput } from "../input";
|
|
2
|
-
class ZikoUIInputSearch extends ZikoUIInput {
|
|
3
|
-
constructor() {
|
|
4
|
-
super("search", "inputSearch");
|
|
5
|
-
this.Length = 0;
|
|
6
|
-
}
|
|
7
|
-
get isInputSearch() {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
onsearch(callback) {
|
|
11
|
-
this.element?.addEventListener("search", () => callback());
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
connect(...UIElement) {
|
|
15
|
-
/*
|
|
16
|
-
let memory = new Array(UIElement.length).fill([]);
|
|
17
|
-
UIElement.map((n, i) => {
|
|
18
|
-
//console.log(n)
|
|
19
|
-
n.items.map((m, j) => {
|
|
20
|
-
memory[i][j] = m.element.style.display;
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
UIElement.map((n, i) =>
|
|
24
|
-
this.onInput(() => {
|
|
25
|
-
n.filterByTextContent(this.value, memory[i]);
|
|
26
|
-
this.Length = n.children.filter(
|
|
27
|
-
(n) => n.style.display != "none"
|
|
28
|
-
).length;
|
|
29
|
-
})
|
|
30
|
-
);
|
|
31
|
-
*/
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
displayLength(UIElement) {
|
|
35
|
-
this.element?.addEventListener("keyup", () =>
|
|
36
|
-
UIElement.setValue(this.Length),
|
|
37
|
-
);
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
const search = (...a) => new ZikoUIInputSearch().connect(...a);
|
|
42
|
-
export {
|
|
43
|
-
ZikoUIInputSearch,
|
|
44
|
-
search
|
|
45
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ZikoUIInput } from "../input";
|
|
2
|
-
class ZikoUIInputSlider extends ZikoUIInput {
|
|
3
|
-
constructor(val = 0, min = 0, max = 10, step = 1) {
|
|
4
|
-
super("range", "inputSlider");
|
|
5
|
-
this.setMin(min).setMax(max).setValue(val).setStep(step);
|
|
6
|
-
}
|
|
7
|
-
get isInputSlider(){
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
setMin(min) {
|
|
11
|
-
this.element.min = min;
|
|
12
|
-
return this;
|
|
13
|
-
}
|
|
14
|
-
setMax(max) {
|
|
15
|
-
this.element.max = max;
|
|
16
|
-
return this;
|
|
17
|
-
}
|
|
18
|
-
setStep(step) {
|
|
19
|
-
this.element.step = step;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
const slider = (value, min, max, step) =>{
|
|
24
|
-
if(value instanceof Object){
|
|
25
|
-
const {min=0,max=10,step=1}=value;
|
|
26
|
-
value=value?.value??5;
|
|
27
|
-
return new ZikoUIInputSlider(value, min, max, step);
|
|
28
|
-
}
|
|
29
|
-
return new ZikoUIInputSlider(value, min, max, step);
|
|
30
|
-
}
|
|
31
|
-
export{
|
|
32
|
-
ZikoUIInputSlider,
|
|
33
|
-
slider
|
|
34
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../../constructors/ziko-ui-element.js";
|
|
2
|
-
import { ZikoUIInputOption } from "../Inputs/__helpers__";
|
|
3
|
-
class ZikoUISelect extends ZikoUIElement {
|
|
4
|
-
constructor(){
|
|
5
|
-
super();
|
|
6
|
-
this.element=document?.createElement("select");
|
|
7
|
-
}
|
|
8
|
-
addOptions(...options) {
|
|
9
|
-
options.map(n => this.append(new ZikoUIInputOption(n)));
|
|
10
|
-
return this;
|
|
11
|
-
}
|
|
12
|
-
get isSelect(){
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
const select=()=>new ZikoUISelect()
|
|
17
|
-
export{
|
|
18
|
-
select,
|
|
19
|
-
ZikoUISelect
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../../constructors/ziko-ui-element.js";
|
|
2
|
-
class ZikoUITextArea extends ZikoUIElement {
|
|
3
|
-
constructor() {
|
|
4
|
-
super();
|
|
5
|
-
this.element = document?.createElement("textarea");
|
|
6
|
-
}
|
|
7
|
-
get value(){
|
|
8
|
-
return this.element.textContent;
|
|
9
|
-
}
|
|
10
|
-
get isTextArea(){
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
const textarea =()=> new ZikoUITextArea();
|
|
15
|
-
export {
|
|
16
|
-
ZikoUITextArea,
|
|
17
|
-
textarea
|
|
18
|
-
}
|
|
File without changes
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../constructors/ziko-ui-element.js";
|
|
2
|
-
import {text} from "../text/index.js";
|
|
3
|
-
class ZikoUILI extends ZikoUIElement{
|
|
4
|
-
constructor(UI){
|
|
5
|
-
super("li","li");
|
|
6
|
-
this.append(UI);
|
|
7
|
-
}
|
|
8
|
-
get isLi(){
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
class ZikoUIList extends ZikoUIElement {
|
|
13
|
-
constructor(element,name) {
|
|
14
|
-
super(element,name);
|
|
15
|
-
delete this.append;
|
|
16
|
-
this.style({ listStylePosition: "inside" });
|
|
17
|
-
}
|
|
18
|
-
get isList(){
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
append(...arr){
|
|
22
|
-
for (let i = 0; i < arr.length; i++) {
|
|
23
|
-
let li = null;
|
|
24
|
-
if(["string","number"].includes(typeof arr[i]))arr[i]=text(arr[i])
|
|
25
|
-
if (arr[i] instanceof ZikoUIElement)li=new ZikoUILI(arr[i]);
|
|
26
|
-
li.setTarget(this.element)
|
|
27
|
-
this.items.push(li[0]);
|
|
28
|
-
this.maintain();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
remove(...ele) {
|
|
32
|
-
if(ele.length==0){
|
|
33
|
-
if(this.target.children.length) this.target.removeChild(this.element);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
const remove = (ele) => {
|
|
37
|
-
if(typeof ele === "number") ele=this.items[ele];
|
|
38
|
-
if(ele instanceof ZikoUIElement)this.element?.removeChild(ele.parent.element);
|
|
39
|
-
this.items=this.items.filter(n=>n!==ele);
|
|
40
|
-
};
|
|
41
|
-
for (let i = 0; i < ele.length; i++) remove(ele[i]);
|
|
42
|
-
for (let i = 0; i < this.items.length; i++)
|
|
43
|
-
Object.assign(this, { [[i]]: this.items[i] });
|
|
44
|
-
}
|
|
45
|
-
return this;
|
|
46
|
-
}
|
|
47
|
-
insertAt(index, ...ele) {
|
|
48
|
-
if (index >= this.element.children.length) this.append(...ele);
|
|
49
|
-
else
|
|
50
|
-
for (let i = 0; i < ele.length; i++) {
|
|
51
|
-
let li = null;
|
|
52
|
-
if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
|
|
53
|
-
if (ele[i] instanceof ZikoUIElement)li=new ZikoUILI(ele[i]);
|
|
54
|
-
this.element?.insertBefore(li.element, this.items[index].parent.element);
|
|
55
|
-
this.items.splice(index, 0, ele[i][0]);
|
|
56
|
-
}
|
|
57
|
-
return this;
|
|
58
|
-
}
|
|
59
|
-
filterByTextContent(text,exactMatch=false){
|
|
60
|
-
this.items.map(n=>n.parent.render());
|
|
61
|
-
this.items.filter(n=>{
|
|
62
|
-
const content=n.element.textContent
|
|
63
|
-
return !(exactMatch?content===text:content.includes(text))
|
|
64
|
-
}).map(n=>n.parent.render(false));
|
|
65
|
-
return this;
|
|
66
|
-
}
|
|
67
|
-
sortByTextContent(order=1){
|
|
68
|
-
this.items.map(n=>n.parent.render(false));
|
|
69
|
-
// To Fix
|
|
70
|
-
this.sortedItems=this.items.sort((a,b)=>order*a.element.textContent.localeCompare(b.element.textContent))
|
|
71
|
-
this.append(...this.sortedItems);
|
|
72
|
-
return this;
|
|
73
|
-
}
|
|
74
|
-
filterByClass(value) {
|
|
75
|
-
this.items.map(n=>n.parent.render(true));
|
|
76
|
-
this.items.filter(n=>!n.Classes.includes(value)).map(n=>n.parent.render(false));
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
delete(value) {
|
|
80
|
-
const valueIndex = [...this.element.children].indexOf(value);
|
|
81
|
-
return valueIndex;
|
|
82
|
-
/*if(valueIndex >= 0) {
|
|
83
|
-
return this.list.splice(valueIndex, 1);
|
|
84
|
-
}*/
|
|
85
|
-
}
|
|
86
|
-
push(){
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
pop(){
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
unshift(){
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
shift(){
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
sort(){
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
filter(){
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
slice(){
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
class ZikoUIOList extends ZikoUIList{
|
|
109
|
-
constructor(...arr){
|
|
110
|
-
super("ol","ol");
|
|
111
|
-
this.append(...arr);
|
|
112
|
-
}
|
|
113
|
-
get isOl(){
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
type(tp = 1) {
|
|
117
|
-
this.element?.setAttribute("type", tp);
|
|
118
|
-
return this;
|
|
119
|
-
}
|
|
120
|
-
start(st = 1) {
|
|
121
|
-
this.element?.setAttribute("start", st);
|
|
122
|
-
return this;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
class ZikoUIUList extends ZikoUIList{
|
|
126
|
-
constructor(...arr){
|
|
127
|
-
super("ul","ul");
|
|
128
|
-
this.append(...arr);
|
|
129
|
-
}
|
|
130
|
-
get isUl(){
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
const li=UI=>new ZikoUILI(UI)
|
|
135
|
-
const ol = (...arr) => new ZikoUIOList(...arr);
|
|
136
|
-
const ul = (...arr) => new ZikoUIUList(...arr);
|
|
137
|
-
|
|
138
|
-
export{ol,ul,li}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { __ZikoUIDynamicMediaElement__ } from "../__ZikoUIDynamicMediaELement__.js";
|
|
2
|
-
class ZikoUIAudio extends __ZikoUIDynamicMediaElement__ {
|
|
3
|
-
constructor(src) {
|
|
4
|
-
super("audio","audio");
|
|
5
|
-
this.element?.setAttribute("src", src);
|
|
6
|
-
this.size("150px","30px")
|
|
7
|
-
// this.useControls();
|
|
8
|
-
}
|
|
9
|
-
get isAudio(){
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
const audio = (src) => new ZikoUIAudio(src);
|
|
14
|
-
export {
|
|
15
|
-
audio,
|
|
16
|
-
ZikoUIAudio
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../../constructors/ziko-ui-element.js";
|
|
2
|
-
class ZikoUIFigure extends ZikoUIElement{
|
|
3
|
-
constructor(src,caption){
|
|
4
|
-
super("figure","figure")
|
|
5
|
-
this.img=src.width("100%").element;
|
|
6
|
-
this.caption=document?.createElement("figcaption");
|
|
7
|
-
this.caption.append(caption.element)
|
|
8
|
-
this.element?.append(this.img);
|
|
9
|
-
this.element?.append(this.caption);
|
|
10
|
-
}
|
|
11
|
-
get isFigure(){
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
const figure =(image,caption) =>new ZikoUIFigure(image,caption);
|
|
16
|
-
export{
|
|
17
|
-
figure,
|
|
18
|
-
ZikoUIFigure
|
|
19
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../../constructors/ziko-ui-element.js";
|
|
2
|
-
class ZikoUIImage extends ZikoUIElement {
|
|
3
|
-
constructor(src,alt, 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.setAttr("alt", alt)
|
|
11
|
-
this.style({ border: "1px solid black", width: w, height: h });
|
|
12
|
-
}
|
|
13
|
-
get isImg(){
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
updateSrc(url){
|
|
17
|
-
this.value=url;
|
|
18
|
-
this.element.src=url;
|
|
19
|
-
return this;
|
|
20
|
-
}
|
|
21
|
-
toggleSrc(...values){
|
|
22
|
-
values=values.map(n=>""+n);
|
|
23
|
-
let index=values.indexOf(""+this.value);
|
|
24
|
-
if(index!=-1&&index!=(values.length-1))this.updateSrc(values[index+1]);
|
|
25
|
-
else this.updateSrc(values[0]);
|
|
26
|
-
return this;
|
|
27
|
-
}
|
|
28
|
-
alt(alt){
|
|
29
|
-
this.element.alt=alt;
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const image = (src,alt, width, height) => new ZikoUIImage(src,alt, width, height);
|
|
34
|
-
export{
|
|
35
|
-
image,
|
|
36
|
-
ZikoUIImage
|
|
37
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import ZikoUIElement from "../../constructors/ziko-ui-element.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
|
-
}
|