@openmrs/esm-styleguide 8.0.1-pre.3581 → 8.0.1-pre.3585
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 +1 -1
- package/dist/brand.d.ts +1 -0
- package/dist/breakpoints/index.d.ts +11 -0
- package/dist/config-schema.d.ts +23 -0
- package/dist/custom-overflow-menu/custom-overflow-menu.component.d.ts +8 -0
- package/dist/custom-overflow-menu/index.d.ts +1 -0
- package/dist/datepicker/DatePickerIcon.d.ts +6 -0
- package/dist/datepicker/DatePickerInput.d.ts +11 -0
- package/dist/datepicker/MonthYear.d.ts +10 -0
- package/dist/datepicker/locale-context.d.ts +2 -0
- package/dist/datepicker/utils.d.ts +15 -0
- package/dist/error-state/error-state.component.d.ts +6 -0
- package/dist/error-state/index.d.ts +1 -0
- package/dist/icons/icon-registration.d.ts +1 -0
- package/dist/icons/icons.d.ts +329 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/left-nav/index.d.ts +23 -0
- package/dist/logo/index.d.ts +1 -0
- package/dist/modals/index.d.ts +25 -0
- package/dist/notifications/actionable-notification.component.d.ts +20 -0
- package/dist/notifications/active-actionable-notifications.component.d.ts +8 -0
- package/dist/notifications/active-notifications.component.d.ts +8 -0
- package/dist/notifications/index.d.ts +19 -0
- package/dist/notifications/notification.component.d.ts +19 -0
- package/dist/pictograms/pictogram-registration.d.ts +1 -0
- package/dist/pictograms/pictograms.d.ts +64 -0
- package/dist/snackbars/active-snackbar.component.d.ts +9 -0
- package/dist/snackbars/index.d.ts +12 -0
- package/dist/snackbars/snackbar.component.d.ts +22 -0
- package/dist/svg-utils.d.ts +1 -0
- package/dist/toasts/active-toasts.component.d.ts +9 -0
- package/dist/toasts/index.d.ts +12 -0
- package/dist/toasts/toast.component.d.ts +19 -0
- package/dist/utils.d.ts +6 -0
- package/dist/workspaces/action-menu-button/action-menu-button.component.d.ts +11 -0
- package/dist/workspaces/container/action-menu.component.d.ts +9 -0
- package/dist/workspaces/container/workspace-container.component.d.ts +54 -0
- package/dist/workspaces/container/workspace-renderer.component.d.ts +8 -0
- package/dist/workspaces/notification/workspace-notification.component.d.ts +6 -0
- package/dist/workspaces/public.d.ts +4 -0
- package/dist/workspaces/workspace-sidebar-store/useWorkspaceGroupStore.d.ts +11 -0
- package/dist/workspaces/workspaces.d.ts +236 -0
- package/dist/workspaces2/workspace2-close-prompt.modal.d.ts +11 -0
- package/package.json +12 -12
package/.turbo/turbo-build.log
CHANGED
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
[0] │ You can limit the size of your bundles by using import() to lazy load some parts of your application.
|
|
17
17
|
[0] │ For more info visit https://www.rspack.dev/guide/optimization/code-splitting
|
|
18
18
|
[0]
|
|
19
|
-
[0] Rspack compiled with 3 warnings in
|
|
19
|
+
[0] Rspack compiled with 3 warnings in 10.22 s
|
|
20
20
|
[0] rspack --mode=production exited with code 0
|
|
21
21
|
[1] tsc --project tsconfig.build.json exited with code 0
|
package/dist/brand.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupBranding(): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const Breakpoint: {
|
|
2
|
+
readonly PHONE_MIN: 0;
|
|
3
|
+
readonly PHONE_MAX: 600;
|
|
4
|
+
readonly TABLET_MIN: 601;
|
|
5
|
+
readonly TABLET_MAX: 1023;
|
|
6
|
+
readonly SMALL_DESKTOP_MIN: 1024;
|
|
7
|
+
readonly SMALL_DESKTOP_MAX: 1439;
|
|
8
|
+
readonly LARGE_DESKTOP_MIN: 1440;
|
|
9
|
+
readonly LARGE_DESKTOP_MAX: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function integrateBreakpoints(): void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ConfigSchema } from '@openmrs/esm-config';
|
|
2
|
+
import { type CarbonTagColor } from './utils';
|
|
3
|
+
export interface StyleguideConfigObject {
|
|
4
|
+
'Brand color #1': string;
|
|
5
|
+
'Brand color #2': string;
|
|
6
|
+
'Brand color #3': string;
|
|
7
|
+
excludePatientIdentifierCodeTypes: {
|
|
8
|
+
uuids: Array<string>;
|
|
9
|
+
};
|
|
10
|
+
implementationName: string;
|
|
11
|
+
patientPhotoConceptUuid: string;
|
|
12
|
+
preferredCalendar: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
preferredDateLocale: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
};
|
|
18
|
+
diagnosisTags: {
|
|
19
|
+
primaryColor: CarbonTagColor;
|
|
20
|
+
secondaryColor: CarbonTagColor;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare const esmStyleGuideSchema: ConfigSchema;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** @module @category UI */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface CustomOverflowMenuProps {
|
|
4
|
+
menuTitle: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function CustomOverflowMenu({ menuTitle, children }: CustomOverflowMenuProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './custom-overflow-menu.component';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Component to render the Calendar icon for the DatePicker component with the same styling as
|
|
4
|
+
* the Carbon DatePicker component.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DatePickerIcon: React.ForwardRefExoticComponent<React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type DateInputProps } from 'react-aria-components';
|
|
3
|
+
interface OpenmrsDateInputProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* This is just the standard React Aria Components DatePickerInput with an added `onClick` handler to open
|
|
8
|
+
* the calendar when the group is clicked. This is used to emulate Carbon's behaviour in the DatePicker.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DatePickerInput: React.ForwardRefExoticComponent<DateInputProps & OpenmrsDateInputProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Custom component to render the month and year on the DatePicker and provide the standard Carbon
|
|
4
|
+
* UI to change them.
|
|
5
|
+
*
|
|
6
|
+
* Should work with any calendar system supported by the @internationalized/date package.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MonthYear: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
+
children?: React.ReactNode | undefined;
|
|
10
|
+
} & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Calendar, type DateValue } from '@internationalized/date';
|
|
2
|
+
import { type DateInputValue } from './OpenmrsDatePicker';
|
|
3
|
+
/**
|
|
4
|
+
* Function to convert relatively arbitrary date values into a React Aria `DateValue`,
|
|
5
|
+
* normally a `CalendarDate`, which represents a date without time or timezone.
|
|
6
|
+
*/
|
|
7
|
+
export declare function dateToInternationalizedDate(date: DateInputValue, calendar: Calendar | undefined, allowNull: true): DateValue | null | undefined;
|
|
8
|
+
export declare function dateToInternationalizedDate(date: DateInputValue, calendar: Calendar | undefined, allowNull: false): DateValue | undefined;
|
|
9
|
+
export declare function dateToInternationalizedDate(date: DateInputValue, calendar: Calendar | undefined): DateValue | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Function to convert a `DateValue` (from React Aria) into a standard JS `Date`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function internationalizedDateToDate(date: DateValue): Date | undefined;
|
|
14
|
+
/** Removes any data attributes from an object */
|
|
15
|
+
export declare function removeDataAttributes<T>(props: T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './error-state.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupIcons(): void;
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/** @category Icons */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type Argument } from 'classnames';
|
|
4
|
+
export declare const iconIds: readonly ["omrs-icon-activity", "omrs-icon-add", "omrs-icon-arrow-down", "omrs-icon-arrow-left", "omrs-icon-arrow-right", "omrs-icon-arrow-up", "omrs-icon-baby", "omrs-icon-calendar-heat-map", "omrs-icon-calendar", "omrs-icon-caret-down", "omrs-icon-caret-left", "omrs-icon-caret-right", "omrs-icon-caret-up", "omrs-icon-chart-average", "omrs-icon-checkmark-filled", "omrs-icon-checkmark-outline", "omrs-icon-chemistry", "omrs-icon-chevron-down", "omrs-icon-chevron-left", "omrs-icon-chevron-right", "omrs-icon-chevron-up", "omrs-icon-close", "omrs-icon-close-filled", "omrs-icon-close-outline", "omrs-icon-document", "omrs-icon-document-attachment", "omrs-icon-download", "omrs-icon-drug-order", "omrs-icon-edit", "omrs-icon-event-schedule", "omrs-icon-events", "omrs-icon-gender-female", "omrs-icon-gender-male", "omrs-icon-gender-other", "omrs-icon-gender-unknown", "omrs-icon-generic-order-type", "omrs-icon-group", "omrs-icon-group-access", "omrs-icon-hospital-bed", "omrs-icon-image-medical", "omrs-icon-information", "omrs-icon-information-filled", "omrs-icon-information-square", "omrs-icon-inventory-management", "omrs-icon-lab-order", "omrs-icon-list-checked", "omrs-icon-location", "omrs-icon-material-order", "omrs-icon-maximize", "omrs-icon-medication", "omrs-icon-message-queue", "omrs-icon-microscope", "omrs-icon-money", "omrs-icon-mother", "omrs-icon-movement", "omrs-icon-overflow-menu--horizontal", "omrs-icon-overflow-menu--vertical", "omrs-icon-password", "omrs-icon-pedestrian-family", "omrs-icon-pen", "omrs-icon-printer", "omrs-icon-procedure-order", "omrs-icon-programs", "omrs-icon-renew", "omrs-icon-referral-order", "omrs-icon-report", "omrs-icon-reset", "omrs-icon-save", "omrs-icon-search", "omrs-icon-settings", "omrs-icon-shopping-cart", "omrs-icon-shopping-cart--arrow-down", "omrs-icon-sticky-note-add", "omrs-icon-switcher", "omrs-icon-syringe", "omrs-icon-table-of-contents", "omrs-icon-table", "omrs-icon-time", "omrs-icon-tools", "omrs-icon-translate", "omrs-icon-trash-can", "omrs-icon-tree-view--alt", "omrs-icon-user-avatar", "omrs-icon-user-follow", "omrs-icon-user-xray", "omrs-icon-user", "omrs-icon-view-off", "omrs-icon-view", "omrs-icon-warning"];
|
|
5
|
+
export type IconId = (typeof iconIds)[number];
|
|
6
|
+
export type IconProps = {
|
|
7
|
+
className?: Argument;
|
|
8
|
+
fill?: string;
|
|
9
|
+
size?: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
*/
|
|
13
|
+
export declare const ActivityIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
14
|
+
/**
|
|
15
|
+
*/
|
|
16
|
+
export declare const AddIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
17
|
+
/**
|
|
18
|
+
*/
|
|
19
|
+
export declare const ArrowDownIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
20
|
+
/**
|
|
21
|
+
*/
|
|
22
|
+
export declare const ArrowLeftIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
23
|
+
/**
|
|
24
|
+
*/
|
|
25
|
+
export declare const ArrowRightIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
26
|
+
/**
|
|
27
|
+
*/
|
|
28
|
+
export declare const ArrowUpIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
29
|
+
/**
|
|
30
|
+
*/
|
|
31
|
+
export declare const BabyIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
32
|
+
/**
|
|
33
|
+
*/
|
|
34
|
+
export declare const CalendarHeatMapIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
35
|
+
/**
|
|
36
|
+
*/
|
|
37
|
+
export declare const CalendarIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
38
|
+
/**
|
|
39
|
+
*/
|
|
40
|
+
export declare const CaretDownIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
41
|
+
/**
|
|
42
|
+
*/
|
|
43
|
+
export declare const CaretLeftIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
44
|
+
/**
|
|
45
|
+
*/
|
|
46
|
+
export declare const CaretRightIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
47
|
+
/**
|
|
48
|
+
*/
|
|
49
|
+
export declare const CaretUpIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
50
|
+
/**
|
|
51
|
+
*/
|
|
52
|
+
export declare const ChartAverageIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
53
|
+
/**
|
|
54
|
+
*/
|
|
55
|
+
export declare const CheckmarkFilledIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
56
|
+
/**
|
|
57
|
+
*/
|
|
58
|
+
export declare const CheckmarkOutlineIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
59
|
+
/**
|
|
60
|
+
*/
|
|
61
|
+
export declare const ChemistryIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
62
|
+
/**
|
|
63
|
+
*/
|
|
64
|
+
export declare const ChevronDownIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
65
|
+
/**
|
|
66
|
+
*/
|
|
67
|
+
export declare const ChevronLeftIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
68
|
+
/**
|
|
69
|
+
*/
|
|
70
|
+
export declare const ChevronRightIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
71
|
+
/**
|
|
72
|
+
*/
|
|
73
|
+
export declare const ChevronUpIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
74
|
+
/**
|
|
75
|
+
*/
|
|
76
|
+
export declare const CloseIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
77
|
+
/**
|
|
78
|
+
*/
|
|
79
|
+
export declare const CloseFilledIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
80
|
+
/**
|
|
81
|
+
*/
|
|
82
|
+
export declare const CloseOutlineIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
83
|
+
/**
|
|
84
|
+
*/
|
|
85
|
+
export declare const DocumentIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
86
|
+
/**
|
|
87
|
+
*/
|
|
88
|
+
export declare const DocumentAttachmentIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
89
|
+
/**
|
|
90
|
+
*/
|
|
91
|
+
export declare const DownloadIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
92
|
+
/**
|
|
93
|
+
*/
|
|
94
|
+
export declare const DrugOrderIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
95
|
+
/**
|
|
96
|
+
*/
|
|
97
|
+
export declare const EditIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
98
|
+
/**
|
|
99
|
+
*/
|
|
100
|
+
export declare const EventScheduleIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
101
|
+
/**
|
|
102
|
+
*/
|
|
103
|
+
export declare const EventsIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
104
|
+
/**
|
|
105
|
+
*/
|
|
106
|
+
export declare const GenderFemaleIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
107
|
+
/**
|
|
108
|
+
*/
|
|
109
|
+
export declare const GenderMaleIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
110
|
+
/**
|
|
111
|
+
*/
|
|
112
|
+
export declare const GenderOtherIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
113
|
+
/**
|
|
114
|
+
*/
|
|
115
|
+
export declare const GenderUnknownIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
116
|
+
/**
|
|
117
|
+
*/
|
|
118
|
+
export declare const GenericOrderTypeIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
119
|
+
/**
|
|
120
|
+
*/
|
|
121
|
+
export declare const GroupIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
122
|
+
/**
|
|
123
|
+
*/
|
|
124
|
+
export declare const GroupAccessIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
125
|
+
/**
|
|
126
|
+
*/
|
|
127
|
+
export declare const HospitalBedIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
128
|
+
/**
|
|
129
|
+
*/
|
|
130
|
+
export declare const ImageMedicalIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
131
|
+
/**
|
|
132
|
+
*/
|
|
133
|
+
export declare const InformationIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
134
|
+
/**
|
|
135
|
+
*/
|
|
136
|
+
export declare const InformationFilledIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
137
|
+
/**
|
|
138
|
+
*/
|
|
139
|
+
export declare const InformationSquareIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
140
|
+
/**
|
|
141
|
+
*/
|
|
142
|
+
export declare const InventoryManagementIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
143
|
+
/**
|
|
144
|
+
*/
|
|
145
|
+
export declare const LabOrderIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
146
|
+
/**
|
|
147
|
+
*/
|
|
148
|
+
export declare const ListCheckedIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
149
|
+
/**
|
|
150
|
+
*/
|
|
151
|
+
export declare const LocationIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
152
|
+
/**
|
|
153
|
+
*/
|
|
154
|
+
export declare const MaterialOrderIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
155
|
+
/**
|
|
156
|
+
*/
|
|
157
|
+
export declare const MaximizeIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
158
|
+
/**
|
|
159
|
+
*/
|
|
160
|
+
export declare const MedicationIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
161
|
+
/**
|
|
162
|
+
*/
|
|
163
|
+
export declare const MessageQueueIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
164
|
+
/**
|
|
165
|
+
*/
|
|
166
|
+
export declare const MicroscopeIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
167
|
+
/**
|
|
168
|
+
* Billing
|
|
169
|
+
*/
|
|
170
|
+
export declare const MoneyIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
171
|
+
/**
|
|
172
|
+
*/
|
|
173
|
+
export declare const MotherIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
174
|
+
/**
|
|
175
|
+
*/
|
|
176
|
+
export declare const MovementIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
177
|
+
/**
|
|
178
|
+
*/
|
|
179
|
+
export declare const OverflowMenuHorizontalIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
180
|
+
/**
|
|
181
|
+
*/
|
|
182
|
+
export declare const OverflowMenuVerticalIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
183
|
+
export declare const PasswordIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
184
|
+
/**
|
|
185
|
+
*/
|
|
186
|
+
export declare const PedestrianFamilyIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
187
|
+
/**
|
|
188
|
+
*/
|
|
189
|
+
export declare const PenIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
190
|
+
/**
|
|
191
|
+
*/
|
|
192
|
+
export declare const PrinterIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
193
|
+
/**
|
|
194
|
+
*/
|
|
195
|
+
export declare const ProcedureOrderIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
196
|
+
/**
|
|
197
|
+
*/
|
|
198
|
+
export declare const ProgramsIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
199
|
+
/**
|
|
200
|
+
*/
|
|
201
|
+
export declare const ReferralOrderIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
202
|
+
/**
|
|
203
|
+
*/
|
|
204
|
+
export declare const RenewIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
205
|
+
/**
|
|
206
|
+
*/
|
|
207
|
+
export declare const ReportIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
208
|
+
/**
|
|
209
|
+
*/
|
|
210
|
+
export declare const ResetIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
211
|
+
/**
|
|
212
|
+
*/
|
|
213
|
+
export declare const SaveIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
214
|
+
/**
|
|
215
|
+
*/
|
|
216
|
+
export declare const SearchIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
217
|
+
/**
|
|
218
|
+
*/
|
|
219
|
+
export declare const SettingsIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
220
|
+
/**
|
|
221
|
+
*/
|
|
222
|
+
export declare const SwitcherIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
223
|
+
/**
|
|
224
|
+
* Order Basket, the UI to enter Orders for Medications, Referrals, Labs, Procedures and more
|
|
225
|
+
*/
|
|
226
|
+
export declare const ShoppingCartIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
227
|
+
/**
|
|
228
|
+
* Used as a button to add an item to the Order basket from a search
|
|
229
|
+
*/
|
|
230
|
+
export declare const ShoppingCartArrowDownIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
231
|
+
/**
|
|
232
|
+
* Used as action button to open ward in-patient note workspace
|
|
233
|
+
*/
|
|
234
|
+
export declare const StickyNoteAddIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
235
|
+
/**
|
|
236
|
+
*/
|
|
237
|
+
export declare const SyringeIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
238
|
+
/**
|
|
239
|
+
* Used as a button to add an item to the Order basket from a search
|
|
240
|
+
*/
|
|
241
|
+
export declare const TableOfContentsIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
242
|
+
/**
|
|
243
|
+
*/
|
|
244
|
+
export declare const TableIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
245
|
+
/**
|
|
246
|
+
* Lab investigations
|
|
247
|
+
*/
|
|
248
|
+
export declare const TimeIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
249
|
+
/**
|
|
250
|
+
*/
|
|
251
|
+
export declare const ToolsIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
252
|
+
/**
|
|
253
|
+
*/
|
|
254
|
+
export declare const TranslateIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
255
|
+
/**
|
|
256
|
+
*/
|
|
257
|
+
export declare const TrashCanIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
258
|
+
/**
|
|
259
|
+
*/
|
|
260
|
+
export declare const TreeViewAltIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
261
|
+
/**
|
|
262
|
+
* User of OpenMRS e.g. My Account
|
|
263
|
+
*/
|
|
264
|
+
export declare const UserAvatarIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
265
|
+
/**
|
|
266
|
+
*/
|
|
267
|
+
export declare const UserFollowIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
268
|
+
/**
|
|
269
|
+
* UserXray Icon
|
|
270
|
+
*
|
|
271
|
+
* `UserXrayIcon` is also used for imaging orders
|
|
272
|
+
*/
|
|
273
|
+
export declare const UserXrayIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
274
|
+
/**
|
|
275
|
+
*/
|
|
276
|
+
export declare const UserIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
277
|
+
/**
|
|
278
|
+
*/
|
|
279
|
+
export declare const ViewOffIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
280
|
+
/**
|
|
281
|
+
*/
|
|
282
|
+
export declare const ViewIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
283
|
+
/**
|
|
284
|
+
*/
|
|
285
|
+
export declare const WarningIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
286
|
+
/**
|
|
287
|
+
*/
|
|
288
|
+
export declare const AllergiesIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
289
|
+
/**
|
|
290
|
+
*
|
|
291
|
+
*/
|
|
292
|
+
export declare const AttachmentIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
293
|
+
/**
|
|
294
|
+
* Conditions
|
|
295
|
+
*
|
|
296
|
+
* Note this is an alias for ListCheckedIcon
|
|
297
|
+
*/
|
|
298
|
+
export declare const ConditionsIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
299
|
+
/**
|
|
300
|
+
*
|
|
301
|
+
*/
|
|
302
|
+
export declare const RadiologyIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
303
|
+
/**
|
|
304
|
+
* Used as a button to add an item to the Order basket from a search
|
|
305
|
+
*
|
|
306
|
+
* Note this is an alias for ShoppingCartArrowDownIcon
|
|
307
|
+
*/
|
|
308
|
+
export declare const ShoppingCartAddItemIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
309
|
+
/**
|
|
310
|
+
* This is a utility component that takes an `icon` and renders it if the sprite for the icon
|
|
311
|
+
* is available. The goal is to make it easier to conditionally render configuration-specified icons.
|
|
312
|
+
*
|
|
313
|
+
* @example
|
|
314
|
+
* ```tsx
|
|
315
|
+
* <MaybeIcon icon='omrs-icon-baby' className={styles.myIconStyles} />
|
|
316
|
+
* ```
|
|
317
|
+
*/
|
|
318
|
+
export declare const MaybeIcon: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
319
|
+
icon: string;
|
|
320
|
+
fallback?: React.ReactNode;
|
|
321
|
+
} & IconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
322
|
+
export type SvgIconProps = {
|
|
323
|
+
icon: IconId;
|
|
324
|
+
iconProps: IconProps;
|
|
325
|
+
};
|
|
326
|
+
/**
|
|
327
|
+
* This is a utility type for custom icons that use the svg-sprite-loader to bundle custom icons
|
|
328
|
+
*/
|
|
329
|
+
export declare const Icon: React.MemoExoticComponent<React.ForwardRefExoticComponent<SvgIconProps & React.RefAttributes<SVGSVGElement>>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icons';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** @module @category UI */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type SideNavProps } from '@carbon/react';
|
|
4
|
+
/**
|
|
5
|
+
* Extended props for the LeftNavMenu component
|
|
6
|
+
*/
|
|
7
|
+
interface LeftNavMenuProps extends SideNavProps {
|
|
8
|
+
/**
|
|
9
|
+
* Flag indicating if this component is a child of the header component.
|
|
10
|
+
* When true, the component renders the left nav menu.
|
|
11
|
+
* When false, it renders an empty fragment.
|
|
12
|
+
*/
|
|
13
|
+
isChildOfHeader?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* This component renders the left nav in desktop mode. It's also used to render the same
|
|
17
|
+
* nav when the hamburger menu is clicked on in tablet mode. See side-menu-panel.component.tsx
|
|
18
|
+
*
|
|
19
|
+
* Use of this component by anything other than <SideMenuPanel> (where isChildOfHeader == false)
|
|
20
|
+
* is deprecated; it simply renders nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LeftNavMenu: React.ForwardRefExoticComponent<LeftNavMenuProps & React.RefAttributes<HTMLElement>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupLogo(): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type ModalSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
2
|
+
export interface ModalProps {
|
|
3
|
+
size?: ModalSize;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @internal
|
|
8
|
+
* Sets up the modals system. Should be called in the app shell during initialization.
|
|
9
|
+
*/
|
|
10
|
+
export declare function setupModals(modalContainer: HTMLElement | null): void;
|
|
11
|
+
/**
|
|
12
|
+
* Shows a modal dialog.
|
|
13
|
+
*
|
|
14
|
+
* The modal must have been registered by name. This should be done in the `routes.json` file of the
|
|
15
|
+
* app that defines the modal. Note that both the `<ModalHeader>` and `<ModalBody>` should be at the
|
|
16
|
+
* top level of the modal component (wrapped in a React.Fragment), or else the content of the modal
|
|
17
|
+
* body might not vertical-scroll properly.
|
|
18
|
+
*
|
|
19
|
+
* @param modalName The name of the modal to show.
|
|
20
|
+
* @param props The optional props to provide to the modal.
|
|
21
|
+
* @param onClose The optional callback to call when the modal is closed.
|
|
22
|
+
* @returns The dispose function to force closing the modal dialog.
|
|
23
|
+
*/
|
|
24
|
+
export declare function showModal(modalName: string, props?: ModalProps, onClose?: () => void): () => void;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** @module @category UI */
|
|
3
|
+
export interface ActionableNotificationProps {
|
|
4
|
+
notification: ActionableNotificationMeta;
|
|
5
|
+
}
|
|
6
|
+
export interface ActionableNotificationDescriptor {
|
|
7
|
+
actionButtonLabel: string;
|
|
8
|
+
onActionButtonClick(): void;
|
|
9
|
+
onClose?(): void;
|
|
10
|
+
subtitle: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
kind?: ActionableNotificationType | string;
|
|
13
|
+
critical?: boolean;
|
|
14
|
+
progressActionLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ActionableNotificationMeta extends ActionableNotificationDescriptor {
|
|
17
|
+
id: number;
|
|
18
|
+
}
|
|
19
|
+
export type ActionableNotificationType = 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
|
|
20
|
+
export declare const ActionableNotificationComponent: React.FC<ActionableNotificationProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Subject } from 'rxjs';
|
|
3
|
+
import type { ActionableNotificationMeta } from './actionable-notification.component';
|
|
4
|
+
interface ActionableActiveNotificationProps {
|
|
5
|
+
subject: Subject<ActionableNotificationMeta>;
|
|
6
|
+
}
|
|
7
|
+
declare const ActionableActiveNotifications: React.FC<ActionableActiveNotificationProps>;
|
|
8
|
+
export default ActionableActiveNotifications;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Subject } from 'rxjs';
|
|
3
|
+
import type { InlineNotificationMeta } from './notification.component';
|
|
4
|
+
interface ActiveNotificationProps {
|
|
5
|
+
subject: Subject<InlineNotificationMeta>;
|
|
6
|
+
}
|
|
7
|
+
declare const ActiveNotifications: React.FC<ActiveNotificationProps>;
|
|
8
|
+
export default ActiveNotifications;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { NotificationDescriptor } from './notification.component';
|
|
2
|
+
import type { ActionableNotificationDescriptor } from './actionable-notification.component';
|
|
3
|
+
/**
|
|
4
|
+
* Starts a rendering host for inline notifications. Should only be used by the app shell.
|
|
5
|
+
* Under normal conditions there is no need to use this function.
|
|
6
|
+
* @param target The container target that hosts the inline notifications.
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderInlineNotifications(target: HTMLElement | null): void;
|
|
9
|
+
/**
|
|
10
|
+
* Displays an inline notification in the UI.
|
|
11
|
+
* @param notification The description of the notification to display.
|
|
12
|
+
*/
|
|
13
|
+
export declare function showNotification(notification: NotificationDescriptor): void;
|
|
14
|
+
export declare function renderActionableNotifications(target: HTMLElement | null): void;
|
|
15
|
+
/**
|
|
16
|
+
* Displays an actionable notification in the UI.
|
|
17
|
+
* @param notification The description of the notification to display.
|
|
18
|
+
*/
|
|
19
|
+
export declare function showActionableNotification(notification: ActionableNotificationDescriptor): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** @module @category UI */
|
|
3
|
+
export interface NotificationProps {
|
|
4
|
+
notification: InlineNotificationMeta;
|
|
5
|
+
}
|
|
6
|
+
export interface NotificationDescriptor {
|
|
7
|
+
description: string;
|
|
8
|
+
action?: string;
|
|
9
|
+
kind?: InlineNotificationType;
|
|
10
|
+
critical?: boolean;
|
|
11
|
+
millis?: number;
|
|
12
|
+
title?: string;
|
|
13
|
+
onAction?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface InlineNotificationMeta extends NotificationDescriptor {
|
|
16
|
+
id: number;
|
|
17
|
+
}
|
|
18
|
+
export type InlineNotificationType = 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
|
|
19
|
+
export declare const Notification: React.FC<NotificationProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function setupPictograms(): void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** @category Pictograms */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type Argument } from 'classnames';
|
|
4
|
+
export declare const pictogramIds: readonly ["omrs-pict-appointments", "omrs-pict-assessment-1", "omrs-pict-assessment-2", "omrs-pict-blood-bank", "omrs-pict-cardiology", "omrs-pict-ct-scan", "omrs-pict-dentistry", "omrs-pict-emergency-department", "omrs-pict-facility", "omrs-pict-geriatrics", "omrs-pict-gynaecology", "omrs-pict-in-patient", "omrs-pict-laboratory", "omrs-pict-labs-2", "omrs-pict-obstetrics", "omrs-pict-patient-search", "omrs-pict-patients", "omrs-pict-payments-desk", "omrs-pict-pharmacy", "omrs-pict-pharmacy-2", "omrs-pict-registration", "omrs-pict-service-queues", "omrs-pict-stock-management", "omrs-pict-transfer", "omrs-pict-triage", "omrs-pict-x-ray"];
|
|
5
|
+
export type PictogramId = (typeof pictogramIds)[number];
|
|
6
|
+
export type PictogramProps = {
|
|
7
|
+
className?: Argument;
|
|
8
|
+
size?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const AppointmentsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated use AppointmentsPictogram instead
|
|
13
|
+
*/
|
|
14
|
+
export declare const AppointmentsAltPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
15
|
+
export declare const Assessment1Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
16
|
+
export declare const Assessment2Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
17
|
+
export declare const BloodBankPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
18
|
+
export declare const CardiologyPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
19
|
+
export declare const CtScanPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
20
|
+
export declare const DentistryPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
21
|
+
export declare const EmergencyDepartmentPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
22
|
+
export declare const FacilityPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
23
|
+
export declare const GeriatricsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
24
|
+
export declare const GynaecologyPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
25
|
+
export declare const InPatientPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
26
|
+
export declare const LaboratoryPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
27
|
+
export declare const Labs2Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
28
|
+
export declare const ObstetricsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
29
|
+
export declare const PatientSearchPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
30
|
+
export declare const PatientsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
31
|
+
export declare const PaymentsDeskPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
32
|
+
export declare const PharmacyPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
33
|
+
export declare const Pharmacy2Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
34
|
+
export declare const RegistrationPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
35
|
+
export declare const ServiceQueuesPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
36
|
+
export declare const StockManagementPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
37
|
+
export declare const TransferPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
38
|
+
export declare const TriagePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
39
|
+
export declare const XrayPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
40
|
+
export declare const HomePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
41
|
+
export declare const PatientListsPictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
42
|
+
/**
|
|
43
|
+
* This is a utility component that takes an `pictogram` and render it if the sprite for the pictogram
|
|
44
|
+
* is available. The goal is to make it easier to conditionally render configuration-specified pictograms.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <MaybePictogram pictogram='omrs-icon-baby' className={styles.myPictogramStyles} />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare const MaybePictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
|
|
52
|
+
pictogram: string;
|
|
53
|
+
fallback?: React.ReactNode;
|
|
54
|
+
} & PictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
55
|
+
export type SvgPictogramProps = {
|
|
56
|
+
/** the id of the pictogram */
|
|
57
|
+
pictogram: PictogramId;
|
|
58
|
+
/** properties when using the pictogram */
|
|
59
|
+
pictogramProps: PictogramProps;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* This is a utility type for custom pictograms. Please maintain alphabetical order when adding new pictograms for readability.
|
|
63
|
+
*/
|
|
64
|
+
export declare const Pictogram: React.MemoExoticComponent<React.ForwardRefExoticComponent<SvgPictogramProps & React.RefAttributes<SVGSVGElement>>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @module @category UI */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Subject } from 'rxjs';
|
|
4
|
+
import type { SnackbarMeta } from './snackbar.component';
|
|
5
|
+
interface ActiveSnackbarProps {
|
|
6
|
+
subject: Subject<SnackbarMeta>;
|
|
7
|
+
}
|
|
8
|
+
declare const ActiveSnackbars: React.FC<ActiveSnackbarProps>;
|
|
9
|
+
export default ActiveSnackbars;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SnackbarDescriptor } from './snackbar.component';
|
|
2
|
+
/**
|
|
3
|
+
* Starts a rendering host for snack bar notifications. Should only be used by the app shell.
|
|
4
|
+
* Under normal conditions there is no need to use this function.
|
|
5
|
+
* @param target The container target that hosts the snack bar notifications.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderSnackbars(target: HTMLElement | null): void;
|
|
8
|
+
/**
|
|
9
|
+
* Displays a snack bar notification in the UI.
|
|
10
|
+
* @param snackbar The description of the snack bar to display.
|
|
11
|
+
*/
|
|
12
|
+
export declare function showSnackbar(snackbar: SnackbarDescriptor): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @module @category UI */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SnackbarProps {
|
|
4
|
+
snackbar: SnackbarMeta;
|
|
5
|
+
closeSnackbar(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface SnackbarDescriptor {
|
|
8
|
+
actionButtonLabel?: string;
|
|
9
|
+
isLowContrast?: boolean;
|
|
10
|
+
kind?: SnackbarType | string;
|
|
11
|
+
onActionButtonClick?: () => void;
|
|
12
|
+
progressActionLabel?: string;
|
|
13
|
+
subtitle?: React.ReactNode;
|
|
14
|
+
timeoutInMs?: number;
|
|
15
|
+
autoClose?: boolean;
|
|
16
|
+
title: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SnackbarMeta extends SnackbarDescriptor {
|
|
19
|
+
id: number;
|
|
20
|
+
}
|
|
21
|
+
export type SnackbarType = 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
|
|
22
|
+
export declare const Snackbar: React.FC<SnackbarProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function addSvg(htmlId: string, svgString: string): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @module @category UI */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Subject } from 'rxjs';
|
|
4
|
+
import type { ToastNotificationMeta } from './toast.component';
|
|
5
|
+
interface ActiveToastsProps {
|
|
6
|
+
subject: Subject<ToastNotificationMeta>;
|
|
7
|
+
}
|
|
8
|
+
declare const ActiveToasts: React.FC<ActiveToastsProps>;
|
|
9
|
+
export default ActiveToasts;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToastDescriptor } from './toast.component';
|
|
2
|
+
/**
|
|
3
|
+
* Starts a rendering host for toast notifications. Should only be used by the app shell.
|
|
4
|
+
* Under normal conditions there is no need to use this function.
|
|
5
|
+
* @param target The container target that hosts the toast notifications.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderToasts(target: HTMLElement | null): void;
|
|
8
|
+
/**
|
|
9
|
+
* Displays a toast notification in the UI.
|
|
10
|
+
* @param toast The description of the toast to display.
|
|
11
|
+
*/
|
|
12
|
+
export declare function showToast(toast: ToastDescriptor): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** @module @category UI */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ToastProps {
|
|
4
|
+
toast: ToastNotificationMeta;
|
|
5
|
+
closeToast(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface ToastDescriptor {
|
|
8
|
+
description: React.ReactNode;
|
|
9
|
+
onActionButtonClick?: () => void;
|
|
10
|
+
actionButtonLabel?: string;
|
|
11
|
+
kind?: ToastType;
|
|
12
|
+
critical?: boolean;
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ToastNotificationMeta extends ToastDescriptor {
|
|
16
|
+
id: number;
|
|
17
|
+
}
|
|
18
|
+
export type ToastType = 'error' | 'info' | 'info-square' | 'success' | 'warning' | 'warning-alt';
|
|
19
|
+
export declare const Toast: React.FC<ToastProps>;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array of valid values for Carbon tag's "type" attribute.
|
|
3
|
+
* Options from https://react.carbondesignsystem.com/?path=/docs/components-tag--overview
|
|
4
|
+
*/
|
|
5
|
+
export declare const carbonTagColors: readonly ["red", "magenta", "purple", "blue", "teal", "cyan", "gray", "green", "warm-gray", "cool-gray", "high-contrast", "outline"];
|
|
6
|
+
export type CarbonTagColor = (typeof carbonTagColors)[number];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @module @category Workspace */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ActionMenuButtonProps {
|
|
4
|
+
getIcon: (props: object) => JSX.Element;
|
|
5
|
+
label: string;
|
|
6
|
+
iconDescription: string;
|
|
7
|
+
handler: () => void;
|
|
8
|
+
type: string;
|
|
9
|
+
tagContent?: string | React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const ActionMenuButton: React.FC<ActionMenuButtonProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @module @category Workspace */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface ActionMenuProps {
|
|
4
|
+
isWithinWorkspace?: boolean;
|
|
5
|
+
name?: string;
|
|
6
|
+
actionMenuProps?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export declare function ActionMenu({ isWithinWorkspace, name, actionMenuProps }: ActionMenuProps): React.JSX.Element;
|
|
9
|
+
export default ActionMenu;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface WorkspaceContainerProps {
|
|
3
|
+
contextKey: string;
|
|
4
|
+
overlay?: boolean;
|
|
5
|
+
showSiderailAndBottomNav?: boolean;
|
|
6
|
+
additionalWorkspaceProps?: object;
|
|
7
|
+
actionMenuProps?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Use this component to render the [workspace window](https://zeroheight.com/23a080e38/p/483a22-workspace)
|
|
11
|
+
* in an app such as the patient chart, or a workspace overlay in an app such as the clinic dashboard.
|
|
12
|
+
* This allows workspaces to be opened on the page where this component is mounted. This component
|
|
13
|
+
* must not be mounted multiple times on the same page. If there are multiple apps on a page, only
|
|
14
|
+
* one of those apps should use this component—it "hosts" the workspaces.
|
|
15
|
+
*
|
|
16
|
+
* Workspaces may be opened with the [[launchWorkspace]] function from `@openmrs/esm-framework`
|
|
17
|
+
* (among other options).
|
|
18
|
+
*
|
|
19
|
+
* The `overlay` prop determines whether the workspace is rendered as an overlay or a window.
|
|
20
|
+
* When a workspace window is opened, the other content on the screen will be pushed to the left.
|
|
21
|
+
* When an overlay is opened, it will cover other content on the screen.
|
|
22
|
+
*
|
|
23
|
+
* The context key is a string that appears in the URL, which defines the pages on which workspaces
|
|
24
|
+
* are valid. If the URL changes in a way such that it no longer contains the context key, then
|
|
25
|
+
* all workspaces will be closed. This ensures that, for example, workspaces on the home page do
|
|
26
|
+
* not stay open when the user transitions to the patient dashboard; and also that workspaces do
|
|
27
|
+
* not stay open when the user navigates to a different patient. The context key must be a valid
|
|
28
|
+
* sub-path of the URL, with no initial or trailing slash. So if the URL is
|
|
29
|
+
* `https://example.com/patient/123/foo`, then `patient` and `patient/123` and `123/foo` are valid
|
|
30
|
+
* context keys, but `patient/12` and `pati` are not.
|
|
31
|
+
*
|
|
32
|
+
* An extension slot is provided in the workspace header. Its name is derived from the `featureName` of
|
|
33
|
+
* the top-level component in which it is defined (feature names are generally provided in the lifecycle
|
|
34
|
+
* functions in an app's `index.ts` file). The slot is named `workspace-header-${featureName}-slot`.
|
|
35
|
+
* For the patient chart, this is `workspace-header-patient-chart-slot`.
|
|
36
|
+
*
|
|
37
|
+
* This component also provides the [Siderail and Bottom Nav](https://zeroheight.com/23a080e38/p/948cf1-siderail-and-bottom-nav/b/86907e).
|
|
38
|
+
* To use this, pass the `showSiderailAndBottomNav` prop. The Siderail is rendered on the right side of the screen
|
|
39
|
+
* on desktop, and the Bottom Nav is rendered at the bottom of the screen on tablet or mobile. The sidebar/bottom-nav
|
|
40
|
+
* menu provides an extension slot, to which buttons are attached as extensions. The slot
|
|
41
|
+
* derives its name from the `featureName` of the top-level component in which this `WorkspaceContainer`
|
|
42
|
+
* appears (feature names are generally provided in the lifecycle functions in an app's `index.ts` file).
|
|
43
|
+
* The slot is named `action-menu-${featureName}-items-slot`. For the patient chart, this is
|
|
44
|
+
* `action-menu-patient-chart-items-slot`.
|
|
45
|
+
*
|
|
46
|
+
* This component also provides everything needed for workspace notifications to be rendered.
|
|
47
|
+
*
|
|
48
|
+
* @param props.contextKey The context key (explained above)
|
|
49
|
+
* @param props.additionalWorkspaceProps Additional props to pass to the workspace. Using this is
|
|
50
|
+
* unusual; you will generally want to pass props to the workspace when you open it, using
|
|
51
|
+
* `launchWorkspace`. Use this only for props that will apply to every workspace launched
|
|
52
|
+
* on the page where this component is mounted.
|
|
53
|
+
*/
|
|
54
|
+
export declare function WorkspaceContainer({ contextKey, overlay, showSiderailAndBottomNav, additionalWorkspaceProps, actionMenuProps, }: WorkspaceContainerProps): React.JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type OpenWorkspace } from '../workspaces';
|
|
3
|
+
interface WorkspaceRendererProps {
|
|
4
|
+
workspace: OpenWorkspace;
|
|
5
|
+
additionalPropsFromPage?: object;
|
|
6
|
+
}
|
|
7
|
+
export declare function WorkspaceRenderer({ workspace, additionalPropsFromPage }: WorkspaceRendererProps): React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from './action-menu-button/action-menu-button.component';
|
|
2
|
+
export * from './container/workspace-container.component';
|
|
3
|
+
export { closeWorkspace, launchWorkspace, navigateAndLaunchWorkspace, useWorkspaces, launchWorkspaceGroup, } from './workspaces';
|
|
4
|
+
export { type DefaultWorkspaceProps, type CloseWorkspaceOptions, type OpenWorkspace, type WorkspacesInfo, type Prompt, } from './workspaces';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook is used to interact with the store of a workspace store.
|
|
3
|
+
* A workspace store is defined as a group of workspaces that open in the same workspace group.
|
|
4
|
+
*
|
|
5
|
+
* In case a workspace group is not active, it will be considered as a standalone workspace, and hence this hook will return an empty object and updateFunction as an empty function.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*
|
|
9
|
+
* @param {string} workspaceGroupName The workspaceGroupName of the workspace used when registering the workspace in the module's routes.json file.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useWorkspaceGroupStore(workspaceGroupName?: string): object;
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/** @module @category Workspace */
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import type { StoreApi } from 'zustand/vanilla';
|
|
4
|
+
import { type WorkspaceRegistration } from '@openmrs/esm-extensions';
|
|
5
|
+
import { type WorkspaceWindowState } from '@openmrs/esm-globals';
|
|
6
|
+
export interface CloseWorkspaceOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to close the workspace ignoring all the changes present in the workspace.
|
|
9
|
+
*
|
|
10
|
+
* If ignoreChanges is true, the user will not be prompted to save changes before closing
|
|
11
|
+
* even if the `testFcn` passed to `promptBeforeClosing` returns `true`.
|
|
12
|
+
*/
|
|
13
|
+
ignoreChanges?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If you want to take an action after the workspace is closed, you can pass your function as
|
|
16
|
+
* `onWorkspaceClose`. This function will be called only after the workspace is closed, given
|
|
17
|
+
* that the user might be shown a prompt.
|
|
18
|
+
* @returns void
|
|
19
|
+
*/
|
|
20
|
+
onWorkspaceClose?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Controls whether the workspace group should be closed and store to be
|
|
23
|
+
* cleared when this workspace is closed.
|
|
24
|
+
* Defaults to true except when opening a new workspace of the same group.
|
|
25
|
+
*
|
|
26
|
+
* @default true
|
|
27
|
+
*/
|
|
28
|
+
closeWorkspaceGroup?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** The default parameters received by all workspaces */
|
|
31
|
+
export interface DefaultWorkspaceProps {
|
|
32
|
+
/**
|
|
33
|
+
* Call this function to close the workspace. This function will prompt the user
|
|
34
|
+
* if there are any unsaved changes to workspace.
|
|
35
|
+
*
|
|
36
|
+
* You can pass `onWorkspaceClose` function to be called when the workspace is finally
|
|
37
|
+
* closed, given the user forcefully closes the workspace.
|
|
38
|
+
*/
|
|
39
|
+
closeWorkspace(closeWorkspaceOptions?: CloseWorkspaceOptions): void;
|
|
40
|
+
/**
|
|
41
|
+
* Call this with a no-args function that returns true if the user should be prompted before
|
|
42
|
+
* this workspace is closed; e.g. if there is unsaved data.
|
|
43
|
+
*/
|
|
44
|
+
promptBeforeClosing(testFcn: () => boolean): void;
|
|
45
|
+
/**
|
|
46
|
+
* Call this function to close the workspace after the form is saved. This function
|
|
47
|
+
* will directly close the workspace without any prompt
|
|
48
|
+
*/
|
|
49
|
+
closeWorkspaceWithSavedChanges(closeWorkspaceOptions?: CloseWorkspaceOptions): void;
|
|
50
|
+
/**
|
|
51
|
+
* Use this to set the workspace title if it needs to be set dynamically.
|
|
52
|
+
*
|
|
53
|
+
* Workspace titles generally are set in the workspace declaration in the routes.json file. They can also
|
|
54
|
+
* be set by the workspace launcher by passing `workspaceTitle` in the `additionalProps`
|
|
55
|
+
* parameter of the `launchWorkspace` function. This function is useful when the workspace
|
|
56
|
+
* title needs to be set dynamically.
|
|
57
|
+
*
|
|
58
|
+
* @param title The title to set. If using titleNode, set this to a human-readable string
|
|
59
|
+
* which will identify the workspace in notifications and other places.
|
|
60
|
+
* @param titleNode A React object to put in the workspace header in place of the title. This
|
|
61
|
+
* is useful for displaying custom elements in the header. Note that custom header
|
|
62
|
+
* elements can also be attached to the workspace header extension slots.
|
|
63
|
+
*/
|
|
64
|
+
setTitle(title: string, titleNode?: ReactNode): void;
|
|
65
|
+
}
|
|
66
|
+
export interface WorkspaceWindowSize {
|
|
67
|
+
size: WorkspaceWindowState;
|
|
68
|
+
}
|
|
69
|
+
export interface WorkspaceWindowSizeProviderProps {
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
}
|
|
72
|
+
export interface WorkspaceWindowSizeContext {
|
|
73
|
+
windowSize: WorkspaceWindowSize;
|
|
74
|
+
updateWindowSize?(value: WorkspaceWindowState): any;
|
|
75
|
+
active: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface Prompt {
|
|
78
|
+
title: string;
|
|
79
|
+
body: string;
|
|
80
|
+
/** Defaults to "Confirm" */
|
|
81
|
+
confirmText?: string;
|
|
82
|
+
onConfirm(): void;
|
|
83
|
+
/** Defaults to "Cancel" */
|
|
84
|
+
cancelText?: string;
|
|
85
|
+
}
|
|
86
|
+
export interface WorkspaceStoreState {
|
|
87
|
+
context: string | null;
|
|
88
|
+
openWorkspaces: Array<OpenWorkspace>;
|
|
89
|
+
prompt: Prompt | null;
|
|
90
|
+
workspaceWindowState: WorkspaceWindowState;
|
|
91
|
+
workspaceGroup?: {
|
|
92
|
+
name: string;
|
|
93
|
+
members: Array<string>;
|
|
94
|
+
cleanup?(): void;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export interface OpenWorkspace extends WorkspaceRegistration, DefaultWorkspaceProps {
|
|
98
|
+
additionalProps: object;
|
|
99
|
+
currentWorkspaceGroup?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @param name Name of the workspace
|
|
104
|
+
* @param ignoreChanges If set to true, the "unsaved changes" modal will never be shown, even if the `promptBeforeClosing` function returns true. The user will not be prompted before closing.
|
|
105
|
+
* @returns true if the workspace can be closed.
|
|
106
|
+
*/
|
|
107
|
+
export declare function canCloseWorkspaceWithoutPrompting(name: string, ignoreChanges?: boolean): boolean;
|
|
108
|
+
interface LaunchWorkspaceGroupArg {
|
|
109
|
+
state: Record<string | symbol | number, any>;
|
|
110
|
+
onWorkspaceGroupLaunch?(): void;
|
|
111
|
+
workspaceGroupCleanup?(): void;
|
|
112
|
+
workspaceToLaunch?: {
|
|
113
|
+
name: string;
|
|
114
|
+
additionalProps?: Record<string | symbol | number, any>;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Launches a workspace group with the specified name and configuration.
|
|
119
|
+
* If there are any open workspaces, it will first close them before launching the new workspace group.
|
|
120
|
+
*
|
|
121
|
+
* @param groupName - The name of the workspace group to launch
|
|
122
|
+
* @param args - Configuration object for launching the workspace group
|
|
123
|
+
* @param args.state - The initial state for the workspace group
|
|
124
|
+
* @param args.onWorkspaceGroupLaunch - Optional callback function to be executed after the workspace group is launched
|
|
125
|
+
* @param args.workspaceGroupCleanup - Optional cleanup function to be executed when the workspace group is closed
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* launchWorkspaceGroup("myGroup", {
|
|
129
|
+
* state: initialState,
|
|
130
|
+
* onWorkspaceGroupLaunch: () => console.log("Workspace group launched"),
|
|
131
|
+
* workspaceGroupCleanup: () => console.log("Cleaning up workspace group")
|
|
132
|
+
* });
|
|
133
|
+
*/
|
|
134
|
+
export declare function launchWorkspaceGroup(groupName: string, args: LaunchWorkspaceGroupArg): void;
|
|
135
|
+
/**
|
|
136
|
+
* This launches a workspace by its name. The workspace must have been registered.
|
|
137
|
+
* Workspaces should be registered in the `routes.json` file.
|
|
138
|
+
*
|
|
139
|
+
* For the workspace to appear, there must be either a `<WorkspaceOverlay />` or
|
|
140
|
+
* a `<WorkspaceWindow />` component rendered.
|
|
141
|
+
*
|
|
142
|
+
* The behavior of this function is as follows:
|
|
143
|
+
*
|
|
144
|
+
* - If no workspaces are open, or if no other workspaces with the same type are open,
|
|
145
|
+
* it will be opened and focused.
|
|
146
|
+
* - If a workspace with the same name is already open, it will be displayed/focused,
|
|
147
|
+
* if it was not already.
|
|
148
|
+
* - If a workspace is launched and a workspace which cannot be hidden is already open,
|
|
149
|
+
* a confirmation modal will pop up warning about closing the currently open workspace.
|
|
150
|
+
* - If another workspace with the same type is open, the workspace will be brought to
|
|
151
|
+
* the front and then a confirmation modal will pop up warning about closing the opened
|
|
152
|
+
* workspace
|
|
153
|
+
*
|
|
154
|
+
* Note that this function just manipulates the workspace store. The UI logic is handled
|
|
155
|
+
* by the components that display workspaces.
|
|
156
|
+
*
|
|
157
|
+
* Additional props can be passed to the workspace component being launched. Passing a
|
|
158
|
+
* prop named `workspaceTitle` will override the title of the workspace.
|
|
159
|
+
*
|
|
160
|
+
* @param name The name of the workspace to launch
|
|
161
|
+
* @param additionalProps Props to pass to the workspace component being launched. Passing
|
|
162
|
+
* a prop named `workspaceTitle` will override the title of the workspace.
|
|
163
|
+
*/
|
|
164
|
+
export declare function launchWorkspace<T extends DefaultWorkspaceProps | object = DefaultWorkspaceProps & {
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
}>(name: string, additionalProps?: Omit<T, keyof DefaultWorkspaceProps> & {
|
|
167
|
+
workspaceTitle?: string;
|
|
168
|
+
}): void;
|
|
169
|
+
/**
|
|
170
|
+
* Use this function to navigate to a new page and launch a workspace on that page.
|
|
171
|
+
*
|
|
172
|
+
* @param options.targetUrl: The URL to navigate to. Will be passed to [[navigate]].
|
|
173
|
+
* @param options.contextKey: The context key used by the target page.
|
|
174
|
+
* @param options.workspaceName: The name of the workspace to launch.
|
|
175
|
+
* @param options.additionalProps: Additional props to pass to the workspace component being launched.
|
|
176
|
+
*/
|
|
177
|
+
export declare function navigateAndLaunchWorkspace({ targetUrl, contextKey, workspaceName, additionalProps, }: {
|
|
178
|
+
targetUrl: string;
|
|
179
|
+
contextKey: string;
|
|
180
|
+
workspaceName: string;
|
|
181
|
+
additionalProps?: object;
|
|
182
|
+
}): void;
|
|
183
|
+
export declare function promptBeforeClosing(workspaceName: string, testFcn: () => boolean): void;
|
|
184
|
+
export declare function getPromptBeforeClosingFcn(workspaceName: string): any;
|
|
185
|
+
export declare function cancelPrompt(): void;
|
|
186
|
+
/**
|
|
187
|
+
* Function to close an opened workspace
|
|
188
|
+
* @param name Workspace registration name
|
|
189
|
+
* @param options Options to close workspace
|
|
190
|
+
*/
|
|
191
|
+
export declare function closeWorkspace(name: string, options?: CloseWorkspaceOptions): boolean;
|
|
192
|
+
/**
|
|
193
|
+
* The set of workspaces is specific to a particular page. This function
|
|
194
|
+
* should be used when transitioning to a new page. If the current
|
|
195
|
+
* workspace data is for a different page, the workspace state is cleared.
|
|
196
|
+
*
|
|
197
|
+
* This is called by the workspace components when they mount.
|
|
198
|
+
* @internal
|
|
199
|
+
*
|
|
200
|
+
* @param contextKey An arbitrary key to identify the current page
|
|
201
|
+
*/
|
|
202
|
+
export declare function changeWorkspaceContext(contextKey: string | null): void;
|
|
203
|
+
export declare const workspaceStore: StoreApi<WorkspaceStoreState>;
|
|
204
|
+
export declare function getWorkspaceStore(): StoreApi<WorkspaceStoreState>;
|
|
205
|
+
export declare function updateWorkspaceWindowState(value: WorkspaceWindowState): void;
|
|
206
|
+
export declare function closeAllWorkspaces(onClosingWorkspaces?: () => void, filter?: (workspace: OpenWorkspace) => boolean): void;
|
|
207
|
+
export interface WorkspacesInfo {
|
|
208
|
+
active: boolean;
|
|
209
|
+
prompt: Prompt | null;
|
|
210
|
+
workspaceWindowState: WorkspaceWindowState;
|
|
211
|
+
workspaces: Array<OpenWorkspace>;
|
|
212
|
+
workspaceGroup?: WorkspaceStoreState['workspaceGroup'];
|
|
213
|
+
}
|
|
214
|
+
export declare function useWorkspaces(): WorkspacesInfo;
|
|
215
|
+
type PromptType = 'closing-workspace' | 'closing-all-workspaces' | 'closing-workspace-launching-new-workspace';
|
|
216
|
+
/**
|
|
217
|
+
* Sets the current prompt according to the prompt type.
|
|
218
|
+
* @param promptType Determines the text and behavior of the prompt
|
|
219
|
+
* @param onConfirmation Function to be called after the user confirms to close the workspace
|
|
220
|
+
* @param workspaceTitle Workspace title to be shown in the prompt
|
|
221
|
+
* @returns
|
|
222
|
+
*/
|
|
223
|
+
export declare function showWorkspacePrompts(promptType: PromptType, onConfirmation?: () => void, workspaceTitle?: string): void;
|
|
224
|
+
export declare function resetWorkspaceStore(): void;
|
|
225
|
+
/**
|
|
226
|
+
* The workspace group store is a store that is specific to the workspace group.
|
|
227
|
+
* If the workspace has its own sidebar, the store will be created.
|
|
228
|
+
* This store can be used to store data that is specific to the workspace group.
|
|
229
|
+
* The store will be same for all the workspaces with same group name.
|
|
230
|
+
*
|
|
231
|
+
* For workspaces launched without a group, the store will be undefined.
|
|
232
|
+
*
|
|
233
|
+
* The store will be cleared when all the workspaces with the store's group name are closed.
|
|
234
|
+
*/
|
|
235
|
+
export declare function getWorkspaceGroupStore(workspaceGroupName: string | undefined, additionalProps?: object): StoreApi<object> | undefined;
|
|
236
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface WorkspaceUnsavedChangesModal {
|
|
3
|
+
onConfirm: () => void;
|
|
4
|
+
onCancel: () => void;
|
|
5
|
+
affectedWorkspaceTitles: string[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This modal is used for prompting user to confirm closing currently opened workspace.
|
|
9
|
+
*/
|
|
10
|
+
declare const Workspace2ClosePromptModal: React.FC<WorkspaceUnsavedChangesModal>;
|
|
11
|
+
export default Workspace2ClosePromptModal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-styleguide",
|
|
3
|
-
"version": "8.0.1-pre.
|
|
3
|
+
"version": "8.0.1-pre.3585",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The styleguide for OpenMRS SPA",
|
|
6
6
|
"main": "dist/openmrs-esm-styleguide.js",
|
|
@@ -98,17 +98,17 @@
|
|
|
98
98
|
"swr": "2.x"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@openmrs/esm-api": "8.0.1-pre.
|
|
102
|
-
"@openmrs/esm-config": "8.0.1-pre.
|
|
103
|
-
"@openmrs/esm-emr-api": "8.0.1-pre.
|
|
104
|
-
"@openmrs/esm-error-handling": "8.0.1-pre.
|
|
105
|
-
"@openmrs/esm-extensions": "8.0.1-pre.
|
|
106
|
-
"@openmrs/esm-globals": "8.0.1-pre.
|
|
107
|
-
"@openmrs/esm-navigation": "8.0.1-pre.
|
|
108
|
-
"@openmrs/esm-react-utils": "8.0.1-pre.
|
|
109
|
-
"@openmrs/esm-state": "8.0.1-pre.
|
|
110
|
-
"@openmrs/esm-translations": "8.0.1-pre.
|
|
111
|
-
"@openmrs/esm-utils": "8.0.1-pre.
|
|
101
|
+
"@openmrs/esm-api": "8.0.1-pre.3585",
|
|
102
|
+
"@openmrs/esm-config": "8.0.1-pre.3585",
|
|
103
|
+
"@openmrs/esm-emr-api": "8.0.1-pre.3585",
|
|
104
|
+
"@openmrs/esm-error-handling": "8.0.1-pre.3585",
|
|
105
|
+
"@openmrs/esm-extensions": "8.0.1-pre.3585",
|
|
106
|
+
"@openmrs/esm-globals": "8.0.1-pre.3585",
|
|
107
|
+
"@openmrs/esm-navigation": "8.0.1-pre.3585",
|
|
108
|
+
"@openmrs/esm-react-utils": "8.0.1-pre.3585",
|
|
109
|
+
"@openmrs/esm-state": "8.0.1-pre.3585",
|
|
110
|
+
"@openmrs/esm-translations": "8.0.1-pre.3585",
|
|
111
|
+
"@openmrs/esm-utils": "8.0.1-pre.3585",
|
|
112
112
|
"@rspack/cli": "^1.3.11",
|
|
113
113
|
"@rspack/core": "^1.3.11",
|
|
114
114
|
"@types/geopattern": "^1.2.9",
|