@abgov/jsonforms-components 2.4.1 → 2.4.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 +140 -106
- package/package.json +1 -1
- package/src/lib/Controls/AddressLookup/utils.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -7,7 +7,7 @@ import axios from 'axios';
|
|
|
7
7
|
import get$1 from 'lodash/get';
|
|
8
8
|
import { rankWith, isStringControl, and, optionIs, uiTypeIs, isDateControl, isNumberControl, isIntegerControl, isDateTimeControl, isTimeControl, isEnumControl, isBooleanControl, getAjv, isVisible, getControlPath, toDataPath, deriveLabelForUISchemaElement, isEnabled, schemaTypeIs, formatIs, createDefaultValue, or, isObjectArrayControl, isPrimitiveArrayControl, Paths, schemaMatches, hasType, isControl, isCategorization, isLayout } from '@jsonforms/core';
|
|
9
9
|
import { withJsonFormsControlProps, withJsonFormsRendererProps, withJsonFormsEnumProps, withTranslateProps, JsonFormsDispatch, useJsonForms, withJsonFormsLayoutProps, withJsonFormsArrayLayoutProps, withJsonFormsAllOfProps, withJsonFormsCellProps } from '@jsonforms/react';
|
|
10
|
-
import * as _$
|
|
10
|
+
import * as _$b from 'lodash';
|
|
11
11
|
import { isEqual, isEmpty as isEmpty$1, isObject as isObject$f } from 'lodash';
|
|
12
12
|
import merge from 'lodash/merge';
|
|
13
13
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -3499,16 +3499,16 @@ const onChangeForNumericControl = props => {
|
|
|
3499
3499
|
}
|
|
3500
3500
|
};
|
|
3501
3501
|
|
|
3502
|
-
let _$
|
|
3502
|
+
let _$a = t => t,
|
|
3503
3503
|
_t$b,
|
|
3504
3504
|
_t2$7;
|
|
3505
|
-
styled.div(_t$b || (_t$b = _$
|
|
3505
|
+
styled.div(_t$b || (_t$b = _$a`
|
|
3506
3506
|
height: 70vh;
|
|
3507
3507
|
overflow-y: auto;
|
|
3508
3508
|
padding-left: var(--goa-space-2xs);
|
|
3509
3509
|
padding-right: var(--goa-space-2xs);
|
|
3510
3510
|
`));
|
|
3511
|
-
const Visible = styled.div(_t2$7 || (_t2$7 = _$
|
|
3511
|
+
const Visible = styled.div(_t2$7 || (_t2$7 = _$a`
|
|
3512
3512
|
display: ${0};
|
|
3513
3513
|
`), p => p.visible ? 'initial' : 'none');
|
|
3514
3514
|
|
|
@@ -4299,7 +4299,7 @@ const JsonFormRegisterProvider = ({
|
|
|
4299
4299
|
});
|
|
4300
4300
|
};
|
|
4301
4301
|
|
|
4302
|
-
let _$
|
|
4302
|
+
let _$9 = t => t,
|
|
4303
4303
|
_t$a,
|
|
4304
4304
|
_t2$6,
|
|
4305
4305
|
_t3$5,
|
|
@@ -4308,42 +4308,42 @@ let _$a = t => t,
|
|
|
4308
4308
|
_t6$3,
|
|
4309
4309
|
_t7$2,
|
|
4310
4310
|
_t8$2;
|
|
4311
|
-
const FormFieldWrapper = styled.div(_t$a || (_t$a = _$
|
|
4311
|
+
const FormFieldWrapper = styled.div(_t$a || (_t$a = _$9`
|
|
4312
4312
|
margin-bottom: var(--goa-space-l);
|
|
4313
4313
|
`));
|
|
4314
|
-
const WarningIconDiv = styled.div(_t2$6 || (_t2$6 = _$
|
|
4314
|
+
const WarningIconDiv = styled.div(_t2$6 || (_t2$6 = _$9`
|
|
4315
4315
|
display: inline-flex;
|
|
4316
4316
|
align-items: flex-start;
|
|
4317
4317
|
gap: 0.25rem;
|
|
4318
4318
|
font-size: var(--goa-font-size-2);
|
|
4319
4319
|
color: var(--goa-color-interactive-error);
|
|
4320
4320
|
`));
|
|
4321
|
-
const RequiredTextLabel = styled.label(_t3$5 || (_t3$5 = _$
|
|
4321
|
+
const RequiredTextLabel = styled.label(_t3$5 || (_t3$5 = _$9`
|
|
4322
4322
|
color: var(--goa-color-greyscale-700);
|
|
4323
4323
|
font-weight: var(--goa-font-weight-regular);
|
|
4324
4324
|
font-size: var(--goa-font-size-2);
|
|
4325
4325
|
line-height: var(--goa-line-height-1);
|
|
4326
4326
|
font-style: normal;
|
|
4327
4327
|
`));
|
|
4328
|
-
const PageReviewNameCol = styled.td(_t4$5 || (_t4$5 = _$
|
|
4328
|
+
const PageReviewNameCol = styled.td(_t4$5 || (_t4$5 = _$9`
|
|
4329
4329
|
width: 5%;
|
|
4330
4330
|
padding-top: var(--goa-space-s);
|
|
4331
4331
|
padding-bottom: var(--goa-space-s);
|
|
4332
4332
|
padding-right: var(--goa-space-m);
|
|
4333
4333
|
`));
|
|
4334
|
-
const PageReviewValueCol = styled.td(_t5$3 || (_t5$3 = _$
|
|
4334
|
+
const PageReviewValueCol = styled.td(_t5$3 || (_t5$3 = _$9`
|
|
4335
4335
|
width: 20%;
|
|
4336
4336
|
text-align: left;
|
|
4337
4337
|
`));
|
|
4338
4338
|
//Check and unchecked are different heights otherwise
|
|
4339
|
-
const CheckboxWrapper = styled.div(_t6$3 || (_t6$3 = _$
|
|
4339
|
+
const CheckboxWrapper = styled.div(_t6$3 || (_t6$3 = _$9`
|
|
4340
4340
|
height: 28px;
|
|
4341
4341
|
`));
|
|
4342
|
-
styled.h4(_t7$2 || (_t7$2 = _$
|
|
4342
|
+
styled.h4(_t7$2 || (_t7$2 = _$9`
|
|
4343
4343
|
margin: 0 0 0.25rem 0;
|
|
4344
4344
|
fontsize: larger;
|
|
4345
4345
|
`));
|
|
4346
|
-
styled.h4(_t8$2 || (_t8$2 = _$
|
|
4346
|
+
styled.h4(_t8$2 || (_t8$2 = _$9`
|
|
4347
4347
|
border-bottom: 1px solid #ddd;
|
|
4348
4348
|
`));
|
|
4349
4349
|
|
|
@@ -4568,12 +4568,12 @@ const SPACE_KEY = ' ';
|
|
|
4568
4568
|
const ALT_KEY = 'Alt';
|
|
4569
4569
|
const SHIFT_KEY = 'Shift';
|
|
4570
4570
|
|
|
4571
|
-
let _$
|
|
4571
|
+
let _$8 = t => t,
|
|
4572
4572
|
_t$9,
|
|
4573
4573
|
_t2$5,
|
|
4574
4574
|
_t3$4,
|
|
4575
4575
|
_t4$4;
|
|
4576
|
-
const GoADropdownTextbox = styled.div(_t$9 || (_t$9 = _$
|
|
4576
|
+
const GoADropdownTextbox = styled.div(_t$9 || (_t$9 = _$8`
|
|
4577
4577
|
border-radius: var(--goa-space-2xs);
|
|
4578
4578
|
box-shadow: ${0};
|
|
4579
4579
|
&:hover {
|
|
@@ -4584,11 +4584,11 @@ const GoADropdownTextbox = styled.div(_t$9 || (_t$9 = _$9`
|
|
|
4584
4584
|
box-shadow: ${0};
|
|
4585
4585
|
}
|
|
4586
4586
|
`), p => p.isOpen ? `0 0 0 3px var(--goa-color-interactive-focus)` : '', p => p.isOpen ? `0 0 0 3px var(--goa-color-interactive-focus) !important` : '');
|
|
4587
|
-
const GoADropdownListContainerWrapper = styled.div(_t2$5 || (_t2$5 = _$
|
|
4587
|
+
const GoADropdownListContainerWrapper = styled.div(_t2$5 || (_t2$5 = _$8`
|
|
4588
4588
|
position: relative;
|
|
4589
4589
|
display: ${0};
|
|
4590
4590
|
`), p => !(p === null || p === void 0 ? void 0 : p.isOpen) && 'none');
|
|
4591
|
-
const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$
|
|
4591
|
+
const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$8`
|
|
4592
4592
|
border: solid 1px var(--goa-color-greyscale-200);
|
|
4593
4593
|
border-radius: var(--goa-space-2xs);
|
|
4594
4594
|
background: var(--goa-color-greyscale-white);
|
|
@@ -4612,7 +4612,7 @@ const GoADropdownListContainer = styled.div(_t3$4 || (_t3$4 = _$9`
|
|
|
4612
4612
|
scrollbar-color: #a8a8a8 var(--goa-color-greyscale-100) !important;
|
|
4613
4613
|
}
|
|
4614
4614
|
`), p => p.optionListMaxHeight || '272px');
|
|
4615
|
-
const GoADropdownListOption = styled.div(_t4$4 || (_t4$4 = _$
|
|
4615
|
+
const GoADropdownListOption = styled.div(_t4$4 || (_t4$4 = _$8`
|
|
4616
4616
|
padding: var(--goa-space-2xs) var(--goa-space-s);
|
|
4617
4617
|
text-overflow: ellipsis;
|
|
4618
4618
|
color: ${0} !important;
|
|
@@ -5679,7 +5679,7 @@ const BooleanRadioControl = props => jsx(GoAInputBaseControl, Object.assign({},
|
|
|
5679
5679
|
const GoABooleanRadioControlTester = rankWith(3, and(isBooleanControl, optionIs('radio', true)));
|
|
5680
5680
|
const GoABooleanRadioControl = withJsonFormsControlProps(BooleanRadioControl);
|
|
5681
5681
|
|
|
5682
|
-
let _$
|
|
5682
|
+
let _$7 = t => t,
|
|
5683
5683
|
_t$8;
|
|
5684
5684
|
const Checkboxes = ({
|
|
5685
5685
|
children,
|
|
@@ -5692,7 +5692,7 @@ const Checkboxes = ({
|
|
|
5692
5692
|
children: children
|
|
5693
5693
|
});
|
|
5694
5694
|
};
|
|
5695
|
-
const CheckBoxGroupDiv = styled.div(_t$8 || (_t$8 = _$
|
|
5695
|
+
const CheckBoxGroupDiv = styled.div(_t$8 || (_t$8 = _$7`
|
|
5696
5696
|
.horizontal {
|
|
5697
5697
|
display: flex;
|
|
5698
5698
|
flex-direction: row;
|
|
@@ -5892,7 +5892,7 @@ const GoAInputBaseTableReview = props => {
|
|
|
5892
5892
|
};
|
|
5893
5893
|
const GoAInputBaseTableReviewControl = withJsonFormsControlProps(GoAInputBaseTableReview);
|
|
5894
5894
|
|
|
5895
|
-
let _$
|
|
5895
|
+
let _$6 = t => t,
|
|
5896
5896
|
_t$7;
|
|
5897
5897
|
const renderLayoutElements = (elements, schema, path, enabled, renderers, cells) => {
|
|
5898
5898
|
return elements.map((child, index) => jsx(JsonFormsDispatch, {
|
|
@@ -5972,13 +5972,13 @@ const ReviewLayoutRenderer = ({
|
|
|
5972
5972
|
}
|
|
5973
5973
|
}
|
|
5974
5974
|
};
|
|
5975
|
-
const ReviewGrid = styled.div(_t$7 || (_t$7 = _$
|
|
5975
|
+
const ReviewGrid = styled.div(_t$7 || (_t$7 = _$6`
|
|
5976
5976
|
display: grid;
|
|
5977
5977
|
grid-template-columns: repeat(auto-fit, minmax(250px, calc(50% - 8px)));
|
|
5978
5978
|
gap: 16px;
|
|
5979
5979
|
`));
|
|
5980
5980
|
|
|
5981
|
-
let _$
|
|
5981
|
+
let _$5 = t => t,
|
|
5982
5982
|
_t$6,
|
|
5983
5983
|
_t2$4,
|
|
5984
5984
|
_t3$3,
|
|
@@ -6001,7 +6001,7 @@ let _$6 = t => t,
|
|
|
6001
6001
|
_t20$1,
|
|
6002
6002
|
_t21,
|
|
6003
6003
|
_t22;
|
|
6004
|
-
const ReviewItem = styled.div(_t$6 || (_t$6 = _$
|
|
6004
|
+
const ReviewItem = styled.div(_t$6 || (_t$6 = _$5`
|
|
6005
6005
|
display: flex;
|
|
6006
6006
|
flex-direction: column;
|
|
6007
6007
|
border: var(--goa-border-width-s) solid grey;
|
|
@@ -6012,7 +6012,7 @@ const ReviewItem = styled.div(_t$6 || (_t$6 = _$6`
|
|
|
6012
6012
|
display: none;
|
|
6013
6013
|
}
|
|
6014
6014
|
`));
|
|
6015
|
-
const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$
|
|
6015
|
+
const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$5`
|
|
6016
6016
|
background-color: #f1f1f1;
|
|
6017
6017
|
margin-bottom: var(--goa-space-m);
|
|
6018
6018
|
padding: var(--goa-space-m);
|
|
@@ -6023,18 +6023,18 @@ const ReviewItemSection = styled.div(_t2$4 || (_t2$4 = _$6`
|
|
|
6023
6023
|
max-width: 1600px;
|
|
6024
6024
|
}
|
|
6025
6025
|
`));
|
|
6026
|
-
const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$
|
|
6026
|
+
const ReviewItemHeader = styled.div(_t3$3 || (_t3$3 = _$5`
|
|
6027
6027
|
display: flex;
|
|
6028
6028
|
align-items: center;
|
|
6029
6029
|
justify-content: space-between;
|
|
6030
6030
|
margin-bottom: var(--goa-space-xl);
|
|
6031
6031
|
`));
|
|
6032
|
-
const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$
|
|
6032
|
+
const ReviewItemTitle = styled.div(_t4$3 || (_t4$3 = _$5`
|
|
6033
6033
|
font-size: var(--goa-space-l);
|
|
6034
6034
|
line-height: var(--goa-space-xl);
|
|
6035
6035
|
font-weight: 300;
|
|
6036
6036
|
`));
|
|
6037
|
-
const Anchor = styled.div(_t5$2 || (_t5$2 = _$
|
|
6037
|
+
const Anchor = styled.div(_t5$2 || (_t5$2 = _$5`
|
|
6038
6038
|
color: #0070c4;
|
|
6039
6039
|
text-decoration: underline;
|
|
6040
6040
|
outline: none;
|
|
@@ -6045,20 +6045,20 @@ const Anchor = styled.div(_t5$2 || (_t5$2 = _$6`
|
|
|
6045
6045
|
background-color: #e6f7ff;
|
|
6046
6046
|
}
|
|
6047
6047
|
`));
|
|
6048
|
-
styled.div(_t6$2 || (_t6$2 = _$
|
|
6048
|
+
styled.div(_t6$2 || (_t6$2 = _$5`
|
|
6049
6049
|
margin-left: var(--goa-space-m);
|
|
6050
6050
|
`));
|
|
6051
|
-
styled.div(_t7$1 || (_t7$1 = _$
|
|
6051
|
+
styled.div(_t7$1 || (_t7$1 = _$5`
|
|
6052
6052
|
margin-bottom: var(--goa-space-m);
|
|
6053
6053
|
`));
|
|
6054
|
-
styled.div(_t8$1 || (_t8$1 = _$
|
|
6054
|
+
styled.div(_t8$1 || (_t8$1 = _$5`
|
|
6055
6055
|
margin: var(--goa-space-s);
|
|
6056
6056
|
width: 100%;
|
|
6057
6057
|
`));
|
|
6058
|
-
styled.h3(_t9$1 || (_t9$1 = _$
|
|
6058
|
+
styled.h3(_t9$1 || (_t9$1 = _$5`
|
|
6059
6059
|
text-transform: capitalize;
|
|
6060
6060
|
`));
|
|
6061
|
-
const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$
|
|
6061
|
+
const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$5`
|
|
6062
6062
|
@media screen and (max-width: 767px) {
|
|
6063
6063
|
margin-bottom: var(--goa-space-l);
|
|
6064
6064
|
}
|
|
@@ -6068,57 +6068,57 @@ const RightAlignmentDiv = styled.div(_t10$1 || (_t10$1 = _$6`
|
|
|
6068
6068
|
margin-bottom: var(--goa-space-l);
|
|
6069
6069
|
}
|
|
6070
6070
|
`));
|
|
6071
|
-
const FormStepperSummaryH3 = styled.h3(_t11$1 || (_t11$1 = _$
|
|
6071
|
+
const FormStepperSummaryH3 = styled.h3(_t11$1 || (_t11$1 = _$5`
|
|
6072
6072
|
flex: 1;
|
|
6073
6073
|
margin-bottom: var(--goa-space-m);
|
|
6074
6074
|
font-size: var(--goa-font-size-7);
|
|
6075
6075
|
line-height: var(--goa-line-height-4);
|
|
6076
6076
|
font-weight: var(--goa-font-weight-regular);
|
|
6077
6077
|
`));
|
|
6078
|
-
const PageRenderPadding = styled.div(_t12$1 || (_t12$1 = _$
|
|
6078
|
+
const PageRenderPadding = styled.div(_t12$1 || (_t12$1 = _$5`
|
|
6079
6079
|
margin-top: var(--goa-space-2xl);
|
|
6080
6080
|
`));
|
|
6081
|
-
const PageBorder = styled.h3(_t13$1 || (_t13$1 = _$
|
|
6081
|
+
const PageBorder = styled.h3(_t13$1 || (_t13$1 = _$5`
|
|
6082
6082
|
padding: var(--goa-space-3xl);
|
|
6083
6083
|
`));
|
|
6084
|
-
const TableReviewItemSection = styled.div(_t14$1 || (_t14$1 = _$
|
|
6084
|
+
const TableReviewItemSection = styled.div(_t14$1 || (_t14$1 = _$5`
|
|
6085
6085
|
.element-style {
|
|
6086
6086
|
max-width: 1600px;
|
|
6087
6087
|
}
|
|
6088
6088
|
`));
|
|
6089
|
-
const TableReviewItem = styled.div(_t15$1 || (_t15$1 = _$
|
|
6089
|
+
const TableReviewItem = styled.div(_t15$1 || (_t15$1 = _$5`
|
|
6090
6090
|
border: 1px solid #dcdcdc;
|
|
6091
6091
|
border-radius: 5px;
|
|
6092
6092
|
padding: var(--goa-space-2xl);
|
|
6093
6093
|
`));
|
|
6094
|
-
const TableReviewPageTitleRow = styled.div(_t16$1 || (_t16$1 = _$
|
|
6094
|
+
const TableReviewPageTitleRow = styled.div(_t16$1 || (_t16$1 = _$5`
|
|
6095
6095
|
margin-top: var(--goa-space-xl);
|
|
6096
6096
|
display: flex;
|
|
6097
6097
|
justify-content: space-between;
|
|
6098
6098
|
`));
|
|
6099
|
-
const TableReviewCategoryLabel = styled.h3(_t17$1 || (_t17$1 = _$
|
|
6099
|
+
const TableReviewCategoryLabel = styled.h3(_t17$1 || (_t17$1 = _$5`
|
|
6100
6100
|
color: var(--goa-color-text-secondary) !important;
|
|
6101
6101
|
margin-bottom: var(--goa-space-l);
|
|
6102
6102
|
`));
|
|
6103
|
-
const CategoryStatus = styled.td(_t18$1 || (_t18$1 = _$
|
|
6103
|
+
const CategoryStatus = styled.td(_t18$1 || (_t18$1 = _$5`
|
|
6104
6104
|
width: var(--goa-space-xl);
|
|
6105
6105
|
padding-right: var(--goa-space-xl);
|
|
6106
6106
|
`));
|
|
6107
|
-
const TocPageRef = styled.td(_t19$1 || (_t19$1 = _$
|
|
6107
|
+
const TocPageRef = styled.td(_t19$1 || (_t19$1 = _$5`
|
|
6108
6108
|
padding-left: var(--goa-space-xl);
|
|
6109
6109
|
`));
|
|
6110
|
-
const TocTitle = styled.h1(_t20$1 || (_t20$1 = _$
|
|
6110
|
+
const TocTitle = styled.h1(_t20$1 || (_t20$1 = _$5`
|
|
6111
6111
|
padding: 0;
|
|
6112
6112
|
margin: 0;
|
|
6113
6113
|
padding-left: var(--goa-space-xl);
|
|
6114
6114
|
padding-bottom: var(--goa-space-3xl);
|
|
6115
6115
|
`));
|
|
6116
|
-
const TocSubtitle = styled.h2(_t21 || (_t21 = _$
|
|
6116
|
+
const TocSubtitle = styled.h2(_t21 || (_t21 = _$5`
|
|
6117
6117
|
padding: 0;
|
|
6118
6118
|
margin: 0;
|
|
6119
6119
|
padding-left: var(--goa-space-xl);
|
|
6120
6120
|
`));
|
|
6121
|
-
const CompletionStatus = styled.div(_t22 || (_t22 = _$
|
|
6121
|
+
const CompletionStatus = styled.div(_t22 || (_t22 = _$5`
|
|
6122
6122
|
padding: 0;
|
|
6123
6123
|
margin: 0;
|
|
6124
6124
|
padding-left: var(--goa-space-xl);
|
|
@@ -6434,7 +6434,7 @@ const pickPropertyValues = (obj, property, endWithType) => {
|
|
|
6434
6434
|
var _a;
|
|
6435
6435
|
if (key === property) {
|
|
6436
6436
|
values.push(obj[key]);
|
|
6437
|
-
} else if (_$
|
|
6437
|
+
} else if (_$b.isObject(obj[key])) {
|
|
6438
6438
|
// if the object type is equal to end type, we are not going to continue the recursive approach
|
|
6439
6439
|
if (endWithType && ((_a = obj[key]) === null || _a === void 0 ? void 0 : _a.type) === endWithType) {
|
|
6440
6440
|
if (property in obj[key]) {
|
|
@@ -6443,7 +6443,7 @@ const pickPropertyValues = (obj, property, endWithType) => {
|
|
|
6443
6443
|
} else {
|
|
6444
6444
|
values = [...values, ...pickPropertyValues(obj[key], property, endWithType)];
|
|
6445
6445
|
}
|
|
6446
|
-
} else if (_$
|
|
6446
|
+
} else if (_$b.isArray(obj[key])) {
|
|
6447
6447
|
const nextValues = obj[key].map(function (arrayObj) {
|
|
6448
6448
|
return pickPropertyValues(arrayObj, property, endWithType);
|
|
6449
6449
|
});
|
|
@@ -7331,9 +7331,9 @@ const FormStepperPageReviewer = props => {
|
|
|
7331
7331
|
};
|
|
7332
7332
|
withAjvProps(withTranslateProps(withJsonFormsLayoutProps(FormStepperPageReviewer)));
|
|
7333
7333
|
|
|
7334
|
-
let _$
|
|
7334
|
+
let _$4 = t => t,
|
|
7335
7335
|
_t$5;
|
|
7336
|
-
const BackButtonWrapper = styled.span(_t$5 || (_t$5 = _$
|
|
7336
|
+
const BackButtonWrapper = styled.span(_t$5 || (_t$5 = _$4`
|
|
7337
7337
|
.back-link::before {
|
|
7338
7338
|
content: '';
|
|
7339
7339
|
display: inline-block;
|
|
@@ -7585,7 +7585,7 @@ const CategorizationPagesRendererTester = rankWith(2, and(uiTypeIs('Categorizati
|
|
|
7585
7585
|
return ((_a = uischema.options) === null || _a === void 0 ? void 0 : _a.variant) === 'pages';
|
|
7586
7586
|
}));
|
|
7587
7587
|
|
|
7588
|
-
let _$
|
|
7588
|
+
let _$3 = t => t,
|
|
7589
7589
|
_t$4;
|
|
7590
7590
|
const GoAContextMenuIcon = props => {
|
|
7591
7591
|
return jsx(GoAIconButton, {
|
|
@@ -7597,7 +7597,7 @@ const GoAContextMenuIcon = props => {
|
|
|
7597
7597
|
disabled: props.disabled
|
|
7598
7598
|
});
|
|
7599
7599
|
};
|
|
7600
|
-
const GoAContextMenu = styled.div(_t$4 || (_t$4 = _$
|
|
7600
|
+
const GoAContextMenu = styled.div(_t$4 || (_t$4 = _$3`
|
|
7601
7601
|
display: flex;
|
|
7602
7602
|
align-items: center;
|
|
7603
7603
|
background-color: #fff;
|
|
@@ -7644,7 +7644,7 @@ const DeleteFileModal = ({
|
|
|
7644
7644
|
});
|
|
7645
7645
|
};
|
|
7646
7646
|
|
|
7647
|
-
let
|
|
7647
|
+
let _2 = t => t,
|
|
7648
7648
|
_t$3,
|
|
7649
7649
|
_t2$3,
|
|
7650
7650
|
_t3$2,
|
|
@@ -7657,7 +7657,7 @@ const FileUploaderReview = props => {
|
|
|
7657
7657
|
}));
|
|
7658
7658
|
};
|
|
7659
7659
|
const FileUploader = _a => {
|
|
7660
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
7660
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
7661
7661
|
var {
|
|
7662
7662
|
data,
|
|
7663
7663
|
path,
|
|
@@ -7685,7 +7685,8 @@ const FileUploader = _a => {
|
|
|
7685
7685
|
} = props;
|
|
7686
7686
|
const propertyId = i18nKeyPrefix;
|
|
7687
7687
|
const variant = ((_e = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _e === void 0 ? void 0 : _e.variant) || 'button';
|
|
7688
|
-
const
|
|
7688
|
+
const multiFileUploader = variant === 'dragdrop';
|
|
7689
|
+
const [deleteHide, setDeleteHide] = useState(false);
|
|
7689
7690
|
function uploadFile(file) {
|
|
7690
7691
|
if (uploadTrigger) {
|
|
7691
7692
|
uploadTrigger(file, propertyId);
|
|
@@ -7693,6 +7694,7 @@ const FileUploader = _a => {
|
|
|
7693
7694
|
const value = ['Loading', Array.isArray(data) ? data[1] : file === null || file === void 0 ? void 0 : file.name];
|
|
7694
7695
|
handleChange(propertyId, value);
|
|
7695
7696
|
};
|
|
7697
|
+
setDeleteHide(false);
|
|
7696
7698
|
setTimeout(handleFunction, DELAY_UPLOAD_TIMEOUT_MS);
|
|
7697
7699
|
}
|
|
7698
7700
|
}
|
|
@@ -7706,11 +7708,12 @@ const FileUploader = _a => {
|
|
|
7706
7708
|
deleteTrigger(file, propertyId);
|
|
7707
7709
|
}
|
|
7708
7710
|
}
|
|
7709
|
-
function getFileName() {
|
|
7710
|
-
|
|
7711
|
+
function getFileName(index) {
|
|
7712
|
+
var _a;
|
|
7713
|
+
return fileList && fileList[props.i18nKeyPrefix] && ((_a = fileList[props.i18nKeyPrefix][index]) === null || _a === void 0 ? void 0 : _a.filename);
|
|
7711
7714
|
}
|
|
7712
|
-
function getFile() {
|
|
7713
|
-
return fileList && fileList[props.i18nKeyPrefix];
|
|
7715
|
+
function getFile(index) {
|
|
7716
|
+
return fileList && fileList[props.i18nKeyPrefix] && fileList[props.i18nKeyPrefix][index];
|
|
7714
7717
|
}
|
|
7715
7718
|
useEffect(() => {
|
|
7716
7719
|
// UseEffect is required because not having it causes a react update error, but
|
|
@@ -7732,6 +7735,55 @@ const FileUploader = _a => {
|
|
|
7732
7735
|
}
|
|
7733
7736
|
const helpText = (_p = uischema === null || uischema === void 0 ? void 0 : uischema.options) === null || _p === void 0 ? void 0 : _p.help;
|
|
7734
7737
|
const sentenceCaseLabel = convertToSentenceCase(label);
|
|
7738
|
+
const DownloadFileWidget = ({
|
|
7739
|
+
index
|
|
7740
|
+
}) => {
|
|
7741
|
+
var _a;
|
|
7742
|
+
const [showFileDeleteConfirmation, setShowFileDeleteConfirmation] = useState(false);
|
|
7743
|
+
return jsx("div", {
|
|
7744
|
+
children: readOnly && index ? jsxs(AttachmentBorderDisabled, {
|
|
7745
|
+
children: [getFileName(index), jsx(GoAContextMenuIcon, {
|
|
7746
|
+
testId: "download-icon",
|
|
7747
|
+
title: "Download",
|
|
7748
|
+
type: "download",
|
|
7749
|
+
onClick: () => downloadFile(getFile(index))
|
|
7750
|
+
})]
|
|
7751
|
+
}) : jsxs(AttachmentBorder, {
|
|
7752
|
+
children: [jsx("div", {
|
|
7753
|
+
children: getFileName(index)
|
|
7754
|
+
}), jsxs(GoAContextMenu, {
|
|
7755
|
+
children: [jsx(GoAContextMenuIcon, {
|
|
7756
|
+
testId: "download-icon",
|
|
7757
|
+
title: "Download",
|
|
7758
|
+
type: "download",
|
|
7759
|
+
onClick: () => downloadFile(getFile(index))
|
|
7760
|
+
}), jsx(GoAContextMenuIcon, {
|
|
7761
|
+
"data-testid": "delete-icon",
|
|
7762
|
+
title: "Delete",
|
|
7763
|
+
type: "trash",
|
|
7764
|
+
onClick: () => {
|
|
7765
|
+
setShowFileDeleteConfirmation(true);
|
|
7766
|
+
}
|
|
7767
|
+
})]
|
|
7768
|
+
}), jsx(DeleteFileModal, {
|
|
7769
|
+
isOpen: showFileDeleteConfirmation,
|
|
7770
|
+
title: "Delete file",
|
|
7771
|
+
content: `Delete file ${(_a = getFile(index)) === null || _a === void 0 ? void 0 : _a.filename} ?`,
|
|
7772
|
+
onCancel: () => setShowFileDeleteConfirmation(false),
|
|
7773
|
+
onDelete: () => {
|
|
7774
|
+
setShowFileDeleteConfirmation(false);
|
|
7775
|
+
deleteFile(getFile(index));
|
|
7776
|
+
setDeleteHide(true);
|
|
7777
|
+
const handleFunction = () => {
|
|
7778
|
+
handleChange(propertyId, '');
|
|
7779
|
+
};
|
|
7780
|
+
setTimeout(handleFunction, DELAY_DELETE_TIMEOUT_MS);
|
|
7781
|
+
}
|
|
7782
|
+
})]
|
|
7783
|
+
})
|
|
7784
|
+
});
|
|
7785
|
+
};
|
|
7786
|
+
const fileListLength = fileList && ((_q = fileList[props.i18nKeyPrefix]) === null || _q === void 0 ? void 0 : _q.length) || 0;
|
|
7735
7787
|
return jsxs(FileUploaderStyle, {
|
|
7736
7788
|
className: "FileUploader",
|
|
7737
7789
|
children: [required ? jsx(GoAFormItem, {
|
|
@@ -7762,57 +7814,23 @@ const FileUploader = _a => {
|
|
|
7762
7814
|
})
|
|
7763
7815
|
})
|
|
7764
7816
|
}) : jsx("div", {
|
|
7765
|
-
children: fileList &&
|
|
7766
|
-
|
|
7767
|
-
|
|
7768
|
-
|
|
7769
|
-
|
|
7770
|
-
|
|
7771
|
-
onClick: () => downloadFile(getFile())
|
|
7772
|
-
})]
|
|
7773
|
-
}) : jsxs(AttachmentBorder, {
|
|
7774
|
-
children: [jsx("div", {
|
|
7775
|
-
children: getFileName()
|
|
7776
|
-
}), jsxs(GoAContextMenu, {
|
|
7777
|
-
children: [jsx(GoAContextMenuIcon, {
|
|
7778
|
-
testId: "download-icon",
|
|
7779
|
-
title: "Download",
|
|
7780
|
-
type: "download",
|
|
7781
|
-
onClick: () => downloadFile(getFile())
|
|
7782
|
-
}), jsx(GoAContextMenuIcon, {
|
|
7783
|
-
"data-testid": "delete-icon",
|
|
7784
|
-
title: "Delete",
|
|
7785
|
-
type: "trash",
|
|
7786
|
-
onClick: () => {
|
|
7787
|
-
setShowFileDeleteConfirmation(true);
|
|
7788
|
-
}
|
|
7789
|
-
})]
|
|
7790
|
-
}), jsx(DeleteFileModal, {
|
|
7791
|
-
isOpen: showFileDeleteConfirmation,
|
|
7792
|
-
title: "Delete file",
|
|
7793
|
-
content: `Delete file ${getFile().filename} ?`,
|
|
7794
|
-
onCancel: () => setShowFileDeleteConfirmation(false),
|
|
7795
|
-
onDelete: () => {
|
|
7796
|
-
setShowFileDeleteConfirmation(false);
|
|
7797
|
-
deleteFile(getFile());
|
|
7798
|
-
const handleFunction = () => {
|
|
7799
|
-
handleChange(propertyId, '');
|
|
7800
|
-
};
|
|
7801
|
-
setTimeout(handleFunction, DELAY_DELETE_TIMEOUT_MS);
|
|
7802
|
-
}
|
|
7803
|
-
})]
|
|
7804
|
-
})
|
|
7817
|
+
children: multiFileUploader ? fileList && (fileList[props.i18nKeyPrefix] || []).map((_, index) => {
|
|
7818
|
+
return jsx(DownloadFileWidget, {
|
|
7819
|
+
index: index
|
|
7820
|
+
});
|
|
7821
|
+
}) : fileList && !deleteHide && getFile(fileListLength - 1) && fileListLength >= 0 && jsx(DownloadFileWidget, {
|
|
7822
|
+
index: fileListLength - 1
|
|
7805
7823
|
})
|
|
7806
7824
|
})
|
|
7807
7825
|
})]
|
|
7808
7826
|
});
|
|
7809
7827
|
};
|
|
7810
|
-
const HelpText = styled.div(_t$3 || (_t$3 =
|
|
7828
|
+
const HelpText = styled.div(_t$3 || (_t$3 = _2`
|
|
7811
7829
|
margin-top: var(--goa-space-xs);
|
|
7812
7830
|
font-size: var(--goa-font-size-3);
|
|
7813
7831
|
color: var(--goa-color-text-secondary);
|
|
7814
7832
|
`));
|
|
7815
|
-
const AttachmentBorderDisabled = styled.div(_t2$3 || (_t2$3 =
|
|
7833
|
+
const AttachmentBorderDisabled = styled.div(_t2$3 || (_t2$3 = _2`
|
|
7816
7834
|
display: flex;
|
|
7817
7835
|
flex-direction: row;
|
|
7818
7836
|
border: var(--goa-border-width-s) solid #dcdcdc;
|
|
@@ -7821,7 +7839,7 @@ const AttachmentBorderDisabled = styled.div(_t2$3 || (_t2$3 = _$3`
|
|
|
7821
7839
|
width: fit-content;
|
|
7822
7840
|
background-color: #f1f1f1;
|
|
7823
7841
|
`));
|
|
7824
|
-
const AttachmentBorder = styled.div(_t3$2 || (_t3$2 =
|
|
7842
|
+
const AttachmentBorder = styled.div(_t3$2 || (_t3$2 = _2`
|
|
7825
7843
|
display: flex;
|
|
7826
7844
|
flex-direction: row;
|
|
7827
7845
|
border: var(--goa-border-width-s) solid #dcdcdc;
|
|
@@ -7830,7 +7848,7 @@ const AttachmentBorder = styled.div(_t3$2 || (_t3$2 = _$3`
|
|
|
7830
7848
|
width: fit-content;
|
|
7831
7849
|
margin-top: var(--goa-space-2xs);
|
|
7832
7850
|
`));
|
|
7833
|
-
const FileUploaderStyle = styled.div(_t4$2 || (_t4$2 =
|
|
7851
|
+
const FileUploaderStyle = styled.div(_t4$2 || (_t4$2 = _2`
|
|
7834
7852
|
margin-bottom: var(--goa-space-l);
|
|
7835
7853
|
.label {
|
|
7836
7854
|
display: block;
|
|
@@ -9605,6 +9623,22 @@ const formatPostalCode = value => {
|
|
|
9605
9623
|
}
|
|
9606
9624
|
return value;
|
|
9607
9625
|
};
|
|
9626
|
+
function detectPostalCodeType(input) {
|
|
9627
|
+
const cleaned = input.toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
9628
|
+
const fullPostal = /^[A-Z]\d[A-Z]\d[A-Z]\d$/;
|
|
9629
|
+
const partialPostal = /^[A-Z]\d[A-Z]?\d?[A-Z]?\d?$/;
|
|
9630
|
+
if (fullPostal.test(cleaned)) return 'full';
|
|
9631
|
+
if (partialPostal.test(cleaned)) return 'partial';
|
|
9632
|
+
return 'none';
|
|
9633
|
+
}
|
|
9634
|
+
function formatPostalCodeIfNeeded(input) {
|
|
9635
|
+
const cleaned = input.trim().toUpperCase().replace(/[^A-Z0-9]/g, '');
|
|
9636
|
+
const type = detectPostalCodeType(cleaned);
|
|
9637
|
+
if (type === 'none') return input;
|
|
9638
|
+
const before = cleaned.slice(0, 3);
|
|
9639
|
+
const after = cleaned.slice(3);
|
|
9640
|
+
return `${before} ${after}`;
|
|
9641
|
+
}
|
|
9608
9642
|
|
|
9609
9643
|
let _ = t => t,
|
|
9610
9644
|
_t,
|
|
@@ -9948,7 +9982,7 @@ const AddressLookUpControl = props => {
|
|
|
9948
9982
|
if (searchTerm.length > 2 && dropdownSelected === false) {
|
|
9949
9983
|
setLoading(true);
|
|
9950
9984
|
setOpen(true);
|
|
9951
|
-
yield fetchAddressSuggestions(formUrl, searchTerm, isAlbertaAddress).then(response => {
|
|
9985
|
+
yield fetchAddressSuggestions(formUrl, formatPostalCodeIfNeeded(searchTerm), isAlbertaAddress).then(response => {
|
|
9952
9986
|
const suggestions = filterSuggestionsWithoutAddressCount(response);
|
|
9953
9987
|
if (isAlbertaAddress) {
|
|
9954
9988
|
setSuggestions(filterAlbertaAddresses(suggestions));
|
|
@@ -10148,7 +10182,7 @@ const AddressViews = ({
|
|
|
10148
10182
|
gap: "s",
|
|
10149
10183
|
children: [jsx(GoAFormItem, {
|
|
10150
10184
|
label: "Address line 1",
|
|
10151
|
-
error: (data === null || data === void 0 ? void 0 : data.addressLine1) === undefined ? '
|
|
10185
|
+
error: (data === null || data === void 0 ? void 0 : data.addressLine1) === undefined ? 'Address line 1 is required' : '',
|
|
10152
10186
|
requirement: "required",
|
|
10153
10187
|
children: jsx(TextWrap, {
|
|
10154
10188
|
children: data === null || data === void 0 ? void 0 : data.addressLine1
|
|
@@ -10163,14 +10197,14 @@ const AddressViews = ({
|
|
|
10163
10197
|
minChildWidth: "0ch",
|
|
10164
10198
|
gap: "s",
|
|
10165
10199
|
children: [jsx(GoAFormItem, {
|
|
10166
|
-
error: (data === null || data === void 0 ? void 0 : data.municipality) === undefined ? '
|
|
10200
|
+
error: (data === null || data === void 0 ? void 0 : data.municipality) === undefined ? 'City is required' : '',
|
|
10167
10201
|
label: "City",
|
|
10168
10202
|
requirement: "required",
|
|
10169
10203
|
children: jsx(TextWrap, {
|
|
10170
10204
|
children: data === null || data === void 0 ? void 0 : data.municipality
|
|
10171
10205
|
})
|
|
10172
10206
|
}), jsx(GoAFormItem, {
|
|
10173
|
-
error: (data === null || data === void 0 ? void 0 : data.postalCode) === undefined ? '
|
|
10207
|
+
error: (data === null || data === void 0 ? void 0 : data.postalCode) === undefined ? 'Postal code is required' : '',
|
|
10174
10208
|
label: "Postal Code",
|
|
10175
10209
|
requirement: "required",
|
|
10176
10210
|
children: jsx(TextWrap, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abgov/jsonforms-components",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.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",
|
|
@@ -8,3 +8,5 @@ export declare const handlePostalCodeValidation: (validatePc: boolean, message:
|
|
|
8
8
|
[x: string]: string;
|
|
9
9
|
};
|
|
10
10
|
export declare const formatPostalCode: (value: string) => string;
|
|
11
|
+
export declare function detectPostalCodeType(input: string): 'full' | 'partial' | 'none';
|
|
12
|
+
export declare function formatPostalCodeIfNeeded(input: string): string;
|