@inseefr/lunatic 2.4.5-mvp-eap → 2.4.6-allDecla

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 (132) hide show
  1. package/lib/components/commons/components/combo-box/combo-box-content.js +5 -2
  2. package/lib/components/commons/components/combo-box/combo-box.js +16 -16
  3. package/lib/components/commons/components/combo-box/combo-box.scss +1 -0
  4. package/lib/components/commons/components/combo-box/panel/panel.js +4 -2
  5. package/lib/components/commons/components/combo-box/state-management/reduce-on-init.js +1 -4
  6. package/lib/components/commons/components/dragger/dragger.scss +7 -7
  7. package/lib/components/commons/components/is-network/use-online-status.spec.js +0 -4
  8. package/lib/components/commons/components/lunatic-component-without-label.js +4 -11
  9. package/lib/components/commons/components/md-label/md-label.js +2 -1
  10. package/lib/components/commons/components/orchestrated-component.js +3 -4
  11. package/lib/components/commons/create-row-orchestrator.js +2 -2
  12. package/lib/components/component-set/html/component-set-components.js +6 -2
  13. package/lib/components/component-set/lunatic-component-set.js +3 -1
  14. package/lib/components/declarations/declarations.spec.js +0 -1
  15. package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +1 -1
  16. package/lib/components/dropdown/html/dropdown-simple/simple-option-renderer.js +5 -7
  17. package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +1 -1
  18. package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +1 -1
  19. package/lib/components/dropdown/html/dropdown.scss +0 -3
  20. package/lib/components/dropdown/lunatic-dropdown.js +0 -1
  21. package/lib/components/index.js +14 -0
  22. package/lib/components/input-number/html/input-number.js +1 -2
  23. package/lib/components/input-number/html/input-number.scss +1 -1
  24. package/lib/components/input-number/lunatic-input-number.js +0 -2
  25. package/lib/components/loop/loop.js +4 -6
  26. package/lib/components/loop/roster-for-loop/body.js +52 -0
  27. package/lib/components/loop/roster-for-loop/header.js +34 -0
  28. package/lib/components/loop/roster-for-loop/roster-for-loop-orchestrator.js +0 -1
  29. package/lib/components/loop/roster-for-loop/roster-for-loop.js +33 -45
  30. package/lib/components/loop/roster-for-loop/roster-table.js +17 -22
  31. package/lib/components/loop/roster-for-loop/roster.scss +34 -30
  32. package/lib/components/loop/roster-for-loop/row.js +31 -84
  33. package/lib/components/modal-controls/modal-controls.spec.js +0 -14
  34. package/lib/components/pairwise-links/pairwise-links.js +3 -2
  35. package/lib/components/pairwise-links/row.js +0 -1
  36. package/lib/components/questions/question-context.js +21 -7
  37. package/lib/components/questions/question-context.scss +1 -0
  38. package/lib/components/questions/question-information.js +19 -5
  39. package/lib/components/questions/question-information.scss +1 -0
  40. package/lib/components/roundabout/components/roundabout.scss +0 -3
  41. package/lib/components/sequence/html/sequence.js +13 -6
  42. package/lib/components/sequence/html/sequence.scss +13 -0
  43. package/lib/components/sequence/lunatic-sequence.js +1 -5
  44. package/lib/components/sequence/sequence.spec.js +0 -3
  45. package/lib/components/suggester/html/default-style.scss +1 -6
  46. package/lib/components/suggester/html/suggester.js +12 -31
  47. package/lib/components/suggester/idb-suggester/check-store.js +2 -1
  48. package/lib/components/suggester/idb-suggester/idb-suggester.js +7 -10
  49. package/lib/components/suggester/lunatic-suggester.js +4 -31
  50. package/lib/components/suggester-loader-widget/loader-row.js +2 -1
  51. package/lib/components/switch/html/switch.scss +0 -2
  52. package/lib/components/switch/lunatic-switch.js +1 -1
  53. package/lib/src/components/commons/components/combo-box/combo-box.d.ts +4 -4
  54. package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +2 -2
  55. package/lib/src/components/commons/components/combo-box/panel/panel.d.ts +1 -1
  56. package/lib/src/components/commons/components/combo-box/state-management/actions.d.ts +4 -4
  57. package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +1 -1
  58. package/lib/src/components/commons/components/orchestrated-component.d.ts +3 -3
  59. package/lib/src/components/commons/create-row-orchestrator.d.ts +4 -5
  60. package/lib/src/components/component-set/html/component-set-components.d.ts +3 -2
  61. package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +1 -1
  62. package/lib/src/components/dropdown/html/dropdown.d.ts +1 -2
  63. package/lib/src/components/index.d.ts +2 -0
  64. package/lib/src/components/input-number/html/input-number.d.ts +0 -1
  65. package/lib/src/components/loop/block-for-loop/block-for-loop-ochestrator.d.ts +3 -11
  66. package/lib/src/components/loop/block-for-loop/block-for-loop.d.ts +1 -5
  67. package/lib/src/components/loop/commons/handle-row-button.d.ts +1 -2
  68. package/lib/src/components/loop/roster-for-loop/body.d.ts +12 -0
  69. package/lib/src/components/loop/roster-for-loop/header.d.ts +9 -0
  70. package/lib/src/components/loop/roster-for-loop/roster-for-loop-orchestrator.d.ts +3 -11
  71. package/lib/src/components/loop/roster-for-loop/roster-for-loop.d.ts +4 -8
  72. package/lib/src/components/loop/roster-for-loop/roster-table.d.ts +3 -3
  73. package/lib/src/components/loop/roster-for-loop/row.d.ts +2 -3
  74. package/lib/src/components/questions/question-context.d.ts +1 -2
  75. package/lib/src/components/questions/question-information.d.ts +1 -2
  76. package/lib/src/components/sequence/html/sequence.d.ts +1 -1
  77. package/lib/src/components/sequence/lunatic-sequence.d.ts +1 -1
  78. package/lib/src/components/suggester/html/suggester.d.ts +4 -6
  79. package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +3 -4
  80. package/lib/src/components/suggester/idb-suggester/suggester-notification.d.ts +1 -3
  81. package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
  82. package/lib/src/components/type.d.ts +7 -28
  83. package/lib/src/hooks/use-ref-sync.d.ts +1 -1
  84. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +16 -61
  85. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +0 -36
  86. package/lib/src/use-lunatic/reducer/commons/is-loop-component.d.ts +2 -2
  87. package/lib/src/use-lunatic/reducer/commons/resize-array-variable.d.ts +1 -1
  88. package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -1
  89. package/lib/src/use-lunatic/reducer/reduce-update-state.d.ts +1 -106
  90. package/lib/src/use-lunatic/replace-component-sequence.d.ts +1 -1
  91. package/lib/src/use-lunatic/type-source.d.ts +1 -11
  92. package/lib/src/use-lunatic/type.d.ts +1 -1
  93. package/lib/src/utils/logger.d.ts +6 -0
  94. package/lib/stories/component-set/data2.json +7 -0
  95. package/lib/stories/component-set/source2.json +31 -31
  96. package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +0 -1
  97. package/lib/stories/input/input.stories.js +9 -1
  98. package/lib/stories/input/source-with-question.json +74 -0
  99. package/lib/stories/input-number/input-number.stories.js +1 -8
  100. package/lib/stories/loop/block-for-loop.stories.js +8 -1
  101. package/lib/stories/loop/roster-for-loop.stories.js +1 -8
  102. package/lib/stories/loop/source-with-header.json +3 -15
  103. package/lib/stories/questionnaires/simpsons/simpsons.stories.js +2 -1
  104. package/lib/stories/sequence/afterInSeq.json +293 -0
  105. package/lib/stories/sequence/sequence.stories.js +12 -8
  106. package/lib/stories/sequence/source-declarations.json +9 -0
  107. package/lib/stories/suggester/suggester-workers.stories.js +7 -6
  108. package/lib/stories/suggester/suggester.stories.js +5 -18
  109. package/lib/stories/utils/orchestrator.js +4 -3
  110. package/lib/use-lunatic/commons/calculated-variables.js +1 -1
  111. package/lib/use-lunatic/commons/compile-controls.js +1 -1
  112. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +1 -4
  113. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +1 -1
  114. package/lib/use-lunatic/commons/get-component-value/get-component-value.js +0 -8
  115. package/lib/use-lunatic/commons/load-suggesters.js +46 -46
  116. package/lib/use-lunatic/initial-state.js +0 -1
  117. package/lib/use-lunatic/reducer/reducer.js +0 -1
  118. package/lib/utils/logger.js +44 -0
  119. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -1
  120. package/lib/utils/suggester-workers/create-worker-ts.js +2 -1
  121. package/lib/utils/suggester-workers/create-worker.js +2 -1
  122. package/package.json +1 -1
  123. package/lib/components/questions/type.js +0 -5
  124. package/lib/hooks/use-did-change.js +0 -19
  125. package/lib/src/components/questions/type.d.ts +0 -4
  126. package/lib/src/hooks/use-did-change.d.ts +0 -4
  127. package/lib/stories/input-number/source-dynamic.json +0 -41
  128. package/lib/stories/questionnaires/EAP/data-eap.json +0 -46
  129. package/lib/stories/questionnaires/EAP/eap.stories.js +0 -71
  130. package/lib/stories/questionnaires/EAP/source-eap.json +0 -433
  131. package/lib/stories/sequence/source-questions.json +0 -19
  132. package/lib/stories/suggester/multipleResponses.json +0 -100
