2.2.0 • Published 23 days ago

@itwin/synchronization-report-react v2.2.0

Weekly downloads
-
License
-
Repository
-
Last release
23 days ago

@itwin/synchronization-report-react

Usage

1. Installation

npm i @itwin/synchronization-report-react
yarn add @itwin/synchronization-report-react

2. Imports

Import the component and styles.

import { Report } from '@itwin/synchronization-report-react';
import '@itwin/synchronization-report-react/style.css';

Export maps

If you get an error that style.css can not be found, it might be because your project cannot handle export maps correctly. You can work around this by importing from the actual path (i.e. dist folder):

import '@itwin/synchronization-report-react/dist/style.css';

3. Basic usage

Simply pass your report data and workflow mapping into the Report component.

export const App = () => {
  // ... load report data

  return (
    <>
      <Report data={report} workflowMapping={mapping} />
    </>
  );
};

4. Advanced usage

This package uses a composition approach to provide extreme flexibility. Smaller components are exported and can be passed as children of Report, which makes the report data available through the context API without prop drilling. However, most of the smaller components do accept props to allow using outside Report.

Additionally, all the smaller components also support these props:

  • displayStrings for localization and for modifying verbiage.
  • className for specifying custom styles.
  • rest props for specifying any delegated props (e.g. data or aria attributes).
export const App = () => {
  // ... load report data

  return (
    <Report data={reportData} workflowMapping={mapping}>
      <ReportTitleWrapper>
        <ReportTitle />
        <ReportDebugIds />
      </ReportTitleWrapper>
      <ReportHeaderBannerWrapper>
        <ReportTimestamp />
        <ReportBanner />
      </ReportHeaderBannerWrapper>
      <ReportTableSelectWrapper>
        <Label as='span'>Issues Found</Label>
        <ReportTableSelect />
      </ReportTableSelectWrapper>
      <ReportInfoPanelWrapper>
          <ProblemsTable />
        <ReportInfoPanel />
      </ReportInfoPanelWrapper>
    </Report>
  );
};

Development

This project was bootstrapped with Vite and uses Yarn v3 without PnP.

The actual components are located in src/components/ and are used by the test app located at src/App.tsx.

You can open the test app in Stackblitz without cloning the repo:

Open in Stackblitz

Available scripts

yarn start

Runs the test app in the development mode.\ Open http://localhost:3000 to view it in the browser.

yarn test

Launches the Cypress test runner environment.\ See the section about component testing for more information.

yarn build

Generates bundled output in the dist/ directory.\ Three files are generated — one each for the ES module, type declarations, and styles.

2.2.0

23 days ago

2.1.19

1 month ago

2.1.18

3 months ago

2.1.17

3 months ago

2.1.16

3 months ago

2.1.15

4 months ago

2.1.14

4 months ago

2.1.13-dev.0

4 months ago

2.1.12-dev.2

4 months ago

2.1.13

4 months ago

2.1.12-dev.1

4 months ago

2.1.11-dev.0

5 months ago

2.1.11

5 months ago

2.1.2

8 months ago

2.1.0-dev.4.0.4

10 months ago

2.1.1

8 months ago

2.1.0-dev.4.0.3

10 months ago

2.1.4

8 months ago

2.1.0-dev.4.1.5

9 months ago

2.1.3

8 months ago

2.1.0-dev.4.0.5

9 months ago

2.1.5

8 months ago

2.1.8

7 months ago

2.1.0-dev.4.0.2

10 months ago

2.1.7

7 months ago

2.1.0-dev.4.0.1

10 months ago

2.1.0-dev.4

10 months ago

2.1.9

6 months ago

2.1.8-dev.0

6 months ago

2.1.10

5 months ago

2.1.0-dev.3

11 months ago

2.1.0-dev.0

12 months ago

2.1.0-dev.2

11 months ago

2.1.0-dev.1

12 months ago

2.0.2

12 months ago

2.0.1

12 months ago

1.1.1

1 year ago

1.1.0

1 year ago

2.0.0

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.3

1 year ago

0.2.0

2 years ago

0.1.0

2 years ago