@abgov/jsonforms-components 1.44.2 → 1.44.4
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 => {},
|
|
@@ -5090,7 +5107,7 @@ const BooleanComponent = ({
|
|
|
5090
5107
|
errors,
|
|
5091
5108
|
schema
|
|
5092
5109
|
}) => {
|
|
5093
|
-
var _a, _b;
|
|
5110
|
+
var _a, _b, _c;
|
|
5094
5111
|
const errorsFormInput = checkFieldValidity({
|
|
5095
5112
|
data,
|
|
5096
5113
|
uischema,
|
|
@@ -5099,7 +5116,7 @@ const BooleanComponent = ({
|
|
|
5099
5116
|
errors,
|
|
5100
5117
|
schema
|
|
5101
5118
|
});
|
|
5102
|
-
const text = `${(
|
|
5119
|
+
const text = `${((_a = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _a === void 0 ? void 0 : _a.text) ? (_b = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _b === void 0 ? void 0 : _b.text : (schema === null || schema === void 0 ? void 0 : schema.title) ? schema === null || schema === void 0 ? void 0 : schema.title : schema === null || schema === void 0 ? void 0 : schema.description}${required ? ' (required)' : ''}`;
|
|
5103
5120
|
return jsx(GoACheckbox, Object.assign({
|
|
5104
5121
|
error: errorsFormInput.length > 0,
|
|
5105
5122
|
testId: `${path}-checkbox-test-id`,
|
|
@@ -5110,7 +5127,7 @@ const BooleanComponent = ({
|
|
|
5110
5127
|
onChange: (_, checked) => {
|
|
5111
5128
|
handleChange(path, checked);
|
|
5112
5129
|
}
|
|
5113
|
-
}, (
|
|
5130
|
+
}, (_c = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _c === void 0 ? void 0 : _c.componentProps, {
|
|
5114
5131
|
mb: "none"
|
|
5115
5132
|
}));
|
|
5116
5133
|
};
|
|
@@ -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", {
|
|
@@ -7565,10 +7593,10 @@ const SearchBox = styled.div(_t$1 || (_t$1 = _$1`
|
|
|
7565
7593
|
box-shadow: 0 8px 8px rgb(0 0 0 / 20%), 0 4px 4px rgb(0 0 0 / 10%);
|
|
7566
7594
|
z-index: 99;
|
|
7567
7595
|
overflow: hidden auto;
|
|
7596
|
+
padding-left: 0.5rem;
|
|
7568
7597
|
}
|
|
7569
7598
|
.suggestions li {
|
|
7570
|
-
|
|
7571
|
-
color: var(--color-gray-900);
|
|
7599
|
+
|
|
7572
7600
|
}
|
|
7573
7601
|
.suggestion-active,
|
|
7574
7602
|
.suggestions li:hover {
|
|
@@ -7614,6 +7642,7 @@ const ListItem = styled.li(_t6 || (_t6 = _$1`
|
|
|
7614
7642
|
background-color: ${0};
|
|
7615
7643
|
color: ${0};
|
|
7616
7644
|
font-weight: ${0};
|
|
7645
|
+
padding: var(--goa-space-xs) var(--goa-space-2xs) var(--goa-space-xs);
|
|
7617
7646
|
`), ({
|
|
7618
7647
|
selectedIndex,
|
|
7619
7648
|
index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "1.44.
|
|
3
|
+
"version": "1.44.4",
|
|
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;
|