@openmrs/esm-framework 3.1.15-pre.744 → 3.1.15-pre.752
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/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.LICENSE.txt +2 -0
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +147 -351
- package/docs/interfaces/AssignedExtension.md +63 -0
- package/docs/interfaces/ConnectedExtension.md +3 -106
- package/docs/interfaces/ExtensionInfo.md +8 -8
- package/docs/interfaces/ExtensionInstance.md +1 -1
- package/docs/interfaces/ExtensionInternalStore.md +34 -0
- package/docs/interfaces/ExtensionProps.md +2 -2
- package/docs/interfaces/ExtensionRegistration.md +7 -9
- package/docs/interfaces/ExtensionSlotConfigObject.md +9 -3
- package/docs/interfaces/ExtensionSlotInfo.md +23 -9
- package/docs/interfaces/ExtensionSlotState.md +30 -0
- package/docs/interfaces/ExtensionStore.md +2 -17
- package/mock.tsx +39 -17
- package/package.json +14 -13
- package/src/integration-tests/extension-config.test.tsx +4 -10
- package/docs/interfaces/ConfigStore.md +0 -34
- package/docs/interfaces/ExtensionDetails.md +0 -81
- package/docs/interfaces/ExtensionSlotConfigsStore.md +0 -32
- package/docs/interfaces/ExtensionSlotInstance.md +0 -51
- package/docs/interfaces/ImplementerToolsConfigStore.md +0 -19
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[@openmrs/esm-framework](../API.md) / AssignedExtension
|
|
2
|
+
|
|
3
|
+
# Interface: AssignedExtension
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [id](AssignedExtension.md#id)
|
|
10
|
+
- [meta](AssignedExtension.md#meta)
|
|
11
|
+
- [name](AssignedExtension.md#name)
|
|
12
|
+
- [offline](AssignedExtension.md#offline)
|
|
13
|
+
- [online](AssignedExtension.md#online)
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### id
|
|
18
|
+
|
|
19
|
+
• **id**: `string`
|
|
20
|
+
|
|
21
|
+
#### Defined in
|
|
22
|
+
|
|
23
|
+
[packages/framework/esm-extensions/src/store.ts:71](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L71)
|
|
24
|
+
|
|
25
|
+
___
|
|
26
|
+
|
|
27
|
+
### meta
|
|
28
|
+
|
|
29
|
+
• **meta**: [`ExtensionMeta`](ExtensionMeta.md)
|
|
30
|
+
|
|
31
|
+
#### Defined in
|
|
32
|
+
|
|
33
|
+
[packages/framework/esm-extensions/src/store.ts:73](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L73)
|
|
34
|
+
|
|
35
|
+
___
|
|
36
|
+
|
|
37
|
+
### name
|
|
38
|
+
|
|
39
|
+
• **name**: `string`
|
|
40
|
+
|
|
41
|
+
#### Defined in
|
|
42
|
+
|
|
43
|
+
[packages/framework/esm-extensions/src/store.ts:72](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L72)
|
|
44
|
+
|
|
45
|
+
___
|
|
46
|
+
|
|
47
|
+
### offline
|
|
48
|
+
|
|
49
|
+
• `Optional` **offline**: `boolean` \| `object`
|
|
50
|
+
|
|
51
|
+
#### Defined in
|
|
52
|
+
|
|
53
|
+
[packages/framework/esm-extensions/src/store.ts:75](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L75)
|
|
54
|
+
|
|
55
|
+
___
|
|
56
|
+
|
|
57
|
+
### online
|
|
58
|
+
|
|
59
|
+
• `Optional` **online**: `boolean` \| `object`
|
|
60
|
+
|
|
61
|
+
#### Defined in
|
|
62
|
+
|
|
63
|
+
[packages/framework/esm-extensions/src/store.ts:74](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L74)
|
|
@@ -2,34 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Interface: ConnectedExtension
|
|
4
4
|
|
|
5
|
-
We have the following extension modes:
|
|
6
|
-
|
|
7
|
-
- attached (set via code in form of: attach, detach, ...)
|
|
8
|
-
- configured (set via configuration in form of: added, removed, ...)
|
|
9
|
-
- assigned (computed from attached and configured)
|
|
10
|
-
- connected (computed from assigned using connectivity and online / offline)
|
|
11
|
-
|
|
12
|
-
## Hierarchy
|
|
13
|
-
|
|
14
|
-
- [`ExtensionRegistration`](ExtensionRegistration.md)
|
|
15
|
-
|
|
16
|
-
↳ **`ConnectedExtension`**
|
|
17
|
-
|
|
18
5
|
## Table of contents
|
|
19
6
|
|
|
20
7
|
### Properties
|
|
21
8
|
|
|
22
9
|
- [id](ConnectedExtension.md#id)
|
|
23
10
|
- [meta](ConnectedExtension.md#meta)
|
|
24
|
-
- [moduleName](ConnectedExtension.md#modulename)
|
|
25
11
|
- [name](ConnectedExtension.md#name)
|
|
26
|
-
- [offline](ConnectedExtension.md#offline)
|
|
27
|
-
- [online](ConnectedExtension.md#online)
|
|
28
|
-
- [order](ConnectedExtension.md#order)
|
|
29
|
-
|
|
30
|
-
### Methods
|
|
31
|
-
|
|
32
|
-
- [load](ConnectedExtension.md#load)
|
|
33
12
|
|
|
34
13
|
## Properties
|
|
35
14
|
|
|
@@ -39,7 +18,7 @@ We have the following extension modes:
|
|
|
39
18
|
|
|
40
19
|
#### Defined in
|
|
41
20
|
|
|
42
|
-
[packages/framework/esm-
|
|
21
|
+
[packages/framework/esm-extensions/src/store.ts:79](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L79)
|
|
43
22
|
|
|
44
23
|
___
|
|
45
24
|
|
|
@@ -47,27 +26,9 @@ ___
|
|
|
47
26
|
|
|
48
27
|
• **meta**: [`ExtensionMeta`](ExtensionMeta.md)
|
|
49
28
|
|
|
50
|
-
#### Inherited from
|
|
51
|
-
|
|
52
|
-
[ExtensionRegistration](ExtensionRegistration.md).[meta](ExtensionRegistration.md#meta)
|
|
53
|
-
|
|
54
29
|
#### Defined in
|
|
55
30
|
|
|
56
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
57
|
-
|
|
58
|
-
___
|
|
59
|
-
|
|
60
|
-
### moduleName
|
|
61
|
-
|
|
62
|
-
• **moduleName**: `string`
|
|
63
|
-
|
|
64
|
-
#### Inherited from
|
|
65
|
-
|
|
66
|
-
[ExtensionRegistration](ExtensionRegistration.md).[moduleName](ExtensionRegistration.md#modulename)
|
|
67
|
-
|
|
68
|
-
#### Defined in
|
|
69
|
-
|
|
70
|
-
[packages/framework/esm-extensions/src/store.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L15)
|
|
31
|
+
[packages/framework/esm-extensions/src/store.ts:81](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L81)
|
|
71
32
|
|
|
72
33
|
___
|
|
73
34
|
|
|
@@ -75,70 +36,6 @@ ___
|
|
|
75
36
|
|
|
76
37
|
• **name**: `string`
|
|
77
38
|
|
|
78
|
-
#### Inherited from
|
|
79
|
-
|
|
80
|
-
[ExtensionRegistration](ExtensionRegistration.md).[name](ExtensionRegistration.md#name)
|
|
81
|
-
|
|
82
|
-
#### Defined in
|
|
83
|
-
|
|
84
|
-
[packages/framework/esm-extensions/src/store.ts:13](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L13)
|
|
85
|
-
|
|
86
|
-
___
|
|
87
|
-
|
|
88
|
-
### offline
|
|
89
|
-
|
|
90
|
-
• `Optional` **offline**: `boolean` \| `object`
|
|
91
|
-
|
|
92
|
-
#### Inherited from
|
|
93
|
-
|
|
94
|
-
[ExtensionRegistration](ExtensionRegistration.md).[offline](ExtensionRegistration.md#offline)
|
|
95
|
-
|
|
96
|
-
#### Defined in
|
|
97
|
-
|
|
98
|
-
[packages/framework/esm-extensions/src/store.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L19)
|
|
99
|
-
|
|
100
|
-
___
|
|
101
|
-
|
|
102
|
-
### online
|
|
103
|
-
|
|
104
|
-
• `Optional` **online**: `boolean` \| `object`
|
|
105
|
-
|
|
106
|
-
#### Inherited from
|
|
107
|
-
|
|
108
|
-
[ExtensionRegistration](ExtensionRegistration.md).[online](ExtensionRegistration.md#online)
|
|
109
|
-
|
|
110
|
-
#### Defined in
|
|
111
|
-
|
|
112
|
-
[packages/framework/esm-extensions/src/store.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L18)
|
|
113
|
-
|
|
114
|
-
___
|
|
115
|
-
|
|
116
|
-
### order
|
|
117
|
-
|
|
118
|
-
• `Optional` **order**: `number`
|
|
119
|
-
|
|
120
|
-
#### Inherited from
|
|
121
|
-
|
|
122
|
-
[ExtensionRegistration](ExtensionRegistration.md).[order](ExtensionRegistration.md#order)
|
|
123
|
-
|
|
124
|
-
#### Defined in
|
|
125
|
-
|
|
126
|
-
[packages/framework/esm-extensions/src/store.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L17)
|
|
127
|
-
|
|
128
|
-
## Methods
|
|
129
|
-
|
|
130
|
-
### load
|
|
131
|
-
|
|
132
|
-
▸ **load**(): `Promise`<`any`\>
|
|
133
|
-
|
|
134
|
-
#### Returns
|
|
135
|
-
|
|
136
|
-
`Promise`<`any`\>
|
|
137
|
-
|
|
138
|
-
#### Inherited from
|
|
139
|
-
|
|
140
|
-
[ExtensionRegistration](ExtensionRegistration.md).[load](ExtensionRegistration.md#load)
|
|
141
|
-
|
|
142
39
|
#### Defined in
|
|
143
40
|
|
|
144
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
41
|
+
[packages/framework/esm-extensions/src/store.ts:80](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L80)
|
|
@@ -35,7 +35,7 @@ indexed by slotModuleName and slotName.
|
|
|
35
35
|
|
|
36
36
|
#### Defined in
|
|
37
37
|
|
|
38
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
38
|
+
[packages/framework/esm-extensions/src/store.ts:28](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L28)
|
|
39
39
|
|
|
40
40
|
___
|
|
41
41
|
|
|
@@ -49,7 +49,7 @@ ___
|
|
|
49
49
|
|
|
50
50
|
#### Defined in
|
|
51
51
|
|
|
52
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
52
|
+
[packages/framework/esm-extensions/src/store.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L17)
|
|
53
53
|
|
|
54
54
|
___
|
|
55
55
|
|
|
@@ -63,7 +63,7 @@ ___
|
|
|
63
63
|
|
|
64
64
|
#### Defined in
|
|
65
65
|
|
|
66
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
66
|
+
[packages/framework/esm-extensions/src/store.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L16)
|
|
67
67
|
|
|
68
68
|
___
|
|
69
69
|
|
|
@@ -77,7 +77,7 @@ ___
|
|
|
77
77
|
|
|
78
78
|
#### Defined in
|
|
79
79
|
|
|
80
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
80
|
+
[packages/framework/esm-extensions/src/store.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L14)
|
|
81
81
|
|
|
82
82
|
___
|
|
83
83
|
|
|
@@ -91,7 +91,7 @@ ___
|
|
|
91
91
|
|
|
92
92
|
#### Defined in
|
|
93
93
|
|
|
94
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
94
|
+
[packages/framework/esm-extensions/src/store.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L20)
|
|
95
95
|
|
|
96
96
|
___
|
|
97
97
|
|
|
@@ -105,7 +105,7 @@ ___
|
|
|
105
105
|
|
|
106
106
|
#### Defined in
|
|
107
107
|
|
|
108
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
108
|
+
[packages/framework/esm-extensions/src/store.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L19)
|
|
109
109
|
|
|
110
110
|
___
|
|
111
111
|
|
|
@@ -119,7 +119,7 @@ ___
|
|
|
119
119
|
|
|
120
120
|
#### Defined in
|
|
121
121
|
|
|
122
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
122
|
+
[packages/framework/esm-extensions/src/store.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L18)
|
|
123
123
|
|
|
124
124
|
## Methods
|
|
125
125
|
|
|
@@ -137,4 +137,4 @@ ___
|
|
|
137
137
|
|
|
138
138
|
#### Defined in
|
|
139
139
|
|
|
140
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
140
|
+
[packages/framework/esm-extensions/src/store.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L15)
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
#### Defined in
|
|
18
18
|
|
|
19
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
19
|
+
[packages/framework/esm-extensions/src/store.ts:32](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L32)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[@openmrs/esm-framework](../API.md) / ExtensionInternalStore
|
|
2
|
+
|
|
3
|
+
# Interface: ExtensionInternalStore
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [extensions](ExtensionInternalStore.md#extensions)
|
|
10
|
+
- [slots](ExtensionInternalStore.md#slots)
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### extensions
|
|
15
|
+
|
|
16
|
+
• **extensions**: `Record`<`string`, [`ExtensionInfo`](ExtensionInfo.md)\>
|
|
17
|
+
|
|
18
|
+
Extensions indexed by name
|
|
19
|
+
|
|
20
|
+
#### Defined in
|
|
21
|
+
|
|
22
|
+
[packages/framework/esm-extensions/src/store.ts:39](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L39)
|
|
23
|
+
|
|
24
|
+
___
|
|
25
|
+
|
|
26
|
+
### slots
|
|
27
|
+
|
|
28
|
+
• **slots**: `Record`<`string`, [`ExtensionSlotInfo`](ExtensionSlotInfo.md)\>
|
|
29
|
+
|
|
30
|
+
Slots indexed by name
|
|
31
|
+
|
|
32
|
+
#### Defined in
|
|
33
|
+
|
|
34
|
+
[packages/framework/esm-extensions/src/store.ts:37](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L37)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
#### Defined in
|
|
22
22
|
|
|
23
|
-
[packages/framework/esm-react-utils/src/Extension.tsx:
|
|
23
|
+
[packages/framework/esm-react-utils/src/Extension.tsx:7](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/Extension.tsx#L7)
|
|
24
24
|
|
|
25
25
|
## Methods
|
|
26
26
|
|
|
@@ -41,4 +41,4 @@
|
|
|
41
41
|
|
|
42
42
|
#### Defined in
|
|
43
43
|
|
|
44
|
-
[packages/framework/esm-react-utils/src/Extension.tsx:
|
|
44
|
+
[packages/framework/esm-react-utils/src/Extension.tsx:8](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/Extension.tsx#L8)
|
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
↳ [`ExtensionInfo`](ExtensionInfo.md)
|
|
10
10
|
|
|
11
|
-
↳ [`ConnectedExtension`](ConnectedExtension.md)
|
|
12
|
-
|
|
13
11
|
## Table of contents
|
|
14
12
|
|
|
15
13
|
### Properties
|
|
@@ -33,7 +31,7 @@
|
|
|
33
31
|
|
|
34
32
|
#### Defined in
|
|
35
33
|
|
|
36
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
34
|
+
[packages/framework/esm-extensions/src/store.ts:17](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L17)
|
|
37
35
|
|
|
38
36
|
___
|
|
39
37
|
|
|
@@ -43,7 +41,7 @@ ___
|
|
|
43
41
|
|
|
44
42
|
#### Defined in
|
|
45
43
|
|
|
46
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
44
|
+
[packages/framework/esm-extensions/src/store.ts:16](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L16)
|
|
47
45
|
|
|
48
46
|
___
|
|
49
47
|
|
|
@@ -53,7 +51,7 @@ ___
|
|
|
53
51
|
|
|
54
52
|
#### Defined in
|
|
55
53
|
|
|
56
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
54
|
+
[packages/framework/esm-extensions/src/store.ts:14](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L14)
|
|
57
55
|
|
|
58
56
|
___
|
|
59
57
|
|
|
@@ -63,7 +61,7 @@ ___
|
|
|
63
61
|
|
|
64
62
|
#### Defined in
|
|
65
63
|
|
|
66
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
64
|
+
[packages/framework/esm-extensions/src/store.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L20)
|
|
67
65
|
|
|
68
66
|
___
|
|
69
67
|
|
|
@@ -73,7 +71,7 @@ ___
|
|
|
73
71
|
|
|
74
72
|
#### Defined in
|
|
75
73
|
|
|
76
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
74
|
+
[packages/framework/esm-extensions/src/store.ts:19](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L19)
|
|
77
75
|
|
|
78
76
|
___
|
|
79
77
|
|
|
@@ -83,7 +81,7 @@ ___
|
|
|
83
81
|
|
|
84
82
|
#### Defined in
|
|
85
83
|
|
|
86
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
84
|
+
[packages/framework/esm-extensions/src/store.ts:18](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L18)
|
|
87
85
|
|
|
88
86
|
## Methods
|
|
89
87
|
|
|
@@ -97,4 +95,4 @@ ___
|
|
|
97
95
|
|
|
98
96
|
#### Defined in
|
|
99
97
|
|
|
100
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
98
|
+
[packages/framework/esm-extensions/src/store.ts:15](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L15)
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
• `Optional` **add**: `string`[]
|
|
18
18
|
|
|
19
|
+
Additional extension IDs to assign to this slot, in addition to those `attach`ed in code.
|
|
20
|
+
|
|
19
21
|
#### Defined in
|
|
20
22
|
|
|
21
|
-
[packages/framework/esm-config/src/types.ts:
|
|
23
|
+
[packages/framework/esm-config/src/types.ts:51](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L51)
|
|
22
24
|
|
|
23
25
|
___
|
|
24
26
|
|
|
@@ -26,9 +28,11 @@ ___
|
|
|
26
28
|
|
|
27
29
|
• `Optional` **order**: `string`[]
|
|
28
30
|
|
|
31
|
+
Overrides the default ordering of extensions.
|
|
32
|
+
|
|
29
33
|
#### Defined in
|
|
30
34
|
|
|
31
|
-
[packages/framework/esm-config/src/types.ts:
|
|
35
|
+
[packages/framework/esm-config/src/types.ts:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L55)
|
|
32
36
|
|
|
33
37
|
___
|
|
34
38
|
|
|
@@ -36,6 +40,8 @@ ___
|
|
|
36
40
|
|
|
37
41
|
• `Optional` **remove**: `string`[]
|
|
38
42
|
|
|
43
|
+
Extension IDs which were `attach`ed to the slot but which should not be assigned.
|
|
44
|
+
|
|
39
45
|
#### Defined in
|
|
40
46
|
|
|
41
|
-
[packages/framework/esm-config/src/types.ts:
|
|
47
|
+
[packages/framework/esm-config/src/types.ts:53](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-config/src/types.ts#L53)
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
### Properties
|
|
8
8
|
|
|
9
9
|
- [attachedIds](ExtensionSlotInfo.md#attachedids)
|
|
10
|
-
- [
|
|
10
|
+
- [config](ExtensionSlotInfo.md#config)
|
|
11
|
+
- [moduleName](ExtensionSlotInfo.md#modulename)
|
|
11
12
|
- [name](ExtensionSlotInfo.md#name)
|
|
12
13
|
|
|
13
14
|
## Properties
|
|
@@ -16,26 +17,39 @@
|
|
|
16
17
|
|
|
17
18
|
• **attachedIds**: `string`[]
|
|
18
19
|
|
|
19
|
-
The set of extension IDs which have been attached to this slot
|
|
20
|
-
This is essentially a complete history of `attach` calls to this specific slot.
|
|
20
|
+
The set of extension IDs which have been attached to this slot using `attach`.
|
|
21
21
|
However, not all of these extension IDs should be rendered.
|
|
22
22
|
`assignedIds` is the set defining those.
|
|
23
23
|
|
|
24
24
|
#### Defined in
|
|
25
25
|
|
|
26
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
26
|
+
[packages/framework/esm-extensions/src/store.ts:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L56)
|
|
27
27
|
|
|
28
28
|
___
|
|
29
29
|
|
|
30
|
-
###
|
|
30
|
+
### config
|
|
31
31
|
|
|
32
|
-
• **
|
|
32
|
+
• **config**: ``null`` \| [`ExtensionSlotConfigObject`](ExtensionSlotConfigObject.md)
|
|
33
33
|
|
|
34
|
-
The
|
|
34
|
+
The configuration provided for this extension slot. `null` if not yet loaded.
|
|
35
35
|
|
|
36
36
|
#### Defined in
|
|
37
37
|
|
|
38
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
38
|
+
[packages/framework/esm-extensions/src/store.ts:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L58)
|
|
39
|
+
|
|
40
|
+
___
|
|
41
|
+
|
|
42
|
+
### moduleName
|
|
43
|
+
|
|
44
|
+
• `Optional` **moduleName**: `string`
|
|
45
|
+
|
|
46
|
+
The module in which the extension slot exists. Undefined if the slot
|
|
47
|
+
hasn't been registered yet (but it has been attached or assigned to
|
|
48
|
+
an extension.
|
|
49
|
+
|
|
50
|
+
#### Defined in
|
|
51
|
+
|
|
52
|
+
[packages/framework/esm-extensions/src/store.ts:48](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L48)
|
|
39
53
|
|
|
40
54
|
___
|
|
41
55
|
|
|
@@ -47,4 +61,4 @@ The name under which the extension slot has been registered.
|
|
|
47
61
|
|
|
48
62
|
#### Defined in
|
|
49
63
|
|
|
50
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
64
|
+
[packages/framework/esm-extensions/src/store.ts:50](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L50)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[@openmrs/esm-framework](../API.md) / ExtensionSlotState
|
|
2
|
+
|
|
3
|
+
# Interface: ExtensionSlotState
|
|
4
|
+
|
|
5
|
+
## Table of contents
|
|
6
|
+
|
|
7
|
+
### Properties
|
|
8
|
+
|
|
9
|
+
- [assignedExtensions](ExtensionSlotState.md#assignedextensions)
|
|
10
|
+
- [moduleName](ExtensionSlotState.md#modulename)
|
|
11
|
+
|
|
12
|
+
## Properties
|
|
13
|
+
|
|
14
|
+
### assignedExtensions
|
|
15
|
+
|
|
16
|
+
• **assignedExtensions**: [`AssignedExtension`](AssignedExtension.md)[]
|
|
17
|
+
|
|
18
|
+
#### Defined in
|
|
19
|
+
|
|
20
|
+
[packages/framework/esm-extensions/src/store.ts:67](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L67)
|
|
21
|
+
|
|
22
|
+
___
|
|
23
|
+
|
|
24
|
+
### moduleName
|
|
25
|
+
|
|
26
|
+
• **moduleName**: `string`
|
|
27
|
+
|
|
28
|
+
#### Defined in
|
|
29
|
+
|
|
30
|
+
[packages/framework/esm-extensions/src/store.ts:66](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L66)
|
|
@@ -6,29 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
### Properties
|
|
8
8
|
|
|
9
|
-
- [extensions](ExtensionStore.md#extensions)
|
|
10
9
|
- [slots](ExtensionStore.md#slots)
|
|
11
10
|
|
|
12
11
|
## Properties
|
|
13
12
|
|
|
14
|
-
### extensions
|
|
15
|
-
|
|
16
|
-
• **extensions**: `Record`<`string`, [`ExtensionInfo`](ExtensionInfo.md)\>
|
|
17
|
-
|
|
18
|
-
Extensions indexed by name
|
|
19
|
-
|
|
20
|
-
#### Defined in
|
|
21
|
-
|
|
22
|
-
[packages/framework/esm-extensions/src/store.ts:38](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L38)
|
|
23
|
-
|
|
24
|
-
___
|
|
25
|
-
|
|
26
13
|
### slots
|
|
27
14
|
|
|
28
|
-
• **slots**: `Record`<`string`, [`
|
|
29
|
-
|
|
30
|
-
Slots indexed by name
|
|
15
|
+
• **slots**: `Record`<`string`, [`ExtensionSlotState`](ExtensionSlotState.md)\>
|
|
31
16
|
|
|
32
17
|
#### Defined in
|
|
33
18
|
|
|
34
|
-
[packages/framework/esm-extensions/src/store.ts:
|
|
19
|
+
[packages/framework/esm-extensions/src/store.ts:62](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-extensions/src/store.ts#L62)
|
package/mock.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import type {} from "@openmrs/esm-globals";
|
|
3
3
|
import createStore, { Store } from "unistore";
|
|
4
4
|
import { never, of } from "rxjs";
|
|
5
|
+
import dayjs from "dayjs";
|
|
5
6
|
|
|
6
7
|
interface StoreEntity {
|
|
7
8
|
value: Store<any>;
|
|
@@ -198,19 +199,14 @@ export const ConfigurableLink = jest
|
|
|
198
199
|
<a href={interpolateString(config.to)}>{config.children}</a>
|
|
199
200
|
));
|
|
200
201
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
updateFcn(state);
|
|
210
|
-
return () => {};
|
|
211
|
-
},
|
|
212
|
-
unsubscribe: () => {},
|
|
213
|
-
};
|
|
202
|
+
export const getExtensionStore = () =>
|
|
203
|
+
getGlobalStore("extensions", { slots: {} });
|
|
204
|
+
|
|
205
|
+
export const getExtensionInternalStore = () =>
|
|
206
|
+
getGlobalStore("extensions-internal", {
|
|
207
|
+
slots: {},
|
|
208
|
+
extensions: {},
|
|
209
|
+
});
|
|
214
210
|
|
|
215
211
|
export const ComponentContext = React.createContext(null);
|
|
216
212
|
|
|
@@ -227,10 +223,11 @@ export const createUseStore = (store: Store<any>) => (actions) => {
|
|
|
227
223
|
return { ...state, ...actions };
|
|
228
224
|
};
|
|
229
225
|
|
|
230
|
-
export const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
export const useExtensionInternalStore = createUseStore(
|
|
227
|
+
getExtensionInternalStore()
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
export const useExtensionStore = createUseStore(getExtensionStore());
|
|
234
231
|
|
|
235
232
|
export const useStore = (store: Store<any>, actions) => {
|
|
236
233
|
const state = store.getState();
|
|
@@ -259,3 +256,28 @@ export const usePagination = jest.fn().mockImplementation(() => ({
|
|
|
259
256
|
}));
|
|
260
257
|
|
|
261
258
|
export const useVisitTypes = jest.fn(() => []);
|
|
259
|
+
|
|
260
|
+
export const formatDate = jest.fn((date: Date, mode) => {
|
|
261
|
+
if (!mode || mode == "standard") {
|
|
262
|
+
return dayjs(date).format("DD-MMM-YYYY");
|
|
263
|
+
}
|
|
264
|
+
if (mode == "wide") {
|
|
265
|
+
return dayjs(date).format("DD - MMM - YYYY");
|
|
266
|
+
}
|
|
267
|
+
if (mode == "no day") {
|
|
268
|
+
return dayjs(date).format("MMM YYYY");
|
|
269
|
+
}
|
|
270
|
+
if (mode == "no year") {
|
|
271
|
+
return dayjs(date).format("DD MMM");
|
|
272
|
+
}
|
|
273
|
+
console.warn("Unknown formatDate mode: ", mode);
|
|
274
|
+
return dayjs(date).format("DD-MMM-YYYY");
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
export const formatTime = jest.fn((date: Date) => {
|
|
278
|
+
return dayjs(date).format("HH:mm");
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
export const formatDatetime = jest.fn((date: Date, mode) => {
|
|
282
|
+
return formatDate(date, mode) + " " + formatTime(date);
|
|
283
|
+
});
|