@inseefr/lunatic 2.0.1-v2 → 2.0.2-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.
Files changed (37) hide show
  1. package/lib/components/button/lunatic-button.js +1 -1
  2. package/lib/components/checkbox/checkbox-boolean/checkbox-boolean.js +1 -1
  3. package/lib/components/checkbox/checkbox-group/checkbox-group.js +2 -2
  4. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +1 -1
  5. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +1 -1
  6. package/lib/components/checkbox/commons/checkbox-option.js +1 -1
  7. package/lib/components/commons/components/combo-box/combo-box.js +1 -1
  8. package/lib/components/commons/components/fieldset.js +1 -1
  9. package/lib/components/commons/components/html-table/table.js +1 -1
  10. package/lib/components/commons/components/html-table/tbody.js +1 -1
  11. package/lib/components/commons/components/html-table/td.js +1 -1
  12. package/lib/components/commons/components/html-table/th.js +1 -1
  13. package/lib/components/commons/components/html-table/thead.js +1 -1
  14. package/lib/components/commons/components/html-table/tr.js +1 -1
  15. package/lib/components/commons/components/label.js +1 -1
  16. package/lib/components/commons/create-customizable-field.js +1 -2
  17. package/lib/components/datepicker/datepicker.js +1 -1
  18. package/lib/components/datepicker/lunatic-datepicker.js +1 -1
  19. package/lib/components/declarations/declaration.js +1 -1
  20. package/lib/components/declarations/declarations.js +1 -1
  21. package/lib/components/dropdown/dropdown.js +1 -1
  22. package/lib/components/dropdown/lunatic-dropdown.js +1 -1
  23. package/lib/components/filter-description/component.js +1 -1
  24. package/lib/components/input/input.js +1 -1
  25. package/lib/components/input-number/input-number.js +1 -1
  26. package/lib/components/input-number/lunatic-input-number.js +1 -1
  27. package/lib/components/loop/block-for-loop/block-for-loop.js +1 -9
  28. package/lib/components/radio/lunatic-radio-group.js +1 -1
  29. package/lib/components/radio/radio-group.js +1 -1
  30. package/lib/components/sequence/sequence.js +1 -1
  31. package/lib/components/subsequence/subsequence.js +1 -1
  32. package/lib/components/suggester/suggester.js +1 -1
  33. package/lib/components/switch/switch.js +1 -1
  34. package/lib/components/textarea/textarea.js +1 -1
  35. package/lib/stories/table/table-dynamique.json +67 -0
  36. package/lib/stories/table/table.stories.js +9 -1
  37. package/package.json +1 -1
@@ -61,6 +61,6 @@ Button.propTypes = {
61
61
  onClick: _propTypes["default"].func.isRequired
62
62
  };
63
63
 
64
- var _default = (0, _commons.createCustomizableLunaticField)(Button);
64
+ var _default = (0, _commons.createCustomizableLunaticField)(Button, 'Button');
65
65
 
66
66
  exports["default"] = _default;
@@ -31,6 +31,6 @@ function CheckboxBoolean(_ref) {
31
31
  });
32
32
  }
33
33
 
34
- var _default = (0, _commons2.createCustomizableLunaticField)(CheckboxBoolean);
34
+ var _default = (0, _commons2.createCustomizableLunaticField)(CheckboxBoolean, 'CheckboxBoolean');
35
35
 
36
36
  exports["default"] = _default;
@@ -61,7 +61,7 @@ function CheckboxGroup(_ref3) {
61
61
  value = _ref3.value,
62
62
  id = _ref3.id,
63
63
  handleChange = _ref3.handleChange;
64
- return options.map(function (option, index) {
64
+ return options.map(function (option) {
65
65
  var label = option.label,
66
66
  response = option.response;
67
67
 
@@ -91,6 +91,6 @@ function CheckboxGroup(_ref3) {
91
91
  });
92
92
  }
93
93
 
94
- var _default = (0, _commons.createCustomizableLunaticField)(CheckboxGroup);
94
+ var _default = (0, _commons.createCustomizableLunaticField)(CheckboxGroup, 'CheckboxGroup');
95
95
 
96
96
  exports["default"] = _default;
@@ -34,7 +34,7 @@ function LunaticCheckboxGroup(_ref) {
34
34
  }));
35
35
  }
