@opengis/gis 0.1.26 → 0.1.27
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/import-file.cjs +138 -138
- package/dist/import-file.css +1 -1
- package/dist/import-file.js +11955 -13041
- package/module/gis/card/gis.maps.table/index.yml +1 -1
- package/module/gis/card/gis.metadata.table/index.yml +1 -1
- package/module/gis/card/gis.rasters.table/index.yml +1 -1
- package/module/gis/card/gis.registers.table/index.yml +1 -1
- package/module/gis/card/gis.services.table/index.yml +1 -1
- package/module/gis/table/gis.metadata.table.json +70 -70
- package/package.json +2 -2
- package/plugin.js +0 -2
- package/server/helpers/core/badge.js +0 -17
- package/server/helpers/core/buttonFilePreview.js +0 -13
- package/server/helpers/core/buttonHelper.js +0 -21
- package/server/helpers/core/coalesce.js +0 -8
- package/server/helpers/core/select.js +0 -48
- package/server/helpers/core/token.js +0 -19
- package/server/helpers/index.js +0 -43
- package/server/helpers/list/buttonHelper.js +0 -21
- package/server/helpers/list/descriptionList.js +0 -46
- package/server/helpers/list/tableList.js +0 -86
- package/server/helpers/list/utils/button.js +0 -6
- package/server/helpers/list/utils/buttonDel.js +0 -13
- package/server/helpers/list/utils/buttonEdit.js +0 -15
- package/server/helpers/temp/contentList.js +0 -58
- package/server/helpers/temp/ifCond.js +0 -101
- package/server/helpers/utils/button.js +0 -6
- package/server/helpers/utils/buttonAdd.js +0 -7
- package/server/helpers/utils/buttonDel.js +0 -26
- package/server/helpers/utils/buttonDownload.js +0 -3
- package/server/helpers/utils/buttonEdit.js +0 -19
- package/server/helpers/utils/buttonPreview.js +0 -3
- package/server/helpers/utils/mdToHTML.js +0 -17
- package/server/helpers/utils/paddingNumber.js +0 -4
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Перетинає два масиви
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* // returns [1, 4, 5, 6]
|
|
6
|
-
* intersect([1,2,3,4,5,6],[1,4,5,6,7,8,9,11])
|
|
7
|
-
* @param {Array} a
|
|
8
|
-
* @param {Array} b
|
|
9
|
-
* @returns {Array} Returns new intersect array
|
|
10
|
-
*/
|
|
11
|
-
function intersect(a, b) {
|
|
12
|
-
let aN = a; let bN = b;
|
|
13
|
-
if (b.length > a.length) {
|
|
14
|
-
[aN, bN] = [bN, aN];
|
|
15
|
-
}
|
|
16
|
-
return aN.filter((e) => bN.includes(e));
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Створення шаблона або його частини внаслідок перевірки значення із веб-запиту та заздалегідь прописаного значення.
|
|
21
|
-
* Дозволяє змінювати наповнення сторінки через ряд перевірок. Є можливість внесення додаткової умови - що робити, коли умова не виконується.
|
|
22
|
-
*
|
|
23
|
-
* @summary Перевірка двох значень та виконання коду при виконанні умови, а також у всіх інших випадках.
|
|
24
|
-
* @priority 5
|
|
25
|
-
* @alias ifCond
|
|
26
|
-
* @type helper
|
|
27
|
-
* @tag condition
|
|
28
|
-
* @example
|
|
29
|
-
* {{#ifCond @root.req.domain 'in' 'help.softpro.ua,123'}} {{select user.uid data="get_full_uid"}} {{^}} Умова не виконана {{/ifCond}}
|
|
30
|
-
* @example
|
|
31
|
-
* {{#ifCond "1234567890" 'in' @root.user.group_list}} 1=1 {{^}} uid='{{uid}}' {{/ifCond}}
|
|
32
|
-
* @example
|
|
33
|
-
* {{#ifCond 'debug' 'in' @root.setting.core.setting}}Умова виконана{{^}}Не виконана умова{{/ifCond}}
|
|
34
|
-
* @param {Array} args Параметри для значень і умов
|
|
35
|
-
* @param {Array} args[0]] Перше значення
|
|
36
|
-
* @param {Array} args[1]] Оператор
|
|
37
|
-
* @param {Array} args[2]] Друге значення
|
|
38
|
-
* @returns {String} Returns HTML
|
|
39
|
-
*/
|
|
40
|
-
export default function ifCond(v1, operator, v2, options) {
|
|
41
|
-
const __obj = this;
|
|
42
|
-
|
|
43
|
-
switch (operator) {
|
|
44
|
-
case '==':
|
|
45
|
-
return (v1 == v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
46
|
-
case '!=':
|
|
47
|
-
return (v1 != v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
48
|
-
case '===':
|
|
49
|
-
return (v1 === v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
50
|
-
case '!==':
|
|
51
|
-
return (v1 !== v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
52
|
-
case '&&':
|
|
53
|
-
return (v1 && v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
54
|
-
case '||':
|
|
55
|
-
return (v1 || v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
56
|
-
case '<':
|
|
57
|
-
return (v1 < v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
58
|
-
case '<=':
|
|
59
|
-
return (v1 <= v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
60
|
-
case '>':
|
|
61
|
-
return (v1 > v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
62
|
-
case '>=':
|
|
63
|
-
return (v1 >= v2) ? options.fn(__obj) : options.inverse(__obj);
|
|
64
|
-
case '&':
|
|
65
|
-
return intersect(v1, v2).length !== 0
|
|
66
|
-
? options.fn(__obj)
|
|
67
|
-
: options.inverse(__obj);
|
|
68
|
-
case '!~':
|
|
69
|
-
return (v1 || '').indexOf(v2) === -1
|
|
70
|
-
? options.fn(__obj)
|
|
71
|
-
: options.inverse(__obj);
|
|
72
|
-
case '~':
|
|
73
|
-
return (v1 || '').indexOf(v2) !== -1
|
|
74
|
-
? options.fn(__obj)
|
|
75
|
-
: options.inverse(__obj);
|
|
76
|
-
case 'period':
|
|
77
|
-
return (new Date(v1) < new Date() && new Date(v2) > new Date())
|
|
78
|
-
? options.fn(__obj)
|
|
79
|
-
: options.inverse(__obj);
|
|
80
|
-
case 'in': {
|
|
81
|
-
if (typeof v2 === 'string') v2 = v2.split(',').map(item => item.trim());
|
|
82
|
-
|
|
83
|
-
if (Array.isArray(v1)) {
|
|
84
|
-
return v1.some((value) => v2.includes(value.toString()))
|
|
85
|
-
? options.fn(__obj)
|
|
86
|
-
: options.inverse(__obj);
|
|
87
|
-
}
|
|
88
|
-
return v2.includes(v1?.toString())
|
|
89
|
-
? options.fn(__obj)
|
|
90
|
-
: options.inverse(__obj);
|
|
91
|
-
}
|
|
92
|
-
case 'not in': {
|
|
93
|
-
if (typeof v2 === 'string') v2 = v2.split(',').map(item => item.trim());
|
|
94
|
-
return !v2.includes(v1?.toString())
|
|
95
|
-
? options.fn(__obj)
|
|
96
|
-
: options.inverse(__obj);
|
|
97
|
-
}
|
|
98
|
-
default:
|
|
99
|
-
return options.inverse(__obj);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export default function button(token, title) {
|
|
4
|
-
return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
|
|
5
|
-
class="inline-flex items-center px-2 py-1 text-sm font-medium text-white duration-300 bg-blue-600 border border-transparent rounded-lg gap-x-2 hover:bg-blue-700 hover:text-white">${title || 'Редагувати'}</button>`;
|
|
6
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const newColor = 'blue'
|
|
4
|
-
export default function button(token, title) {
|
|
5
|
-
return `<button onclick="window.v3plugin.$form({ token: '${token}' })"
|
|
6
|
-
class="px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500">${title || 'Додати'}</button>`;
|
|
7
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
const newColor = 'red';
|
|
2
|
-
|
|
3
|
-
export default function button(token, title, icon) {
|
|
4
|
-
const apiCall = `window.v3plugin.$api({
|
|
5
|
-
api: '/api/table/${token}',
|
|
6
|
-
method: 'delete',
|
|
7
|
-
confirm: {
|
|
8
|
-
title: 'Підтвердити операцію',
|
|
9
|
-
text: 'Ви впевнені що хочете вилучити запис?',
|
|
10
|
-
cancel: 'Скасувати',
|
|
11
|
-
confirm: 'Виконати'
|
|
12
|
-
}
|
|
13
|
-
})`;
|
|
14
|
-
|
|
15
|
-
const buttonClass = icon
|
|
16
|
-
? `size-8 inline-flex justify-center items-center gap-x-2 rounded-e-lg border border-stone-200 bg-${newColor}-100 text-stone-800 shadow-sm hover:bg-${newColor}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700`
|
|
17
|
-
: `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500`;
|
|
18
|
-
|
|
19
|
-
const buttonContent = icon
|
|
20
|
-
? `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="${newColor}" class="size-3.5">
|
|
21
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>
|
|
22
|
-
</svg>`
|
|
23
|
-
: `${title || 'Вилучити'}`;
|
|
24
|
-
|
|
25
|
-
return `<button onclick="${apiCall}" class="${buttonClass}">${buttonContent}</button>`;
|
|
26
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
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="https://cdn.softpro.ua/assets/file-up.svg" alt="generate"></a>`;
|
|
3
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
const newColor = 'blue';
|
|
3
|
-
export default function button(token, title, icon) {
|
|
4
|
-
const formCall = `window.v3plugin.$form({ token: '${token}' })`;
|
|
5
|
-
|
|
6
|
-
const buttonClass = icon
|
|
7
|
-
? `size-8 inline-flex justify-center items-center gap-x-2 font-medium rounded-s-lg border border-stone-200 bg-${newColor}-100 text-stone-800 shadow-sm hover:bg-${newColor}-200 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-${newColor}-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700 `
|
|
8
|
-
: `px-2 py-1 inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border border-transparent hover:text-white ring-offset-white bg-${newColor}-100 text-${newColor}-500 hover:bg-${newColor}-500 focus:ring-${newColor}-500`;
|
|
9
|
-
|
|
10
|
-
const buttonContent = icon
|
|
11
|
-
? `<svg class="shrink-0 size-3.5" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="${newColor}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
12
|
-
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"></path>
|
|
13
|
-
<path d="m15 5 4 4"></path>
|
|
14
|
-
</svg>`
|
|
15
|
-
: `${title || 'Редагувати'}`;
|
|
16
|
-
|
|
17
|
-
return `<button onclick="${formCall}" class="${buttonClass}">${buttonContent}</button>`;
|
|
18
|
-
|
|
19
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import md from 'markdown-it';
|
|
2
|
-
|
|
3
|
-
const md1 = md({ html: true });
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Перетворення з файла readme.md до формату HTML.
|
|
7
|
-
* Потрабно вставити в хелпер шлях до файла або текст readme.md і за допомогою бібліотеки markdown-it перетвориться в HTML.
|
|
8
|
-
|
|
9
|
-
* @returns {String} Returns HTML
|
|
10
|
-
*/
|
|
11
|
-
export default function mdToHTML(data, options) {
|
|
12
|
-
// auto detect HTML or MD
|
|
13
|
-
// const result = md().render(data);
|
|
14
|
-
if (!data) return 'empty data';
|
|
15
|
-
const result = md1.render(data);
|
|
16
|
-
return result;
|
|
17
|
-
};
|