Skip to content

Commit

Permalink
chore: merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
ldq1220 committed Dec 24, 2024
2 parents 297a765 + 37d5d14 commit e944db5
Show file tree
Hide file tree
Showing 224 changed files with 9,817 additions and 10 deletions.
4 changes: 1 addition & 3 deletions lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"version": "1.5.0-beta.15",
"npmClient": "yarn",
"useWorkspaces": true,
"npmClientArgs": [
"--ignore-engines"
],
"npmClientArgs": ["--ignore-engines"],
"command": {
"version": {
"forcePublish": true,
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@
"*.{js,json}": [
"prettier --write"
],
"*.ts?(x)": [
"eslint --fix"
]
"*.ts?(x)": []
},
"devDependencies": {
"@commitlint/cli": "^16.1.0",
Expand All @@ -91,4 +89,4 @@
"yarn": "1.22.19"
},
"dependencies": {}
}
}
2 changes: 1 addition & 1 deletion packages/core/client/src/locale/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1040,4 +1040,4 @@
"Please add or select record":"请添加或选择数据",
"No data":"暂无数据",
"Fields can only be used correctly if they are defined with an interface.": "只有字段设置了interface字段才能正常使用"
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import { FormItem } from '@formily/antd-v5';
import { SchemaComponent, SchemaComponentProvider, Variable } from '@nocobase/client';
import React from 'react';
Expand Down
2 changes: 2 additions & 0 deletions packages/plugins/@gemel/plugin-add-custom-charts/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/src
1 change: 1 addition & 0 deletions packages/plugins/@gemel/plugin-add-custom-charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @gemel/plugin-add-custom-charts
2 changes: 2 additions & 0 deletions packages/plugins/@gemel/plugin-add-custom-charts/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './dist/client';
export { default } from './dist/client';
1 change: 1 addition & 0 deletions packages/plugins/@gemel/plugin-add-custom-charts/client.js
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 packages/plugins/@gemel/plugin-add-custom-charts/package.json
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"
}
}
2 changes: 2 additions & 0 deletions packages/plugins/@gemel/plugin-add-custom-charts/server.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './dist/server';
export { default } from './dist/server';
1 change: 1 addition & 0 deletions packages/plugins/@gemel/plugin-add-custom-charts/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./dist/server/index.js');
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;
}
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)} />;
};
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();
Loading

0 comments on commit e944db5

Please sign in to comment.