@inseefr/lunatic 0.4.22-v2 → 0.4.24-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/commons/checkbox-option.js +8 -2
- package/lib/components/checkbox/commons/checkbox-option.scss +3 -0
- package/lib/components/commons/components/combo-box/selection/label-selection.js +1 -1
- package/lib/components/modal-controls/modal-controls.scss +7 -29
- 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/lib/stories/questionnaires/logement/logement.stories.js +10 -1
- package/lib/stories/questionnaires/logement/source-sum.json +34612 -0
- package/lib/use-lunatic/commons/execute-expression/execute-expression.js +28 -1
- package/lib/use-lunatic/commons/page-tag.js +1 -1
- 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;
|
|
@@ -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
14
|
margin-top: 20%;
|
|
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.3em;
|
|
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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.Sequence = exports.Default = void 0;
|
|
6
|
+
exports["default"] = exports.Sequence = exports.DefaultSum = exports.Default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -11,6 +11,8 @@ var _orchestrator = _interopRequireDefault(require("../../utils/orchestrator"));
|
|
|
11
11
|
|
|
12
12
|
var _source = _interopRequireDefault(require("./source"));
|
|
13
13
|
|
|
14
|
+
var _sourceSum = _interopRequireDefault(require("./source-sum"));
|
|
15
|
+
|
|
14
16
|
var _sourceSequence = _interopRequireDefault(require("./source-sequence"));
|
|
15
17
|
|
|
16
18
|
var _data = _interopRequireDefault(require("./data"));
|
|
@@ -67,6 +69,13 @@ Default.args = {
|
|
|
67
69
|
data: _data["default"],
|
|
68
70
|
pagination: true
|
|
69
71
|
};
|
|
72
|
+
var DefaultSum = Template.bind({});
|
|
73
|
+
exports.DefaultSum = DefaultSum;
|
|
74
|
+
DefaultSum.args = {
|
|
75
|
+
id: 'logement-sum',
|
|
76
|
+
source: _sourceSum["default"],
|
|
77
|
+
pagination: true
|
|
78
|
+
};
|
|
70
79
|
var Sequence = Template.bind({});
|
|
71
80
|
exports.Sequence = Sequence;
|
|
72
81
|
Sequence.args = {
|