mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-01-30 13:50:55 +08:00
Merge branch 'develop' into main
This commit is contained in:
commit
518f7fdc7e
2
.pnp.cjs
generated
2
.pnp.cjs
generated
@ -3113,6 +3113,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@emotion/jest", "virtual:573fe255dffc9c89f4f7aa60da718603753ee98acc55d6772bbd0ebdcf07f9183fb8e54b4f3f2246c538a14ead402db8d2e076039c667d1538702638a0cc87b8#npm:11.9.1"],\
|
||||
["@lowdefy/block-dev", "workspace:packages/utils/block-dev"],\
|
||||
["@lowdefy/block-utils", "workspace:packages/utils/block-utils"],\
|
||||
["@lowdefy/helpers", "workspace:packages/utils/helpers"],\
|
||||
["@lowdefy/jest-yaml-transform", "workspace:packages/utils/jest-yaml-transform"],\
|
||||
["@swc/cli", "virtual:babee6e81435a5d101529cd67f2c6b175f4db37a4ab0b58df15adf73dd11be8917ac14caf44ab4e6882a92c61661055072365b349016e85173e049f006fc2305#npm:0.1.57"],\
|
||||
["@swc/core", "npm:1.2.194"],\
|
||||
@ -3917,6 +3918,7 @@ function $$SETUP_STATE(hydrateRuntimeState, basePath) {
|
||||
["@lowdefy/server-dev", "workspace:packages/server-dev"],\
|
||||
["@lowdefy/actions-core", "workspace:packages/plugins/actions/actions-core"],\
|
||||
["@lowdefy/api", "workspace:packages/api"],\
|
||||
["@lowdefy/blocks-aggrid", "workspace:packages/plugins/blocks/blocks-aggrid"],\
|
||||
["@lowdefy/blocks-antd", "workspace:packages/plugins/blocks/blocks-antd"],\
|
||||
["@lowdefy/blocks-basic", "workspace:packages/plugins/blocks/blocks-basic"],\
|
||||
["@lowdefy/blocks-color-selectors", "workspace:packages/plugins/blocks/blocks-color-selectors"],\
|
||||
|
@ -55,6 +55,7 @@
|
||||
"@ag-grid-community/core": "27.3.0",
|
||||
"@ag-grid-community/react": "27.3.0",
|
||||
"@lowdefy/block-utils": "4.0.0-alpha.18",
|
||||
"@lowdefy/helpers": "4.0.0-alpha.18",
|
||||
"react": "18.1.0",
|
||||
"react-dom": "18.1.0"
|
||||
},
|
||||
|
@ -18,6 +18,8 @@ import React from 'react';
|
||||
|
||||
import { AgGridReact } from '@ag-grid-community/react';
|
||||
import { AllCommunityModules } from '@ag-grid-community/all-modules';
|
||||
import { renderHtml } from '@lowdefy/block-utils';
|
||||
import { type } from '@lowdefy/helpers';
|
||||
|
||||
class AgGrid extends React.Component {
|
||||
constructor(props) {
|
||||
@ -121,10 +123,24 @@ class AgGrid extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { quickFilterValue, ...someProperties } = this.props.properties;
|
||||
const { quickFilterValue, columnDefs, ...someProperties } = this.props.properties;
|
||||
if (quickFilterValue && quickFilterValue === '') {
|
||||
this.gridApi.setQuickFilter(quickFilterValue); // check if empty string matches all
|
||||
}
|
||||
const newColDefs = (columnDefs || []).map((col) => {
|
||||
if (type.isFunction(col.cellRenderer)) {
|
||||
return {
|
||||
...col,
|
||||
cellRenderer: (params) => {
|
||||
return renderHtml({
|
||||
html: col.cellRenderer(params),
|
||||
methods: this.props.methods,
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
return col;
|
||||
});
|
||||
return (
|
||||
<AgGridReact
|
||||
onFilterChanged={this.onFilterChanged}
|
||||
@ -134,6 +150,7 @@ class AgGrid extends React.Component {
|
||||
onCellClicked={this.onCellClicked}
|
||||
onGridReady={this.onGridReady}
|
||||
modules={AllCommunityModules}
|
||||
columnDefs={newColDefs}
|
||||
{...someProperties}
|
||||
/>
|
||||
);
|
||||
|
@ -18,6 +18,8 @@ import React from 'react';
|
||||
|
||||
import { AgGridReact } from '@ag-grid-community/react';
|
||||
import { AllCommunityModules } from '@ag-grid-community/all-modules';
|
||||
import { renderHtml } from '@lowdefy/block-utils';
|
||||
import { type } from '@lowdefy/helpers';
|
||||
|
||||
class AgGridInput extends React.Component {
|
||||
constructor(props) {
|
||||
@ -170,10 +172,24 @@ class AgGridInput extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { quickFilterValue, ...someProperties } = this.props.properties;
|
||||
const { quickFilterValue, columnDefs, ...someProperties } = this.props.properties;
|
||||
if (quickFilterValue && quickFilterValue === '') {
|
||||
this.gridApi.setQuickFilter(quickFilterValue); // check if empty string matches all
|
||||
}
|
||||
const newColDefs = (columnDefs || []).map((col) => {
|
||||
if (type.isFunction(col.cellRenderer)) {
|
||||
return {
|
||||
...col,
|
||||
cellRenderer: (params) => {
|
||||
return renderHtml({
|
||||
html: col.cellRenderer(params),
|
||||
methods: this.props.methods,
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
return col;
|
||||
});
|
||||
return (
|
||||
<AgGridReact
|
||||
onSelectionChanged={this.onSelectionChanged}
|
||||
@ -185,6 +201,7 @@ class AgGridInput extends React.Component {
|
||||
onCellValueChanged={this.onCellValueChanged}
|
||||
postSort={this.postSort}
|
||||
modules={AllCommunityModules}
|
||||
columnDefs={newColDefs}
|
||||
{...someProperties}
|
||||
rowData={this.props.value}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user