36
36
 
37
- var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticCheckboxGroup), {
37
+ var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticCheckboxGroup, 'LunaticCheckboxGroup'), {
38
38
  fieldset: true,
39
39
  inputId: 'lunatic-checkbox-group'
40
40
  });
@@ -34,6 +34,6 @@ function LunaticCheckboxOne(_ref) {
34
34
  }));
35
35
  }
36
36
 
37
- var _default = (0, _commons.createCustomizableLunaticField)(LunaticCheckboxOne);
37
+ var _default = (0, _commons.createCustomizableLunaticField)(LunaticCheckboxOne, 'LunaticCheckboxOne');
38
38
 
39
39
  exports["default"] = _default;
@@ -63,6 +63,6 @@ function CheckboxOption(_ref) {
63
63
  }, label)));
64
64
  }
65
65
 
66
- var _default = (0, _commons.createCustomizableLunaticField)(CheckboxOption);
66
+ var _default = (0, _commons.createCustomizableLunaticField)(CheckboxOption, 'CheckboxOption');
67
67
 
68
68
  exports["default"] = _default;
@@ -217,6 +217,6 @@ ComboBox.defaultProps = {
217
217
  getOptionValue: getDefaultOptionValue
218
218
  };
219
219
 
220
- var _default = (0, _createCustomizableField["default"])(ComboBox);
220
+ var _default = (0, _createCustomizableField["default"])(ComboBox, 'ComboBox');
221
221
 
222
222
  exports["default"] = _default;
@@ -21,6 +21,6 @@ function Fieldset(_ref) {
21
21
  return /*#__PURE__*/_react["default"].createElement("fieldset", null, /*#__PURE__*/_react["default"].createElement("legend", null, (0, _safetyLabel["default"])(legend)), children);
22
22
  }
23
23
 
24
- var _default = (0, _createCustomizableField["default"])(Fieldset);
24
+ var _default = (0, _createCustomizableField["default"])(Fieldset, 'Fieldset');
25
25
 
26
26
  exports["default"] = _default;
@@ -33,6 +33,6 @@ Table.defaultProps = {
33
33
  className: undefined
34
34
  };
35
35
 
36
- var _default = (0, _createCustomizableField["default"])(Table);
36
+ var _default = (0, _createCustomizableField["default"])(Table, 'Table');
37
37
 
38
38
  exports["default"] = _default;
@@ -33,6 +33,6 @@ Tbody.defaultProps = {
33
33
  className: undefined
34
34
  };
35
35
 
36
- var _default = (0, _createCustomizableField["default"])(Tbody);
36
+ var _default = (0, _createCustomizableField["default"])(Tbody, 'Tbody');
37
37
 
38
38
  exports["default"] = _default;
@@ -45,6 +45,6 @@ Td.defaultProps = {
45
45
  colSpan: undefined
46
46
  };
47
47
 
48
- var _default = (0, _createCustomizableField["default"])(Td);
48
+ var _default = (0, _createCustomizableField["default"])(Td, 'Td');
49
49
 
50
50
  exports["default"] = _default;
@@ -43,6 +43,6 @@ Th.defaultProps = {
43
43
  colSpan: undefined
44
44
  };
45
45
 
46
- var _default = (0, _createCustomizableField["default"])(Th);
46
+ var _default = (0, _createCustomizableField["default"])(Th, 'Th');
47
47
 
48
48
  exports["default"] = _default;
@@ -33,6 +33,6 @@ Thead.defaultProps = {
33
33
  className: undefined
34
34
  };
35
35
 
