ziko 0.0.13 → 0.0.15
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 +13310 -11794
- package/dist/ziko.js +13868 -12352
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +13286 -11774
- package/package.json +5 -4
- package/src/__helpers__/index.js +61 -41
- package/src/app/index.js +20 -12
- package/src/app/json-style-sheet.js +64 -0
- package/src/app/routes.js +58 -0
- package/src/app/spa.js +56 -0
- package/src/app/ziko-app.js +39 -0
- package/src/data/api/fetchdom.js +13 -13
- package/src/data/api/index.js +3 -3
- package/src/data/api/preload.js +10 -10
- package/src/data/converter/adoc.js +130 -130
- package/src/data/converter/array.js +42 -42
- package/src/data/converter/canvas.js +24 -24
- package/src/data/converter/css.js +37 -0
- package/src/data/converter/csv.js +32 -32
- package/src/data/converter/idea.txt +9 -9
- package/src/data/converter/index.js +37 -34
- package/src/data/converter/json.js +80 -80
- package/src/data/converter/markdown.js +95 -95
- package/src/data/converter/object.js +69 -69
- package/src/data/converter/svg.js +10 -10
- package/src/data/index.js +16 -73
- package/src/data/parser/index.js +1 -0
- package/src/data/parser/xml.js +46 -46
- package/src/data/string/patterns.js +11 -11
- package/src/data/string/string.js +169 -169
- package/src/{app/app.js → global/app/index.js} +45 -45
- package/src/{app → global}/component/index.js +38 -38
- package/src/global/globals/index.js +20 -0
- package/src/global/index.js +12 -0
- package/src/global/params/index.js +40 -0
- package/src/{app → global}/router/index.js +66 -66
- package/src/{app → global}/seo/index.js +42 -42
- package/src/global/style/index.js +1 -0
- package/src/{app → global}/themes/dark.js +884 -884
- package/src/{app → global}/themes/index.js +10 -10
- package/src/{app → global}/themes/light.js +254 -254
- package/src/graphics/canvas/canvas.js +188 -188
- package/src/graphics/canvas/elements/Basic/arc.js +42 -42
- package/src/graphics/canvas/elements/Basic/line.js +25 -25
- package/src/graphics/canvas/elements/Basic/points.js +47 -47
- package/src/graphics/canvas/elements/Basic/polygon.js +6 -6
- package/src/graphics/canvas/elements/Basic/rect.js +45 -45
- package/src/graphics/canvas/elements/Chart/scatter.js +2 -2
- package/src/graphics/canvas/elements/Element.js +114 -114
- package/src/graphics/canvas/elements/index.js +12 -12
- package/src/graphics/canvas/index.js +14 -14
- package/src/graphics/canvas/utils/color.js +7 -7
- package/src/graphics/canvas/utils/floodFill.js +57 -57
- package/src/graphics/index.js +68 -68
- package/src/graphics/svg/Elements/Basic/circle.js +25 -25
- package/src/graphics/svg/Elements/Basic/ellipse.js +20 -20
- package/src/graphics/svg/Elements/Basic/foreignObject.js +32 -32
- package/src/graphics/svg/Elements/Basic/groupe.js +29 -29
- package/src/graphics/svg/Elements/Basic/image.js +32 -32
- package/src/graphics/svg/Elements/Basic/line.js +28 -28
- package/src/graphics/svg/Elements/Basic/link.js +30 -30
- package/src/graphics/svg/Elements/Basic/path.js +58 -58
- package/src/graphics/svg/Elements/Basic/polygon.js +31 -31
- package/src/graphics/svg/Elements/Basic/polyline.js +3 -3
- package/src/graphics/svg/Elements/Basic/rect.js +42 -42
- package/src/graphics/svg/Elements/Basic/text.js +25 -25
- package/src/graphics/svg/Elements/Derived/grid.js +8 -8
- package/src/graphics/svg/Elements/ZikoSvgElement.js +46 -46
- package/src/graphics/svg/Elements/index.js +14 -14
- package/src/graphics/svg/index.js +1 -1
- package/src/graphics/svg/svg.js +114 -114
- package/src/index.js +83 -88
- package/src/math/calculus/derivation/index.js +7 -0
- package/src/math/calculus/index.js +2 -1
- package/src/math/calculus/special-functions/bessel.js +30 -30
- package/src/math/calculus/special-functions/beta.js +37 -37
- package/src/math/calculus/special-functions/gamma.js +29 -29
- package/src/math/calculus/special-functions/index.js +4 -4
- package/src/math/complex/index.js +202 -202
- package/src/math/const.js +2 -2
- package/src/math/discret/Combinaison/index.js +33 -33
- package/src/math/discret/Conversion/index.js +85 -85
- package/src/math/discret/Logic/index.js +45 -45
- package/src/math/discret/Permutation/index.js +30 -30
- package/src/math/discret/Set/index.js +1 -1
- package/src/math/discret/Set/power-set.js +14 -14
- package/src/math/discret/Set/sub-set.js +10 -10
- package/src/math/discret/index.js +12 -23
- package/src/math/functions/helper.js +20 -0
- package/src/math/functions/index.js +161 -181
- package/src/math/index.js +32 -189
- package/src/math/matrix/Decomposition.js +90 -90
- package/src/math/matrix/LinearSystem.js +9 -9
- package/src/math/matrix/Matrix.js +716 -716
- package/src/math/matrix/index.js +2 -2
- package/src/math/random/index.js +172 -172
- package/src/math/signal/__np.py.txt +39 -39
- package/src/math/signal/conv.js +174 -174
- package/src/math/signal/fft.js +54 -54
- package/src/math/signal/filter.js +38 -38
- package/src/math/signal/functions.js +145 -145
- package/src/math/signal/index.js +109 -109
- package/src/math/statistics/Functions/index.js +99 -99
- package/src/math/statistics/index.js +15 -15
- package/src/math/utils/arithmetic.js +138 -138
- package/src/math/utils/checkers.js +29 -29
- package/src/math/utils/conversions.js +19 -19
- package/src/math/utils/discret.js +51 -51
- package/src/math/utils/index.js +101 -101
- package/src/math/utils/mapfun.js +49 -49
- package/src/reactivity/events/{Partiel/Input.js → Input.js} +62 -59
- package/src/reactivity/events/{Global/Pointer.js → Pointer.js} +232 -234
- package/src/reactivity/events/ZikoEvent.js +90 -90
- package/src/reactivity/events/{Global/Click.js → click.js} +60 -56
- package/src/reactivity/events/{Global/Clipboard.js → clipboard.js} +88 -84
- package/src/reactivity/events/{Global/CustomEvent.js → custom-event.js} +57 -53
- package/src/reactivity/events/{Global/Drag.js → drag.js} +136 -136
- package/src/reactivity/events/{Global/Focus.js → focus.js} +59 -56
- package/src/reactivity/events/{Partiel/Hash.js → hash.js} +47 -44
- package/src/reactivity/events/index.js +62 -62
- package/src/reactivity/events/{Global/Key.js → key.js} +102 -104
- package/src/reactivity/events/{Global/Mouse.js → mouse.js} +233 -230
- package/src/reactivity/events/{Global/Swipe.js → swipe.js} +149 -147
- package/src/reactivity/events/{Global/Wheel.js → wheel.js} +47 -44
- package/src/reactivity/hooks/{Contexte → contexte}/useSuccesifKeys.js +13 -13
- package/src/reactivity/hooks/{Decorators → decorators}/index.js +6 -6
- package/src/reactivity/hooks/{Decorators → decorators}/time.js +16 -16
- package/src/reactivity/hooks/{Decorators → decorators}/type.js +87 -87
- package/src/reactivity/hooks/head/index.js +5 -0
- package/src/reactivity/hooks/{UI → head}/useCssText.js +21 -21
- package/src/reactivity/hooks/{UI → head}/useFavIcon.js +37 -37
- package/src/reactivity/hooks/head/useHead.js +28 -0
- package/src/reactivity/hooks/head/useMeta.js +52 -0
- package/src/reactivity/hooks/{UI → head}/useTitle.js +29 -29
- package/src/reactivity/hooks/index.js +91 -85
- package/src/reactivity/hooks/{Interactions → interactions}/index.js +3 -3
- package/src/reactivity/hooks/{Interactions → interactions}/useBluetooth.js +47 -47
- package/src/reactivity/hooks/{Interactions → interactions}/useChannel.js +49 -49
- package/src/reactivity/hooks/{Interactions → interactions}/useEventEmmiter.js +63 -63
- package/src/reactivity/hooks/{Interactions → interactions}/useThread.js +43 -43
- package/src/reactivity/hooks/sensors/index.js +2 -0
- package/src/reactivity/hooks/{Sensors → sensors}/useBattery.js +35 -35
- package/src/reactivity/hooks/{Sensors → sensors}/useGeolocation.js +16 -16
- package/src/reactivity/hooks/{Storage → storage}/useStorage.js +72 -72
- package/src/reactivity/hooks/todo.md +26 -26
- package/src/reactivity/hooks/ui/index.js +5 -0
- package/src/reactivity/hooks/{UI → ui}/useMediaQuery.js +43 -43
- package/src/reactivity/hooks/{UI → ui}/useStyle.js +79 -79
- package/src/reactivity/hooks/{UI → ui}/useTheme.js +61 -61
- package/src/reactivity/idea +1 -1
- package/src/reactivity/index.js +11 -21
- package/src/reactivity/observer/attributes.js +28 -28
- package/src/reactivity/observer/children.js +36 -36
- package/src/reactivity/observer/index.js +6 -44
- package/src/reactivity/observer/intersection.js +43 -43
- package/src/reactivity/observer/mutation.js +112 -112
- package/src/reactivity/observer/resize.js +46 -46
- package/src/reactivity/observer/screen.js +44 -44
- package/src/reactivity/observer/screen.js.txt +83 -83
- package/src/reactivity/observer/screen.txt +12 -12
- package/src/time/animation.js +75 -75
- package/src/time/index.js +12 -54
- package/src/time/loop.js +87 -87
- package/src/time/utils/decorators.js +16 -16
- package/src/time/utils/ease.js +143 -143
- package/src/time/utils/index.js +17 -17
- package/src/time/utils/performance.js +15 -15
- package/src/time/utils/ui.js +25 -25
- package/src/types.js +73 -0
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/accordion/accordion.js +42 -45
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/accordion/collapsible.js +82 -82
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/accordion/index.js +1 -1
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/alert/alert.js +80 -80
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/alert/palette.js +51 -51
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/carousel/index.js +50 -49
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/code-note/SubElements.js.txt +104 -104
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/code-note/code-cell.js +194 -194
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/code-note/code-note.js +71 -71
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/code-note/index.js +1 -1
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/code-note/sub-elements.js +66 -66
- package/src/{user-interface → ui}/elements/derived/elements/Swipper.js +3 -3
- package/src/{user-interface → ui}/elements/derived/elements/index.js +9 -9
- package/src/{user-interface/elements/derived/Flex.js → ui/elements/derived/flex/index.js} +102 -102
- package/src/{user-interface/elements/derived/Grid.js → ui/elements/derived/grid/index.js} +32 -32
- package/src/ui/elements/derived/index.js +12 -0
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/menu/menu3d.js +259 -259
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/modal/index.js +91 -91
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/pagination/breadcrumbs.js +53 -53
- package/src/ui/elements/derived/slider/__ZikoUISlider__.js +112 -0
- package/src/ui/elements/derived/slider/hSlider.js +34 -0
- package/src/ui/elements/derived/slider/index.js +12 -0
- package/src/ui/elements/derived/slider/vSlider.js +27 -0
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/splitter/__ZikoUISplitter__.js +61 -61
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/splitter/hsplitter.js +39 -39
- package/src/ui/elements/derived/splitter/index.js +12 -0
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/splitter/vsplitter.js +39 -39
- package/src/{user-interface/elements/derived/elements → ui/elements/derived}/tabs/index.js +179 -179
- package/src/{user-interface → ui}/elements/primitives/ZikoUIContainerElement.js +126 -126
- package/src/{user-interface → ui}/elements/primitives/ZikoUIElement.js +492 -478
- package/src/ui/elements/primitives/embaded/html.js +20 -0
- package/src/ui/elements/primitives/embaded/index.js +3 -0
- package/src/ui/elements/primitives/embaded/pdf.js +17 -0
- package/src/ui/elements/primitives/embaded/youtube.js +24 -0
- package/src/{user-interface → ui}/elements/primitives/index.js +7 -7
- package/src/{user-interface → ui}/elements/primitives/io/Form/index.js +41 -41
- package/src/{user-interface → ui}/elements/primitives/io/Form/index.js.txt +104 -104
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/__helpers__.js +51 -51
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/index.js +12 -12
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input/index.js +98 -97
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-camera/index.js +26 -26
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-checkbox/index.js +25 -25
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-color/index.js +15 -15
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-date-time/index.js +2 -2
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-date-time/input-date-time.js +13 -13
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-date-time/input-date.js +13 -13
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-date-time/input-time.js +13 -13
- package/src/ui/elements/primitives/io/Inputs/input-email-password/index.js +2 -0
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-email-password/input-email.js +14 -14
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-email-password/input-password.js +13 -13
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-file/input-image.js +42 -42
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-number/index.js +36 -36
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-radio/index.js +25 -25
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-search/index.js +45 -45
- package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-slider/index.js +34 -34
- package/src/{user-interface → ui}/elements/primitives/io/Select/index.js +19 -19
- package/src/{user-interface → ui}/elements/primitives/io/Textarea/index.js +17 -17
- package/src/{user-interface → ui}/elements/primitives/io/index.js +3 -3
- package/src/{user-interface → ui}/elements/primitives/list/index.js +138 -138
- package/src/{user-interface → ui}/elements/primitives/media/Audio/index.js +16 -16
- package/src/{user-interface → ui}/elements/primitives/media/Image/figure.js +18 -18
- package/src/{user-interface → ui}/elements/primitives/media/Image/image.js +36 -35
- package/src/ui/elements/primitives/media/Image/index.js +2 -0
- package/src/{user-interface → ui}/elements/primitives/media/Video/index.js +26 -26
- package/src/{user-interface → ui}/elements/primitives/media/__ZikoUIDynamicMediaELement__.js +46 -46
- package/src/{user-interface → ui}/elements/primitives/media/index.js +2 -2
- package/src/{user-interface → ui}/elements/primitives/misc/index.js +100 -99
- package/src/{user-interface → ui}/elements/primitives/semantic/index.js +81 -81
- package/src/{user-interface → ui}/elements/primitives/table/elements.js +93 -93
- package/src/ui/elements/primitives/table/index.js +3 -0
- package/src/{user-interface → ui}/elements/primitives/table/table.js +115 -115
- package/src/{user-interface → ui}/elements/primitives/table/utils.js +11 -11
- package/src/{user-interface → ui}/elements/primitives/text/__ZikoUIText__.js +71 -71
- package/src/{user-interface → ui}/elements/primitives/text/heading.js +35 -35
- package/src/{user-interface → ui}/elements/primitives/text/index.js +2 -2
- package/src/{user-interface → ui}/elements/primitives/text/p.js +26 -26
- package/src/{user-interface → ui}/elements/primitives/text/text.js +80 -80
- package/src/ui/index.js +29 -0
- package/src/{user-interface → ui}/style/index.js +515 -509
- package/src/{user-interface → ui}/utils/index.js +69 -69
- package/src/reactivity/events/Global/Touch.js +0 -0
- package/src/reactivity/hooks/Sensors/index.js +0 -2
- package/src/reactivity/hooks/UI/index.js +0 -5
- package/src/user-interface/elements/derived/elements/splitter/index.js +0 -2
- package/src/user-interface/elements/derived/index.js +0 -3
- package/src/user-interface/elements/primitives/embaded/index.js +0 -1
- package/src/user-interface/elements/primitives/io/Inputs/input-email-password/index.js +0 -2
- package/src/user-interface/elements/primitives/media/Image/index.js +0 -2
- package/src/user-interface/elements/primitives/table/index.js +0 -3
- package/src/user-interface/index.js +0 -188
- /package/src/app/{globals/index.js → globals.js} +0 -0
- /package/src/app/{params/index.js → params.js} +0 -0
- /package/src/reactivity/events/{Partiel/Media.js → media.js} +0 -0
- /package/src/{app/accessibility/index.js → reactivity/events/touch.js} +0 -0
- /package/src/reactivity/hooks/{Contexte → contexte}/index.js +0 -0
- /package/src/reactivity/hooks/{Interactions → interactions}/useSerial.js +0 -0
- /package/src/reactivity/hooks/{Interactions → interactions}/useUsb.js +0 -0
- /package/src/reactivity/hooks/{Sensors → sensors}/useCamera.js +0 -0
- /package/src/reactivity/hooks/{Sensors → sensors}/useMicro.js +0 -0
- /package/src/reactivity/hooks/{Sensors → sensors}/useOrientation.js +0 -0
- /package/src/reactivity/hooks/{Storage → storage}/index.js +0 -0
- /package/src/reactivity/hooks/{Storage → storage}/useCookie.js +0 -0
- /package/src/reactivity/hooks/{Storage → storage}/useIndexedDb.js +0 -0
- /package/src/reactivity/hooks/{UI → ui}/useCssLink.js +0 -0
- /package/src/reactivity/hooks/{UI → ui}/useLinearGradient.js +0 -0
- /package/src/reactivity/hooks/{UI → ui}/useRadialGradient.js +0 -0
- /package/src/{user-interface/elements/derived/elements → ui/elements/derived}/alert/index.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/Notification.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/Popover.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/Popup.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/Timeline.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/Toast.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/Treeview.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/columns.js +0 -0
- /package/src/{user-interface → ui}/elements/derived/elements/fab.js +0 -0
- /package/src/{user-interface/elements/derived/elements → ui/elements/derived}/menu/index.js +0 -0
- /package/src/{user-interface/elements/derived/elements → ui/elements/derived}/pagination/index.js +0 -0
- /package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-file/index.js +0 -0
- /package/src/{user-interface → ui}/elements/primitives/io/Inputs/input-file/input-file.js +0 -0
- /package/src/{user-interface → ui}/elements/primitives/list/elements.js +0 -0
- /package/src/{user-interface → ui}/elements/primitives/text/pre.js +0 -0
package/src/data/parser/xml.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
function parseXML(xmlString) {
|
|
2
|
-
const parser = new DOMParser();
|
|
3
|
-
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
|
4
|
-
const rootNode = xmlDoc.documentElement;
|
|
5
|
-
const result = parseNode(rootNode);
|
|
6
|
-
return result;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function parseNode(node) {
|
|
10
|
-
const obj = {
|
|
11
|
-
type: node.nodeName,
|
|
12
|
-
attributes: {},
|
|
13
|
-
children: []
|
|
14
|
-
};
|
|
15
|
-
for (let i = 0; i < node.attributes.length; i++) {
|
|
16
|
-
const attr = node.attributes[i];
|
|
17
|
-
obj.attributes[attr.name] = attr.value;
|
|
18
|
-
}
|
|
19
|
-
for (let i = 0; i < node.childNodes.length; i++) {
|
|
20
|
-
const child = node.childNodes[i];
|
|
21
|
-
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
22
|
-
obj.children.push(parseNode(child));
|
|
23
|
-
} else if (child.nodeType === Node.TEXT_NODE) {
|
|
24
|
-
obj.text = child.textContent.trim();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return obj;
|
|
28
|
-
}
|
|
29
|
-
export default parseXML;
|
|
30
|
-
|
|
31
|
-
// function htmlParser(element) {
|
|
32
|
-
// const obj = {
|
|
33
|
-
// type: element.tagName,
|
|
34
|
-
// attributes: {},
|
|
35
|
-
// children: [],
|
|
36
|
-
// };
|
|
37
|
-
// for (let i = 0; i < element.attributes.length; i++) {
|
|
38
|
-
// const attr = element.attributes[i];
|
|
39
|
-
// obj.attributes[attr.name] = attr.value;
|
|
40
|
-
// }
|
|
41
|
-
// for (let i = 0; i < element.children.length; i++) {
|
|
42
|
-
// const child = element.children[i];
|
|
43
|
-
// obj.children.push(htmlParser(child));
|
|
44
|
-
// }
|
|
45
|
-
// return obj;
|
|
46
|
-
// }
|
|
1
|
+
function parseXML(xmlString) {
|
|
2
|
+
const parser = new DOMParser();
|
|
3
|
+
const xmlDoc = parser.parseFromString(xmlString, 'text/xml');
|
|
4
|
+
const rootNode = xmlDoc.documentElement;
|
|
5
|
+
const result = parseNode(rootNode);
|
|
6
|
+
return result;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
function parseNode(node) {
|
|
10
|
+
const obj = {
|
|
11
|
+
type: node.nodeName,
|
|
12
|
+
attributes: {},
|
|
13
|
+
children: []
|
|
14
|
+
};
|
|
15
|
+
for (let i = 0; i < node.attributes.length; i++) {
|
|
16
|
+
const attr = node.attributes[i];
|
|
17
|
+
obj.attributes[attr.name] = attr.value;
|
|
18
|
+
}
|
|
19
|
+
for (let i = 0; i < node.childNodes.length; i++) {
|
|
20
|
+
const child = node.childNodes[i];
|
|
21
|
+
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
22
|
+
obj.children.push(parseNode(child));
|
|
23
|
+
} else if (child.nodeType === Node.TEXT_NODE) {
|
|
24
|
+
obj.text = child.textContent.trim();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
export default parseXML;
|
|
30
|
+
|
|
31
|
+
// function htmlParser(element) {
|
|
32
|
+
// const obj = {
|
|
33
|
+
// type: element.tagName,
|
|
34
|
+
// attributes: {},
|
|
35
|
+
// children: [],
|
|
36
|
+
// };
|
|
37
|
+
// for (let i = 0; i < element.attributes.length; i++) {
|
|
38
|
+
// const attr = element.attributes[i];
|
|
39
|
+
// obj.attributes[attr.name] = attr.value;
|
|
40
|
+
// }
|
|
41
|
+
// for (let i = 0; i < element.children.length; i++) {
|
|
42
|
+
// const child = element.children[i];
|
|
43
|
+
// obj.children.push(htmlParser(child));
|
|
44
|
+
// }
|
|
45
|
+
// return obj;
|
|
46
|
+
// }
|
|
47
47
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const Patterns={
|
|
2
|
-
isDigit: /^\d+$/,
|
|
3
|
-
isEmail: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
4
|
-
isURL: /^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-./?%&=]*)?$/,
|
|
5
|
-
isHexColor: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
|
|
6
|
-
isIPv4: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
|
|
7
|
-
isMACAddress: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,
|
|
8
|
-
isDate: /^\d{4}-\d{2}-\d{2}$/,
|
|
9
|
-
}
|
|
10
|
-
export{
|
|
11
|
-
Patterns
|
|
1
|
+
const Patterns={
|
|
2
|
+
isDigit: /^\d+$/,
|
|
3
|
+
isEmail: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,
|
|
4
|
+
isURL: /^(https?:\/\/)?([\w\-]+\.)+[\w\-]+(\/[\w\-./?%&=]*)?$/,
|
|
5
|
+
isHexColor: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,
|
|
6
|
+
isIPv4: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
|
|
7
|
+
isMACAddress: /^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/,
|
|
8
|
+
isDate: /^\d{4}-\d{2}-\d{2}$/,
|
|
9
|
+
}
|
|
10
|
+
export{
|
|
11
|
+
Patterns
|
|
12
12
|
}
|
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
import { Patterns } from "./patterns.js";
|
|
2
|
-
class Str{
|
|
3
|
-
constructor(string){
|
|
4
|
-
this.string=string;
|
|
5
|
-
}
|
|
6
|
-
isDigit() {
|
|
7
|
-
return Patterns.isDigit.test(this.string);
|
|
8
|
-
}
|
|
9
|
-
static isDigit(string){
|
|
10
|
-
return new Str(string).isDigit();
|
|
11
|
-
}
|
|
12
|
-
isNumber() {
|
|
13
|
-
return !isNaN(this.string);
|
|
14
|
-
}
|
|
15
|
-
static isNumber(string){
|
|
16
|
-
return new Str(string).isNumber();
|
|
17
|
-
}
|
|
18
|
-
isUrl(){
|
|
19
|
-
return Patterns.isURL.test(this.string);
|
|
20
|
-
}
|
|
21
|
-
static isUrl(string){
|
|
22
|
-
return new Str(string).isUrl();
|
|
23
|
-
}
|
|
24
|
-
isHexColor(){
|
|
25
|
-
return Patterns.isHexColor.test(this.string);
|
|
26
|
-
}
|
|
27
|
-
static isHexColor(string){
|
|
28
|
-
return new Str(string).isHexColor();
|
|
29
|
-
}
|
|
30
|
-
isIPv4(){
|
|
31
|
-
return Patterns.isIPv4.test(this.string);
|
|
32
|
-
}
|
|
33
|
-
static isIPv4(string){
|
|
34
|
-
return new Str(string).isIPv4();
|
|
35
|
-
}
|
|
36
|
-
isDate(){
|
|
37
|
-
return Patterns.isDate.test(this.string);
|
|
38
|
-
}
|
|
39
|
-
static isDate(string){
|
|
40
|
-
return new Str(string).isDate();
|
|
41
|
-
}
|
|
42
|
-
isMACAddress(){
|
|
43
|
-
return Patterns.isMACAddress.test(this.string);
|
|
44
|
-
}
|
|
45
|
-
static isMACAddress(string){
|
|
46
|
-
return new Str(string).isMACAddress();
|
|
47
|
-
}
|
|
48
|
-
isPascalCase(){
|
|
49
|
-
if (this.string.length === 0) return false;
|
|
50
|
-
const PascalCasePattern = /^[A-Z][a-zA-Z0-9]*$/;
|
|
51
|
-
return PascalCasePattern.test(this.string);
|
|
52
|
-
}
|
|
53
|
-
static isPascalCase(string){
|
|
54
|
-
return new Str(string).isPascalCase();
|
|
55
|
-
}
|
|
56
|
-
isCamelCase() {
|
|
57
|
-
if (this.string.length === 0) return false;
|
|
58
|
-
const camelCasePattern = /^[a-z][a-zA-Z0-9]*$/;
|
|
59
|
-
return camelCasePattern.test(this.string);
|
|
60
|
-
}
|
|
61
|
-
static isCamelCase(string){
|
|
62
|
-
return new Str(string).isCamelCase();
|
|
63
|
-
}
|
|
64
|
-
isHyphenCase(){
|
|
65
|
-
return this.string.split('-').length > 1;
|
|
66
|
-
}
|
|
67
|
-
static isHyphenCase(string){
|
|
68
|
-
return new Str(string).isHyphenCase();
|
|
69
|
-
}
|
|
70
|
-
isSnakeCase(){
|
|
71
|
-
return this.string.split('_').length > 1;
|
|
72
|
-
}
|
|
73
|
-
static isSnakeCase(string){
|
|
74
|
-
return new Str(string).isSnakeCase();
|
|
75
|
-
}
|
|
76
|
-
isPalindrome(){
|
|
77
|
-
const str=this.string.toLocaleLowerCase();
|
|
78
|
-
let l=str.length,i;
|
|
79
|
-
for(i=0;i<l/2;i++)if(str[i]!=str[l-i-1])return false;
|
|
80
|
-
return true;
|
|
81
|
-
}
|
|
82
|
-
static isPalindrome(string){
|
|
83
|
-
return new Str(string).isPalindrome();
|
|
84
|
-
}
|
|
85
|
-
static isAnagrams(word,words){
|
|
86
|
-
word=word.split("").sort();
|
|
87
|
-
words=words.split("").sort();
|
|
88
|
-
return JSON.stringify(word)===JSON.stringify(words);
|
|
89
|
-
}
|
|
90
|
-
isIsogram(){
|
|
91
|
-
return [...new Set(this.string.toLowerCase())].length===this.string.length;
|
|
92
|
-
}
|
|
93
|
-
static isIsogram(string){
|
|
94
|
-
return new Str(string).isIsogram();
|
|
95
|
-
}
|
|
96
|
-
static camel2hyphencase(text) {
|
|
97
|
-
return text.replace(/[A-Z]/g, match => '-' + match.toLowerCase());
|
|
98
|
-
}
|
|
99
|
-
static camel2snakecase(text) {
|
|
100
|
-
return text.replace(/[A-Z]/g, match => '_' + match.toLowerCase());
|
|
101
|
-
}
|
|
102
|
-
static camel2pascalcase(text) {
|
|
103
|
-
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
104
|
-
}
|
|
105
|
-
static camel2constantcase(text) {
|
|
106
|
-
return text.replace(/[A-Z]/g, match => '_' + match).toUpperCase();
|
|
107
|
-
}
|
|
108
|
-
static pascal2snakecase(text) {
|
|
109
|
-
return text.replace(/([A-Z])/g, (match, offset) => offset ? '_' + match.toLowerCase() : match.toLowerCase());
|
|
110
|
-
}
|
|
111
|
-
static pascal2hyphencase(text) {
|
|
112
|
-
return text.replace(/([A-Z])/g, (match, offset) => offset ? '-' + match.toLowerCase() : match.toLowerCase());
|
|
113
|
-
}
|
|
114
|
-
static pascal2camelcase(text) {
|
|
115
|
-
return text.charAt(0).toLowerCase() + text.slice(1);
|
|
116
|
-
}
|
|
117
|
-
static pascal2constantcase(text) {
|
|
118
|
-
return text.replace(/([A-Z])/g, (match, offset) => offset ? '_' + match : match).toUpperCase();
|
|
119
|
-
}
|
|
120
|
-
static snake2camelcase(text) {
|
|
121
|
-
return text.replace(/(_\w)/g, match => match[1].toUpperCase());
|
|
122
|
-
}
|
|
123
|
-
static snake2hyphencase(text) {
|
|
124
|
-
return text.replace(/_/g, "-");
|
|
125
|
-
}
|
|
126
|
-
static snake2pascalcase(text) {
|
|
127
|
-
return text.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
128
|
-
}
|
|
129
|
-
static snake2constantcase(text) {
|
|
130
|
-
return text.toUpperCase();
|
|
131
|
-
}
|
|
132
|
-
static hyphen2camelcase(text) {
|
|
133
|
-
return text.replace(/-([a-z])/g, match => match[1].toUpperCase());
|
|
134
|
-
}
|
|
135
|
-
static hyphen2snakecase(text) {
|
|
136
|
-
return text.replace(/-/g, '_');
|
|
137
|
-
}
|
|
138
|
-
static hyphen2pascalcase(text) {
|
|
139
|
-
return text.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
140
|
-
}
|
|
141
|
-
static hyphen2constantcase(text) {
|
|
142
|
-
return text.replace(/-/g, '_').toUpperCase();
|
|
143
|
-
}
|
|
144
|
-
static constant2camelcase(text) {
|
|
145
|
-
return text.toLowerCase().replace(/_([a-z])/g, match => match[1].toUpperCase());
|
|
146
|
-
}
|
|
147
|
-
static constant2snakecase(text) {
|
|
148
|
-
return text.toLowerCase();
|
|
149
|
-
}
|
|
150
|
-
static constant2pascalcase(text) {
|
|
151
|
-
return text.toLowerCase().split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
152
|
-
}
|
|
153
|
-
static constant2hyphencase(text) {
|
|
154
|
-
return text.toLowerCase().replace(/_/g, '-');
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
const removeExtraSpace=str=>str.replace(/\s+/g,' ');
|
|
158
|
-
const count=(str,value)=>str.split("").filter(x => x==value).length;
|
|
159
|
-
const countWords=(str,value)=>str.split(" ").filter(x => x==value).length;
|
|
160
|
-
|
|
161
|
-
export{
|
|
162
|
-
removeExtraSpace,
|
|
163
|
-
count,
|
|
164
|
-
countWords
|
|
165
|
-
}
|
|
166
|
-
const str=string=>new Str(string);
|
|
167
|
-
export{
|
|
168
|
-
Str,
|
|
169
|
-
str
|
|
1
|
+
import { Patterns } from "./patterns.js";
|
|
2
|
+
class Str{
|
|
3
|
+
constructor(string){
|
|
4
|
+
this.string=string;
|
|
5
|
+
}
|
|
6
|
+
isDigit() {
|
|
7
|
+
return Patterns.isDigit.test(this.string);
|
|
8
|
+
}
|
|
9
|
+
static isDigit(string){
|
|
10
|
+
return new Str(string).isDigit();
|
|
11
|
+
}
|
|
12
|
+
isNumber() {
|
|
13
|
+
return !isNaN(this.string);
|
|
14
|
+
}
|
|
15
|
+
static isNumber(string){
|
|
16
|
+
return new Str(string).isNumber();
|
|
17
|
+
}
|
|
18
|
+
isUrl(){
|
|
19
|
+
return Patterns.isURL.test(this.string);
|
|
20
|
+
}
|
|
21
|
+
static isUrl(string){
|
|
22
|
+
return new Str(string).isUrl();
|
|
23
|
+
}
|
|
24
|
+
isHexColor(){
|
|
25
|
+
return Patterns.isHexColor.test(this.string);
|
|
26
|
+
}
|
|
27
|
+
static isHexColor(string){
|
|
28
|
+
return new Str(string).isHexColor();
|
|
29
|
+
}
|
|
30
|
+
isIPv4(){
|
|
31
|
+
return Patterns.isIPv4.test(this.string);
|
|
32
|
+
}
|
|
33
|
+
static isIPv4(string){
|
|
34
|
+
return new Str(string).isIPv4();
|
|
35
|
+
}
|
|
36
|
+
isDate(){
|
|
37
|
+
return Patterns.isDate.test(this.string);
|
|
38
|
+
}
|
|
39
|
+
static isDate(string){
|
|
40
|
+
return new Str(string).isDate();
|
|
41
|
+
}
|
|
42
|
+
isMACAddress(){
|
|
43
|
+
return Patterns.isMACAddress.test(this.string);
|
|
44
|
+
}
|
|
45
|
+
static isMACAddress(string){
|
|
46
|
+
return new Str(string).isMACAddress();
|
|
47
|
+
}
|
|
48
|
+
isPascalCase(){
|
|
49
|
+
if (this.string.length === 0) return false;
|
|
50
|
+
const PascalCasePattern = /^[A-Z][a-zA-Z0-9]*$/;
|
|
51
|
+
return PascalCasePattern.test(this.string);
|
|
52
|
+
}
|
|
53
|
+
static isPascalCase(string){
|
|
54
|
+
return new Str(string).isPascalCase();
|
|
55
|
+
}
|
|
56
|
+
isCamelCase() {
|
|
57
|
+
if (this.string.length === 0) return false;
|
|
58
|
+
const camelCasePattern = /^[a-z][a-zA-Z0-9]*$/;
|
|
59
|
+
return camelCasePattern.test(this.string);
|
|
60
|
+
}
|
|
61
|
+
static isCamelCase(string){
|
|
62
|
+
return new Str(string).isCamelCase();
|
|
63
|
+
}
|
|
64
|
+
isHyphenCase(){
|
|
65
|
+
return this.string.split('-').length > 1;
|
|
66
|
+
}
|
|
67
|
+
static isHyphenCase(string){
|
|
68
|
+
return new Str(string).isHyphenCase();
|
|
69
|
+
}
|
|
70
|
+
isSnakeCase(){
|
|
71
|
+
return this.string.split('_').length > 1;
|
|
72
|
+
}
|
|
73
|
+
static isSnakeCase(string){
|
|
74
|
+
return new Str(string).isSnakeCase();
|
|
75
|
+
}
|
|
76
|
+
isPalindrome(){
|
|
77
|
+
const str=this.string.toLocaleLowerCase();
|
|
78
|
+
let l=str.length,i;
|
|
79
|
+
for(i=0;i<l/2;i++)if(str[i]!=str[l-i-1])return false;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
static isPalindrome(string){
|
|
83
|
+
return new Str(string).isPalindrome();
|
|
84
|
+
}
|
|
85
|
+
static isAnagrams(word,words){
|
|
86
|
+
word=word.split("").sort();
|
|
87
|
+
words=words.split("").sort();
|
|
88
|
+
return JSON.stringify(word)===JSON.stringify(words);
|
|
89
|
+
}
|
|
90
|
+
isIsogram(){
|
|
91
|
+
return [...new Set(this.string.toLowerCase())].length===this.string.length;
|
|
92
|
+
}
|
|
93
|
+
static isIsogram(string){
|
|
94
|
+
return new Str(string).isIsogram();
|
|
95
|
+
}
|
|
96
|
+
static camel2hyphencase(text) {
|
|
97
|
+
return text.replace(/[A-Z]/g, match => '-' + match.toLowerCase());
|
|
98
|
+
}
|
|
99
|
+
static camel2snakecase(text) {
|
|
100
|
+
return text.replace(/[A-Z]/g, match => '_' + match.toLowerCase());
|
|
101
|
+
}
|
|
102
|
+
static camel2pascalcase(text) {
|
|
103
|
+
return text.charAt(0).toUpperCase() + text.slice(1);
|
|
104
|
+
}
|
|
105
|
+
static camel2constantcase(text) {
|
|
106
|
+
return text.replace(/[A-Z]/g, match => '_' + match).toUpperCase();
|
|
107
|
+
}
|
|
108
|
+
static pascal2snakecase(text) {
|
|
109
|
+
return text.replace(/([A-Z])/g, (match, offset) => offset ? '_' + match.toLowerCase() : match.toLowerCase());
|
|
110
|
+
}
|
|
111
|
+
static pascal2hyphencase(text) {
|
|
112
|
+
return text.replace(/([A-Z])/g, (match, offset) => offset ? '-' + match.toLowerCase() : match.toLowerCase());
|
|
113
|
+
}
|
|
114
|
+
static pascal2camelcase(text) {
|
|
115
|
+
return text.charAt(0).toLowerCase() + text.slice(1);
|
|
116
|
+
}
|
|
117
|
+
static pascal2constantcase(text) {
|
|
118
|
+
return text.replace(/([A-Z])/g, (match, offset) => offset ? '_' + match : match).toUpperCase();
|
|
119
|
+
}
|
|
120
|
+
static snake2camelcase(text) {
|
|
121
|
+
return text.replace(/(_\w)/g, match => match[1].toUpperCase());
|
|
122
|
+
}
|
|
123
|
+
static snake2hyphencase(text) {
|
|
124
|
+
return text.replace(/_/g, "-");
|
|
125
|
+
}
|
|
126
|
+
static snake2pascalcase(text) {
|
|
127
|
+
return text.split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
128
|
+
}
|
|
129
|
+
static snake2constantcase(text) {
|
|
130
|
+
return text.toUpperCase();
|
|
131
|
+
}
|
|
132
|
+
static hyphen2camelcase(text) {
|
|
133
|
+
return text.replace(/-([a-z])/g, match => match[1].toUpperCase());
|
|
134
|
+
}
|
|
135
|
+
static hyphen2snakecase(text) {
|
|
136
|
+
return text.replace(/-/g, '_');
|
|
137
|
+
}
|
|
138
|
+
static hyphen2pascalcase(text) {
|
|
139
|
+
return text.split('-').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
140
|
+
}
|
|
141
|
+
static hyphen2constantcase(text) {
|
|
142
|
+
return text.replace(/-/g, '_').toUpperCase();
|
|
143
|
+
}
|
|
144
|
+
static constant2camelcase(text) {
|
|
145
|
+
return text.toLowerCase().replace(/_([a-z])/g, match => match[1].toUpperCase());
|
|
146
|
+
}
|
|
147
|
+
static constant2snakecase(text) {
|
|
148
|
+
return text.toLowerCase();
|
|
149
|
+
}
|
|
150
|
+
static constant2pascalcase(text) {
|
|
151
|
+
return text.toLowerCase().split('_').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
152
|
+
}
|
|
153
|
+
static constant2hyphencase(text) {
|
|
154
|
+
return text.toLowerCase().replace(/_/g, '-');
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const removeExtraSpace=str=>str.replace(/\s+/g,' ');
|
|
158
|
+
const count=(str,value)=>str.split("").filter(x => x==value).length;
|
|
159
|
+
const countWords=(str,value)=>str.split(" ").filter(x => x==value).length;
|
|
160
|
+
|
|
161
|
+
export{
|
|
162
|
+
removeExtraSpace,
|
|
163
|
+
count,
|
|
164
|
+
countWords
|
|
165
|
+
}
|
|
166
|
+
const str=string=>new Str(string);
|
|
167
|
+
export{
|
|
168
|
+
Str,
|
|
169
|
+
str
|
|
170
170
|
}
|
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
import { ZikoUIFlex } from "
|
|
2
|
-
import { Seo } from "
|
|
3
|
-
import { useHashEvent } from "
|
|
4
|
-
class ZikoUIApp extends ZikoUIFlex{
|
|
5
|
-
constructor(){
|
|
6
|
-
super("main");
|
|
7
|
-
this.root=document.documentElement;
|
|
8
|
-
this.head=null;
|
|
9
|
-
this.#init();
|
|
10
|
-
this.seo=Seo(this);
|
|
11
|
-
Object.assign(this.events,{
|
|
12
|
-
hash:null
|
|
13
|
-
})
|
|
14
|
-
Object.assign(this.cache,{
|
|
15
|
-
theme:null,
|
|
16
|
-
isRoot:true
|
|
17
|
-
});
|
|
18
|
-
// globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
19
|
-
}
|
|
20
|
-
#init(){
|
|
21
|
-
this.root.setAttribute("data-engine","zikojs");
|
|
22
|
-
const head=this.root.getElementsByTagName("head")[0];
|
|
23
|
-
this.head=head?head:this.head=document?.
|
|
24
|
-
if(!head)this.root.insertBefore(this.head,document?.body);
|
|
25
|
-
const title=this.head.getElementsByTagName("title")[0];
|
|
26
|
-
this.Title=title?title:document?.
|
|
27
|
-
if(!title)this.head.append(this.Title);
|
|
28
|
-
}
|
|
29
|
-
title(title=this.title.textContent){
|
|
30
|
-
this.Title.textContent=title;
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
prefetch(){
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
description(){
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
onHashChange(...callbacks){
|
|
40
|
-
if(!this.events.hash)this.events.hash = useHashEvent(this);
|
|
41
|
-
this.events.hash.onChange(...callbacks);
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
const App=(...UIElement)=>new ZikoUIApp().append(...UIElement)
|
|
1
|
+
import { ZikoUIFlex } from "../../ui/elements/derived/flex/index.js";
|
|
2
|
+
import { Seo } from "../seo/index.js";
|
|
3
|
+
import { useHashEvent } from "../../reactivity/index.js";
|
|
4
|
+
class ZikoUIApp extends ZikoUIFlex{
|
|
5
|
+
constructor(){
|
|
6
|
+
super("main");
|
|
7
|
+
this.root=document.documentElement;
|
|
8
|
+
this.head=null;
|
|
9
|
+
this.#init();
|
|
10
|
+
this.seo=Seo(this);
|
|
11
|
+
Object.assign(this.events,{
|
|
12
|
+
hash:null
|
|
13
|
+
})
|
|
14
|
+
Object.assign(this.cache,{
|
|
15
|
+
theme:null,
|
|
16
|
+
isRoot:true
|
|
17
|
+
});
|
|
18
|
+
// globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
19
|
+
}
|
|
20
|
+
#init(){
|
|
21
|
+
this.root.setAttribute("data-engine","zikojs");
|
|
22
|
+
const head=this.root.getElementsByTagName("head")[0];
|
|
23
|
+
this.head=head?head:this.head=document?.createElement("head");
|
|
24
|
+
if(!head)this.root.insertBefore(this.head,document?.body);
|
|
25
|
+
const title=this.head.getElementsByTagName("title")[0];
|
|
26
|
+
this.Title=title?title:document?.createElement("title");
|
|
27
|
+
if(!title)this.head.append(this.Title);
|
|
28
|
+
}
|
|
29
|
+
title(title=this.title.textContent){
|
|
30
|
+
this.Title.textContent=title;
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
prefetch(){
|
|
34
|
+
|
|
35
|
+
}
|
|
36
|
+
description(){
|
|
37
|
+
|
|
38
|
+
}
|
|
39
|
+
onHashChange(...callbacks){
|
|
40
|
+
if(!this.events.hash)this.events.hash = useHashEvent(this);
|
|
41
|
+
this.events.hash.onChange(...callbacks);
|
|
42
|
+
return this;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const App=(...UIElement)=>new ZikoUIApp().append(...UIElement)
|
|
46
46
|
export {App};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
// if(globalThis?.document){
|
|
2
|
-
// class ZikoUIComponent extends HTMLElement{
|
|
3
|
-
// constructor(){
|
|
4
|
-
// super();
|
|
5
|
-
// this.shadowDOM = this.attachShadow({ mode: 'open' });
|
|
6
|
-
// this.wrapper=document?.
|
|
7
|
-
// }
|
|
8
|
-
// connectedCallback() {
|
|
9
|
-
// this.setAttribute('role', 'region');
|
|
10
|
-
// this.setAttribute('data-engine',"zikojs");
|
|
11
|
-
// this.shadowDOM.append(this.wrapper);
|
|
12
|
-
// this.observeContentChanges();
|
|
13
|
-
// }
|
|
14
|
-
// observeContentChanges() {
|
|
15
|
-
// const observer = new MutationObserver((mutations) => {
|
|
16
|
-
// mutations.forEach((mutation) => {
|
|
17
|
-
// if (mutation.type === 'childList' || mutation.type === 'characterData') {
|
|
18
|
-
// this.wrapper.innerHTML="";
|
|
19
|
-
// __Ziko__.__Config__.setDefault({ target: this.wrapper });
|
|
20
|
-
// globalThis.eval(this.innerHTML);
|
|
21
|
-
// }
|
|
22
|
-
// });
|
|
23
|
-
// });
|
|
24
|
-
// observer.observe(this, { childList: true, subtree: true, characterData: true });
|
|
25
|
-
// }
|
|
26
|
-
|
|
27
|
-
// disconnectedCallback() {
|
|
28
|
-
// console.log('ZikoUIComponent removed from page.');
|
|
29
|
-
// }
|
|
30
|
-
// }
|
|
31
|
-
// globalThis.customElements.define('ziko-ui', ZikoUIComponent);
|
|
32
|
-
// }
|
|
33
|
-
// else {
|
|
34
|
-
// var ZikoUIComponent = null;
|
|
35
|
-
// }
|
|
36
|
-
// export{
|
|
37
|
-
// ZikoUIComponent
|
|
38
|
-
// }
|
|
1
|
+
// if(globalThis?.document){
|
|
2
|
+
// class ZikoUIComponent extends HTMLElement{
|
|
3
|
+
// constructor(){
|
|
4
|
+
// super();
|
|
5
|
+
// this.shadowDOM = this.attachShadow({ mode: 'open' });
|
|
6
|
+
// this.wrapper=document?.createElement("div");
|
|
7
|
+
// }
|
|
8
|
+
// connectedCallback() {
|
|
9
|
+
// this.setAttribute('role', 'region');
|
|
10
|
+
// this.setAttribute('data-engine',"zikojs");
|
|
11
|
+
// this.shadowDOM.append(this.wrapper);
|
|
12
|
+
// this.observeContentChanges();
|
|
13
|
+
// }
|
|
14
|
+
// observeContentChanges() {
|
|
15
|
+
// const observer = new MutationObserver((mutations) => {
|
|
16
|
+
// mutations.forEach((mutation) => {
|
|
17
|
+
// if (mutation.type === 'childList' || mutation.type === 'characterData') {
|
|
18
|
+
// this.wrapper.innerHTML="";
|
|
19
|
+
// __Ziko__.__Config__.setDefault({ target: this.wrapper });
|
|
20
|
+
// globalThis.eval(this.innerHTML);
|
|
21
|
+
// }
|
|
22
|
+
// });
|
|
23
|
+
// });
|
|
24
|
+
// observer.observe(this, { childList: true, subtree: true, characterData: true });
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
// disconnectedCallback() {
|
|
28
|
+
// console.log('ZikoUIComponent removed from page.');
|
|
29
|
+
// }
|
|
30
|
+
// }
|
|
31
|
+
// globalThis.customElements.define('ziko-ui', ZikoUIComponent);
|
|
32
|
+
// }
|
|
33
|
+
// else {
|
|
34
|
+
// var ZikoUIComponent = null;
|
|
35
|
+
// }
|
|
36
|
+
// export{
|
|
37
|
+
// ZikoUIComponent
|
|
38
|
+
// }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const __UI__={}
|
|
2
|
+
const __Config__={
|
|
3
|
+
default:{
|
|
4
|
+
target:null,
|
|
5
|
+
render:true,
|
|
6
|
+
math:{
|
|
7
|
+
mode:"deg"
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
setDefault:function(pairs){
|
|
11
|
+
const keys=Object.keys(pairs);
|
|
12
|
+
const values=Object.values(pairs);
|
|
13
|
+
for(let i=0;i<keys.length;i++)this.default[keys[i]]=values[i];
|
|
14
|
+
},
|
|
15
|
+
init:()=>document.documentElement.setAttribute("data-engine","zikojs")
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
__UI__,
|
|
19
|
+
__Config__
|
|
20
|
+
}
|