@inseefr/lunatic 3.0.0-rc.6 → 3.0.0-rc.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/CheckboxGroup/CheckboxGroup.js +3 -2
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.js +2 -3
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.spec.js +3 -0
- package/lib/components/CheckboxOne/CheckboxOne.js +0 -1
- package/lib/components/Datepicker/Datepicker.js +0 -1
- package/lib/components/Dropdown/Dropdown.js +0 -17
- package/lib/components/Duration/Duration.js +0 -1
- package/lib/components/Input/Input.js +0 -1
- package/lib/components/InputNumber/InputNumber.js +0 -1
- package/lib/components/RosterForLoop/RosterForLoop.js +0 -1
- package/lib/components/Roundabout/Roundabout.js +0 -1
- package/lib/components/Sequence/Sequence.js +0 -1
- package/lib/components/Suggester/CustomSuggester.js +7 -4
- package/lib/components/Suggester/Suggester.js +59 -4
- package/lib/components/Textarea/Textarea.js +1 -2
- package/lib/components/shared/Button/Button.js +0 -1
- package/lib/components/shared/Button/IconButton.js +0 -1
- package/lib/components/shared/Checkbox/CheckboxOption.js +0 -1
- package/lib/components/shared/Combobox/Combobox.js +3 -2
- package/lib/components/shared/ComponentErrors/ComponentErrors.js +0 -1
- package/lib/components/shared/Declarations/Declarations.js +0 -1
- package/lib/components/shared/Fieldset/Fieldset.js +0 -1
- package/lib/components/shared/Icons/lunatic-icon.js +0 -1
- package/lib/components/shared/Label/Label.js +0 -1
- package/lib/components/shared/Missing/Missing.js +0 -1
- package/lib/components/shared/ModalControls/ModalControls.js +0 -1
- package/lib/components/shared/Radio/RadioGroup.js +0 -1
- package/lib/components/shared/Table/Table.js +0 -1
- package/lib/components/shared/VariableStatus/VariableStatus.js +0 -1
- package/lib/components/shared/suggester-loader-widget/dragger/dragger.js +0 -1
- package/lib/components/shared/suggester-loader-widget/widget.js +0 -1
- package/lib/css/components/Button.scss +24 -0
- package/lib/css/components/CheckboxGroup.scss +13 -0
- package/lib/css/components/CheckboxOne.scss +19 -0
- package/lib/css/components/CheckboxOption.scss +19 -0
- package/lib/css/components/Combobox.scss +206 -0
- package/lib/css/components/ComponentErrors.scss +5 -0
- package/lib/css/components/Datepicker.scss +19 -0
- package/lib/css/components/Declarations.scss +42 -0
- package/lib/css/components/Dragger.scss +8 -0
- package/lib/css/components/Dropdown.scss +38 -0
- package/lib/css/components/Duration.scss +9 -0
- package/lib/css/components/Fieldset.scss +5 -0
- package/lib/css/components/IconButton.scss +38 -0
- package/lib/css/components/Input.scss +42 -0
- package/lib/css/components/InputNumber.scss +11 -0
- package/lib/css/components/Label.scss +6 -0
- package/lib/css/components/Missing.scss +27 -0
- package/lib/css/components/ModalControls.scss +48 -0
- package/lib/css/components/RadioGroup.scss +21 -0
- package/lib/css/components/RosterForLoop.scss +39 -0
- package/lib/css/components/Roundabout.scss +13 -0
- package/lib/css/components/Sequence.scss +10 -0
- package/lib/css/components/Suggester.scss +170 -0
- package/lib/css/components/SuggesterWidget.scss +176 -0
- package/lib/css/components/Table.scss +27 -0
- package/lib/css/components/Textarea.scss +8 -0
- package/lib/css/components/VariableStatus.scss +36 -0
- package/lib/css/main.scss +181 -0
- package/lib/hooks/useSuggesterInfo.js +14 -12
- package/lib/main.css +1063 -0
- package/lib/main.css.map +1 -0
- package/lib/src/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +0 -1
- package/lib/src/components/Datepicker/Datepicker.d.ts +0 -1
- package/lib/src/components/Dropdown/Dropdown.d.ts +0 -1
- package/lib/src/components/Duration/Duration.d.ts +0 -1
- package/lib/src/components/Input/Input.d.ts +0 -1
- package/lib/src/components/InputNumber/InputNumber.d.ts +0 -1
- package/lib/src/components/RosterForLoop/RosterForLoop.d.ts +0 -1
- package/lib/src/components/Roundabout/Roundabout.d.ts +0 -1
- package/lib/src/components/Sequence/Sequence.d.ts +1 -2
- package/lib/src/components/Subsequence/Subsequence.d.ts +1 -1
- package/lib/src/components/Suggester/CustomSuggester.d.ts +5 -1
- package/lib/src/components/Suggester/Suggester.d.ts +1 -2
- package/lib/src/components/Textarea/Textarea.d.ts +0 -1
- package/lib/src/components/library.d.ts +3 -3
- package/lib/src/components/shared/Button/Button.d.ts +0 -1
- package/lib/src/components/shared/Button/IconButton.d.ts +0 -1
- package/lib/src/components/shared/Checkbox/CheckboxOption.d.ts +0 -1
- package/lib/src/components/shared/Combobox/Combobox.d.ts +1 -1
- package/lib/src/components/shared/ComponentErrors/ComponentErrors.d.ts +0 -1
- package/lib/src/components/shared/Declarations/Declarations.d.ts +0 -1
- package/lib/src/components/shared/Fieldset/Fieldset.d.ts +0 -1
- package/lib/src/components/shared/Icons/lunatic-icon.d.ts +0 -1
- package/lib/src/components/shared/Label/Label.d.ts +0 -1
- package/lib/src/components/shared/Missing/Missing.d.ts +0 -1
- package/lib/src/components/shared/ModalControls/ModalControls.d.ts +0 -1
- package/lib/src/components/shared/Radio/RadioGroup.d.ts +0 -1
- package/lib/src/components/shared/Table/Table.d.ts +0 -1
- package/lib/src/components/shared/VariableStatus/VariableStatus.d.ts +0 -1
- package/lib/src/components/shared/suggester-loader-widget/dragger/dragger.d.ts +0 -1
- package/lib/src/components/shared/suggester-loader-widget/widget.d.ts +0 -1
- package/lib/src/components/type.d.ts +6 -1
- package/lib/src/hooks/use-track-changes.d.ts +9 -1
- package/lib/src/hooks/useSuggesterInfo.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +102 -44
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +83 -21
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +47 -36
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +158 -46
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +21 -3
- package/lib/src/use-lunatic/type-source.d.ts +51 -42
- package/lib/src/use-lunatic/type.d.ts +4 -4
- package/lib/src/use-lunatic/use-lunatic.d.ts +57 -15
- package/lib/src/utils/variables.d.ts +10 -2
- package/lib/stories/loop/source-roster.json +2 -2
- package/lib/stories/suggester/fakeReferentiel.json +12 -0
- package/lib/stories/suggester/source-option-responses.json +145 -0
- package/lib/stories/suggester/suggester.stories.js +46 -1
- package/lib/use-lunatic/use-lunatic.test.js +8 -7
- package/package.json +2 -2
- package/lib/components/Dropdown/DropdownWritable.js +0 -58
- package/lib/components/Dropdown/renderer/WritableLabelRenderer.js +0 -38
- package/lib/components/Dropdown/renderer/WritableOptionRenderer.js +0 -140
- package/lib/src/components/Dropdown/DropdownWritable.d.ts +0 -17
- package/lib/src/components/Dropdown/renderer/WritableLabelRenderer.d.ts +0 -8
- package/lib/src/components/Dropdown/renderer/WritableOptionRenderer.d.ts +0 -8
|
@@ -3,15 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.Default = void 0;
|
|
6
|
+
exports["default"] = exports.OptionResponses = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _defaultArgTypes = _interopRequireDefault(require("../utils/default-arg-types"));
|
|
9
9
|
var _orchestrator = _interopRequireDefault(require("../utils/orchestrator"));
|
|
10
10
|
var _referentiel = require("../utils/referentiel");
|
|
11
11
|
var _source = _interopRequireDefault(require("./source"));
|
|
12
|
+
var _sourceOptionResponses = _interopRequireDefault(require("./source-option-responses"));
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
15
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
16
|
+
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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
19
|
+
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); } }
|
|
20
|
+
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); }); }; }
|
|
15
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
22
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
23
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -27,10 +33,49 @@ var Template = function Template(args) {
|
|
|
27
33
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_orchestrator["default"], _objectSpread({}, args));
|
|
28
34
|
};
|
|
29
35
|
var Default = exports.Default = Template.bind({});
|
|
36
|
+
var getFakeReferentiel = /*#__PURE__*/function () {
|
|
37
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(name) {
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
_context.prev = 0;
|
|
42
|
+
_context.next = 3;
|
|
43
|
+
return function (specifier) {
|
|
44
|
+
return new Promise(function (r) {
|
|
45
|
+
return r(specifier);
|
|
46
|
+
}).then(function (s) {
|
|
47
|
+
return _interopRequireWildcard(require(s));
|
|
48
|
+
});
|
|
49
|
+
}("./fakeReferentiel.json");
|
|
50
|
+
case 3:
|
|
51
|
+
return _context.abrupt("return", _context.sent["default"]);
|
|
52
|
+
case 6:
|
|
53
|
+
_context.prev = 6;
|
|
54
|
+
_context.t0 = _context["catch"](0);
|
|
55
|
+
console.log('error', _context.t0);
|
|
56
|
+
throw new Error("Unknown r\xE9f\xE9rentiel ".concat(name));
|
|
57
|
+
case 10:
|
|
58
|
+
case "end":
|
|
59
|
+
return _context.stop();
|
|
60
|
+
}
|
|
61
|
+
}, _callee, null, [[0, 6]]);
|
|
62
|
+
}));
|
|
63
|
+
return function getFakeReferentiel(_x) {
|
|
64
|
+
return _ref.apply(this, arguments);
|
|
65
|
+
};
|
|
66
|
+
}();
|
|
30
67
|
Default.args = {
|
|
31
68
|
id: 'suggester',
|
|
32
69
|
source: _source["default"],
|
|
33
70
|
autoSuggesterLoading: true,
|
|
34
71
|
getReferentiel: _referentiel.getReferentiel,
|
|
35
72
|
pagination: true
|
|
73
|
+
};
|
|
74
|
+
var OptionResponses = exports.OptionResponses = Template.bind({});
|
|
75
|
+
OptionResponses.args = {
|
|
76
|
+
id: 'suggester-with-option',
|
|
77
|
+
source: _sourceOptionResponses["default"],
|
|
78
|
+
getReferentiel: getFakeReferentiel,
|
|
79
|
+
autoSuggesterLoading: true,
|
|
80
|
+
pagination: true
|
|
36
81
|
};
|
|
@@ -202,6 +202,7 @@ var dataFromObject = function dataFromObject(o) {
|
|
|
202
202
|
});
|
|
203
203
|
(0, _vitest.describe)('resizing', function () {
|
|
204
204
|
(0, _vitest.it)('should resize after cleaning', function () {
|
|
205
|
+
var _result$current$getDa, _result$current$getDa2;
|
|
205
206
|
var spy = _vitest.vi.fn();
|
|
206
207
|
var _renderHook11 = (0, _reactHooks.renderHook)(function () {
|
|
207
208
|
return (0, _useLunatic["default"])(_sourceResizingCleaning["default"], undefined, {
|
|
@@ -212,11 +213,11 @@ var dataFromObject = function dataFromObject(o) {
|
|
|
212
213
|
result.current.onChange({
|
|
213
214
|
name: 'NB'
|
|
214
215
|
}, 3);
|
|
215
|
-
(0, _vitest.expect)(result.current.getData(true).COLLECTED.PRENOMS.COLLECTED).toEqual([null, null, null]);
|
|
216
|
+
(0, _vitest.expect)(((_result$current$getDa = result.current.getData(true).COLLECTED) === null || _result$current$getDa === void 0 ? void 0 : _result$current$getDa.PRENOMS).COLLECTED).toEqual([null, null, null]);
|
|
216
217
|
result.current.onChange({
|
|
217
218
|
name: 'NB'
|
|
218
219
|
}, 2);
|
|
219
|
-
(0, _vitest.expect)(result.current.getData(true).COLLECTED.PRENOMS.COLLECTED).toEqual([null, null]);
|
|
220
|
+
(0, _vitest.expect)(((_result$current$getDa2 = result.current.getData(true).COLLECTED) === null || _result$current$getDa2 === void 0 ? void 0 : _result$current$getDa2.PRENOMS).COLLECTED).toEqual([null, null]);
|
|
220
221
|
});
|
|
221
222
|
});
|
|
222
223
|
(0, _vitest.describe)('getData()', function () {
|
|
@@ -248,13 +249,13 @@ var dataFromObject = function dataFromObject(o) {
|
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
});
|
|
251
|
-
(0, _vitest.expect)(Object.keys(data.COLLECTED)).toHaveLength(109);
|
|
252
|
-
(0, _vitest.expect)(Object.keys(data.CALCULATED)).toHaveLength(0);
|
|
252
|
+
(0, _vitest.expect)(data.COLLECTED && Object.keys(data.COLLECTED)).toHaveLength(109);
|
|
253
|
+
(0, _vitest.expect)(data.CALCULATED && Object.keys(data === null || data === void 0 ? void 0 : data.CALCULATED)).toHaveLength(0);
|
|
253
254
|
});
|
|
254
255
|
(0, _vitest.it)('should return calculated values', function () {
|
|
255
256
|
var data = hookRef.current.getData(true);
|
|
256
|
-
(0, _vitest.expect)(Object.keys(data.COLLECTED)).toHaveLength(109);
|
|
257
|
-
(0, _vitest.expect)(Object.keys(data.CALCULATED)).toHaveLength(33);
|
|
257
|
+
(0, _vitest.expect)(data.COLLECTED && Object.keys(data.COLLECTED)).toHaveLength(109);
|
|
258
|
+
(0, _vitest.expect)(data.CALCULATED && Object.keys(data === null || data === void 0 ? void 0 : data.CALCULATED)).toHaveLength(33);
|
|
258
259
|
});
|
|
259
260
|
(0, _vitest.it)('should only return requested variables', function () {
|
|
260
261
|
var data = hookRef.current.getData(false, ['COMMENT']);
|
|
@@ -265,7 +266,7 @@ var dataFromObject = function dataFromObject(o) {
|
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
268
|
});
|
|
268
|
-
(0, _vitest.expect)(Object.keys(data.COLLECTED)).toHaveLength(1);
|
|
269
|
+
(0, _vitest.expect)(data.COLLECTED && Object.keys(data.COLLECTED)).toHaveLength(1);
|
|
269
270
|
});
|
|
270
271
|
});
|
|
271
272
|
(0, _vitest.describe)('getChangedData()', function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inseefr/lunatic",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.8",
|
|
4
4
|
"workersVersion": "0.3.0",
|
|
5
5
|
"description": "Library of questionnaire components",
|
|
6
6
|
"repository": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"build-workers": "node ./scripts/build/build-workers.js",
|
|
57
57
|
"prepare-workers": "npm run build-workers && node ./scripts/build/add-workers-to-public.js",
|
|
58
58
|
"postinstall": "node ./scripts/build/add-workers-to-public.js",
|
|
59
|
-
"build": "babel src --out-dir lib --extensions \".ts,.js,.tsx,.jsx\" --copy-files && tsc --project tsconfig.prod.json && npm run build-workers",
|
|
59
|
+
"build": "babel src --out-dir lib --extensions \".ts,.js,.tsx,.jsx\" --copy-files && tsc --project tsconfig.prod.json && sass ./src/css/main.scss ./lib/main.css && npm run build-workers",
|
|
60
60
|
"storybook": "npm run prepare-workers && storybook dev -p 9999 --no-open",
|
|
61
61
|
"build-storybook": "npm run prepare-workers && storybook build"
|
|
62
62
|
},
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.DropdownWritable = DropdownWritable;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _WritableOptionRenderer = require("./renderer/WritableOptionRenderer");
|
|
9
|
-
var _WritableLabelRenderer = require("./renderer/WritableLabelRenderer");
|
|
10
|
-
var _Combobox = require("../shared/Combobox/Combobox");
|
|
11
|
-
var _helpers = require("./helpers");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
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."); }
|
|
15
|
-
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); }
|
|
16
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
|
-
function DropdownWritable(_ref) {
|
|
20
|
-
var id = _ref.id,
|
|
21
|
-
disabled = _ref.disabled,
|
|
22
|
-
options = _ref.options,
|
|
23
|
-
onSelect = _ref.onSelect,
|
|
24
|
-
className = _ref.className,
|
|
25
|
-
value = _ref.value,
|
|
26
|
-
label = _ref.label,
|
|
27
|
-
errors = _ref.errors,
|
|
28
|
-
description = _ref.description,
|
|
29
|
-
readOnly = _ref.readOnly;
|
|
30
|
-
var _useState = (0, _react.useState)(options),
|
|
31
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
-
filtered = _useState2[0],
|
|
33
|
-
setFiltered = _useState2[1];
|
|
34
|
-
var onChange = (0, _react.useCallback)(function (search) {
|
|
35
|
-
if (search) {
|
|
36
|
-
setFiltered((0, _helpers.filterOptions)(options, search));
|
|
37
|
-
} else {
|
|
38
|
-
setFiltered(options);
|
|
39
|
-
}
|
|
40
|
-
onSelect(null);
|
|
41
|
-
}, [options, onSelect]);
|
|
42
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Combobox.Combobox, {
|
|
43
|
-
id: id,
|
|
44
|
-
className: className,
|
|
45
|
-
disabled: disabled,
|
|
46
|
-
readOnly: readOnly,
|
|
47
|
-
options: filtered,
|
|
48
|
-
onSelect: onSelect,
|
|
49
|
-
onChange: onChange,
|
|
50
|
-
optionRenderer: _WritableOptionRenderer.WritableOptionRenderer,
|
|
51
|
-
labelRenderer: _WritableLabelRenderer.WritableLabelRenderer,
|
|
52
|
-
editable: true,
|
|
53
|
-
value: value,
|
|
54
|
-
label: label,
|
|
55
|
-
errors: errors,
|
|
56
|
-
description: description
|
|
57
|
-
});
|
|
58
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.WritableLabelRenderer = WritableLabelRenderer;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
-
function getContent(option, search) {
|
|
10
|
-
if (option) {
|
|
11
|
-
var value = option.value,
|
|
12
|
-
label = option.label;
|
|
13
|
-
if ( /*#__PURE__*/(0, _react.isValidElement)(label)) {
|
|
14
|
-
return label;
|
|
15
|
-
}
|
|
16
|
-
return label ? "".concat(value, " - ").concat(label) : value;
|
|
17
|
-
}
|
|
18
|
-
if (search !== null && search !== void 0 && search.trim().length) {
|
|
19
|
-
return search;
|
|
20
|
-
}
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
function WritableLabelRenderer(_ref) {
|
|
24
|
-
var option = _ref.option,
|
|
25
|
-
placeholder = _ref.placeholder,
|
|
26
|
-
search = _ref.search;
|
|
27
|
-
var content = getContent(option, search);
|
|
28
|
-
if (content) {
|
|
29
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
30
|
-
className: "selection",
|
|
31
|
-
children: content
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
35
|
-
className: "placeholder",
|
|
36
|
-
children: placeholder
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.WritableOptionRenderer = WritableOptionRenderer;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var _helpers = require("../helpers");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
16
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
19
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
21
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
22
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
23
|
-
function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
|
24
|
-
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."); }
|
|
25
|
-
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); }
|
|
26
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
27
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
28
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
-
function hightlightSearch(label, prefix) {
|
|
30
|
-
var labelText = (0, _helpers.labelToString)(label);
|
|
31
|
-
var initLetters = (0, _helpers.lettersMatching)(labelText, prefix);
|
|
32
|
-
return labelText.split('').reduce(function (_ref, c) {
|
|
33
|
-
var letters = _ref.letters,
|
|
34
|
-
stack = _ref.stack;
|
|
35
|
-
var m = (0, _helpers.preparePrefix)(c);
|
|
36
|
-
var _letters = _toArray(letters),
|
|
37
|
-
first = _letters[0],
|
|
38
|
-
rest = _letters.slice(1);
|
|
39
|
-
if (m === first) {
|
|
40
|
-
return {
|
|
41
|
-
letters: rest,
|
|
42
|
-
stack: [].concat(_toConsumableArray(stack), [{
|
|
43
|
-
"char": c,
|
|
44
|
-
className: 'prefix'
|
|
45
|
-
}])
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
letters: letters,
|
|
50
|
-
stack: [].concat(_toConsumableArray(stack), [{
|
|
51
|
-
"char": c,
|
|
52
|
-
className: 'normal'
|
|
53
|
-
}])
|
|
54
|
-
};
|
|
55
|
-
}, {
|
|
56
|
-
letters: initLetters,
|
|
57
|
-
stack: []
|
|
58
|
-
}).stack.reduce(function (_ref2, _ref3) {
|
|
59
|
-
var last = _ref2.last,
|
|
60
|
-
stack = _ref2.stack;
|
|
61
|
-
var _char = _ref3["char"],
|
|
62
|
-
className = _ref3.className;
|
|
63
|
-
if (!last) {
|
|
64
|
-
return {
|
|
65
|
-
last: className,
|
|
66
|
-
stack: [{
|
|
67
|
-
part: _char,
|
|
68
|
-
className: className
|
|
69
|
-
}]
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
if (last !== className) {
|
|
73
|
-
return {
|
|
74
|
-
last: className,
|
|
75
|
-
stack: [{
|
|
76
|
-
part: _char,
|
|
77
|
-
className: className
|
|
78
|
-
}].concat(_toConsumableArray(stack))
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
var _stack = _toArray(stack),
|
|
82
|
-
first = _stack[0],
|
|
83
|
-
rest = _stack.slice(1);
|
|
84
|
-
return {
|
|
85
|
-
last: className,
|
|
86
|
-
stack: [_objectSpread(_objectSpread({}, first), {}, {
|
|
87
|
-
part: "".concat(first.part).concat(_char)
|
|
88
|
-
})].concat(_toConsumableArray(rest))
|
|
89
|
-
};
|
|
90
|
-
}, {
|
|
91
|
-
last: undefined,
|
|
92
|
-
stack: []
|
|
93
|
-
}).stack.reverse();
|
|
94
|
-
}
|
|
95
|
-
function WritableOptionRenderer(_ref4) {
|
|
96
|
-
var option = _ref4.option,
|
|
97
|
-
selected = _ref4.selected,
|
|
98
|
-
search = _ref4.search;
|
|
99
|
-
var _useState = (0, _react.useState)([]),
|
|
100
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
101
|
-
parts = _useState2[0],
|
|
102
|
-
setParts = _useState2[1];
|
|
103
|
-
var value = option.value,
|
|
104
|
-
label = option.label;
|
|
105
|
-
(0, _react.useEffect)(function () {
|
|
106
|
-
setParts(hightlightSearch(label, search));
|
|
107
|
-
}, [search, label]);
|
|
108
|
-
if (parts !== null && parts !== void 0 && parts.length) {
|
|
109
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
110
|
-
className: (0, _classnames["default"])('lunatic-dropdown-option', {
|
|
111
|
-
selected: selected
|
|
112
|
-
}),
|
|
113
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
114
|
-
className: "id",
|
|
115
|
-
children: value
|
|
116
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
117
|
-
children: "\xA0\u2014\xA0"
|
|
118
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
119
|
-
className: "label",
|
|
120
|
-
children: parts.map(function (_ref5, i) {
|
|
121
|
-
var part = _ref5.part,
|
|
122
|
-
className = _ref5.className;
|
|
123
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
124
|
-
className: className,
|
|
125
|
-
children: part
|
|
126
|
-
}, i);
|
|
127
|
-
})
|
|
128
|
-
})]
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
132
|
-
className: (0, _classnames["default"])('lunatic-dropdown-option', {
|
|
133
|
-
selected: selected
|
|
134
|
-
}),
|
|
135
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
136
|
-
className: "id",
|
|
137
|
-
children: value
|
|
138
|
-
})
|
|
139
|
-
});
|
|
140
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { ComboboxOptionType } from '../shared/Combobox/ComboboxType';
|
|
3
|
-
import type { LunaticError } from '../../use-lunatic/type';
|
|
4
|
-
type Props = {
|
|
5
|
-
id?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
options: ComboboxOptionType[];
|
|
8
|
-
onSelect: (v: string | null) => void;
|
|
9
|
-
className?: string;
|
|
10
|
-
value: string | null;
|
|
11
|
-
label?: ReactNode;
|
|
12
|
-
errors?: LunaticError[];
|
|
13
|
-
description?: ReactNode;
|
|
14
|
-
readOnly?: boolean;
|
|
15
|
-
};
|
|
16
|
-
export declare function DropdownWritable({ id, disabled, options, onSelect, className, value, label, errors, description, readOnly, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComboboxOptionType } from '../../shared/Combobox/ComboboxType';
|
|
2
|
-
type Props = {
|
|
3
|
-
option?: ComboboxOptionType;
|
|
4
|
-
placeholder?: string;
|
|
5
|
-
search?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function WritableLabelRenderer({ option, placeholder, search }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComboboxOptionType } from '../../shared/Combobox/ComboboxType';
|
|
2
|
-
type Props = {
|
|
3
|
-
option: ComboboxOptionType;
|
|
4
|
-
selected?: boolean;
|
|
5
|
-
search?: string;
|
|
6
|
-
};
|
|
7
|
-
export declare function WritableOptionRenderer({ option, selected, search }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|