@abgov/jsonforms-components 1.44.2 → 1.44.3
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/index.esm.js
CHANGED
|
@@ -2767,6 +2767,23 @@ const convertToReadableFormat = input => {
|
|
|
2767
2767
|
}
|
|
2768
2768
|
return input.replace(/([a-z])([A-Z])/g, '$1 $2').split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join(' ');
|
|
2769
2769
|
};
|
|
2770
|
+
/**
|
|
2771
|
+
* Converts a input to sentence case (eg: incomeThresholdExample or IncomeThresholdExample)
|
|
2772
|
+
* to 'Income threshold example' with the first letter in the sentence capitalized.
|
|
2773
|
+
*
|
|
2774
|
+
* @param input - The camelCase or PascalCase string (e.g., "incomeThresholdExample").
|
|
2775
|
+
* @returns A formatted string with spaces and capitalization (e.g., "Income threshold example").
|
|
2776
|
+
*/
|
|
2777
|
+
const convertToSentenceCase = input => {
|
|
2778
|
+
if (!input) {
|
|
2779
|
+
return input;
|
|
2780
|
+
}
|
|
2781
|
+
const convertedInput = convertToReadableFormat(input);
|
|
2782
|
+
if (!convertedInput) return convertedInput;
|
|
2783
|
+
const firstWord = convertedInput.split(' ').splice(0, 1);
|
|
2784
|
+
const newWords = convertedInput.split(' ').splice(1).map(word => word.charAt(0).toLowerCase() + word.slice(1).toLowerCase()).join(' ');
|
|
2785
|
+
return firstWord.concat(newWords).join(' ');
|
|
2786
|
+
};
|
|
2770
2787
|
|
|
2771
2788
|
const StepperContext = /*#__PURE__*/createContext({
|
|
2772
2789
|
updateStatus: status => {},
|
|
@@ -6400,7 +6417,8 @@ let _$2 = t => t,
|
|
|
6400
6417
|
_t10,
|
|
6401
6418
|
_t11,
|
|
6402
6419
|
_t12,
|
|
6403
|
-
_t13
|
|
6420
|
+
_t13,
|
|
6421
|
+
_t14;
|
|
6404
6422
|
const DeleteDialogContent = styled.div(_t$2 || (_t$2 = _$2`
|
|
6405
6423
|
margin-bottom: var(--goa-space-m);
|
|
6406
6424
|
`));
|
|
@@ -6455,6 +6473,9 @@ const ListContainer = styled.div(_t13 || (_t13 = _$2`
|
|
|
6455
6473
|
padding: 0 1.5rem 0 0;
|
|
6456
6474
|
border: 1px solid #dcdcdc;
|
|
6457
6475
|
`));
|
|
6476
|
+
const TableTHHeader = styled.th(_t14 || (_t14 = _$2`
|
|
6477
|
+
background-color: var(--goa-color-greyscale-100) !important;
|
|
6478
|
+
`));
|
|
6458
6479
|
|
|
6459
6480
|
const DeleteDialog = /*#__PURE__*/React.memo(function DeleteDialog({
|
|
6460
6481
|
open,
|
|
@@ -6783,9 +6804,16 @@ const NonEmptyCellComponent$1 = /*#__PURE__*/React.memo(function NonEmptyCellCom
|
|
|
6783
6804
|
children: [jsx("thead", {
|
|
6784
6805
|
children: jsxs("tr", {
|
|
6785
6806
|
children: [Object.keys(properties).map((key, index) => {
|
|
6786
|
-
|
|
6807
|
+
if (!isInReview) {
|
|
6808
|
+
return jsx("th", {
|
|
6809
|
+
children: jsx("p", {
|
|
6810
|
+
children: convertToSentenceCase(key)
|
|
6811
|
+
})
|
|
6812
|
+
}, index);
|
|
6813
|
+
}
|
|
6814
|
+
return jsx(TableTHHeader, {
|
|
6787
6815
|
children: jsx("p", {
|
|
6788
|
-
children: key
|
|
6816
|
+
children: convertToSentenceCase(key)
|
|
6789
6817
|
})
|
|
6790
6818
|
}, index);
|
|
6791
6819
|
}), isInReview !== true && jsx("th", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
|
|
6
6
|
"repository": "https://github.com/GovAlta/adsp-monorepo",
|
|
@@ -12,3 +12,4 @@ export declare const FlexForm: import("styled-components/dist/types").IStyledCom
|
|
|
12
12
|
export declare const TabName: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
13
13
|
export declare const Trash: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
14
|
export declare const ListContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const TableTHHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, never>> & string;
|
|
@@ -48,3 +48,11 @@ export declare const getLastSegmentFromPointer: (pointer: string) => string;
|
|
|
48
48
|
* @returns A formatted string with spaces and capitalization (e.g., "Income Threshold Example").
|
|
49
49
|
*/
|
|
50
50
|
export declare const convertToReadableFormat: (input: string) => string;
|
|
51
|
+
/**
|
|
52
|
+
* Converts a input to sentence case (eg: incomeThresholdExample or IncomeThresholdExample)
|
|
53
|
+
* to 'Income threshold example' with the first letter in the sentence capitalized.
|
|
54
|
+
*
|
|
55
|
+
* @param input - The camelCase or PascalCase string (e.g., "incomeThresholdExample").
|
|
56
|
+
* @returns A formatted string with spaces and capitalization (e.g., "Income threshold example").
|
|
57
|
+
*/
|
|
58
|
+
export declare const convertToSentenceCase: (input: string) => string;
|