ui-soxo-bootstrap-core 2.6.1-dev.14 → 2.6.1-dev.16

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.
@@ -82,7 +82,7 @@ export async function ApiCall({ url, formBody, method, settings, ...props }) {
82
82
  ...settings.headers,
83
83
  ...headers,
84
84
  ...(props.headers || {}),
85
- Authorization: `Bearer ${token}`,
85
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
86
86
  'Content-Type': 'application/json',
87
87
  },
88
88
  body: formBody ? JSON.stringify(formBody) : null,
@@ -25,11 +25,15 @@ function getExportDefinition(entry, record) {
25
25
  * @param {Array} root0.columns
26
26
  * @param {Array} root0.patients
27
27
  * @param {boolean} root0.isFixedIndex
28
- * @param {Object} root0.CustomComponents
28
+ * @param {Object.<string, React.ComponentType<any>>} root0.CustomComponents
29
29
  * @param {Function} root0.refresh
30
+ * @param {Object} [root0.otherDetails={}] - Optional details from the report configuration.
31
+ * @param {boolean} [root0.otherDetails.isFilterEnabled] - Fallback to enable filtering on all columns.
32
+ * @param {boolean} [root.otherDetails.isSortingEnabled] - Fallback to enable sorting on all columns.
33
+ * @param {boolean} [root0.otherDetails.isHeaderWrapEnabled] - Fallback to enable header text wrapping for all columns.
30
34
  * @returns {Array}
31
35
  */
32
- export default function buildDisplayColumns({ columns = [], patients = [], isFixedIndex, CustomComponents, refresh }) {
36
+ export default function buildDisplayColumns({ columns = [], patients = [], isFixedIndex, CustomComponents, refresh, otherDetails = {} }) {
33
37
  const displayColumns = [
34
38
  {
35
39
  title: '#',
@@ -42,6 +46,11 @@ export default function buildDisplayColumns({ columns = [], patients = [], isFix
42
46
  ];
43
47
 
44
48
  columns.forEach((entry, index) => {
49
+ const isFilterEnabled = entry.isFilterEnabled || otherDetails?.isFilterEnabled;
50
+ const isSortingEnabled = entry.isSortingEnabled || otherDetails?.isSortingEnabled;
51
+ const isHeaderWrapEnabled = otherDetails?.isHeaderWrapEnabled;
52
+
53
+ const titleStyle = isHeaderWrapEnabled ? { whiteSpace: 'pre-wrap', overflowWrap: 'break-word' } : {};
45
54
  displayColumns.push({
46
55
  render: (record) =>
47
56
  renderDisplayCell({
@@ -52,20 +61,26 @@ export default function buildDisplayColumns({ columns = [], patients = [], isFix
52
61
  }),
53
62
  field: entry.field,
54
63
  title: (
55
- <Tooltip title={entry.tooltip || entry.title}>
56
- <span>{entry.title}</span>
64
+ <Tooltip
65
+ title={entry.tooltip || entry.title}
66
+ overlayInnerStyle={{
67
+ whiteSpace: 'normal',
68
+ overflowWrap: 'break-word',
69
+ }}
70
+ >
71
+ <span style={titleStyle}>{entry.title}</span>
57
72
  </Tooltip>
58
73
  ),
59
74
  key: entry.field || `display_column_${index}`,
60
75
  width: entry.width ? parseInt(entry.width, 10) : 160,
61
76
  fixed: entry.isFixedColumn ? entry.isFixedColumn : null,
62
77
  filters:
63
- entry.isFilterEnabled && Array.isArray(patients)
78
+ isFilterEnabled && Array.isArray(patients)
64
79
  ? [...new Set(patients.map((item) => item[entry.field]).filter(Boolean))].map((value) => ({ text: value, value }))
65
80
  : null,
66
- onFilter: entry.isFilterEnabled ? (value, record) => record[entry.field] === value : null,
67
- sorter: entry.isSortingEnabled ? (a, b) => String(a[entry.field]).localeCompare(String(b[entry.field])) : null,
68
- filterSearch: entry.isFilterEnabled ? entry.isFilterEnabled : false,
81
+ onFilter: isFilterEnabled ? (value, record) => record[entry.field] === value : null,
82
+ sorter: isSortingEnabled ? (a, b) => String(a[entry.field]).localeCompare(String(b[entry.field])) : null,
83
+ filterSearch: isFilterEnabled ? isFilterEnabled : false,
69
84
  exportDefinition: (record) => getExportDefinition(entry, record),
70
85
  align: entry.type === 'number' ? 'right' : 'left',
71
86
  });
@@ -722,7 +722,9 @@ function GuestList({
722
722
 
723
723
  const { isMobile, dispatch } = useContext(GlobalContext);
724
724
  const [single, setSingle] = useState({});
725
+ const otherDetails = config.other_details1 ? JSON.parse(config.other_details1) : {};
725
726
 
727
+ const otherDetails = config.other_details1 ? JSON.parse(config.other_details1) : {};
726
728
  // const [view, setView] = useState(isMobile ? true : false); //Need to check this condition
727
729
  const cols = buildDisplayColumns({
728
730
  columns,
@@ -730,6 +732,7 @@ function GuestList({
730
732
  isFixedIndex,
731
733
  CustomComponents,
732
734
  refresh,
735
+ otherDetails,
733
736
  });
734
737
 
735
738
  /**
@@ -1071,7 +1074,7 @@ function GuestList({
1071
1074
  const summaryValues = calculateSummaryValues(summaryCols, pageData);
1072
1075
 
1073
1076
  return (
1074
- <Table.Summary.Row className='report-summary-row'>
1077
+ <Table.Summary.Row className="report-summary-row">
1075
1078
  {cols.map((col, index) => {
1076
1079
  if (summaryValues[col.field] !== undefined) {
1077
1080
  return (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-soxo-bootstrap-core",
3
- "version": "2.6.1-dev.14",
3
+ "version": "2.6.1-dev.16",
4
4
  "description": "All the Core Components for you to start",
5
5
  "keywords": [
6
6
  "all in one"