@@ -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
  }
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports["default"] = void 0;
7
- var _react = require("react");
8
- var _i18n = _interopRequireDefault(require("../../../i18n"));
9
- var _function = require("../../../utils/function");
8
+ var _react = _interopRequireWildcard(require("react"));
10
9
  var _commons = require("../../commons");
11
10
  require("./default-style.scss");
11
+ var _function = require("../../../utils/function");
12
+ var _i18n = _interopRequireDefault(require("../../../i18n"));
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
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); }
15
+ 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); }
16
+ 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; }
15
17
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
16
18
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
17
19
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -34,8 +36,6 @@ function Suggester(_ref) {
34
36
  optionRenderer = _ref$optionRenderer === void 0 ? _commons.DefaultOptionRenderer : _ref$optionRenderer,
35
37
  value = _ref.value,
36
38
  disabled = _ref.disabled,
37
- response = _ref.response,
38
- responses = _ref.responses,
39
39
  id = _ref.id,
40
40
  searching = _ref.searching,
41
41
  label = _ref.label,
@@ -49,11 +49,9 @@ function Suggester(_ref) {
49
49
  _useState4 = _slicedToArray(_useState3, 2),
50
50
  options = _useState4[0],
51
51
  setOptions = _useState4[1];
52
- var handleSelect = (0, _react.useCallback)(function (option) {
53
- onSelect(option ? option : null);
52
+ var handleSelect = (0, _react.useCallback)(function (id) {
53
+ onSelect(id ? id : null);
54
54
  }, [onSelect]);
55
-
56
- /* UserInput */
57
55
  var handleChange = (0, _react.useCallback)( /*#__PURE__*/function () {
58
56
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(search) {
59
57
  var _yield$searching, results;
@@ -87,7 +85,7 @@ function Suggester(_ref) {
87
85
  return _ref2.apply(this, arguments);
88
86
  };
89
87
  }(), [searching, onSelect]);
90
- var defaultSearch = getSearch(responses, search, value);
88
+ var defaultSearch = getSearch(search, value);
91
89
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_commons.ComboBox, {
92
90
  id: id,
93
91
  className: className,
@@ -106,28 +104,11 @@ function Suggester(_ref) {
106
104
  errors: errors
107
105
  });
108
106
  }
109
- function getDisplayValue(responses, value) {
110
- if (responses) {
111
- var responseId = responses.find(function (r) {
112
- return r.id === 'id';
113
- }).response.name;
114
- var responseLabel = responses.find(function (r) {
115
- return r.id === 'label';
116
- }).response.name;
117
- return value[responseId] && value[responseId].length > 0 ? "".concat(value[responseId], " - ").concat(value[responseLabel]) : '';
107
+ function getSearch(search, value) {
108
+ if (!search.length && value) {
109
+ return value;
118
110
  }
119
111
  return '';
120
112
  }
121
- function getSearch(responses, search, value) {
122
- if (responses && _typeof(value) === 'object') {
123
- var displayValue = getDisplayValue(responses, value);
124
- return displayValue;
125
- } else {
126
- if (typeof value === 'string' && !search.length && value) {
127
- return value;
128
- }
129
- return '';
130
- }
131
- }
132
113
  var _default = (0, _commons.createCustomizableLunaticField)(Suggester, 'Suggester');
133
114
  exports["default"] = _default;
@@ -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) {
@@ -1,16 +1,19 @@
1
1
  "use strict";
2
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); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.IDBSuggester = IDBSuggester;
7
- var _react = require("react");
8
+ var _react = _interopRequireWildcard(require("react"));
8
9
  var _suggester = _interopRequireDefault(require("../html/suggester"));
9
10
  var _searching = _interopRequireDefault(require("../searching"));
10
11
  var _checkStore = _interopRequireDefault(require("./check-store"));
11
12
  var _suggesterStatus = require("./suggester-status");
12
13
  var _jsxRuntime = require("react/jsx-runtime");
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
+ 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); }
16
+ 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; }
14
17
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
18
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
19
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -31,9 +34,7 @@ function IDBSuggester(_ref) {
31
34
  label = _ref.label,
32
35
  description = _ref.description,
33
36
  getSuggesterStatus = _ref.getSuggesterStatus,
34
- errors = _ref.errors,
35
- responses = _ref.responses,
36
- response = _ref.response;
37
+ errors = _ref.errors;
37
38
  var _useState = (0, _react.useState)(undefined),
38
39
  _useState2 = _slicedToArray(_useState, 2),
39
40
  store = _useState2[0],
@@ -57,18 +58,14 @@ function IDBSuggester(_ref) {
57
58
  id: id,
58
59
  className: className,
59
60
  optionRenderer: optionRenderer,
60
- labelRenderer: labelRenderer
61
- // @ts-ignore
62
- ,
61
+ labelRenderer: labelRenderer,
63
62
  onSelect: onSelect,
64
63
  searching: searching,
65
64
  disabled: disabled,
66
65
  value: value,
67
66
  label: label,
68
67
  description: description,
69
- errors: errors,
70
- responses: responses,
71
- response: response
68
+ errors: errors
72
69
  })
73
70
  })
