gbs-add-block 0.0.35 → 0.0.36
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/README.md +4 -4
- package/package.json +1 -1
- package/source/components/formrenderer/InputHandles.tsx +1 -0
- package/source/components/formrenderer/MultiHandles.tsx +1 -0
- package/source/components/formrenderer/SelectHandles.tsx +1 -0
- package/source/components/formrenderer/types.ts +2 -0
- package/source/components/grid/Grid.tsx +14 -1
- package/source/components/grid/RenderCell.tsx +32 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# GBS Building Blocks 2.0 (v0.0.
|
|
1
|
+
# GBS Building Blocks 2.0 (v0.0.36)
|
|
2
2
|
|
|
3
3
|
Latest and upgraded version of GBS building blocks with headless UI and removed dependencies.
|
|
4
4
|
|
|
@@ -6,10 +6,10 @@ Latest and upgraded version of GBS building blocks with headless UI and removed
|
|
|
6
6
|
|
|
7
7
|
For detailed documentation on usage and props, Please visit: [Building Block Documentation v2.0](https://blackmax-designs.gitbook.io/building-block-v2.0)
|
|
8
8
|
|
|
9
|
-
## What's New 🎉 (Ver 0.0.
|
|
9
|
+
## What's New 🎉 (Ver 0.0.36)
|
|
10
10
|
|
|
11
|
-
- Updated Form Renderer
|
|
12
|
-
- Updated
|
|
11
|
+
- Updated Form Renderer with form builder and AI support
|
|
12
|
+
- Updated Grid
|
|
13
13
|
|
|
14
14
|
## Authors
|
|
15
15
|
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type FormItem = {
|
|
2
|
+
id?: string;
|
|
2
3
|
name?: string;
|
|
3
4
|
component?: string;
|
|
4
5
|
type?: string;
|
|
@@ -11,6 +12,7 @@ export type FormItem = {
|
|
|
11
12
|
key?: string;
|
|
12
13
|
dependency?: string;
|
|
13
14
|
hasDependents?: boolean;
|
|
15
|
+
isReady?: boolean;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
interface DependencyConfig {
|
|
@@ -232,6 +232,8 @@ export const GridMemoised = forwardRef((props: GridProps, ref) => {
|
|
|
232
232
|
|
|
233
233
|
// This will render template passed to Grid
|
|
234
234
|
const renderCell = (rowData: any, column: any, rowIndex: number) => {
|
|
235
|
+
const cellValue = rowData[column.field];
|
|
236
|
+
|
|
235
237
|
if (column.template) {
|
|
236
238
|
return (
|
|
237
239
|
<column.template
|
|
@@ -243,7 +245,18 @@ export const GridMemoised = forwardRef((props: GridProps, ref) => {
|
|
|
243
245
|
/>
|
|
244
246
|
);
|
|
245
247
|
}
|
|
246
|
-
|
|
248
|
+
|
|
249
|
+
if (column.tooltip) {
|
|
250
|
+
return (
|
|
251
|
+
<span title={cellValue?.toString()}>
|
|
252
|
+
{cellValue && cellValue.length > 10
|
|
253
|
+
? `${cellValue.slice(0, 10)}...`
|
|
254
|
+
: cellValue}
|
|
255
|
+
</span>
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return cellValue;
|
|
247
260
|
};
|
|
248
261
|
|
|
249
262
|
// *** Filter Handling Functions Starts Here
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const renderCell = (
|
|
2
|
+
rowData: any,
|
|
3
|
+
column: any,
|
|
4
|
+
rowIndex: number,
|
|
5
|
+
currentPage: number,
|
|
6
|
+
pageSettings: any,
|
|
7
|
+
rowChange?: any
|
|
8
|
+
) => {
|
|
9
|
+
const cellValue = rowData[column.field];
|
|
10
|
+
|
|
11
|
+
if (column.template) {
|
|
12
|
+
return (
|
|
13
|
+
<column.template
|
|
14
|
+
rowData={rowData}
|
|
15
|
+
rowIndex={rowIndex + currentPage * pageSettings.pageNumber}
|
|
16
|
+
rowChange={(changes: any) => {
|
|
17
|
+
if (rowChange) rowChange(changes);
|
|
18
|
+
}}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (column.tooltip) {
|
|
24
|
+
return (
|
|
25
|
+
<span title={cellValue?.toString()}>
|
|
26
|
+
{column.tooltip ? cellValue.slice(0, 10) : cellValue}
|
|
27
|
+
</span>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return cellValue;
|
|
32
|
+
};
|