File tree

10 files changed

+492
-44
lines changed

10 files changed

+492
-44
lines changed
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const path = require('path')
88
const globby = require('globby')
99
const pkg = require('../package.json')
1010

11-
const GLOB = ['src/components/**/*.tsx']
11+
const GLOB = ['**/src/**/*.tsx']
1212
const GLOBBY_OPTIONS = {
1313
absolute: true,
14-
cwd: path.join(__dirname, '..', '..', 'coreui-react'),
14+
cwd: path.join(__dirname, '..', '..'),
1515
gitignore: true,
16-
ignore: ['**/__tests__/**'],
16+
ignore: ['**/docs/**', '**/__tests__/**'],
1717
}
1818
const EXCLUDED_FILES = []
1919

@@ -27,12 +27,13 @@ async function createMdx(file, filename, name, props) {
2727
if (typeof props === 'undefined') return
2828

2929
const pro = PRO_COMPONENTS.some((v) => file.includes(v))
30+
const relativeFilename = file.replace(GLOBBY_OPTIONS.cwd, '').replace('coreui-', '')
3031

3132
let content = `
3233
\`\`\`jsx
33-
import { ${name} } from '@coreui/react${pro ? '-pro' : ''}'
34+
import { ${name} } from '@coreui/${relativeFilename.split('/')[1]}${pro ? '-pro' : ''}'
3435
// or
35-
import ${name} from '@coreui/react${pro ? '-pro' : ''}${file.replace('.tsx', '').replace(GLOBBY_OPTIONS.cwd, '')}'
36+
import ${name} from '@coreui${relativeFilename.replace('.tsx', '')}'
3637
\`\`\`\n
3738
`
3839

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
```jsx
3+
import { CChart } from '@coreui/react-chartjs'
4+
// or
5+
import CChart from '@coreui/react-chartjs/src/CChart'
6+
```
7+
8+
| Property | Description | Type | Default |
9+
| --- | --- | --- | --- |
10+
| **className** | A string of all className you want applied to the base component. | `string` | - |
11+
| **customTooltips** | Enables custom html based tooltips instead of standard tooltips. | `boolean` | true |
12+
| **data** | The data object that is passed into the Chart.js chart (more info). | `ChartData<keyof ChartTypeRegistry, (number` \| `ScatterDataPoint` \| `BubbleDataPoint)[], unknown>` \| `((canvas: HTMLCanvasElement) => ChartData<...>)` | - |
13+
| **fallbackContent** | A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions.<br/><br/>{@link https ://www.chartjs.org/docs/latest/general/accessibility.html More Info} | `any` | - |
14+
| **getDatasetAtEvent** | Proxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event. | `(dataset: InteractionItem[], event: any) => void` | - |
15+
| **getElementAtEvent** | Proxy for Chart.js getElementAtEvent. Calls with single element array and triggering event. | `(element: InteractionItem[], event: any) => void` | - |
16+
| **getElementsAtEvent** | Proxy for Chart.js getElementsAtEvent. Calls with element array and triggering event. | `(elements: InteractionItem[], event: any) => void` | - |
17+
| **height** | Height attribute applied to the rendered canvas. | `number` | 150 |
18+
| **id** | ID attribute applied to the rendered canvas. | `string` | - |
19+
| **options** | The options object that is passed into the Chart.js chart.<br/><br/>{@link https ://www.chartjs.org/docs/latest/general/options.html More Info} | `_DeepPartialObject<CoreChartOptions<keyof ChartTypeRegistry> & ElementChartOptions<keyof ChartTypeRegistry> & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>>` | - |
20+
| **plugins** | The plugins array that is passed into the Chart.js chart (more info)<br/><br/>{@link https ://www.chartjs.org/docs/latest/developers/plugins.html More Info} | `Plugin<keyof ChartTypeRegistry, AnyObject>[]` | - |
21+
| **redraw** | If true, will tear down and redraw chart on all updates. | `boolean` | false |
22+
| **type** | Chart.js chart type. | `{'line'` \| `'bar'` \| `'radar'` \| `'doughnut'` \| `'polarArea'` \| `'bubble'` \| `'pie'` \| `'scatter'}` | - |
23+
| **width** | Width attribute applied to the rendered canvas. | `number` | 300 |
24+
| **wrapper** | Put the chart into the wrapper div element. | `boolean` | true |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
```jsx
3+
import { CChartBar } from '@coreui/react-chartjs'
4+
// or
5+
import CChartBar from '@coreui/react-chartjs/src/CCharts'
6+
```
7+
8+
| Property | Description | Type | Default |
9+
| --- | --- | --- | --- |
10+
| **className** | A string of all className you want applied to the base component. | `string` | - |
11+
| **customTooltips** | Enables custom html based tooltips instead of standard tooltips. | `boolean` | true |
12+
| **data** | The data object that is passed into the Chart.js chart (more info). | `ChartData<keyof ChartTypeRegistry, (number` \| `ScatterDataPoint` \| `BubbleDataPoint)[], unknown>` \| `((canvas: HTMLCanvasElement) => ChartData<...>)` | - |
13+
| **fallbackContent** | A fallback for when the canvas cannot be rendered. Can be used for accessible chart descriptions.<br/><br/>{@link https ://www.chartjs.org/docs/latest/general/accessibility.html More Info} | `any` | - |
14+
| **getDatasetAtEvent** | Proxy for Chart.js getDatasetAtEvent. Calls with dataset and triggering event. | `(dataset: InteractionItem[], event: any) => void` | - |
15+
| **getElementAtEvent** | Proxy for Chart.js getElementAtEvent. Calls with single element array and triggering event. | `(element: InteractionItem[], event: any) => void` | - |
16+
| **getElementsAtEvent** | Proxy for Chart.js getElementsAtEvent. Calls with element array and triggering event. | `(elements: InteractionItem[], event: any) => void` | - |
17+
| **height** | Height attribute applied to the rendered canvas. | `number` | 150 |
18+
| **id** | ID attribute applied to the rendered canvas. | `string` | - |
19+
| **options** | The options object that is passed into the Chart.js chart.<br/><br/>{@link https ://www.chartjs.org/docs/latest/general/options.html More Info} | `_DeepPartialObject<CoreChartOptions<keyof ChartTypeRegistry> & ElementChartOptions<keyof ChartTypeRegistry> & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>>` | - |
20+
| **plugins** | The plugins array that is passed into the Chart.js chart (more info)<br/><br/>{@link https ://www.chartjs.org/docs/latest/developers/plugins.html More Info} | `Plugin<keyof ChartTypeRegistry, AnyObject>[]` | - |
21+
| **redraw** | If true, will tear down and redraw chart on all updates. | `boolean` | false |
22+
| **type** | Chart.js chart type. | `{'line'` \| `'bar'` \| `'radar'` \| `'doughnut'` \| `'polarArea'` \| `'bubble'` \| `'pie'` \| `'scatter'}` | - |
23+
| **width** | Width attribute applied to the rendered canvas. | `number` | 300 |
24+
| **wrapper** | Put the chart into the wrapper div element. | `boolean` | true |
This file was deleted.

0 commit comments

Comments
 (0)