74
71
  });
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- var _react = require("react");
8
- var _commons = require("../commons");
9
- var _lunaticComponentWithoutLabel = _interopRequireDefault(require("../commons/components/lunatic-component-without-label"));
10
7
  var _idbSuggester = require("./idb-suggester");
8
+ var _lunaticComponentWithoutLabel = _interopRequireDefault(require("../commons/components/lunatic-component-without-label"));
9
+ var _useOnHandleChange = _interopRequireDefault(require("../commons/use-on-handle-change"));
11
10
  var _jsxRuntime = require("react/jsx-runtime");
12
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
12
  function LunaticSuggester(_ref) {
@@ -29,34 +28,12 @@ function LunaticSuggester(_ref) {
29
28
  missingResponse = _ref.missingResponse,
30
29
  management = _ref.management,
31
30
  response = _ref.response,
32
- responses = _ref.responses,
33
31
  getSuggesterStatus = _ref.getSuggesterStatus;
34
- // ToDo :
35
- /**
36
- * response -> responses
37
- * onChange(id) -> onChange({ code: '', label: '', info: '' }) -> onSelect in subComponent
38
- * useOnHandleChange -> update to handleChange on 3 response REPONSENAME (historical value i.e the code), REPONSENAME_LABEL, REPONSENAME_INFO
39
- */
40
- // @ts-ignore
41
- var onChangeSimple = (0, _commons.useOnHandleChange)({
32
+ var onChange = (0, _useOnHandleChange["default"])({
42
33
  handleChange: handleChange,
43
34
  response: response,
44
35
  value: value
45
36
  });
46
- var onChange = (0, _react.useCallback)(function (option) {
47
- if (responses) {
48
- responses.forEach(function (r) {
49
- // @ts-ignore
50
- if (value[r.id] != option[r.id]) {
51
- // @ts-ignore
52
- handleChange(r.response, option[r.id]);
53
- }
54
- });
55
- } else {
56
- // @ts-ignore
57
- onChangeSimple(option === null || option === void 0 ? void 0 : option.id);
58
- }
59
- }, [handleChange, onChangeSimple, responses, value]);
60
37
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_lunaticComponentWithoutLabel["default"], {
61
38
  id: id,
62
39
  preferences: preferences,
@@ -71,12 +48,8 @@ function LunaticSuggester(_ref) {
71
48
  storeName: storeName,
72
49
  optionRenderer: optionRenderer,
73
50
  labelRenderer: labelRenderer,
74
- idbVersion: idbVersion
75
- // @ts-ignore
76
- ,
51
+ idbVersion: idbVersion,
77
52
  onSelect: onChange,
78
- responses: responses,
79
- response: response,
80
53
  disabled: disabled,
81
54
  id: id,
82
55
  value: value,
@@ -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,
@@ -1,20 +1,20 @@
1
1
  import { ReactNode } from 'react';
2
- import { LunaticBaseProps } from '../../../type';
3
2
  import './combo-box.scss';
4
3
  import { ComboBoxOption } from './combo-box.type';
5
- import { PanelProps } from './panel/panel';
6
4
  import { SelectionProps } from './selection/selection';
5
+ import { PanelProps } from './panel/panel';
6
+ import { LunaticBaseProps } from '../../../type';
7
7
  type Props = SelectionProps & PanelProps & {
8
8
  className?: string;
9
9
  classStyle?: string;
10
10
  value: string | null;
11
11
  messageError?: string;
12
- getOptionValue?: (o: ComboBoxOption) => string | undefined;
12
+ getOptionValue?: (o: ComboBoxOption) => string;
13
13
  label?: ReactNode;
14
14
  description?: ReactNode;
15
15
  errors?: LunaticBaseProps['errors'];
16
16
  onChange?: (s: string | null) => void;
17
- onSelect: (s: ComboBoxOption | null | string) => void;
17
+ onSelect: (s: string | null) => void;
18
18
  options: ComboBoxOption[];
19
19
  };
20
20
  declare const _default: import("react").ComponentType<Props>;
@@ -15,13 +15,13 @@ export declare const Default: Story<{
15
15
  classStyle?: string | undefined;
16
16
  value: string | null;
17
17
  messageError?: string | undefined;
18
- getOptionValue?: ((o: ComboBoxOption) => string | undefined) | undefined;
18
+ getOptionValue?: ((o: ComboBoxOption) => string) | undefined;
19
19
  label?: import("react").ReactNode;
20
20
  description?: import("react").ReactNode;
21
21
  errors?: {
22
22
  [id: string]: import("../../../..").LunaticError[];
23
23
  } | undefined;
24
24
  onChange?: ((s: string | null) => void) | undefined;
25
- onSelect: (s: string | ComboBoxOption | null) => void;
25
+ onSelect: (s: string | null) => void;
26
26
  options: ComboBoxOption[];
27
27
  }>;
@@ -12,6 +12,6 @@ export type PanelProps = {
12
12
  expanded?: boolean;
13
13
  id?: string;
14
14
  search?: string;
15
- onSelect: (value: string | ComboBoxOption | null) => void;
15
+ onSelect: (value: string) => void;
16
16
  };
17
17
  export declare function Panel({ optionRenderer: OptionRender, options, focused, selectedIndex, expanded, id, search, onSelect, }: PanelProps): import("react/jsx-runtime").JSX.Element;
@@ -40,8 +40,8 @@ export declare const onInit: ({ ...payload }: ComboAction<ComboActionKind.ON_INI
40
40
  readonly type: ComboActionKind.ON_INIT;
41
41
  readonly payload: {
42
42
  readonly options: ComboBoxOption[];
43
- readonly value: string | ComboBoxOption | null;
44
- readonly getOptionValue: (o: ComboBoxOption) => string | undefined;
43
+ readonly value: string | null;
44
+ readonly getOptionValue: (o: ComboBoxOption) => string;
45
45
  };
46
46
  };
47
47
  export type ComboAction<T extends ComboActionKind = ComboActionKind> = ({
@@ -70,8 +70,8 @@ export type ComboAction<T extends ComboActionKind = ComboActionKind> = ({
70
70
  type: ComboActionKind.ON_INIT;
71
71
  payload: {
72
72
  options: ComboBoxOption[];
73
- value: string | ComboBoxOption | null;
74
- getOptionValue: (o: ComboBoxOption) => string | undefined;
73
+ value: string | null;
74
+ getOptionValue: (o: ComboBoxOption) => string;
75
75
  };
76
76
  }) & {
77
77
  type: T;
@@ -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;
@@ -1,9 +1,9 @@
1
- import { LunaticComponentDefinition } from '../../../use-lunatic/type';
2
1
  import { LunaticBaseProps } from '../../type';
2
+ import { LunaticComponentDefinition } from '../../../use-lunatic/type';
3
3
  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' | 'getSuggesterStatus' | 'preferences' | 'value' | 'errors'>;
8
- declare function OrchestratedComponent({ id, component, handleChange, features, missing, shortcut, management, preferences, value, iteration, linksIterations, executeExpression, getSuggesterStatus, errors, }: Props): import("react/jsx-runtime").JSX.Element | null;
7
+ } & Pick<LunaticBaseProps, 'id' | 'iteration' | 'executeExpression' | 'handleChange' | 'missing' | 'shortcut' | 'management' | 'preferences' | 'value' | 'errors' | 'className'>;
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,6 +1,6 @@
1
- import { FunctionComponent } from 'react';
1
+ import type { FunctionComponent } from 'react';
2
+ import type { LunaticComponentProps } from '../type';
2
3
  import { LunaticComponentDefinition, LunaticState } from '../../use-lunatic/type';
3
- import { LunaticComponentProps } from '../type';
4
4
  type OriginalProps = {
5
5
  key: number;
6
6
  rowIndex: number;
@@ -13,7 +13,6 @@ type OriginalProps = {
13
13
  [key: string]: unknown;
14
14
  }) => void;
15
15
  executeExpression: LunaticState['executeExpression'];
16
- getSuggesterStatus?: LunaticState['getSuggesterStatus'];
17
16
  iteration?: number;
18
17
  linksIterations?: [number, number];
19
18
  features?: string[];
@@ -27,6 +26,6 @@ type OrchestratedProps = {
27
26
  index: number;
28
27
  [key: string]: unknown;
29
28
  }) => void;
30
- } & Pick<OriginalProps, 'id' | 'components' | 'valueMap' | 'features' | 'missing' | 'shortcut' | 'preferences' | 'executeExpression' | 'iteration' | 'errors' | 'getSuggesterStatus'>;
31
- declare function createRowOrchestrator(Row: FunctionComponent<OriginalProps>): ({ id, components, nbRows, valueMap, handleChange, features, missing, shortcut, preferences, executeExpression, getSuggesterStatus, iteration, xAxisIterations, errors, }: OrchestratedProps) => import("react/jsx-runtime").JSX.Element | null;
29
+ } & Pick<OriginalProps, 'id' | 'components' | 'valueMap' | 'features' | 'missing' | 'shortcut' | 'preferences' | 'executeExpression' | 'iteration' | 'errors'>;
30
+ declare function createRowOrchestrator(Row: FunctionComponent<OriginalProps>): ({ id, components, nbRows, valueMap, handleChange, features, missing, shortcut, preferences, executeExpression, iteration, xAxisIterations, errors, }: OrchestratedProps) => import("react/jsx-runtime").JSX.Element | null;
32
31
  export default createRowOrchestrator;
@@ -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;
@@ -5,7 +5,7 @@ type Props = {
5
5
  id?: string;
6
6
  disabled?: boolean;
7
7
  options: ComboBoxOption[];
8
- onSelect: (v: string | null | ComboBoxOption) => void;
8
+ onSelect: (v: string | null) => void;
9
9
  className?: string;
10
10
  value: string | null;
11
11
  label?: ReactNode;
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import './dropdown.scss';
3
3
  import { LunaticComponentProps } from '../../type';
4
- import { ComboBoxOption } from '../../commons/components/combo-box/combo-box.type';
5
4
  export type DropdownProps = {
6
- onSelect: (value: string | ComboBoxOption | null) => void;
5
+ onSelect: (v: string | null) => void;
7
6
  className?: string;
8
7
  } & Pick<LunaticComponentProps<'Dropdown'>, 'id' | 'disabled' | 'options' | 'writable' | 'value' | 'description' | 'label' | 'errors'>;
9
8
  declare const _default: React.ComponentType<DropdownProps>;
@@ -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';
@@ -14,7 +14,6 @@ type Props = {
14
14
  label?: ReactNode;
15
15
  description?: string;
16
16
  unit?: string;
17
- dynamicUnit?: ReactNode;
18
17
  errors?: LunaticBaseProps['errors'];
19
18
  };
20
19
  declare const _default: import("react").ComponentType<Props>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const BlockForLoopOrchestrator: ({ id, components, nbRows, valueMap, handleChange, features, missing, shortcut, preferences, executeExpression, getSuggesterStatus, iteration, xAxisIterations, errors, }: {
2
+ declare const BlockForLoopOrchestrator: ({ id, components, nbRows, valueMap, handleChange, features, missing, shortcut, preferences, executeExpression, iteration, xAxisIterations, errors, }: {
3
3
  nbRows: number;
4
4
  xAxisIterations?: number | undefined;
5
5
  handleChange: (response: {
@@ -25,10 +25,6 @@ declare const BlockForLoopOrchestrator: ({ id, components, nbRows, valueMap, han
25
25
  logging?: import("../../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
26
26
  bindingDependencies?: string[] | undefined;
27
27
  } | undefined) => T;
28
- getSuggesterStatus?: ((name: string | undefined) => {
29
- status: import("../../../use-lunatic/use-suggesters").SuggesterStatus;
30
- timestamp: number;
31
- }) | undefined;
32
28
  iteration?: number | undefined;
33
29
  linksIterations?: [number, number] | undefined;
34
30
  features?: string[] | undefined;
@@ -45,14 +41,10 @@ declare const BlockForLoopOrchestrator: ({ id, components, nbRows, valueMap, han
45
41
  logging?: import("../../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
46
42
  bindingDependencies?: string[] | undefined;
47
43
  } | undefined) => T;
48
- getSuggesterStatus: (name: string) => {
49
- status: import("../../../use-lunatic/use-suggesters").SuggesterStatus;
50
- timestamp: number;
51
- };
52
44
  value: Record<string, unknown[]>;
53
- header?: {
45
+ headers?: {
54
46
  label: import("react").ReactNode;
55
47
  }[] | undefined;
56
48
  paginatedLoop?: boolean | undefined;
57
- }, "id" | "preferences" | "missing" | "errors" | "shortcut">, "id" | "components" | "iteration" | "executeExpression" | "features" | "preferences" | "missing" | "errors" | "shortcut" | "getSuggesterStatus" | "valueMap">) => import("react/jsx-runtime").JSX.Element | null;
49
+ }, "id" | "preferences" | "missing" | "errors" | "shortcut">, "id" | "components" | "iteration" | "executeExpression" | "features" | "preferences" | "missing" | "errors" | "shortcut" | "valueMap">) => import("react/jsx-runtime").JSX.Element | null;
58
50
  export default BlockForLoopOrchestrator;
@@ -12,12 +12,8 @@ declare const _default: React.ComponentType<import("../../type").LunaticBaseProp
12
12
  logging?: import("../../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
13
13
  bindingDependencies?: string[] | undefined;
14
14
  } | undefined) => T;
15
- getSuggesterStatus: (name: string) => {
16
- status: import("../../../use-lunatic/use-suggesters").SuggesterStatus;
17
- timestamp: number;
18
- };
19
15
  value: Record<string, unknown[]>;
20
- header?: {
16
+ headers?: {
21
17
  label: React.ReactNode;
22
18
  }[] | undefined;
23
19
  paginatedLoop?: boolean | undefined;
@@ -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>;
@@ -0,0 +1,12 @@
1
+ import { LunaticComponentProps } from '../../type';
2
+ type Props = {
3
+ nbRows: number;
4
+ handleChange: (response: {
5
+ name: string;
6
+ }, value: unknown, args: {
7
+ index: number;
8
+ [k: string]: unknown;
9
+ }) => void;
10
+ } & Pick<LunaticComponentProps<'RosterForLoop'>, 'id' | 'components' | 'executeExpression' | 'headers' | 'value' | 'management' | 'missing' | 'shortcut' | 'errors'>;
11
+ declare function Body({ id, components, nbRows, executeExpression, handleChange, value: valueMap, missing, }: Props): import("react/jsx-runtime").JSX.Element | null;
12
+ export default Body;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ id?: string;
4
+ header?: Array<{
5
+ label: ReactNode;
6
+ }>;
7
+ };
8
+ declare function Header({ header, id }: Props): import("react/jsx-runtime").JSX.Element | null;
9
+ export default Header;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const RosterForLoopOrchestrator: ({ id, components, nbRows, valueMap, handleChange, features, missing, shortcut, preferences, executeExpression, getSuggesterStatus, iteration, xAxisIterations, errors, }: {
2
+ declare const RosterForLoopOrchestrator: ({ id, components, nbRows, valueMap, handleChange, features, missing, shortcut, preferences, executeExpression, iteration, xAxisIterations, errors, }: {
3
3
  nbRows: number;
4
4
  xAxisIterations?: number | undefined;
5
5
  handleChange: (response: {
@@ -25,10 +25,6 @@ declare const RosterForLoopOrchestrator: ({ id, components, nbRows, valueMap, ha
25
25
  logging?: import("../../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
26
26
  bindingDependencies?: string[] | undefined;
27
27
  } | undefined) => T;
28
- getSuggesterStatus?: ((name: string | undefined) => {
29
- status: import("../../../use-lunatic/use-suggesters").SuggesterStatus;
30
- timestamp: number;
31
- }) | undefined;
32
28
  iteration?: number | undefined;
33
29
  linksIterations?: [number, number] | undefined;
34
30
  features?: string[] | undefined;
@@ -45,14 +41,10 @@ declare const RosterForLoopOrchestrator: ({ id, components, nbRows, valueMap, ha
45
41
  logging?: import("../../../use-lunatic/commons/execute-expression/create-execute-expression").ExpressionLogger | undefined;
46
42
  bindingDependencies?: string[] | undefined;
47
43
  } | undefined) => T;
48
- getSuggesterStatus: (name: string) => {
49
- status: import("../../../use-lunatic/use-suggesters").SuggesterStatus;
50
- timestamp: number;
51
- };
52
44
  value: Record<string, unknown[]>;
53
- header?: {
45
+ headers?: {
54
46
  label: import("react").ReactNode;
55
47
  }[] | undefined;
56
48
  paginatedLoop?: boolean | undefined;
57
- }, "id" | "preferences" | "missing" | "errors" | "shortcut">, "id" | "components" | "iteration" | "executeExpression" | "features" | "preferences" | "missing" | "errors" | "shortcut" | "getSuggesterStatus" | "valueMap">) => import("react/jsx-runtime").JSX.Element | null;
49
+ }, "id" | "preferences" | "missing" | "errors" | "shortcut">, "id" | "components" | "iteration" | "executeExpression" | "features" | "preferences" | "missing" | "errors" | "shortcut" | "valueMap">) => import("react/jsx-runtime").JSX.Element | null;
58
50
  export default RosterForLoopOrchestrator;