ziko 0.0.22 → 0.0.24
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 +93 -2819
- package/dist/ziko.js +93 -2819
- package/dist/ziko.min.js +2 -2
- package/dist/ziko.mjs +90 -2757
- package/package.json +1 -1
- package/src/app/globals.js +5 -1
- package/src/data/converter/index.js +2 -6
- package/src/graphics/canvas/index.js +176 -2
- package/src/graphics/canvas/utils/floodFill.js +0 -1
- package/src/graphics/svg/index.js +69 -2
- package/src/index.js +2 -1
- package/src/reactivity/hooks/index.js +1 -1
- package/src/ui/elements/{primitives/ZikoUIElement.js → ZikoUIElement.js} +20 -12
- package/src/ui/elements/derived ( To Be Moved)/index.js +12 -0
- package/src/ui/elements/{derived/flex → flex}/index.js +2 -2
- package/src/ui/elements/{derived/grid → grid}/index.js +2 -2
- package/src/ui/elements/{primitives/index.js → index.js} +3 -1
- package/src/ui/elements/{primitives/io → io}/Form/index.js +1 -1
- package/src/ui/elements/{primitives/io → io}/Inputs/__helpers__.js +1 -1
- package/src/ui/elements/{primitives/io → io}/Inputs/input/index.js +1 -1
- package/src/ui/elements/{primitives/list → list}/index.js +2 -3
- package/src/ui/elements/{primitives/misc → misc}/index.js +2 -3
- package/src/ui/elements/{primitives/semantic → semantic}/index.js +8 -8
- package/src/ui/elements/{primitives/table → table}/table.js +1 -1
- package/src/ui/elements/{primitives/text → text}/__ZikoUIText__.js +3 -4
- package/src/ui/index.js +21 -21
- package/src/ui/utils/index.js +1 -1
- package/src/graphics/canvas/canvas.js +0 -176
- package/src/graphics/svg/svg.js +0 -69
- package/src/reactivity/hooks/Interactions/useSerial.js +0 -0
- package/src/types.js +0 -73
- package/src/ui/elements/derived/index.js +0 -12
- package/src/ui/elements/primitives/ZikoUIContainerElement.js +0 -123
- package/starter/bin/index.js +0 -11
- /package/src/{global → _global (To Be Replaced )}/_themes/dark.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/_themes/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/_themes/light.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/app/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/component/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/globals/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/params/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/router/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/seo/index.js +0 -0
- /package/src/{global → _global (To Be Replaced )}/style/index.js +0 -0
- /package/src/data/converter/{adoc.js → __(To Be Moved)adoc.js} +0 -0
- /package/src/data/converter/{markdown.js → __(To Be Moved)markdown.js} +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/arc.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/image.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/line.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/path.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/points.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/polygon.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/polyline.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/rect.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Basic/text.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/histogram.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/plot.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/scatter.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Chart/stem.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/Element.js +0 -0
- /package/src/graphics/canvas/{elements → elements ( To Be Moved )}/index.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/circle.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/ellipse.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/foreign-object.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/groupe.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/image.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/index.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/line.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/link.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/path.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/polygon.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/polyline.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/rect.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Basic/text.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Derived/grid.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/Derived/index.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/index.js +0 -0
- /package/src/graphics/svg/{Elements → Elements ( To Be Moved )}/ziko-svg-element.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/index.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useBattery.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useCamera.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useGeolocation.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useMicro.js +0 -0
- /package/src/reactivity/hooks/{Sensors → Sensors ( To Be Moved )}/useOrientation.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/accordion/accordion.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/accordion/collapsible.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/accordion/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/alert/alert.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/alert/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/alert/palette.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/carousel/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/SubElements.js.txt +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/code-cell.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/code-note.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/code-note/sub-elements.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/menu/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/menu/menu3d.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/modal/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/pagination/breadcrumbs.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/pagination/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/__ZikoUISlider__.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/hSlider.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/slider/vSlider.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/__ZikoUISplitter__.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/hsplitter.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/index.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/splitter/vsplitter.js +0 -0
- /package/src/ui/elements/{derived → derived ( To Be Moved)}/tabs/index.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/html.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/index.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/pdf.js +0 -0
- /package/src/ui/elements/{primitives/embaded → embaded}/youtube.js +0 -0
- /package/src/{data/parser/markdown.js → ui/elements/hydrate.js} +0 -0
- /package/src/ui/elements/{primitives/io → io}/Form/index.js.txt +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-camera/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-checkbox/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-color/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date-time.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-date.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-date-time/input-time.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-email.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-email-password/input-password.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-file.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-file/input-image.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-number/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-radio/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-search/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Inputs/input-slider/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Select/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/Textarea/index.js +0 -0
- /package/src/ui/elements/{primitives/io → io}/index.js +0 -0
- /package/src/ui/elements/{primitives/list → list}/elements.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Audio/index.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Image/figure.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Image/image.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Image/index.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/Video/index.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/__ZikoUIDynamicMediaELement__.js +0 -0
- /package/src/ui/elements/{primitives/media → media}/index.js +0 -0
- /package/src/ui/elements/{primitives/misc → misc}/hyperscript.js +0 -0
- /package/src/ui/elements/{primitives/misc → misc}/suspense.js +0 -0
- /package/src/ui/elements/{primitives/misc → misc}/xml-wrapper.js +0 -0
- /package/src/ui/elements/{primitives/table → table}/elements.js +0 -0
- /package/src/ui/elements/{primitives/table → table}/index.js +0 -0
- /package/src/ui/elements/{primitives/table → table}/utils.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/heading.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/index.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/p.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/pre.js +0 -0
- /package/src/ui/elements/{primitives/text → text}/text.js +0 -0
package/dist/ziko.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/*
|
|
3
3
|
Project: ziko.js
|
|
4
4
|
Author: Zakaria Elalaoui
|
|
5
|
-
Date :
|
|
5
|
+
Date : Fri Jan 24 2025 23:58:20 GMT+0100 (UTC+01:00)
|
|
6
6
|
Git-Repo : https://github.com/zakarialaoui10/ziko.js
|
|
7
7
|
Git-Wiki : https://github.com/zakarialaoui10/ziko.js/wiki
|
|
8
8
|
Released under MIT License
|
|
@@ -1127,229 +1127,6 @@
|
|
|
1127
1127
|
preload: preload
|
|
1128
1128
|
});
|
|
1129
1129
|
|
|
1130
|
-
const parseInlineElements$1 = text => {
|
|
1131
|
-
return text
|
|
1132
|
-
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
|
1133
|
-
.replace(/\*(.*?)\*/g, '<em>$1</em>')
|
|
1134
|
-
.replace(/\[(.*?)\]\((.*?)\)/g, '<a href="$2">$1</a>')
|
|
1135
|
-
.replace(/!\[(.*?)\]\((.*?)\)/g, '<img src="$2" alt="$1">')
|
|
1136
|
-
.replace(/`([^`]+)`/g, '<code>$1</code>'); // Inline Code
|
|
1137
|
-
};
|
|
1138
|
-
|
|
1139
|
-
const parseTable$1 = line => {
|
|
1140
|
-
const cells = line.split('|').map(cell => cell.trim()).filter(cell => cell !== '');
|
|
1141
|
-
const tableRow = cells.map(cell => `<td>${parseInlineElements$1(cell)}</td>`).join('');
|
|
1142
|
-
return `<tr>${tableRow}</tr>\n`;
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
const parseCodeBlock$1 = (lines, language) => {
|
|
1146
|
-
const codeContent = lines.join('\n'); // No need to exclude the triple backticks
|
|
1147
|
-
const highlightedCode = language ? `<pre><code data-language="${language}">${codeContent}</code></pre>` : `<pre><code>${codeContent}</code></pre>`;
|
|
1148
|
-
return `${highlightedCode}\n`;
|
|
1149
|
-
};
|
|
1150
|
-
|
|
1151
|
-
const parseList$1 = line => {
|
|
1152
|
-
const DIGIT_FOLLOWED_BY_A_DOT_AND_SPACE = /^\d+\.\s/;
|
|
1153
|
-
const match = line.match(DIGIT_FOLLOWED_BY_A_DOT_AND_SPACE);
|
|
1154
|
-
if (match) {
|
|
1155
|
-
let start = +match[1];
|
|
1156
|
-
return `<ol${start===1?"":` start="${start}"`}>${parseInlineElements$1(line.slice(match[0].length))}</ol>\n`;
|
|
1157
|
-
}
|
|
1158
|
-
return `<ul>${parseInlineElements$1(line)}</ul>\n`;
|
|
1159
|
-
};
|
|
1160
|
-
|
|
1161
|
-
const parseHorizontalRule$1 = () => {
|
|
1162
|
-
return '<hr>\n';
|
|
1163
|
-
};
|
|
1164
|
-
|
|
1165
|
-
const markdown2html = markdownText => {
|
|
1166
|
-
const lines = markdownText.split('\n');
|
|
1167
|
-
let htmlOutput = '';
|
|
1168
|
-
let inTable = false;
|
|
1169
|
-
let inCodeBlock = false;
|
|
1170
|
-
let codeBlockLines = [];
|
|
1171
|
-
let codeBlockLanguage = '';
|
|
1172
|
-
for (let i = 0; i < lines.length; i++) {
|
|
1173
|
-
let line = lines[i];
|
|
1174
|
-
// Table
|
|
1175
|
-
if (line.startsWith('|')) {
|
|
1176
|
-
if (!inTable) {
|
|
1177
|
-
inTable = true;
|
|
1178
|
-
htmlOutput += '<table>\n';
|
|
1179
|
-
}
|
|
1180
|
-
htmlOutput += parseTable$1(line);
|
|
1181
|
-
continue;
|
|
1182
|
-
} else if (inTable) {
|
|
1183
|
-
inTable = false;
|
|
1184
|
-
htmlOutput += '</table>\n';
|
|
1185
|
-
}
|
|
1186
|
-
// Code block
|
|
1187
|
-
if (line.startsWith('```')) {
|
|
1188
|
-
if (!inCodeBlock) {
|
|
1189
|
-
inCodeBlock = true;
|
|
1190
|
-
codeBlockLines = [];
|
|
1191
|
-
codeBlockLanguage = line.slice(3).trim();
|
|
1192
|
-
} else {
|
|
1193
|
-
inCodeBlock = false;
|
|
1194
|
-
htmlOutput += parseCodeBlock$1(codeBlockLines, codeBlockLanguage);
|
|
1195
|
-
}
|
|
1196
|
-
continue;
|
|
1197
|
-
} else if (inCodeBlock) {
|
|
1198
|
-
codeBlockLines.push(line);
|
|
1199
|
-
continue;
|
|
1200
|
-
}
|
|
1201
|
-
// Headings
|
|
1202
|
-
if (line.startsWith('# ')) {
|
|
1203
|
-
const headingLevel = line.indexOf(' ');
|
|
1204
|
-
const headingText = line.slice(headingLevel + 1);
|
|
1205
|
-
htmlOutput += `<h${headingLevel}>${parseInlineElements$1(headingText)}</h${headingLevel}>\n`;
|
|
1206
|
-
continue;
|
|
1207
|
-
}
|
|
1208
|
-
// Lists
|
|
1209
|
-
if (line.startsWith('- ') || line.startsWith('* ') || line.match(/^\d+\.\s/)) {
|
|
1210
|
-
htmlOutput += parseList$1(line);
|
|
1211
|
-
continue;
|
|
1212
|
-
}
|
|
1213
|
-
// Horizontal Rule
|
|
1214
|
-
if (line.trim() === '---') {
|
|
1215
|
-
htmlOutput += parseHorizontalRule$1();
|
|
1216
|
-
continue;
|
|
1217
|
-
}
|
|
1218
|
-
// Other paragraphs
|
|
1219
|
-
htmlOutput += `<p>${parseInlineElements$1(line)}</p>\n`;
|
|
1220
|
-
}
|
|
1221
|
-
return htmlOutput;
|
|
1222
|
-
};
|
|
1223
|
-
|
|
1224
|
-
const parseInlineElements = text => {
|
|
1225
|
-
return text
|
|
1226
|
-
.replace(/\*(.*?)\*/g, '_$1_') // Emphasis
|
|
1227
|
-
.replace(/\*\*(.*?)\*\*/g, '*$1*') // Strong
|
|
1228
|
-
.replace(/\[(.*?)\]\((.*?)\)/g, 'link:$2[$1]') // Links
|
|
1229
|
-
.replace(/!\[(.*?)\]\((.*?)\)/g, 'image::$2[$1]') // Images
|
|
1230
|
-
.replace(/`([^`]+)`/g, '``$1``') // Inline Code
|
|
1231
|
-
.replace(/^\*\s/, ''); // Remove list item marker at the beginning of the line
|
|
1232
|
-
};
|
|
1233
|
-
|
|
1234
|
-
const parseTable = line => {
|
|
1235
|
-
const cells = line.split('|').map(cell => cell.trim()).filter(cell => cell !== '');
|
|
1236
|
-
const tableRow = cells.map(cell => `<td>${parseInlineElements(cell)}</td>`).join('');
|
|
1237
|
-
return `<tr>${tableRow}</tr>\n`;
|
|
1238
|
-
};
|
|
1239
|
-
|
|
1240
|
-
const parseCodeBlock = (lines, language) => {
|
|
1241
|
-
const codeContent = lines.join('\n'); // No need to exclude the triple backticks
|
|
1242
|
-
const highlightedCode = language ? `<pre><code data-language="${language}">${codeContent}</code></pre>` : `<pre><code>${codeContent}</code></pre>`;
|
|
1243
|
-
return `${highlightedCode}\n`;
|
|
1244
|
-
};
|
|
1245
|
-
|
|
1246
|
-
const parseList = line => {
|
|
1247
|
-
const OL_PATTERN = /^(\d+)\.\s/;
|
|
1248
|
-
const OL_PATTERN_WITHOUT_START = /^[.]\s/;
|
|
1249
|
-
const UL_PATTERN = /^[*]\s/;
|
|
1250
|
-
|
|
1251
|
-
if (line.match(OL_PATTERN)) {
|
|
1252
|
-
const start = line.match(OL_PATTERN)[1];
|
|
1253
|
-
return `<ol start="${start}"><li>${parseInlineElements(line.replace(OL_PATTERN, ''))}</li></ol>\n`;
|
|
1254
|
-
}
|
|
1255
|
-
if (line.match(OL_PATTERN_WITHOUT_START)) {
|
|
1256
|
-
return `<ol><li>${parseInlineElements(line.replace(OL_PATTERN_WITHOUT_START, ''))}</li></ol>\n`;
|
|
1257
|
-
}
|
|
1258
|
-
if (line.match(UL_PATTERN)) {
|
|
1259
|
-
return `<ul><li>${parseInlineElements(line.replace(UL_PATTERN, ''))}</li></ul>\n`;
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
// If neither ordered nor unordered list pattern matches, treat it as a paragraph
|
|
1263
|
-
return `<p>${parseInlineElements(line)}</p>\n`;
|
|
1264
|
-
};
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
const parseBlockquote = line => {
|
|
1270
|
-
return `<blockquote>${parseInlineElements(line.slice(2))}</blockquote>\n`;
|
|
1271
|
-
};
|
|
1272
|
-
|
|
1273
|
-
const parseHorizontalRule = () => {
|
|
1274
|
-
return '<hr>\n';
|
|
1275
|
-
};
|
|
1276
|
-
|
|
1277
|
-
const parseAttributes = line => {
|
|
1278
|
-
const attrs = line.match(/\[(.*?)\]/);
|
|
1279
|
-
return attrs ? attrs[1].split(',').map(attr => `[${attr.trim()}]`).join('') : '';
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
const adoc2html = adocText => {
|
|
1283
|
-
const lines = adocText.split('\n');
|
|
1284
|
-
let htmlOutput = '';
|
|
1285
|
-
let inTable = false;
|
|
1286
|
-
let inCodeBlock = false;
|
|
1287
|
-
let codeBlockLines = [];
|
|
1288
|
-
let codeBlockLanguage = '';
|
|
1289
|
-
for (let i = 0; i < lines.length; i++) {
|
|
1290
|
-
let line = lines[i];
|
|
1291
|
-
// Table
|
|
1292
|
-
if (line.startsWith('|')) {
|
|
1293
|
-
if (!inTable) {
|
|
1294
|
-
inTable = true;
|
|
1295
|
-
htmlOutput += '<table>\n';
|
|
1296
|
-
}
|
|
1297
|
-
htmlOutput += parseTable(line);
|
|
1298
|
-
continue;
|
|
1299
|
-
} else if (inTable) {
|
|
1300
|
-
inTable = false;
|
|
1301
|
-
htmlOutput += '</table>\n';
|
|
1302
|
-
}
|
|
1303
|
-
// Code block
|
|
1304
|
-
if (line.startsWith('```')) {
|
|
1305
|
-
if (!inCodeBlock) {
|
|
1306
|
-
inCodeBlock = true;
|
|
1307
|
-
codeBlockLines = [];
|
|
1308
|
-
codeBlockLanguage = line.slice(3).trim();
|
|
1309
|
-
} else {
|
|
1310
|
-
inCodeBlock = false;
|
|
1311
|
-
htmlOutput += parseCodeBlock(codeBlockLines, codeBlockLanguage);
|
|
1312
|
-
}
|
|
1313
|
-
continue;
|
|
1314
|
-
} else if (inCodeBlock) {
|
|
1315
|
-
codeBlockLines.push(line);
|
|
1316
|
-
continue;
|
|
1317
|
-
}
|
|
1318
|
-
// Headings
|
|
1319
|
-
if (line.startsWith('=')) {
|
|
1320
|
-
const headingLevel = (line.match(/=/g) || []).length;
|
|
1321
|
-
const headingText = line.replace(/=/g, '').trim();
|
|
1322
|
-
htmlOutput += `<h${headingLevel}>${parseInlineElements(headingText)}</h${headingLevel}>\n`;
|
|
1323
|
-
continue;
|
|
1324
|
-
}
|
|
1325
|
-
// Lists
|
|
1326
|
-
if (line.match(/^(\d+)\.\s/) || line.match(/^[*\.]\s/)) {
|
|
1327
|
-
htmlOutput += parseList(line);
|
|
1328
|
-
continue;
|
|
1329
|
-
}
|
|
1330
|
-
// Blockquote
|
|
1331
|
-
if (line.startsWith('> ')) {
|
|
1332
|
-
htmlOutput += parseBlockquote(line);
|
|
1333
|
-
continue;
|
|
1334
|
-
}
|
|
1335
|
-
// Horizontal Rule
|
|
1336
|
-
if (line.trim() === '---') {
|
|
1337
|
-
htmlOutput += parseHorizontalRule();
|
|
1338
|
-
continue;
|
|
1339
|
-
}
|
|
1340
|
-
// Attributes
|
|
1341
|
-
if (line.startsWith('[')) {
|
|
1342
|
-
htmlOutput += parseAttributes(line);
|
|
1343
|
-
continue;
|
|
1344
|
-
}
|
|
1345
|
-
// Other paragraphs
|
|
1346
|
-
if (line.trim() !== '') { // Exclude empty lines
|
|
1347
|
-
htmlOutput += `<p>${parseInlineElements(line)}</p>\n`;
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
return htmlOutput;
|
|
1351
|
-
};
|
|
1352
|
-
|
|
1353
1130
|
const csv2arr = (csv, delimiter = ",")=>csv.trim().trimEnd().split("\n").map(n=>n.split(delimiter));
|
|
1354
1131
|
const csv2matrix = (csv, delimiter = ",")=>new Matrix(csv2arr(csv,delimiter));
|
|
1355
1132
|
const csv2object = (csv, delimiter = ",") => {
|
|
@@ -4495,59 +4272,6 @@
|
|
|
4495
4272
|
return T;
|
|
4496
4273
|
};
|
|
4497
4274
|
|
|
4498
|
-
class ZikoUseBattery{
|
|
4499
|
-
constructor(){
|
|
4500
|
-
if(this.isSupported)this.#init();
|
|
4501
|
-
}
|
|
4502
|
-
async #init(){
|
|
4503
|
-
this.__Battery__=await navigator.getBattery();
|
|
4504
|
-
}
|
|
4505
|
-
get isSupported(){
|
|
4506
|
-
return !!navigator.getBattery;
|
|
4507
|
-
}
|
|
4508
|
-
get current(){
|
|
4509
|
-
// Synchrouns Code
|
|
4510
|
-
const {
|
|
4511
|
-
level,
|
|
4512
|
-
charging,
|
|
4513
|
-
chargingTime,
|
|
4514
|
-
dischargingTime
|
|
4515
|
-
}=this.__Battery__;
|
|
4516
|
-
return {
|
|
4517
|
-
level,
|
|
4518
|
-
charging,
|
|
4519
|
-
chargingTime,
|
|
4520
|
-
dischargingTime
|
|
4521
|
-
}
|
|
4522
|
-
}
|
|
4523
|
-
onChargingChange(callback){
|
|
4524
|
-
this.__Battery__?.addEventListener("chargingchange",callback);
|
|
4525
|
-
return this;
|
|
4526
|
-
}
|
|
4527
|
-
onLevelChange(callback){
|
|
4528
|
-
this.__Battery__?.addEventListener("levelchange",callback);
|
|
4529
|
-
return this;
|
|
4530
|
-
}
|
|
4531
|
-
}
|
|
4532
|
-
const useBattery=()=>new ZikoUseBattery();
|
|
4533
|
-
|
|
4534
|
-
class ZikoUseGeolocation{
|
|
4535
|
-
constructor(){
|
|
4536
|
-
if(this.isSupported)this.#init();
|
|
4537
|
-
}
|
|
4538
|
-
async #init(){
|
|
4539
|
-
navigator.geolocation.getCurrentPosition(e=>this.__Geolocation__=e);
|
|
4540
|
-
}
|
|
4541
|
-
get isSupported(){
|
|
4542
|
-
return !!navigator.geolocation;
|
|
4543
|
-
}
|
|
4544
|
-
get current(){
|
|
4545
|
-
// Synchrouns Code
|
|
4546
|
-
return this.__Geolocation__;
|
|
4547
|
-
}
|
|
4548
|
-
}
|
|
4549
|
-
const useGeolocation=()=>new ZikoUseGeolocation();
|
|
4550
|
-
|
|
4551
4275
|
class ZikoUseChannel{
|
|
4552
4276
|
constructor(name=""){
|
|
4553
4277
|
this.channel=new BroadcastChannel(name);
|
|
@@ -4823,12 +4547,10 @@
|
|
|
4823
4547
|
ZikoHead: ZikoHead$1,
|
|
4824
4548
|
ZikoUseRoot: ZikoUseRoot,
|
|
4825
4549
|
ZikoUseStyle: ZikoUseStyle,
|
|
4826
|
-
useBattery: useBattery,
|
|
4827
4550
|
useChannel: useChannel$1,
|
|
4828
4551
|
useDebounce: useDebounce,
|
|
4829
4552
|
useEventEmitter: useEventEmitter,
|
|
4830
4553
|
useFavIcon: useFavIcon$1,
|
|
4831
|
-
useGeolocation: useGeolocation,
|
|
4832
4554
|
useHead: useHead$1,
|
|
4833
4555
|
useLocaleStorage: useLocaleStorage,
|
|
4834
4556
|
useMediaQuery: useMediaQuery,
|
|
@@ -4851,7 +4573,7 @@
|
|
|
4851
4573
|
};
|
|
4852
4574
|
|
|
4853
4575
|
class ZikoUIElement {
|
|
4854
|
-
constructor(element
|
|
4576
|
+
constructor(element, name="", {el_type="html", useDefaultStyle=false}={}){
|
|
4855
4577
|
this.target = globalThis.__Ziko__.__Config__.default.target||globalThis?.document?.body;
|
|
4856
4578
|
if(typeof element === "string") {
|
|
4857
4579
|
switch(el_type){
|
|
@@ -4860,8 +4582,10 @@
|
|
|
4860
4582
|
default : throw Error("Not supported")
|
|
4861
4583
|
}
|
|
4862
4584
|
}
|
|
4585
|
+
else {
|
|
4586
|
+
this.target = element.parentElement;
|
|
4587
|
+
}
|
|
4863
4588
|
if(element)this.__ele__ = element;
|
|
4864
|
-
this.uuid=this.constructor.name+"-"+Random.string(10);
|
|
4865
4589
|
this.cache = {
|
|
4866
4590
|
name,
|
|
4867
4591
|
parent:null,
|
|
@@ -4892,23 +4616,29 @@
|
|
|
4892
4616
|
resize:null,
|
|
4893
4617
|
intersection:null
|
|
4894
4618
|
};
|
|
4619
|
+
this.uuid = `${this.cache.name}-${Random.string(16)}`;
|
|
4895
4620
|
this.cache.style.linkTo(this);
|
|
4896
|
-
this.style({
|
|
4621
|
+
useDefaultStyle && this.style({
|
|
4897
4622
|
position: "relative",
|
|
4898
4623
|
boxSizing:"border-box",
|
|
4899
4624
|
margin:0,
|
|
4900
4625
|
padding:0,
|
|
4626
|
+
width : "auto",
|
|
4627
|
+
height : "auto"
|
|
4901
4628
|
});
|
|
4902
4629
|
this.items = [];
|
|
4903
|
-
this.size("auto", "auto");
|
|
4904
4630
|
globalThis.__Ziko__.__UI__[this.cache.name]?globalThis.__Ziko__.__UI__[this.cache.name]?.push(this):globalThis.__Ziko__.__UI__[this.cache.name]=[this];
|
|
4905
4631
|
element && globalThis.__Ziko__.__Config__.default.render && this.render();
|
|
4632
|
+
this.setAttr("data-ref", this.uuid);
|
|
4633
|
+
if(globalThis.__Ziko__.__Config__.renderingMode !== "spa" && !globalThis.__Ziko__.__Config__.isSSC) {
|
|
4634
|
+
globalThis.__Ziko__.__HYDRATION_MAP__.set(this.uuid, ()=>this);
|
|
4635
|
+
}
|
|
4906
4636
|
}
|
|
4907
4637
|
get element(){
|
|
4908
|
-
return this.__ele__
|
|
4638
|
+
return this.__ele__;
|
|
4909
4639
|
}
|
|
4910
4640
|
get isZikoUIElement(){
|
|
4911
|
-
return true
|
|
4641
|
+
return true;
|
|
4912
4642
|
}
|
|
4913
4643
|
get st(){
|
|
4914
4644
|
return this.cache.style;
|
|
@@ -4917,7 +4647,7 @@
|
|
|
4917
4647
|
return this.cache.attributes;
|
|
4918
4648
|
}
|
|
4919
4649
|
get evt(){
|
|
4920
|
-
return this.
|
|
4650
|
+
return this.events;
|
|
4921
4651
|
}
|
|
4922
4652
|
get html(){
|
|
4923
4653
|
return this.element.innerHTML;
|
|
@@ -4982,7 +4712,7 @@
|
|
|
4982
4712
|
return this;
|
|
4983
4713
|
}
|
|
4984
4714
|
for (let i = 0; i < ele.length; i++) {
|
|
4985
|
-
if (["number", "string"].includes(typeof ele[i])) ele[i] = text
|
|
4715
|
+
if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
|
|
4986
4716
|
if (ele[i] instanceof ZikoUIElement) {
|
|
4987
4717
|
ele[i].cache.parent = this;
|
|
4988
4718
|
this.element[adder](ele[i].element);
|
|
@@ -5012,7 +4742,7 @@
|
|
|
5012
4742
|
if (index >= this.element.children.length) this.append(...ele);
|
|
5013
4743
|
else
|
|
5014
4744
|
for (let i = 0; i < ele.length; i++) {
|
|
5015
|
-
if (["number", "string"].includes(typeof ele[i])) ele[i] = text
|
|
4745
|
+
if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
|
|
5016
4746
|
this.element?.insertBefore(ele[i].element, this.items[index].element);
|
|
5017
4747
|
this.items.splice(index, 0, ele[i]);
|
|
5018
4748
|
}
|
|
@@ -5431,128 +5161,7 @@
|
|
|
5431
5161
|
}
|
|
5432
5162
|
}
|
|
5433
5163
|
|
|
5434
|
-
class
|
|
5435
|
-
constructor(element, name = "") {
|
|
5436
|
-
super(element, name);
|
|
5437
|
-
this.items = [];
|
|
5438
|
-
}
|
|
5439
|
-
// maintain() {
|
|
5440
|
-
// for (let i = 0; i < this.items.length; i++)
|
|
5441
|
-
// Object.assign(this, { [[i]]: this.items[i] });
|
|
5442
|
-
// this.length = this.items.length;
|
|
5443
|
-
// return this;
|
|
5444
|
-
// }
|
|
5445
|
-
// at(index) {
|
|
5446
|
-
// return this.items.at(index);
|
|
5447
|
-
// }
|
|
5448
|
-
// #addItem(adder, pusher, ...ele) {
|
|
5449
|
-
// if (this.cache.isFrozzen) {
|
|
5450
|
-
// console.warn("You can't append new item to frozzen element");
|
|
5451
|
-
// return this;
|
|
5452
|
-
// }
|
|
5453
|
-
// for (let i = 0; i < ele.length; i++) {
|
|
5454
|
-
// if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
|
|
5455
|
-
// if (ele[i] instanceof ZikoUIElement) {
|
|
5456
|
-
// ele[i].cache.parent = this;
|
|
5457
|
-
// this.element[adder](ele[i].element);
|
|
5458
|
-
// ele[i].target = this.element;
|
|
5459
|
-
// this.items[pusher](ele[i]);
|
|
5460
|
-
// } else if (ele[i] instanceof Object) {
|
|
5461
|
-
// if (ele[i]?.style) this.style(ele[i]?.style);
|
|
5462
|
-
// if (ele[i]?.attr) {
|
|
5463
|
-
// Object.entries(ele[i].attr).forEach((n) =>
|
|
5464
|
-
// this.setAttr("" + n[0], n[1]),
|
|
5465
|
-
// );
|
|
5466
|
-
// }
|
|
5467
|
-
// }
|
|
5468
|
-
// }
|
|
5469
|
-
// this.maintain();
|
|
5470
|
-
// return this;
|
|
5471
|
-
// }
|
|
5472
|
-
// append(...ele) {
|
|
5473
|
-
// this.#addItem("append", "push", ...ele);
|
|
5474
|
-
// return this;
|
|
5475
|
-
// }
|
|
5476
|
-
// prepend(...ele) {
|
|
5477
|
-
// this.#addItem("prepend", "unshift", ...ele);
|
|
5478
|
-
// return this;
|
|
5479
|
-
// }
|
|
5480
|
-
// insertAt(index, ...ele) {
|
|
5481
|
-
// if (index >= this.element.children.length) this.append(...ele);
|
|
5482
|
-
// else
|
|
5483
|
-
// for (let i = 0; i < ele.length; i++) {
|
|
5484
|
-
// if (["number", "string"].includes(typeof ele[i])) ele[i] = text(ele[i]);
|
|
5485
|
-
// this.element?.insertBefore(ele[i].element, this.items[index].element);
|
|
5486
|
-
// this.items.splice(index, 0, ele[i]);
|
|
5487
|
-
// }
|
|
5488
|
-
// return this;
|
|
5489
|
-
// }
|
|
5490
|
-
// remove(...ele) {
|
|
5491
|
-
// const remove = (ele) => {
|
|
5492
|
-
// if (typeof ele === "number") ele = this.items[ele];
|
|
5493
|
-
// if (ele instanceof ZikoUIElement) this.element?.removeChild(ele.element);
|
|
5494
|
-
// this.items = this.items.filter((n) => n !== ele);
|
|
5495
|
-
// };
|
|
5496
|
-
// for (let i = 0; i < ele.length; i++) remove(ele[i]);
|
|
5497
|
-
// for (let i = 0; i < this.items.length; i++)
|
|
5498
|
-
// Object.assign(this, { [[i]]: this.items[i] });
|
|
5499
|
-
// // Remove from item
|
|
5500
|
-
// return this;
|
|
5501
|
-
// }
|
|
5502
|
-
// forEach(callback) {
|
|
5503
|
-
// this.items.forEach(callback);
|
|
5504
|
-
// return this;
|
|
5505
|
-
// }
|
|
5506
|
-
// map(callback) {
|
|
5507
|
-
// return this.items.map(callback);
|
|
5508
|
-
// }
|
|
5509
|
-
// find(condition) {
|
|
5510
|
-
// return this.items.filter(condition);
|
|
5511
|
-
// }
|
|
5512
|
-
// filter(condition_callback, if_callback = () => {}, else_callback = () => {}) {
|
|
5513
|
-
// const FilterItems = this.items.filter(condition_callback);
|
|
5514
|
-
// FilterItems.forEach(if_callback);
|
|
5515
|
-
// this.items
|
|
5516
|
-
// .filter((item) => !FilterItems.includes(item))
|
|
5517
|
-
// .forEach(else_callback);
|
|
5518
|
-
// return this;
|
|
5519
|
-
// }
|
|
5520
|
-
// filterByTextContent(text, exactMatch = false) {
|
|
5521
|
-
// this.items.forEach((n) => n.render());
|
|
5522
|
-
// this.filter(
|
|
5523
|
-
// (n) => !(exactMatch ? n.text === text : n.text.includes(text)),
|
|
5524
|
-
// (e) => e.unrender(),
|
|
5525
|
-
// );
|
|
5526
|
-
// // this.items.filter(n=>{
|
|
5527
|
-
// // const content=n.element.textContent;
|
|
5528
|
-
// // return !(exactMatch?content===text:content.includes(text))
|
|
5529
|
-
// // }).map(n=>n.unrender());
|
|
5530
|
-
// // return this;
|
|
5531
|
-
// }
|
|
5532
|
-
// filterByClass(value) {
|
|
5533
|
-
// this.items.map((n) => n.render());
|
|
5534
|
-
// this.items
|
|
5535
|
-
// .filter((n) => !n.classes.includes(value))
|
|
5536
|
-
// .map((n) => n.unrender());
|
|
5537
|
-
// return this;
|
|
5538
|
-
// }
|
|
5539
|
-
// sortByTextContent(value, displays) {
|
|
5540
|
-
// let item = this.children;
|
|
5541
|
-
// item
|
|
5542
|
-
// .filter((n) => !n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5543
|
-
// .map((n) => {
|
|
5544
|
-
// n.style.display = "none";
|
|
5545
|
-
// });
|
|
5546
|
-
// item
|
|
5547
|
-
// .filter((n) => n.textContent.toLowerCase().includes(value.toLowerCase()))
|
|
5548
|
-
// .map((n, i) => (n.style.display = displays[i]));
|
|
5549
|
-
// //return item.filter(n=>n.style.display!="none")
|
|
5550
|
-
// item.filter((n) => n.style.display != "none");
|
|
5551
|
-
// return this;
|
|
5552
|
-
// }
|
|
5553
|
-
}
|
|
5554
|
-
|
|
5555
|
-
class __ZikoUIText__ extends ZikoUIContainerElement {
|
|
5164
|
+
class __ZikoUIText__ extends ZikoUIElement {
|
|
5556
5165
|
constructor(tag, name, lineBreak,...value) {
|
|
5557
5166
|
super(tag, name);
|
|
5558
5167
|
this.addValue(...value);
|
|
@@ -5657,7 +5266,7 @@
|
|
|
5657
5266
|
return true
|
|
5658
5267
|
}
|
|
5659
5268
|
}
|
|
5660
|
-
const text
|
|
5269
|
+
const text = (...str) => new ZikoUIText(...str);
|
|
5661
5270
|
const quote = (...str) => new ZikoUIQuote(...str);
|
|
5662
5271
|
const dfnText = (...str) => new ZikoUIDefintion(...str);
|
|
5663
5272
|
const supText = (...str) => new ZikoUISupText(...str);
|
|
@@ -5738,10 +5347,10 @@
|
|
|
5738
5347
|
quote: quote,
|
|
5739
5348
|
subText: subText,
|
|
5740
5349
|
supText: supText,
|
|
5741
|
-
text: text
|
|
5350
|
+
text: text
|
|
5742
5351
|
});
|
|
5743
5352
|
|
|
5744
|
-
class ZikoUILI extends
|
|
5353
|
+
class ZikoUILI extends ZikoUIElement{
|
|
5745
5354
|
constructor(UI){
|
|
5746
5355
|
super("li","li");
|
|
5747
5356
|
this.append(UI);
|
|
@@ -5750,7 +5359,7 @@
|
|
|
5750
5359
|
return true;
|
|
5751
5360
|
}
|
|
5752
5361
|
}
|
|
5753
|
-
class ZikoUIList extends
|
|
5362
|
+
class ZikoUIList extends ZikoUIElement {
|
|
5754
5363
|
constructor(element,name) {
|
|
5755
5364
|
super(element,name);
|
|
5756
5365
|
delete this.append;
|
|
@@ -5762,7 +5371,7 @@
|
|
|
5762
5371
|
append(...arr){
|
|
5763
5372
|
for (let i = 0; i < arr.length; i++) {
|
|
5764
5373
|
let li = null;
|
|
5765
|
-
if(["string","number"].includes(typeof arr[i]))arr[i]=text
|
|
5374
|
+
if(["string","number"].includes(typeof arr[i]))arr[i]=text(arr[i]);
|
|
5766
5375
|
if (arr[i] instanceof ZikoUIElement)li=new ZikoUILI(arr[i]);
|
|
5767
5376
|
li.setTarget(this.element);
|
|
5768
5377
|
this.items.push(li[0]);
|
|
@@ -5790,7 +5399,7 @@
|
|
|
5790
5399
|
else
|
|
5791
5400
|
for (let i = 0; i < ele.length; i++) {
|
|
5792
5401
|
let li = null;
|
|
5793
|
-
if(["number","string"].includes(typeof ele[i]))ele[i]=text
|
|
5402
|
+
if(["number","string"].includes(typeof ele[i]))ele[i]=text(ele[i]);
|
|
5794
5403
|
if (ele[i] instanceof ZikoUIElement)li=new ZikoUILI(ele[i]);
|
|
5795
5404
|
this.element?.insertBefore(li.element, this.items[index].parent.element);
|
|
5796
5405
|
this.items.splice(index, 0, ele[i][0]);
|
|
@@ -6398,7 +6007,7 @@
|
|
|
6398
6007
|
return acc;
|
|
6399
6008
|
}, {});
|
|
6400
6009
|
|
|
6401
|
-
class ZikoUIHtmlTag extends
|
|
6010
|
+
class ZikoUIHtmlTag extends ZikoUIElement {
|
|
6402
6011
|
constructor(element) {
|
|
6403
6012
|
super(element,"html");
|
|
6404
6013
|
}
|
|
@@ -6451,7 +6060,7 @@
|
|
|
6451
6060
|
return true
|
|
6452
6061
|
}
|
|
6453
6062
|
}
|
|
6454
|
-
class ZikoUILink extends
|
|
6063
|
+
class ZikoUILink extends ZikoUIElement{
|
|
6455
6064
|
constructor(href){
|
|
6456
6065
|
super("a","link");
|
|
6457
6066
|
Object.assign(this.cache,{
|
|
@@ -6785,7 +6394,7 @@
|
|
|
6785
6394
|
}
|
|
6786
6395
|
const textarea =()=> new ZikoUITextArea();
|
|
6787
6396
|
|
|
6788
|
-
|
|
6397
|
+
class ZikoUIFlex extends ZikoUIElement {
|
|
6789
6398
|
constructor(tag = "div", w = "100%", h = "100%") {
|
|
6790
6399
|
super(tag ,"Flex");
|
|
6791
6400
|
this.direction = "cols";
|
|
@@ -6833,18 +6442,18 @@
|
|
|
6833
6442
|
return this;
|
|
6834
6443
|
}
|
|
6835
6444
|
vertical(x, y, order=1) {
|
|
6836
|
-
set_vertical
|
|
6445
|
+
set_vertical.call(this,order);
|
|
6837
6446
|
this.style({
|
|
6838
|
-
alignItems: typeof(x)==="number"?map_pos_x
|
|
6839
|
-
justifyContent: typeof(y)=="number"?map_pos_y
|
|
6447
|
+
alignItems: typeof(x)==="number"?map_pos_x.call(this,x):x,
|
|
6448
|
+
justifyContent: typeof(y)=="number"?map_pos_y.call(this,y):y
|
|
6840
6449
|
});
|
|
6841
6450
|
return this;
|
|
6842
6451
|
}
|
|
6843
6452
|
horizontal(x, y, order=1) {
|
|
6844
|
-
set_horizontal
|
|
6453
|
+
set_horizontal.call(this,order);
|
|
6845
6454
|
this.style({
|
|
6846
|
-
alignItems: typeof(y)=="number"?map_pos_y
|
|
6847
|
-
justifyContent: typeof(x)==="number"?map_pos_x
|
|
6455
|
+
alignItems: typeof(y)=="number"?map_pos_y.call(this,y):y,
|
|
6456
|
+
justifyContent: typeof(x)==="number"?map_pos_x.call(this,x):x
|
|
6848
6457
|
});
|
|
6849
6458
|
return this;
|
|
6850
6459
|
}
|
|
@@ -6853,38 +6462,44 @@
|
|
|
6853
6462
|
this.style({ display: "flex" });
|
|
6854
6463
|
return this;
|
|
6855
6464
|
}
|
|
6856
|
-
}
|
|
6465
|
+
}
|
|
6857
6466
|
|
|
6858
|
-
const Flex
|
|
6467
|
+
const Flex = (...ZikoUIElement) =>{
|
|
6859
6468
|
let tag="div";
|
|
6860
6469
|
if(typeof ZikoUIElement[0]==="string"){
|
|
6861
6470
|
tag=ZikoUIElement[0];
|
|
6862
6471
|
ZikoUIElement.pop();
|
|
6863
6472
|
}
|
|
6864
|
-
return new ZikoUIFlex
|
|
6473
|
+
return new ZikoUIFlex(tag).append(...ZikoUIElement);
|
|
6865
6474
|
};
|
|
6866
|
-
function set_vertical
|
|
6475
|
+
function set_vertical(direction){
|
|
6867
6476
|
direction == 1
|
|
6868
6477
|
? this.style({ flexDirection: "column" })
|
|
6869
6478
|
: direction == -1 && this.style({ flexDirection: "column-reverse" });
|
|
6870
6479
|
return this;
|
|
6871
6480
|
}
|
|
6872
|
-
function set_horizontal
|
|
6481
|
+
function set_horizontal(direction){
|
|
6873
6482
|
direction == 1
|
|
6874
6483
|
? this.style({ flexDirection: "row" })
|
|
6875
6484
|
: direction == -1 && this.style({ flexDirection: "row-reverse" });
|
|
6876
6485
|
return this;
|
|
6877
6486
|
}
|
|
6878
|
-
function map_pos_x
|
|
6487
|
+
function map_pos_x(align){
|
|
6879
6488
|
let pos = ["flex-start", "center", "flex-end"];
|
|
6880
6489
|
if (typeof align === "number") align = pos[align + 1];
|
|
6881
6490
|
return align;
|
|
6882
6491
|
}
|
|
6883
|
-
function map_pos_y
|
|
6884
|
-
return map_pos_x
|
|
6492
|
+
function map_pos_y(align){
|
|
6493
|
+
return map_pos_x(-align);
|
|
6885
6494
|
}
|
|
6886
6495
|
|
|
6887
|
-
|
|
6496
|
+
var Flex$1 = /*#__PURE__*/Object.freeze({
|
|
6497
|
+
__proto__: null,
|
|
6498
|
+
Flex: Flex,
|
|
6499
|
+
ZikoUIFlex: ZikoUIFlex
|
|
6500
|
+
});
|
|
6501
|
+
|
|
6502
|
+
class ZikoUIForm extends ZikoUIFlex{
|
|
6888
6503
|
constructor(...items){
|
|
6889
6504
|
super("form", "Form");
|
|
6890
6505
|
this.append(...items);
|
|
@@ -7002,7 +6617,7 @@
|
|
|
7002
6617
|
const tr=(...ZikoUIElement)=>new ZikoUITr(...ZikoUIElement);
|
|
7003
6618
|
const td=(...UI)=>{
|
|
7004
6619
|
UI=UI.map(n=>{
|
|
7005
|
-
if(!(n instanceof ZikoUIElement))n=text
|
|
6620
|
+
if(!(n instanceof ZikoUIElement))n=text(n);
|
|
7006
6621
|
return n
|
|
7007
6622
|
});
|
|
7008
6623
|
return new ZikoUITd(...UI)
|
|
@@ -7145,7 +6760,7 @@
|
|
|
7145
6760
|
Table: Table$1
|
|
7146
6761
|
});
|
|
7147
6762
|
|
|
7148
|
-
class ZikoUIMain extends
|
|
6763
|
+
class ZikoUIMain extends ZikoUIElement{
|
|
7149
6764
|
constructor(){
|
|
7150
6765
|
super("main","Main");
|
|
7151
6766
|
}
|
|
@@ -7153,7 +6768,7 @@
|
|
|
7153
6768
|
return true
|
|
7154
6769
|
}
|
|
7155
6770
|
}
|
|
7156
|
-
class ZikoUIHeader extends
|
|
6771
|
+
class ZikoUIHeader extends ZikoUIElement{
|
|
7157
6772
|
constructor(){
|
|
7158
6773
|
super("header","Header");
|
|
7159
6774
|
}
|
|
@@ -7161,7 +6776,7 @@
|
|
|
7161
6776
|
return true
|
|
7162
6777
|
}
|
|
7163
6778
|
}
|
|
7164
|
-
class ZikoUINav extends
|
|
6779
|
+
class ZikoUINav extends ZikoUIElement{
|
|
7165
6780
|
constructor(){
|
|
7166
6781
|
super("nav","Nav");
|
|
7167
6782
|
}
|
|
@@ -7169,7 +6784,7 @@
|
|
|
7169
6784
|
return true
|
|
7170
6785
|
}
|
|
7171
6786
|
}
|
|
7172
|
-
class ZikoUISection extends
|
|
6787
|
+
class ZikoUISection extends ZikoUIElement{
|
|
7173
6788
|
constructor(){
|
|
7174
6789
|
super("section","Section");
|
|
7175
6790
|
this.style({position:"relative"});
|
|
@@ -7178,7 +6793,7 @@
|
|
|
7178
6793
|
return true
|
|
7179
6794
|
}
|
|
7180
6795
|
}
|
|
7181
|
-
class ZikoUIArticle extends
|
|
6796
|
+
class ZikoUIArticle extends ZikoUIElement{
|
|
7182
6797
|
constructor(){
|
|
7183
6798
|
super("article","Article");
|
|
7184
6799
|
}
|
|
@@ -7186,7 +6801,7 @@
|
|
|
7186
6801
|
return true
|
|
7187
6802
|
}
|
|
7188
6803
|
}
|
|
7189
|
-
class ZikoUIAside extends
|
|
6804
|
+
class ZikoUIAside extends ZikoUIElement{
|
|
7190
6805
|
constructor(){
|
|
7191
6806
|
super("aside","Aside");
|
|
7192
6807
|
}
|
|
@@ -7194,7 +6809,7 @@
|
|
|
7194
6809
|
return true
|
|
7195
6810
|
}
|
|
7196
6811
|
}
|
|
7197
|
-
class ZikoUIFooter extends
|
|
6812
|
+
class ZikoUIFooter extends ZikoUIElement{
|
|
7198
6813
|
constructor(){
|
|
7199
6814
|
super("footer","Footer");
|
|
7200
6815
|
this.element=document?.createElement("footer");
|
|
@@ -7229,7 +6844,7 @@
|
|
|
7229
6844
|
ZikoUISection: ZikoUISection
|
|
7230
6845
|
});
|
|
7231
6846
|
|
|
7232
|
-
class ZikoUIGrid extends
|
|
6847
|
+
class ZikoUIGrid extends ZikoUIElement {
|
|
7233
6848
|
constructor(tag ="div", w = "50vw", h = "50vh") {
|
|
7234
6849
|
super(tag,"Grid");
|
|
7235
6850
|
this.direction = "cols";
|
|
@@ -7261,1609 +6876,24 @@
|
|
|
7261
6876
|
}
|
|
7262
6877
|
const Grid$1 = (...ZikoUIElement) => new ZikoUIGrid("div").append(...ZikoUIElement);
|
|
7263
6878
|
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7267
|
-
|
|
7268
|
-
|
|
7269
|
-
open : openIcon,
|
|
7270
|
-
close : closeIcon
|
|
7271
|
-
}
|
|
7272
|
-
});
|
|
7273
|
-
this.summary=html("summary",summary).style({
|
|
7274
|
-
fontSize:"1.1em",
|
|
7275
|
-
padding:"0.625rem",
|
|
7276
|
-
fontWeight:"bold",
|
|
7277
|
-
listStyleType:`"${openIcon}"`,
|
|
7278
|
-
cursor:"pointer",
|
|
7279
|
-
});
|
|
7280
|
-
this.summary[0].style({
|
|
7281
|
-
marginLeft:"0.5em",
|
|
7282
|
-
});
|
|
7283
|
-
this.content=content.style({
|
|
7284
|
-
margin:"0.7em",
|
|
7285
|
-
});
|
|
7286
|
-
this.element?.append(this.summary.element,this.content.element);
|
|
7287
|
-
this.style({
|
|
7288
|
-
marginBottom:"0.7em",
|
|
7289
|
-
});
|
|
7290
|
-
watchAttr(this, e=>{
|
|
7291
|
-
if(e.target.isOpen){
|
|
7292
|
-
e.target.emit("open");
|
|
7293
|
-
if(this?.parent?.isAccordion){
|
|
7294
|
-
if(this.parent.cache.autoClose)this.parent.closeExcept(this);
|
|
7295
|
-
}
|
|
7296
|
-
this.summary.style({
|
|
7297
|
-
listStyleType:`"${this.cache.icons.close}"`
|
|
7298
|
-
});
|
|
7299
|
-
}
|
|
7300
|
-
else {
|
|
7301
|
-
e.target.emit("close");
|
|
7302
|
-
this.summary.style({
|
|
7303
|
-
listStyleType:`"${this.cache.icons.open}"`
|
|
7304
|
-
});
|
|
7305
|
-
}
|
|
7306
|
-
});
|
|
7307
|
-
}
|
|
7308
|
-
get isCollapsible(){
|
|
7309
|
-
return true;
|
|
7310
|
-
}
|
|
7311
|
-
get isOpen(){
|
|
7312
|
-
return this.element.open;
|
|
7313
|
-
}
|
|
7314
|
-
open(details=this){
|
|
7315
|
-
this.element.open=true;
|
|
7316
|
-
this.emit("open",details);
|
|
7317
|
-
return this;
|
|
7318
|
-
}
|
|
7319
|
-
close(){
|
|
7320
|
-
this.element.open=false;
|
|
7321
|
-
return this;
|
|
7322
|
-
}
|
|
7323
|
-
onOpen(callback){
|
|
7324
|
-
this.on("open", callback);
|
|
7325
|
-
return this;
|
|
7326
|
-
}
|
|
7327
|
-
onClose(callback){
|
|
7328
|
-
this.on("close", callback);
|
|
7329
|
-
return this;
|
|
7330
|
-
}
|
|
7331
|
-
toggle(){
|
|
7332
|
-
this.element.open=!this.element.open;
|
|
7333
|
-
return this;
|
|
7334
|
-
}
|
|
7335
|
-
}
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
const Collapsible=(summary, content, openIcon, closeIcon)=>new ZikoUICollapbsible(summary,content,openIcon, closeIcon);
|
|
6879
|
+
var Grid$2 = /*#__PURE__*/Object.freeze({
|
|
6880
|
+
__proto__: null,
|
|
6881
|
+
Grid: Grid$1,
|
|
6882
|
+
ZikoUIGrid: ZikoUIGrid
|
|
6883
|
+
});
|
|
7339
6884
|
|
|
7340
|
-
|
|
7341
|
-
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
this.items.forEach(n=>n.close());
|
|
7353
|
-
return this;
|
|
7354
|
-
}
|
|
7355
|
-
closeExcept(...Collapsibles){
|
|
7356
|
-
this.items.filter(n=>!Collapsibles.includes(n)).forEach(n=>n.close());
|
|
7357
|
-
return this;
|
|
7358
|
-
}
|
|
7359
|
-
open(CollapsibleOrIndex){
|
|
7360
|
-
CollapsibleOrIndex.isCollapsible? CollapsibleOrIndex.open(): this.items[CollapsibleOrIndex].open();
|
|
7361
|
-
this.closeExcept(CollapsibleOrIndex.isCollapsible? CollapsibleOrIndex: this.items[CollapsibleOrIndex]);
|
|
7362
|
-
return this;
|
|
7363
|
-
}
|
|
7364
|
-
enableAutoClose(){
|
|
7365
|
-
this.cache.autoClose = true;
|
|
7366
|
-
return this;
|
|
7367
|
-
}
|
|
7368
|
-
disableAutoClose(){
|
|
7369
|
-
this.cache.autoClose = false;
|
|
7370
|
-
return this;
|
|
7371
|
-
}
|
|
7372
|
-
toggleAutoClose(){
|
|
7373
|
-
this.cache.autoClose = !this.cache.autoClose;
|
|
7374
|
-
}
|
|
7375
|
-
}
|
|
7376
|
-
const Accordion = (... Collapsible) => new ZikoUIAccordion(...Collapsible);
|
|
7377
|
-
|
|
7378
|
-
class ZikoUIFlex extends ZikoUIContainerElement {
|
|
7379
|
-
constructor(tag = "div", w = "100%", h = "100%") {
|
|
7380
|
-
super(tag ,"Flex");
|
|
7381
|
-
this.direction = "cols";
|
|
7382
|
-
if (typeof w == "number") w += "%";
|
|
7383
|
-
if (typeof h == "number") h += "%";
|
|
7384
|
-
this.style({ width: w, height: h });
|
|
7385
|
-
this.style({ display: "flex" });
|
|
7386
|
-
// this.render();
|
|
7387
|
-
}
|
|
7388
|
-
get isFlex(){
|
|
7389
|
-
return true;
|
|
7390
|
-
}
|
|
7391
|
-
resp(px,wrap = true) {
|
|
7392
|
-
this.wrap(wrap);
|
|
7393
|
-
if (this.element.clientWidth < px) this.vertical();
|
|
7394
|
-
else this.horizontal();
|
|
7395
|
-
return this;
|
|
7396
|
-
}
|
|
7397
|
-
setSpaceAround() {
|
|
7398
|
-
this.style({ justifyContent: "space-around" });
|
|
7399
|
-
return this;
|
|
7400
|
-
}
|
|
7401
|
-
setSpaceBetween() {
|
|
7402
|
-
this.style({ justifyContent: "space-between" });
|
|
7403
|
-
return this;
|
|
7404
|
-
}
|
|
7405
|
-
setBaseline() {
|
|
7406
|
-
this.style({ alignItems: "baseline" });
|
|
7407
|
-
return this;
|
|
7408
|
-
}
|
|
7409
|
-
gap(g) {
|
|
7410
|
-
if (this.direction === "row") this.style({ columnGap: g });
|
|
7411
|
-
else if (this.direction === "column") this.style({ rowGap: g });
|
|
7412
|
-
return this;
|
|
7413
|
-
}
|
|
7414
|
-
wrap(value = "wrap") {
|
|
7415
|
-
const values = ["no-wrap", "wrap","wrap-reverse"];
|
|
7416
|
-
this.style({
|
|
7417
|
-
flexWrap: typeof value === "string" ? value : values[+value],
|
|
7418
|
-
});
|
|
7419
|
-
return this;
|
|
7420
|
-
}
|
|
7421
|
-
_justifyContent(align = "center") {
|
|
7422
|
-
this.style({ justifyContent: align });
|
|
7423
|
-
return this;
|
|
7424
|
-
}
|
|
7425
|
-
vertical(x, y, order=1) {
|
|
7426
|
-
set_vertical.call(this,order);
|
|
7427
|
-
this.style({
|
|
7428
|
-
alignItems: typeof(x)==="number"?map_pos_x.call(this,x):x,
|
|
7429
|
-
justifyContent: typeof(y)=="number"?map_pos_y.call(this,y):y
|
|
7430
|
-
});
|
|
7431
|
-
return this;
|
|
7432
|
-
}
|
|
7433
|
-
horizontal(x, y, order=1) {
|
|
7434
|
-
set_horizontal.call(this,order);
|
|
7435
|
-
this.style({
|
|
7436
|
-
alignItems: typeof(y)=="number"?map_pos_y.call(this,y):y,
|
|
7437
|
-
justifyContent: typeof(x)==="number"?map_pos_x.call(this,x):x
|
|
7438
|
-
});
|
|
7439
|
-
return this;
|
|
7440
|
-
}
|
|
7441
|
-
show() {
|
|
7442
|
-
this.isHidden = false;
|
|
7443
|
-
this.style({ display: "flex" });
|
|
7444
|
-
return this;
|
|
7445
|
-
}
|
|
7446
|
-
}
|
|
7447
|
-
|
|
7448
|
-
const Flex = (...ZikoUIElement) =>{
|
|
7449
|
-
let tag="div";
|
|
7450
|
-
if(typeof ZikoUIElement[0]==="string"){
|
|
7451
|
-
tag=ZikoUIElement[0];
|
|
7452
|
-
ZikoUIElement.pop();
|
|
7453
|
-
}
|
|
7454
|
-
return new ZikoUIFlex(tag).append(...ZikoUIElement);
|
|
7455
|
-
};
|
|
7456
|
-
function set_vertical(direction){
|
|
7457
|
-
direction == 1
|
|
7458
|
-
? this.style({ flexDirection: "column" })
|
|
7459
|
-
: direction == -1 && this.style({ flexDirection: "column-reverse" });
|
|
7460
|
-
return this;
|
|
7461
|
-
}
|
|
7462
|
-
function set_horizontal(direction){
|
|
7463
|
-
direction == 1
|
|
7464
|
-
? this.style({ flexDirection: "row" })
|
|
7465
|
-
: direction == -1 && this.style({ flexDirection: "row-reverse" });
|
|
7466
|
-
return this;
|
|
7467
|
-
}
|
|
7468
|
-
function map_pos_x(align){
|
|
7469
|
-
let pos = ["flex-start", "center", "flex-end"];
|
|
7470
|
-
if (typeof align === "number") align = pos[align + 1];
|
|
7471
|
-
return align;
|
|
7472
|
-
}
|
|
7473
|
-
function map_pos_y(align){
|
|
7474
|
-
return map_pos_x(-align);
|
|
7475
|
-
}
|
|
7476
|
-
|
|
7477
|
-
class ZikoUICarousel extends ZikoUIFlex{
|
|
7478
|
-
constructor(...ZikoUIElement){
|
|
7479
|
-
super();
|
|
7480
|
-
this.style({
|
|
7481
|
-
position:"relative",
|
|
7482
|
-
overflow:"hidden",
|
|
7483
|
-
touchAction:"none",
|
|
7484
|
-
userSelect:"none"
|
|
7485
|
-
});
|
|
7486
|
-
this.horizontal("space-around",0);
|
|
7487
|
-
this.track = Section(...ZikoUIElement).style({ display: "inline-flex" });
|
|
7488
|
-
this.track.size(this.track.children.length * 100 + "vw");
|
|
7489
|
-
this.track.setTarget(this);
|
|
7490
|
-
this.track.items.map((n) =>
|
|
7491
|
-
n.style({ pointerEvents: "none", margin: "auto 10px" })
|
|
7492
|
-
);
|
|
7493
|
-
this.x0 = null;
|
|
7494
|
-
this.tx = 0;
|
|
7495
|
-
this.onPtrMove(e=>{
|
|
7496
|
-
if(e.isDown){
|
|
7497
|
-
let x = e.event.pageX;
|
|
7498
|
-
let dx = x - this.x0;
|
|
7499
|
-
this.track.st.translateX(
|
|
7500
|
-
this.tx + dx,
|
|
7501
|
-
0
|
|
7502
|
-
);
|
|
7503
|
-
}
|
|
7504
|
-
});
|
|
7505
|
-
this.onPtrDown(e=>{
|
|
7506
|
-
console.log(e.event);
|
|
7507
|
-
this.x0 = e.event.pageX;
|
|
7508
|
-
const transformMatrix = window
|
|
7509
|
-
.getComputedStyle(this.track.element)
|
|
7510
|
-
.getPropertyValue("transform");
|
|
7511
|
-
if (transformMatrix !== "none") {
|
|
7512
|
-
this.tx = +transformMatrix.split(",")[4];
|
|
7513
|
-
}
|
|
7514
|
-
});
|
|
7515
|
-
this.onPtrUp(e=>console.log(e.isDown));
|
|
7516
|
-
this.onPtrLeave(e=>{
|
|
7517
|
-
// Handle outside up
|
|
7518
|
-
});
|
|
7519
|
-
}
|
|
7520
|
-
get isCarousel(){
|
|
7521
|
-
return true;
|
|
7522
|
-
}
|
|
7523
|
-
}
|
|
7524
|
-
const Carousel=(...ZikoUIElement)=>new ZikoUICarousel(...ZikoUIElement);
|
|
7525
|
-
|
|
7526
|
-
class ZikoUICodeNote extends ZikoUIFlex{
|
|
7527
|
-
constructor(){
|
|
7528
|
-
super("section");
|
|
7529
|
-
Object.assign(this.cache,{
|
|
7530
|
-
order:0,
|
|
7531
|
-
currentNote:null,
|
|
7532
|
-
currentNoteIndex:null
|
|
7533
|
-
});
|
|
7534
|
-
this.vertical(0,0);
|
|
7535
|
-
}
|
|
7536
|
-
get isCodeNote(){
|
|
7537
|
-
return true;
|
|
7538
|
-
}
|
|
7539
|
-
setCurrentNote(currentNote){
|
|
7540
|
-
this.cache.currentNote=currentNote;
|
|
7541
|
-
this.cache.currentNoteIndex=this.items.findIndex(n=>n===currentNote);
|
|
7542
|
-
currentNote.focus();
|
|
7543
|
-
this.items.forEach(n=>n.Input.style({
|
|
7544
|
-
border: "1px solid #ccc"
|
|
7545
|
-
}));
|
|
7546
|
-
currentNote.Input.style({
|
|
7547
|
-
border:"2px lightgreen solid"
|
|
7548
|
-
});
|
|
7549
|
-
return this;
|
|
7550
|
-
}
|
|
7551
|
-
addNote(text=""){
|
|
7552
|
-
this.append(CodeCell(text));
|
|
7553
|
-
return this;
|
|
7554
|
-
}
|
|
7555
|
-
execute(){
|
|
7556
|
-
this.cache.currentNote.execute();
|
|
7557
|
-
this.incrementOrder();
|
|
7558
|
-
return this;
|
|
7559
|
-
}
|
|
7560
|
-
incrementOrder(){
|
|
7561
|
-
this.cache.order++;
|
|
7562
|
-
this.cache.currentNote.setOrder(this.cache.order);
|
|
7563
|
-
return this;
|
|
7564
|
-
}
|
|
7565
|
-
next(){
|
|
7566
|
-
if(this.cache.currentNote===this.items.at(-1)){
|
|
7567
|
-
this.addNote();
|
|
7568
|
-
this.setCurrentNote(this.items.at(-1));
|
|
7569
|
-
}
|
|
7570
|
-
else this.setCurrentNote(this.items[this.cache.currentNoteIndex+1]);
|
|
7571
|
-
return this;
|
|
7572
|
-
}
|
|
7573
|
-
previous(){
|
|
7574
|
-
// add append before
|
|
7575
|
-
if(this.cache.currentNote!==this.items[0]){
|
|
7576
|
-
this.setCurrentNote(this.items[this.cache.currentNoteIndex-1]);
|
|
7577
|
-
}
|
|
7578
|
-
return this;
|
|
7579
|
-
}
|
|
7580
|
-
data(){
|
|
7581
|
-
return this.items.map(n=>n.cellData());
|
|
7582
|
-
}
|
|
7583
|
-
serialize(){
|
|
7584
|
-
return JSON.stringify(this.data());
|
|
7585
|
-
}
|
|
7586
|
-
import(data=[]){
|
|
7587
|
-
data.forEach((n,i)=>this.addNote(data[i].input));
|
|
7588
|
-
return this;
|
|
7589
|
-
}
|
|
7590
|
-
}
|
|
7591
|
-
const CodeNote=()=>new ZikoUICodeNote();
|
|
7592
|
-
|
|
7593
|
-
const Input=(codeText="")=>html("code",codeText).style({
|
|
7594
|
-
width:"100%",
|
|
7595
|
-
height:"auto",
|
|
7596
|
-
padding:"10px",
|
|
7597
|
-
boxSizing:"border-box",
|
|
7598
|
-
border: "1px solid #ccc",
|
|
7599
|
-
outline: "none",
|
|
7600
|
-
fontSize: "1rem",
|
|
7601
|
-
fontFamily: "Lucida Console, Courier New, monospace",
|
|
7602
|
-
padding: "1rem 0.5rem",
|
|
7603
|
-
wordBreak:"break-all",
|
|
7604
|
-
background:"#f6f8fa",
|
|
7605
|
-
color:"#0062C3"
|
|
7606
|
-
}).setAttr("contenteditable",true).setAttr("spellcheck",false);
|
|
7607
|
-
|
|
7608
|
-
const Output=()=>html("output").style({
|
|
7609
|
-
width:"100%",
|
|
7610
|
-
height:"auto",
|
|
7611
|
-
padding:"5px 0",
|
|
7612
|
-
});
|
|
7613
|
-
const Left=(ctx)=>Flex$1(
|
|
7614
|
-
text$1("[ ]")
|
|
7615
|
-
).style({
|
|
7616
|
-
width:"50px",
|
|
7617
|
-
//height:getComputedStyle(ctx.Input.element).height,
|
|
7618
|
-
height:"50px",
|
|
7619
|
-
margin:"10px 4px",
|
|
7620
|
-
padding:"5px",
|
|
7621
|
-
color:"darkblue",
|
|
7622
|
-
borderBottom:"4px solid gold",
|
|
7623
|
-
}).horizontal(0,0);
|
|
7624
|
-
const BTN_STYLE={
|
|
7625
|
-
background:"none",
|
|
7626
|
-
width:"25px",
|
|
7627
|
-
height:"25px",
|
|
7628
|
-
fontSize:"1.2rem",
|
|
7629
|
-
cursor:"pointer"
|
|
7630
|
-
};
|
|
7631
|
-
const Right=(ctx)=>Flex$1(
|
|
7632
|
-
text$1('▶️').style(BTN_STYLE).onClick(e=>{
|
|
7633
|
-
if(ctx.parent instanceof ZikoUICodeNote)ctx.parent.setCurrentNote(ctx);
|
|
7634
|
-
ctx.execute();
|
|
7635
|
-
globalThis.__Ziko__.__Config__.default.target=e.target.parent.parent[1][1];
|
|
7636
|
-
}),
|
|
7637
|
-
text$1('📋').style(BTN_STYLE).onClick(()=>{
|
|
7638
|
-
navigator.clipboard.writeText(ctx.codeText);
|
|
7639
|
-
}),
|
|
7640
|
-
text$1('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
7641
|
-
text$1('✖️').style(BTN_STYLE).onClick(()=>ctx.remove()),
|
|
7642
|
-
).style({
|
|
7643
|
-
width:"70px",
|
|
7644
|
-
height:"50px",
|
|
7645
|
-
//background:"cyan",
|
|
7646
|
-
margin:"10px 0"
|
|
7647
|
-
}).horizontal(0,0).wrap(true);
|
|
7648
|
-
|
|
7649
|
-
class ZikoUICodeCell extends ZikoUIFlex{
|
|
7650
|
-
constructor(code="",{type="js",order=null}={}){
|
|
7651
|
-
super("section");
|
|
7652
|
-
Object.assign(this.cache,{
|
|
7653
|
-
state:null,
|
|
7654
|
-
order,
|
|
7655
|
-
type,
|
|
7656
|
-
metadata:{
|
|
7657
|
-
created:Date.now(),
|
|
7658
|
-
updated:null
|
|
7659
|
-
}
|
|
7660
|
-
});
|
|
7661
|
-
this.Input=Input(code);
|
|
7662
|
-
this.Output=Output();
|
|
7663
|
-
this.InOut=Flex(
|
|
7664
|
-
this.Input,
|
|
7665
|
-
this.Output
|
|
7666
|
-
).vertical().style({
|
|
7667
|
-
width:"100%",
|
|
7668
|
-
margin:"10px auto"
|
|
7669
|
-
});
|
|
7670
|
-
this.RightControl=Right(this);
|
|
7671
|
-
this.LeftControl=Left();
|
|
7672
|
-
this.append(
|
|
7673
|
-
this.LeftControl,
|
|
7674
|
-
this.InOut,
|
|
7675
|
-
this.RightControl
|
|
7676
|
-
);
|
|
7677
|
-
this.horizontal(-1,1).style({
|
|
7678
|
-
//background:"#444",
|
|
7679
|
-
width:"95vw",
|
|
7680
|
-
margin:"0 auto",
|
|
7681
|
-
border:"1px darkblue dotted"
|
|
7682
|
-
});
|
|
7683
|
-
let cm_content = this.Input.element.getElementsByClassName("cm-content")[0];
|
|
7684
|
-
if( cm_content ){
|
|
7685
|
-
cm_content.addEventListener("keydown",e=>{
|
|
7686
|
-
if(e.key === "Enter" && e.shiftKey){
|
|
7687
|
-
e.preventDefault();
|
|
7688
|
-
this.execute(this.cache.order);
|
|
7689
|
-
}
|
|
7690
|
-
});
|
|
7691
|
-
}
|
|
7692
|
-
else {
|
|
7693
|
-
this.Input.onKeyDown(e=>{
|
|
7694
|
-
if(e.kd==="Enter"){
|
|
7695
|
-
if(e.event.shiftKey){
|
|
7696
|
-
e.event.preventDefault();
|
|
7697
|
-
this.execute(this.cache.order);
|
|
7698
|
-
}
|
|
7699
|
-
}
|
|
7700
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
7701
|
-
if(e.kd==="ArrowDown" && e.event.shiftKey ){
|
|
7702
|
-
this.cache.parent.next();
|
|
7703
|
-
}
|
|
7704
|
-
if(e.kd==="ArrowUp" && e.event.shiftKey){
|
|
7705
|
-
this.cache.parent.previous();
|
|
7706
|
-
}
|
|
7707
|
-
}
|
|
7708
|
-
}
|
|
7709
|
-
);
|
|
7710
|
-
this.Input.onFocus(()=>{
|
|
7711
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
7712
|
-
this.cache.parent.cache.currentNote=this;
|
|
7713
|
-
this.cache.parent.setCurrentNote(this);
|
|
7714
|
-
}
|
|
7715
|
-
});
|
|
7716
|
-
this.Input.onPaste((e)=>{
|
|
7717
|
-
//e.event.preventDefault();
|
|
7718
|
-
//this.setValue(this.codeText.trim())
|
|
7719
|
-
});
|
|
7720
|
-
// this.Input.onKeyPress(e=>{
|
|
7721
|
-
// if(e.kp==="(")a.Input.element.textContent+=")";
|
|
7722
|
-
// if(e.kp==="[")a.Input.element.textContent+="]";
|
|
7723
|
-
// if(e.kp==="{")a.Input.element.textContent+="}";
|
|
7724
|
-
// })
|
|
7725
|
-
}
|
|
7726
|
-
}
|
|
7727
|
-
get isCodeCell(){
|
|
7728
|
-
return true;
|
|
7729
|
-
}
|
|
7730
|
-
// space  
|
|
7731
|
-
get codeText() {
|
|
7732
|
-
return (this.Input.element.getElementsByClassName("cm-content")[0])
|
|
7733
|
-
?this.Input.element.getElementsByClassName("cm-content")[0].innerText.trim()
|
|
7734
|
-
:this.Input.element.innerText.trim()
|
|
7735
|
-
// return this.Input.element.innerText.trim();
|
|
7736
|
-
}
|
|
7737
|
-
get codeHTML() {
|
|
7738
|
-
return this.Input.element.innerHTML;
|
|
7739
|
-
}
|
|
7740
|
-
get outputHTML(){
|
|
7741
|
-
return this.Output.element.innerHTML;
|
|
7742
|
-
}
|
|
7743
|
-
setValue(codeText){
|
|
7744
|
-
this.Input[0].setValue(codeText);
|
|
7745
|
-
return this;
|
|
7746
|
-
}
|
|
7747
|
-
cellData(){
|
|
7748
|
-
return {
|
|
7749
|
-
input:this.codeText,
|
|
7750
|
-
output:this.outputHTML,
|
|
7751
|
-
order:this.cache.order,
|
|
7752
|
-
type:this.cache.type
|
|
7753
|
-
}
|
|
7754
|
-
}
|
|
7755
|
-
execute(order){
|
|
7756
|
-
this.clearOutput();
|
|
7757
|
-
this.evaluate(order);
|
|
7758
|
-
this.cache.metadata.updated=Date.now();
|
|
7759
|
-
return this;
|
|
7760
|
-
}
|
|
7761
|
-
#evaluateJs(order){
|
|
7762
|
-
try{
|
|
7763
|
-
this.LeftControl[0].setValue("pending");
|
|
7764
|
-
this.cache.state="pending";
|
|
7765
|
-
// globalThis.eval(this.Input.element.innerText);
|
|
7766
|
-
globalThis.eval(this.codeText);
|
|
7767
|
-
|
|
7768
|
-
}
|
|
7769
|
-
catch(err){
|
|
7770
|
-
console.log(err);
|
|
7771
|
-
text(`Error : ${err.message}`).style({
|
|
7772
|
-
color:"red",
|
|
7773
|
-
background:"gold",
|
|
7774
|
-
border:"2px red solid",
|
|
7775
|
-
padding:"10px",
|
|
7776
|
-
margin:"10px 0",
|
|
7777
|
-
display:"flex",
|
|
7778
|
-
justifyContent: "center",
|
|
7779
|
-
});
|
|
7780
|
-
this.LeftControl[0].setValue("Err");
|
|
7781
|
-
this.cache.state="Error";
|
|
7782
|
-
}
|
|
7783
|
-
finally{
|
|
7784
|
-
if(this.cache.state==="pending"){
|
|
7785
|
-
this.cache.state="success";
|
|
7786
|
-
this.setOrder(order);
|
|
7787
|
-
if(this.cache.parent instanceof ZikoUICodeNote){
|
|
7788
|
-
this.cache.parent.incrementOrder();
|
|
7789
|
-
this.cache.parent.next();
|
|
7790
|
-
}
|
|
7791
|
-
}
|
|
7792
|
-
}
|
|
7793
|
-
}
|
|
7794
|
-
#evaluateMd(){
|
|
7795
|
-
|
|
7796
|
-
}
|
|
7797
|
-
#evaluateHtml(){
|
|
7798
|
-
|
|
7799
|
-
}
|
|
7800
|
-
evaluate(order){
|
|
7801
|
-
globalThis.__Ziko__.__Config__.default.target=this.Output.element;
|
|
7802
|
-
switch(this.cache.type){
|
|
7803
|
-
case "js":this.#evaluateJs(order);break;
|
|
7804
|
-
}
|
|
7805
|
-
return this;
|
|
7806
|
-
}
|
|
7807
|
-
clearInput(){
|
|
7808
|
-
this.Output.element.innerText="";
|
|
7809
|
-
return this;
|
|
7810
|
-
}
|
|
7811
|
-
clearOutput(){
|
|
7812
|
-
this.Output.element.innerText="";
|
|
7813
|
-
return this;
|
|
7814
|
-
}
|
|
7815
|
-
setOrder(order,render=true){
|
|
7816
|
-
this.cache.order=order;
|
|
7817
|
-
if(render){
|
|
7818
|
-
(typeof order === "number")?this.LeftControl[0].setValue(`[${order}]`):this.LeftControl[0].setValue("[-]");
|
|
7819
|
-
}
|
|
7820
|
-
return this;
|
|
7821
|
-
}
|
|
7822
|
-
focus(){
|
|
7823
|
-
this.Input.element.focus();
|
|
7824
|
-
return this;
|
|
7825
|
-
}
|
|
7826
|
-
}
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
const CodeCell=(codeText,{type,order}={})=>new ZikoUICodeCell(codeText,{type,order});
|
|
7830
|
-
|
|
7831
|
-
// Next
|
|
7832
|
-
// Previous
|
|
7833
|
-
// Vertical
|
|
7834
|
-
// Horizontal
|
|
7835
|
-
class ZikoUITabs extends ZikoUIFlex{
|
|
7836
|
-
#ACTIVE_ELEMENT_INDEX=0;
|
|
7837
|
-
constructor(Controllers,Contents){
|
|
7838
|
-
super("div","Tabs");
|
|
7839
|
-
Object.assign(this.cache,{
|
|
7840
|
-
config:{
|
|
7841
|
-
controllersPercent : .50
|
|
7842
|
-
}
|
|
7843
|
-
});
|
|
7844
|
-
this.style({
|
|
7845
|
-
boxSizing:"border-box",
|
|
7846
|
-
backgroundColor: "blanchedalmond",
|
|
7847
|
-
border:"1px red solid",
|
|
7848
|
-
margin:"30px",
|
|
7849
|
-
});
|
|
7850
|
-
this.controllersContainer = Flex().size("auto","auto").style({
|
|
7851
|
-
boxSizing:"border-box",
|
|
7852
|
-
justifyContent:"center",
|
|
7853
|
-
alignItems:"center",
|
|
7854
|
-
textAlign:"center",
|
|
7855
|
-
|
|
7856
|
-
minWidth:"50px",
|
|
7857
|
-
minHeight:"50px",
|
|
7858
|
-
|
|
7859
|
-
backgroundColor:"darkblue",
|
|
7860
|
-
border:"1px darkblue solid",
|
|
7861
|
-
|
|
7862
|
-
}).setAttr("role","tablist");
|
|
7863
|
-
this.contentContainer = Flex().style({
|
|
7864
|
-
boxSizing:"border-box",
|
|
7865
|
-
justifyContent:"center",
|
|
7866
|
-
alignItems:"center",
|
|
7867
|
-
textAlign:"center",
|
|
7868
|
-
|
|
7869
|
-
width:"100%",
|
|
7870
|
-
height:"100%",
|
|
7871
|
-
backgroundColor:"darkslategrey",
|
|
7872
|
-
});
|
|
7873
|
-
this.append(
|
|
7874
|
-
this.controllersContainer,
|
|
7875
|
-
this.contentContainer
|
|
7876
|
-
);
|
|
7877
|
-
if(Controllers.length!==Contents.length)console.error("");
|
|
7878
|
-
else {
|
|
7879
|
-
this.controllersContainer.append(...Controllers);
|
|
7880
|
-
this.contentContainer.append(...Contents);
|
|
7881
|
-
}
|
|
7882
|
-
this.init();
|
|
7883
|
-
this.display(0);
|
|
7884
|
-
this.useVertical();
|
|
7885
|
-
}
|
|
7886
|
-
get isTabs(){
|
|
7887
|
-
return true;
|
|
7888
|
-
}
|
|
7889
|
-
init(){
|
|
7890
|
-
// Remove old listener
|
|
7891
|
-
for(let i=0;i<this.controllersContainer.length;i++){
|
|
7892
|
-
this.controllersContainer[i].setAttr("role","tab").setAttr("aria-controls",`tab${i}`);
|
|
7893
|
-
this.contentContainer[i].setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${i}`).setAttr("tabindex",-1);
|
|
7894
|
-
}
|
|
7895
|
-
this.controllersContainer.forEach(item=>item.onClick(e=>{
|
|
7896
|
-
const tab=e.target.element.getAttribute("aria-controls");
|
|
7897
|
-
const index=+tab.slice(3);
|
|
7898
|
-
this.contentContainer.filter(n=>n.element.getAttribute("aria-labelledby")===tab,()=>{
|
|
7899
|
-
if(this.#ACTIVE_ELEMENT_INDEX!==index)this.display(index);
|
|
7900
|
-
});
|
|
7901
|
-
}));
|
|
7902
|
-
return this;
|
|
7903
|
-
}
|
|
7904
|
-
addPairs(ControllerItem,ContentItem){
|
|
7905
|
-
this.controllersContainer.append(ControllerItem);
|
|
7906
|
-
this.contentContainer.append(ContentItem);
|
|
7907
|
-
const length=this.controllersContainer.length;
|
|
7908
|
-
this.controllersContainer.at(-1).setAttr("role","tab").setAttr("aria-controls",`tab${length-1}`);
|
|
7909
|
-
this.contentContainer.at(-1).setAttr("role","tabpanel").setAttr("aria-labelledby",`tab${length-1}`).setAttr("tabindex",-1);
|
|
7910
|
-
// Add listener
|
|
7911
|
-
return this;
|
|
7912
|
-
}
|
|
7913
|
-
removePairs(index){
|
|
7914
|
-
|
|
7915
|
-
}
|
|
7916
|
-
display(index){
|
|
7917
|
-
this.#ACTIVE_ELEMENT_INDEX=index%this.contentContainer.length;
|
|
7918
|
-
const ActiveContent = this.contentContainer.at(this.#ACTIVE_ELEMENT_INDEX);
|
|
7919
|
-
this.controllersContainer.forEach(n=>n.setAttr("tabindex",-1).setAttr("aria-selected",false));
|
|
7920
|
-
this.controllersContainer.at(this.#ACTIVE_ELEMENT_INDEX).setAttr("tabindex",0).setAttr("aria-selected",true);
|
|
7921
|
-
|
|
7922
|
-
this.contentContainer.forEach(n=>n.st.hide());
|
|
7923
|
-
|
|
7924
|
-
ActiveContent.st.translateX(100,0);
|
|
7925
|
-
ActiveContent.setAttr("tabindex",0).st.show();
|
|
7926
|
-
ActiveContent.st.translateX(0,1000);
|
|
7927
|
-
|
|
7928
|
-
return this;
|
|
7929
|
-
}
|
|
7930
|
-
next(i=1){
|
|
7931
|
-
this.display(this.#ACTIVE_ELEMENT_INDEX+i);
|
|
7932
|
-
return this;
|
|
7933
|
-
}
|
|
7934
|
-
previous(i=1){
|
|
7935
|
-
this.display(this.#ACTIVE_ELEMENT_INDEX-i);
|
|
7936
|
-
return this;
|
|
7937
|
-
}
|
|
7938
|
-
useVertical(){
|
|
7939
|
-
this.vertical(0,0);
|
|
7940
|
-
this.controllersContainer.horizontal(0,0);
|
|
7941
|
-
this.controllersContainer.style({
|
|
7942
|
-
width : "100%",
|
|
7943
|
-
height : `${this.cache.config.controllersPercent*100}%`
|
|
7944
|
-
});
|
|
7945
|
-
this.contentContainer.style({
|
|
7946
|
-
width : "100%",
|
|
7947
|
-
height : `${(1-this.cache.config.controllersPercent)*100}%`
|
|
7948
|
-
});
|
|
7949
|
-
return this;
|
|
7950
|
-
}
|
|
7951
|
-
useHorizontal(){
|
|
7952
|
-
this.horizontal(0,0);
|
|
7953
|
-
this.controllersContainer.vertical(0, 0);
|
|
7954
|
-
this.controllersContainer.style({
|
|
7955
|
-
height : "100%",
|
|
7956
|
-
width : `${this.cache.config.controllersPercent*100}%`
|
|
7957
|
-
});
|
|
7958
|
-
this.contentContainer.style({
|
|
7959
|
-
height : "100%",
|
|
7960
|
-
width : `${(1-this.cache.config.controllersPercent)*100}%`
|
|
7961
|
-
});
|
|
7962
|
-
return this;
|
|
7963
|
-
}
|
|
7964
|
-
// useHorizontalSwippe(){
|
|
7965
|
-
// this.onPtrDown();
|
|
7966
|
-
// this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_x)));
|
|
7967
|
-
// return this;
|
|
7968
|
-
// }
|
|
7969
|
-
// useVerticalSwippe(){
|
|
7970
|
-
// this.onPtrDown();
|
|
7971
|
-
// this.onPtrUp(e=>this.next(Math.sign(e.swippe.delta_y)));
|
|
7972
|
-
// return this;
|
|
7973
|
-
// }
|
|
7974
|
-
}
|
|
7975
|
-
|
|
7976
|
-
const Tabs=(Controllers,Contents)=>new ZikoUITabs(Controllers,Contents);
|
|
7977
|
-
|
|
7978
|
-
/*
|
|
7979
|
-
|
|
7980
|
-
const cont=(txt = "A")=>btn(txt).style({width:"170px"})
|
|
7981
|
-
a=Tabs(
|
|
7982
|
-
[cont("A1"),cont("A2"),cont("A3"),cont("A4")],
|
|
7983
|
-
[cont("A1"),cont("A2"),cont("A3"),cont("A4")]
|
|
7984
|
-
).vertical().size("400px")
|
|
7985
|
-
a.controllersContainer.style({
|
|
7986
|
-
overflowX:"auto"
|
|
7987
|
-
})
|
|
7988
|
-
a.useHorizontal()
|
|
7989
|
-
|
|
7990
|
-
*/
|
|
7991
|
-
|
|
7992
|
-
/*
|
|
7993
|
-
|
|
7994
|
-
a=Flex().size("400px","400px").style({background:"red"})
|
|
7995
|
-
a.element.animate([
|
|
7996
|
-
{ borderRadius: "0" , background : "red" },
|
|
7997
|
-
{ borderRadius: "50% 0" },
|
|
7998
|
-
{ borderRadius: "50% 50%" },
|
|
7999
|
-
{ borderRadius: "0 50%" },
|
|
8000
|
-
{ borderRadius: "0", background : "yellow" },
|
|
8001
|
-
],
|
|
8002
|
-
{
|
|
8003
|
-
// temporisation
|
|
8004
|
-
duration: 2000,
|
|
8005
|
-
iterations: Infinity,
|
|
8006
|
-
})
|
|
8007
|
-
|
|
8008
|
-
*/
|
|
8009
|
-
|
|
8010
|
-
const palette = {
|
|
8011
|
-
success: {
|
|
8012
|
-
titleColor:"green",
|
|
8013
|
-
contentColor: "#35495e",
|
|
8014
|
-
bgColor: "#d4edda", // Fixed
|
|
8015
|
-
bgColor:"linear-gradient(-225deg, #DFFFCD 0%, #90F9C4 48%, #39F3BB 100%)",
|
|
8016
|
-
borderColor: "#28a745", // Fixed
|
|
8017
|
-
icon: "✅"
|
|
8018
|
-
},
|
|
8019
|
-
info: {
|
|
8020
|
-
titleColor:"blue",
|
|
8021
|
-
contentColor: "#00204a",
|
|
8022
|
-
bgColor: "#93deff", // Fixed
|
|
8023
|
-
bgColor:"radial-gradient(circle at 10% 20%, rgb(147, 230, 241) 0%, rgb(145, 192, 241) 45.5%)",
|
|
8024
|
-
borderColor: "#005689", // Fixed
|
|
8025
|
-
icon: "ℹ️"
|
|
8026
|
-
},
|
|
8027
|
-
warning: {
|
|
8028
|
-
titleColor:"#e4663a",
|
|
8029
|
-
contentColor: "#45171d",
|
|
8030
|
-
bgColor:"#fdffcd",
|
|
8031
|
-
bgColor:"radial-gradient(907px at 3.4% 19.8%, rgb(255, 243, 122) 0%, rgb(255, 102, 145) 97.4%)",
|
|
8032
|
-
borderColor: "#efd510",
|
|
8033
|
-
icon: "⚠️"
|
|
8034
|
-
},
|
|
8035
|
-
danger: {
|
|
8036
|
-
titleColor:"red",
|
|
8037
|
-
contentColor: "#721c24",
|
|
8038
|
-
bgColor: "#f8d7da", // Fixed
|
|
8039
|
-
bgColor:"linear-gradient(90deg, rgb(255, 157, 129) 24.3%, rgb(255, 138, 138) 78.3%)",
|
|
8040
|
-
borderColor: "#c50000", // Fixed
|
|
8041
|
-
icon: "❌"
|
|
8042
|
-
},
|
|
8043
|
-
tips: {
|
|
8044
|
-
titleColor:null,
|
|
8045
|
-
contentColor: null,
|
|
8046
|
-
bgColor: null,
|
|
8047
|
-
borderColor: null,
|
|
8048
|
-
icon: "💡"
|
|
8049
|
-
},
|
|
8050
|
-
important: {
|
|
8051
|
-
titleColor:null,
|
|
8052
|
-
contentColor: null,
|
|
8053
|
-
bgColor: null,
|
|
8054
|
-
borderColor: null,
|
|
8055
|
-
icon: "📌"
|
|
8056
|
-
},
|
|
8057
|
-
|
|
8058
|
-
};
|
|
8059
|
-
|
|
8060
|
-
class ZikoUIAlert extends ZikoUIFlex$1{
|
|
8061
|
-
constructor(type, title, content){
|
|
8062
|
-
super();
|
|
8063
|
-
this.title = h3(title);
|
|
8064
|
-
this.icon = text$1(palette[type].icon).style({
|
|
8065
|
-
display: "flex",
|
|
8066
|
-
justifyContent:"center",
|
|
8067
|
-
borderRadius:"50%",
|
|
8068
|
-
minWidth:"30px",
|
|
8069
|
-
minHeight:"30px",
|
|
8070
|
-
});
|
|
8071
|
-
this.content = content;
|
|
8072
|
-
this.vertical()
|
|
8073
|
-
.size("200px", "auto")
|
|
8074
|
-
.style({
|
|
8075
|
-
borderRadius:"10px",
|
|
8076
|
-
padding:"10px"
|
|
8077
|
-
});
|
|
8078
|
-
this.append(
|
|
8079
|
-
Flex$1(
|
|
8080
|
-
this.title,
|
|
8081
|
-
this.icon
|
|
8082
|
-
).size("100%", "40px").style({}).horizontal("space-between",0),
|
|
8083
|
-
this.content
|
|
8084
|
-
);
|
|
8085
|
-
this.useType(type);
|
|
8086
|
-
}
|
|
8087
|
-
get isAlert(){
|
|
8088
|
-
return true;
|
|
8089
|
-
}
|
|
8090
|
-
useType(type){
|
|
8091
|
-
this.style({
|
|
8092
|
-
color:palette[type].color,
|
|
8093
|
-
background:palette[type].bgColor,
|
|
8094
|
-
border: `1px darkblue solid`,
|
|
8095
|
-
borderLeft: `15px ${palette[type].borderColor} solid`,
|
|
8096
|
-
});
|
|
8097
|
-
this.title.style({
|
|
8098
|
-
color:palette[type].titleColor
|
|
8099
|
-
});
|
|
8100
|
-
this.content.st.color(palette[type].titleColor);
|
|
8101
|
-
this.icon.setValue(palette[type].icon).style({
|
|
8102
|
-
border:`2px ${palette[type].borderColor} solid`,
|
|
8103
|
-
alignItems: type==="warning"?"flex-start":"center",
|
|
8104
|
-
});
|
|
8105
|
-
return this;
|
|
8106
|
-
}
|
|
8107
|
-
useSuccess(){
|
|
8108
|
-
this.useType("success");
|
|
8109
|
-
return this;
|
|
8110
|
-
}
|
|
8111
|
-
useInfo(){
|
|
8112
|
-
this.useType("info");
|
|
8113
|
-
return this;
|
|
8114
|
-
}
|
|
8115
|
-
useWarning(){
|
|
8116
|
-
this.useType("warning");
|
|
8117
|
-
return this;
|
|
8118
|
-
}
|
|
8119
|
-
useDanger(){
|
|
8120
|
-
this.useType("danger");
|
|
8121
|
-
return this;
|
|
8122
|
-
}
|
|
8123
|
-
}
|
|
8124
|
-
|
|
8125
|
-
const successAlert=(title, content)=>new ZikoUIAlert("success", title, content);
|
|
8126
|
-
const infoAlert=(title, content)=>new ZikoUIAlert("info", title, content);
|
|
8127
|
-
const warningAlert=(title, content)=>new ZikoUIAlert("warning", title, content);
|
|
8128
|
-
const dangerAlert=(title, content)=>new ZikoUIAlert("danger", title, content);
|
|
8129
|
-
|
|
8130
|
-
class __ZikoUISplitter__ extends ZikoUIElement{
|
|
8131
|
-
constructor(flexDirection, resizerCursor, resizerProp){
|
|
8132
|
-
super("div", "Splitter");
|
|
8133
|
-
Object.assign(this.cache,{
|
|
8134
|
-
isResizing : false,
|
|
8135
|
-
flexDirection,
|
|
8136
|
-
resizerCursor,
|
|
8137
|
-
resizerProp
|
|
8138
|
-
});
|
|
8139
|
-
this.style({
|
|
8140
|
-
display:"flex",
|
|
8141
|
-
flexDirection : this.cache.flexDirection,
|
|
8142
|
-
border: "2px solid #333",
|
|
8143
|
-
overflow: "hidden"
|
|
8144
|
-
});
|
|
8145
|
-
this.resizer = new ZikoUIElement("div", "resizer").style({
|
|
8146
|
-
[this.cache.resizerProp]:"5px",
|
|
8147
|
-
backgroundColor: "gold",
|
|
8148
|
-
cursor: this.cache.resizerCursor,
|
|
8149
|
-
touchAction: "none",
|
|
8150
|
-
});
|
|
8151
|
-
this.onPtrDown(e=>{
|
|
8152
|
-
this.cache.isResizing = true;
|
|
8153
|
-
this.style({
|
|
8154
|
-
cursor : this.cache.resizerCursor // ns-resize
|
|
8155
|
-
});
|
|
8156
|
-
this.resizer.element.setPointerCapture(e.event.pointerId);
|
|
8157
|
-
});
|
|
8158
|
-
this.onPtrUp(e=>{
|
|
8159
|
-
this.cache.isResizing = false;
|
|
8160
|
-
this.style({
|
|
8161
|
-
cursor: "default"
|
|
8162
|
-
});
|
|
8163
|
-
this.resizer.element.releasePointerCapture(e.event.pointerId);
|
|
8164
|
-
});
|
|
8165
|
-
this.onPtrCancel(()=>{
|
|
8166
|
-
this.cache.isResizing = false;
|
|
8167
|
-
this.style({
|
|
8168
|
-
cursor: "default"
|
|
8169
|
-
});
|
|
8170
|
-
});
|
|
8171
|
-
this.onPtrOut(()=>{
|
|
8172
|
-
if (this.cache.isResizing) {
|
|
8173
|
-
this.cache.isResizing = false;
|
|
8174
|
-
this.style({
|
|
8175
|
-
cursor: "default"
|
|
8176
|
-
});
|
|
8177
|
-
}
|
|
8178
|
-
});
|
|
8179
|
-
}
|
|
8180
|
-
get isSplitter(){
|
|
8181
|
-
return true;
|
|
8182
|
-
}
|
|
8183
|
-
styleResizer(style={}){
|
|
8184
|
-
this.resizer.style(style);
|
|
8185
|
-
return this;
|
|
8186
|
-
}
|
|
8187
|
-
}
|
|
8188
|
-
|
|
8189
|
-
class ZikoUIHorizontalSplitter extends __ZikoUISplitter__{
|
|
8190
|
-
constructor(leftPane, rightPane){
|
|
8191
|
-
super("row", "ew-resize", "width");
|
|
8192
|
-
this.leftPane = leftPane.style({
|
|
8193
|
-
width:"50%",
|
|
8194
|
-
flexGrow: 1,
|
|
8195
|
-
overflow: "hidden"
|
|
8196
|
-
});
|
|
8197
|
-
this.rightPane = rightPane.style({
|
|
8198
|
-
width:"50%",
|
|
8199
|
-
flexGrow: 1,
|
|
8200
|
-
overflow: "hidden"
|
|
8201
|
-
});
|
|
8202
|
-
this.element?.append(
|
|
8203
|
-
this.leftPane.element,
|
|
8204
|
-
this.resizer.element,
|
|
8205
|
-
this.rightPane.element
|
|
8206
|
-
);
|
|
8207
|
-
this.onPtrMove(e=>{
|
|
8208
|
-
if (!this.cache.isResizing) return;
|
|
8209
|
-
const containerWidth = this.element.getBoundingClientRect().width; // height
|
|
8210
|
-
const pointerRelativeXpos = e.event.clientX - this.element.getBoundingClientRect().x; // y
|
|
8211
|
-
let newLeftPaneWidth = (pointerRelativeXpos / containerWidth) * 100;
|
|
8212
|
-
let newRightPaneWidth = 100 - newLeftPaneWidth;
|
|
8213
|
-
if (newLeftPaneWidth < 0) newLeftPaneWidth = 0;
|
|
8214
|
-
if (newRightPaneWidth < 0) newRightPaneWidth = 0;
|
|
8215
|
-
this.leftPane.element.style.width = `${newLeftPaneWidth}%`;
|
|
8216
|
-
this.rightPane.element.style.width = `${newRightPaneWidth}%`;
|
|
8217
|
-
});
|
|
8218
|
-
}
|
|
8219
|
-
get isHorizontalSplitter(){
|
|
8220
|
-
return true;
|
|
8221
|
-
}
|
|
8222
|
-
}
|
|
8223
|
-
const hSplitter=(leftPane, rightPane)=>new ZikoUIHorizontalSplitter(leftPane, rightPane);
|
|
8224
|
-
|
|
8225
|
-
class ZikoUIVerticalSplitter extends __ZikoUISplitter__{
|
|
8226
|
-
constructor(topPane, bottomPane){
|
|
8227
|
-
super("column", "ns-resize", "height");
|
|
8228
|
-
this.topPane = topPane.style({
|
|
8229
|
-
height:"50%",
|
|
8230
|
-
flexGrow: 1,
|
|
8231
|
-
overflow: "hidden"
|
|
8232
|
-
});
|
|
8233
|
-
this.bottomPane = bottomPane.style({
|
|
8234
|
-
height:"50%",
|
|
8235
|
-
flexGrow: 1,
|
|
8236
|
-
overflow: "hidden"
|
|
8237
|
-
});
|
|
8238
|
-
this.element?.append(
|
|
8239
|
-
this.topPane.element,
|
|
8240
|
-
this.resizer.element,
|
|
8241
|
-
this.bottomPane.element
|
|
8242
|
-
);
|
|
8243
|
-
this.onPtrMove(e=>{
|
|
8244
|
-
if (!this.cache.isResizing) return;
|
|
8245
|
-
const containerHeight = this.element.getBoundingClientRect().height; // height
|
|
8246
|
-
const pointerRelativeYpos = e.event.clientY - this.element.getBoundingClientRect().y; // y
|
|
8247
|
-
let newTopPaneHeight = (pointerRelativeYpos / containerHeight) * 100;
|
|
8248
|
-
let newBottomPaneHeight = 100 - newTopPaneHeight;
|
|
8249
|
-
if (newTopPaneHeight < 0) newTopPaneHeight = 0;
|
|
8250
|
-
if (newBottomPaneHeight < 0) newBottomPaneHeight = 0;
|
|
8251
|
-
this.topPane.element.style.height = `${newTopPaneHeight}%`;
|
|
8252
|
-
this.bottomPane.element.style.height = `${newBottomPaneHeight}%`;
|
|
8253
|
-
});
|
|
8254
|
-
}
|
|
8255
|
-
get isHorizontalSplitter(){
|
|
8256
|
-
return true;
|
|
8257
|
-
}
|
|
8258
|
-
}
|
|
8259
|
-
const vSplitter=(topPane, bottomPane)=>new ZikoUIVerticalSplitter(topPane, bottomPane);
|
|
8260
|
-
|
|
8261
|
-
const Splitter = ({orintation = "horizontal",slides = []}) =>{
|
|
8262
|
-
if(["v","vertical"].includes(orintation.toLowerCase())) return vSplitter(...slides);
|
|
8263
|
-
else if(["h","horizontal"].includes(orintation.toLowerCase())) return hSplitter(...slides);
|
|
8264
|
-
else ;
|
|
8265
|
-
};
|
|
8266
|
-
|
|
8267
|
-
class ZikoUIBreadcrumbs extends ZikoUIElement{
|
|
8268
|
-
constructor(...items){
|
|
8269
|
-
super("ul", "Breadcrumbs");
|
|
8270
|
-
Object.assign(this.cache,{
|
|
8271
|
-
separatorTextContent:"/"
|
|
8272
|
-
});
|
|
8273
|
-
this.style({
|
|
8274
|
-
listStyle: "none",
|
|
8275
|
-
display: "flex",
|
|
8276
|
-
flexWrap: "wrap"
|
|
8277
|
-
});
|
|
8278
|
-
this.list=html('li').style({
|
|
8279
|
-
display: "flex",
|
|
8280
|
-
flexWrap: "wrap"
|
|
8281
|
-
});
|
|
8282
|
-
this.append(...items);
|
|
8283
|
-
}
|
|
8284
|
-
#addItem(item){
|
|
8285
|
-
if(["string","number","boolean"].includes(typeof item))item = text$1(item);
|
|
8286
|
-
const li = html("li", item).style({
|
|
8287
|
-
display: "flex",
|
|
8288
|
-
alignItems: "center"
|
|
8289
|
-
});
|
|
8290
|
-
if(this.element.children.length>0){
|
|
8291
|
-
const separator = text$1(this.cache.separatorTextContent).style({
|
|
8292
|
-
padding: "0 4px"
|
|
8293
|
-
});
|
|
8294
|
-
this.element?.append(separator.element);
|
|
8295
|
-
}
|
|
8296
|
-
this.element?.append(li.element);
|
|
8297
|
-
}
|
|
8298
|
-
append(...items){
|
|
8299
|
-
items.forEach(n=>this.#addItem(n));
|
|
8300
|
-
return this;
|
|
8301
|
-
}
|
|
8302
|
-
configSeparator(separatorTextContent = this.cache.separator, style = {}){
|
|
8303
|
-
this.cache.separatorTextContent = separatorTextContent;
|
|
8304
|
-
const separators = [...this.element.children].filter(n=>n.tagName==="SPAN");
|
|
8305
|
-
separators.forEach(node=>{
|
|
8306
|
-
node.textContent = separatorTextContent;
|
|
8307
|
-
Object.assign(node.style, style);
|
|
8308
|
-
}
|
|
8309
|
-
);
|
|
8310
|
-
return this;
|
|
8311
|
-
}
|
|
8312
|
-
}
|
|
8313
|
-
const Breadcrumbs=(...items)=>new ZikoUIBreadcrumbs(...items);
|
|
8314
|
-
|
|
8315
|
-
class ZikoUIMenu3d extends ZikoUIFlex$1{
|
|
8316
|
-
constructor(controller, content){
|
|
8317
|
-
super("div", "menu3d");
|
|
8318
|
-
this.controller = controller;
|
|
8319
|
-
this.content = content;
|
|
8320
|
-
this.cover = null;
|
|
8321
|
-
Object.assign(this.cache,{
|
|
8322
|
-
config:{
|
|
8323
|
-
useTransfo : false,
|
|
8324
|
-
isOpen : false,
|
|
8325
|
-
position : "left",
|
|
8326
|
-
threshold : 40,
|
|
8327
|
-
angle : 70,
|
|
8328
|
-
overlap : 6,
|
|
8329
|
-
width : 300,
|
|
8330
|
-
height : 300,
|
|
8331
|
-
transitionDuration: '0.5s',
|
|
8332
|
-
transitionEasing: 'ease',
|
|
8333
|
-
menuTransformOrigin : null,
|
|
8334
|
-
menuTransformClosed : null,
|
|
8335
|
-
menuTransformOpened : null,
|
|
8336
|
-
contentTransformOrigin : null,
|
|
8337
|
-
contentTransformClosed : null,
|
|
8338
|
-
contentTransformOpened : null,
|
|
8339
|
-
}
|
|
8340
|
-
});
|
|
8341
|
-
this.append(
|
|
8342
|
-
this.controller,
|
|
8343
|
-
this.content
|
|
8344
|
-
);
|
|
8345
|
-
this.update();
|
|
8346
|
-
}
|
|
8347
|
-
get isOpen(){
|
|
8348
|
-
return this.cache.config.isOpen;
|
|
8349
|
-
}
|
|
8350
|
-
update(){
|
|
8351
|
-
this.controller.style({
|
|
8352
|
-
display:"none",
|
|
8353
|
-
padding:"20px",
|
|
8354
|
-
overflow:"auto",
|
|
8355
|
-
background:"darkblue",
|
|
8356
|
-
color: "#eee",
|
|
8357
|
-
webkitboxSizing: "border-box",
|
|
8358
|
-
mozBoxSizing: "border-box",
|
|
8359
|
-
boxSizing:"border-box",
|
|
8360
|
-
});
|
|
8361
|
-
this.content.style({
|
|
8362
|
-
padding:"20px 40px",
|
|
8363
|
-
width: "100%",
|
|
8364
|
-
height: "100%",
|
|
8365
|
-
// overflowY:"auto",
|
|
8366
|
-
background:"gold",
|
|
8367
|
-
color: "#eee",
|
|
8368
|
-
webkitboxSizing: "border-box",
|
|
8369
|
-
mozBoxSizing: "border-box",
|
|
8370
|
-
boxSizing:"border-box",
|
|
8371
|
-
webkitOverflowScrolling:"touch",
|
|
8372
|
-
webkitTransformStyle: "preserve-3d"
|
|
8373
|
-
});
|
|
8374
|
-
this.setupPositions();
|
|
8375
|
-
this.setupWrapper();
|
|
8376
|
-
this.setupCover();
|
|
8377
|
-
this.setupMenu();
|
|
8378
|
-
this.setupContent();
|
|
8379
|
-
}
|
|
8380
|
-
setupPositions() {
|
|
8381
|
-
this.cache.config.menuTransformOpened = '';
|
|
8382
|
-
this.cache.config.contentTransformClosed = '';
|
|
8383
|
-
let menuAngle = this.cache.config.angle;
|
|
8384
|
-
let contentAngle = this.cache.config.angle / -2;
|
|
8385
|
-
switch( this.cache.config.position ) {
|
|
8386
|
-
case "top":
|
|
8387
|
-
this.cache.config.menuTransformOrigin = '50% 0%';
|
|
8388
|
-
this.cache.config.menuTransformClosed = `rotateX(${menuAngle}deg) translateY(-100%) translateY(${this.cache.config.overlap}px)`;
|
|
8389
|
-
this.cache.config.contentTransformOrigin = '50% 0';
|
|
8390
|
-
this.cache.config.contentTransformOpened = `translateY(${this.height/2}px) rotateX(${contentAngle}deg)`;
|
|
8391
|
-
break;
|
|
8392
|
-
case "right":
|
|
8393
|
-
this.cache.config.menuTransformOrigin = '100% 50%';
|
|
8394
|
-
this.cache.config.menuTransformClosed = 'rotateY( ' + menuAngle + 'deg ) translateX( 100% ) translateX( -2px ) scale( 1.01 )';
|
|
8395
|
-
this.cache.config.contentTransformOrigin = '100% 50%';
|
|
8396
|
-
this.cache.config.contentTransformOpened = 'translateX( -'+ this.width/2 +'px ) rotateY( ' + contentAngle + 'deg )';
|
|
8397
|
-
break;
|
|
8398
|
-
case "bottom":
|
|
8399
|
-
this.cache.config.menuTransformOrigin = '50% 100%';
|
|
8400
|
-
this.cache.config.menuTransformClosed = 'rotateX( ' + -menuAngle + 'deg ) translateY( 100% ) translateY( -'+ this.cache.config.overlap +'px )';
|
|
8401
|
-
this.cache.config.contentTransformOrigin = '50% 100%';
|
|
8402
|
-
this.cache.config.contentTransformOpened = 'translateY( -'+ this.height/2 +'px ) rotateX( ' + -contentAngle + 'deg )';
|
|
8403
|
-
break;
|
|
8404
|
-
default:
|
|
8405
|
-
this.cache.config.menuTransformOrigin = '100% 50%';
|
|
8406
|
-
this.cache.config.menuTransformClosed = 'translateX( -100% ) translateX( '+ this.cache.config.overlap +'px ) scale( 1.01 ) rotateY( ' + -menuAngle + 'deg )';
|
|
8407
|
-
this.cache.config.contentTransformOrigin = '0 50%';
|
|
8408
|
-
this.cache.config.contentTransformOpened = 'translateX( '+ this.width/2 +'px ) rotateY( ' + -contentAngle + 'deg )';
|
|
8409
|
-
break;
|
|
8410
|
-
}
|
|
8411
|
-
}
|
|
8412
|
-
setupWrapper() {
|
|
8413
|
-
this.style({
|
|
8414
|
-
perspective : "800px",
|
|
8415
|
-
perspectiveOrigin : this.cache.config.contentTransformOrigin
|
|
8416
|
-
});
|
|
8417
|
-
}
|
|
8418
|
-
setupCover(){
|
|
8419
|
-
if( this.cover ) this.cover.element.parentNode.removeChild( this.cover.element );
|
|
8420
|
-
this.cover=new ZikoUIElement("div","div").style({
|
|
8421
|
-
position:"absolute",
|
|
8422
|
-
display:"block",
|
|
8423
|
-
width:"100%",
|
|
8424
|
-
height:"100%",
|
|
8425
|
-
left:0,
|
|
8426
|
-
top:0,
|
|
8427
|
-
zIndex:1000,
|
|
8428
|
-
visibility:"hidden",
|
|
8429
|
-
opacity:0,
|
|
8430
|
-
transition: `all ${this.cache.config.transitionDuration} ${this.cache.config.transitionEasing}`
|
|
8431
|
-
});
|
|
8432
|
-
this.content.element.appendChild( this.cover.element );
|
|
8433
|
-
}
|
|
8434
|
-
setupMenu() {
|
|
8435
|
-
// var style = dom.menu.style;
|
|
8436
|
-
switch( this.cache.config.position ) {
|
|
8437
|
-
case "top":
|
|
8438
|
-
this.controller.style({
|
|
8439
|
-
width : "100%",
|
|
8440
|
-
height : `${this.height/2}px`
|
|
8441
|
-
});break;
|
|
8442
|
-
case "right":
|
|
8443
|
-
this.controller.style({
|
|
8444
|
-
right : 0,
|
|
8445
|
-
width : `${this.width/2}px`,
|
|
8446
|
-
height : "100%"
|
|
8447
|
-
});break;
|
|
8448
|
-
case "bottom":
|
|
8449
|
-
this.controller.style({
|
|
8450
|
-
bottom : "0",
|
|
8451
|
-
width : "100%",
|
|
8452
|
-
height : `${this.height/2}px`
|
|
8453
|
-
});break;
|
|
8454
|
-
case "left":
|
|
8455
|
-
this.controller.style({
|
|
8456
|
-
width : `${this.width/2}px`,
|
|
8457
|
-
height : "100%"
|
|
8458
|
-
});break;
|
|
8459
|
-
}
|
|
8460
|
-
this.controller.style({
|
|
8461
|
-
position : "fixed",
|
|
8462
|
-
display : "block",
|
|
8463
|
-
zIndex : 1,
|
|
8464
|
-
transform : this.cache.config.menuTransformClosed,
|
|
8465
|
-
transformOrigin : this.cache.config.menuTransformOrigin,
|
|
8466
|
-
transition : 'all ' + this.cache.config.transitionDuration +' '+ this.cache.config.transitionEasing
|
|
8467
|
-
});
|
|
8468
|
-
}
|
|
8469
|
-
setupContent() {
|
|
8470
|
-
this.content.style({
|
|
8471
|
-
transform : this.cache.config.contentTransformClosed,
|
|
8472
|
-
transformOrigin : this.cache.config.contentTransformOrigin,
|
|
8473
|
-
transition : `all ${this.cache.config.transitionDuration} ${this.cache.config.transitionEasing}`
|
|
8474
|
-
});
|
|
8475
|
-
}
|
|
8476
|
-
open(){
|
|
8477
|
-
if(!this.cache.config.isOpen){
|
|
8478
|
-
this.cache.config.isOpen = true;
|
|
8479
|
-
this.cover.style({
|
|
8480
|
-
height : this.content.element.scrollHeight + "px",
|
|
8481
|
-
visibility : "visible",
|
|
8482
|
-
opacity : 1,
|
|
8483
|
-
});
|
|
8484
|
-
if(this.cache.config.useTransfo)this.content.style({
|
|
8485
|
-
transform : this.cache.config.contentTransformOpened,
|
|
8486
|
-
userSelect : "default"
|
|
8487
|
-
});
|
|
8488
|
-
this.controller.style({
|
|
8489
|
-
transform : this.cache.config.menuTransformOpened,
|
|
8490
|
-
useSelect : "none"
|
|
8491
|
-
});
|
|
8492
|
-
this.emit("opened");
|
|
8493
|
-
}
|
|
8494
|
-
}
|
|
8495
|
-
close() {
|
|
8496
|
-
if( this.cache.config.isOpen ) {
|
|
8497
|
-
this.cache.config.isOpen = false;
|
|
8498
|
-
this.cover.style({
|
|
8499
|
-
// height : this.content.element.scrollHeight + "px",
|
|
8500
|
-
visibility : "hidden",
|
|
8501
|
-
opacity : 0,
|
|
8502
|
-
});
|
|
8503
|
-
this.content.style({
|
|
8504
|
-
transform : this.cache.config.contentTransformClosed,
|
|
8505
|
-
useSelect : "default"
|
|
8506
|
-
});
|
|
8507
|
-
this.controller.style({
|
|
8508
|
-
transform : this.cache.config.menuTransformClosed,
|
|
8509
|
-
userSelect : "none"
|
|
8510
|
-
});
|
|
8511
|
-
}
|
|
8512
|
-
this.emit("closed");
|
|
8513
|
-
}
|
|
8514
|
-
onOpen(callback){
|
|
8515
|
-
this.on("opened", callback.bind(this));
|
|
8516
|
-
return this;
|
|
8517
|
-
}
|
|
8518
|
-
onClose(callback){
|
|
8519
|
-
this.on("closed", callback.bind(this));
|
|
8520
|
-
return this;
|
|
8521
|
-
}
|
|
8522
|
-
#usePosition(position){
|
|
8523
|
-
if(this.cache.config.position!==position){
|
|
8524
|
-
this.cache.config.position=position;
|
|
8525
|
-
const isOpen = this.isOpen;
|
|
8526
|
-
this.close();
|
|
8527
|
-
this.update();
|
|
8528
|
-
if(isOpen)this.open();
|
|
8529
|
-
}
|
|
8530
|
-
}
|
|
8531
|
-
useRight(){
|
|
8532
|
-
this.#usePosition("left");
|
|
8533
|
-
return this;
|
|
8534
|
-
}
|
|
8535
|
-
useRight(){
|
|
8536
|
-
this.#usePosition("right");
|
|
8537
|
-
return this;
|
|
8538
|
-
}
|
|
8539
|
-
useTop(){
|
|
8540
|
-
this.#usePosition("top");
|
|
8541
|
-
return this;
|
|
8542
|
-
}
|
|
8543
|
-
useBottom(){
|
|
8544
|
-
this.#usePosition("bottom");
|
|
8545
|
-
return this;
|
|
8546
|
-
}
|
|
8547
|
-
}
|
|
8548
|
-
const menu3d = (controller, content) => new ZikoUIMenu3d(controller, content);
|
|
8549
|
-
globalThis.menu3d = menu3d;
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
/*
|
|
8553
|
-
|
|
8554
|
-
a = menu3d(Flex(text("Menu")), Flex(text("Content")))
|
|
8555
|
-
.size("80vw", "50vh")
|
|
8556
|
-
.style({ userSelect: "none" });
|
|
8557
|
-
a.onOpen((e) => console.log(e));
|
|
8558
|
-
a.open();
|
|
8559
|
-
a.controller.onSwipe(0.05, 1, (e) => {
|
|
8560
|
-
if (e.event.detail.direction.x === "left") a.close();
|
|
8561
|
-
});
|
|
8562
|
-
a.content.onSwipe(0.1, 1, (e) => {
|
|
8563
|
-
if (e.event.detail.direction.x === "left") a.close();
|
|
8564
|
-
if (e.event.detail.direction.x === "right") a.open();
|
|
8565
|
-
});
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
*/
|
|
8569
|
-
|
|
8570
|
-
class ZikoUIModal extends ZikoUIContainerElement{
|
|
8571
|
-
constructor(...UIElements){
|
|
8572
|
-
super("dialog", "modal");
|
|
8573
|
-
this.append(...UIElements);
|
|
8574
|
-
Object.assign(this.cache,{
|
|
8575
|
-
config:{
|
|
8576
|
-
mode:"modal",
|
|
8577
|
-
useTransition:true
|
|
8578
|
-
}
|
|
8579
|
-
});
|
|
8580
|
-
this.style({
|
|
8581
|
-
display:"flex",
|
|
8582
|
-
justifyContent:"center",
|
|
8583
|
-
alignItems:"center",
|
|
8584
|
-
position: "absolute",
|
|
8585
|
-
top: "50%",
|
|
8586
|
-
left: "50%",
|
|
8587
|
-
transform: "translate(-50%, -50%)",
|
|
8588
|
-
padding: "20px",
|
|
8589
|
-
border: "none",
|
|
8590
|
-
backgroundCcolor: "#f5f5f5",
|
|
8591
|
-
boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.1)",
|
|
8592
|
-
borderRadius: "8px"
|
|
8593
|
-
});
|
|
8594
|
-
this.close();
|
|
8595
|
-
}
|
|
8596
|
-
open(){
|
|
8597
|
-
if(!this.element.open){
|
|
8598
|
-
switch(this.cache.config.mode){
|
|
8599
|
-
case "modal": this.element.showModal(); break;
|
|
8600
|
-
case "dialog": this.element.show(); break;
|
|
8601
|
-
default : this.element.show(); break;
|
|
8602
|
-
}
|
|
8603
|
-
// this.style({
|
|
8604
|
-
// display : "flex",
|
|
8605
|
-
// })
|
|
8606
|
-
this.st.fadeIn(1000);
|
|
8607
|
-
this.emit("modal:opened");
|
|
8608
|
-
}
|
|
8609
|
-
return this;
|
|
8610
|
-
}
|
|
8611
|
-
close(){
|
|
8612
|
-
// this.style({
|
|
8613
|
-
// display : "none"
|
|
8614
|
-
// })
|
|
8615
|
-
this.st.fadeOut(1000);
|
|
8616
|
-
if(this.element.open){
|
|
8617
|
-
this.element.close();
|
|
8618
|
-
}
|
|
8619
|
-
this.emit("modal:closed");
|
|
8620
|
-
return this;
|
|
8621
|
-
}
|
|
8622
|
-
closeAfter(t = 1000){
|
|
8623
|
-
globalThis?.setTimeout(()=>this.close(), t);
|
|
8624
|
-
return this;
|
|
8625
|
-
}
|
|
8626
|
-
onOpen(callback){
|
|
8627
|
-
this.on("modal:opened",callback.bind(this));
|
|
8628
|
-
return this;
|
|
8629
|
-
}
|
|
8630
|
-
onClose(callback){
|
|
8631
|
-
this.on("modal:closed",callback.bind(this));
|
|
8632
|
-
return this;
|
|
8633
|
-
}
|
|
8634
|
-
useModal(){
|
|
8635
|
-
this.cache.config.mode = "modal";
|
|
8636
|
-
return this;
|
|
8637
|
-
}
|
|
8638
|
-
useDialog(){
|
|
8639
|
-
this.cache.config.mode = "dialog";
|
|
8640
|
-
return this;
|
|
8641
|
-
}
|
|
8642
|
-
useTransition(enabled = true){
|
|
8643
|
-
this.cache.config.useTransition = enabled;
|
|
8644
|
-
return this;
|
|
8645
|
-
}
|
|
8646
|
-
}
|
|
8647
|
-
|
|
8648
|
-
const Modal=(...UIElements)=>new ZikoUIModal(...UIElements);
|
|
8649
|
-
|
|
8650
|
-
/*
|
|
8651
|
-
a=Modal(text("Hello")).style({
|
|
8652
|
-
width:"100%",
|
|
8653
|
-
height:"100%"
|
|
8654
|
-
})
|
|
8655
|
-
Flex(a).size("400px","400px").style({border:"1px red solid"})
|
|
8656
|
-
*/
|
|
8657
|
-
|
|
8658
|
-
class __ZikoUISlider__ extends ZikoUISection{
|
|
8659
|
-
constructor(){
|
|
8660
|
-
super("section","");
|
|
8661
|
-
Object.assign(this.cache,{
|
|
8662
|
-
currentIndex : 0,
|
|
8663
|
-
slideBuilder : null,
|
|
8664
|
-
});
|
|
8665
|
-
this.container = Flex().size("100%","100%").vertical(0,0).style({
|
|
8666
|
-
// width:"100%",
|
|
8667
|
-
overflow:"hidden"
|
|
8668
|
-
});
|
|
8669
|
-
// this.style({
|
|
8670
|
-
// // width:"100%",
|
|
8671
|
-
// overflow:"hidden"
|
|
8672
|
-
// });
|
|
8673
|
-
this.container.setAttr({
|
|
8674
|
-
ariaRoledescription : "carousel",
|
|
8675
|
-
ariaLive: "polite",
|
|
8676
|
-
ariaLabel : "Content Slider"
|
|
8677
|
-
});
|
|
8678
|
-
this.track = Section().size("100%","100%").style({
|
|
8679
|
-
transition : "transform 0.3s ease-in-out",
|
|
8680
|
-
});
|
|
8681
|
-
this.bullets = Flex().style({
|
|
8682
|
-
// position : "absolute",
|
|
8683
|
-
// top : 0,
|
|
8684
|
-
gap : "10px",
|
|
8685
|
-
padding:"10px",
|
|
8686
|
-
});
|
|
8687
|
-
this.container.append(
|
|
8688
|
-
this.track,
|
|
8689
|
-
this.bullets
|
|
8690
|
-
);
|
|
8691
|
-
this.append(this.container);
|
|
8692
|
-
}
|
|
8693
|
-
#updateAriaHidden(){
|
|
8694
|
-
for(let i=0;i<this.track.items.length;i++){
|
|
8695
|
-
this.track[i].setAttr({
|
|
8696
|
-
ariaHidden : (i!==this.cache.currentIndex)
|
|
8697
|
-
});
|
|
8698
|
-
}
|
|
8699
|
-
}
|
|
8700
|
-
goto(n = 0){
|
|
8701
|
-
this.cache.currentIndex = n;
|
|
8702
|
-
this.__updatePos();
|
|
8703
|
-
this.#updateAriaHidden();
|
|
8704
|
-
}
|
|
8705
|
-
next(n = 1){
|
|
8706
|
-
this.cache.currentIndex += n;
|
|
8707
|
-
this.__updatePos();
|
|
8708
|
-
this.#updateAriaHidden();
|
|
8709
|
-
return this;
|
|
8710
|
-
}
|
|
8711
|
-
previous(n = 1){
|
|
8712
|
-
this.cache.currentIndex -= n;
|
|
8713
|
-
this.__updatePos();
|
|
8714
|
-
this.#updateAriaHidden();
|
|
8715
|
-
return this;
|
|
8716
|
-
}
|
|
8717
|
-
#update(){
|
|
8718
|
-
const length = this.track.items.length;
|
|
8719
|
-
for(let i=0;i<length;i++){
|
|
8720
|
-
this.track.items[i].setAttr({
|
|
8721
|
-
ariaLabel : `Slide ${i+1} of ${length}`,
|
|
8722
|
-
dataSlideIndex : i
|
|
8723
|
-
});
|
|
8724
|
-
this.bullets.items[i].setAttr({
|
|
8725
|
-
dataIndex : i,
|
|
8726
|
-
ariaLabel : `Go to slide ${i}`
|
|
8727
|
-
});
|
|
8728
|
-
this.bullets[i].events.click?.destroy();
|
|
8729
|
-
this.bullets[i].onClick(()=>this.goto(i));
|
|
8730
|
-
}
|
|
8731
|
-
}
|
|
8732
|
-
#addSlide(UIElement){
|
|
8733
|
-
this.track.append(this.cache.slideBuilder(UIElement).setAttr({
|
|
8734
|
-
ariaRoledescription : "slide",
|
|
8735
|
-
role : "group",
|
|
8736
|
-
ariaLabel : "" // link to update
|
|
8737
|
-
}));
|
|
8738
|
-
const bullet = text$1().size("15px","15px").style({
|
|
8739
|
-
borderRadius:"50%",
|
|
8740
|
-
cursor : "pointer",
|
|
8741
|
-
border : "3px solid blue",
|
|
8742
|
-
background : "white"
|
|
8743
|
-
}).setAttr({
|
|
8744
|
-
role : "button",
|
|
8745
|
-
tabIndex : 0
|
|
8746
|
-
})
|
|
8747
|
-
.onPtrEnter(e=>e.target.st.background("gold").scale(1.2,1.2))
|
|
8748
|
-
.onPtrLeave(e=>e.target.st.background("white").scale(1,1));
|
|
8749
|
-
this.bullets.append(
|
|
8750
|
-
bullet
|
|
8751
|
-
);
|
|
8752
|
-
return this;
|
|
8753
|
-
}
|
|
8754
|
-
addSlides(...slides){
|
|
8755
|
-
slides.forEach(n=>this.#addSlide(n));
|
|
8756
|
-
this.#update();
|
|
8757
|
-
this.#updateAriaHidden();
|
|
8758
|
-
return this;
|
|
8759
|
-
}
|
|
8760
|
-
}
|
|
8761
|
-
|
|
8762
|
-
class ZikoUIHorizontalSlider extends __ZikoUISlider__{
|
|
8763
|
-
constructor(...slides){
|
|
8764
|
-
super("section","hSlider");
|
|
8765
|
-
this.container.vertical(0,0);
|
|
8766
|
-
Object.assign(this.cache,{
|
|
8767
|
-
slideBuilder : (UIElement) => Flex(UIElement).style({
|
|
8768
|
-
minWidth : "100%",
|
|
8769
|
-
width:"100%",
|
|
8770
|
-
height:"100%",
|
|
8771
|
-
}).vertical(0,0)
|
|
8772
|
-
});
|
|
8773
|
-
this.track.size("100%","90%").style({
|
|
8774
|
-
display : "flex"
|
|
8775
|
-
});
|
|
8776
|
-
this.addSlides(...slides);
|
|
8777
|
-
this.bullets.horizontal(0,0).style({
|
|
8778
|
-
width : "100%",
|
|
8779
|
-
height : "10%",
|
|
8780
|
-
});
|
|
8781
|
-
}
|
|
8782
|
-
__updatePos(){
|
|
8783
|
-
const width = this.container.width;
|
|
8784
|
-
this.track.st.translateX(-this.cache.currentIndex * width);
|
|
8785
|
-
}
|
|
8786
|
-
|
|
8787
|
-
}
|
|
8788
|
-
|
|
8789
|
-
const hSlider=(...slides)=>new ZikoUIHorizontalSlider(...slides);
|
|
8790
|
-
|
|
8791
|
-
class ZikoUIVerticalSlider extends __ZikoUISlider__{
|
|
8792
|
-
constructor(...slides){
|
|
8793
|
-
super("section","vSlider");
|
|
8794
|
-
Object.assign(this.cache,{
|
|
8795
|
-
slideBuilder : (UIElement) => Flex(UIElement).size("100%","100%").vertical(0, 0)
|
|
8796
|
-
});
|
|
8797
|
-
this.addSlides(...slides);
|
|
8798
|
-
this.container.horizontal(0,0);
|
|
8799
|
-
this.track.size("90%","100%");
|
|
8800
|
-
this.bullets.vertical(0,0).style({
|
|
8801
|
-
height : "100%",
|
|
8802
|
-
width : "10%"
|
|
8803
|
-
});
|
|
8804
|
-
}
|
|
8805
|
-
__updatePos(){
|
|
8806
|
-
const height = this.container.height;
|
|
8807
|
-
this.track.st.translateY(-this.cache.currentIndex * height);
|
|
8808
|
-
}
|
|
8809
|
-
}
|
|
8810
|
-
|
|
8811
|
-
const vSlider=(...slides)=>new ZikoUIVerticalSlider(...slides);
|
|
8812
|
-
|
|
8813
|
-
const Slider = ({orintation = "horizontal",slides = []}) =>{
|
|
8814
|
-
if(["v","vertical"].includes(orintation.toLowerCase())) return vSlider(...slides);
|
|
8815
|
-
else if(["h","horizontal"].includes(orintation.toLowerCase())) return hSlider(...slides);
|
|
8816
|
-
else ;
|
|
8817
|
-
};
|
|
8818
|
-
|
|
8819
|
-
var Derived = /*#__PURE__*/Object.freeze({
|
|
8820
|
-
__proto__: null,
|
|
8821
|
-
Accordion: Accordion,
|
|
8822
|
-
Breadcrumbs: Breadcrumbs,
|
|
8823
|
-
Carousel: Carousel,
|
|
8824
|
-
CodeCell: CodeCell,
|
|
8825
|
-
CodeNote: CodeNote,
|
|
8826
|
-
Collapsible: Collapsible,
|
|
8827
|
-
Flex: Flex$1,
|
|
8828
|
-
Grid: Grid$1,
|
|
8829
|
-
Modal: Modal,
|
|
8830
|
-
Slider: Slider,
|
|
8831
|
-
Splitter: Splitter,
|
|
8832
|
-
Tabs: Tabs,
|
|
8833
|
-
ZikoUIAccordion: ZikoUIAccordion,
|
|
8834
|
-
ZikoUIBreadcrumbs: ZikoUIBreadcrumbs,
|
|
8835
|
-
ZikoUICodeNote: ZikoUICodeNote,
|
|
8836
|
-
ZikoUIFlex: ZikoUIFlex$1,
|
|
8837
|
-
ZikoUIGrid: ZikoUIGrid,
|
|
8838
|
-
ZikoUIHorizontalSlider: ZikoUIHorizontalSlider,
|
|
8839
|
-
ZikoUIHorizontalSplitter: ZikoUIHorizontalSplitter,
|
|
8840
|
-
ZikoUIMenu3d: ZikoUIMenu3d,
|
|
8841
|
-
ZikoUIModal: ZikoUIModal,
|
|
8842
|
-
ZikoUIVerticalSlider: ZikoUIVerticalSlider,
|
|
8843
|
-
ZikoUIVerticalSplitter: ZikoUIVerticalSplitter,
|
|
8844
|
-
dangerAlert: dangerAlert,
|
|
8845
|
-
hSlider: hSlider,
|
|
8846
|
-
hSplitter: hSplitter,
|
|
8847
|
-
infoAlert: infoAlert,
|
|
8848
|
-
menu3d: menu3d,
|
|
8849
|
-
successAlert: successAlert,
|
|
8850
|
-
vSlider: vSlider,
|
|
8851
|
-
vSplitter: vSplitter,
|
|
8852
|
-
warningAlert: warningAlert
|
|
8853
|
-
});
|
|
8854
|
-
|
|
8855
|
-
const UI$1 = {
|
|
8856
|
-
...Text$1,
|
|
8857
|
-
...List,
|
|
8858
|
-
...Io,
|
|
8859
|
-
...Media,
|
|
8860
|
-
...Table,
|
|
8861
|
-
...Semantic,
|
|
8862
|
-
...Misc,
|
|
8863
|
-
...Derived,
|
|
8864
|
-
ZikoUIElement,
|
|
8865
|
-
ZikoUIContainerElement
|
|
8866
|
-
};
|
|
6885
|
+
const UI$1 = {
|
|
6886
|
+
...Text$1,
|
|
6887
|
+
...List,
|
|
6888
|
+
...Io,
|
|
6889
|
+
...Media,
|
|
6890
|
+
...Table,
|
|
6891
|
+
...Semantic,
|
|
6892
|
+
...Misc,
|
|
6893
|
+
...Flex$1,
|
|
6894
|
+
...Grid$2,
|
|
6895
|
+
ZikoUIElement,
|
|
6896
|
+
};
|
|
8867
6897
|
|
|
8868
6898
|
const svg2str=svg=>(new XMLSerializer()).serializeToString(svg);
|
|
8869
6899
|
const svg2ascii=svg=>btoa(svg2str(svg));
|
|
@@ -9009,9 +7039,11 @@
|
|
|
9009
7039
|
}, Array.isArray(obj) ? [] : {});
|
|
9010
7040
|
}
|
|
9011
7041
|
|
|
7042
|
+
// export { markdown2html } from "./markdown.js";
|
|
7043
|
+
// export { adoc2html } from "./adoc.js";
|
|
7044
|
+
|
|
9012
7045
|
var Converter = /*#__PURE__*/Object.freeze({
|
|
9013
7046
|
__proto__: null,
|
|
9014
|
-
adoc2html: adoc2html,
|
|
9015
7047
|
arr2str: arr2str,
|
|
9016
7048
|
csv2arr: csv2arr,
|
|
9017
7049
|
csv2json: csv2json,
|
|
@@ -9026,7 +7058,6 @@
|
|
|
9026
7058
|
json2xmlFile: json2xmlFile,
|
|
9027
7059
|
json2yml: json2yml,
|
|
9028
7060
|
json2ymlFile: json2ymlFile,
|
|
9029
|
-
markdown2html: markdown2html,
|
|
9030
7061
|
obj2str: obj2str,
|
|
9031
7062
|
svg2ascii: svg2ascii,
|
|
9032
7063
|
svg2img: svg2img,
|
|
@@ -10399,7 +8430,7 @@
|
|
|
10399
8430
|
...__Calculus__,
|
|
10400
8431
|
};
|
|
10401
8432
|
|
|
10402
|
-
class ZikoUISvg extends
|
|
8433
|
+
class ZikoUISvg extends ZikoUIElement {
|
|
10403
8434
|
constructor(w=360,h=300) {
|
|
10404
8435
|
super("svg","svg");
|
|
10405
8436
|
//this.cache={};
|
|
@@ -10464,439 +8495,14 @@
|
|
|
10464
8495
|
|
|
10465
8496
|
const Svg =(w,h)=>new ZikoUISvg(w,h);
|
|
10466
8497
|
|
|
10467
|
-
class ZikoSvgElement extends ZikoUIElement{
|
|
10468
|
-
constructor(type) {
|
|
10469
|
-
super();
|
|
10470
|
-
Object.assign(this.cache,{
|
|
10471
|
-
type
|
|
10472
|
-
});
|
|
10473
|
-
}
|
|
10474
|
-
pos(x,y){
|
|
10475
|
-
return this.posX(x).posY(y);
|
|
10476
|
-
}
|
|
10477
|
-
posX(x){
|
|
10478
|
-
if(["circle","ellipse"].includes(this.cache.type))this.element.cx.baseVal.value=x;
|
|
10479
|
-
else this.element.x.baseVal.value=x;
|
|
10480
|
-
return this;
|
|
10481
|
-
}
|
|
10482
|
-
posY(y){
|
|
10483
|
-
if(["circle","ellipse"].includes(this.cache.type))this.element.cy.baseVal.value=y;
|
|
10484
|
-
else this.element.y.baseVal.value=y;
|
|
10485
|
-
return this;
|
|
10486
|
-
}
|
|
10487
|
-
translate(x,y){
|
|
10488
|
-
return this;
|
|
10489
|
-
}
|
|
10490
|
-
color({ stroke, fill }) {
|
|
10491
|
-
this.element?.setAttribute("stroke", stroke);
|
|
10492
|
-
this.element?.setAttribute("fill", fill);
|
|
10493
|
-
return this;
|
|
10494
|
-
}
|
|
10495
|
-
fill(color = "none") {
|
|
10496
|
-
this.element?.setAttribute("fill", color);
|
|
10497
|
-
return this;
|
|
10498
|
-
}
|
|
10499
|
-
stroke(color = "none", width) {
|
|
10500
|
-
this.element?.setAttribute("stroke", color);
|
|
10501
|
-
width && this.strokeWidth(width);
|
|
10502
|
-
return this;
|
|
10503
|
-
}
|
|
10504
|
-
strokeWidth(width = 1) {
|
|
10505
|
-
this.element?.setAttribute("stroke-width", width);
|
|
10506
|
-
return this;
|
|
10507
|
-
}
|
|
10508
|
-
opacity(value = 1) {
|
|
10509
|
-
this.element?.setAttribute("opacity", value);
|
|
10510
|
-
return this;
|
|
10511
|
-
}
|
|
10512
|
-
}
|
|
10513
|
-
|
|
10514
|
-
class ZikoSvgCircle extends ZikoSvgElement{
|
|
10515
|
-
constructor(cx,cy,r){
|
|
10516
|
-
super("circle");
|
|
10517
|
-
this.element=document.createElementNS(
|
|
10518
|
-
"http://www.w3.org/2000/svg",
|
|
10519
|
-
"circle",
|
|
10520
|
-
);
|
|
10521
|
-
this.pos(cx,cy).setR(r);
|
|
10522
|
-
}
|
|
10523
|
-
setR(r){
|
|
10524
|
-
this.element.r.baseVal.value=r;
|
|
10525
|
-
return this;
|
|
10526
|
-
}
|
|
10527
|
-
get r(){
|
|
10528
|
-
return this.element.baseVal.value;
|
|
10529
|
-
}
|
|
10530
|
-
get cx(){
|
|
10531
|
-
return this.element.baseVal.value;
|
|
10532
|
-
}
|
|
10533
|
-
get cy(){
|
|
10534
|
-
return this.element.baseVal.value;
|
|
10535
|
-
}
|
|
10536
|
-
}
|
|
10537
|
-
const svgCircle=(x,y,r)=>new ZikoSvgCircle(x,y,r);
|
|
10538
|
-
|
|
10539
|
-
class ZikoSvgEllipse extends ZikoSvgElement{
|
|
10540
|
-
constructor(cx,cy,rx,ry){
|
|
10541
|
-
super("ellipse");
|
|
10542
|
-
this.element=document?.createElementNS(
|
|
10543
|
-
"http://www.w3.org/2000/svg",
|
|
10544
|
-
"ellipse",
|
|
10545
|
-
);
|
|
10546
|
-
this.pos(cx,cy).setRx(rx).setRy(ry);
|
|
10547
|
-
}
|
|
10548
|
-
setRx(rx){
|
|
10549
|
-
this.element.rx.baseVal.value=rx;
|
|
10550
|
-
return this;
|
|
10551
|
-
}
|
|
10552
|
-
setRy(ry){
|
|
10553
|
-
this.element.ry.baseVal.value=ry;
|
|
10554
|
-
return this;
|
|
10555
|
-
}
|
|
10556
|
-
}
|
|
10557
|
-
const svgEllipse=(x,y,rx,ry)=>new ZikoSvgEllipse(x,y,rx,ry);
|
|
10558
|
-
|
|
10559
|
-
class ZikoSvgForeignObject extends ZikoSvgElement{
|
|
10560
|
-
constructor(x=0,y=0,w="100%",h="100%",...ZikoUIElement){
|
|
10561
|
-
super("foreignObject");
|
|
10562
|
-
this.items=[];
|
|
10563
|
-
this.element=document?.createElementNS(
|
|
10564
|
-
"http://www.w3.org/2000/svg",
|
|
10565
|
-
"foreignObject",
|
|
10566
|
-
);
|
|
10567
|
-
this.container=Flex$1().setTarget(this.element).vertical(0,0).size("auto","auto");
|
|
10568
|
-
this.container.st.scaleY(-1);
|
|
10569
|
-
this.posX(x).posY(y).width(w).height(h);
|
|
10570
|
-
}
|
|
10571
|
-
width(w){
|
|
10572
|
-
this.element.etAttribute("width",w);
|
|
10573
|
-
return this;
|
|
10574
|
-
}
|
|
10575
|
-
height(h){
|
|
10576
|
-
this.element.etAttribute("height",h);
|
|
10577
|
-
return this;
|
|
10578
|
-
}
|
|
10579
|
-
add(...ZikoUIElement){
|
|
10580
|
-
this.container.append(...ZikoUIElement);
|
|
10581
|
-
return this;
|
|
10582
|
-
}
|
|
10583
|
-
remove(...ZikoUIElement){
|
|
10584
|
-
this.container.append(...ZikoUIElement);
|
|
10585
|
-
return this;
|
|
10586
|
-
}
|
|
10587
|
-
}
|
|
10588
|
-
const svgObject=(x, y, w, h)=>new ZikoSvgForeignObject(x, y, w, h);
|
|
10589
|
-
|
|
10590
|
-
class ZikoSvgGroupe extends ZikoSvgElement{
|
|
10591
|
-
constructor(...svgElement){
|
|
10592
|
-
super();
|
|
10593
|
-
this.items=[];
|
|
10594
|
-
this.element=document?.createElementNS(
|
|
10595
|
-
"http://www.w3.org/2000/svg",
|
|
10596
|
-
"g",
|
|
10597
|
-
);
|
|
10598
|
-
this.add(...svgElement);
|
|
10599
|
-
}
|
|
10600
|
-
add(...svgElement){
|
|
10601
|
-
for(let i=0;i<svgElement.length;i++){
|
|
10602
|
-
this.element?.appendChild(svgElement[i].element);
|
|
10603
|
-
this.items.push(svgElement[i]);
|
|
10604
|
-
}
|
|
10605
|
-
if(svgElement.length===1)return svgElement[0]
|
|
10606
|
-
return svgElement;
|
|
10607
|
-
}
|
|
10608
|
-
remove(...svgElement){
|
|
10609
|
-
for(let i=0;i<svgElement.length;i++){
|
|
10610
|
-
this.element?.removeChild(svgElement[i].element);
|
|
10611
|
-
this.items=this.items.filter(n=>n!=svgElement);
|
|
10612
|
-
}
|
|
10613
|
-
return this;
|
|
10614
|
-
}
|
|
10615
|
-
}
|
|
10616
|
-
const svgGroupe=(...svgElement)=>new ZikoSvgGroupe(...svgElement);
|
|
10617
|
-
|
|
10618
|
-
class ZikoSvgImage extends ZikoSvgElement{
|
|
10619
|
-
constructor(src="",w="100%",h="100%",x=0,y=0){
|
|
10620
|
-
super();
|
|
10621
|
-
this.element=document?.createElementNS(
|
|
10622
|
-
"http://www.w3.org/2000/svg",
|
|
10623
|
-
"image",
|
|
10624
|
-
);
|
|
10625
|
-
this.setSrc(src).width(w).height(h).x(x).y(y);
|
|
10626
|
-
}
|
|
10627
|
-
x(x){
|
|
10628
|
-
this.element.x.baseVal.value=x;
|
|
10629
|
-
return this;
|
|
10630
|
-
}
|
|
10631
|
-
y(y){
|
|
10632
|
-
this.element.y.baseVal.value=y;
|
|
10633
|
-
return this;
|
|
10634
|
-
}
|
|
10635
|
-
width(w){
|
|
10636
|
-
this.element?.setAttribute("width",w);
|
|
10637
|
-
return this;
|
|
10638
|
-
}
|
|
10639
|
-
height(h){
|
|
10640
|
-
this.element?.setAttribute("height",h);
|
|
10641
|
-
return this;
|
|
10642
|
-
}
|
|
10643
|
-
setSrc(src=""){
|
|
10644
|
-
this.element?.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', src);
|
|
10645
|
-
return this;
|
|
10646
|
-
}
|
|
10647
|
-
}
|
|
10648
|
-
const svgImage=(src,w,h,x,y)=>new ZikoSvgImage(src,w,h,x,y);
|
|
10649
|
-
|
|
10650
|
-
class ZikoSvgLine extends ZikoSvgElement{
|
|
10651
|
-
constructor(x1,y1,x2,y2){
|
|
10652
|
-
super();
|
|
10653
|
-
this.element=document?.createElementNS(
|
|
10654
|
-
"http://www.w3.org/2000/svg",
|
|
10655
|
-
"line",
|
|
10656
|
-
);
|
|
10657
|
-
this.x1(x1).y1(y1).x2(x2).y2(y2).stroke("black");
|
|
10658
|
-
}
|
|
10659
|
-
x1(x1){
|
|
10660
|
-
this.element.x1.baseVal.value=x1;
|
|
10661
|
-
return this;
|
|
10662
|
-
}
|
|
10663
|
-
y1(y1){
|
|
10664
|
-
this.element.y1.baseVal.value=y1;
|
|
10665
|
-
return this;
|
|
10666
|
-
}
|
|
10667
|
-
x2(x2){
|
|
10668
|
-
this.element.x2.baseVal.value=x2;
|
|
10669
|
-
return this;
|
|
10670
|
-
}
|
|
10671
|
-
y2(y2){
|
|
10672
|
-
this.element.y2.baseVal.value=y2;
|
|
10673
|
-
return this;
|
|
10674
|
-
}
|
|
10675
|
-
}
|
|
10676
|
-
const svgLine=(x1,y1,x2,y2)=>new ZikoSvgLine(x1,y1,x2,y2);
|
|
10677
|
-
|
|
10678
|
-
class ZikoSvgLink extends ZikoSvgElement{
|
|
10679
|
-
constructor(href,...svgElement){
|
|
10680
|
-
super();
|
|
10681
|
-
this.items=[];
|
|
10682
|
-
this.element=document?.createElementNS(
|
|
10683
|
-
"http://www.w3.org/2000/svg",
|
|
10684
|
-
"a",
|
|
10685
|
-
);
|
|
10686
|
-
this.element.etAttribute("href",href);
|
|
10687
|
-
this.add(...svgElement);
|
|
10688
|
-
}
|
|
10689
|
-
add(...svgElement){
|
|
10690
|
-
for(let i=0;i<svgElement.length;i++){
|
|
10691
|
-
this.element.ppendChild(svgElement[i].element);
|
|
10692
|
-
this.items.push(svgElement[i]);
|
|
10693
|
-
}
|
|
10694
|
-
if(svgElement.length===1)return svgElement[0]
|
|
10695
|
-
return svgElement;
|
|
10696
|
-
}
|
|
10697
|
-
remove(...svgElement){
|
|
10698
|
-
for(let i=0;i<svgElement.length;i++){
|
|
10699
|
-
this.element.moveChild(svgElement[i].element);
|
|
10700
|
-
this.items=this.items.filter(n=>n!=svgElement);
|
|
10701
|
-
}
|
|
10702
|
-
return this;
|
|
10703
|
-
}
|
|
10704
|
-
}
|
|
10705
|
-
const svgLink=(href,...svgElement)=>new ZikoSvgLink(href,...svgElement);
|
|
10706
|
-
|
|
10707
|
-
class ZikoSvgPath extends ZikoSvgElement{
|
|
10708
|
-
constructor(){
|
|
10709
|
-
super();
|
|
10710
|
-
this.element=document?.createElementNS(
|
|
10711
|
-
"http://www.w3.org/2000/svg",
|
|
10712
|
-
"path",
|
|
10713
|
-
);
|
|
10714
|
-
this.path="";
|
|
10715
|
-
|
|
10716
|
-
}
|
|
10717
|
-
setPath(){
|
|
10718
|
-
this.element.etAttribute("d",this.path);
|
|
10719
|
-
return this;
|
|
10720
|
-
}
|
|
10721
|
-
clear(){
|
|
10722
|
-
this.path="";
|
|
10723
|
-
this.setPath();
|
|
10724
|
-
return this;
|
|
10725
|
-
}
|
|
10726
|
-
moveTo(x,y){
|
|
10727
|
-
this.path+=`M${x} ${y} `;
|
|
10728
|
-
this.setPath();
|
|
10729
|
-
return this;
|
|
10730
|
-
}
|
|
10731
|
-
lineTo(x,y){
|
|
10732
|
-
this.path+=`L${x} ${y} `;
|
|
10733
|
-
this.setPath();
|
|
10734
|
-
return this;
|
|
10735
|
-
}
|
|
10736
|
-
hr(x){
|
|
10737
|
-
this.path+=`H${x} `;
|
|
10738
|
-
this.setPath();
|
|
10739
|
-
return this;
|
|
10740
|
-
}
|
|
10741
|
-
vr(y){
|
|
10742
|
-
this.path+=`V${y} `;
|
|
10743
|
-
this.setPath();
|
|
10744
|
-
return this;
|
|
10745
|
-
}
|
|
10746
|
-
bezier(x1,y1,x2,y2,x,y){
|
|
10747
|
-
this.path+=`C ${x1} ${y1},${x2} ${y2},${x} ${y} `;
|
|
10748
|
-
this.setPath();
|
|
10749
|
-
return this;
|
|
10750
|
-
}
|
|
10751
|
-
quadratic(x1,y1,x,y){
|
|
10752
|
-
this.path+=`Q ${x1} ${y1} ${x} ${y} `;
|
|
10753
|
-
this.setPath();
|
|
10754
|
-
return this;
|
|
10755
|
-
}
|
|
10756
|
-
close(){
|
|
10757
|
-
this.path+="Z";
|
|
10758
|
-
this.setPath();
|
|
10759
|
-
return this;
|
|
10760
|
-
}
|
|
10761
|
-
}
|
|
10762
|
-
|
|
10763
|
-
const svgPath=()=>new ZikoSvgPath();
|
|
10764
|
-
|
|
10765
|
-
class ZikoSvgPolygon extends ZikoSvgElement{
|
|
10766
|
-
constructor(X=[],Y=[]){
|
|
10767
|
-
super();
|
|
10768
|
-
this.X=X;
|
|
10769
|
-
this.Y=Y;
|
|
10770
|
-
this.element=document?.createElementNS(
|
|
10771
|
-
"http://www.w3.org/2000/svg",
|
|
10772
|
-
"polygon",
|
|
10773
|
-
);
|
|
10774
|
-
this.element?.setAttribute("points","");
|
|
10775
|
-
this.addPoints(X,Y);
|
|
10776
|
-
}
|
|
10777
|
-
addPoint(x,y){
|
|
10778
|
-
let p=this.element.parentElement.createSVGPoint();
|
|
10779
|
-
p.x=x;
|
|
10780
|
-
p.y=y;
|
|
10781
|
-
this.element.points.appendItem(p);
|
|
10782
|
-
return this;
|
|
10783
|
-
}
|
|
10784
|
-
addPoints(X,Y){
|
|
10785
|
-
for(let i=0;i<X.length;i++){
|
|
10786
|
-
let p=this.element.parentElement.createSVGPoint();
|
|
10787
|
-
p.x=X[i];
|
|
10788
|
-
p.y=Y[i];
|
|
10789
|
-
this.element.oints.appendItem(p);
|
|
10790
|
-
}
|
|
10791
|
-
return this;
|
|
10792
|
-
}
|
|
10793
|
-
}
|
|
10794
|
-
const svgPolygon=(X,Y)=>new ZikoSvgPolygon(X,Y);
|
|
10795
|
-
|
|
10796
|
-
class ZikoSvgRectangle extends ZikoSvgElement{
|
|
10797
|
-
constructor(x,y,w,h,center=true){
|
|
10798
|
-
super();
|
|
10799
|
-
this.element=document?.createElementNS(
|
|
10800
|
-
"http://www.w3.org/2000/svg",
|
|
10801
|
-
"rect",
|
|
10802
|
-
);
|
|
10803
|
-
this.setX(x).setY(y).width(w).height(h);
|
|
10804
|
-
this.rx=this.x+this.w/2;
|
|
10805
|
-
this.ty=this.y+this.h/2;
|
|
10806
|
-
}
|
|
10807
|
-
setX(x){
|
|
10808
|
-
this.element.x.baseVal.value=x;
|
|
10809
|
-
this.x=x;
|
|
10810
|
-
return this;
|
|
10811
|
-
}
|
|
10812
|
-
setY(y){
|
|
10813
|
-
this.element.y.baseVal.value=y;
|
|
10814
|
-
this.y=y;
|
|
10815
|
-
return this;
|
|
10816
|
-
}
|
|
10817
|
-
r(rx,ry){
|
|
10818
|
-
this.rx=rx;
|
|
10819
|
-
this.ry=ry;
|
|
10820
|
-
this.setX(this.rx-this.w/2);
|
|
10821
|
-
this.setY(this.ry-this.h/2);
|
|
10822
|
-
return this;
|
|
10823
|
-
}
|
|
10824
|
-
width(w){
|
|
10825
|
-
this.element.width.baseVal.value=w;
|
|
10826
|
-
this.w=w;
|
|
10827
|
-
return this;
|
|
10828
|
-
}
|
|
10829
|
-
height(h){
|
|
10830
|
-
this.element.height.baseVal.value=h;
|
|
10831
|
-
this.h=h;
|
|
10832
|
-
return this;
|
|
10833
|
-
}
|
|
10834
|
-
}
|
|
10835
|
-
const svgRect=(x,y,w,h,center)=>new ZikoSvgRectangle(x,y,w,h,center);
|
|
10836
|
-
|
|
10837
|
-
class ZikoSvgText extends ZikoSvgElement{
|
|
10838
|
-
constructor(text,x,y){
|
|
10839
|
-
super();
|
|
10840
|
-
this.element=document?.createElementNS(
|
|
10841
|
-
"http://www.w3.org/2000/svg",
|
|
10842
|
-
"text",
|
|
10843
|
-
);
|
|
10844
|
-
this.setText(text);
|
|
10845
|
-
this.x(x).y(y);
|
|
10846
|
-
}
|
|
10847
|
-
x(x){
|
|
10848
|
-
this.element?.setAttribute("x",x);
|
|
10849
|
-
return this;
|
|
10850
|
-
}
|
|
10851
|
-
y(y){
|
|
10852
|
-
this.element?.setAttribute("y",y);
|
|
10853
|
-
return this;
|
|
10854
|
-
}
|
|
10855
|
-
setText(text=""){
|
|
10856
|
-
this.element.textContent=text;
|
|
10857
|
-
return this;
|
|
10858
|
-
}
|
|
10859
|
-
}
|
|
10860
|
-
const svgText=(text,x,y)=>new ZikoSvgText(text,x,y);
|
|
10861
|
-
|
|
10862
|
-
const svgGrid=(w,h,r=10,c=10)=>{
|
|
10863
|
-
let path=svgPath().fill("none").stroke("coral").strokeWidth(0.6);
|
|
10864
|
-
console.log({x:w/r,y:h/c});
|
|
10865
|
-
for(let i=0;i<w;i++) path.moveTo(0,i*w/r).hr(w);
|
|
10866
|
-
for(let j=0;j<h;j++) path.moveTo(j*h/c,0).vr(h);
|
|
10867
|
-
return path
|
|
10868
|
-
};
|
|
10869
|
-
|
|
10870
8498
|
var SVG = /*#__PURE__*/Object.freeze({
|
|
10871
8499
|
__proto__: null,
|
|
10872
8500
|
Svg: Svg,
|
|
10873
|
-
|
|
10874
|
-
ZikoSvgEllipse: ZikoSvgEllipse,
|
|
10875
|
-
ZikoSvgForeignObject: ZikoSvgForeignObject,
|
|
10876
|
-
ZikoSvgGroupe: ZikoSvgGroupe,
|
|
10877
|
-
ZikoSvgImage: ZikoSvgImage,
|
|
10878
|
-
ZikoSvgLine: ZikoSvgLine,
|
|
10879
|
-
ZikoSvgLink: ZikoSvgLink,
|
|
10880
|
-
ZikoSvgPath: ZikoSvgPath,
|
|
10881
|
-
ZikoSvgRectangle: ZikoSvgRectangle,
|
|
10882
|
-
ZikoSvgText: ZikoSvgText,
|
|
10883
|
-
ZikoUISvg: ZikoUISvg,
|
|
10884
|
-
svgCircle: svgCircle,
|
|
10885
|
-
svgEllipse: svgEllipse,
|
|
10886
|
-
svgGrid: svgGrid,
|
|
10887
|
-
svgGroupe: svgGroupe,
|
|
10888
|
-
svgImage: svgImage,
|
|
10889
|
-
svgLine: svgLine,
|
|
10890
|
-
svgLink: svgLink,
|
|
10891
|
-
svgObject: svgObject,
|
|
10892
|
-
svgPath: svgPath,
|
|
10893
|
-
svgPolygon: svgPolygon,
|
|
10894
|
-
svgRect: svgRect,
|
|
10895
|
-
svgText: svgText
|
|
8501
|
+
ZikoUISvg: ZikoUISvg
|
|
10896
8502
|
});
|
|
10897
8503
|
|
|
10898
8504
|
// import { convolute } from "../../math/signal/conv.js";
|
|
10899
|
-
class ZikoUICanvas extends
|
|
8505
|
+
class ZikoUICanvas extends ZikoUIElement{
|
|
10900
8506
|
constructor(w,h){
|
|
10901
8507
|
super("canvas","canvas");
|
|
10902
8508
|
this.ctx = this.element?.getContext("2d");
|
|
@@ -11066,288 +8672,10 @@
|
|
|
11066
8672
|
|
|
11067
8673
|
const Canvas=(w,h)=>new ZikoUICanvas(w,h);
|
|
11068
8674
|
|
|
11069
|
-
class ZikoCanvasElement{
|
|
11070
|
-
constructor(x,y){
|
|
11071
|
-
this.parent=null;
|
|
11072
|
-
this.position={
|
|
11073
|
-
x,
|
|
11074
|
-
y
|
|
11075
|
-
};
|
|
11076
|
-
this.cache={
|
|
11077
|
-
interact:null/*avoid redraw*/,
|
|
11078
|
-
config:{
|
|
11079
|
-
draggable:false,
|
|
11080
|
-
selected:false,
|
|
11081
|
-
highlighted:false,
|
|
11082
|
-
rendered:false
|
|
11083
|
-
},
|
|
11084
|
-
style:{
|
|
11085
|
-
normal:{
|
|
11086
|
-
strokeEnabled:true,
|
|
11087
|
-
fillEnabled:false,
|
|
11088
|
-
strokeColor:"#111111",
|
|
11089
|
-
fillColor:"#777777",
|
|
11090
|
-
},
|
|
11091
|
-
highlighted:{
|
|
11092
|
-
strokeEnabled:true,
|
|
11093
|
-
fillEnabled:false,
|
|
11094
|
-
strokeColor:null,
|
|
11095
|
-
fillColor:null,
|
|
11096
|
-
}
|
|
11097
|
-
},
|
|
11098
|
-
};
|
|
11099
|
-
this.history={
|
|
11100
|
-
position:[],
|
|
11101
|
-
styles:[]
|
|
11102
|
-
};
|
|
11103
|
-
this.render();
|
|
11104
|
-
}
|
|
11105
|
-
get px(){
|
|
11106
|
-
//_x=====>px
|
|
11107
|
-
return (this.position.x??0)+(this.parent?.position?.x??0);
|
|
11108
|
-
}
|
|
11109
|
-
get py(){
|
|
11110
|
-
//_y=====>py
|
|
11111
|
-
return (this.position.y??0)+(this.parent?.position?.y??0);
|
|
11112
|
-
}
|
|
11113
|
-
isIntersectedWith(){
|
|
11114
|
-
|
|
11115
|
-
}
|
|
11116
|
-
isInStroke(x,y){
|
|
11117
|
-
let is;
|
|
11118
|
-
if(this.parent){
|
|
11119
|
-
this.parent.ctx.setTransform(1,0,0,1,0,0);
|
|
11120
|
-
is=this.parent.ctx.isPointInStroke(this.path,x,y);
|
|
11121
|
-
this.parent.applyTransformMatrix();
|
|
11122
|
-
}
|
|
11123
|
-
return is;
|
|
11124
|
-
}
|
|
11125
|
-
isInPath(x,y){
|
|
11126
|
-
let is;
|
|
11127
|
-
if(this.parent){
|
|
11128
|
-
this.parent.ctx.setTransform(1,0,0,1,0,0);
|
|
11129
|
-
is=this.parent.ctx.isPointInPath(this.path,x,y);
|
|
11130
|
-
this.parent.applyTransformMatrix();
|
|
11131
|
-
}
|
|
11132
|
-
return is;
|
|
11133
|
-
}
|
|
11134
|
-
posX(x){
|
|
11135
|
-
this.position.x=x;
|
|
11136
|
-
if(this.parent)this.parent.draw();
|
|
11137
|
-
return this;
|
|
11138
|
-
}
|
|
11139
|
-
posY(y){
|
|
11140
|
-
this.position.y=y;
|
|
11141
|
-
if(this.parent)this.parent.draw();
|
|
11142
|
-
return this;
|
|
11143
|
-
}
|
|
11144
|
-
color({stroke=this.cache.style.normal.strokeColor,fill=this.cache.style.normal.fillColor}={stroke,fill}){
|
|
11145
|
-
this.cache.style.normal.strokeColor=stroke;
|
|
11146
|
-
this.cache.style.normal.fillColor=fill;
|
|
11147
|
-
if(this.parent)this.parent.draw();
|
|
11148
|
-
return this;
|
|
11149
|
-
}
|
|
11150
|
-
translate(dx=0,dy=0){
|
|
11151
|
-
this.position.x+=dx;
|
|
11152
|
-
this.position.y+=dy;
|
|
11153
|
-
if(this.parent)this.parent.draw();
|
|
11154
|
-
return;
|
|
11155
|
-
}
|
|
11156
|
-
applyNormalStyle(ctx){
|
|
11157
|
-
ctx.strokeStyle=this.cache.style.normal.strokeColor;
|
|
11158
|
-
ctx.fillStyle=this.cache.style.normal.fillColor;
|
|
11159
|
-
return this;
|
|
11160
|
-
}
|
|
11161
|
-
applyHighlightedStyle(ctx){
|
|
11162
|
-
ctx.strokeStyle=this.cache.style.highlighted.strokeColor;
|
|
11163
|
-
ctx.fillStyle=this.cache.style.highlighted.fillColor;
|
|
11164
|
-
return this;
|
|
11165
|
-
}
|
|
11166
|
-
stroke(color=this.cache.style.normal.strokeColor,enabled=true){
|
|
11167
|
-
this.cache.style.normal.strokeEnabled=enabled;
|
|
11168
|
-
this.cache.style.normal.strokeColor=color;
|
|
11169
|
-
if(this.parent)this.parent.draw();
|
|
11170
|
-
return this
|
|
11171
|
-
}
|
|
11172
|
-
fill(color=this.cache.style.normal.fillColor,enabled=true){
|
|
11173
|
-
this.cache.style.normal.fillEnabled=enabled;
|
|
11174
|
-
this.cache.style.normal.filleColor=color;
|
|
11175
|
-
if(this.parent)this.parent.draw();
|
|
11176
|
-
return this;
|
|
11177
|
-
}
|
|
11178
|
-
render(render=true){
|
|
11179
|
-
this.cache.config.rendered=render;
|
|
11180
|
-
return this;
|
|
11181
|
-
}
|
|
11182
|
-
}
|
|
11183
|
-
|
|
11184
|
-
class CanvasArc extends ZikoCanvasElement{
|
|
11185
|
-
constructor(x,y,r,angle){
|
|
11186
|
-
super(x,y);
|
|
11187
|
-
this.r=r;
|
|
11188
|
-
this.angle=angle;
|
|
11189
|
-
this.path=null;
|
|
11190
|
-
}
|
|
11191
|
-
draw(ctx){
|
|
11192
|
-
if(this.cache.config.rendered){
|
|
11193
|
-
ctx.save();
|
|
11194
|
-
this.applyNormalStyle(ctx);
|
|
11195
|
-
ctx.beginPath();
|
|
11196
|
-
this.path=new Path2D();
|
|
11197
|
-
this.path.arc(this.px, this.py, this.r, 0, this.angle);
|
|
11198
|
-
const{strokeEnabled,fillEnabled}=this.cache.style.normal;
|
|
11199
|
-
if(strokeEnabled)ctx.stroke(this.path);
|
|
11200
|
-
if(fillEnabled)ctx.fill(this.path);
|
|
11201
|
-
ctx.closePath();
|
|
11202
|
-
ctx.restore();
|
|
11203
|
-
}
|
|
11204
|
-
return this;
|
|
11205
|
-
}
|
|
11206
|
-
radius(r){
|
|
11207
|
-
this.r=r;
|
|
11208
|
-
if(this.parent)this.parent.draw();
|
|
11209
|
-
return this;
|
|
11210
|
-
}
|
|
11211
|
-
// distanceFromCenter(x,y){
|
|
11212
|
-
// return Math.sqrt(
|
|
11213
|
-
// (this._x-x)**2-(this._y-y)**2
|
|
11214
|
-
// )
|
|
11215
|
-
// }
|
|
11216
|
-
// isIn(x,y,strict=false){
|
|
11217
|
-
// return strict?this.distanceFromCenter(x,y)<this.r:this.distanceFromCenter(x,y)<=this.r;
|
|
11218
|
-
// }
|
|
11219
|
-
// isInEdges(x,y){
|
|
11220
|
-
// return this.distanceFromCenter(x,y)===this.r;
|
|
11221
|
-
// }
|
|
11222
|
-
}
|
|
11223
|
-
const canvasArc=(x,y,r,phi)=>new CanvasArc(x,y,r,phi);
|
|
11224
|
-
const canvasCircle=(x,y,r)=>new CanvasArc(x,y,r,2*Math.PI);
|
|
11225
|
-
|
|
11226
|
-
class CanvasPoints extends ZikoCanvasElement{
|
|
11227
|
-
constructor(ptsX,ptsY){
|
|
11228
|
-
super();
|
|
11229
|
-
this.pointsMatrix=null;
|
|
11230
|
-
this.path=new Path2D();
|
|
11231
|
-
this.fromXY(ptsX,ptsY);
|
|
11232
|
-
}
|
|
11233
|
-
get points(){
|
|
11234
|
-
return this.pointsMatrix.T.arr;
|
|
11235
|
-
}
|
|
11236
|
-
draw(ctx){
|
|
11237
|
-
if(this.cache.config.rendered){
|
|
11238
|
-
ctx.save();
|
|
11239
|
-
this.applyNormalStyle(ctx);
|
|
11240
|
-
ctx.beginPath();
|
|
11241
|
-
this.path.moveTo(this.points[1][0]+this._x,this.points[1][1]+this._y);
|
|
11242
|
-
for(let i=1;i<this.points.length;i++){
|
|
11243
|
-
this.path.lineTo(this.points[i][0]+this._x,this.points[i][1]+this._y);
|
|
11244
|
-
}
|
|
11245
|
-
ctx.stroke(this.path);
|
|
11246
|
-
ctx.restore();
|
|
11247
|
-
}
|
|
11248
|
-
return this;
|
|
11249
|
-
}
|
|
11250
|
-
fromXY(X,Y){
|
|
11251
|
-
this.pointsMatrix=matrix([X,Y]);
|
|
11252
|
-
return this;
|
|
11253
|
-
}
|
|
11254
|
-
push(ptsX,ptsY){
|
|
11255
|
-
this.pointsMatrix.hstack(matrix([ptsX,ptsY]));
|
|
11256
|
-
if(this.parent)this.parent.draw();
|
|
11257
|
-
return this;
|
|
11258
|
-
}
|
|
11259
|
-
isIn(x,y){
|
|
11260
|
-
let is;
|
|
11261
|
-
if(this.parent){
|
|
11262
|
-
this.parent.ctx.setTransform(1,0,0,1,0,0);
|
|
11263
|
-
is=this.parent.ctx.isPointInPath(this.path,x,y);
|
|
11264
|
-
this.parent.applyTransformMatrix();
|
|
11265
|
-
}
|
|
11266
|
-
return is;
|
|
11267
|
-
}
|
|
11268
|
-
}
|
|
11269
|
-
|
|
11270
|
-
const canvasPoints=(ptsX=[],ptsY=[])=>new CanvasPoints(ptsX,ptsY);
|
|
11271
|
-
|
|
11272
|
-
class CanvasLine extends ZikoCanvasElement{
|
|
11273
|
-
constructor(x0,y0,x1,y1){
|
|
11274
|
-
super();
|
|
11275
|
-
this.x0=x0;
|
|
11276
|
-
this.x1=x1;
|
|
11277
|
-
this.y0=y0;
|
|
11278
|
-
this.y1=y1;
|
|
11279
|
-
delete this.fill;
|
|
11280
|
-
}
|
|
11281
|
-
draw(ctx){
|
|
11282
|
-
if(this.cache.config.rendered){
|
|
11283
|
-
ctx.save();
|
|
11284
|
-
this.applyNormalStyle(ctx);
|
|
11285
|
-
ctx.beginPath();
|
|
11286
|
-
ctx.moveTo(this.x0+this._x,this.y0+this._y_);
|
|
11287
|
-
ctx.lineTo(this.x1+this._x,this.y1+this._y);
|
|
11288
|
-
ctx.stroke();
|
|
11289
|
-
if(this.cache.style.normal.strokeEnabled)ctx.stroke();
|
|
11290
|
-
ctx.restore();
|
|
11291
|
-
}
|
|
11292
|
-
return this;
|
|
11293
|
-
}
|
|
11294
|
-
}
|
|
11295
|
-
const canvasLine=(x0,y0,x1,y1)=>new CanvasLine(x0,y0,x1,y1);
|
|
11296
|
-
|
|
11297
|
-
class CanvasRect extends ZikoCanvasElement{
|
|
11298
|
-
constructor(x,y,w,h){
|
|
11299
|
-
super(x,y);
|
|
11300
|
-
this.w=w;
|
|
11301
|
-
this.h=h;
|
|
11302
|
-
this.path=new Path2D();
|
|
11303
|
-
}
|
|
11304
|
-
draw(ctx){
|
|
11305
|
-
if(this.cache.config.rendered){
|
|
11306
|
-
ctx.save();
|
|
11307
|
-
this.applyNormalStyle(ctx);
|
|
11308
|
-
ctx.beginPath();
|
|
11309
|
-
this.path.rect(this.px, this.py,this.w,this.h);
|
|
11310
|
-
const{strokeEnabled,fillEnabled}=this.cache.style.normal;
|
|
11311
|
-
if(strokeEnabled)ctx.stroke(this.path);
|
|
11312
|
-
if(fillEnabled)ctx.fill(this.path);
|
|
11313
|
-
ctx.closePath();
|
|
11314
|
-
ctx.restore();
|
|
11315
|
-
}
|
|
11316
|
-
return this;
|
|
11317
|
-
}
|
|
11318
|
-
width(w){
|
|
11319
|
-
this.w=w;
|
|
11320
|
-
if(this.parent)this.parent.draw();
|
|
11321
|
-
return this;
|
|
11322
|
-
}
|
|
11323
|
-
height(h){
|
|
11324
|
-
this.h=h;
|
|
11325
|
-
if(this.parent)this.parent.draw();
|
|
11326
|
-
return this;
|
|
11327
|
-
}
|
|
11328
|
-
// distanceFromCenter(x,y){
|
|
11329
|
-
// return Math.sqrt(
|
|
11330
|
-
// (this.position.x-x)**2-(this.position.y-y)**2
|
|
11331
|
-
// )
|
|
11332
|
-
// }
|
|
11333
|
-
// isIn(x,y,strict=false){
|
|
11334
|
-
// return strict?this.distanceFromCenter(x,y)<this.r:this.distanceFromCenter(x,y)<=this.r;
|
|
11335
|
-
// }
|
|
11336
|
-
// isInEdges(x,y){
|
|
11337
|
-
// return this.distanceFromCenter(x,y)===this.r;
|
|
11338
|
-
// }
|
|
11339
|
-
}
|
|
11340
|
-
const canvasRect=(x,y,w,h)=>new CanvasRect(x,y,w,h);
|
|
11341
|
-
|
|
11342
8675
|
var CANVAS = /*#__PURE__*/Object.freeze({
|
|
11343
8676
|
__proto__: null,
|
|
11344
8677
|
Canvas: Canvas,
|
|
11345
|
-
ZikoUICanvas: ZikoUICanvas
|
|
11346
|
-
canvasArc: canvasArc,
|
|
11347
|
-
canvasCircle: canvasCircle,
|
|
11348
|
-
canvasLine: canvasLine,
|
|
11349
|
-
canvasPoints: canvasPoints,
|
|
11350
|
-
canvasRect: canvasRect
|
|
8678
|
+
ZikoUICanvas: ZikoUICanvas
|
|
11351
8679
|
});
|
|
11352
8680
|
|
|
11353
8681
|
const Graphics = {
|
|
@@ -11652,7 +8980,7 @@
|
|
|
11652
8980
|
constructor({head, wrapper, target, routes}){
|
|
11653
8981
|
super({head, wrapper, target});
|
|
11654
8982
|
this.routes=new Map([
|
|
11655
|
-
["404",text
|
|
8983
|
+
["404",text("Error 404")],
|
|
11656
8984
|
...Object.entries(routes)
|
|
11657
8985
|
]);
|
|
11658
8986
|
this.clear();
|
|
@@ -11732,6 +9060,7 @@
|
|
|
11732
9060
|
}
|
|
11733
9061
|
|
|
11734
9062
|
const __UI__={};
|
|
9063
|
+
const __HYDRATION_MAP__ = new Map();
|
|
11735
9064
|
const __Config__={
|
|
11736
9065
|
default:{
|
|
11737
9066
|
target:null,
|
|
@@ -11745,12 +9074,15 @@
|
|
|
11745
9074
|
const values=Object.values(pairs);
|
|
11746
9075
|
for(let i=0;i<keys.length;i++)this.default[keys[i]]=values[i];
|
|
11747
9076
|
},
|
|
11748
|
-
init:()=>document.documentElement.setAttribute("data-engine","zikojs")
|
|
9077
|
+
init:()=>document.documentElement.setAttribute("data-engine","zikojs"),
|
|
9078
|
+
renderingMode :"spa",
|
|
9079
|
+
isSSC : false,
|
|
11749
9080
|
};
|
|
11750
9081
|
|
|
11751
9082
|
var Global = /*#__PURE__*/Object.freeze({
|
|
11752
9083
|
__proto__: null,
|
|
11753
9084
|
__Config__: __Config__,
|
|
9085
|
+
__HYDRATION_MAP__: __HYDRATION_MAP__,
|
|
11754
9086
|
__UI__: __UI__
|
|
11755
9087
|
});
|
|
11756
9088
|
|
|
@@ -11850,6 +9182,7 @@
|
|
|
11850
9182
|
globalThis.__Ziko__={
|
|
11851
9183
|
...Ziko,
|
|
11852
9184
|
__UI__,
|
|
9185
|
+
__HYDRATION_MAP__,
|
|
11853
9186
|
__Config__,
|
|
11854
9187
|
ExtractAll,
|
|
11855
9188
|
RemoveAll
|
|
@@ -11884,24 +9217,18 @@
|
|
|
11884
9217
|
Data.RemoveAll();
|
|
11885
9218
|
}
|
|
11886
9219
|
|
|
11887
|
-
exports.Accordion = Accordion;
|
|
11888
9220
|
exports.App = App$1;
|
|
11889
9221
|
exports.Article = Article;
|
|
11890
9222
|
exports.Aside = Aside;
|
|
11891
9223
|
exports.Base = Base;
|
|
11892
|
-
exports.Breadcrumbs = Breadcrumbs;
|
|
11893
9224
|
exports.Canvas = Canvas;
|
|
11894
|
-
exports.Carousel = Carousel;
|
|
11895
|
-
exports.CodeCell = CodeCell;
|
|
11896
|
-
exports.CodeNote = CodeNote;
|
|
11897
|
-
exports.Collapsible = Collapsible;
|
|
11898
9225
|
exports.Combinaison = Combinaison;
|
|
11899
9226
|
exports.Complex = Complex;
|
|
11900
9227
|
exports.E = E;
|
|
11901
9228
|
exports.EPSILON = EPSILON;
|
|
11902
9229
|
exports.Ease = Ease;
|
|
11903
9230
|
exports.FileBasedRouting = FileBasedRouting;
|
|
11904
|
-
exports.Flex = Flex
|
|
9231
|
+
exports.Flex = Flex;
|
|
11905
9232
|
exports.Footer = Footer;
|
|
11906
9233
|
exports.Form = Form;
|
|
11907
9234
|
exports.Grid = Grid$1;
|
|
@@ -11911,7 +9238,6 @@
|
|
|
11911
9238
|
exports.Logic = Logic$1;
|
|
11912
9239
|
exports.Main = Main;
|
|
11913
9240
|
exports.Matrix = Matrix;
|
|
11914
|
-
exports.Modal = Modal;
|
|
11915
9241
|
exports.Nav = Nav;
|
|
11916
9242
|
exports.PI = PI$1;
|
|
11917
9243
|
exports.Permutation = Permutation;
|
|
@@ -11919,13 +9245,10 @@
|
|
|
11919
9245
|
exports.SPA = SPA;
|
|
11920
9246
|
exports.SVGWrapper = SVGWrapper;
|
|
11921
9247
|
exports.Section = Section;
|
|
11922
|
-
exports.Slider = Slider;
|
|
11923
|
-
exports.Splitter = Splitter;
|
|
11924
9248
|
exports.Str = Str;
|
|
11925
9249
|
exports.Suspense = Suspense;
|
|
11926
9250
|
exports.Svg = Svg;
|
|
11927
9251
|
exports.Table = Table$1;
|
|
11928
|
-
exports.Tabs = Tabs;
|
|
11929
9252
|
exports.Utils = Utils$1;
|
|
11930
9253
|
exports.ZikoApp = ZikoApp;
|
|
11931
9254
|
exports.ZikoCustomEvent = ZikoCustomEvent;
|
|
@@ -11943,40 +9266,24 @@
|
|
|
11943
9266
|
exports.ZikoJsonStyleSheet = ZikoJsonStyleSheet;
|
|
11944
9267
|
exports.ZikoMutationObserver = ZikoMutationObserver;
|
|
11945
9268
|
exports.ZikoSPA = ZikoSPA;
|
|
11946
|
-
exports.ZikoSvgCircle = ZikoSvgCircle;
|
|
11947
|
-
exports.ZikoSvgEllipse = ZikoSvgEllipse;
|
|
11948
|
-
exports.ZikoSvgForeignObject = ZikoSvgForeignObject;
|
|
11949
|
-
exports.ZikoSvgGroupe = ZikoSvgGroupe;
|
|
11950
|
-
exports.ZikoSvgImage = ZikoSvgImage;
|
|
11951
|
-
exports.ZikoSvgLine = ZikoSvgLine;
|
|
11952
|
-
exports.ZikoSvgLink = ZikoSvgLink;
|
|
11953
|
-
exports.ZikoSvgPath = ZikoSvgPath;
|
|
11954
|
-
exports.ZikoSvgRectangle = ZikoSvgRectangle;
|
|
11955
|
-
exports.ZikoSvgText = ZikoSvgText;
|
|
11956
9269
|
exports.ZikoUIAbbrText = ZikoUIAbbrText;
|
|
11957
|
-
exports.ZikoUIAccordion = ZikoUIAccordion;
|
|
11958
9270
|
exports.ZikoUIArticle = ZikoUIArticle;
|
|
11959
9271
|
exports.ZikoUIAside = ZikoUIAside;
|
|
11960
9272
|
exports.ZikoUIAudio = ZikoUIAudio;
|
|
11961
9273
|
exports.ZikoUIBlockQuote = ZikoUIBlockQuote;
|
|
11962
9274
|
exports.ZikoUIBr = ZikoUIBr;
|
|
11963
|
-
exports.ZikoUIBreadcrumbs = ZikoUIBreadcrumbs;
|
|
11964
9275
|
exports.ZikoUICanvas = ZikoUICanvas;
|
|
11965
|
-
exports.ZikoUICodeNote = ZikoUICodeNote;
|
|
11966
9276
|
exports.ZikoUICodeText = ZikoUICodeText;
|
|
11967
|
-
exports.ZikoUIContainerElement = ZikoUIContainerElement;
|
|
11968
9277
|
exports.ZikoUIDefintion = ZikoUIDefintion;
|
|
11969
9278
|
exports.ZikoUIElement = ZikoUIElement;
|
|
11970
9279
|
exports.ZikoUIFigure = ZikoUIFigure;
|
|
11971
|
-
exports.ZikoUIFlex = ZikoUIFlex
|
|
9280
|
+
exports.ZikoUIFlex = ZikoUIFlex;
|
|
11972
9281
|
exports.ZikoUIFooter = ZikoUIFooter;
|
|
11973
9282
|
exports.ZikoUIForm = ZikoUIForm;
|
|
11974
9283
|
exports.ZikoUIGrid = ZikoUIGrid;
|
|
11975
9284
|
exports.ZikoUIHTMLWrapper = ZikoUIHTMLWrapper;
|
|
11976
9285
|
exports.ZikoUIHeader = ZikoUIHeader;
|
|
11977
9286
|
exports.ZikoUIHeading = ZikoUIHeading;
|
|
11978
|
-
exports.ZikoUIHorizontalSlider = ZikoUIHorizontalSlider;
|
|
11979
|
-
exports.ZikoUIHorizontalSplitter = ZikoUIHorizontalSplitter;
|
|
11980
9287
|
exports.ZikoUIHr = ZikoUIHr;
|
|
11981
9288
|
exports.ZikoUIHtmlTag = ZikoUIHtmlTag;
|
|
11982
9289
|
exports.ZikoUIImage = ZikoUIImage;
|
|
@@ -11998,8 +9305,6 @@
|
|
|
11998
9305
|
exports.ZikoUILabel = ZikoUILabel;
|
|
11999
9306
|
exports.ZikoUILink = ZikoUILink;
|
|
12000
9307
|
exports.ZikoUIMain = ZikoUIMain;
|
|
12001
|
-
exports.ZikoUIMenu3d = ZikoUIMenu3d;
|
|
12002
|
-
exports.ZikoUIModal = ZikoUIModal;
|
|
12003
9308
|
exports.ZikoUINav = ZikoUINav;
|
|
12004
9309
|
exports.ZikoUIParagraphe = ZikoUIParagraphe;
|
|
12005
9310
|
exports.ZikoUIQuote = ZikoUIQuote;
|
|
@@ -12012,13 +9317,12 @@
|
|
|
12012
9317
|
exports.ZikoUISvg = ZikoUISvg;
|
|
12013
9318
|
exports.ZikoUIText = ZikoUIText;
|
|
12014
9319
|
exports.ZikoUITextArea = ZikoUITextArea;
|
|
12015
|
-
exports.ZikoUIVerticalSlider = ZikoUIVerticalSlider;
|
|
12016
|
-
exports.ZikoUIVerticalSplitter = ZikoUIVerticalSplitter;
|
|
12017
9320
|
exports.ZikoUIVideo = ZikoUIVideo;
|
|
12018
9321
|
exports.ZikoUIXMLWrapper = ZikoUIXMLWrapper;
|
|
12019
9322
|
exports.ZikoUseRoot = ZikoUseRoot;
|
|
12020
9323
|
exports.ZikoUseStyle = ZikoUseStyle;
|
|
12021
9324
|
exports.__Config__ = __Config__;
|
|
9325
|
+
exports.__HYDRATION_MAP__ = __HYDRATION_MAP__;
|
|
12022
9326
|
exports.__UI__ = __UI__;
|
|
12023
9327
|
exports.abbrText = abbrText;
|
|
12024
9328
|
exports.abs = abs;
|
|
@@ -12027,7 +9331,6 @@
|
|
|
12027
9331
|
exports.acosh = acosh;
|
|
12028
9332
|
exports.acot = acot;
|
|
12029
9333
|
exports.add = add;
|
|
12030
|
-
exports.adoc2html = adoc2html;
|
|
12031
9334
|
exports.arange = arange;
|
|
12032
9335
|
exports.arr2str = arr2str;
|
|
12033
9336
|
exports.asin = asin;
|
|
@@ -12042,11 +9345,6 @@
|
|
|
12042
9345
|
exports.br = br;
|
|
12043
9346
|
exports.brs = brs;
|
|
12044
9347
|
exports.btn = btn;
|
|
12045
|
-
exports.canvasArc = canvasArc;
|
|
12046
|
-
exports.canvasCircle = canvasCircle;
|
|
12047
|
-
exports.canvasLine = canvasLine;
|
|
12048
|
-
exports.canvasPoints = canvasPoints;
|
|
12049
|
-
exports.canvasRect = canvasRect;
|
|
12050
9348
|
exports.cartesianProduct = cartesianProduct;
|
|
12051
9349
|
exports.ceil = ceil;
|
|
12052
9350
|
exports.checkbox = checkbox;
|
|
@@ -12067,7 +9365,6 @@
|
|
|
12067
9365
|
exports.csv2matrix = csv2matrix;
|
|
12068
9366
|
exports.csv2object = csv2object;
|
|
12069
9367
|
exports.csv2sql = csv2sql;
|
|
12070
|
-
exports.dangerAlert = dangerAlert;
|
|
12071
9368
|
exports.datalist = datalist;
|
|
12072
9369
|
exports.default = Ziko;
|
|
12073
9370
|
exports.defineParamsGetter = defineParamsGetter;
|
|
@@ -12087,8 +9384,6 @@
|
|
|
12087
9384
|
exports.h4 = h4;
|
|
12088
9385
|
exports.h5 = h5;
|
|
12089
9386
|
exports.h6 = h6;
|
|
12090
|
-
exports.hSlider = hSlider;
|
|
12091
|
-
exports.hSplitter = hSplitter;
|
|
12092
9387
|
exports.hTags = hTags;
|
|
12093
9388
|
exports.hr = hr;
|
|
12094
9389
|
exports.hrs = hrs;
|
|
@@ -12096,7 +9391,6 @@
|
|
|
12096
9391
|
exports.hypot = hypot;
|
|
12097
9392
|
exports.image = image;
|
|
12098
9393
|
exports.inRange = inRange;
|
|
12099
|
-
exports.infoAlert = infoAlert;
|
|
12100
9394
|
exports.input = input;
|
|
12101
9395
|
exports.inputCamera = inputCamera;
|
|
12102
9396
|
exports.inputColor = inputColor;
|
|
@@ -12126,13 +9420,11 @@
|
|
|
12126
9420
|
exports.luDecomposition = luDecomposition;
|
|
12127
9421
|
exports.map = map;
|
|
12128
9422
|
exports.mapfun = mapfun$1;
|
|
12129
|
-
exports.markdown2html = markdown2html;
|
|
12130
9423
|
exports.matrix = matrix;
|
|
12131
9424
|
exports.matrix2 = matrix2;
|
|
12132
9425
|
exports.matrix3 = matrix3;
|
|
12133
9426
|
exports.matrix4 = matrix4;
|
|
12134
9427
|
exports.max = max;
|
|
12135
|
-
exports.menu3d = menu3d;
|
|
12136
9428
|
exports.min = min;
|
|
12137
9429
|
exports.modulo = modulo;
|
|
12138
9430
|
exports.mul = mul;
|
|
@@ -12171,34 +9463,20 @@
|
|
|
12171
9463
|
exports.sub = sub;
|
|
12172
9464
|
exports.subSet = subSet;
|
|
12173
9465
|
exports.subText = subText;
|
|
12174
|
-
exports.successAlert = successAlert;
|
|
12175
9466
|
exports.sum = sum;
|
|
12176
9467
|
exports.supText = supText;
|
|
12177
9468
|
exports.svg2ascii = svg2ascii;
|
|
12178
9469
|
exports.svg2img = svg2img;
|
|
12179
9470
|
exports.svg2imgUrl = svg2imgUrl;
|
|
12180
9471
|
exports.svg2str = svg2str;
|
|
12181
|
-
exports.svgCircle = svgCircle;
|
|
12182
|
-
exports.svgEllipse = svgEllipse;
|
|
12183
|
-
exports.svgGrid = svgGrid;
|
|
12184
|
-
exports.svgGroupe = svgGroupe;
|
|
12185
|
-
exports.svgImage = svgImage;
|
|
12186
|
-
exports.svgLine = svgLine;
|
|
12187
|
-
exports.svgLink = svgLink;
|
|
12188
|
-
exports.svgObject = svgObject;
|
|
12189
|
-
exports.svgPath = svgPath;
|
|
12190
|
-
exports.svgPolygon = svgPolygon;
|
|
12191
|
-
exports.svgRect = svgRect;
|
|
12192
|
-
exports.svgText = svgText;
|
|
12193
9472
|
exports.tan = tan;
|
|
12194
9473
|
exports.tanh = tanh;
|
|
12195
|
-
exports.text = text
|
|
9474
|
+
exports.text = text;
|
|
12196
9475
|
exports.textarea = textarea;
|
|
12197
9476
|
exports.timeTaken = timeTaken;
|
|
12198
9477
|
exports.time_memory_Taken = time_memory_Taken;
|
|
12199
9478
|
exports.ul = ul;
|
|
12200
9479
|
exports.useAnimation = useAnimation;
|
|
12201
|
-
exports.useBattery = useBattery;
|
|
12202
9480
|
exports.useChannel = useChannel$1;
|
|
12203
9481
|
exports.useClickEvent = useClickEvent;
|
|
12204
9482
|
exports.useClipboardEvent = useClipboardEvent;
|
|
@@ -12210,7 +9488,6 @@
|
|
|
12210
9488
|
exports.useFavIcon = useFavIcon$1;
|
|
12211
9489
|
exports.useFocusEvent = useFocusEvent;
|
|
12212
9490
|
exports.useFps = useFps;
|
|
12213
|
-
exports.useGeolocation = useGeolocation;
|
|
12214
9491
|
exports.useHashEvent = useHashEvent;
|
|
12215
9492
|
exports.useHead = useHead$1;
|
|
12216
9493
|
exports.useInputEvent = useInputEvent;
|
|
@@ -12232,13 +9509,10 @@
|
|
|
12232
9509
|
exports.useTitle = useTitle$1;
|
|
12233
9510
|
exports.useType = useType;
|
|
12234
9511
|
exports.useWheelEvent = useWheelEvent;
|
|
12235
|
-
exports.vSlider = vSlider;
|
|
12236
|
-
exports.vSplitter = vSplitter;
|
|
12237
9512
|
exports.video = video;
|
|
12238
9513
|
exports.wait = wait;
|
|
12239
9514
|
exports.waitForUIElm = waitForUIElm;
|
|
12240
9515
|
exports.waitForUIElmSync = waitForUIElmSync;
|
|
12241
|
-
exports.warningAlert = warningAlert;
|
|
12242
9516
|
exports.watch = watch;
|
|
12243
9517
|
exports.watchAttr = watchAttr;
|
|
12244
9518
|
exports.watchChildren = watchChildren;
|