@inseefr/lunatic 2.4.5 → 2.4.6-declaInSeq

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 (71) hide show
  1. package/lib/components/commons/components/dragger/dragger.scss +7 -7
  2. package/lib/components/commons/components/is-network/use-online-status.spec.js +0 -4
  3. package/lib/components/commons/components/lunatic-component-without-label.js +4 -11
  4. package/lib/components/commons/components/md-label/md-label.js +2 -1
  5. package/lib/components/commons/components/orchestrated-component.js +3 -2
  6. package/lib/components/component-set/html/component-set-components.js +6 -2
  7. package/lib/components/component-set/lunatic-component-set.js +3 -1
  8. package/lib/components/declarations/declarations.spec.js +0 -1
  9. package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +1 -1
  10. package/lib/components/dropdown/html/dropdown-simple/simple-option-renderer.js +5 -7
  11. package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +1 -1
  12. package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +1 -1
  13. package/lib/components/dropdown/html/dropdown.scss +0 -3
  14. package/lib/components/index.js +14 -0
  15. package/lib/components/loop/roster-for-loop/roster-table.js +0 -1
  16. package/lib/components/loop/roster-for-loop/roster.scss +0 -3
  17. package/lib/components/modal-controls/modal-controls.spec.js +0 -14
  18. package/lib/components/pairwise-links/pairwise-links.js +0 -1
  19. package/lib/components/questions/question-context.js +21 -7
  20. package/lib/components/questions/question-context.scss +1 -0
  21. package/lib/components/questions/question-information.js +19 -5
  22. package/lib/components/questions/question-information.scss +1 -0
  23. package/lib/components/roundabout/components/roundabout.scss +0 -3
  24. package/lib/components/sequence/html/sequence.js +13 -6
  25. package/lib/components/sequence/lunatic-sequence.js +1 -5
  26. package/lib/components/sequence/sequence.spec.js +0 -3
  27. package/lib/components/suggester/html/default-style.scss +1 -6
  28. package/lib/components/suggester/idb-suggester/check-store.js +2 -1
  29. package/lib/components/suggester-loader-widget/loader-row.js +2 -1
  30. package/lib/components/switch/html/switch.scss +0 -2
  31. package/lib/components/switch/lunatic-switch.js +1 -1
  32. package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +1 -1
  33. package/lib/src/components/commons/components/orchestrated-component.d.ts +1 -1
  34. package/lib/src/components/commons/create-row-orchestrator.d.ts +2 -2
  35. package/lib/src/components/component-set/html/component-set-components.d.ts +3 -2
  36. package/lib/src/components/index.d.ts +2 -0
  37. package/lib/src/components/loop/commons/handle-row-button.d.ts +1 -2
  38. package/lib/src/components/questions/question-context.d.ts +1 -2
  39. package/lib/src/components/questions/question-information.d.ts +1 -2
  40. package/lib/src/components/sequence/html/sequence.d.ts +1 -1
  41. package/lib/src/components/sequence/lunatic-sequence.d.ts +1 -1
  42. package/lib/src/components/suggester/idb-suggester/suggester-notification.d.ts +1 -3
  43. package/lib/src/components/type.d.ts +2 -3
  44. package/lib/src/hooks/use-ref-sync.d.ts +1 -1
  45. package/lib/src/use-lunatic/reducer/commons/resize-array-variable.d.ts +1 -1
  46. package/lib/src/utils/logger.d.ts +6 -0
  47. package/lib/stories/component-set/data2.json +7 -0
  48. package/lib/stories/component-set/source2.json +31 -31
  49. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +0 -1
  50. package/lib/stories/input/input.stories.js +9 -1
  51. package/lib/stories/input/source-with-question.json +74 -0
  52. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +2 -1
  53. package/lib/stories/sequence/afterInSeq.json +293 -0
  54. package/lib/stories/sequence/sequence.stories.js +12 -8
  55. package/lib/stories/sequence/source-declarations.json +9 -0
  56. package/lib/stories/suggester/suggester-workers.stories.js +6 -5
  57. package/lib/stories/suggester/suggester.stories.js +0 -1
  58. package/lib/stories/utils/orchestrator.js +4 -3
  59. package/lib/use-lunatic/commons/calculated-variables.js +1 -1
  60. package/lib/use-lunatic/commons/compile-controls.js +1 -1
  61. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +1 -4
  62. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +1 -1
  63. package/lib/use-lunatic/commons/load-suggesters.js +46 -46
  64. package/lib/utils/logger.js +44 -0
  65. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -1
  66. package/lib/utils/suggester-workers/create-worker-ts.js +2 -1
  67. package/lib/utils/suggester-workers/create-worker.js +2 -1
  68. package/package.json +1 -1
  69. package/lib/components/questions/type.js +0 -5
  70. package/lib/src/components/questions/type.d.ts +0 -4
  71. package/lib/stories/sequence/source-questions.json +0 -19
