@opengis/admin 0.3.67 → 0.3.69
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/assets/images/eye.svg +4 -0
- package/dist/assets/images/file-up.svg +6 -0
- package/package.json +2 -2
- package/server/helpers/core/buttonFilePreview.js +13 -0
- package/server/helpers/index.js +3 -0
- package/server/helpers/utils/buttonDownload.js +3 -0
- package/server/helpers/utils/buttonPreview.js +3 -0
@@ -0,0 +1,4 @@
|
|
1
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M1.3335 8C1.3335 8 3.3335 3.33333 8.00016 3.33333C12.6668 3.33333 14.6668 8 14.6668 8C14.6668 8 12.6668 12.6667 8.00016 12.6667C3.3335 12.6667 1.3335 8 1.3335 8Z" stroke="#6B7280" stroke-linecap="round" stroke-linejoin="round"/>
|
3
|
+
<path d="M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z" stroke="#6B7280" stroke-linecap="round" stroke-linejoin="round"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,6 @@
|
|
1
|
+
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M8.45837 1.16666H3.50004C3.19062 1.16666 2.89388 1.28957 2.67508 1.50837C2.45629 1.72716 2.33337 2.0239 2.33337 2.33332V11.6667C2.33337 11.9761 2.45629 12.2728 2.67508 12.4916C2.89388 12.7104 3.19062 12.8333 3.50004 12.8333H10.5C10.8095 12.8333 11.1062 12.7104 11.325 12.4916C11.5438 12.2728 11.6667 11.9761 11.6667 11.6667V4.37499L8.45837 1.16666Z" stroke="#2563EB" stroke-linecap="round" stroke-linejoin="round"/>
|
3
|
+
<path d="M8.16663 1.16666V4.66666H11.6666" stroke="#2563EB" stroke-linecap="round" stroke-linejoin="round"/>
|
4
|
+
<path d="M7 7V10.5" stroke="#2563EB" stroke-linecap="round" stroke-linejoin="round"/>
|
5
|
+
<path d="M8.75 8.75L7 7L5.25 8.75" stroke="#2563EB" stroke-linecap="round" stroke-linejoin="round"/>
|
6
|
+
</svg>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@opengis/admin",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.69",
|
4
4
|
"description": "This project Softpro Admin",
|
5
5
|
"main": "dist/admin.js",
|
6
6
|
"type": "module",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"@fullcalendar/vue3": "^6.1.15",
|
49
49
|
"@opengis/fastify-auth": "1.0.80",
|
50
50
|
"@opengis/fastify-file": "1.0.66",
|
51
|
-
"@opengis/fastify-table": "1.3.
|
51
|
+
"@opengis/fastify-table": "^1.3.28",
|
52
52
|
"@opengis/v3-core": "^0.3.126",
|
53
53
|
"@opengis/v3-filter": "^0.0.72",
|
54
54
|
"@tiptap/core": "^2.8.0",
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
import buttonPreview from '../utils/buttonPreview.js';
|
3
|
+
import buttonDownload from '../utils/buttonDownload.js';
|
4
|
+
|
5
|
+
export default function buttonFilePreviewHelper(data, options = {}) {
|
6
|
+
const { hash } = options;
|
7
|
+
if (typeof data !== 'string') return 'wrong input data type';
|
8
|
+
if (!data) return 'filepath empty';
|
9
|
+
|
10
|
+
const preview = buttonPreview(data);
|
11
|
+
const download = buttonDownload(data);
|
12
|
+
return `<div class='flex gap-x-2'>${hash?.action === 'download' ? '' : preview}${hash?.action === 'preview' ? '' : download}</div>`;
|
13
|
+
}
|
package/server/helpers/index.js
CHANGED
@@ -5,6 +5,7 @@ import token from "./core/token.js";
|
|
5
5
|
import descriptionList from "./list/descriptionList.js";
|
6
6
|
import tableList from "./list/tableList.js";
|
7
7
|
import buttonHelper from "./core/buttonHelper.js";
|
8
|
+
import buttonFilePreview from "./core/buttonFilePreview.js";
|
8
9
|
import select from "./core/select.js";
|
9
10
|
import badge from "./core/badge.js";
|
10
11
|
import coalesce from "./core/coalesce.js";
|
@@ -24,6 +25,8 @@ export default async function route() {
|
|
24
25
|
handlebars.registerHelper('descriptionList', descriptionList);
|
25
26
|
handlebars.registerHelper('tableList', tableList);
|
26
27
|
handlebars.registerHelper('button', buttonHelper);
|
28
|
+
handlebars.registerHelper('buttonFilePreview', buttonFilePreview);
|
29
|
+
handlebarsSync.registerHelper('buttonFilePreview', buttonFilePreview);
|
27
30
|
handlebars.registerHelper('select', select);
|
28
31
|
handlebars.registerHelper('badge', badge);
|
29
32
|
handlebars.registerHelper('contentList', contentList);
|
@@ -0,0 +1,3 @@
|
|
1
|
+
export default function buttonDownload(filepath) {
|
2
|
+
return `<a download=1 class="flex items-center gap-x-2 border py-2 px-3 shadow rounded-xl cursor-pointer w-[42px] y-[34px]" href="${filepath}" target="_blank"><img src="/public/assets/images/file-up.svg" alt="generate"></a>`;
|
3
|
+
}
|