@lowdefy/blocks-aggrid 4.7.3 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AgGrid.js +12 -12
- package/dist/AgGridInput.js +11 -11
- package/dist/LoadingOverlay.js +42 -0
- package/dist/ag-grid-antd.module.css +107 -0
- package/dist/blocks/AgGridAlpine/AgGridAlpine.js +12 -14
- package/dist/blocks/AgGridAlpine/meta.js +407 -0
- package/dist/blocks/AgGridBalham/AgGridBalham.js +12 -14
- package/dist/blocks/AgGridBalham/meta.js +407 -0
- package/dist/blocks/AgGridInputAlpine/AgGridInputAlpine.js +12 -15
- package/dist/blocks/AgGridInputAlpine/meta.js +441 -0
- package/dist/blocks/AgGridInputBalham/AgGridInputBalham.js +12 -15
- package/dist/blocks/AgGridInputBalham/meta.js +441 -0
- package/dist/blocks/AgGridInputMaterial/AgGridInputMaterial.js +12 -15
- package/dist/blocks/AgGridInputMaterial/meta.js +441 -0
- package/dist/blocks/AgGridMaterial/AgGridMaterial.js +12 -14
- package/dist/blocks/AgGridMaterial/meta.js +407 -0
- package/dist/blocks.js +0 -4
- package/dist/cellRenderers/AvatarCell.js +115 -0
- package/dist/cellRenderers/BooleanCell.js +31 -0
- package/dist/cellRenderers/DateCell.js +36 -0
- package/dist/cellRenderers/EllipsisCell.js +37 -0
- package/dist/cellRenderers/LinkCell.js +68 -0
- package/dist/{blocks/AgGridAlpineDark/e2e.js → cellRenderers/NullCell.js} +10 -2
- package/dist/cellRenderers/NumberCell.js +76 -0
- package/dist/cellRenderers/ProgressCell.js +68 -0
- package/dist/cellRenderers/TagCell.js +67 -0
- package/dist/cellRenderers/index.js +34 -0
- package/dist/cellRenderers/resolveFieldRefs.js +40 -0
- package/dist/e2e.js +0 -4
- package/dist/{schemas.js → metas.js} +6 -10
- package/dist/processColDefs.js +80 -3
- package/dist/types.js +4 -16
- package/package.json +16 -11
- package/dist/blocks/AgGridAlpine/schema.js +0 -125
- package/dist/blocks/AgGridAlpine/schema.json +0 -105
- package/dist/blocks/AgGridAlpine/style.less +0 -18
- package/dist/blocks/AgGridAlpineDark/AgGridAlpineDark.js +0 -39
- package/dist/blocks/AgGridAlpineDark/schema.js +0 -125
- package/dist/blocks/AgGridAlpineDark/schema.json +0 -105
- package/dist/blocks/AgGridAlpineDark/style.less +0 -18
- package/dist/blocks/AgGridBalham/schema.js +0 -125
- package/dist/blocks/AgGridBalham/schema.json +0 -105
- package/dist/blocks/AgGridBalham/style.less +0 -18
- package/dist/blocks/AgGridBalhamDark/AgGridBalhamDark.js +0 -39
- package/dist/blocks/AgGridBalhamDark/e2e.js +0 -16
- package/dist/blocks/AgGridBalhamDark/schema.js +0 -125
- package/dist/blocks/AgGridBalhamDark/schema.json +0 -105
- package/dist/blocks/AgGridBalhamDark/style.less +0 -18
- package/dist/blocks/AgGridInputAlpine/schema.js +0 -146
- package/dist/blocks/AgGridInputAlpine/schema.json +0 -123
- package/dist/blocks/AgGridInputAlpine/style.less +0 -18
- package/dist/blocks/AgGridInputAlpineDark/AgGridInputAlpineDark.js +0 -44
- package/dist/blocks/AgGridInputAlpineDark/e2e.js +0 -16
- package/dist/blocks/AgGridInputAlpineDark/schema.js +0 -146
- package/dist/blocks/AgGridInputAlpineDark/schema.json +0 -123
- package/dist/blocks/AgGridInputAlpineDark/style.less +0 -18
- package/dist/blocks/AgGridInputBalham/schema.js +0 -146
- package/dist/blocks/AgGridInputBalham/schema.json +0 -123
- package/dist/blocks/AgGridInputBalham/style.less +0 -18
- package/dist/blocks/AgGridInputBalhamDark/AgGridInputBalhamDark.js +0 -44
- package/dist/blocks/AgGridInputBalhamDark/e2e.js +0 -16
- package/dist/blocks/AgGridInputBalhamDark/schema.js +0 -146
- package/dist/blocks/AgGridInputBalhamDark/schema.json +0 -123
- package/dist/blocks/AgGridInputBalhamDark/style.less +0 -18
- package/dist/blocks/AgGridInputMaterial/schema.js +0 -146
- package/dist/blocks/AgGridInputMaterial/schema.json +0 -123
- package/dist/blocks/AgGridInputMaterial/style.less +0 -18
- package/dist/blocks/AgGridMaterial/schema.js +0 -125
- package/dist/blocks/AgGridMaterial/schema.json +0 -105
- package/dist/blocks/AgGridMaterial/style.less +0 -18
package/dist/AgGrid.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -18,6 +18,7 @@ import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-mod
|
|
|
18
18
|
import { CsvExportModule } from '@ag-grid-community/csv-export';
|
|
19
19
|
import processColDefs from './processColDefs.js';
|
|
20
20
|
import assignRowId from './assignRowId.js';
|
|
21
|
+
import LoadingOverlay from './LoadingOverlay.js';
|
|
21
22
|
const AgGrid = ({ properties, methods, loading, events })=>{
|
|
22
23
|
const { quickFilterValue, columnDefs, defaultColDef, rowData: newRowData, ...someProperties } = properties;
|
|
23
24
|
const [rowData, setRowData] = useState(newRowData ?? []);
|
|
@@ -118,14 +119,6 @@ const AgGrid = ({ properties, methods, loading, events })=>{
|
|
|
118
119
|
}
|
|
119
120
|
gridRef.current.columnApi.autoSizeColumns(allColumnIds, skipHeader);
|
|
120
121
|
});
|
|
121
|
-
if (gridRef.current.api) {
|
|
122
|
-
if (loading) {
|
|
123
|
-
gridRef.current.api.showLoadingOverlay();
|
|
124
|
-
}
|
|
125
|
-
if (!loading) {
|
|
126
|
-
gridRef.current.api.hideOverlay();
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
122
|
}, []);
|
|
130
123
|
useEffect(()=>{
|
|
131
124
|
if (JSON.stringify(rowData) !== JSON.stringify(newRowData)) {
|
|
@@ -137,7 +130,13 @@ const AgGrid = ({ properties, methods, loading, events })=>{
|
|
|
137
130
|
if (quickFilterValue && quickFilterValue === '') {
|
|
138
131
|
gridRef.current.api.setQuickFilter(quickFilterValue); // check if empty string matches all
|
|
139
132
|
}
|
|
140
|
-
return /*#__PURE__*/ React.createElement(
|
|
133
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
134
|
+
style: {
|
|
135
|
+
position: 'relative',
|
|
136
|
+
width: '100%',
|
|
137
|
+
height: '100%'
|
|
138
|
+
}
|
|
139
|
+
}, /*#__PURE__*/ React.createElement(AgGridReact, {
|
|
141
140
|
...someProperties,
|
|
142
141
|
rowData: rowData,
|
|
143
142
|
defaultColDef: memoDefaultColDef,
|
|
@@ -153,7 +152,8 @@ const AgGrid = ({ properties, methods, loading, events })=>{
|
|
|
153
152
|
],
|
|
154
153
|
columnDefs: processColDefs(columnDefs, methods),
|
|
155
154
|
ref: gridRef,
|
|
156
|
-
getRowId: getRowId
|
|
157
|
-
|
|
155
|
+
getRowId: getRowId,
|
|
156
|
+
suppressLoadingOverlay: true
|
|
157
|
+
}), loading && /*#__PURE__*/ React.createElement(LoadingOverlay, null));
|
|
158
158
|
};
|
|
159
159
|
export default AgGrid;
|
package/dist/AgGridInput.js
CHANGED
|
@@ -18,6 +18,7 @@ import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-mod
|
|
|
18
18
|
import { CsvExportModule } from '@ag-grid-community/csv-export';
|
|
19
19
|
import processColDefs from './processColDefs.js';
|
|
20
20
|
import assignRowId from './assignRowId.js';
|
|
21
|
+
import LoadingOverlay from './LoadingOverlay.js';
|
|
21
22
|
const AgGridInput = ({ properties, methods, loading, events, value })=>{
|
|
22
23
|
const { quickFilterValue, columnDefs, defaultColDef, ...someProperties } = properties;
|
|
23
24
|
const [rowData, setRowData] = useState(value ?? []);
|
|
@@ -167,14 +168,6 @@ const AgGridInput = ({ properties, methods, loading, events, value })=>{
|
|
|
167
168
|
}
|
|
168
169
|
gridRef.current.columnApi.autoSizeColumns(allColumnIds, skipHeader);
|
|
169
170
|
});
|
|
170
|
-
if (gridRef.current.api) {
|
|
171
|
-
if (loading) {
|
|
172
|
-
gridRef.current.api.showLoadingOverlay();
|
|
173
|
-
}
|
|
174
|
-
if (!loading) {
|
|
175
|
-
gridRef.current.api.hideOverlay();
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
171
|
}, []);
|
|
179
172
|
useEffect(()=>{
|
|
180
173
|
if (JSON.stringify(rowData) !== JSON.stringify(value)) {
|
|
@@ -186,7 +179,13 @@ const AgGridInput = ({ properties, methods, loading, events, value })=>{
|
|
|
186
179
|
if (quickFilterValue && quickFilterValue === '') {
|
|
187
180
|
gridRef.current.api.setQuickFilter(quickFilterValue); // check if empty string matches all
|
|
188
181
|
}
|
|
189
|
-
return /*#__PURE__*/ React.createElement(
|
|
182
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
183
|
+
style: {
|
|
184
|
+
position: 'relative',
|
|
185
|
+
width: '100%',
|
|
186
|
+
height: '100%'
|
|
187
|
+
}
|
|
188
|
+
}, /*#__PURE__*/ React.createElement(AgGridReact, {
|
|
190
189
|
...someProperties,
|
|
191
190
|
rowData: rowData,
|
|
192
191
|
onCellClicked: onCellClicked,
|
|
@@ -204,7 +203,8 @@ const AgGridInput = ({ properties, methods, loading, events, value })=>{
|
|
|
204
203
|
],
|
|
205
204
|
columnDefs: processColDefs(columnDefs, methods),
|
|
206
205
|
ref: gridRef,
|
|
207
|
-
getRowId: getRowId
|
|
208
|
-
|
|
206
|
+
getRowId: getRowId,
|
|
207
|
+
suppressLoadingOverlay: true
|
|
208
|
+
}), loading && /*#__PURE__*/ React.createElement(LoadingOverlay, null));
|
|
209
209
|
};
|
|
210
210
|
export default AgGridInput;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
const wrapperStyle = {
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
inset: 0,
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
backgroundColor: 'color-mix(in srgb, var(--ant-color-bg-container) 70%, transparent)',
|
|
23
|
+
zIndex: 2,
|
|
24
|
+
pointerEvents: 'all'
|
|
25
|
+
};
|
|
26
|
+
const boxStyle = {
|
|
27
|
+
padding: '8px 16px',
|
|
28
|
+
borderRadius: 'var(--ant-border-radius)',
|
|
29
|
+
boxShadow: 'var(--ant-box-shadow-secondary)',
|
|
30
|
+
backgroundColor: 'var(--ant-color-bg-container)',
|
|
31
|
+
color: 'var(--ant-color-text)',
|
|
32
|
+
border: '1px solid var(--ant-color-border)',
|
|
33
|
+
fontSize: 'var(--ant-font-size)'
|
|
34
|
+
};
|
|
35
|
+
function LoadingOverlay() {
|
|
36
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
37
|
+
style: wrapperStyle
|
|
38
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
39
|
+
style: boxStyle
|
|
40
|
+
}, "Loading..."));
|
|
41
|
+
}
|
|
42
|
+
export default LoadingOverlay;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
.antdTheme.antdTheme {
|
|
2
|
+
--ag-background-color: var(--ant-color-bg-container);
|
|
3
|
+
--ag-foreground-color: var(--ant-color-text);
|
|
4
|
+
--ag-secondary-foreground-color: var(--ant-color-text-secondary);
|
|
5
|
+
--ag-border-color: var(--ant-color-border);
|
|
6
|
+
--ag-secondary-border-color: var(--ant-color-border-secondary);
|
|
7
|
+
--ag-header-background-color: var(--ant-color-fill-quaternary);
|
|
8
|
+
--ag-header-foreground-color: var(--ant-color-text);
|
|
9
|
+
--ag-header-cell-hover-background-color: var(--ant-color-fill-tertiary);
|
|
10
|
+
--ag-header-cell-moving-background-color: var(--ant-color-fill-secondary);
|
|
11
|
+
--ag-tooltip-background-color: var(--ant-color-bg-spotlight);
|
|
12
|
+
--ag-odd-row-background-color: var(--ant-color-fill-quaternary);
|
|
13
|
+
--ag-control-panel-background-color: var(--ant-color-bg-elevated);
|
|
14
|
+
--ag-subheader-background-color: var(--ant-color-bg-layout);
|
|
15
|
+
--ag-subheader-toolbar-background-color: var(--ant-color-bg-layout);
|
|
16
|
+
--ag-selected-row-background-color: var(--ant-color-primary-bg);
|
|
17
|
+
--ag-row-hover-color: var(--ant-color-primary-bg-hover);
|
|
18
|
+
--ag-column-hover-color: var(--ant-color-primary-bg-hover);
|
|
19
|
+
--ag-range-selection-highlight-color: var(--ant-color-primary-bg-hover);
|
|
20
|
+
--ag-modal-overlay-background-color: var(--ant-color-bg-mask);
|
|
21
|
+
--ag-input-disabled-background-color: var(--ant-color-bg-container-disabled);
|
|
22
|
+
--ag-input-disabled-border-color: var(--ant-color-border);
|
|
23
|
+
--ag-disabled-foreground-color: var(--ant-color-text-disabled);
|
|
24
|
+
--ag-chip-background-color: var(--ant-color-fill-secondary);
|
|
25
|
+
--ag-input-focus-box-shadow: 0 0 0 2px var(--ant-color-primary-bg);
|
|
26
|
+
--ag-input-focus-border-color: var(--ant-color-primary);
|
|
27
|
+
--ag-range-selection-border-color: var(--ant-color-primary);
|
|
28
|
+
--ag-range-selection-background-color: var(--ant-color-primary-bg);
|
|
29
|
+
--ag-checkbox-checked-color: var(--ant-color-primary);
|
|
30
|
+
--ag-checkbox-unchecked-color: var(--ant-color-text-quaternary);
|
|
31
|
+
--ag-checkbox-background-color: var(--ant-color-bg-container);
|
|
32
|
+
--ag-card-shadow: var(--ant-box-shadow-secondary);
|
|
33
|
+
--ag-popup-shadow: var(--ant-box-shadow);
|
|
34
|
+
--ag-font-family: var(--ant-font-family);
|
|
35
|
+
--ag-font-size: var(--ant-font-size);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.antdTheme :global(.ag-root-wrapper) {
|
|
39
|
+
border-radius: var(--ant-border-radius);
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Avatar sizing per ag-grid theme — reads row-height via the wrapper class. */
|
|
44
|
+
.antdTheme:global(.ag-theme-balham),
|
|
45
|
+
.antdTheme:global(.ag-theme-balham-dark) {
|
|
46
|
+
--lf-avatar-size: 20px;
|
|
47
|
+
--lf-avatar-font-size: 10px;
|
|
48
|
+
}
|
|
49
|
+
.antdTheme:global(.ag-theme-alpine),
|
|
50
|
+
.antdTheme:global(.ag-theme-alpine-dark) {
|
|
51
|
+
--lf-avatar-size: var(--ant-control-height-sm, 24px);
|
|
52
|
+
--lf-avatar-font-size: var(--ant-font-size-sm, 12px);
|
|
53
|
+
}
|
|
54
|
+
.antdTheme:global(.ag-theme-material) {
|
|
55
|
+
--lf-avatar-size: 26px;
|
|
56
|
+
--lf-avatar-font-size: var(--ant-font-size-sm, 12px);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.antdTheme :global(.ag-overlay-loading-wrapper) {
|
|
60
|
+
background-color: color-mix(in srgb, var(--ant-color-bg-container) 70%, transparent);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.antdTheme :global(.ag-overlay-loading-center) {
|
|
64
|
+
border-radius: var(--ant-border-radius);
|
|
65
|
+
box-shadow: var(--ant-box-shadow-secondary);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.antdTheme :global(.ag-overlay-no-rows-wrapper) {
|
|
69
|
+
color: var(--ant-color-text-secondary);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.antdTheme :global(.ag-cell) {
|
|
73
|
+
display: flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
line-height: var(--ant-line-height, 1.5);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.antdTheme :global(.lf-ellipsis-1),
|
|
79
|
+
.antdTheme :global(.lf-ellipsis-2),
|
|
80
|
+
.antdTheme :global(.lf-ellipsis-3),
|
|
81
|
+
.antdTheme :global(.lf-ellipsis-4),
|
|
82
|
+
.antdTheme :global(.lf-ellipsis-5),
|
|
83
|
+
.antdTheme :global(.lf-ellipsis-6) {
|
|
84
|
+
display: -webkit-box;
|
|
85
|
+
-webkit-box-orient: vertical;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
white-space: normal;
|
|
88
|
+
word-break: break-word;
|
|
89
|
+
}
|
|
90
|
+
.antdTheme :global(.lf-ellipsis-1) {
|
|
91
|
+
-webkit-line-clamp: 1;
|
|
92
|
+
}
|
|
93
|
+
.antdTheme :global(.lf-ellipsis-2) {
|
|
94
|
+
-webkit-line-clamp: 2;
|
|
95
|
+
}
|
|
96
|
+
.antdTheme :global(.lf-ellipsis-3) {
|
|
97
|
+
-webkit-line-clamp: 3;
|
|
98
|
+
}
|
|
99
|
+
.antdTheme :global(.lf-ellipsis-4) {
|
|
100
|
+
-webkit-line-clamp: 4;
|
|
101
|
+
}
|
|
102
|
+
.antdTheme :global(.lf-ellipsis-5) {
|
|
103
|
+
-webkit-line-clamp: 5;
|
|
104
|
+
}
|
|
105
|
+
.antdTheme :global(.lf-ellipsis-6) {
|
|
106
|
+
-webkit-line-clamp: 6;
|
|
107
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -13,27 +13,25 @@
|
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
15
|
*/ import React from 'react';
|
|
16
|
-
import {
|
|
16
|
+
import { withBlockDefaults } from '@lowdefy/block-utils';
|
|
17
|
+
import '@ag-grid-community/styles/ag-grid.css';
|
|
18
|
+
import '@ag-grid-community/styles/ag-theme-alpine.css';
|
|
19
|
+
import antdStyles from '../../ag-grid-antd.module.css';
|
|
17
20
|
import AgGrid from '../../AgGrid.js';
|
|
18
|
-
const AgGridAlpine = ({ blockId, events, loading, methods, properties })
|
|
21
|
+
const AgGridAlpine = ({ blockId, events, loading, methods, properties, styles })=>{
|
|
22
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
19
23
|
id: blockId,
|
|
20
|
-
className: `ag-theme-alpine ${
|
|
24
|
+
className: `ag-theme-alpine ${antdStyles.antdTheme}`,
|
|
25
|
+
style: {
|
|
21
26
|
width: '100%',
|
|
22
27
|
height: properties.height ?? 500,
|
|
23
|
-
...
|
|
24
|
-
}
|
|
28
|
+
...styles?.element
|
|
29
|
+
}
|
|
25
30
|
}, /*#__PURE__*/ React.createElement(AgGrid, {
|
|
26
31
|
events: events,
|
|
27
32
|
loading: loading,
|
|
28
33
|
methods: methods,
|
|
29
34
|
properties: properties
|
|
30
35
|
}));
|
|
31
|
-
AgGridAlpine.defaultProps = blockDefaultProps;
|
|
32
|
-
AgGridAlpine.meta = {
|
|
33
|
-
category: 'display',
|
|
34
|
-
icons: [],
|
|
35
|
-
styles: [
|
|
36
|
-
'blocks/AgGridAlpine/style.less'
|
|
37
|
-
]
|
|
38
36
|
};
|
|
39
|
-
export default AgGridAlpine;
|
|
37
|
+
export default withBlockDefaults(AgGridAlpine);
|