@@ -1,8 +1,8 @@
1
1
  .lunatic-dragger {
2
- display: inline-block;;
3
- width: 100%;
4
- height: 100%;
5
- -moz-user-select: -moz-none;
6
- -khtml-user-select: none;
7
- -webkit-user-select: none;
8
- }
2
+ display: inline-block;
3
+ width: 100%;
4
+ height: 100%;
5
+ -moz-user-select: -moz-none;
6
+ -khtml-user-select: none;
7
+ -webkit-user-select: none;
8
+ }
@@ -6,12 +6,8 @@ var _useOnlineStatus = _interopRequireDefault(require("./use-online-status"));
6
6
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
7
7
  (0, _vitest.describe)('useOnlineStatus', function () {
8
8
  var originalNavigator;
9
- var onlineCallback;
10
- var offlineCallback;
11
9
  (0, _vitest.beforeEach)(function () {
12
10
  originalNavigator = window.navigator;
13
- onlineCallback = _vitest.vi.fn();
14
- offlineCallback = _vitest.vi.fn();
15
11
  });
16
12
  (0, _vitest.afterEach)(function () {
17
13
  _vitest.vi.restoreAllMocks();
@@ -9,7 +9,6 @@ var _fieldContainer = _interopRequireDefault(require("./field-container"));
9
9
  var _missing = _interopRequireDefault(require("./missing"));
10
10
  var _react = _interopRequireDefault(require("react"));
11
11
  var _variableStatus = _interopRequireDefault(require("./variable-status"));
12
- var _questions = require("../../questions");
13
12
  var _jsxRuntime = require("react/jsx-runtime");
14
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
14
  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); }
@@ -24,24 +23,18 @@ function LunaticComponent(props) {
24
23
  children = props.children,
25
24
  management = props.management,
26
25
  description = props.description,
27
- handleChange = props.handleChange,
28
- questionContext = props.questionContext,
29
- questionInformation = props.questionInformation;
26
+ handleChange = props.handleChange;
30
27
  var content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
31
28
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations.DeclarationsBeforeText, {
32
29
  declarations: declarations,
33
30
  id: id
34
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_questions.QuestionContext, {
35
- text: questionContext
36
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_fieldContainer["default"], {
37
- children: [/*#__PURE__*/_react["default"].cloneElement(children, {
31
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_fieldContainer["default"], {
32
+ children: /*#__PURE__*/_react["default"].cloneElement(children, {
38
33
  description: getDescription({
39
34
  declarations: declarations,
40
35
  description: description
41
36
  })
42
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_questions.QuestionInformation, {
43
- text: questionInformation
44
- })]
37
+ })
45
38
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_declarations.DeclarationsDetachable, {
46
39
  declarations: declarations,
47
40
  id: id
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _reactMarkdown = _interopRequireDefault(require("react-markdown"));
8
8
  var _link = _interopRequireDefault(require("./link"));
9
+ var _function = require("../../../../utils/function");
9
10
  var _jsxRuntime = require("react/jsx-runtime");
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
12
  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); }
@@ -29,7 +30,7 @@ var renderers = function renderers(otherProps) {
29
30
  }
30
31
  };
31
32
  };
32
- var DEFAULT_LOG_FUNCTION = function DEFAULT_LOG_FUNCTION() {};
33
+ var DEFAULT_LOG_FUNCTION = _function.voidFunction;
33
34
  var MdLabel = function MdLabel(_ref) {
34
35
  var expression = _ref.expression,
35
36
  _ref$logFunction = _ref.logFunction,
@@ -38,7 +38,7 @@ function OrchestratedComponent(_ref) {
38
38
  }
39
39
  });
40
40
  var conditionFilter = componentFilled.conditionFilter;
41
- var hasToBeDisplay = conditionFilter !== undefined ? conditionFilter : true;
41
+ var hasToBeDisplay = conditionFilter !== null && conditionFilter !== void 0 ? conditionFilter : true;
42
42
  if (componentType in lunatic && hasToBeDisplay) {
43
43
  var Component = lunatic[componentType]; // This is too dynamic, orchestration has no way to check props
44
44
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread(_objectSpread({}, componentFilled), {}, {
@@ -51,7 +51,8 @@ function OrchestratedComponent(_ref) {
51
51
  shortcut: shortcut,
52
52
  value: value,
53
53
  executeExpression: executeExpression,
54
- errors: errors
54
+ errors: errors,
55
+ iteration: iteration
55
56
  }));
56
57
  }
57
58
  return null;
@@ -37,7 +37,9 @@ function ComponentSetComponents(_ref) {
37
37
  executeExpression = _ref.executeExpression,
38
38
  errors = _ref.errors,
39
39
  className = _ref.className,
40
- handleChange = _ref.handleChange;
40
+ handleChange = _ref.handleChange,
41
+ componentClassName = _ref.componentClassName,
42
+ iteration = _ref.iteration;
41
43
  if (!Array.isArray(components)) {
42
44
  return null;
43
45
  }
@@ -54,11 +56,13 @@ function ComponentSetComponents(_ref) {
54
56
  shortcut: shortcut,
55
57
  management: management,
56
58
  value: componentValue,
59
+ iteration: iteration,
57
60
  id: id,
58
61
  preferences: preferences,
59
62
  executeExpression: executeExpression,
60
63
  errors: errors,
61
- handleChange: handleChange
64
+ handleChange: handleChange,
65
+ className: componentClassName
62
66
  })
63
67
  }, id);
64
68
  })
