@simple-reporting/base 1.0.28 → 1.0.29
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/dev/package.json +1 -1
- package/livingdocs/040.Media/010.table/table.html +1 -1
- package/package.json +1 -1
- package/plugins/viteSrlPlugin.js +7 -1
- package/srl/.srl/composables/article.ts +16 -16
- package/srl/.srl/composables/articles.ts +7 -1
- package/srl/.srl/composables/index.ts +5 -0
- package/srl/.srl/composables/instance.ts +13 -0
- package/srl/.srl/composables/languageSwitch.ts +0 -3
- package/srl/.srl/plugins/initProject.ts +12 -1
- package/srl/.srl/utils/index.ts +3 -2
- package/srl/.srl/utils/uri.ts +38 -26
- /package/srl/.srl/utils/{camelCase.ts → string.ts} +0 -0
package/dev/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<div class="srl-table">
|
|
2
|
-
<srl-ld-table data-remove-from-xhtml="transient" data-remove-from-pdf="transient">
|
|
2
|
+
<srl-ld-table data-replace-tag="div" data-remove-from-xhtml="transient" data-remove-from-pdf="transient">
|
|
3
3
|
<div ref="wrapper" class="srl-table__container" doc-include="nswow-table">
|
|
4
4
|
<p class="srl-grid srl-paragraph">
|
|
5
5
|
<span class="srl-grid__inner srl-paragraph__text">
|
package/package.json
CHANGED
package/plugins/viteSrlPlugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { join
|
|
2
|
+
import { join } from 'node:path/posix';
|
|
3
3
|
import { execSync } from 'node:child_process';
|
|
4
4
|
import folders from '../scripts/folders.js';
|
|
5
5
|
import { beaver } from '../scripts/beaver.js';
|
|
@@ -77,11 +77,17 @@ function checkForUpdates() {
|
|
|
77
77
|
try {
|
|
78
78
|
if (!data.version) return;
|
|
79
79
|
|
|
80
|
+
/*
|
|
80
81
|
const tag = `v${data.version.split('.')[0]}-lts`;
|
|
81
82
|
|
|
82
83
|
const latest = execSync(`npm view ${packageName}@${tag} version`)
|
|
83
84
|
.toString()
|
|
84
85
|
.trim();
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
const latest = execSync(`npm view ${packageName} version`)
|
|
89
|
+
.toString()
|
|
90
|
+
.trim();
|
|
85
91
|
|
|
86
92
|
if (isVersionGreater(latest, data.version)) {
|
|
87
93
|
printPromptsMessage([
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { computed, type ComputedRef } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { useInstance } from '#composables/instance.ts'
|
|
3
3
|
import useArticles from './articles';
|
|
4
4
|
|
|
5
5
|
const articles = useArticles();
|
|
6
|
+
const instance = useInstance();
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
: undefined;
|
|
13
|
-
const article = !slug
|
|
14
|
-
? articles.value.find((article) => article.index)
|
|
15
|
-
: articles.value.find((article) => article.slug === slug);
|
|
8
|
+
const slug = computed(() => {
|
|
9
|
+
return instance.value?.config.globalProperties.$route?.params?.slug
|
|
10
|
+
? (instance.value?.config.globalProperties.$route?.params?.slug[0] as string)
|
|
11
|
+
: undefined;
|
|
12
|
+
});
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
const article = computed<NsWowArticle | undefined>(() => {
|
|
15
|
+
const slugValue = slug.value;
|
|
16
|
+
const a = articles.value
|
|
17
|
+
return !slugValue
|
|
18
|
+
? a.find((article) => article.index)
|
|
19
|
+
: a.find((article) => article.slug === slugValue);
|
|
20
|
+
});
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export default function useArticle(): ComputedRef<NsWowArticle | undefined> {
|
|
23
|
+
return article;
|
|
24
24
|
}
|
|
@@ -29,11 +29,17 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import { computed, type ComputedRef } from 'vue';
|
|
31
31
|
import useConfig from './config.ts';
|
|
32
|
+
import { useInstance } from '#composables/instance.ts';
|
|
32
33
|
|
|
33
34
|
const config = useConfig();
|
|
35
|
+
const instance = useInstance();
|
|
36
|
+
const locale = computed(() => instance.value?.config.globalProperties.$route.params.locale);
|
|
34
37
|
|
|
35
38
|
const articles = computed<NsWowArticle[]>(
|
|
36
|
-
() =>
|
|
39
|
+
() => {
|
|
40
|
+
const lang = locale.value || config.value.locale;
|
|
41
|
+
return config.value?.articles[lang] ?? [];
|
|
42
|
+
},
|
|
37
43
|
);
|
|
38
44
|
|
|
39
45
|
export default function useArticles(): ComputedRef<NsWowArticle[]> {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _instance from './instance';
|
|
1
2
|
import _useArticle from './article';
|
|
2
3
|
import _useArticles from './articles';
|
|
3
4
|
import _useConfig from './config';
|
|
@@ -10,6 +11,8 @@ import _useViewPort from './viewPort';
|
|
|
10
11
|
import _useLanguageSwitch from './languageSwitch';
|
|
11
12
|
import * as cssStyles from './cssStyles.ts'
|
|
12
13
|
|
|
14
|
+
export const setInstance = _instance.setInstance;
|
|
15
|
+
export const useInstance = _instance.useInstance;
|
|
13
16
|
export const useArticle = _useArticle;
|
|
14
17
|
export const useArticles = _useArticles;
|
|
15
18
|
export const useConfig = _useConfig;
|
|
@@ -24,6 +27,8 @@ export const addCssStyles = cssStyles.addCssStyles;
|
|
|
24
27
|
export const useCssStyles = cssStyles.useCssStyles;
|
|
25
28
|
|
|
26
29
|
export default {
|
|
30
|
+
setInstance,
|
|
31
|
+
useInstance,
|
|
27
32
|
useArticle,
|
|
28
33
|
useArticles,
|
|
29
34
|
useConfig,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { setConfig } from '#composables/config';
|
|
2
|
+
import { setInstance } from '#composables/instance.ts'
|
|
2
3
|
import { createApp } from 'vue';
|
|
3
4
|
import { initI18n } from '@/i18n';
|
|
4
5
|
import srlVuePlugin from '#plugins/vueSrlPlugin';
|
|
5
6
|
import { clearPageState } from '#utils'
|
|
7
|
+
import Translate from '@/i18n/translation.ts'
|
|
6
8
|
|
|
7
9
|
import '#imports/app.scss';
|
|
8
10
|
|
|
@@ -10,15 +12,24 @@ import SrlPageApp from '../App.vue';
|
|
|
10
12
|
import router from '@/router';
|
|
11
13
|
|
|
12
14
|
export default async function initProject() {
|
|
15
|
+
const config = await setConfig();
|
|
13
16
|
router.beforeEach((to, from, next) => {
|
|
14
17
|
clearPageState();
|
|
15
18
|
next();
|
|
16
19
|
});
|
|
17
|
-
|
|
20
|
+
router.afterEach(() => {
|
|
21
|
+
if (
|
|
22
|
+
router.currentRoute.value.params.locale
|
|
23
|
+
&& config.value.locale !== router.currentRoute.value.params.locale
|
|
24
|
+
) {
|
|
25
|
+
Translate.switchLanguage(router.currentRoute.value.params.locale as string);
|
|
26
|
+
}
|
|
27
|
+
})
|
|
18
28
|
const i18n = initI18n();
|
|
19
29
|
const app = (window.app = createApp(SrlPageApp));
|
|
20
30
|
app.use(i18n);
|
|
21
31
|
app.use(router);
|
|
22
32
|
app.use(srlVuePlugin);
|
|
33
|
+
setInstance(app);
|
|
23
34
|
return app;
|
|
24
35
|
}
|
package/srl/.srl/utils/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isRouterPath, isExternalPath } from './uri';
|
|
2
|
-
import { camelCase } from './
|
|
1
|
+
import { isFilePath, isRouterPath, isExternalPath } from './uri';
|
|
2
|
+
import { camelCase } from './string';
|
|
3
3
|
import { prepareHtmlContent } from './html';
|
|
4
4
|
import {
|
|
5
5
|
usePageState,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from './pageState.ts';
|
|
16
16
|
|
|
17
17
|
export {
|
|
18
|
+
isFilePath,
|
|
18
19
|
isRouterPath,
|
|
19
20
|
isExternalPath,
|
|
20
21
|
camelCase,
|
package/srl/.srl/utils/uri.ts
CHANGED
|
@@ -1,36 +1,47 @@
|
|
|
1
|
+
export function isFilePath(path: string): boolean {
|
|
2
|
+
return (
|
|
3
|
+
path.endsWith('.pdf') ||
|
|
4
|
+
path.endsWith('.doc') ||
|
|
5
|
+
path.endsWith('.docx') ||
|
|
6
|
+
path.endsWith('.xls') ||
|
|
7
|
+
path.endsWith('.xlsx') ||
|
|
8
|
+
path.endsWith('.ppt') ||
|
|
9
|
+
path.endsWith('.pptx') ||
|
|
10
|
+
path.endsWith('.zip') ||
|
|
11
|
+
path.endsWith('.html') ||
|
|
12
|
+
path.endsWith('.htm') ||
|
|
13
|
+
path.endsWith('.php') ||
|
|
14
|
+
path.endsWith('.asp') ||
|
|
15
|
+
path.endsWith('.aspx') ||
|
|
16
|
+
path.endsWith('.jsp') ||
|
|
17
|
+
path.endsWith('.xml') ||
|
|
18
|
+
path.endsWith('.json') ||
|
|
19
|
+
path.endsWith('.txt') ||
|
|
20
|
+
path.endsWith('.svg') ||
|
|
21
|
+
path.endsWith('.png') ||
|
|
22
|
+
path.endsWith('.jpg') ||
|
|
23
|
+
path.endsWith('.jpeg') ||
|
|
24
|
+
path.endsWith('.gif') ||
|
|
25
|
+
path.endsWith('.webp')
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
1
29
|
export function isRouterPath(path: string): boolean {
|
|
2
30
|
return (
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
!path
|
|
11
|
-
!path.endsWith('.jsp') &&
|
|
12
|
-
!path.endsWith('.xml') &&
|
|
13
|
-
!path.endsWith('.json') &&
|
|
14
|
-
!path.endsWith('.txt') &&
|
|
15
|
-
!path.endsWith('.svg') &&
|
|
16
|
-
!path.endsWith('.png') &&
|
|
17
|
-
!path.endsWith('.jpg') &&
|
|
18
|
-
!path.endsWith('.jpeg') &&
|
|
19
|
-
!path.endsWith('.gif') &&
|
|
20
|
-
!path.endsWith('.webp') &&
|
|
21
|
-
!path.endsWith('.pdf') &&
|
|
22
|
-
!path.endsWith('.doc') &&
|
|
23
|
-
!path.endsWith('.docx') &&
|
|
24
|
-
!path.endsWith('.xls') &&
|
|
25
|
-
!path.endsWith('.xlsx') &&
|
|
26
|
-
!path.endsWith('.ppt') &&
|
|
27
|
-
!path.endsWith('.pptx') &&
|
|
28
|
-
!path.endsWith('.zip')
|
|
31
|
+
(
|
|
32
|
+
(
|
|
33
|
+
path.startsWith('/') &&
|
|
34
|
+
!path.startsWith('//')
|
|
35
|
+
) ||
|
|
36
|
+
path.startsWith('./')
|
|
37
|
+
) &&
|
|
38
|
+
!isFilePath(path)
|
|
29
39
|
);
|
|
30
40
|
}
|
|
31
41
|
|
|
32
42
|
export function isExternalPath(path: string): boolean {
|
|
33
43
|
return (
|
|
44
|
+
isFilePath(path) ||
|
|
34
45
|
path.startsWith('http') ||
|
|
35
46
|
path.startsWith('//') ||
|
|
36
47
|
path.startsWith('mailto') ||
|
|
@@ -49,6 +60,7 @@ export function isExternalPath(path: string): boolean {
|
|
|
49
60
|
}
|
|
50
61
|
|
|
51
62
|
export default {
|
|
63
|
+
isFilePath,
|
|
52
64
|
isRouterPath,
|
|
53
65
|
isExternalPath,
|
|
54
66
|
};
|
|
File without changes
|