eservices-core 1.0.397 → 1.0.399
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.
|
@@ -28,7 +28,7 @@ declare class ApplicationManager extends EventEmitter {
|
|
|
28
28
|
organizations: ICustomerContext[];
|
|
29
29
|
set ready(v: boolean);
|
|
30
30
|
get ready(): boolean;
|
|
31
|
-
onReady(callback: () => any): () => void;
|
|
31
|
+
onReady(callback: (v: boolean) => any): () => void;
|
|
32
32
|
onupdateContext(callback: (id: number) => any): () => void;
|
|
33
33
|
onupdateData(callback: () => any): () => void;
|
|
34
34
|
/**
|
|
@@ -14,6 +14,8 @@ export default function useCustomerState(): {
|
|
|
14
14
|
readonly email?: string;
|
|
15
15
|
readonly photo?: string;
|
|
16
16
|
}[];
|
|
17
|
+
readonly ready: boolean;
|
|
17
18
|
};
|
|
18
19
|
currentContext: import("vue").ComputedRef<ICustomerContext>;
|
|
20
|
+
isPerson: import("vue").ComputedRef<boolean>;
|
|
19
21
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* eservices-core v1.0.
|
|
2
|
+
* eservices-core v1.0.399
|
|
3
3
|
* (c) 2022 ESERVICES
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -6316,7 +6316,7 @@ function Filter(filters) {
|
|
|
6316
6316
|
* @param {String} folder name of folder witch include file. Default value is images (More useful folder)
|
|
6317
6317
|
*/
|
|
6318
6318
|
function staticLink(filename, folder = 'images') {
|
|
6319
|
-
return `/static-folder/${folder}/${filename}
|
|
6319
|
+
return `/static-folder/${folder}/${filename}`;
|
|
6320
6320
|
}
|
|
6321
6321
|
|
|
6322
6322
|
function useFormMetadata(form, rules, id) {
|
|
@@ -6488,7 +6488,8 @@ function useCustomerState() {
|
|
|
6488
6488
|
const state = vue.reactive({
|
|
6489
6489
|
contextId: Manager.contextId,
|
|
6490
6490
|
person: Manager.person,
|
|
6491
|
-
organizations: Manager.organizations
|
|
6491
|
+
organizations: Manager.organizations,
|
|
6492
|
+
ready: Manager.ready
|
|
6492
6493
|
});
|
|
6493
6494
|
const currentContext = vue.computed(() => {
|
|
6494
6495
|
if (!Manager.ready)
|
|
@@ -6500,6 +6501,7 @@ function useCustomerState() {
|
|
|
6500
6501
|
return Manager.person;
|
|
6501
6502
|
return Manager.organizations.find(org => org.id === id) || null;
|
|
6502
6503
|
});
|
|
6504
|
+
const isPerson = vue.computed(() => { var _a; return state.contextId === ((_a = state.person) === null || _a === void 0 ? void 0 : _a.id); });
|
|
6503
6505
|
Manager.onupdateContext((v) => {
|
|
6504
6506
|
state.contextId = v;
|
|
6505
6507
|
});
|
|
@@ -6507,9 +6509,13 @@ function useCustomerState() {
|
|
|
6507
6509
|
state.person = Manager.person;
|
|
6508
6510
|
state.organizations = Manager.organizations;
|
|
6509
6511
|
});
|
|
6512
|
+
Manager.onReady((v) => {
|
|
6513
|
+
state.ready = v;
|
|
6514
|
+
});
|
|
6510
6515
|
return {
|
|
6511
6516
|
state: vue.readonly(state),
|
|
6512
|
-
currentContext
|
|
6517
|
+
currentContext,
|
|
6518
|
+
isPerson
|
|
6513
6519
|
};
|
|
6514
6520
|
}
|
|
6515
6521
|
|