@thzero/library_client_svelte 0.15.8 → 0.15.9
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/boot/baseServices.js +4 -4
- package/boot/baseValidation.js +1 -1
- package/boot/basei18n.js +3 -3
- package/boot/main.js +2 -6
- package/package.json +5 -4
- package/service/event.js +2 -2
- package/service/router.js +4 -4
- package/service/store.js +2 -2
- package/service/translate.js +2 -2
package/boot/baseServices.js
CHANGED
|
@@ -13,19 +13,19 @@ class SvelteBaseServices extends BaseServices {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
_initializeEvent(injector) {
|
|
16
|
-
return new eventService(
|
|
16
|
+
return new eventService();
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
_initializeRouter(injector) {
|
|
20
|
-
return new routerService(
|
|
20
|
+
return new routerService();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
_initializeStore(injector) {
|
|
24
|
-
return new storeService(
|
|
24
|
+
return new storeService();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
_initializeTranslate(injector) {
|
|
28
|
-
return new translateService(
|
|
28
|
+
return new translateService();
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
package/boot/baseValidation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class BaseValidate {
|
|
2
2
|
// eslint-disable-next-line
|
|
3
|
-
async execute(
|
|
3
|
+
async execute(framework, app, store) {
|
|
4
4
|
// extend('decimal', {
|
|
5
5
|
// validate: (value, { decimals = '*', separator = '.' } = {}) => {
|
|
6
6
|
// if (value === null || value === undefined || value === '') {
|
package/boot/basei18n.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { init, getLocaleFromNavigator, register,
|
|
1
|
+
import { init, getLocaleFromNavigator, register, format, addMessages, unwrapFunctionStore } from 'svelte-i18n';
|
|
2
2
|
|
|
3
3
|
import GlobalUtility from '@thzero/library_client/utility/global';
|
|
4
4
|
|
|
@@ -8,14 +8,14 @@ import NotImplementedError from '@thzero/library_common/errors/notImplemented';
|
|
|
8
8
|
|
|
9
9
|
class SvelteBasei18n extends Basei18n {
|
|
10
10
|
// eslint-disable-next-line
|
|
11
|
-
async execute(framework, app,
|
|
11
|
+
async execute(framework, app, store) {
|
|
12
12
|
this._initMessages(register, addMessages);
|
|
13
13
|
|
|
14
14
|
init({
|
|
15
15
|
fallbackLocale: 'en',
|
|
16
16
|
initialLocale: getLocaleFromNavigator()
|
|
17
17
|
});
|
|
18
|
-
GlobalUtility.$trans = { t:
|
|
18
|
+
GlobalUtility.$trans = { t: unwrapFunctionStore(format) };
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
_initMessages(register) {
|
package/boot/main.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import GlobalUtility from '@thzero/library_client/utility/global';
|
|
2
2
|
|
|
3
|
+
// @ts-ignore
|
|
3
4
|
import {} from '@thzero/library_common/utility/string';
|
|
4
5
|
|
|
5
6
|
// eslint-disable-next-line
|
|
6
|
-
async function start(app,
|
|
7
|
+
async function start(app, storeRequest, bootFiles, starter) {
|
|
7
8
|
let store = null;
|
|
8
9
|
if (storeRequest) {
|
|
9
10
|
try {
|
|
@@ -18,8 +19,6 @@ async function start(app, router, storeRequest, bootFiles, starter) {
|
|
|
18
19
|
if (!store)
|
|
19
20
|
throw Error('Unable to create store.');
|
|
20
21
|
GlobalUtility.$store = store;
|
|
21
|
-
|
|
22
|
-
GlobalUtility.$navRouter = router;
|
|
23
22
|
|
|
24
23
|
if (bootFiles && (bootFiles.length > 0)) {
|
|
25
24
|
let obj;
|
|
@@ -30,7 +29,6 @@ async function start(app, router, storeRequest, bootFiles, starter) {
|
|
|
30
29
|
try {
|
|
31
30
|
try {
|
|
32
31
|
await bootFile({
|
|
33
|
-
router,
|
|
34
32
|
store
|
|
35
33
|
});
|
|
36
34
|
continue;
|
|
@@ -38,7 +36,6 @@ async function start(app, router, storeRequest, bootFiles, starter) {
|
|
|
38
36
|
catch (err) {
|
|
39
37
|
obj = new bootFile();
|
|
40
38
|
await obj.execute(
|
|
41
|
-
router,
|
|
42
39
|
store
|
|
43
40
|
);
|
|
44
41
|
continue;
|
|
@@ -65,7 +62,6 @@ async function start(app, router, storeRequest, bootFiles, starter) {
|
|
|
65
62
|
|
|
66
63
|
try {
|
|
67
64
|
const result = starter({
|
|
68
|
-
router,
|
|
69
65
|
store
|
|
70
66
|
});
|
|
71
67
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thzero/library_client_svelte",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.9",
|
|
4
4
|
"version_major": 0,
|
|
5
5
|
"version_minor": 15,
|
|
6
|
-
"version_patch":
|
|
7
|
-
"version_date": "12/
|
|
6
|
+
"version_patch": 9,
|
|
7
|
+
"version_date": "12/15/2022",
|
|
8
8
|
"description": "An opinionated library of common functionality to bootstrap a Svelte based SPA application.",
|
|
9
9
|
"author": "thZero",
|
|
10
10
|
"license": "MIT",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"@thzero/library_client": "^0.16",
|
|
25
25
|
"@thzero/library_common": "^0.16",
|
|
26
26
|
"mitt": "^3.0.0",
|
|
27
|
-
"svelte-i18n": "^3.6.0"
|
|
27
|
+
"svelte-i18n": "^3.6.0",
|
|
28
|
+
"svelte-spa-router": "^3.3.0"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
31
|
"svelte": "^3"
|
package/service/event.js
CHANGED
|
@@ -2,11 +2,11 @@ import GlobalUtility from '@thzero/library_client/utility/global';
|
|
|
2
2
|
|
|
3
3
|
import EventService from '@thzero/library_client/service/event';
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class SvelteEventService extends EventService {
|
|
6
6
|
// eslint-disable-next-line
|
|
7
7
|
emit(channel, value) {
|
|
8
8
|
GlobalUtility.$EventBus.emit(channel, value);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export default
|
|
12
|
+
export default SvelteEventService;
|
package/service/router.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { navigateTo } from 'svelte-router-spa';
|
|
2
2
|
|
|
3
3
|
import RouterService from '@thzero/library_client/service/router';
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class SvelteRouterService extends RouterService {
|
|
6
6
|
// eslint-disable-next-line
|
|
7
7
|
route(path, options) {
|
|
8
|
-
|
|
8
|
+
navigateTo(path);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export default
|
|
12
|
+
export default SvelteRouterService;
|
package/service/store.js
CHANGED
|
@@ -2,10 +2,10 @@ import GlobalUtility from '@thzero/library_client/utility/global';
|
|
|
2
2
|
|
|
3
3
|
import Service from '@thzero/library_client/service/index';
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class SvelteStoreService extends Service {
|
|
6
6
|
get store() {
|
|
7
7
|
return GlobalUtility.$store;
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
export default
|
|
11
|
+
export default SvelteStoreService;
|
package/service/translate.js
CHANGED
|
@@ -2,11 +2,11 @@ import GlobalUtility from '@thzero/library_client/utility/global';
|
|
|
2
2
|
|
|
3
3
|
import TranslateService from '@thzero/library_client/service/translate';
|
|
4
4
|
|
|
5
|
-
class
|
|
5
|
+
class SvelteTranslateService extends TranslateService {
|
|
6
6
|
// eslint-disable-next-line
|
|
7
7
|
translate(correlationId, id) {
|
|
8
8
|
return GlobalUtility.$trans.t(id);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export default
|
|
12
|
+
export default SvelteTranslateService;
|