36
- var _default = (0, _createCustomizableField["default"])(Thead);
36
+ var _default = (0, _createCustomizableField["default"])(Thead, 'Thead');
37
37
 
38
38
  exports["default"] = _default;
@@ -35,6 +35,6 @@ Tr.defaultProps = {
35
35
  className: undefined
36
36
  };
37
37
 
38
- var _default = (0, _createCustomizableField["default"])(Tr);
38
+ var _default = (0, _createCustomizableField["default"])(Tr, 'Tr');
39
39
 
40
40
  exports["default"] = _default;
@@ -30,6 +30,6 @@ function Label(_ref) {
30
30
  return null;
31
31
  }
32
32
 
33
- var _default = (0, _createCustomizableField["default"])(Label);
33
+ var _default = (0, _createCustomizableField["default"])(Label, 'Label');
34
34
 
35
35
  exports["default"] = _default;
@@ -17,10 +17,9 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
17
17
 
18
18
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
19
19
 
20
- function createCustomizableLunaticField(LunaticField) {
20
+ function createCustomizableLunaticField(LunaticField, name) {
21
21
  var Memoized = /*#__PURE__*/_react["default"].memo(LunaticField);
22
22
 
23
- var name = LunaticField.name;
24
23
  return function OverlayField(props) {
25
24
  var custom = props.custom,
26
25
  rest = _objectWithoutProperties(props, _excluded);
@@ -51,6 +51,6 @@ function Datepicker(_ref) {
51
51
  });
52
52
  }
53
53
 
54
- var _default = (0, _commons.createCustomizableLunaticField)(Datepicker);
54
+ var _default = (0, _commons.createCustomizableLunaticField)(Datepicker, 'Datepicker');
55
55
 
56
56
  exports["default"] = _default;
@@ -32,7 +32,7 @@ var LunaticDatepicker = function LunaticDatepicker(_ref) {
32
32
  }));
33
33
  };
34
34
 
35
- var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticDatepicker), {
35
+ var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticDatepicker, 'LunaticDatepicker'), {
36
36
  inputId: 'lunatic-datepicker'
37
37
  });
38
38
 
@@ -21,6 +21,6 @@ function Declaration(_ref) {
21
21
  }, children);
22
22
  }
23
23
 
24
- var _default = (0, _createCustomizableField["default"])(Declaration);
24
+ var _default = (0, _createCustomizableField["default"])(Declaration, 'Declaration');
25
25
 
26
26
  exports["default"] = _default;
@@ -56,6 +56,6 @@ Declarations.defaultProps = {
56
56
  };
57
57
  Declarations.propTypes = {};
58
58
 
59
- var _default = (0, _commons.createCustomizableLunaticField)(Declarations);
59
+ var _default = (0, _commons.createCustomizableLunaticField)(Declarations, 'Declarations');
60
60
 
61
61
  exports["default"] = _default;
@@ -53,6 +53,6 @@ function Dropdown(_ref) {
53
53
  });
54
54
  }
55
55
 
56
- var _default = (0, _commons.createCustomizableLunaticField)(Dropdown);
56
+ var _default = (0, _commons.createCustomizableLunaticField)(Dropdown, 'Dropdown');
57
57
 
58
58
  exports["default"] = _default;
@@ -57,6 +57,6 @@ LunaticDropdown.defaultProps = {
57
57
  value: null
58
58
  };
59
59
 
60
- var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticDropdown));
60
+ var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticDropdown, 'LunaticDropdown'));
61
61
 
62
62
  exports["default"] = _default;
@@ -21,6 +21,6 @@ var FilterDescription = function FilterDescription(_ref) {
21
21
  }, label);
22
22
  };
23
23
 
24
- var _default = (0, _commons.createCustomizableLunaticField)(FilterDescription);
24
+ var _default = (0, _commons.createCustomizableLunaticField)(FilterDescription, 'FilterDescription');
25
25
 
26
26
  exports["default"] = _default;
