@visns-studio/visns-components 5.14.9 → 5.14.11
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 +51 -7
- package/package.json +2 -1
- package/src/components/columns/ColumnRenderers.jsx +16 -6
- package/src/components/generic/GenericReport.jsx +1311 -158
- package/src/components/generic/GroupedReportRenderer.jsx +91 -0
- package/src/components/generic/SectionGroupedReport.jsx +388 -0
- package/src/components/generic/groupedReport.css +307 -0
- package/src/components/generic/shared/formatters.js +152 -23
- package/src/components/generic/shared/groupingUtils.js +118 -0
- package/src/components/styles/GenericReport.module.scss +532 -0
package/README.md
CHANGED
|
@@ -2889,7 +2889,7 @@ Response:
|
|
|
2889
2889
|
|
|
2890
2890
|
### Report Builder Component
|
|
2891
2891
|
|
|
2892
|
-
#### GenericReport (Enhanced v5.
|
|
2892
|
+
#### GenericReport (Enhanced v5.12.2+)
|
|
2893
2893
|
|
|
2894
2894
|
A powerful and enhanced report building component that provides an intuitive wizard-based interface for creating custom reports. The component has been significantly improved with new features and better user experience.
|
|
2895
2895
|
|
|
@@ -2909,16 +2909,19 @@ A powerful and enhanced report building component that provides an intuitive wiz
|
|
|
2909
2909
|
|
|
2910
2910
|
**Major Enhancements:**
|
|
2911
2911
|
|
|
2912
|
-
- **
|
|
2912
|
+
- **6-Step Wizard Interface**: Guided workflow with visual progress indicators
|
|
2913
2913
|
- **Business Templates**: Pre-built report templates for common business scenarios
|
|
2914
|
+
- **Custom Grouping**: Create grouped reports with flexible configuration options
|
|
2915
|
+
- **Smart Data Formatting**: Intelligent formatting for JSON, boolean, ABN/ACN, and numeric data
|
|
2916
|
+
- **Custom API Endpoints**: Override default URLs with template or custom endpoints
|
|
2914
2917
|
- **Calculated Fields**: Create custom formulas and calculations within reports
|
|
2915
2918
|
- **Smart Column Selection**: Automatic suggestions based on table relationships
|
|
2916
2919
|
- **Enhanced Filtering**: Advanced filter options with AND/OR logic and grouping
|
|
2917
|
-
- **Live Preview**: Real-time preview of report data
|
|
2920
|
+
- **Live Preview**: Real-time preview of report data with grouped/table view toggle
|
|
2918
2921
|
- **Intelligent Currency Formatting**: Automatic detection and formatting of monetary fields
|
|
2919
2922
|
- **Expandable Field Summary**: View selected fields in a collapsible overview
|
|
2920
|
-
- **Template Management**: Save, load, and share report templates
|
|
2921
|
-
- **Multiple Export Formats**: Export to Excel, CSV, PDF with formatting
|
|
2923
|
+
- **Template Management**: Save, load, and share report templates with custom configurations
|
|
2924
|
+
- **Multiple Export Formats**: Export to Excel, CSV, PDF with proper formatting preservation
|
|
2922
2925
|
|
|
2923
2926
|
**New Features in Recent Updates:**
|
|
2924
2927
|
|
|
@@ -2960,13 +2963,54 @@ A powerful and enhanced report building component that provides an intuitive wiz
|
|
|
2960
2963
|
- Expandable selected fields summary
|
|
2961
2964
|
- Step-by-step guidance with tooltips and help text
|
|
2962
2965
|
|
|
2963
|
-
**
|
|
2966
|
+
5. **Custom Grouping & Reporting (v5.12.0+)**:
|
|
2967
|
+
```jsx
|
|
2968
|
+
// Create custom grouped reports with flexible configuration
|
|
2969
|
+
{
|
|
2970
|
+
enabled: true,
|
|
2971
|
+
groupByField: 'facilities.label',
|
|
2972
|
+
groupDisplayName: 'Facility',
|
|
2973
|
+
sortBy: 'facilities.label',
|
|
2974
|
+
sortDirection: 'asc',
|
|
2975
|
+
rowsPerGroup: 10,
|
|
2976
|
+
showGroupTotals: true,
|
|
2977
|
+
groupHeaderStyle: 'primary'
|
|
2978
|
+
}
|
|
2979
|
+
```
|
|
2980
|
+
- Build grouped reports with custom field selection
|
|
2981
|
+
- Flexible grouping options with configurable display
|
|
2982
|
+
- Support for both predefined templates and custom grouping
|
|
2983
|
+
- Toggle between grouped and regular table views
|
|
2984
|
+
|
|
2985
|
+
6. **Smart Data Formatting (v5.12.1+)**:
|
|
2986
|
+
- **JSON Data**: Automatically parses and displays JSON strings in readable key-value format
|
|
2987
|
+
- **Boolean Values**: Shows "Yes/No" with color coding instead of true/false
|
|
2988
|
+
- **Status Columns**: Detects status fields and displays "Active/Inactive" with colors
|
|
2989
|
+
- **ABN/ACN Numbers**: Formats Australian Business/Company Numbers (12 345 678 901 / 123 456 789)
|
|
2990
|
+
- **Numeric Values**: Applies locale-specific number formatting with thousands separators
|
|
2991
|
+
- **Null Values**: Shows em dash (—) with italic styling for empty values
|
|
2992
|
+
|
|
2993
|
+
7. **Custom API Endpoints (v5.12.2+)**:
|
|
2994
|
+
```jsx
|
|
2995
|
+
// Override default API endpoints for specialized handling
|
|
2996
|
+
customUrls: {
|
|
2997
|
+
executeUrl: '/api/custom-reports/execute',
|
|
2998
|
+
exportUrl: '/api/custom-reports/export'
|
|
2999
|
+
}
|
|
3000
|
+
```
|
|
3001
|
+
- **URL Priority**: Custom > Template > Default
|
|
3002
|
+
- **Template Support**: Respects `executeUrl` and `exportUrl` from business templates
|
|
3003
|
+
- **Flexible Configuration**: Override URLs at report level for specialized requirements
|
|
3004
|
+
- **Persistent Settings**: Custom URLs save with reports for reuse
|
|
3005
|
+
|
|
3006
|
+
**The 6-Step Wizard Process:**
|
|
2964
3007
|
|
|
2965
3008
|
1. **Select Data Source**: Choose main table and review business templates
|
|
2966
3009
|
2. **Choose Columns**: Select specific data fields with drag-and-drop reordering
|
|
2967
3010
|
3. **Add Relationships**: Connect related tables with automatic join suggestions
|
|
2968
3011
|
4. **Apply Filters**: Set conditions and date ranges with advanced logic
|
|
2969
|
-
5. **
|
|
3012
|
+
5. **Configure Grouping**: Set up custom grouping options and API endpoints (optional)
|
|
3013
|
+
6. **Generate & Export**: Preview results and export in multiple formats
|
|
2970
3014
|
|
|
2971
3015
|
**API Integration:**
|
|
2972
3016
|
|
package/package.json
CHANGED
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
"uuid": "^11.1.0",
|
|
66
66
|
"validator": "^13.15.15",
|
|
67
67
|
"vite": "^6.3.5",
|
|
68
|
+
"xlsx": "^0.18.5",
|
|
68
69
|
"yarn": "^1.22.22",
|
|
69
70
|
"yet-another-react-lightbox": "^3.25.0"
|
|
70
71
|
},
|
|
@@ -88,7 +89,7 @@
|
|
|
88
89
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
89
90
|
},
|
|
90
91
|
"name": "@visns-studio/visns-components",
|
|
91
|
-
"version": "5.14.
|
|
92
|
+
"version": "5.14.11",
|
|
92
93
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
93
94
|
"main": "src/index.js",
|
|
94
95
|
"files": [
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getRelationshipPath,
|
|
10
10
|
DEFAULT_INTELLIGENT_SORTING_CONFIG,
|
|
11
11
|
} from '../../utils/relationshipSortingUtils';
|
|
12
|
+
import { formatCellContent } from '../generic/shared/formatters';
|
|
12
13
|
|
|
13
14
|
// Stage Toggle Utility Functions
|
|
14
15
|
const buildToggleUrl = (urlTemplate, stageItem, rowData) => {
|
|
@@ -145,10 +146,11 @@ export const renderBooleanColumn = ({
|
|
|
145
146
|
name: `${column.type}.${column.id}`,
|
|
146
147
|
sortable: true,
|
|
147
148
|
render: ({ data }) => {
|
|
148
|
-
const
|
|
149
|
+
const rawValue = data[column.id];
|
|
150
|
+
const formattedValue = formatCellContent(rawValue, { ...column, type: 'boolean' });
|
|
149
151
|
return (
|
|
150
|
-
<CellWithTooltip value={
|
|
151
|
-
<span>{
|
|
152
|
+
<CellWithTooltip value={rawValue} columnType="boolean">
|
|
153
|
+
<span>{formattedValue}</span>
|
|
152
154
|
</CellWithTooltip>
|
|
153
155
|
);
|
|
154
156
|
},
|
|
@@ -202,9 +204,17 @@ export const renderDateColumn = ({
|
|
|
202
204
|
moment(data[column.id]).isValid() &&
|
|
203
205
|
moment(data[column.id]).format('YYYY-MM-DD') !== '1970-01-01'
|
|
204
206
|
) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
207
|
+
// Smart date/datetime detection
|
|
208
|
+
const momentValue = moment(data[column.id]);
|
|
209
|
+
const hasTime = momentValue.format('HH:mm:ss') !== '00:00:00';
|
|
210
|
+
|
|
211
|
+
let format = column.format;
|
|
212
|
+
if (!format) {
|
|
213
|
+
// Auto-detect format based on whether there's a time component
|
|
214
|
+
format = hasTime ? 'DD-MM-YYYY HH:mm' : 'DD-MM-YYYY';
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
const value = momentValue.format(format);
|
|
208
218
|
let columnStyle = {};
|
|
209
219
|
|
|
210
220
|
if (
|