-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge branch 'main' into next
- Loading branch information
Showing
224 changed files
with
9,817 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
packages/core/client/src/schema-component/antd/variable/demos/demo1.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/node_modules | ||
/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @gemel/plugin-add-custom-charts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './dist/client'; | ||
export { default } from './dist/client'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/client/index.js'); |
19 changes: 19 additions & 0 deletions
19
packages/plugins/@gemel/plugin-add-custom-charts/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "@gemel/plugin-add-custom-charts", | ||
"version": "1.4.0-alpha.15", | ||
"main": "dist/server/index.js", | ||
"displayName": "Add Custom Charts", | ||
"displayName.zh-CN": "添加自定义图表", | ||
"description": "Add custom charts", | ||
"description.zh-CN": "添加自定义图表", | ||
"peerDependencies": { | ||
"@nocobase/client": "1.x", | ||
"@nocobase/server": "1.x", | ||
"@nocobase/test": "1.x" | ||
}, | ||
"devDependencies": { | ||
"deepmerge": "^4.3.1", | ||
"echarts": "^5.5.1", | ||
"echarts-for-react": "^3.0.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './dist/server'; | ||
export { default } from './dist/server'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/server/index.js'); |
249 changes: 249 additions & 0 deletions
249
packages/plugins/@gemel/plugin-add-custom-charts/src/client/client.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,249 @@ | ||
/** | ||
* This file is part of the NocoBase (R) project. | ||
* Copyright (c) 2020-2024 NocoBase Co., Ltd. | ||
* Authors: NocoBase Team. | ||
* | ||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. | ||
* For more information, please refer to: https://www.nocobase.com/agreement. | ||
*/ | ||
|
||
// CSS modules | ||
type CSSModuleClasses = { readonly [key: string]: string }; | ||
|
||
declare module '*.module.css' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.scss' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.sass' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.less' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.styl' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.stylus' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.pcss' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
declare module '*.module.sss' { | ||
const classes: CSSModuleClasses; | ||
export default classes; | ||
} | ||
|
||
// CSS | ||
declare module '*.css' { } | ||
declare module '*.scss' { } | ||
declare module '*.sass' { } | ||
declare module '*.less' { } | ||
declare module '*.styl' { } | ||
declare module '*.stylus' { } | ||
declare module '*.pcss' { } | ||
declare module '*.sss' { } | ||
|
||
// Built-in asset types | ||
// see `src/node/constants.ts` | ||
|
||
// images | ||
declare module '*.apng' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.png' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.jpg' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.jpeg' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.jfif' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.pjpeg' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.pjp' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.gif' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.svg' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.ico' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.webp' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.avif' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
// media | ||
declare module '*.mp4' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.webm' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.ogg' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.mp3' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.wav' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.flac' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.aac' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.opus' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.mov' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.m4a' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.vtt' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
// fonts | ||
declare module '*.woff' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.woff2' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.eot' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.ttf' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.otf' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
// other | ||
declare module '*.webmanifest' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.pdf' { | ||
const src: string; | ||
export default src; | ||
} | ||
declare module '*.txt' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
// wasm?init | ||
declare module '*.wasm?init' { | ||
const initWasm: (options?: WebAssembly.Imports) => Promise<WebAssembly.Instance>; | ||
export default initWasm; | ||
} | ||
|
||
// web worker | ||
declare module '*?worker' { | ||
const workerConstructor: { | ||
new(options?: { name?: string }): Worker; | ||
}; | ||
export default workerConstructor; | ||
} | ||
|
||
declare module '*?worker&inline' { | ||
const workerConstructor: { | ||
new(options?: { name?: string }): Worker; | ||
}; | ||
export default workerConstructor; | ||
} | ||
|
||
declare module '*?worker&url' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
declare module '*?sharedworker' { | ||
const sharedWorkerConstructor: { | ||
new(options?: { name?: string }): SharedWorker; | ||
}; | ||
export default sharedWorkerConstructor; | ||
} | ||
|
||
declare module '*?sharedworker&inline' { | ||
const sharedWorkerConstructor: { | ||
new(options?: { name?: string }): SharedWorker; | ||
}; | ||
export default sharedWorkerConstructor; | ||
} | ||
|
||
declare module '*?sharedworker&url' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
declare module '*?raw' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
declare module '*?url' { | ||
const src: string; | ||
export default src; | ||
} | ||
|
||
declare module '*?inline' { | ||
const src: string; | ||
export default src; | ||
} |
19 changes: 19 additions & 0 deletions
19
packages/plugins/@gemel/plugin-add-custom-charts/src/client/echarts/ReactEcharts.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* This file is part of the NocoBase (R) project. | ||
* Copyright (c) 2020-2024 NocoBase Co., Ltd. | ||
* Authors: NocoBase Team. | ||
* | ||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. | ||
* For more information, please refer to: https://www.nocobase.com/agreement. | ||
*/ | ||
|
||
import React, { useEffect } from 'react'; | ||
import ReactEChartsComponent, { EChartsInstance, EChartsReactProps } from 'echarts-for-react'; | ||
|
||
export const ReactECharts = (props: EChartsReactProps['option']) => { | ||
const echartRef = React.useRef<EChartsInstance>(); | ||
useEffect(() => { | ||
echartRef.current?.resize(); | ||
}); | ||
return <ReactEChartsComponent option={props} ref={(e) => (echartRef.current = e)} />; | ||
}; |
51 changes: 51 additions & 0 deletions
51
packages/plugins/@gemel/plugin-add-custom-charts/src/client/echarts/bar.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* This file is part of the NocoBase (R) project. | ||
* Copyright (c) 2020-2024 NocoBase Co., Ltd. | ||
* Authors: NocoBase Team. | ||
* | ||
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License. | ||
* For more information, please refer to: https://www.nocobase.com/agreement. | ||
*/ | ||
|
||
import { RenderProps } from '@nocobase/plugin-data-visualization/client'; | ||
import { ECharts } from './echarts'; | ||
|
||
export class Bar extends ECharts { | ||
constructor() { | ||
super({ | ||
name: 'bar', | ||
title: 'Bar Chart', | ||
series: { type: 'bar' }, | ||
}); | ||
this.config = [ | ||
{ | ||
configType: 'field', | ||
title: 'xField', | ||
}, | ||
{ | ||
configType: 'field', | ||
title: 'yField', | ||
}, | ||
'seriesField', | ||
]; | ||
} | ||
|
||
getProps({ data, general, advanced, fieldProps }: RenderProps) { | ||
const props = super.getProps({ data, general, advanced, fieldProps }); | ||
const xLabel = fieldProps[general.xField]?.label; | ||
const yLabel = fieldProps[general.yField]?.label; | ||
props.xAxis = { | ||
...props.xAxis, | ||
type: 'value', | ||
name: xLabel, | ||
}; | ||
props.yAxis = { | ||
...props.yAxis, | ||
name: yLabel, | ||
}; | ||
|
||
return props; | ||
} | ||
} | ||
|
||
new Bar(); |
Oops, something went wrong.