@@ -24,7 +24,8 @@ function LunaticComponentSet(props) {
24
24
  errors = props.errors,
25
25
  description = props.description,
26
26
  handleChange = props.handleChange,
27
- className = props.className;
27
+ className = props.className,
28
+ iteration = props.iteration;
28
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_lunaticComponentWithoutLabel["default"], {
29
30
  id: id,
30
31
  preferences: preferences,
@@ -44,6 +45,7 @@ function LunaticComponentSet(props) {
44
45
  features: features,
45
46
  errors: errors,
46
47
  value: value,
48
+ iteration: iteration,
47
49
  executeExpression: executeExpression,
48
50
  preferences: preferences,
49
51
  management: management,
@@ -71,7 +71,6 @@ var declarations = [{
71
71
  declarations: []
72
72
  })]
73
73
  })),
74
- getByTestId = _render3.getByTestId,
75
74
  queryByTestId = _render3.queryByTestId;
76
75
  var declarationsElement = queryByTestId('declarations-1-DETACHABLE');
77
76
  (0, _vitest.expect)(declarationsElement.nextElementSibling).toBeNull();
@@ -13,7 +13,7 @@ function getContent(option, search) {
13
13
  label = option.label;
14
14
  return label || value;
15
15
  }
16
- if (search && search.trim().length) {
16
+ if (search !== null && search !== void 0 && search.trim().length) {
17
17
  return search;
18
18
  }
19
19
  return null;
@@ -21,13 +21,11 @@ function SimpleOptionRenderer(_ref) {
21
21
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
22
22
  className: "id",
23
23
  children: value
24
- }), label && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
25
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
26
- children: "\xA0\u2014\xA0"
27
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
28
- className: "label",
29
- children: label
30
- })]
24
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
25
+ children: "\xA0\u2014\xA0"
26
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
27
+ className: "label",
28
+ children: label
31
29
  })]
32
30
  });
33
31
  }
@@ -18,7 +18,7 @@ function getContent(option, search) {
18
18
  }
19
19
  return label ? "".concat(value, " - ").concat(label) : value;
20
20
  }
