Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore) Bump @carbon/react and @carbon/charts #770

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/apps/esm-devtools-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
"webpack": "^5.88.0"
},
"dependencies": {
"@carbon/react": "^1.12.0"
"@carbon/react": "^1.37.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
declare module "@carbon/react";

declare namespace JSX {
interface IntrinsicElements {
"import-map-overrides-list": any;
Expand All @@ -13,3 +15,5 @@ declare module "*.scss" {
const styles: any;
export default styles;
}

declare type SideNavProps = {};
2 changes: 1 addition & 1 deletion packages/apps/esm-implementer-tools-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"access": "public"
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@carbon/react": "^1.37.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
declare module "*.css";
declare module "*.scss";
declare module "@carbon/react";
2 changes: 1 addition & 1 deletion packages/apps/esm-login-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"access": "public"
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@carbon/react": "^1.37.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ declare type Observable<T> = import("rxjs").Observable<T>;

declare module "*.css";
declare module "*.scss";
declare module "@carbon/react";
declare type SideNavProps = {};
2 changes: 1 addition & 1 deletion packages/apps/esm-offline-tools-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"access": "public"
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@carbon/react": "^1.37.0",
"lodash-es": "^4.17.21",
"swr": "^2.0.1"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/apps/esm-offline-tools-app/src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
declare module "*.svg";
declare module "*.css";
declare module "*.scss";

declare module "@carbon/react";
declare type SideNavProps = {};
declare type TileProps = {};
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { useTranslation } from "react-i18next";
import {
Button,
DataTable,
DataTableHeader,
DataTableSkeleton,
FilterRowsData,
Layer,
Link,
Pagination,
Expand Down Expand Up @@ -38,11 +36,7 @@ export interface SyncItemWithPatient {
patient?: fhir.Patient;
}

export type OfflineActionsTableHeaders =
| "createdOn"
| "patient"
| "action"
| "error";
type OfflineActionsTableHeaders = "createdOn" | "patient" | "action" | "error";

export interface OfflineActionsTableProps {
data?: Array<SyncItemWithPatient>;
Expand All @@ -65,8 +59,13 @@ const OfflineActionsTable: React.FC<OfflineActionsTableProps> = ({
const [pageSize, setPageSize] = useState(10);
const { results, currentPage, goTo } = usePagination(data);
const layout = useLayoutType();

const toolbarItemSize = isDesktop(layout) ? "sm" : undefined;
const defaultHeaders: Array<DataTableHeader<OfflineActionsTableHeaders>> = [

const defaultHeaders: Array<{
key: OfflineActionsTableHeaders;
header: string;
}> = [
{
key: "createdOn",
header: t("offlineActionsTableCreatedOn", "Date & Time"),
Expand Down Expand Up @@ -280,7 +279,7 @@ function filterTableRows({
inputValue,
// @ts-ignore `getCellId` is not in the types, but present in Carbon.
getCellId,
}: FilterRowsData) {
}) {
return rowIds.filter((rowId) =>
headers.some(({ key }) => {
const cellId = getCellId(rowId, key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import React, { useMemo, useState } from "react";
import {
Button,
DataTable,
DataTableCustomRenderProps,
DataTableSkeleton,
DenormalizedRow,
FilterRowsData,
Layer,
Search,
SearchSkeleton,
Expand Down Expand Up @@ -53,6 +50,7 @@ const OfflinePatientTable: React.FC<OfflinePatientTableProps> = ({
isInteractive,
showHeader,
}) => {
// TODO: Restore @carbon/react type annotations
const { t } = useTranslation();
const layout = useLayoutType();
const offlinePatientsSwr = useOfflinePatientsWithEntries();
Expand All @@ -64,9 +62,7 @@ const OfflinePatientTable: React.FC<OfflinePatientTableProps> = ({
const headers = useOfflinePatientTableHeaders();
const rows = useOfflinePatientTableRows(syncingPatientUuids);

const handleUpdateSelectedPatientsClick = async (
selectedRows: ReadonlyArray<DenormalizedRow>
) => {
const handleUpdateSelectedPatientsClick = async (selectedRows) => {
const selectedPatientUuids = selectedRows.map((row) => row.id);
setSyncingPatientUuids(selectedPatientUuids);
await syncSelectedOfflinePatients(selectedPatientUuids).finally(() =>
Expand All @@ -77,9 +73,7 @@ const OfflinePatientTable: React.FC<OfflinePatientTableProps> = ({
offlineRegisteredPatientsSwr.mutate();
};

const handleRemovePatientsFromOfflineListClick = async (
selectedRows: ReadonlyArray<DenormalizedRow>
) => {
const handleRemovePatientsFromOfflineListClick = async (selectedRows) => {
const closeModal = showModal("offline-tools-confirmation-modal", {
title: t(
"offlinePatientsTableDeleteConfirmationModalTitle",
Expand Down Expand Up @@ -138,7 +132,7 @@ const OfflinePatientTable: React.FC<OfflinePatientTableProps> = ({
getSelectionProps,
onInputChange,
selectedRows,
}: DataTableCustomRenderProps) => (
}) => (
<TableContainer
className={styles.tableContainer}
{...getTableContainerProps()}
Expand Down Expand Up @@ -254,7 +248,7 @@ function filterTableRows({
inputValue,
// @ts-ignore `getCellId` is not in the types, but present in Carbon.
getCellId,
}: FilterRowsData) {
}) {
return rowIds.filter((rowId) =>
headers.some(({ key }) => {
const cellId = getCellId(rowId, key);
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/esm-primary-navigation-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"access": "public"
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@carbon/react": "^1.37.0",
"lodash-es": "^4.17.21"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module "*.css";
declare module "*.scss";
declare module "@carbon/react";
declare type HeaderPanelProps = {};
declare type SideNavProps = {
denniskigen marked this conversation as resolved.
Show resolved Hide resolved
isChildOfHeader: boolean;
};

This file was deleted.

29 changes: 27 additions & 2 deletions packages/framework/esm-framework/docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
- [formatDate](API.md#formatdate)
- [formatDatetime](API.md#formatdatetime)
- [formatTime](API.md#formattime)
- [getLocale](API.md#getlocale)
- [isOmrsDateStrict](API.md#isomrsdatestrict)
- [isOmrsDateToday](API.md#isomrsdatetoday)
- [parseDate](API.md#parsedate)
Expand Down Expand Up @@ -818,6 +819,16 @@ and *must* only be used once within that `<ExtensionSlot>`.

___

### OpenmrsDatePicker

• `Const` **OpenmrsDatePicker**: `React.FC`<`OpenmrsDatePickerProps`\>

#### Defined in

[packages/framework/esm-styleguide/src/datepicker/openmrs/openmrs-date-picker.component.tsx:41](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-styleguide/src/datepicker/openmrs/openmrs-date-picker.component.tsx#L41)

___

### backendDependencies

• `Const` **backendDependencies**: `Object`
Expand All @@ -839,7 +850,7 @@ ___

### LeftNavMenu

• `Const` **LeftNavMenu**: `ForwardRefExoticComponent`<`Pick`<`SideNavProps`, `string` \| `number` \| `symbol`\> & `RefAttributes`<`HTMLElement`\>\>
• `Const` **LeftNavMenu**: `ForwardRefExoticComponent`<`RefAttributes`<`HTMLElement`\>\>

#### Defined in

Expand Down Expand Up @@ -1969,6 +1980,20 @@ Formats the input as a time, according to the current locale.

___

### getLocale

▸ **getLocale**(): `string`

#### Returns

`string`

#### Defined in

[packages/framework/esm-utils/src/omrs-dates.ts:269](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-utils/src/omrs-dates.ts#L269)

___

### isOmrsDateStrict

▸ **isOmrsDateStrict**(`omrsPayloadString`): `boolean`
Expand Down Expand Up @@ -2383,7 +2408,7 @@ An array of extensions assigned to the named slot

#### Defined in

[packages/framework/esm-extensions/src/extensions.ts:373](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L373)
[packages/framework/esm-extensions/src/extensions.ts:375](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-extensions/src/extensions.ts#L375)

___

Expand Down
4 changes: 2 additions & 2 deletions packages/framework/esm-styleguide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"access": "public"
},
"dependencies": {
"@carbon/charts": "^1.6.3",
"@carbon/react": "^1.12.0",
"@carbon/charts": "^1.12.0",
"@carbon/react": "^1.37.0",
"@internationalized/date": "^3.2.0",
"@react-spectrum/datepicker": "^3.5.0",
"@react-spectrum/provider": "^3.7.1",
Expand Down
2 changes: 2 additions & 0 deletions packages/framework/esm-styleguide/src/declarations.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
declare module "@carbon/react";
declare module "*.svg" {
const content: string;
export = content;
}
declare module "*.css";
declare module "*.scss";
declare type SideNavProps = {};
2 changes: 1 addition & 1 deletion packages/shell/esm-app-shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"access": "public"
},
"dependencies": {
"@carbon/react": "^1.12.0",
"@carbon/react": "^1.37.0",
"@openmrs/esm-framework": "5.1.0",
"@openmrs/esm-styleguide": "5.1.0",
"dayjs": "^1.10.4",
Expand Down
Loading
Loading