oa-componentbook 0.17.13 → 0.17.14
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/build/components/oa-component-tabs/CustomTabs.js +2 -2
- package/build/widgets/oa-widget-close-claim/CloseClaim.js +3 -3
- package/build/widgets/oa-widget-keyValueDataView/KeyValueDataView.js +22 -7
- package/build/widgets/oa-widget-keyValueDataView/styles.js +2 -2
- package/build/widgets/oa-widget-stage-timeline/StageTimeline.js +7 -4
- package/build/widgets/oa-widget-stage-timeline/styles.js +3 -3
- package/package.json +1 -1
|
@@ -47,12 +47,12 @@ function CustomTabs(_ref) {
|
|
|
47
47
|
}
|
|
48
48
|
CustomTabs.propTypes = {
|
|
49
49
|
data: _propTypes.default.shape({
|
|
50
|
-
tabs: _propTypes.default.arrayOf({
|
|
50
|
+
tabs: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
51
51
|
body: _propTypes.default.node.isRequired,
|
|
52
52
|
disabled: _propTypes.default.bool,
|
|
53
53
|
key: _propTypes.default.string.isRequired,
|
|
54
54
|
label: _propTypes.default.string.isRequired
|
|
55
|
-
}).isRequired
|
|
55
|
+
})).isRequired
|
|
56
56
|
}),
|
|
57
57
|
defaultActiveKey: _propTypes.default.string,
|
|
58
58
|
disabled: _propTypes.default.bool,
|
|
@@ -155,10 +155,10 @@ CloseClaim.propTypes = {
|
|
|
155
155
|
visible: _propTypes.default.bool.isRequired,
|
|
156
156
|
onCancel: _propTypes.default.func.isRequired,
|
|
157
157
|
onConfirm: _propTypes.default.func.isRequired,
|
|
158
|
-
fraudReasons: _propTypes.default.arrayOf(_propTypes.default.objectOf(_propTypes.default.string
|
|
159
|
-
closingClaimReasons: _propTypes.default.arrayOf(_propTypes.default.objectOf(_propTypes.default.string
|
|
158
|
+
fraudReasons: _propTypes.default.arrayOf(_propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.null]))).isRequired,
|
|
159
|
+
closingClaimReasons: _propTypes.default.arrayOf(_propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.null]))).isRequired,
|
|
160
160
|
// Can't define object type in this because the data is highly dynamic
|
|
161
|
-
serviceRequestData: _propTypes.default.
|
|
161
|
+
serviceRequestData: _propTypes.default.array.isRequired
|
|
162
162
|
};
|
|
163
163
|
var _default = CloseClaim;
|
|
164
164
|
exports.default = _default;
|
|
@@ -4,13 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
8
|
+
require("core-js/modules/es.regexp.test.js");
|
|
7
9
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
8
10
|
var _react = _interopRequireDefault(require("react"));
|
|
9
11
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
13
|
var _styles = require("./styles");
|
|
14
|
+
var _templateObject, _templateObject2;
|
|
11
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
17
|
// Import the styles
|
|
13
|
-
|
|
18
|
+
const KeyValueGroup = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .col-md-4:last-child{\n margin: 0;\n }\n valueStyle{\n display: flex;\n gap: 16px;\n padding: 0 0 8px;\n }\n valueStyle span{\n width: 60%;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: #717171;\n }\n valueStyle b{\n width: 40%;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 20px;\n color: #212121;\n\n }\n .emailText{\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])));
|
|
19
|
+
const KeyValueGroups = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n.container {\n max-width: 1120px;\n margin: 0 auto;\n padding: 0 16px;\n}\n.container-fluid{\n width: 100%;\n padding: 0 16px;\n}\n.row {\n display: flex;\n flex-direction: column;\n}\n.gutter{\n margin: 0 24px 0 0;\n}\n.row::after {\n content: \"\";\n clear: both;\n display: table;\n}\n.col-xs-1 {\n width: 8.33333%;\n}\n\n.col-xs-2 {\n width: 16.66667%;\n}\n\n.col-xs-3 {\n width: 25%;\n}\n\n.col-xs-4 {\n width: 33.33333%;\n}\n\n.col-xs-5 {\n width: 41.66667%;\n}\n\n.col-xs-6 {\n width: 50%;\n}\n\n.col-xs-7 {\n width: 58.33333%;\n}\n\n.col-xs-8 {\n width: 66.66667%;\n}\n\n.col-xs-9 {\n width: 75%;\n}\n\n.col-xs-10 {\n width: 83.33333%;\n}\n\n.col-xs-11 {\n width: 91.66667%;\n}\n\n.col-xs-12 {\n width: 100%;\n}\n@media (min-width: 768px) {\n .row {\n flex-direction: row;\n}\n .col-sm-1 {\n width: 8.33333%;\n }\n\n .col-sm-2 {\n width: 16.66667%;\n }\n\n .col-sm-3 {\n width: 25%;\n }\n\n .col-sm-4 {\n width: 33.33333%;\n }\n\n .col-sm-5 {\n width: 41.66667%;\n }\n\n .col-sm-6 {\n width: 50%;\n }\n .col-sm-7 {\n width: 58.33333%;\n }\n .col-sm-8 {\n width: 66.66667%;\n }\n .col-sm-9 {\n width: 75%;\n }\n .col-sm-10 {\n width: 83.33333%;\n }\n .col-sm-11 {\n width: 91.66667%;\n }\n .col-sm-12 {\n width: 100%;\n }\n}\n\n@media (min-width: 768px) {\n .col-md-1 {\n width: 8.33333%;\n }\n .col-md-2 {\n width: 16.66667%;\n }\n .col-md-3 {\n width: 25%;\n }\n .col-md-4 {\n width: 33.33333%;\n float: left;\n }\n\n .col-md-5 {\n width: 41.66667%;\n }\n\n .col-md-6 {\n width: 50%;\n }\n\n .col-md-7 {\n width: 58.33333%;\n }\n\n .col-md-8 {\n width: 66.66667%;\n }\n\n .col-md-9 {\n width: 75%;\n }\n\n .col-md-10 {\n width: 83.33333%;\n }\n .col-md-11 {\n width: 91.66667%;\n }\n\n .col-md-12 {\n width: 100%;\n }\n\n}\n/* Large Devices (desktops) */\n@media (min-width: 992px) {\n .gutter{\n margin: 0 24px 0 0;\n }\n .col-lg-1 {\n width: 8.33333%;\n }\n .col-lg-2 {\n width: 16.66667%;\n }\n .col-lg-3 {\n width: 25%;\n float: left;\n }\n .col-lg-4 {\n width: 33.33333%;\n float: left;\n }\n .col-lg-5 {\n width: 41.66667%;\n }\n .col-lg-6 {\n width: 50%;\n }\n .col-lg-7 {\n width: 58.33333%;\n }\n .col-lg-8 {\n width: 66.66667%;\n }\n .col-lg-9 {\n width: 75%;\n }\n .col-lg-10 {\n width: 83.33333%;\n }\n\n .col-lg-11 {\n width: 91.66667%;\n }\n\n .col-lg-12 {\n width: 100%;\n }\n}\n\n@media (min-width: 1200px) {\n .gutter{\n margin: 0 32px 0 0;\n }\n .col-xl-1 {\n width: 8.33333%;\n }\n\n \n}\n@media (max-width: 767px) {\n .gutter{\n margin: 0;\n }\n"])));
|
|
20
|
+
const emailCheckFunc = field => {
|
|
21
|
+
const emailRegex = /^[A-Za-z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Za-z0-9.-]+$/gm;
|
|
22
|
+
return emailRegex.test(field);
|
|
23
|
+
};
|
|
24
|
+
emailCheckFunc();
|
|
14
25
|
function KeyValueDataView(_ref) {
|
|
15
26
|
let {
|
|
16
27
|
data,
|
|
@@ -23,11 +34,12 @@ function KeyValueDataView(_ref) {
|
|
|
23
34
|
actualColumnLayout = columnLayout;
|
|
24
35
|
}
|
|
25
36
|
let entryIdx = 0;
|
|
26
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
27
|
-
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(KeyValueGroups, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(KeyValueGroup, {
|
|
38
|
+
className: "row"
|
|
28
39
|
}, actualColumnLayout.map((element, layoutIdx) => {
|
|
29
40
|
entryIdx += layoutIdx - 1 >= 0 ? actualColumnLayout[layoutIdx - 1] : 0;
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
className: "col-sm-12 col-md-4 col-lg-4 gutter",
|
|
31
43
|
key: element
|
|
32
44
|
}, Object.entries(data)
|
|
33
45
|
|
|
@@ -36,13 +48,16 @@ function KeyValueDataView(_ref) {
|
|
|
36
48
|
resulting in no elements selected.
|
|
37
49
|
*/.splice(entryIdx, element).map(_ref2 => {
|
|
38
50
|
let [key, value] = _ref2;
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement("valueStyle", null, /*#__PURE__*/_react.default.createElement("b", null, key, ":"), /*#__PURE__*/_react.default.createElement("span", {
|
|
52
|
+
className: emailCheckFunc(value) ? 'emailText' : undefined,
|
|
53
|
+
title: emailCheckFunc(value) ? value : undefined
|
|
54
|
+
}, value));
|
|
40
55
|
}));
|
|
41
|
-
}));
|
|
56
|
+
}))));
|
|
42
57
|
}
|
|
43
58
|
KeyValueDataView.propTypes = {
|
|
44
59
|
columnLayout: _propTypes.default.arrayOf(_propTypes.default.number),
|
|
45
|
-
data: _propTypes.default.objectOf(_propTypes.default.string).isRequired
|
|
60
|
+
data: _propTypes.default.objectOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])).isRequired
|
|
46
61
|
};
|
|
47
62
|
KeyValueDataView.defaultProps = {
|
|
48
63
|
columnLayout: []
|
|
@@ -8,9 +8,9 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4; // KeyValueDataViewStyles.js
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const KeyValueGroups = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n \n display: flex;\n gap: 32px;\n grid-template-columns: repeat(", " ,1fr);\n"])), props => props.columns);
|
|
11
|
+
const KeyValueGroups = _styledComponents.default.section(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // width: 100%;\n \n // display: flex;\n // gap: 32px;\n // grid-template-columns: repeat(", " ,1fr);\n"])), props => props.columns);
|
|
12
12
|
exports.KeyValueGroups = KeyValueGroups;
|
|
13
|
-
const KeyValueGroup = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: grid;\n grid-template-columns: 120px 1fr;\n // This prevents the rows from taking up all the available space.\n grid-auto-rows: min-content;\n width: 33.33%;\n"])));
|
|
13
|
+
const KeyValueGroup = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n // display: grid;\n // grid-template-columns: 120px 1fr;\n // // This prevents the rows from taking up all the available space.\n // grid-auto-rows: min-content;\n // width: 33.33%;\n"])));
|
|
14
14
|
exports.KeyValueGroup = KeyValueGroup;
|
|
15
15
|
const StyledBold = _styledComponents.default.b(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: var(--color-primarygrey-text);\n font-weight: 400;\n"])));
|
|
16
16
|
exports.StyledBold = StyledBold;
|
|
@@ -35,17 +35,19 @@ function StageTimelineChild(_ref) {
|
|
|
35
35
|
, {
|
|
36
36
|
onChange: data.onClick,
|
|
37
37
|
className: className,
|
|
38
|
+
collapsible: className === 'notstarted' ? 'disabled' : undefined,
|
|
38
39
|
expandIconPosition: "end",
|
|
39
40
|
ghost: true,
|
|
40
41
|
items: [{
|
|
41
42
|
key: data.stageId,
|
|
42
43
|
label: StageDetailsDisplay,
|
|
43
|
-
children: /*#__PURE__*/_react.default.createElement(_styles.SubStageContainer,
|
|
44
|
+
children: /*#__PURE__*/_react.default.createElement(_styles.SubStageContainer, {
|
|
45
|
+
className: className
|
|
46
|
+
}, data.subStages.map(subStage => /*#__PURE__*/_react.default.createElement(_styles.SubStage, {
|
|
44
47
|
key: subStage,
|
|
45
48
|
className: subStage.status,
|
|
46
49
|
onClick: subStage.onClick,
|
|
47
|
-
type: "button"
|
|
48
|
-
disabled: subStage.status === 'disabled'
|
|
50
|
+
type: "button"
|
|
49
51
|
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
50
52
|
typography: subStage.status === 'active' ? 'type-button-500' : 'type-b2-400'
|
|
51
53
|
}, subStage.stageName))))
|
|
@@ -61,7 +63,8 @@ StageTimelineChild.propTypes = {
|
|
|
61
63
|
onClick: _propTypes.default.func,
|
|
62
64
|
stageId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
63
65
|
stageName: _propTypes.default.string.isRequired,
|
|
64
|
-
|
|
66
|
+
// null and Not-Started result in the same behavior for a state.
|
|
67
|
+
status: _propTypes.default.oneOf([null, 'Not-Started', 'In-Progress', 'completed']).isRequired,
|
|
65
68
|
subStages: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
66
69
|
stageId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
67
70
|
stageName: _propTypes.default.string.isRequired,
|
|
@@ -25,13 +25,13 @@ const DotIcon = _styledComponents.default.span(_templateObject3 || (_templateObj
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
exports.DotIcon = DotIcon;
|
|
28
|
-
const StageDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n \n &.notstarted {\n color: var(--color-grey2-disabled);\n }\n\n &.inprogress {\n color: var(--color-blue-CTA);\n }\n\n &.completed {\n color: var(--color-secondarygrey-text);\n }\n"])));
|
|
28
|
+
const StageDetails = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n \n &.notstarted {\n cursor: not-allowed;\n color: var(--color-grey2-disabled);\n }\n\n &.inprogress {\n color: var(--color-blue-CTA);\n }\n\n &.completed {\n color: var(--color-secondarygrey-text);\n }\n"])));
|
|
29
29
|
exports.StageDetails = StageDetails;
|
|
30
|
-
const StaticStage = _styledComponents.default.a(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n \n padding: 12px 24px 12px 24px;\n \n cursor: pointer;\n\n border: 1px solid transparent;\n color: var(--color-grey2-disabled);\n \n text-decoration: none;\n border-radius: 28px;\n\n &.inprogress {\n color: var(--color-blue-CTA);\n background: var(--color-lightblue-background);\n border-color: var(--color-lightblue-background);\n }\n\n &.completed {\n color: var(--color-secondarygrey-text);\n border: 1px solid var(--color-secondarygrey-text);\n background: #fff;\n }\n"])));
|
|
30
|
+
const StaticStage = _styledComponents.default.a(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n \n padding: 12px 24px 12px 24px;\n \n cursor: pointer;\n\n border: 1px solid transparent;\n color: var(--color-grey2-disabled);\n \n text-decoration: none;\n border-radius: 28px;\n\n &.notstarted {\n cursor: not-allowed;\n }\n\n &.inprogress {\n color: var(--color-blue-CTA);\n background: var(--color-lightblue-background);\n border-color: var(--color-lightblue-background);\n }\n\n &.completed {\n color: var(--color-secondarygrey-text);\n border: 1px solid var(--color-secondarygrey-text);\n background: #fff;\n }\n"])));
|
|
31
31
|
exports.StaticStage = StaticStage;
|
|
32
32
|
const StagesList = _styledComponents.default.ul(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n gap: 12px;\n list-style-type: none;\n \n /* Since width is 100%, it'll take up all of its container */\n /* width: 100%; */\n"])));
|
|
33
33
|
exports.StagesList = StagesList;
|
|
34
34
|
const SubStage = _styledComponents.default.button(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 4px 1px 4px calc(12px + 12px + 10px);\n \n background: inherit;\n border: none;\n text-align: left;\n \n cursor: pointer;\n \n &.active {\n color: var(--color-primarygrey-text);\n } \n \n &.inactive {\n color: var(--color-secondarygrey-text);\n }\n \n &.disabled {\n cursor: not-allowed;\n color: var(--color-grey2-disabled);\n }\n "])));
|
|
35
35
|
exports.SubStage = SubStage;
|
|
36
|
-
const SubStageContainer = _styledComponents.default.section(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n"])));
|
|
36
|
+
const SubStageContainer = _styledComponents.default.section(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 12px;\n\n /* &.notstarted {\n cursor: not-allowed;\n pointer-events: none;\n } */\n"])));
|
|
37
37
|
exports.SubStageContainer = SubStageContainer;
|