@inseefr/lunatic 0.4.5-v2 → 0.4.6-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/datepicker/datepicker.js +6 -2
- package/lib/components/input-number/input-number.js +1 -1
- package/lib/stories/date-picker/data.json +3 -0
- package/lib/stories/date-picker/datepicker.stories.js +38 -0
- package/lib/stories/date-picker/source.json +140 -0
- package/lib/stories/input/data.json +1 -5
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +1 -1
- package/package.json +1 -1
|
@@ -25,7 +25,9 @@ function Datepicker(_ref) {
|
|
|
25
25
|
value = _ref.value,
|
|
26
26
|
onChange = _ref.onChange,
|
|
27
27
|
labelId = _ref.labelId,
|
|
28
|
-
id = _ref.id
|
|
28
|
+
id = _ref.id,
|
|
29
|
+
min = _ref.min,
|
|
30
|
+
max = _ref.max;
|
|
29
31
|
var handleChange = (0, _react.useCallback)(function (e) {
|
|
30
32
|
var value = e.target.value;
|
|
31
33
|
onChange(value);
|
|
@@ -41,7 +43,9 @@ function Datepicker(_ref) {
|
|
|
41
43
|
readOnly: readOnly,
|
|
42
44
|
disabled: disabled,
|
|
43
45
|
value: value,
|
|
44
|
-
onChange: handleChange
|
|
46
|
+
onChange: handleChange,
|
|
47
|
+
min: min,
|
|
48
|
+
max: max
|
|
45
49
|
});
|
|
46
50
|
}
|
|
47
51
|
|
|
@@ -32,7 +32,7 @@ function InputNumber(_ref) {
|
|
|
32
32
|
step = _ref.step;
|
|
33
33
|
var valueEffective = value !== null && value !== void 0 ? value : '';
|
|
34
34
|
var handleChange = (0, _react.useCallback)(function (e) {
|
|
35
|
-
var val = e.target.
|
|
35
|
+
var val = e.target.valueAsNumber;
|
|
36
36
|
onChange(val);
|
|
37
37
|
}, [onChange]);
|
|
38
38
|
return /*#__PURE__*/_react["default"].createElement("input", {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
11
|
+
|
|
12
|
+
var _source = _interopRequireDefault(require("./source"));
|
|
13
|
+
|
|
14
|
+
var _data = _interopRequireDefault(require("./data"));
|
|
15
|
+
|
|
16
|
+
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
|
+
|
|
20
|
+
var stories = {
|
|
21
|
+
title: 'Components/DatePicker',
|
|
22
|
+
component: _orchestrator["default"],
|
|
23
|
+
argTypes: _defaultArgTypes["default"]
|
|
24
|
+
};
|
|
25
|
+
var _default = stories;
|
|
26
|
+
exports["default"] = _default;
|
|
27
|
+
|
|
28
|
+
var Template = function Template(args) {
|
|
29
|
+
return /*#__PURE__*/_react["default"].createElement(_orchestrator["default"], args);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var Default = Template.bind({});
|
|
33
|
+
exports.Default = Default;
|
|
34
|
+
Default.args = {
|
|
35
|
+
id: 'input',
|
|
36
|
+
source: _source["default"],
|
|
37
|
+
data: _data["default"]
|
|
38
|
+
};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cleaning": {},
|
|
3
|
+
"variables": [
|
|
4
|
+
{
|
|
5
|
+
"variableType": "COLLECTED",
|
|
6
|
+
"values": {
|
|
7
|
+
"COLLECTED": null,
|
|
8
|
+
"EDITED": null,
|
|
9
|
+
"INPUTED": null,
|
|
10
|
+
"FORCED": null,
|
|
11
|
+
"PREVIOUS": null
|
|
12
|
+
},
|
|
13
|
+
"name": "COMMENT_QE"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"variableType": "COLLECTED",
|
|
17
|
+
"values": {
|
|
18
|
+
"COLLECTED": null,
|
|
19
|
+
"EDITED": null,
|
|
20
|
+
"INPUTED": null,
|
|
21
|
+
"FORCED": null,
|
|
22
|
+
"PREVIOUS": null
|
|
23
|
+
},
|
|
24
|
+
"name": "Q1"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"variableType": "CALCULATED",
|
|
28
|
+
"expression": { "type": "VTL", "value": "true" },
|
|
29
|
+
"name": "FILTER_RESULT_Q1",
|
|
30
|
+
"inFilter": "false"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"components": [
|
|
34
|
+
{
|
|
35
|
+
"componentType": "Sequence",
|
|
36
|
+
"hierarchy": {
|
|
37
|
+
"sequence": {
|
|
38
|
+
"id": "l7ovaca8",
|
|
39
|
+
"page": "1",
|
|
40
|
+
"label": { "type": "VTL|MD", "value": "\"I - \" || \"S1\"" }
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"conditionFilter": { "type": "VTL", "value": "true" },
|
|
44
|
+
"id": "l7ovaca8",
|
|
45
|
+
"page": "1",
|
|
46
|
+
"label": { "type": "VTL|MD", "value": "\"I - \" || \"S1\"" }
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"componentType": "Datepicker",
|
|
50
|
+
"controls": [
|
|
51
|
+
{
|
|
52
|
+
"criticality": "ERROR",
|
|
53
|
+
"errorMessage": {
|
|
54
|
+
"type": "VTL|MD",
|
|
55
|
+
"value": "Le format de la date YYYY-MM-DD n'est pas respecté."
|
|
56
|
+
},
|
|
57
|
+
"control": {
|
|
58
|
+
"type": "VTL",
|
|
59
|
+
"value": "not(cast(\\\"Q1\\\", date, \\\"YYYY-MM-DD\\\"))"
|
|
60
|
+
},
|
|
61
|
+
"id": "l7ovm2rv-format"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"criticality": "ERROR",
|
|
65
|
+
"errorMessage": {
|
|
66
|
+
"type": "VTL|MD",
|
|
67
|
+
"value": "La date saisie doit être comprise entre 1900-01-01 et 2100-01-01."
|
|
68
|
+
},
|
|
69
|
+
"control": {
|
|
70
|
+
"type": "VTL",
|
|
71
|
+
"value": "not(cast(\\\"Q1\\\", date, \\\"YYYY-MM-DD\\\")>cast(\\\"2100-01-01\\\", date, \\\"YYYY-MM-DD\\\") or cast(\\\"Q1\\\", date, \\\"YYYY-MM-DD\\\")<cast(\\\"1900-01-01\\\", date, \\\"YYYY-MM-DD\\\"))"
|
|
72
|
+
},
|
|
73
|
+
"id": "l7ovm2rv-formatborne"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"max": "2100-01-01",
|
|
77
|
+
"dateFormat": "YYYY-MM-DD",
|
|
78
|
+
"hierarchy": {
|
|
79
|
+
"sequence": {
|
|
80
|
+
"id": "l7ovaca8",
|
|
81
|
+
"page": "1",
|
|
82
|
+
"label": { "type": "VTL|MD", "value": "\"I - \" || \"S1\"" }
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"conditionFilter": { "type": "VTL", "value": "true" },
|
|
86
|
+
"label": { "type": "VTL|MD", "value": "\"➡ 1. \" || \"Q1\"" },
|
|
87
|
+
"mandatory": false,
|
|
88
|
+
"bindingDependencies": ["Q1"],
|
|
89
|
+
"min": "1900-01-01",
|
|
90
|
+
"response": { "name": "Q1" },
|
|
91
|
+
"id": "l7ovm2rv",
|
|
92
|
+
"page": "2"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"componentType": "Sequence",
|
|
96
|
+
"hierarchy": {
|
|
97
|
+
"sequence": {
|
|
98
|
+
"id": "COMMENT-SEQ",
|
|
99
|
+
"page": "3",
|
|
100
|
+
"label": { "type": "VTL|MD", "value": "\"Commentaire\"" }
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"conditionFilter": { "type": "VTL", "value": "true" },
|
|
104
|
+
"id": "COMMENT-SEQ",
|
|
105
|
+
"page": "3",
|
|
106
|
+
"label": { "type": "VTL|MD", "value": "\"Commentaire\"" }
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"componentType": "Textarea",
|
|
110
|
+
"bindingDependencies": ["COMMENT_QE"],
|
|
111
|
+
"response": { "name": "COMMENT_QE" },
|
|
112
|
+
"hierarchy": {
|
|
113
|
+
"sequence": {
|
|
114
|
+
"id": "COMMENT-SEQ",
|
|
115
|
+
"page": "3",
|
|
116
|
+
"label": { "type": "VTL|MD", "value": "\"Commentaire\"" }
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"conditionFilter": { "type": "VTL", "value": "true" },
|
|
120
|
+
"id": "COMMENT-QUESTION",
|
|
121
|
+
"page": "4",
|
|
122
|
+
"label": {
|
|
123
|
+
"type": "VTL|MD",
|
|
124
|
+
"value": "\"Avez-vous des remarques concernant l'enquête ou des commentaires ?\""
|
|
125
|
+
},
|
|
126
|
+
"mandatory": false,
|
|
127
|
+
"maxLength": 2000
|
|
128
|
+
}
|
|
129
|
+
],
|
|
130
|
+
"pagination": "question",
|
|
131
|
+
"resizing": {},
|
|
132
|
+
"label": { "type": "VTL|MD", "value": "DatePicker" },
|
|
133
|
+
"lunaticModelVersion": "2.2.13",
|
|
134
|
+
"modele": "DATEPICKER",
|
|
135
|
+
"enoCoreVersion": "2.3.10",
|
|
136
|
+
"generatingDate": "05-09-2022 14:37:43",
|
|
137
|
+
"missing": false,
|
|
138
|
+
"id": "l7ovbqou",
|
|
139
|
+
"maxPage": "4"
|
|
140
|
+
}
|
|
@@ -141,7 +141,7 @@ function createRefreshCalculated(_ref) {
|
|
|
141
141
|
linksIterations: linksIterations,
|
|
142
142
|
bindings: bindings
|
|
143
143
|
});
|
|
144
|
-
if (
|
|
144
|
+
if (iteration !== undefined) toRefreshVariables["delete"](name);
|
|
145
145
|
return _objectSpread(_objectSpread({}, sub), {}, _defineProperty({}, name, value));
|
|
146
146
|
}
|
|
147
147
|
|