@openmrs/esm-framework 3.2.1-pre.986 → 3.3.1-pre.1177
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/.turbo/turbo-build.log +154 -0
- package/dist/openmrs-esm-framework.js +1 -1
- package/dist/openmrs-esm-framework.js.LICENSE.txt +47 -1
- package/dist/openmrs-esm-framework.js.map +1 -1
- package/docs/API.md +1387 -1947
- package/docs/classes/OpenmrsFetchError.md +3 -3
- package/docs/enums/Type.md +11 -0
- package/docs/enums/VisitMode.md +3 -3
- package/docs/enums/VisitStatus.md +2 -2
- package/docs/interfaces/AssignedExtension.md +21 -8
- package/docs/interfaces/BreadcrumbRegistration.md +4 -4
- package/docs/interfaces/BreadcrumbSettings.md +6 -6
- package/docs/interfaces/ClearDynamicRoutesMessage.md +3 -3
- package/docs/interfaces/ConfigSchema.md +3 -3
- package/docs/interfaces/ConfigurableLinkProps.md +3 -3
- package/docs/interfaces/ConnectedExtension.md +18 -5
- package/docs/interfaces/CurrentPatientOptions.md +1 -1
- package/docs/interfaces/ExtensionRegistration.md +9 -15
- package/docs/interfaces/ExtensionSlotConfig.md +4 -4
- package/docs/interfaces/ExtensionSlotConfigObject.md +3 -3
- package/docs/interfaces/ExtensionSlotState.md +5 -5
- package/docs/interfaces/ExtensionStore.md +3 -3
- package/docs/interfaces/FHIRRequestObj.md +3 -3
- package/docs/interfaces/LoggedInUser.md +12 -12
- package/docs/interfaces/LoggedInUserFetchResponse.md +2 -2
- package/docs/interfaces/MessageServiceWorkerResult.md +5 -5
- package/docs/interfaces/NavigateOptions.md +3 -3
- package/docs/interfaces/NotificationDescriptor.md +74 -0
- package/docs/interfaces/OfflineModeResult.md +5 -5
- package/docs/interfaces/OfflinePatientArgs.md +4 -4
- package/docs/interfaces/OfflinePatientDataSyncHandler.md +4 -4
- package/docs/interfaces/OfflinePatientDataSyncState.md +8 -8
- package/docs/interfaces/OfflinePatientDataSyncStore.md +4 -4
- package/docs/interfaces/OmrsServiceWorkerMessage.md +3 -3
- package/docs/interfaces/OnImportMapChangedMessage.md +4 -4
- package/docs/interfaces/OnlyThePatient.md +1 -1
- package/docs/interfaces/PatientWithFullResponse.md +1 -1
- package/docs/interfaces/Person.md +3 -3
- package/docs/interfaces/Privilege.md +4 -4
- package/docs/interfaces/QueueItemDescriptor.md +6 -6
- package/docs/interfaces/RegisterDynamicRouteMessage.md +6 -6
- package/docs/interfaces/RetryOptions.md +3 -3
- package/docs/interfaces/Role.md +3 -3
- package/docs/interfaces/Session.md +92 -0
- package/docs/interfaces/SessionLocation.md +3 -3
- package/docs/interfaces/ShowNotificationEvent.md +5 -5
- package/docs/interfaces/ShowToastEvent.md +4 -4
- package/docs/interfaces/SyncItem.md +9 -9
- package/docs/interfaces/SyncProcessOptions.md +8 -8
- package/docs/interfaces/ToastDescriptor.md +69 -0
- package/docs/interfaces/ToastNotificationMeta.md +100 -0
- package/docs/interfaces/UserHasAccessProps.md +3 -3
- package/docs/interfaces/VisitItem.md +4 -4
- package/jest.config.js +1 -1
- package/mock.tsx +34 -3
- package/package.json +13 -13
- package/src/index.ts +8 -8
- package/src/integration-tests/extension-config.test.tsx +129 -14
- package/src/internal.ts +11 -0
- package/webpack.config.js +10 -2
- package/babel.config.js +0 -7
- package/docs/interfaces/ComponentConfig.md +0 -30
- package/docs/interfaces/ComponentDecoratorOptions.md +0 -52
- package/docs/interfaces/ExtensionInfo.md +0 -140
- package/docs/interfaces/ExtensionInstance.md +0 -19
- package/docs/interfaces/ExtensionInternalStore.md +0 -34
- package/docs/interfaces/ExtensionSlotInfo.md +0 -64
- package/docs/interfaces/NavigationContext.md +0 -50
- package/docs/interfaces/NetworkRequestFailedEvent.md +0 -49
- package/docs/interfaces/OfflineSynchronizationStore.md +0 -30
- package/docs/interfaces/OmrsServiceWorkerEvent.md +0 -31
- package/docs/interfaces/OpenmrsReactComponentProps.md +0 -19
- package/docs/interfaces/OpenmrsReactComponentState.md +0 -41
- package/docs/interfaces/SessionUser.md +0 -92
- package/docs/interfaces/UnauthenticatedUser.md +0 -52
- package/docs/interfaces/User.md +0 -107
package/mock.tsx
CHANGED
|
@@ -8,6 +8,7 @@ export {
|
|
|
8
8
|
formatDate,
|
|
9
9
|
formatDatetime,
|
|
10
10
|
formatTime,
|
|
11
|
+
age,
|
|
11
12
|
} from "@openmrs/esm-utils";
|
|
12
13
|
export { interpolateString, interpolateUrl } from "@openmrs/esm-config";
|
|
13
14
|
|
|
@@ -176,6 +177,10 @@ export function defineConfigSchema(moduleName, schema) {
|
|
|
176
177
|
configSchema = schema;
|
|
177
178
|
}
|
|
178
179
|
|
|
180
|
+
export function defineExtensionConfigSchema(extensionName, schema) {
|
|
181
|
+
configSchema = schema;
|
|
182
|
+
}
|
|
183
|
+
|
|
179
184
|
export const navigate = jest.fn();
|
|
180
185
|
|
|
181
186
|
export const ConfigurableLink = jest
|
|
@@ -199,7 +204,9 @@ export const detachAll = jest.fn();
|
|
|
199
204
|
|
|
200
205
|
export const switchTo = jest.fn();
|
|
201
206
|
|
|
202
|
-
export const ExtensionSlot =
|
|
207
|
+
export const ExtensionSlot = jest
|
|
208
|
+
.fn()
|
|
209
|
+
.mockImplementation(({ children }) => <>{children}</>);
|
|
203
210
|
|
|
204
211
|
export const Extension = jest.fn().mockImplementation((props: any) => <slot />);
|
|
205
212
|
|
|
@@ -229,7 +236,7 @@ export const usePatient = jest.fn(() => ({
|
|
|
229
236
|
error: null,
|
|
230
237
|
}));
|
|
231
238
|
|
|
232
|
-
export const
|
|
239
|
+
export const useSession = jest.fn(() => null);
|
|
233
240
|
|
|
234
241
|
export const useLayoutType = jest.fn(() => "desktop");
|
|
235
242
|
|
|
@@ -239,6 +246,8 @@ export const useExtensionSlot = jest.fn(() => ({
|
|
|
239
246
|
extensionIdsToRender: [],
|
|
240
247
|
}));
|
|
241
248
|
|
|
249
|
+
export const useExtensionSlotMeta = jest.fn(() => ({}));
|
|
250
|
+
|
|
242
251
|
export const UserHasAccess = jest.fn().mockImplementation((props: any) => {
|
|
243
252
|
return props.children;
|
|
244
253
|
});
|
|
@@ -254,7 +263,17 @@ export const useExtensionInternalStore = createUseStore(
|
|
|
254
263
|
|
|
255
264
|
export const useExtensionStore = createUseStore(getExtensionStore());
|
|
256
265
|
|
|
257
|
-
|
|
266
|
+
const defaultSelect = (x) => x;
|
|
267
|
+
export const useStore = (
|
|
268
|
+
store: Store<any>,
|
|
269
|
+
select = defaultSelect,
|
|
270
|
+
actions = {}
|
|
271
|
+
) => {
|
|
272
|
+
const state = select(store.getState());
|
|
273
|
+
return { ...state, ...actions };
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export const useStoreWithActions = (store: Store<any>, actions) => {
|
|
258
277
|
const state = store.getState();
|
|
259
278
|
return { ...state, ...actions };
|
|
260
279
|
};
|
|
@@ -265,9 +284,21 @@ export const usePagination = jest.fn().mockImplementation(() => ({
|
|
|
265
284
|
results: [],
|
|
266
285
|
}));
|
|
267
286
|
|
|
287
|
+
export const useVisit = jest.fn().mockReturnValue({
|
|
288
|
+
error: null,
|
|
289
|
+
mutate: jest.fn(),
|
|
290
|
+
isValidating: true,
|
|
291
|
+
currentVisit: null,
|
|
292
|
+
});
|
|
293
|
+
|
|
268
294
|
export const useVisitTypes = jest.fn(() => []);
|
|
269
295
|
|
|
270
296
|
/* esm-styleguide */
|
|
271
297
|
|
|
272
298
|
export const showNotification = jest.fn();
|
|
273
299
|
export const showToast = jest.fn();
|
|
300
|
+
export const showModal = jest.fn();
|
|
301
|
+
|
|
302
|
+
export const LeftNavMenu = jest.fn();
|
|
303
|
+
export const setLeftNav = jest.fn();
|
|
304
|
+
export const unsetLeftNav = jest.fn();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-framework",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1-pre.1177",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"browser": "dist/openmrs-esm-framework.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@openmrs/esm-api": "^3.
|
|
39
|
-
"@openmrs/esm-breadcrumbs": "^3.
|
|
40
|
-
"@openmrs/esm-config": "^3.
|
|
41
|
-
"@openmrs/esm-error-handling": "^3.
|
|
42
|
-
"@openmrs/esm-extensions": "^3.
|
|
43
|
-
"@openmrs/esm-globals": "^3.
|
|
44
|
-
"@openmrs/esm-offline": "^3.
|
|
45
|
-
"@openmrs/esm-react-utils": "^3.
|
|
46
|
-
"@openmrs/esm-state": "^3.
|
|
47
|
-
"@openmrs/esm-styleguide": "^3.
|
|
48
|
-
"@openmrs/esm-utils": "^3.
|
|
38
|
+
"@openmrs/esm-api": "^3.3.1-pre.1177",
|
|
39
|
+
"@openmrs/esm-breadcrumbs": "^3.3.1-pre.1177",
|
|
40
|
+
"@openmrs/esm-config": "^3.3.1-pre.1177",
|
|
41
|
+
"@openmrs/esm-error-handling": "^3.3.1-pre.1177",
|
|
42
|
+
"@openmrs/esm-extensions": "^3.3.1-pre.1177",
|
|
43
|
+
"@openmrs/esm-globals": "^3.3.1-pre.1177",
|
|
44
|
+
"@openmrs/esm-offline": "^3.3.1-pre.1177",
|
|
45
|
+
"@openmrs/esm-react-utils": "^3.3.1-pre.1177",
|
|
46
|
+
"@openmrs/esm-state": "^3.3.1-pre.1177",
|
|
47
|
+
"@openmrs/esm-styleguide": "^3.3.1-pre.1177",
|
|
48
|
+
"@openmrs/esm-utils": "^3.3.1-pre.1177",
|
|
49
49
|
"dayjs": "^1.10.7"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "d3541372844e7f46f8c1887ae4df492a1894aa87"
|
|
52
52
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "@openmrs/esm-api";
|
|
1
|
+
export * from "@openmrs/esm-api/src/public";
|
|
2
2
|
export * from "@openmrs/esm-breadcrumbs";
|
|
3
|
-
export * from "@openmrs/esm-config";
|
|
3
|
+
export * from "@openmrs/esm-config/src/public";
|
|
4
4
|
export * from "@openmrs/esm-error-handling";
|
|
5
|
-
export * from "@openmrs/esm-extensions";
|
|
6
|
-
export * from "@openmrs/esm-globals";
|
|
7
|
-
export * from "@openmrs/esm-
|
|
8
|
-
export * from "@openmrs/esm-
|
|
9
|
-
export * from "@openmrs/esm-
|
|
5
|
+
export * from "@openmrs/esm-extensions/src/public";
|
|
6
|
+
export * from "@openmrs/esm-globals/src/public";
|
|
7
|
+
export * from "@openmrs/esm-offline/src/public";
|
|
8
|
+
export * from "@openmrs/esm-react-utils/src/public";
|
|
9
|
+
export * from "@openmrs/esm-state/src/public";
|
|
10
|
+
export * from "@openmrs/esm-styleguide/src/public";
|
|
10
11
|
export * from "@openmrs/esm-utils";
|
|
11
|
-
export * from "@openmrs/esm-offline";
|
|
@@ -3,18 +3,32 @@ import {
|
|
|
3
3
|
attach,
|
|
4
4
|
registerExtension,
|
|
5
5
|
updateInternalExtensionStore,
|
|
6
|
+
getExtensionInternalStore,
|
|
7
|
+
getExtensionStore,
|
|
6
8
|
} from "../../../esm-extensions";
|
|
7
9
|
import {
|
|
8
10
|
ExtensionSlot,
|
|
9
11
|
getSyncLifecycle,
|
|
10
12
|
openmrsComponentDecorator,
|
|
11
13
|
useConfig,
|
|
14
|
+
useExtensionStore,
|
|
12
15
|
} from "../../../esm-react-utils/src";
|
|
13
|
-
import {
|
|
14
|
-
|
|
16
|
+
import {
|
|
17
|
+
defineConfigSchema,
|
|
18
|
+
provide,
|
|
19
|
+
Type,
|
|
20
|
+
temporaryConfigStore,
|
|
21
|
+
configInternalStore,
|
|
22
|
+
getExtensionSlotsConfigStore,
|
|
23
|
+
} from "../../../esm-config/src";
|
|
24
|
+
import { act, render, screen, waitFor } from "@testing-library/react";
|
|
25
|
+
import { waitForElementToBeRemoved } from "@testing-library/dom";
|
|
15
26
|
|
|
16
27
|
describe("Interaction between configuration and extension systems", () => {
|
|
17
28
|
beforeEach(() => {
|
|
29
|
+
temporaryConfigStore.setState({ config: {} });
|
|
30
|
+
configInternalStore.setState({ providedConfigs: [], schemas: {} });
|
|
31
|
+
getExtensionSlotsConfigStore().setState({ slots: {} });
|
|
18
32
|
updateInternalExtensionStore(() => ({ slots: {}, extensions: {} }));
|
|
19
33
|
});
|
|
20
34
|
|
|
@@ -28,7 +42,7 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
28
42
|
defineConfigSchema("esm-flintstone", {});
|
|
29
43
|
provide({
|
|
30
44
|
"esm-flintstone": {
|
|
31
|
-
|
|
45
|
+
extensionSlots: {
|
|
32
46
|
"A slot": {
|
|
33
47
|
add: ["Barney", "Betty"],
|
|
34
48
|
order: ["Betty", "Wilma"],
|
|
@@ -53,19 +67,19 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
53
67
|
});
|
|
54
68
|
|
|
55
69
|
test("Extensions should recieve config from module and from 'configure' key", async () => {
|
|
56
|
-
registerSimpleExtension("
|
|
70
|
+
registerSimpleExtension("Pebbles", "esm-flintstone", true);
|
|
57
71
|
defineConfigSchema("esm-flintstone", {
|
|
58
72
|
town: { _type: Type.String, _default: "Bedrock" },
|
|
59
73
|
});
|
|
60
|
-
attach("Flintstone slot", "
|
|
61
|
-
attach("Future slot", "
|
|
74
|
+
attach("Flintstone slot", "Pebbles");
|
|
75
|
+
attach("Future slot", "Pebbles");
|
|
62
76
|
provide({
|
|
63
77
|
"esm-flintstone": {
|
|
64
78
|
town: "Springfield",
|
|
65
|
-
|
|
79
|
+
extensionSlots: {
|
|
66
80
|
"Future slot": {
|
|
67
81
|
configure: {
|
|
68
|
-
|
|
82
|
+
Pebbles: {
|
|
69
83
|
town: "New New York",
|
|
70
84
|
},
|
|
71
85
|
},
|
|
@@ -90,11 +104,11 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
90
104
|
</>
|
|
91
105
|
));
|
|
92
106
|
render(<App />);
|
|
93
|
-
await screen.findAllByText(/.*
|
|
94
|
-
const
|
|
95
|
-
expect(
|
|
96
|
-
const
|
|
97
|
-
expect(
|
|
107
|
+
await screen.findAllByText(/.*Pebbles.*/);
|
|
108
|
+
const flintstonePebbles = screen.getByTestId("flintstone-slot");
|
|
109
|
+
expect(flintstonePebbles).toHaveTextContent(/Pebbles:.*Springfield/);
|
|
110
|
+
const futurePebbles = screen.getByTestId("future-slot");
|
|
111
|
+
expect(futurePebbles).toHaveTextContent(/Pebbles:.*New New York/);
|
|
98
112
|
});
|
|
99
113
|
|
|
100
114
|
test("Should be possible to attach the same extension twice with different configurations", async () => {
|
|
@@ -106,7 +120,7 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
106
120
|
attach("Flintstone slot", "pet#BabyPuss");
|
|
107
121
|
provide({
|
|
108
122
|
"esm-flintstone": {
|
|
109
|
-
|
|
123
|
+
extensionSlots: {
|
|
110
124
|
"Flintstone slot": {
|
|
111
125
|
configure: {
|
|
112
126
|
"pet#Dino": {
|
|
@@ -138,6 +152,107 @@ describe("Interaction between configuration and extension systems", () => {
|
|
|
138
152
|
expect(slot.firstChild).toHaveTextContent(/Dino/);
|
|
139
153
|
expect(slot.lastChild).toHaveTextContent(/Baby Puss/);
|
|
140
154
|
});
|
|
155
|
+
|
|
156
|
+
test("Slot config should update with temporary config", async () => {
|
|
157
|
+
registerSimpleExtension("Pearl", "esm-slaghoople");
|
|
158
|
+
attach("A slot", "Pearl");
|
|
159
|
+
defineConfigSchema("esm-slaghoople", {});
|
|
160
|
+
const App = openmrsComponentDecorator({
|
|
161
|
+
moduleName: "esm-slaghoople",
|
|
162
|
+
featureName: "The Slaghooples",
|
|
163
|
+
disableTranslations: true,
|
|
164
|
+
})(() => <ExtensionSlot data-testid="slot" extensionSlotName="A slot" />);
|
|
165
|
+
render(<App />);
|
|
166
|
+
await waitFor(() => expect(screen.getByText("Pearl")).toBeInTheDocument());
|
|
167
|
+
act(() => {
|
|
168
|
+
temporaryConfigStore.setState({
|
|
169
|
+
config: {
|
|
170
|
+
"esm-slaghoople": {
|
|
171
|
+
extensionSlots: {
|
|
172
|
+
"A slot": {
|
|
173
|
+
remove: ["Pearl"],
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
expect(screen.queryByText("Pearl")).not.toBeInTheDocument();
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test("Extension config should update with temporary config", async () => {
|
|
184
|
+
registerSimpleExtension("Mr. Slate", "esm-flintstone", true);
|
|
185
|
+
attach("A slot", "Mr. Slate");
|
|
186
|
+
defineConfigSchema("esm-flintstone", { tie: { _default: "green" } });
|
|
187
|
+
const App = openmrsComponentDecorator({
|
|
188
|
+
moduleName: "esm-quarry",
|
|
189
|
+
featureName: "The Flintstones",
|
|
190
|
+
disableTranslations: true,
|
|
191
|
+
})(() => <ExtensionSlot data-testid="slot" extensionSlotName="A slot" />);
|
|
192
|
+
render(<App />);
|
|
193
|
+
await waitFor(() =>
|
|
194
|
+
expect(screen.getByText(/Mr. Slate/)).toBeInTheDocument()
|
|
195
|
+
);
|
|
196
|
+
expect(screen.getByTestId("slot")).toHaveTextContent(/green/);
|
|
197
|
+
act(() => {
|
|
198
|
+
temporaryConfigStore.setState({
|
|
199
|
+
config: {
|
|
200
|
+
"esm-quarry": {
|
|
201
|
+
extensionSlots: {
|
|
202
|
+
"A slot": {
|
|
203
|
+
configure: {
|
|
204
|
+
"Mr. Slate": { tie: "black" },
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
expect(screen.queryByText("green")).not.toBeInTheDocument();
|
|
213
|
+
expect(screen.getByTestId("slot")).toHaveTextContent(/black/);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
test("Extension config should be available in extension store", async () => {
|
|
217
|
+
registerSimpleExtension("Bamm-Bamm", "esm-flintstone", false);
|
|
218
|
+
attach("A slot", "Bamm-Bamm");
|
|
219
|
+
defineConfigSchema("esm-flintstone", { clothes: { _default: "leopard" } });
|
|
220
|
+
function RootComponent() {
|
|
221
|
+
const store = useExtensionStore();
|
|
222
|
+
return (
|
|
223
|
+
<div>
|
|
224
|
+
<ExtensionSlot data-testid="slot" extensionSlotName="A slot" />
|
|
225
|
+
{store.slots["A slot"].assignedExtensions.map((e) => (
|
|
226
|
+
<div key={e.name}>{JSON.stringify(e.config)}</div>
|
|
227
|
+
))}
|
|
228
|
+
</div>
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
const App = openmrsComponentDecorator({
|
|
232
|
+
moduleName: "esm-flintstone",
|
|
233
|
+
featureName: "The Flintstones",
|
|
234
|
+
disableTranslations: true,
|
|
235
|
+
})(RootComponent);
|
|
236
|
+
render(<App />);
|
|
237
|
+
await waitFor(() => expect(screen.getByTestId(/slot/)).toBeInTheDocument());
|
|
238
|
+
expect(screen.getByText(/clothes/)).toHaveTextContent(/leopard/);
|
|
239
|
+
act(() => {
|
|
240
|
+
temporaryConfigStore.setState({
|
|
241
|
+
config: {
|
|
242
|
+
"esm-flintstone": {
|
|
243
|
+
extensionSlots: {
|
|
244
|
+
"A slot": {
|
|
245
|
+
configure: {
|
|
246
|
+
"Bamm-Bamm": { clothes: "tiger" },
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
expect(screen.getByText(/clothes/)).toHaveTextContent(/tiger/);
|
|
255
|
+
});
|
|
141
256
|
});
|
|
142
257
|
|
|
143
258
|
function registerSimpleExtension(
|
package/src/internal.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "@openmrs/esm-api";
|
|
2
|
+
export * from "@openmrs/esm-breadcrumbs";
|
|
3
|
+
export * from "@openmrs/esm-config";
|
|
4
|
+
export * from "@openmrs/esm-error-handling";
|
|
5
|
+
export * from "@openmrs/esm-extensions";
|
|
6
|
+
export * from "@openmrs/esm-globals";
|
|
7
|
+
export * from "@openmrs/esm-offline";
|
|
8
|
+
export * from "@openmrs/esm-react-utils";
|
|
9
|
+
export * from "@openmrs/esm-state";
|
|
10
|
+
export * from "@openmrs/esm-styleguide";
|
|
11
|
+
export * from "@openmrs/esm-utils";
|
package/webpack.config.js
CHANGED
|
@@ -17,12 +17,20 @@ module.exports = (env) => ({
|
|
|
17
17
|
{
|
|
18
18
|
test: /\.m?(js|ts|tsx)$/,
|
|
19
19
|
exclude: /(node_modules|bower_components)/,
|
|
20
|
-
use: "
|
|
20
|
+
use: "swc-loader",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
test: /\.s?css$/,
|
|
24
|
+
use: [
|
|
25
|
+
{ loader: require.resolve("style-loader") },
|
|
26
|
+
{ loader: require.resolve("css-loader") },
|
|
27
|
+
{ loader: require.resolve("sass-loader") },
|
|
28
|
+
],
|
|
21
29
|
},
|
|
22
30
|
],
|
|
23
31
|
},
|
|
24
32
|
resolve: {
|
|
25
|
-
extensions: [".ts", ".js", ".tsx", ".jsx"],
|
|
33
|
+
extensions: [".ts", ".js", ".tsx", ".jsx", ".scss"],
|
|
26
34
|
},
|
|
27
35
|
plugins: [
|
|
28
36
|
new SystemJSPublicPathWebpackPlugin(),
|
package/babel.config.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ComponentConfig
|
|
2
|
-
|
|
3
|
-
# Interface: ComponentConfig
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [extension](ComponentConfig.md#extension)
|
|
10
|
-
- [moduleName](ComponentConfig.md#modulename)
|
|
11
|
-
|
|
12
|
-
## Properties
|
|
13
|
-
|
|
14
|
-
### extension
|
|
15
|
-
|
|
16
|
-
• `Optional` **extension**: [`ExtensionData`](ExtensionData.md)
|
|
17
|
-
|
|
18
|
-
#### Defined in
|
|
19
|
-
|
|
20
|
-
[packages/framework/esm-react-utils/src/ComponentContext.ts:11](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ComponentContext.ts#L11)
|
|
21
|
-
|
|
22
|
-
___
|
|
23
|
-
|
|
24
|
-
### moduleName
|
|
25
|
-
|
|
26
|
-
• **moduleName**: `string`
|
|
27
|
-
|
|
28
|
-
#### Defined in
|
|
29
|
-
|
|
30
|
-
[packages/framework/esm-react-utils/src/ComponentContext.ts:10](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/ComponentContext.ts#L10)
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ComponentDecoratorOptions
|
|
2
|
-
|
|
3
|
-
# Interface: ComponentDecoratorOptions
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [disableTranslations](ComponentDecoratorOptions.md#disabletranslations)
|
|
10
|
-
- [featureName](ComponentDecoratorOptions.md#featurename)
|
|
11
|
-
- [moduleName](ComponentDecoratorOptions.md#modulename)
|
|
12
|
-
- [strictMode](ComponentDecoratorOptions.md#strictmode)
|
|
13
|
-
|
|
14
|
-
## Properties
|
|
15
|
-
|
|
16
|
-
### disableTranslations
|
|
17
|
-
|
|
18
|
-
• `Optional` **disableTranslations**: `boolean`
|
|
19
|
-
|
|
20
|
-
#### Defined in
|
|
21
|
-
|
|
22
|
-
[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:57](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L57)
|
|
23
|
-
|
|
24
|
-
___
|
|
25
|
-
|
|
26
|
-
### featureName
|
|
27
|
-
|
|
28
|
-
• **featureName**: `string`
|
|
29
|
-
|
|
30
|
-
#### Defined in
|
|
31
|
-
|
|
32
|
-
[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:56](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L56)
|
|
33
|
-
|
|
34
|
-
___
|
|
35
|
-
|
|
36
|
-
### moduleName
|
|
37
|
-
|
|
38
|
-
• **moduleName**: `string`
|
|
39
|
-
|
|
40
|
-
#### Defined in
|
|
41
|
-
|
|
42
|
-
[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:55](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L55)
|
|
43
|
-
|
|
44
|
-
___
|
|
45
|
-
|
|
46
|
-
### strictMode
|
|
47
|
-
|
|
48
|
-
• `Optional` **strictMode**: `boolean`
|
|
49
|
-
|
|
50
|
-
#### Defined in
|
|
51
|
-
|
|
52
|
-
[packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx:58](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/framework/esm-react-utils/src/openmrsComponentDecorator.tsx#L58)
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ExtensionInfo
|
|
2
|
-
|
|
3
|
-
# Interface: ExtensionInfo
|
|
4
|
-
|
|
5
|
-
## Hierarchy
|
|
6
|
-
|
|
7
|
-
- [`ExtensionRegistration`](ExtensionRegistration.md)
|
|
8
|
-
|
|
9
|
-
↳ **`ExtensionInfo`**
|
|
10
|
-
|
|
11
|
-
## Table of contents
|
|
12
|
-
|
|
13
|
-
### Properties
|
|
14
|
-
|
|
15
|
-
- [instances](ExtensionInfo.md#instances)
|
|
16
|
-
- [meta](ExtensionInfo.md#meta)
|
|
17
|
-
- [moduleName](ExtensionInfo.md#modulename)
|
|
18
|
-
- [name](ExtensionInfo.md#name)
|
|
19
|
-
- [offline](ExtensionInfo.md#offline)
|
|
20
|
-
- [online](ExtensionInfo.md#online)
|
|
21
|
-
- [order](ExtensionInfo.md#order)
|
|
22
|
-
|
|
23
|
-
### Methods
|
|
24
|
-
|
|
25
|
-
- [load](ExtensionInfo.md#load)
|
|
26
|
-
|
|
27
|
-
## Properties
|
|
28
|
-
|
|
29
|
-
### instances
|
|
30
|
-
|
|
31
|
-
• **instances**: `Record`<`string`, `Record`<`string`, [`ExtensionInstance`](ExtensionInstance.md)\>\>
|
|
32
|
-
|
|
33
|
-
The instances where the extension has been rendered using `renderExtension`,
|
|
34
|
-
indexed by slotModuleName and slotName.
|
|
35
|
-
|
|
36
|
-
#### Defined in
|
|
37
|
-
|
|
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
|
-
|
|
40
|
-
___
|
|
41
|
-
|
|
42
|
-
### meta
|
|
43
|
-
|
|
44
|
-
• **meta**: [`ExtensionMeta`](ExtensionMeta.md)
|
|
45
|
-
|
|
46
|
-
#### Inherited from
|
|
47
|
-
|
|
48
|
-
[ExtensionRegistration](ExtensionRegistration.md).[meta](ExtensionRegistration.md#meta)
|
|
49
|
-
|
|
50
|
-
#### Defined in
|
|
51
|
-
|
|
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
|
-
|
|
54
|
-
___
|
|
55
|
-
|
|
56
|
-
### moduleName
|
|
57
|
-
|
|
58
|
-
• **moduleName**: `string`
|
|
59
|
-
|
|
60
|
-
#### Inherited from
|
|
61
|
-
|
|
62
|
-
[ExtensionRegistration](ExtensionRegistration.md).[moduleName](ExtensionRegistration.md#modulename)
|
|
63
|
-
|
|
64
|
-
#### Defined in
|
|
65
|
-
|
|
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
|
-
|
|
68
|
-
___
|
|
69
|
-
|
|
70
|
-
### name
|
|
71
|
-
|
|
72
|
-
• **name**: `string`
|
|
73
|
-
|
|
74
|
-
#### Inherited from
|
|
75
|
-
|
|
76
|
-
[ExtensionRegistration](ExtensionRegistration.md).[name](ExtensionRegistration.md#name)
|
|
77
|
-
|
|
78
|
-
#### Defined in
|
|
79
|
-
|
|
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
|
-
|
|
82
|
-
___
|
|
83
|
-
|
|
84
|
-
### offline
|
|
85
|
-
|
|
86
|
-
• `Optional` **offline**: `boolean` \| `object`
|
|
87
|
-
|
|
88
|
-
#### Inherited from
|
|
89
|
-
|
|
90
|
-
[ExtensionRegistration](ExtensionRegistration.md).[offline](ExtensionRegistration.md#offline)
|
|
91
|
-
|
|
92
|
-
#### Defined in
|
|
93
|
-
|
|
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
|
-
|
|
96
|
-
___
|
|
97
|
-
|
|
98
|
-
### online
|
|
99
|
-
|
|
100
|
-
• `Optional` **online**: `boolean` \| `object`
|
|
101
|
-
|
|
102
|
-
#### Inherited from
|
|
103
|
-
|
|
104
|
-
[ExtensionRegistration](ExtensionRegistration.md).[online](ExtensionRegistration.md#online)
|
|
105
|
-
|
|
106
|
-
#### Defined in
|
|
107
|
-
|
|
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
|
-
|
|
110
|
-
___
|
|
111
|
-
|
|
112
|
-
### order
|
|
113
|
-
|
|
114
|
-
• `Optional` **order**: `number`
|
|
115
|
-
|
|
116
|
-
#### Inherited from
|
|
117
|
-
|
|
118
|
-
[ExtensionRegistration](ExtensionRegistration.md).[order](ExtensionRegistration.md#order)
|
|
119
|
-
|
|
120
|
-
#### Defined in
|
|
121
|
-
|
|
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
|
-
|
|
124
|
-
## Methods
|
|
125
|
-
|
|
126
|
-
### load
|
|
127
|
-
|
|
128
|
-
▸ **load**(): `Promise`<`any`\>
|
|
129
|
-
|
|
130
|
-
#### Returns
|
|
131
|
-
|
|
132
|
-
`Promise`<`any`\>
|
|
133
|
-
|
|
134
|
-
#### Inherited from
|
|
135
|
-
|
|
136
|
-
[ExtensionRegistration](ExtensionRegistration.md).[load](ExtensionRegistration.md#load)
|
|
137
|
-
|
|
138
|
-
#### Defined in
|
|
139
|
-
|
|
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)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[@openmrs/esm-framework](../API.md) / ExtensionInstance
|
|
2
|
-
|
|
3
|
-
# Interface: ExtensionInstance
|
|
4
|
-
|
|
5
|
-
## Table of contents
|
|
6
|
-
|
|
7
|
-
### Properties
|
|
8
|
-
|
|
9
|
-
- [id](ExtensionInstance.md#id)
|
|
10
|
-
|
|
11
|
-
## Properties
|
|
12
|
-
|
|
13
|
-
### id
|
|
14
|
-
|
|
15
|
-
• **id**: `string`
|
|
16
|
-
|
|
17
|
-
#### Defined in
|
|
18
|
-
|
|
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)
|
|
@@ -1,34 +0,0 @@
|
|
|
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)
|