21
- if (search && search.trim().length) {
21
+ if (search !== null && search !== void 0 && search.trim().length) {
22
22
  return search;
23
23
  }
24
24
  return null;
@@ -109,7 +109,7 @@ function WritableOptionRenderer(_ref4) {
109
109
  (0, _react.useEffect)(function () {
110
110
  setParts(hightlightSearch(label, search));
111
111
  }, [search, label]);
112
- if (parts && parts.length) {
112
+ if (parts !== null && parts !== void 0 && parts.length) {
113
113
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
114
114
  className: (0, _classnames["default"])('lunatic-dropdown-option', {
115
115
  selected: selected
@@ -33,9 +33,6 @@
33
33
  .prefix {
34
34
  color: red;
35
35
  }
36
-
37
- .normal {
38
- }
39
36
  }
40
37
  }
41
38
  }
@@ -87,6 +87,18 @@ Object.defineProperty(exports, "PairwiseLinks", {
87
87
  return _pairwiseLinks["default"];
88
88
  }
89
89
  });
90
+ Object.defineProperty(exports, "QuestionContext", {
91
+ enumerable: true,
92
+ get: function get() {
93
+ return _questionContext["default"];
94
+ }
95
+ });
96
+ Object.defineProperty(exports, "QuestionInformation", {
97
+ enumerable: true,
98
+ get: function get() {
99
+ return _questionInformation["default"];
100
+ }
101
+ });
90
102
  Object.defineProperty(exports, "Radio", {
91
103
  enumerable: true,
92
104
  get: function get() {
@@ -170,4 +182,6 @@ var _suggesterLoaderWidget = _interopRequireDefault(require("./suggester-loader-
170
182
  var _roundabout = _interopRequireDefault(require("./roundabout"));
171
183
  var _table = _interopRequireDefault(require("./table"));
172
184
  var _componentSet = _interopRequireDefault(require("./component-set"));
185
+ var _questionInformation = _interopRequireDefault(require("./questions/question-information"));
186
+ var _questionContext = _interopRequireDefault(require("./questions/question-context"));
173
187
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -23,7 +23,6 @@ function RosterTable(_ref) {
23
23
  missing = _ref.missing,
24
24
  management = _ref.management,
25
25
  handleChange = _ref.handleChange;
26
- console.log('lunatic', 'roster-table', headers);
27
26
  if (nbRows <= 0) {
28
27
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_commons.NothingToDisplay, {});
29
28
  }
@@ -36,7 +36,4 @@
36
36
  padding: 0.2em;
37
37
  }
38
38
  }
39
-
40
- .lunatic-table-tbody {
41
- }
42
39
  }
@@ -44,20 +44,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
44
44
  (0, _vitest.expect)(queryByText('Error message 1')).toBeNull();
45
45
  (0, _vitest.expect)(queryByText('Error message 2')).toBeNull();
46
46
  });
47
- /*
48
- it('should call the goNext function with block:true when the close button is clicked', () => {
49
- const errors = {
50
- field1: [{ criticality: 'ERROR', errorMessage: 'Error message 1' }],
51
- field2: [{ criticality: 'ERROR', errorMessage: 'Error message 2' }],
52
- };
53
- const goNext = vi.fn();
54
- const { getByText } = render(
55
- <ModalControls errors={errors} goNext={goNext} />
56
- );
57
- fireEvent.click(getByText('Correct'));
58
- expect(goNext).toHaveBeenCalledWith({ block: true });
59
- });
60
- */
61
47
  (0, _vitest.it)('should call the goNext function when the skip button is clicked', function () {
62
48
  var errors = {
63
49
  field1: [{
@@ -26,7 +26,6 @@ var PairwiseLinks = function PairwiseLinks(_ref) {
26
26
  id = _ref.id,
27
27
  symLinks = _ref.symLinks;
28
28
  var nbRows = xAxisIterations * yAxisIterations;
29
- console.log('lunatic', 'pairwise', value);
30
29
  if (nbRows <= 1) {
31
30
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_nothingToDisplay["default"], {});
32
31
  }
@@ -7,15 +7,29 @@ exports["default"] = void 0;
7
7
  var _commons = require("../commons");
8
8
  require("./question-context.scss");
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
- function QuestionContent(props) {
11
- var text = props.text;
12
- if (text) {
13
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
14
- className: "lunatic-call-out",
15
- children: text
10
+ function Description(_ref) {
11
+ var description = _ref.description;
12
+ if (!description) {
13
+ return null;
14
+ }
15
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
16
+ children: description
17
+ });
18
+ }
19
+ function QuestionContext(props) {
20
+ var label = props.label,
21
+ description = props.description;
22
+ if (label) {
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
24
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
25
+ className: "lunatic-call-out",
26
+ children: [label, /*#__PURE__*/(0, _jsxRuntime.jsx)(Description, {
27
+ description: description
28
+ })]
29
+ })
16
30
  });
17
31
  }
18
32
  return null;
19
33
  }
20
- var _default = (0, _commons.createCustomizableLunaticField)(QuestionContent, 'QuestionContent');
34
+ var _default = (0, _commons.createCustomizableLunaticField)(QuestionContext, 'QuestionContext');
21
35
  exports["default"] = _default;
@@ -6,4 +6,5 @@
6
6
  font-size: 1rem;
7
7
  line-height: 1.5rem;
8
8
  padding: 2rem 3rem;
9
+ margin-bottom: 0.6em;
9
10
  }
@@ -7,12 +7,26 @@ exports["default"] = void 0;
7
7
  var _commons = require("../commons");
8
8
  require("./question-information.scss");
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
+ function Description(_ref) {
11
+ var description = _ref.description;
12
+ if (!description) {
13
+ return null;
14
+ }
15
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
16
+ children: description
17
+ });
18
+ }
10
19
  function QuestionInformation(props) {
11
- var text = props.text;
12
- if (text) {
13
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
14
- className: "lunatic-alert-information",
15
- children: text
20
+ var label = props.label,
21
+ description = props.description;
22
+ if (label) {
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
24
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
25
+ className: "lunatic-alert-information",
26
+ children: [label, /*#__PURE__*/(0, _jsxRuntime.jsx)(Description, {
27
+ description: description
28
+ })]
29
+ })
16
30
  });
