@opengis/fastify-table 1.1.49 → 1.1.51
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/.eslintrc.cjs +42 -42
- package/.gitlab-ci.yml +18 -0
- package/Changelog.md +352 -351
- package/cron/funcs/addCron.js +132 -132
- package/crud/controllers/deleteCrud.js +36 -31
- package/crud/controllers/insert.js +71 -70
- package/crud/controllers/update.js +76 -73
- package/crud/funcs/dataDelete.js +19 -19
- package/crud/funcs/dataInsert.js +30 -30
- package/crud/funcs/dataUpdate.js +48 -48
- package/crud/funcs/getAccess.js +46 -56
- package/crud/funcs/getOpt.js +10 -10
- package/crud/funcs/setOpt.js +16 -16
- package/crud/funcs/setToken.js +2 -2
- package/crud/funcs/utils/getFolder.js +9 -9
- package/crud/funcs/utils/logChanges.js +62 -62
- package/crud/index.js +36 -36
- package/docs/.vitepress/abbr.mjs +26 -26
- package/docs/.vitepress/config.mjs +127 -127
- package/docs/.vitepress/navigation.mjs +82 -82
- package/docs/.vitepress/theme/Layout.vue +17 -17
- package/docs/.vitepress/theme/components/NavigationLinks.vue +102 -102
- package/docs/.vitepress/theme/components/Panzoom.vue +169 -169
- package/docs/.vitepress/theme/index.mjs +15 -15
- package/docs/.vitepress/theme/style.scss +163 -163
- package/docs/abbr.json +4 -4
- package/docs/api/cron/cronApi.md +56 -56
- package/docs/api/crud/deleteCrud.md +58 -58
- package/docs/api/crud/insert.md +82 -82
- package/docs/api/crud/update.md +85 -85
- package/docs/api/index.md +47 -47
- package/docs/api/notification/testEmail.md +91 -91
- package/docs/api/table/card.md +73 -73
- package/docs/api/table/data.md +134 -134
- package/docs/api/table/export.md +60 -60
- package/docs/api/table/filter.md +104 -104
- package/docs/api/table/form.md +126 -126
- package/docs/api/table/search.md +123 -123
- package/docs/api/table/suggest.md +156 -156
- package/docs/api/table/table.md +107 -107
- package/docs/api/user/user.cls.id.md +77 -77
- package/docs/api/user/user.cls.md +49 -49
- package/docs/api/user/user.cls.post.md +62 -62
- package/docs/api/user/user.info.md +37 -37
- package/docs/api/utils/logger.file.md +60 -60
- package/docs/api/utils/next.id.md +34 -34
- package/docs/api/utils/properties.add.md +127 -127
- package/docs/api/utils/properties.get.md +73 -73
- package/docs/api/utils/status.monitor.md +36 -36
- package/docs/api/widget/widget.del.md +76 -76
- package/docs/api/widget/widget.get.md +233 -233
- package/docs/api/widget/widget.set.md +88 -88
- package/docs/db/admin.md +947 -947
- package/docs/db/crm.md +564 -564
- package/docs/db/index.md +9 -9
- package/docs/db/log.md +204 -204
- package/docs/hook/card/afterCard.md +20 -20
- package/docs/hook/card/preCard.md +25 -25
- package/docs/hook/data/afterData.md +26 -26
- package/docs/hook/data/preData.md +26 -26
- package/docs/hook/deleteCrud/afterDelete.md +21 -21
- package/docs/hook/deleteCrud/preDelete.md +26 -26
- package/docs/hook/form/afterForm.md +19 -19
- package/docs/hook/form/preForm.md +26 -26
- package/docs/hook/getTemplate/afterTemplate.md +24 -24
- package/docs/hook/getTemplate/preTemplate.md +29 -29
- package/docs/hook/index.md +45 -45
- package/docs/hook/insert/afterInsert.md +41 -41
- package/docs/hook/insert/preInsert.md +25 -25
- package/docs/hook/table/afterTable.md +20 -20
- package/docs/hook/table/preTable.md +25 -25
- package/docs/hook/update/afterUpdate.md +41 -41
- package/docs/hook/update/preUpdate.md +25 -25
- package/docs/index.md +42 -42
- package/docs/public/fastify-dark.svg +3 -3
- package/docs/public/logo-short-dark.svg +11 -11
- package/docs/public/logo-short.svg +10 -10
- package/docs/public/logo.svg +19 -19
- package/docs/readme/index.md +121 -121
- package/docs/templates/card.md +83 -83
- package/docs/templates/cls.md +29 -29
- package/docs/templates/filters.md +91 -91
- package/docs/templates/forms.md +139 -139
- package/docs/templates/index.md +28 -28
- package/docs/templates/select.md +90 -90
- package/docs/templates/table.md +162 -162
- package/docs/utils/cron/addCron.md +29 -29
- package/docs/utils/crud/dataInsert.md +51 -51
- package/docs/utils/crud/dataUpdate.md +52 -52
- package/docs/utils/crud/getOpt.md +33 -33
- package/docs/utils/crud/isFileExists.md +37 -37
- package/docs/utils/crud/setOpt.md +37 -37
- package/docs/utils/hook/addHook.md +74 -74
- package/docs/utils/hook/applyHook.md +64 -64
- package/docs/utils/index.md +47 -47
- package/docs/utils/notification/addNotification.md +28 -28
- package/docs/utils/notification/notification.md +41 -41
- package/docs/utils/pg/autoIndex.md +22 -22
- package/docs/utils/pg/getMeta.md +58 -58
- package/docs/utils/pg/getPG.md +34 -34
- package/docs/utils/pg/init.md +29 -29
- package/docs/utils/pg/pg.md +70 -70
- package/docs/utils/redis/getRedis.md +36 -36
- package/docs/utils/redis/rclient.md +74 -74
- package/docs/utils/table/getForm.md +68 -68
- package/docs/utils/table/getMeta.md +55 -55
- package/docs/utils/table/getSelect.md +38 -38
- package/docs/utils/table/getSelectMeta.md +46 -46
- package/docs/utils/table/getTable.md +77 -77
- package/helper.js +30 -30
- package/index.js +105 -105
- package/migration/exec.migrations.js +79 -79
- package/module/core/select/core.user_mentioned.sql +1 -1
- package/module/test/cls/itree.composition.json +25 -25
- package/module/test/table/test.rest_zone.table.json +265 -265
- package/notification/controllers/readNotifications.js +30 -30
- package/notification/controllers/testEmail.js +50 -50
- package/notification/controllers/userNotifications.js +64 -64
- package/notification/funcs/addNotification.js +21 -21
- package/notification/funcs/sendNotification.js +112 -112
- package/package.json +42 -41
- package/pg/funcs/getMeta.js +29 -29
- package/pg/funcs/getPG.js +30 -30
- package/pg/pgClients.js +20 -20
- package/policy/funcs/checkPolicy.js +92 -92
- package/policy/funcs/sqlInjection.js +33 -33
- package/policy/index.js +14 -14
- package/redis/client.js +8 -8
- package/redis/funcs/redisClients.js +2 -2
- package/redis/index.js +19 -19
- package/server/migrations/0.sql +78 -78
- package/server/migrations/cls.sql +39 -39
- package/server/migrations/properties.sql +144 -144
- package/server/migrations/roles.sql +172 -166
- package/server/migrations/users.sql +168 -168
- package/server.js +26 -26
- package/table/controllers/data.js +150 -134
- package/table/controllers/filter.js +50 -50
- package/table/controllers/form.js +42 -42
- package/table/controllers/search.js +80 -80
- package/table/controllers/suggest.js +79 -79
- package/table/controllers/table.js +83 -79
- package/table/controllers/utils/addTemplateDir.js +8 -8
- package/table/controllers/utils/getSelect.js +19 -19
- package/table/controllers/utils/getSelectMeta.js +66 -66
- package/table/controllers/utils/getTemplate_old.js +28 -28
- package/table/controllers/utils/getTemplates.js +18 -18
- package/table/controllers/utils/gisIRColumn.js +67 -67
- package/table/controllers/utils/loadTemplate.js +1 -1
- package/table/controllers/utils/loadTemplatePath.js +1 -1
- package/table/controllers/utils/userTemplateDir.js +1 -1
- package/table/funcs/getFilterSQL/index.js +94 -94
- package/table/funcs/getFilterSQL/util/formatValue.js +170 -170
- package/table/funcs/getFilterSQL/util/getCustomQuery.js +13 -13
- package/table/funcs/getFilterSQL/util/getFilterQuery.js +66 -66
- package/table/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -12
- package/table/funcs/getFilterSQL/util/getTableSql.js +34 -34
- package/table/funcs/metaFormat/getSelectVal.js +21 -21
- package/table/funcs/metaFormat/index.js +28 -28
- package/table/index.js +37 -84
- package/table/schema.js +54 -0
- package/test/api/applyHook.test.js +95 -95
- package/test/api/crud.test.js +89 -89
- package/test/api/crud.xss.test.js +80 -80
- package/test/api/suggest.test.js +66 -66
- package/test/api/table.test.js +134 -134
- package/test/api/user.test.js +85 -85
- package/test/api/widget.test.js +117 -117
- package/test/helper/formatDate.test.js +62 -62
- package/test/templates/select/test.storage.data.json +3 -3
- package/test/templates/select/test.suggest.ato_new.json +3 -3
- package/test/templates/select/test.suggest.ato_new.sql +25 -25
- package/test/templates/select/test.suggest.data.json +4 -4
- package/test/templates/select/test.suggest.parent.sql +1 -1
- package/user/controllers/user.cls.id.js +14 -14
- package/user/controllers/user.cls.js +75 -75
- package/user/controllers/user.cls.post.js +55 -55
- package/user/controllers/user.info.js +21 -21
- package/util/controllers/logger.file.js +91 -91
- package/util/controllers/properties.add.js +60 -60
- package/util/controllers/status.monitor.js +8 -8
- package/util/controllers/utils/checkUserAccess.js +17 -17
- package/util/controllers/utils/getRootDir.js +25 -25
- package/utils.js +104 -104
- package/widget/controllers/utils/historyFormat.js +76 -76
- package/widget/controllers/utils/obj2db.js +13 -13
- package/widget/controllers/widget.del.js +44 -44
- package/widget/controllers/widget.get.js +102 -102
- package/widget/controllers/widget.set.js +79 -79
- package/widget/index.js +40 -40
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { onMounted, nextTick, watch } from 'vue';
|
|
3
|
-
import { useRouter } from 'vitepress';
|
|
4
|
-
import Panzoom from '@panzoom/panzoom';
|
|
5
|
-
|
|
6
|
-
const { route } = useRouter();
|
|
7
|
-
|
|
8
|
-
onMounted(() => createPanzoom());
|
|
9
|
-
|
|
10
|
-
watch(
|
|
11
|
-
() => route.path,
|
|
12
|
-
async () => {
|
|
13
|
-
await nextTick();
|
|
14
|
-
|
|
15
|
-
createPanzoom();
|
|
16
|
-
},
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
function createPanzoom() {
|
|
20
|
-
document.querySelectorAll('img[alt = "zoom"], .mermaid').forEach(async (m) => {
|
|
21
|
-
if (m.panzoom) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const wrapper = document.createElement('div');
|
|
26
|
-
wrapper.classList.add('mermaid-wrapper');
|
|
27
|
-
|
|
28
|
-
m.before(wrapper);
|
|
29
|
-
|
|
30
|
-
wrapper.appendChild(m);
|
|
31
|
-
|
|
32
|
-
await nextTick();
|
|
33
|
-
|
|
34
|
-
const pz = Panzoom(m, {
|
|
35
|
-
maxScale: 20,
|
|
36
|
-
minScale: 0.5,
|
|
37
|
-
canvas: true,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
m.panzoom = pz;
|
|
41
|
-
|
|
42
|
-
wrapper.appendChild(createActions(pz, wrapper, m));
|
|
43
|
-
wrapper.addEventListener('wheel', pz.zoomWithWheel);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function createActions(panzoom, wrapper, mermaid) {
|
|
48
|
-
const actions = document.createElement('div');
|
|
49
|
-
actions.classList.add('mermaid-wrapper__actions');
|
|
50
|
-
|
|
51
|
-
actions.appendChild(createZoomIn(panzoom, wrapper, mermaid));
|
|
52
|
-
actions.appendChild(createZoomOut(panzoom, wrapper, mermaid));
|
|
53
|
-
actions.appendChild(createZoomRestore(panzoom, wrapper, mermaid));
|
|
54
|
-
actions.appendChild(createFullScreenToggler(panzoom, wrapper, mermaid));
|
|
55
|
-
|
|
56
|
-
return actions;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function createZoomIn(panzoom, wrapper, mermaid) {
|
|
60
|
-
const zoomIn = document.createElement('div');
|
|
61
|
-
|
|
62
|
-
zoomIn.classList.add('mermaid-wrapper__action');
|
|
63
|
-
zoomIn.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
|
|
64
|
-
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 5l0 14" /><path d="M5 12l14 0" /></svg>`;
|
|
65
|
-
|
|
66
|
-
zoomIn.onclick = () => {
|
|
67
|
-
panzoom.zoomIn();
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
return zoomIn;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function createZoomOut(panzoom, wrapper, mermaid) {
|
|
74
|
-
const zoomOut = document.createElement('div');
|
|
75
|
-
|
|
76
|
-
zoomOut.classList.add('mermaid-wrapper__action');
|
|
77
|
-
zoomOut.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
|
|
78
|
-
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /></svg>`;
|
|
79
|
-
|
|
80
|
-
zoomOut.onclick = () => {
|
|
81
|
-
panzoom.zoomOut();
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
return zoomOut;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function createZoomRestore(panzoom, wrapper, mermaid) {
|
|
88
|
-
const zoomRestore = document.createElement('div');
|
|
89
|
-
|
|
90
|
-
zoomRestore.classList.add('mermaid-wrapper__action');
|
|
91
|
-
zoomRestore.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
|
|
92
|
-
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M21 21l-6 -6" />
|
|
93
|
-
<path d="M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403" /><path d="M3 4v4h4" /></svg>`;
|
|
94
|
-
|
|
95
|
-
zoomRestore.onclick = () => {
|
|
96
|
-
panzoom.reset();
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return zoomRestore;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function createFullScreenToggler(panzoom, wrapper, mermaid) {
|
|
103
|
-
const fullScreenToggler = document.createElement('div');
|
|
104
|
-
|
|
105
|
-
fullScreenToggler.classList.add('mermaid-wrapper__action');
|
|
106
|
-
fullScreenToggler.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
|
|
107
|
-
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 8v-2a2 2 0 0 1 2 -2h2" />
|
|
108
|
-
<path d="M4 16v2a2 2 0 0 0 2 2h2" /><path d="M16 4h2a2 2 0 0 1 2 2v2" /><path d="M16 20h2a2 2 0 0 0 2 -2v-2" /></svg>`;
|
|
109
|
-
|
|
110
|
-
fullScreenToggler.onclick = () => {
|
|
111
|
-
panzoom.reset({ animate: false });
|
|
112
|
-
wrapper.classList.toggle('is-fullscreen');
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return fullScreenToggler;
|
|
116
|
-
}
|
|
117
|
-
</script>
|
|
118
|
-
|
|
119
|
-
<template>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<style lang="scss">
|
|
123
|
-
.mermaid-wrapper {
|
|
124
|
-
display: block;
|
|
125
|
-
min-height: 168px;
|
|
126
|
-
overflow: hidden;
|
|
127
|
-
position: relative;
|
|
128
|
-
background: var(--vp-c-bg);
|
|
129
|
-
|
|
130
|
-
&__actions {
|
|
131
|
-
position: absolute;
|
|
132
|
-
z-index: 10;
|
|
133
|
-
right: 16px;
|
|
134
|
-
bottom: 16px;
|
|
135
|
-
display: flex;
|
|
136
|
-
flex-direction: column;
|
|
137
|
-
gap: 8px;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&__action {
|
|
141
|
-
display: inline-flex;
|
|
142
|
-
align-items: center;
|
|
143
|
-
justify-content: center;
|
|
144
|
-
text-align: center;
|
|
145
|
-
font-weight: 600;
|
|
146
|
-
color: var(--vp-button-alt-hover-text);
|
|
147
|
-
background-color: var(--vp-button-alt-hover-bg);
|
|
148
|
-
border-radius: 4px;
|
|
149
|
-
padding: 4px;
|
|
150
|
-
line-height: 1;
|
|
151
|
-
white-space: nowrap;
|
|
152
|
-
cursor: pointer;
|
|
153
|
-
|
|
154
|
-
& > * {
|
|
155
|
-
display: block;
|
|
156
|
-
width: 20px;
|
|
157
|
-
height: 20px;
|
|
158
|
-
font-size: 20px;
|
|
159
|
-
line-height: 1;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
&.is-fullscreen {
|
|
164
|
-
position: fixed;
|
|
165
|
-
z-index: 1000;
|
|
166
|
-
inset: 0;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
</style>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted, nextTick, watch } from 'vue';
|
|
3
|
+
import { useRouter } from 'vitepress';
|
|
4
|
+
import Panzoom from '@panzoom/panzoom';
|
|
5
|
+
|
|
6
|
+
const { route } = useRouter();
|
|
7
|
+
|
|
8
|
+
onMounted(() => createPanzoom());
|
|
9
|
+
|
|
10
|
+
watch(
|
|
11
|
+
() => route.path,
|
|
12
|
+
async () => {
|
|
13
|
+
await nextTick();
|
|
14
|
+
|
|
15
|
+
createPanzoom();
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
function createPanzoom() {
|
|
20
|
+
document.querySelectorAll('img[alt = "zoom"], .mermaid').forEach(async (m) => {
|
|
21
|
+
if (m.panzoom) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const wrapper = document.createElement('div');
|
|
26
|
+
wrapper.classList.add('mermaid-wrapper');
|
|
27
|
+
|
|
28
|
+
m.before(wrapper);
|
|
29
|
+
|
|
30
|
+
wrapper.appendChild(m);
|
|
31
|
+
|
|
32
|
+
await nextTick();
|
|
33
|
+
|
|
34
|
+
const pz = Panzoom(m, {
|
|
35
|
+
maxScale: 20,
|
|
36
|
+
minScale: 0.5,
|
|
37
|
+
canvas: true,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
m.panzoom = pz;
|
|
41
|
+
|
|
42
|
+
wrapper.appendChild(createActions(pz, wrapper, m));
|
|
43
|
+
wrapper.addEventListener('wheel', pz.zoomWithWheel);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function createActions(panzoom, wrapper, mermaid) {
|
|
48
|
+
const actions = document.createElement('div');
|
|
49
|
+
actions.classList.add('mermaid-wrapper__actions');
|
|
50
|
+
|
|
51
|
+
actions.appendChild(createZoomIn(panzoom, wrapper, mermaid));
|
|
52
|
+
actions.appendChild(createZoomOut(panzoom, wrapper, mermaid));
|
|
53
|
+
actions.appendChild(createZoomRestore(panzoom, wrapper, mermaid));
|
|
54
|
+
actions.appendChild(createFullScreenToggler(panzoom, wrapper, mermaid));
|
|
55
|
+
|
|
56
|
+
return actions;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function createZoomIn(panzoom, wrapper, mermaid) {
|
|
60
|
+
const zoomIn = document.createElement('div');
|
|
61
|
+
|
|
62
|
+
zoomIn.classList.add('mermaid-wrapper__action');
|
|
63
|
+
zoomIn.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
|
|
64
|
+
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M12 5l0 14" /><path d="M5 12l14 0" /></svg>`;
|
|
65
|
+
|
|
66
|
+
zoomIn.onclick = () => {
|
|
67
|
+
panzoom.zoomIn();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return zoomIn;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function createZoomOut(panzoom, wrapper, mermaid) {
|
|
74
|
+
const zoomOut = document.createElement('div');
|
|
75
|
+
|
|
76
|
+
zoomOut.classList.add('mermaid-wrapper__action');
|
|
77
|
+
zoomOut.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
|
|
78
|
+
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" /></svg>`;
|
|
79
|
+
|
|
80
|
+
zoomOut.onclick = () => {
|
|
81
|
+
panzoom.zoomOut();
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return zoomOut;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function createZoomRestore(panzoom, wrapper, mermaid) {
|
|
88
|
+
const zoomRestore = document.createElement('div');
|
|
89
|
+
|
|
90
|
+
zoomRestore.classList.add('mermaid-wrapper__action');
|
|
91
|
+
zoomRestore.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
|
|
92
|
+
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M21 21l-6 -6" />
|
|
93
|
+
<path d="M3.268 12.043a7.017 7.017 0 0 0 6.634 4.957a7.012 7.012 0 0 0 7.043 -6.131a7 7 0 0 0 -5.314 -7.672a7.021 7.021 0 0 0 -8.241 4.403" /><path d="M3 4v4h4" /></svg>`;
|
|
94
|
+
|
|
95
|
+
zoomRestore.onclick = () => {
|
|
96
|
+
panzoom.reset();
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return zoomRestore;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function createFullScreenToggler(panzoom, wrapper, mermaid) {
|
|
103
|
+
const fullScreenToggler = document.createElement('div');
|
|
104
|
+
|
|
105
|
+
fullScreenToggler.classList.add('mermaid-wrapper__action');
|
|
106
|
+
fullScreenToggler.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
|
|
107
|
+
stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 8v-2a2 2 0 0 1 2 -2h2" />
|
|
108
|
+
<path d="M4 16v2a2 2 0 0 0 2 2h2" /><path d="M16 4h2a2 2 0 0 1 2 2v2" /><path d="M16 20h2a2 2 0 0 0 2 -2v-2" /></svg>`;
|
|
109
|
+
|
|
110
|
+
fullScreenToggler.onclick = () => {
|
|
111
|
+
panzoom.reset({ animate: false });
|
|
112
|
+
wrapper.classList.toggle('is-fullscreen');
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
return fullScreenToggler;
|
|
116
|
+
}
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<template>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<style lang="scss">
|
|
123
|
+
.mermaid-wrapper {
|
|
124
|
+
display: block;
|
|
125
|
+
min-height: 168px;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
position: relative;
|
|
128
|
+
background: var(--vp-c-bg);
|
|
129
|
+
|
|
130
|
+
&__actions {
|
|
131
|
+
position: absolute;
|
|
132
|
+
z-index: 10;
|
|
133
|
+
right: 16px;
|
|
134
|
+
bottom: 16px;
|
|
135
|
+
display: flex;
|
|
136
|
+
flex-direction: column;
|
|
137
|
+
gap: 8px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&__action {
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
text-align: center;
|
|
145
|
+
font-weight: 600;
|
|
146
|
+
color: var(--vp-button-alt-hover-text);
|
|
147
|
+
background-color: var(--vp-button-alt-hover-bg);
|
|
148
|
+
border-radius: 4px;
|
|
149
|
+
padding: 4px;
|
|
150
|
+
line-height: 1;
|
|
151
|
+
white-space: nowrap;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
|
|
154
|
+
& > * {
|
|
155
|
+
display: block;
|
|
156
|
+
width: 20px;
|
|
157
|
+
height: 20px;
|
|
158
|
+
font-size: 20px;
|
|
159
|
+
line-height: 1;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&.is-fullscreen {
|
|
164
|
+
position: fixed;
|
|
165
|
+
z-index: 1000;
|
|
166
|
+
inset: 0;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
// https://vitepress.dev/guide/custom-theme
|
|
2
|
-
import DefaultTheme from 'vitepress/theme';
|
|
3
|
-
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client';
|
|
4
|
-
import './style.scss';
|
|
5
|
-
//import "@tabler/icons-webfont/tabler-icons.css";
|
|
6
|
-
import Layout from './Layout.vue';
|
|
7
|
-
|
|
8
|
-
/** @type {import('vitepress').Theme} */
|
|
9
|
-
export default {
|
|
10
|
-
extends: DefaultTheme,
|
|
11
|
-
Layout: Layout,
|
|
12
|
-
enhanceApp({ app, router, siteData }) {
|
|
13
|
-
enhanceAppWithTabs(app);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
1
|
+
// https://vitepress.dev/guide/custom-theme
|
|
2
|
+
import DefaultTheme from 'vitepress/theme';
|
|
3
|
+
import { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client';
|
|
4
|
+
import './style.scss';
|
|
5
|
+
//import "@tabler/icons-webfont/tabler-icons.css";
|
|
6
|
+
import Layout from './Layout.vue';
|
|
7
|
+
|
|
8
|
+
/** @type {import('vitepress').Theme} */
|
|
9
|
+
export default {
|
|
10
|
+
extends: DefaultTheme,
|
|
11
|
+
Layout: Layout,
|
|
12
|
+
enhanceApp({ app, router, siteData }) {
|
|
13
|
+
enhanceAppWithTabs(app);
|
|
14
|
+
}
|
|
15
|
+
};
|