dibk-design 3.6.1 → 3.7.0
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/dist/components/Accordion.js +5 -3
- package/dist/components/CheckBoxInput.js +4 -2
- package/dist/components/CheckBoxListItem.js +3 -1
- package/dist/components/DragAndDropFileInput.js +5 -1
- package/dist/components/InputField.js +3 -1
- package/dist/components/RadioButtonInput.js +4 -2
- package/dist/components/RadioButtonListItem.js +3 -1
- package/dist/components/Select.js +2 -0
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ var _AccordionModule = _interopRequireDefault(require("./Accordion.module.scss")
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
12
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
13
14
|
const Accordion = props => {
|
|
14
15
|
const [expanded, setExpanded] = (0, _react.useState)(props.expanded);
|
|
15
16
|
const [initialized, setInitialized] = (0, _react.useState)(props.initialized);
|
|
@@ -24,11 +25,11 @@ const Accordion = props => {
|
|
|
24
25
|
setExpanded(props.expanded);
|
|
25
26
|
}, [props.expanded]);
|
|
26
27
|
const renderPanel = () => {
|
|
27
|
-
return _react.default.createElement("button", {
|
|
28
|
+
return _react.default.createElement("button", _extends({}, props.buttonProps, {
|
|
28
29
|
className: _AccordionModule.default.panel,
|
|
29
30
|
onClick: handleToggleExpand,
|
|
30
31
|
"aria-expanded": expanded ? "true" : "false"
|
|
31
|
-
}, _react.default.createElement("span", {
|
|
32
|
+
}), _react.default.createElement("span", {
|
|
32
33
|
className: _AccordionModule.default.panelText
|
|
33
34
|
}, props.title), _react.default.createElement("span", {
|
|
34
35
|
className: "".concat(_AccordionModule.default.panelChevron, " ").concat(expanded ? _AccordionModule.default.expanded : "")
|
|
@@ -47,7 +48,8 @@ Accordion.propTypes = {
|
|
|
47
48
|
content: _propTypes.default.string,
|
|
48
49
|
color: _propTypes.default.oneOf(["default", "primary", "success", "warning", "info", "lightCyan", "orange", "lightOrange", "lime", "lightLime"]),
|
|
49
50
|
expanded: _propTypes.default.bool,
|
|
50
|
-
onToggleExpand: _propTypes.default.func
|
|
51
|
+
onToggleExpand: _propTypes.default.func,
|
|
52
|
+
buttonProps: _propTypes.default.object
|
|
51
53
|
};
|
|
52
54
|
Accordion.defaultProps = {
|
|
53
55
|
title: null,
|
|
@@ -34,7 +34,8 @@ const CheckBoxInput = props => {
|
|
|
34
34
|
tabIndex: props.tabIndex || null,
|
|
35
35
|
"aria-controls": props["aria-controls"],
|
|
36
36
|
"aria-invalid": props.hasErrors ? "true" : null,
|
|
37
|
-
"aria-describedby": props["aria-describedby"]
|
|
37
|
+
"aria-describedby": props["aria-describedby"],
|
|
38
|
+
"data-transaction-name": props["data-transaction-name"]
|
|
38
39
|
};
|
|
39
40
|
return _react.default.createElement("label", labelProps, !props.contentOnly ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_CheckBoxIcon.default, iconProps), _react.default.createElement("input", inputProps)) : _react.default.createElement(_CheckBoxIcon.default, iconProps), _react.default.createElement("span", null, props.children, props.required && _react.default.createElement("img", {
|
|
40
41
|
src: _asterisk.default,
|
|
@@ -55,7 +56,8 @@ CheckBoxInput.propTypes = {
|
|
|
55
56
|
theme: _propTypes.default.object,
|
|
56
57
|
checkmarkCharacter: _propTypes.default.string,
|
|
57
58
|
"aria-controls": _propTypes.default.string,
|
|
58
|
-
"aria-describedby": _propTypes.default.string
|
|
59
|
+
"aria-describedby": _propTypes.default.string,
|
|
60
|
+
"data-transaction-name": _propTypes.default.string
|
|
59
61
|
};
|
|
60
62
|
CheckBoxInput.defaultProps = {
|
|
61
63
|
checked: false,
|
|
@@ -23,6 +23,7 @@ const CheckBoxListItem = props => {
|
|
|
23
23
|
hasErrors: props.hasErrors,
|
|
24
24
|
"aria-controls": props["aria-controls"],
|
|
25
25
|
"aria-describedby": props["aria-describedby"],
|
|
26
|
+
"data-transaction-name": props["data-transaction-name"],
|
|
26
27
|
id: props.id,
|
|
27
28
|
theme: props.theme,
|
|
28
29
|
checkmarkCharacter: props.checkmarkCharacter
|
|
@@ -45,7 +46,8 @@ CheckBoxListItem.propTypes = {
|
|
|
45
46
|
hasErrors: _propTypes.default.bool,
|
|
46
47
|
checkmarkCharacter: _propTypes.default.string,
|
|
47
48
|
"aria-controls": _propTypes.default.string,
|
|
48
|
-
"aria-describedby": _propTypes.default.string
|
|
49
|
+
"aria-describedby": _propTypes.default.string,
|
|
50
|
+
"data-transaction-name": _propTypes.default.string
|
|
49
51
|
};
|
|
50
52
|
CheckBoxListItem.defaultProps = {
|
|
51
53
|
checked: false,
|
|
@@ -36,6 +36,7 @@ const DragAndDropFileInput = props => {
|
|
|
36
36
|
const inputElementProps = {
|
|
37
37
|
"aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
|
|
38
38
|
"aria-invalid": props.hasErrors ? "true" : null,
|
|
39
|
+
"data-transaction-name": props["data-transaction-name-for-input"],
|
|
39
40
|
required: props.required
|
|
40
41
|
};
|
|
41
42
|
let buttonContent;
|
|
@@ -93,7 +94,8 @@ const DragAndDropFileInput = props => {
|
|
|
93
94
|
color: props.buttonColor,
|
|
94
95
|
onClick: () => handleAddButtonOnClick(),
|
|
95
96
|
content: buttonContent,
|
|
96
|
-
hasErrors: props.hasErrors
|
|
97
|
+
hasErrors: props.hasErrors,
|
|
98
|
+
"data-transaction-name": props["data-transaction-name-for-button"]
|
|
97
99
|
})) : null) : null, props.contentOnly ? _react.default.createElement("span", null, renderValueAsText(props.selectedFileName, props.defaultContent)) : "", _react.default.createElement(_ErrorMessage.default, {
|
|
98
100
|
id: getErrorElementId(),
|
|
99
101
|
content: props.errorMessage,
|
|
@@ -114,6 +116,8 @@ DragAndDropFileInput.propTypes = {
|
|
|
114
116
|
hasErrors: _propTypes.default.bool,
|
|
115
117
|
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
|
|
116
118
|
required: _propTypes.default.bool,
|
|
119
|
+
"data-transaction-name-for-button": _propTypes.default.string,
|
|
120
|
+
"data-transaction-name-for-input": _propTypes.default.string,
|
|
117
121
|
theme: _propTypes.default.object
|
|
118
122
|
};
|
|
119
123
|
DragAndDropFileInput.defaultProps = {
|
|
@@ -59,6 +59,7 @@ const InputField = props => {
|
|
|
59
59
|
"aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
|
|
60
60
|
"aria-invalid": props.hasErrors ? "true" : null,
|
|
61
61
|
"aria-autocomplete": props["aria-autocomplete"] || null,
|
|
62
|
+
"data-transaction-name": props["data-transaction-name"] || null,
|
|
62
63
|
style: styleRules
|
|
63
64
|
};
|
|
64
65
|
};
|
|
@@ -119,7 +120,8 @@ InputField.propTypes = {
|
|
|
119
120
|
"aria-autocomplete": _propTypes.default.oneOf(["none", "inline", "list", "both"]),
|
|
120
121
|
hasErrors: _propTypes.default.bool,
|
|
121
122
|
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
|
|
122
|
-
theme: _propTypes.default.object
|
|
123
|
+
theme: _propTypes.default.object,
|
|
124
|
+
"data-transaction-name": _propTypes.default.string
|
|
123
125
|
};
|
|
124
126
|
InputField.defaultProps = {
|
|
125
127
|
onChange: () => {
|
|
@@ -33,7 +33,8 @@ const RadioButtonInput = props => {
|
|
|
33
33
|
tabIndex: props.tabIndex || null,
|
|
34
34
|
"aria-controls": props["aria-controls"],
|
|
35
35
|
"aria-invalid": props.hasErrors ? "true" : null,
|
|
36
|
-
"aria-describedby": props["aria-describedby"]
|
|
36
|
+
"aria-describedby": props["aria-describedby"],
|
|
37
|
+
"data-transaction-name": props["data-transaction-name"]
|
|
37
38
|
};
|
|
38
39
|
return _react.default.createElement("label", labelProps, !props.contentOnly ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_RadioButtonIcon.default, iconProps), _react.default.createElement("input", inputProps)) : null, _react.default.createElement("span", null, props.children, props.required && _react.default.createElement("img", {
|
|
39
40
|
src: _asterisk.default,
|
|
@@ -54,7 +55,8 @@ RadioButtonInput.propTypes = {
|
|
|
54
55
|
theme: _propTypes.default.object,
|
|
55
56
|
inputValue: _propTypes.default.string.isRequired,
|
|
56
57
|
"aria-controls": _propTypes.default.string,
|
|
57
|
-
"aria-describedby": _propTypes.default.string
|
|
58
|
+
"aria-describedby": _propTypes.default.string,
|
|
59
|
+
"data-transaction-name": _propTypes.default.string
|
|
58
60
|
};
|
|
59
61
|
RadioButtonInput.defaultProps = {
|
|
60
62
|
name: "",
|
|
@@ -24,6 +24,7 @@ const RadioButtonListItem = props => {
|
|
|
24
24
|
hasErrors: props.hasErrors,
|
|
25
25
|
"aria-controls": props["aria-controls"],
|
|
26
26
|
"aria-describedby": props["aria-describedby"],
|
|
27
|
+
"data-transaction-name": props["data-transaction-name"],
|
|
27
28
|
id: props.id,
|
|
28
29
|
name: props.name,
|
|
29
30
|
theme: props.theme
|
|
@@ -46,7 +47,8 @@ RadioButtonListItem.propTypes = {
|
|
|
46
47
|
theme: _propTypes.default.object,
|
|
47
48
|
hasErrors: _propTypes.default.bool,
|
|
48
49
|
"aria-controls": _propTypes.default.string,
|
|
49
|
-
"aria-describedby": _propTypes.default.string
|
|
50
|
+
"aria-describedby": _propTypes.default.string,
|
|
51
|
+
"data-transaction-name": _propTypes.default.string
|
|
50
52
|
};
|
|
51
53
|
RadioButtonListItem.defaultProps = {
|
|
52
54
|
name: "",
|
|
@@ -157,6 +157,7 @@ const Select = props => {
|
|
|
157
157
|
className,
|
|
158
158
|
"aria-describedby": props.hasErrors && !!((_props$errorMessage = props.errorMessage) !== null && _props$errorMessage !== void 0 && _props$errorMessage.length) ? getErrorElementId() : !!((_props$ariaDescribed = props["aria-describedby"]) !== null && _props$ariaDescribed !== void 0 && _props$ariaDescribed.length) ? props["aria-describedby"] : null,
|
|
159
159
|
"aria-invalid": props.hasErrors ? "true" : null,
|
|
160
|
+
"data-transaction-name": props["data-transaction-name"],
|
|
160
161
|
style: styleRules
|
|
161
162
|
};
|
|
162
163
|
return _react.default.createElement("div", {
|
|
@@ -218,6 +219,7 @@ Select.propTypes = {
|
|
|
218
219
|
"aria-describedby": _propTypes.default.string,
|
|
219
220
|
hasErrors: _propTypes.default.bool,
|
|
220
221
|
errorMessage: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]))]),
|
|
222
|
+
"data-transaction-name": _propTypes.default.string,
|
|
221
223
|
theme: _propTypes.default.object
|
|
222
224
|
};
|
|
223
225
|
Select.defaultProps = {
|