17
31
  }
18
32
  return null;
@@ -2,6 +2,7 @@
2
2
  text-rendering: optimizeLegibility;
3
3
  box-shadow: inset 0 0 0 1px dodgerblue, inset 2.5rem 0 0 0 dodgerblue;
4
4
  padding: 1rem 2.25rem 0.75rem 3.5rem;
5
+ margin: 1em 0;
5
6
  &::before {
6
7
  content: '!';
7
8
  float: left;
@@ -9,8 +9,5 @@
9
9
  &.partial {
10
10
  background-color: cornflowerblue;
11
11
  }
12
-
13
- &.unstarted {
14
- }
15
12
  }
16
13
  }
@@ -6,16 +6,23 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _commons = require("../../commons");
8
8
  require("./sequence.scss");
9
+ var _description = _interopRequireDefault(require("../../commons/components/description"));
9
10
  var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
12
  function Sequence(_ref) {
11
13
  var label = _ref.label,
12
14
  id = _ref.id,
13
- style = _ref.style;
14
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
15
- className: "sequence-lunatic",
16
- id: "sequence-".concat(id),
17
- style: style,
18
- children: label
15
+ style = _ref.style,
16
+ description = _ref.description;
17
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
18
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
19
+ className: "sequence-lunatic",
20
+ id: "sequence-".concat(id),
21
+ style: style,
22
+ children: label
23
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_description["default"], {
24
+ value: description
25
+ })]
19
26
  });
20
27
  }
21
28
  var _default = (0, _commons.createCustomizableLunaticField)(Sequence, 'Sequence');