@@ -56,6 +56,6 @@ Input.defaultProps = {
56
56
  maxLength: Number.MAX_SAFE_INTEGER
57
57
  };
58
58
 
59
- var _default = (0, _commons.createCustomizableLunaticField)(Input);
59
+ var _default = (0, _commons.createCustomizableLunaticField)(Input, 'Input');
60
60
 
61
61
  exports["default"] = _default;
@@ -56,6 +56,6 @@ function InputNumber(_ref) {
56
56
  }), unit && /*#__PURE__*/_react["default"].createElement("span", null, unit));
57
57
  }
58
58
 
59
- var _default = (0, _commons.createCustomizableLunaticField)(InputNumber);
59
+ var _default = (0, _commons.createCustomizableLunaticField)(InputNumber, 'InputNumber');
60
60
 
61
61
  exports["default"] = _default;
@@ -30,7 +30,7 @@ var LunaticInputNumber = function LunaticInputNumber(_ref) {
30
30
  }));
31
31
  };
32
32
 
33
- var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticInputNumber), {
33
+ var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticInputNumber, 'LunaticInputNumber'), {
34
34
  inputId: 'lunatic-input-number'
35
35
  });
36
36
 
@@ -166,14 +166,6 @@ function BlockForLoop(_ref) {
166
166
  return null;
167
167
  }
168
168
 
169
- var _default = (0, _commons.createCustomizableLunaticField)(BlockForLoop); // handleChange={handleChange}
170
- // preferences={preferences}
171
- // savingType={savingType}
172
- // management={management}
173
- // features={features}
174
- // bindings={bindings}
175
- // missing={missing}
176
- // shortcut={shortcut}
177
-
169
+ var _default = (0, _commons.createCustomizableLunaticField)(BlockForLoop, 'BlockForLoop');
178
170
 
179
171
  exports["default"] = _default;
@@ -36,7 +36,7 @@ function LunaticRadioGroup(props) {
36
36
  }));
37
37
  }
38
38
 
39
- var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticRadioGroup), {
39
+ var _default = (0, _commons.createLunaticComponent)((0, _commons.createCustomizableLunaticField)(LunaticRadioGroup, 'LunaticRadioGroup'), {
40
40
  // set it to true if you want to display a fieldset + legend on a component
41
41
  fieldset: true,
42
42
  inputId: 'lunatic-radio-group'
@@ -43,6 +43,6 @@ function Radio(_ref) {
43
43
  });
44
44
  }
45
45
 
46
- var _default = (0, _commons.createCustomizableLunaticField)(Radio);
46
+ var _default = (0, _commons.createCustomizableLunaticField)(Radio, 'Radio');
47
47
 
48
48
  exports["default"] = _default;
@@ -36,6 +36,6 @@ function Sequence(_ref) {
36
36
  }));
37
37
  }
38
38
 
39
- var _default = (0, _commons.createCustomizableLunaticField)(Sequence);
39
+ var _default = (0, _commons.createCustomizableLunaticField)(Sequence, 'Sequence');
40
40
 
41
41
  exports["default"] = _default;
@@ -33,6 +33,6 @@ function Subsequence(_ref) {
33
33
  }));
34
34
  }
35
35
 
36
- var _default = (0, _commons.createCustomizableLunaticField)(Subsequence);
36
+ var _default = (0, _commons.createCustomizableLunaticField)(Subsequence, 'Subsequence');
37
37
 
38
38
  exports["default"] = _default;
@@ -167,6 +167,6 @@ Suggester.defaultProps = {
167
167
  searching: undefined
168
168
  };
169
169
 
170
- var _default = (0, _commons.createCustomizableLunaticField)(Suggester);
170
+ var _default = (0, _commons.createCustomizableLunaticField)(Suggester, 'Suggester');
171
171
 
172
172
  exports["default"] = _default;
@@ -87,6 +87,6 @@ Switch.defaultProps = {
87
87
  }
88
88
  };
89
89
 
