@inseefr/lunatic 0.4.23-v2 → 0.4.25-v2
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/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +4 -2
- package/lib/components/checkbox/checkbox-group/checkbox-group.js +7 -7
- package/lib/components/checkbox/checkbox-group/checkbox.scss +1 -0
- package/lib/components/checkbox/commons/checkbox-option.js +8 -2
- package/lib/components/checkbox/commons/checkbox-option.scss +3 -0
- package/lib/components/commons/components/combo-box/combo-box.js +2 -2
- package/lib/components/commons/components/combo-box/selection/label-selection.js +1 -1
- package/lib/components/modal-controls/modal-controls.scss +8 -30
- package/lib/components/radio/radio-group.js +3 -5
- package/lib/components/radio/radio-option.js +6 -2
- package/lib/components/radio/radio.scss +5 -2
- package/package.json +1 -1
- package/lib/components/checkbox/checkbox-group/checkbox-option.js +0 -57
- package/lib/components/checkbox/checkbox.scss +0 -1
|
@@ -18,14 +18,16 @@ function CheckboxBoolean(_ref) {
|
|
|
18
18
|
id = _ref.id,
|
|
19
19
|
disabled = _ref.disabled,
|
|
20
20
|
onClick = _ref.onClick,
|
|
21
|
-
labelId = _ref.labelId
|
|
21
|
+
labelId = _ref.labelId,
|
|
22
|
+
label = _ref.label;
|
|
22
23
|
return /*#__PURE__*/_react["default"].createElement(_commons.CheckboxOption, {
|
|
23
24
|
disabled: disabled,
|
|
24
25
|
checked: checked,
|
|
25
26
|
id: id,
|
|
26
27
|
onClick: onClick,
|
|
27
28
|
labelledBy: labelId,
|
|
28
|
-
value: checked
|
|
29
|
+
value: checked,
|
|
30
|
+
label: label
|
|
29
31
|
});
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -24,7 +24,8 @@ function CheckBoxOptionWrapper(_ref) {
|
|
|
24
24
|
value = _ref.value,
|
|
25
25
|
onKeyDown = _ref.onKeyDown,
|
|
26
26
|
handleChange = _ref.handleChange,
|
|
27
|
-
response = _ref.response
|
|
27
|
+
response = _ref.response,
|
|
28
|
+
label = _ref.label;
|
|
28
29
|
var booleanValue = value || false;
|
|
29
30
|
var onClickOption = (0, _commons.useOnHandleChange)({
|
|
30
31
|
handleChange: handleChange,
|
|
@@ -43,7 +44,8 @@ function CheckBoxOptionWrapper(_ref) {
|
|
|
43
44
|
checked: checked,
|
|
44
45
|
onClick: onClickOption,
|
|
45
46
|
value: booleanValue,
|
|
46
|
-
onKeyDown: onKeyDown
|
|
47
|
+
onKeyDown: onKeyDown,
|
|
48
|
+
label: label
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
51
|
|
|
@@ -79,11 +81,9 @@ function CheckboxGroup(_ref3) {
|
|
|
79
81
|
value: optionValue,
|
|
80
82
|
onKeyDown: onClick,
|
|
81
83
|
response: response,
|
|
82
|
-
handleChange: handleChange
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
htmlFor: checkboxId
|
|
86
|
-
}, label));
|
|
84
|
+
handleChange: handleChange,
|
|
85
|
+
label: label
|
|
86
|
+
}));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -13,6 +13,8 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
13
13
|
|
|
14
14
|
var _icons = require("../../commons/icons");
|
|
15
15
|
|
|
16
|
+
require("./checkbox-option.scss");
|
|
17
|
+
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
19
|
|
|
18
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -26,7 +28,8 @@ function CheckboxOption(_ref) {
|
|
|
26
28
|
_ref$value = _ref.value,
|
|
27
29
|
value = _ref$value === void 0 ? false : _ref$value,
|
|
28
30
|
onClick = _ref.onClick,
|
|
29
|
-
labelledBy = _ref.labelledBy
|
|
31
|
+
labelledBy = _ref.labelledBy,
|
|
32
|
+
label = _ref.label;
|
|
30
33
|
var onClickOption = (0, _react.useCallback)(function () {
|
|
31
34
|
onClick(!value);
|
|
32
35
|
}, [value, onClick]);
|
|
@@ -52,7 +55,10 @@ function CheckboxOption(_ref) {
|
|
|
52
55
|
onClick: onClickOption,
|
|
53
56
|
onKeyDown: handleKeyDown,
|
|
54
57
|
"aria-labelledby": labelledBy
|
|
55
|
-
}, /*#__PURE__*/_react["default"].createElement(Icon, null)
|
|
58
|
+
}, /*#__PURE__*/_react["default"].createElement(Icon, null), /*#__PURE__*/_react["default"].createElement("span", {
|
|
59
|
+
id: labelledBy,
|
|
60
|
+
htmlFor: id
|
|
61
|
+
}, label)));
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
var _default = CheckboxOption;
|
|
@@ -99,8 +99,8 @@ function ComboBox(_ref) {
|
|
|
99
99
|
value: value,
|
|
100
100
|
selectedIndex: selectedIndex,
|
|
101
101
|
getOptionValue: getOptionValue
|
|
102
|
-
}));
|
|
103
|
-
}, [
|
|
102
|
+
})); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
+
}, []);
|
|
104
104
|
var onFocus = (0, _react.useCallback)(function () {
|
|
105
105
|
dispatch(_stateManagement.actions.onFocus());
|
|
106
106
|
}, []);
|
|
@@ -27,7 +27,7 @@ function LabelSelection(_ref) {
|
|
|
27
27
|
disabled: disabled
|
|
28
28
|
}),
|
|
29
29
|
"aria-labelledby": labelledBy
|
|
30
|
-
},
|
|
30
|
+
}, /*#__PURE__*/_react["default"].createElement(Renderer, {
|
|
31
31
|
option: option,
|
|
32
32
|
placeholder: placeholder,
|
|
33
33
|
search: search
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.lunatic-modal-controls {
|
|
2
2
|
position: fixed;
|
|
3
|
-
|
|
4
3
|
top: 0;
|
|
5
4
|
left: 0;
|
|
6
5
|
width: 100%;
|
|
@@ -9,29 +8,13 @@
|
|
|
9
8
|
|
|
10
9
|
.modal {
|
|
11
10
|
background-color: snow;
|
|
12
|
-
height:
|
|
13
|
-
width:
|
|
11
|
+
height: 25%;
|
|
12
|
+
width: 50%;
|
|
14
13
|
margin: auto;
|
|
15
|
-
margin-top:
|
|
14
|
+
margin-top: 38vh;
|
|
16
15
|
position: relative;
|
|
17
16
|
border-radius: 8px;
|
|
18
|
-
|
|
19
|
-
.title {
|
|
20
|
-
height: 32px;
|
|
21
|
-
background-color: darkslateblue;
|
|
22
|
-
color: black;
|
|
23
|
-
font-size: 18px;
|
|
24
|
-
font-weight: bolder;
|
|
25
|
-
line-height: 32px;
|
|
26
|
-
padding: 0 12px;
|
|
27
|
-
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
28
|
-
border-radius: 8px 8px 0 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
17
|
.body {
|
|
32
|
-
// padding: 0 12px 0 12px;
|
|
33
|
-
padding: 12px 0 0 12px;
|
|
34
|
-
height: 60%;
|
|
35
18
|
color: black;
|
|
36
19
|
font-size: 16px;
|
|
37
20
|
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
@@ -41,9 +24,9 @@
|
|
|
41
24
|
position: absolute;
|
|
42
25
|
bottom: 0;
|
|
43
26
|
right: 0;
|
|
44
|
-
margin: 0
|
|
27
|
+
margin: 0 0.2em 0.2em 0;
|
|
45
28
|
:first-child {
|
|
46
|
-
margin-right:
|
|
29
|
+
margin-right: 0.5em;
|
|
47
30
|
}
|
|
48
31
|
}
|
|
49
32
|
}
|
|
@@ -53,16 +36,11 @@
|
|
|
53
36
|
li,
|
|
54
37
|
div,
|
|
55
38
|
span {
|
|
56
|
-
margin: 0;
|
|
57
|
-
padding: 0;
|
|
58
39
|
border: none;
|
|
59
40
|
list-style: none;
|
|
60
41
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
.info {
|
|
66
|
-
}
|
|
42
|
+
}
|
|
43
|
+
ul {
|
|
44
|
+
padding: 0.5em;
|
|
67
45
|
}
|
|
68
46
|
}
|
|
@@ -37,11 +37,9 @@ function Radio(_ref) {
|
|
|
37
37
|
onClick: onClick,
|
|
38
38
|
value: valueOption,
|
|
39
39
|
onKeyDown: onKeyDown,
|
|
40
|
-
checkboxStyle: checkboxStyle
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
htmlFor: radioId
|
|
44
|
-
}, label));
|
|
40
|
+
checkboxStyle: checkboxStyle,
|
|
41
|
+
label: label
|
|
42
|
+
}));
|
|
45
43
|
});
|
|
46
44
|
}
|
|
47
45
|
|
|
@@ -44,7 +44,8 @@ function RadioOption(_ref) {
|
|
|
44
44
|
onKeyDown = _ref.onKeyDown,
|
|
45
45
|
index = _ref.index,
|
|
46
46
|
labelledBy = _ref.labelledBy,
|
|
47
|
-
checkboxStyle = _ref.checkboxStyle
|
|
47
|
+
checkboxStyle = _ref.checkboxStyle,
|
|
48
|
+
label = _ref.label;
|
|
48
49
|
var spanEl = (0, _react.useRef)();
|
|
49
50
|
var Icon = getIcon(checked, checkboxStyle);
|
|
50
51
|
var tabIndex = checked ? '0' : '-1';
|
|
@@ -83,7 +84,10 @@ function RadioOption(_ref) {
|
|
|
83
84
|
onKeyDown: handleKeyDown,
|
|
84
85
|
"aria-labelledby": labelledBy,
|
|
85
86
|
ref: spanEl
|
|
86
|
-
}, /*#__PURE__*/_react["default"].createElement(Icon, null)
|
|
87
|
+
}, /*#__PURE__*/_react["default"].createElement(Icon, null), /*#__PURE__*/_react["default"].createElement("span", {
|
|
88
|
+
id: labelledBy,
|
|
89
|
+
htmlFor: id
|
|
90
|
+
}, label)));
|
|
87
91
|
}
|
|
88
92
|
|
|
89
93
|
var _default = RadioOption;
|
package/package.json
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
|
-
|
|
14
|
-
var _icons = require("../../commons/icons");
|
|
15
|
-
|
|
16
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
-
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
22
|
-
function CheckboxOption(_ref) {
|
|
23
|
-
var disabled = _ref.disabled,
|
|
24
|
-
checked = _ref.checked,
|
|
25
|
-
id = _ref.id,
|
|
26
|
-
value = _ref.value,
|
|
27
|
-
onClick = _ref.onClick,
|
|
28
|
-
labelledBy = _ref.labelledBy;
|
|
29
|
-
var onClickOption = (0, _react.useCallback)(function () {
|
|
30
|
-
onClick(value);
|
|
31
|
-
}, [value, onClick]);
|
|
32
|
-
var handleKeyDown = (0, _react.useCallback)(function (e) {
|
|
33
|
-
var key = e.key;
|
|
34
|
-
|
|
35
|
-
if (key === 'Space') {// TODO
|
|
36
|
-
}
|
|
37
|
-
}, []);
|
|
38
|
-
var Icon = checked ? _icons.CheckboxChecked : _icons.CheckboxUnchecked;
|
|
39
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
40
|
-
className: (0, _classnames["default"])('checkbox-modality', 'checkbox-modality-block', {
|
|
41
|
-
checked: checked,
|
|
42
|
-
disabled: disabled
|
|
43
|
-
})
|
|
44
|
-
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
45
|
-
id: id,
|
|
46
|
-
role: "checkbox",
|
|
47
|
-
className: "lunatic-input-checkbox",
|
|
48
|
-
"aria-checked": checked,
|
|
49
|
-
tabIndex: "0",
|
|
50
|
-
onClick: onClickOption,
|
|
51
|
-
onKeyDown: handleKeyDown,
|
|
52
|
-
"aria-labelledby": labelledBy
|
|
53
|
-
}, /*#__PURE__*/_react["default"].createElement(Icon, null)));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
var _default = CheckboxOption;
|
|
57
|
-
exports["default"] = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.lunatic-checkbox-boolean{}
|