@@ -13,17 +13,13 @@ function LunaticSequence(_ref) {
13
13
  var declarations = _ref.declarations,
14
14
  label = _ref.label,
15
15
  id = _ref.id,
16
- style = _ref.style,
17
- questionContext = _ref.questionContext,
18
- questionInformation = _ref.questionInformation;
16
+ style = _ref.style;
19
17
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_lunaticComponentWithoutLabel["default"], {
20
18
  id: id,
21
19
  label: label,
22
20
  declarations: declarations,
23
21
  handleChange: empty,
24
22
  value: undefined,
25
- questionContext: questionContext,
26
- questionInformation: questionInformation,
27
23
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_sequence["default"], {
28
24
  label: label,
29
25
  id: id,
@@ -30,7 +30,6 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
30
30
  style: {
31
31
  backgroundColor: 'red'
32
32
  },
33
- questionContext: 'question-context',
34
33
  questionInformation: 'question-information'
35
34
  };
36
35
  (0, _vitest.it)('renders the label and declarations in the correct order', function () {
@@ -40,10 +39,8 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
40
39
  var sequenceLabel = getByText('Test Sequence Label');
41
40
  var declaration1 = getByText('Declaration 1');
42
41
  var declaration3 = getByText('Declaration 3');
43
- var questionContext = getByText('question-context');
44
42
  var questionInformation = getByText('question-information');
45
43
  (0, _vitest.expect)(sequenceLabel).toBeInTheDocument();
46
- (0, _vitest.expect)(questionContext).toBeInTheDocument();
47
44
  (0, _vitest.expect)(questionInformation).toBeInTheDocument();
48
45
  // Declarations before text should appear before the label
49
46
  (0, _vitest.expect)(declaration1).toBeInTheDocument();
@@ -53,14 +53,12 @@
53
53
  min-width: 260px;
54
54
  width: 100%;
55
55
  .lunatic-suggester-content {
56
- /* */
57
56
 
58
57
  &.focused {
59
58
  .lunatic-suggester-selection {
60
59
  }
61
60
  }
62
61
 
63
- /* */
64
62
  .lunatic-suggester-selection {
65
63
  border-radius: 5px;
66
64
  border: 2px solid var(--color-primary-dark);
@@ -69,7 +67,7 @@
69
67
  border-color: var(--color-primary-main);
70
68
  }
71
69
  .lunatic-suggester-input {
72
- height: 34;
70
+ height: 34px;
73
71
  line-height: 34px;
74
72
  font-size: 15px;
75
73
  padding-left: 4px;
@@ -104,7 +102,6 @@
104
102
  }
105
103
  }
106
104
 
107
- /* */
108
105
  .lunatic-suggester-panel {
109
106
  @include defaultFont();
110
107
  height: 0;
@@ -168,8 +165,6 @@
168
165
  font-size: large;
169
166
  margin-bottom: 3px;
170
167
  }
171
- .descrition {
172
- }
173
168
  }
174
169
  }
175
170
  }
@@ -8,6 +8,7 @@ exports["default"] = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _idbTools = require("../../../utils/idb-tools");
10
10
  var _storeTools = require("../../../utils/store-tools");
11
+ var _logger = require("../../../utils/logger");
11
12
  var _jsxRuntime = require("react/jsx-runtime");
12
13
  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); }
13
14
  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; }
@@ -86,7 +87,7 @@ function CheckStore(_ref) {
86
87
  };
87
88
  }();
88
89
  setRefresh(false);
89
- go();
90
+ go()["catch"](_logger.Logger.error);
90
91
  }
91
92
  }, [refresh, checkStore]);
92
93
  if (ready === 0) {
@@ -10,6 +10,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
10
10
  var _storeTools = require("../../utils/store-tools");
11
11
  var _icons = require("../commons/icons");
12
12
  var _loader = _interopRequireDefault(require("./loader"));
13
+ var _logger = require("../../utils/logger");
13
14
  var _jsxRuntime = require("react/jsx-runtime");
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
16
  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); }
@@ -43,7 +44,7 @@ function LoaderRow(_ref) {
43
44
  }, [onRefresh, name]);
44
45
  var clear = (0, _react.useCallback)(function () {
45
46
  if (db) {
46
- (0, _storeTools.clearStoreData)(db);
47
+ (0, _storeTools.clearStoreData)(db)["catch"](_logger.Logger.error);
47
48
  setNbEntities(0);
48
49
  }
49
50
  }, [db]);
@@ -33,8 +33,6 @@
33
33
  transition: 0.3s;
34
34
  }
35
35
 