90
- var _default = (0, _commons.createCustomizableLunaticField)(Switch);
90
+ var _default = (0, _commons.createCustomizableLunaticField)(Switch, 'Switch');
91
91
 
92
92
  exports["default"] = _default;
@@ -49,6 +49,6 @@ function Textarea(_ref) {
49
49
  });
50
50
  }
51
51
 
52
- var _default = (0, _commons.createCustomizableLunaticField)(Textarea);
52
+ var _default = (0, _commons.createCustomizableLunaticField)(Textarea, 'Textarea');
53
53
 
54
54
  exports["default"] = _default;
@@ -0,0 +1,67 @@
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": "Q11"
14
+ }
15
+ ],
16
+ "components": [
17
+ {
18
+ "componentType": "Table",
19
+ "bindingDependencies": ["Q11"],
20
+ "positioning": "HORIZONTAL",
21
+ "hierarchy": {
22
+ "sequence": {
23
+ "id": "kanya0cm",
24
+ "page": "1",
25
+ "label": {
26
+ "type": "VTL|MD",
27
+ "value": "\"I - \" || \"Tableaux dynamiques\""
28
+ }
29
+ }
30
+ },
31
+ "header": [{ "label": { "type": "VTL|MD", "value": "\"Valeur\"" } }],
32
+ "conditionFilter": { "type": "VTL", "value": "true" },
33
+ "id": "kanz18h6",
34
+ "page": "1",
35
+ "label": {
36
+ "type": "VTL|MD",
37
+ "value": "\"➡ 1. \" || \"Tableau dynamique\""
38
+ },
39
+ "body": [
40
+ [
41
+ {
42
+ "componentType": "Input",
43
+ "bindingDependencies": ["Q11"],
44
+ "response": { "name": "Q11" },
45
+ "id": "kanz18h6-QOP-l7hovxs7",
46
+ "maxLength": 249
47
+ }
48
+ ]
49
+ ],
50
+ "lines": {
51
+ "min": { "type": "VTL", "value": "1" },
52
+ "max": { "type": "VTL", "value": "4" }
53
+ },
54
+ "mandatory": false
55
+ }
56
+ ],
57
+ "pagination": "question",
58
+ "resizing": {},
59
+ "label": { "type": "VTL|MD", "value": "V2 Tab Dynamique" },
60
+ "lunaticModelVersion": "2.2.14-rc",
61
+ "modele": "QTEST_DECL",
62
+ "enoCoreVersion": "2.3.10-controls-type",
63
+ "generatingDate": "11-10-2022 08:24:50",
64
+ "missing": false,
65
+ "id": "l7hp65id",
66
+ "maxPage": "1"
67
+ }
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.RosterMui = exports.Roster = exports.Default = void 0;
8
+ exports["default"] = exports.RosterMui = exports.Roster = exports.DynamicTable = exports.Default = void 0;
9
9
 
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
 
@@ -17,6 +17,8 @@ var _data = _interopRequireDefault(require("./data.json"));
17
17
 
18
18
  var _sourceRoster = _interopRequireDefault(require("./source-roster.json"));
19
19
 
20
+ var _tableDynamique = _interopRequireDefault(require("./table-dynamique.json"));
21
+
20
22
  var _dataRoster = _interopRequireDefault(require("./data-roster.json"));
21
23
 
22
24
  var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
@@ -62,4 +64,10 @@ RosterMui.args = {
62
64
  source: _sourceRoster["default"],
63
65
  data: _dataRoster["default"],
64
66
  custom: custom
67
+ };
68
+ var DynamicTable = Template.bind({});
69
+ exports.DynamicTable = DynamicTable;
70
+ DynamicTable.args = {
71
+ id: 'dynamic-table',
72
+ source: _tableDynamique["default"]
65
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inseefr/lunatic",
3
- "version": "2.0.1-v2",
3
+ "version": "2.0.2-v2",
4
4
  "workersVersion": "0.2.4-experimental",
5
5
  "description": "Library of questionnaire components",
6
6
  "repository": {