36
- &.disabled {
37
- }
38
36
  &.checked {
39
37
  background-color: royalblue;
40
38
  .lunatic-switch-button {
@@ -28,7 +28,7 @@ function LunaticSwitch(_ref) {
28
28
  description = _ref.description,
29
29
  label = _ref.label,
30
30
  errors = _ref.errors;
31
- var booleanValue = value || false;
31
+ var booleanValue = value !== null && value !== void 0 ? value : false;
32
32
  var onClick = (0, _useOnHandleChange["default"])({
33
33
  handleChange: handleChange,
34
34
  response: response,
@@ -7,6 +7,6 @@ type Props = {
7
7
  handleChange: (response: {
8
8
  name: string;
9
9
  }, value: any, args?: Record<string, unknown>) => void;
10
- } & Pick<LunaticBaseProps, 'description' | 'declarations' | 'management' | 'id' | 'label' | 'missingResponse' | 'preferences' | 'value' | 'missing' | 'questionContext' | 'questionInformation'>;
10
+ } & Pick<LunaticBaseProps, 'description' | 'declarations' | 'management' | 'id' | 'label' | 'missingResponse' | 'preferences' | 'value' | 'missing'>;
11
11
  declare function LunaticComponent(props: Props): import("react/jsx-runtime").JSX.Element;
12
12
  export default LunaticComponent;
@@ -4,6 +4,6 @@ type Props = {
4
4
  linksIterations?: [number, number];
5
5
  component: LunaticComponentDefinition;
6
6
  features?: string[];
7
- } & Pick<LunaticBaseProps, 'id' | 'iteration' | 'executeExpression' | 'handleChange' | 'missing' | 'shortcut' | 'management' | 'preferences' | 'value' | 'errors'>;
7
+ } & Pick<LunaticBaseProps, 'id' | 'iteration' | 'executeExpression' | 'handleChange' | 'missing' | 'shortcut' | 'management' | 'preferences' | 'value' | 'errors' | 'className'>;
8
8
  declare function OrchestratedComponent({ id, component, handleChange, features, missing, shortcut, management, preferences, value, iteration, linksIterations, executeExpression, errors, }: Props): import("react/jsx-runtime").JSX.Element | null;
9
9
  export default OrchestratedComponent;
@@ -1,5 +1,5 @@
1
- import { FunctionComponent } from 'react';
2
- import { LunaticComponentProps } from '../type';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { LunaticComponentProps } from '../type';
3
3
  import { LunaticComponentDefinition, LunaticState } from '../../use-lunatic/type';
4
4
  type OriginalProps = {
5
5
  key: number;
@@ -1,6 +1,7 @@
1
1
  import { LunaticComponentProps } from '../../type';
2
2
  type Props = {
3
3
  className?: string;
4
- } & Pick<LunaticComponentProps<'ComponentSet'>, 'components' | 'value' | 'features' | 'missing' | 'shortcut' | 'management' | 'preferences' | 'executeExpression' | 'errors' | 'className' | 'handleChange'>;
5
- declare function ComponentSetComponents({ components, value, features, missing, shortcut, management, preferences, executeExpression, errors, className, handleChange, }: Props): import("react/jsx-runtime").JSX.Element | null;
4
+ componentClassName?: string;
5
+ } & Pick<LunaticComponentProps<'ComponentSet'>, 'components' | 'value' | 'features' | 'missing' | 'shortcut' | 'management' | 'preferences' | 'executeExpression' | 'errors' | 'className' | 'handleChange' | 'iteration'>;
6
+ declare function ComponentSetComponents({ components, value, features, missing, shortcut, management, preferences, executeExpression, errors, className, handleChange, componentClassName, iteration, }: Props): import("react/jsx-runtime").JSX.Element | null;
6
7
  export default ComponentSetComponents;
@@ -22,3 +22,5 @@ export { default as SuggesterLoaderWidget } from './suggester-loader-widget';
22
22
  export { default as Roundabout } from './roundabout';
23
23
  export { default as Table } from './table';
24
24
  export { default as ComponentSet } from './component-set';
25
+ export { default as QuestionInformation } from './questions/question-information';
26
+ export { default as QuestionContext } from './questions/question-context';
@@ -1,5 +1,4 @@
1
- import { MouseEventHandler } from 'react';
2
- import { PropsWithChildren } from 'react';
1
+ import { MouseEventHandler, PropsWithChildren } from 'react';
3
2
  type Props = PropsWithChildren<{
4
3
  disabled?: boolean;
5
4
  onClick: MouseEventHandler<HTMLButtonElement | HTMLInputElement>;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { MessageType } from './type';
3
2
  import './question-context.scss';
4
- declare const _default: import("react").ComponentType<MessageType>;
3
+ declare const _default: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<unknown>, "label" | "description">>;
5
4
  export default _default;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { MessageType } from './type';
3
2
  import './question-information.scss';
4
- declare const _default: import("react").ComponentType<MessageType>;
3
+ declare const _default: import("react").ComponentType<Pick<import("../type").LunaticBaseProps<unknown>, "label" | "description">>;
5
4
  export default _default;