@inseefr/lunatic 3.0.0-rc.1 → 3.0.0-rc.6
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/CheckboxBoolean/CheckboxBoolean.js +39 -19
- package/lib/components/CheckboxGroup/CustomCheckboxGroup.js +2 -2
- package/lib/components/CheckboxOne/CheckboxOne.js +6 -6
- package/lib/components/Datepicker/Datepicker.js +43 -28
- package/lib/components/Dropdown/Dropdown.js +40 -23
- package/lib/components/Duration/Duration.js +41 -16
- package/lib/components/FilterDescription/FilterDescription.js +2 -3
- package/lib/components/Input/Input.js +39 -21
- package/lib/components/InputNumber/InputNumber.js +45 -34
- package/lib/components/InputNumber/__snapshots__/InputNumber.spec.tsx.snap +0 -2
- package/lib/components/Loop/Loop.js +52 -29
- package/lib/components/LunaticComponents.js +42 -37
- package/lib/components/Question/Question.js +23 -14
- package/lib/components/Radio/Radio.js +2 -2
- package/lib/components/RosterForLoop/RosterForLoop.js +13 -35
- package/lib/components/Roundabout/CustomRoundabout.js +2 -2
- package/lib/components/Roundabout/RoundaboutItButton.js +2 -2
- package/lib/components/Roundabout/extra.js +6 -6
- package/lib/components/Sequence/Sequence.js +2 -2
- package/lib/components/Subsequence/Subsequence.js +2 -2
- package/lib/components/Suggester/CustomSuggester.js +2 -2
- package/lib/components/Suggester/SuggesterNotification.js +2 -2
- package/lib/components/Summary/Summary.js +3 -3
- package/lib/components/Switch/Switch.js +42 -22
- package/lib/components/Textarea/Textarea.js +43 -23
- package/lib/components/library.js +0 -2
- package/lib/components/shared/Button/Button.js +2 -2
- package/lib/components/shared/Checkbox/CheckboxOption.js +2 -2
- package/lib/components/shared/Combobox/Combobox.js +2 -2
- package/lib/components/shared/Combobox/ComboboxContainer.js +2 -2
- package/lib/components/shared/Combobox/ComboboxContentBox.js +2 -2
- package/lib/components/shared/Combobox/Panel/ComboboxOption.js +2 -2
- package/lib/components/shared/Combobox/Panel/ComboboxPanelContainer.js +2 -2
- package/lib/components/shared/Combobox/Selection/ComboboxClearButton.js +2 -2
- package/lib/components/shared/Combobox/Selection/ComboboxInput.js +2 -2
- package/lib/components/shared/Combobox/Selection/ComboboxLabelSelection.js +2 -2
- package/lib/components/shared/Declarations/Declarations.js +3 -3
- package/lib/components/shared/Fieldset/Fieldset.js +2 -2
- package/lib/components/shared/HOC/{customizedComponent.js → slottableComponent.js} +35 -13
- package/lib/components/shared/Label/Label.js +2 -2
- package/lib/components/shared/MDLabel/RouterLink.js +2 -2
- package/lib/components/shared/Notification.js +2 -2
- package/lib/components/shared/Radio/RadioGroup.js +4 -3
- package/lib/components/shared/Radio/RadioOption.js +2 -2
- package/lib/components/shared/Table/Table.js +2 -2
- package/lib/components/shared/Table/Tbody.js +2 -2
- package/lib/components/shared/Table/Td.js +2 -2
- package/lib/components/shared/Table/Th.js +2 -2
- package/lib/components/shared/Table/Thead.js +2 -2
- package/lib/components/shared/Table/Tr.js +2 -2
- package/lib/src/components/CheckboxBoolean/CheckboxBoolean.d.ts +10 -5
- package/lib/src/components/CheckboxOne/CheckboxOne.d.ts +5 -11
- package/lib/src/components/Datepicker/Datepicker.d.ts +8 -9
- package/lib/src/components/Dropdown/Dropdown.d.ts +9 -11
- package/lib/src/components/Duration/Duration.d.ts +9 -6
- package/lib/src/components/FilterDescription/FilterDescription.d.ts +1 -1
- package/lib/src/components/Input/Input.d.ts +9 -7
- package/lib/src/components/InputNumber/InputNumber.d.ts +9 -9
- package/lib/src/components/Loop/Loop.d.ts +11 -18
- package/lib/src/components/LunaticComponents.d.ts +4 -2
- package/lib/src/components/Question/Question.d.ts +6 -4
- package/lib/src/components/RosterForLoop/RosterForLoop.d.ts +2 -21
- package/lib/src/components/Switch/Switch.d.ts +9 -0
- package/lib/src/components/Textarea/Textarea.d.ts +9 -9
- package/lib/src/components/library.d.ts +24 -91
- package/lib/src/components/shared/HOC/slottableComponent.d.ts +101 -0
- package/lib/src/components/shared/Radio/RadioGroup.d.ts +1 -0
- package/lib/src/components/type.d.ts +0 -5
- package/lib/src/index.d.ts +1 -1
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +18 -33
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +0 -37
- package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +16 -18
- package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +4 -52
- package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +1 -1
- package/lib/src/use-lunatic/lunatic-context.d.ts +1 -4
- package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
- package/lib/src/use-lunatic/type-source.d.ts +1 -5
- package/lib/src/use-lunatic/use-lunatic.d.ts +8 -19
- package/lib/stories/{component-set/component-set.stories.js → behaviour/slots.stories.js} +36 -25
- package/lib/stories/checkbox-group/checkbox-group.stories.js +1 -6
- package/lib/stories/disabled/source.json +1 -1
- package/lib/stories/pairwise/pairwise-links.stories.js +1 -9
- package/lib/stories/suggester/suggester.stories.js +1 -8
- package/lib/stories/utils/orchestrator.js +4 -4
- package/lib/use-lunatic/commons/fill-components/fill-specific-expression.js +0 -1
- package/lib/use-lunatic/lunatic-context.js +2 -10
- package/lib/use-lunatic/replace-component-sequence.js +2 -3
- package/lib/use-lunatic/use-lunatic.js +1 -4
- package/lib/use-lunatic/use-lunatic.test.js +4 -30
- package/package.json +1 -1
- package/lib/components/ComponentSet/ComponentSet.js +0 -68
- package/lib/components/type-custom.js +0 -5
- package/lib/src/components/ComponentSet/ComponentSet.d.ts +0 -7
- package/lib/src/components/shared/HOC/customizedComponent.d.ts +0 -5
- package/lib/src/components/type-custom.d.ts +0 -101
- package/lib/stories/checkbox-group/sourceComponentset.json +0 -424
- package/lib/stories/component-set/data-loop.json +0 -18
- package/lib/stories/component-set/data-roundabout.json +0 -25
- package/lib/stories/component-set/data.json +0 -25
- package/lib/stories/component-set/source-loop.json +0 -308
- package/lib/stories/component-set/source-roundabout.json +0 -434
- package/lib/stories/component-set/source.json +0 -113
- package/lib/stories/pairwise/source-componentset.json +0 -292
- package/lib/stories/suggester/source-component-set.json +0 -113
|
@@ -1,39 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.
|
|
7
|
-
|
|
7
|
+
exports.CustomInputNumber = void 0;
|
|
8
|
+
exports.InputNumber = InputNumber;
|
|
8
9
|
var _InputNumberThousand = require("./InputNumberThousand");
|
|
9
10
|
require("./InputNumber.scss");
|
|
10
11
|
var _Label = require("../shared/Label/Label");
|
|
11
12
|
var _ComponentErrors = require("../shared/ComponentErrors/ComponentErrors");
|
|
12
|
-
var
|
|
13
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
13
14
|
var _Declarations = require("../shared/Declarations/Declarations");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
_ref$max = _ref.max,
|
|
26
|
-
max = _ref$max === void 0 ? 1000000 : _ref$max,
|
|
27
|
-
_ref$decimals = _ref.decimals,
|
|
28
|
-
decimals = _ref$decimals === void 0 ? 0 : _ref$decimals,
|
|
29
|
-
unit = _ref.unit,
|
|
30
|
-
label = _ref.label,
|
|
31
|
-
errors = _ref.errors,
|
|
16
|
+
var _excluded = ["handleChange", "response", "errors", "decimals"];
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
21
|
+
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); }
|
|
22
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
23
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
24
|
+
function InputNumber(_ref) {
|
|
25
|
+
var handleChange = _ref.handleChange,
|
|
32
26
|
response = _ref.response,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
errors = _ref.errors,
|
|
28
|
+
decimals = _ref.decimals,
|
|
29
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomInputNumber, _objectSpread(_objectSpread({}, props), {}, {
|
|
31
|
+
decimals: decimals !== null && decimals !== void 0 ? decimals : 0,
|
|
32
|
+
onChange: function onChange(v) {
|
|
33
|
+
return handleChange(response, v);
|
|
34
|
+
},
|
|
35
|
+
errors: (0, _ComponentErrors.getComponentErrors)(errors, props.id)
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
var CustomInputNumber = exports.CustomInputNumber = (0, _slottableComponent.slottableComponent)('InputNumber', function (props) {
|
|
39
|
+
var id = props.id,
|
|
40
|
+
value = props.value,
|
|
41
|
+
onChange = props.onChange,
|
|
42
|
+
disabled = props.disabled,
|
|
43
|
+
readOnly = props.readOnly,
|
|
44
|
+
max = props.max,
|
|
45
|
+
decimals = props.decimals,
|
|
46
|
+
unit = props.unit,
|
|
47
|
+
label = props.label,
|
|
48
|
+
errors = props.errors,
|
|
49
|
+
required = props.required,
|
|
50
|
+
description = props.description,
|
|
51
|
+
declarations = props.declarations;
|
|
37
52
|
var labelId = "label-".concat(id);
|
|
38
53
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
39
54
|
className: "lunatic-input-number",
|
|
@@ -49,12 +64,10 @@ function LunaticInputNumber(_ref) {
|
|
|
49
64
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_InputNumberThousand.InputNumberThousand, {
|
|
50
65
|
id: id,
|
|
51
66
|
value: value,
|
|
52
|
-
onChange:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
readOnly: readOnly,
|
|
57
|
-
required: required,
|
|
67
|
+
onChange: onChange,
|
|
68
|
+
disabled: !!disabled,
|
|
69
|
+
readOnly: !!readOnly,
|
|
70
|
+
required: !!required,
|
|
58
71
|
labelId: labelId,
|
|
59
72
|
max: max,
|
|
60
73
|
decimals: decimals,
|
|
@@ -62,9 +75,7 @@ function LunaticInputNumber(_ref) {
|
|
|
62
75
|
}), unit && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
63
76
|
children: unit
|
|
64
77
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComponentErrors.ComponentErrors, {
|
|
65
|
-
errors: errors
|
|
66
|
-
componentId: id
|
|
78
|
+
errors: errors
|
|
67
79
|
})]
|
|
68
80
|
});
|
|
69
|
-
}
|
|
70
|
-
var InputNumber = exports.InputNumber = (0, _customizedComponent.customizedComponent)('InputNumber', LunaticInputNumber);
|
|
81
|
+
});
|
|
@@ -12,7 +12,6 @@ exports[`InputNumber > renders without crashing 1`] = `
|
|
|
12
12
|
id="number"
|
|
13
13
|
inputmode="numeric"
|
|
14
14
|
lang="en"
|
|
15
|
-
required=""
|
|
16
15
|
type="text"
|
|
17
16
|
value="10"
|
|
18
17
|
/>
|
|
@@ -33,7 +32,6 @@ exports[`InputNumber > should handle readOnly 1`] = `
|
|
|
33
32
|
inputmode="numeric"
|
|
34
33
|
lang="en"
|
|
35
34
|
readonly=""
|
|
36
|
-
required=""
|
|
37
35
|
type="text"
|
|
38
36
|
value="123"
|
|
39
37
|
/>
|
|
@@ -4,17 +4,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.CustomLoop = void 0;
|
|
8
|
+
exports.Loop = Loop;
|
|
8
9
|
var _react = require("react");
|
|
9
10
|
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
10
11
|
var _array = require("../../utils/array");
|
|
11
12
|
var _LunaticComponents = require("../LunaticComponents");
|
|
12
13
|
var _constant = require("./constant");
|
|
13
|
-
var
|
|
14
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
14
15
|
var _Label = require("../shared/Label/Label");
|
|
15
16
|
var _Declarations = require("../shared/Declarations/Declarations");
|
|
16
17
|
var _Button = require("../shared/Button/Button");
|
|
18
|
+
var _ComponentErrors = require("../shared/ComponentErrors/ComponentErrors");
|
|
17
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
+
var _excluded = ["lines", "iterations", "value", "handleChange", "getComponents", "errors"];
|
|
18
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
22
|
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; }
|
|
20
23
|
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; }
|
|
@@ -26,22 +29,23 @@ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructur
|
|
|
26
29
|
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); }
|
|
27
30
|
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; }
|
|
28
31
|
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; } }
|
|
29
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
33
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
34
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
35
|
+
/**
|
|
30
36
|
* Loop without specific markup (stack of subcomponents)
|
|
31
37
|
*/
|
|
32
|
-
|
|
38
|
+
function Loop(_ref) {
|
|
33
39
|
var _lines$min, _lines$max;
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
getComponents = props.getComponents;
|
|
40
|
+
var lines = _ref.lines,
|
|
41
|
+
iterations = _ref.iterations,
|
|
42
|
+
value = _ref.value,
|
|
43
|
+
handleChange = _ref.handleChange,
|
|
44
|
+
getComponents = _ref.getComponents,
|
|
45
|
+
errors = _ref.errors,
|
|
46
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
42
47
|
var min = (_lines$min = lines === null || lines === void 0 ? void 0 : lines.min) !== null && _lines$min !== void 0 ? _lines$min : 0;
|
|
43
48
|
var max = (_lines$max = lines === null || lines === void 0 ? void 0 : lines.max) !== null && _lines$max !== void 0 ? _lines$max : Infinity;
|
|
44
|
-
var canControlRows = min !== max && Number.isFinite(max);
|
|
45
49
|
var _useState = (0, _react.useState)(function () {
|
|
46
50
|
return Math.max(iterations, min);
|
|
47
51
|
}),
|
|
@@ -57,10 +61,10 @@ var Loop = exports.Loop = (0, _customizedComponent.customizedComponent)('BlockFo
|
|
|
57
61
|
if (nbRows > 1) {
|
|
58
62
|
var newNbRows = nbRows - 1;
|
|
59
63
|
setNbRows(newNbRows);
|
|
60
|
-
Object.entries(value).forEach(function (
|
|
61
|
-
var
|
|
62
|
-
k =
|
|
63
|
-
v =
|
|
64
|
+
Object.entries(value).forEach(function (_ref2) {
|
|
65
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
66
|
+
k = _ref3[0],
|
|
67
|
+
v = _ref3[1];
|
|
64
68
|
var newValue = v.filter(function (_, i) {
|
|
65
69
|
return i < newNbRows;
|
|
66
70
|
});
|
|
@@ -73,16 +77,12 @@ var Loop = exports.Loop = (0, _customizedComponent.customizedComponent)('BlockFo
|
|
|
73
77
|
if (nbRows <= 0) {
|
|
74
78
|
return null;
|
|
75
79
|
}
|
|
76
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
type: "AFTER_QUESTION_TEXT",
|
|
83
|
-
declarations: declarations,
|
|
84
|
-
id: id
|
|
85
|
-
}), (0, _array.times)(nbRows, function (n) {
|
|
80
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomLoop, _objectSpread(_objectSpread({}, props), {}, {
|
|
81
|
+
errors: (0, _ComponentErrors.getComponentErrors)(errors, props.id),
|
|
82
|
+
addRow: nbRows === max ? undefined : addRow,
|
|
83
|
+
removeRow: nbRows === 1 ? undefined : removeRow,
|
|
84
|
+
canControlRows: min !== max && Number.isFinite(max),
|
|
85
|
+
children: (0, _array.times)(nbRows, function (n) {
|
|
86
86
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LunaticComponents.LunaticComponents, {
|
|
87
87
|
blocklist: _constant.blockedInLoopComponents,
|
|
88
88
|
components: getComponents(n),
|
|
@@ -92,14 +92,37 @@ var Loop = exports.Loop = (0, _customizedComponent.customizedComponent)('BlockFo
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}, n);
|
|
95
|
+
})
|
|
96
|
+
}));
|
|
97
|
+
}
|
|
98
|
+
var CustomLoop = exports.CustomLoop = (0, _slottableComponent.slottableComponent)('Loop', function (props) {
|
|
99
|
+
var declarations = props.declarations,
|
|
100
|
+
id = props.id,
|
|
101
|
+
label = props.label,
|
|
102
|
+
canControlRows = props.canControlRows,
|
|
103
|
+
children = props.children,
|
|
104
|
+
errors = props.errors,
|
|
105
|
+
addRow = props.addRow,
|
|
106
|
+
removeRow = props.removeRow;
|
|
107
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
108
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Label.Label, {
|
|
109
|
+
htmlFor: id,
|
|
110
|
+
id: "label-".concat(id),
|
|
111
|
+
children: label
|
|
112
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Declarations.Declarations, {
|
|
113
|
+
type: "AFTER_QUESTION_TEXT",
|
|
114
|
+
declarations: declarations,
|
|
115
|
+
id: id
|
|
116
|
+
}), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_ComponentErrors.ComponentErrors, {
|
|
117
|
+
errors: errors
|
|
95
118
|
}), canControlRows && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
96
119
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
97
120
|
onClick: addRow,
|
|
98
|
-
disabled:
|
|
121
|
+
disabled: !addRow,
|
|
99
122
|
children: _i18n["default"].DEFAULT_BUTTON_ADD
|
|
100
123
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
101
124
|
onClick: removeRow,
|
|
102
|
-
disabled:
|
|
125
|
+
disabled: !removeRow,
|
|
103
126
|
children: _i18n["default"].DEFAULT_BUTTON_REMOVE
|
|
104
127
|
})]
|
|
105
128
|
})]
|
|
@@ -11,6 +11,7 @@ var _component = require("../use-lunatic/commons/component");
|
|
|
11
11
|
var _ComponentWrapper = require("./shared/ComponentWrapper");
|
|
12
12
|
var _library = require("./library");
|
|
13
13
|
var _reactErrorBoundary = require("react-error-boundary");
|
|
14
|
+
var _slottableComponent = require("./shared/HOC/slottableComponent");
|
|
14
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
16
|
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
17
|
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; }
|
|
@@ -27,6 +28,7 @@ function LunaticComponents(_ref) {
|
|
|
27
28
|
componentProps = _ref.componentProps,
|
|
28
29
|
blocklist = _ref.blocklist,
|
|
29
30
|
memo = _ref.memo,
|
|
31
|
+
slots = _ref.slots,
|
|
30
32
|
_ref$wrapper = _ref.wrapper,
|
|
31
33
|
wrapper = _ref$wrapper === void 0 ? function (_ref2) {
|
|
32
34
|
var children = _ref2.children;
|
|
@@ -41,50 +43,53 @@ function LunaticComponents(_ref) {
|
|
|
41
43
|
(0, _useAutoFocus.useAutoFocus)(wrapperRef, hasComponents ? autoFocusKey : undefined);
|
|
42
44
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(WrapperComponent, {
|
|
43
45
|
ref: WrapperComponent === _react.Fragment ? undefined : wrapperRef,
|
|
44
|
-
children:
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_slottableComponent.SlotsProvider, {
|
|
47
|
+
slots: slots,
|
|
48
|
+
children: components.map(function (component, k) {
|
|
49
|
+
if ((0, _component.hasComponentType)(component)) {
|
|
50
|
+
if (blocklist && blocklist.includes(component.componentType)) {
|
|
51
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
52
|
+
children: wrapper(_objectSpread({
|
|
53
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
54
|
+
style: {
|
|
55
|
+
color: 'red'
|
|
56
|
+
},
|
|
57
|
+
children: ["Component \"", component.componentType, "\" is not allowed here"]
|
|
58
|
+
}),
|
|
59
|
+
index: k
|
|
60
|
+
}, component))
|
|
61
|
+
}, computeId(component, k));
|
|
62
|
+
}
|
|
63
|
+
var _props = _objectSpread(_objectSpread({}, component), componentProps === null || componentProps === void 0 ? void 0 : componentProps(component));
|
|
47
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
48
65
|
children: wrapper(_objectSpread({
|
|
49
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
50
|
-
style: {
|
|
51
|
-
color: 'red'
|
|
52
|
-
},
|
|
53
|
-
children: ["Component \"", component.componentType, "\" is not allowed here"]
|
|
54
|
-
}),
|
|
66
|
+
children: memo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LunaticComponentMemo, _objectSpread({}, _props)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(LunaticComponent, _objectSpread({}, _props)),
|
|
55
67
|
index: k
|
|
56
|
-
},
|
|
68
|
+
}, _props))
|
|
57
69
|
}, computeId(component, k));
|
|
58
70
|
}
|
|
59
|
-
var _props = _objectSpread(_objectSpread({}, component), componentProps === null || componentProps === void 0 ? void 0 : componentProps(component));
|
|
60
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
61
|
-
children: wrapper(_objectSpread({
|
|
62
|
-
children: memo ? /*#__PURE__*/(0, _jsxRuntime.jsx)(LunaticComponentMemo, _objectSpread({}, _props)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(LunaticComponent, _objectSpread({}, _props)),
|
|
63
|
-
index: k
|
|
64
|
-
}, _props))
|
|
65
|
-
}, computeId(component, k));
|
|
66
|
-
}
|
|
67
71
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
// In some case (table for instance) we have static component that only have a label (no componentType)
|
|
73
|
+
if (hasLabel(component)) {
|
|
74
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
75
|
+
children: wrapper(_objectSpread(_objectSpread({}, component), {}, {
|
|
76
|
+
children: component.label,
|
|
77
|
+
index: k
|
|
78
|
+
}))
|
|
79
|
+
}, k);
|
|
80
|
+
}
|
|
77
81
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
// Component is a ReactNode
|
|
83
|
+
if ( /*#__PURE__*/(0, _react.isValidElement)(component)) {
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Fragment, {
|
|
85
|
+
children: wrapper({
|
|
86
|
+
children: component,
|
|
87
|
+
index: k
|
|
88
|
+
})
|
|
89
|
+
}, k);
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
})
|
|
88
93
|
})
|
|
89
94
|
});
|
|
90
95
|
}
|
|
@@ -1,22 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.Question = void 0;
|
|
7
|
+
exports.Question = exports.CustomQuestion = void 0;
|
|
7
8
|
var _LunaticComponents = require("../LunaticComponents");
|
|
8
|
-
var
|
|
9
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
9
10
|
var _Declarations = require("../shared/Declarations/Declarations");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
var _excluded = ["components"];
|
|
13
|
+
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; }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
17
|
+
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); }
|
|
18
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
19
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
20
|
/**
|
|
12
21
|
* Surround a question giving additional context with label / description / declarations
|
|
13
22
|
*/
|
|
14
|
-
var Question = exports.Question =
|
|
23
|
+
var Question = exports.Question = function Question(_ref) {
|
|
24
|
+
var components = _ref.components,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomQuestion, _objectSpread(_objectSpread({}, props), {}, {
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LunaticComponents.LunaticComponents, {
|
|
28
|
+
components: components
|
|
29
|
+
})
|
|
30
|
+
}));
|
|
31
|
+
};
|
|
32
|
+
var CustomQuestion = exports.CustomQuestion = (0, _slottableComponent.slottableComponent)('Question', function (props) {
|
|
15
33
|
var id = props.id,
|
|
16
34
|
description = props.description,
|
|
17
35
|
declarations = props.declarations,
|
|
18
36
|
label = props.label,
|
|
19
|
-
|
|
37
|
+
children = props.children;
|
|
20
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("fieldset", {
|
|
21
39
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("legend", {
|
|
22
40
|
id: "question-legend-".concat(id),
|
|
@@ -31,15 +49,6 @@ var Question = exports.Question = (0, _customizedComponent.customizedComponent)(
|
|
|
31
49
|
type: "AFTER_QUESTION_TEXT",
|
|
32
50
|
declarations: declarations,
|
|
33
51
|
id: id
|
|
34
|
-
}),
|
|
35
|
-
components: components,
|
|
36
|
-
wrapper: function wrapper(_ref) {
|
|
37
|
-
var children = _ref.children;
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
39
|
-
className: "question-components",
|
|
40
|
-
children: children
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
})]
|
|
52
|
+
}), children]
|
|
44
53
|
});
|
|
45
54
|
});
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Radio = void 0;
|
|
7
7
|
var _ComponentErrors = require("../shared/ComponentErrors/ComponentErrors");
|
|
8
8
|
var _RadioGroup = require("../shared/Radio/RadioGroup");
|
|
9
|
-
var
|
|
9
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function LunaticRadio(props) {
|
|
12
12
|
var id = props.id,
|
|
@@ -38,4 +38,4 @@ function LunaticRadio(props) {
|
|
|
38
38
|
readOnly: readOnly
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
var Radio = exports.Radio = (0,
|
|
41
|
+
var Radio = exports.Radio = (0, _slottableComponent.slottableComponent)('Radio', LunaticRadio);
|
|
@@ -7,19 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.RosterForLoop = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
require("./RosterForLoop.scss");
|
|
10
|
-
var _i18n = _interopRequireDefault(require("../../i18n"));
|
|
11
10
|
var _Table = require("../shared/Table");
|
|
12
11
|
var _array = require("../../utils/array");
|
|
13
12
|
var _LunaticComponents = require("../LunaticComponents");
|
|
14
13
|
var _constant = require("../Loop/constant");
|
|
15
14
|
var _ComponentErrors = require("../shared/ComponentErrors/ComponentErrors");
|
|
16
|
-
var
|
|
17
|
-
var _customizedComponent = require("../shared/HOC/customizedComponent");
|
|
18
|
-
var _Label = require("../shared/Label/Label");
|
|
19
|
-
var _Button = require("../shared/Button/Button");
|
|
15
|
+
var _Loop = require("../Loop/Loop");
|
|
20
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
var _excluded = ["value", "lines", "handleChange", "declarations", "header", "iterations", "id", "getComponents", "label"];
|
|
22
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
|
+
var _excluded = ["value", "lines", "errors", "handleChange", "declarations", "header", "iterations", "id", "getComponents", "label"];
|
|
23
18
|
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; }
|
|
24
19
|
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; }
|
|
25
20
|
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; }
|
|
@@ -39,9 +34,10 @@ var DEFAULT_MAX_ROWS = 12;
|
|
|
39
34
|
/**
|
|
40
35
|
* Loop displayed as a table
|
|
41
36
|
*/
|
|
42
|
-
var RosterForLoop = exports.RosterForLoop =
|
|
37
|
+
var RosterForLoop = exports.RosterForLoop = function RosterForLoop(props) {
|
|
43
38
|
var valueMap = props.value,
|
|
44
39
|
lines = props.lines,
|
|
40
|
+
errors = props.errors,
|
|
45
41
|
handleChange = props.handleChange,
|
|
46
42
|
declarations = props.declarations,
|
|
47
43
|
header = props.header,
|
|
@@ -56,7 +52,6 @@ var RosterForLoop = exports.RosterForLoop = (0, _customizedComponent.customizedC
|
|
|
56
52
|
_useState2 = _slicedToArray(_useState, 2),
|
|
57
53
|
nbRows = _useState2[0],
|
|
58
54
|
setNbRows = _useState2[1];
|
|
59
|
-
var showButtons = min && max && min !== max;
|
|
60
55
|
var addRow = (0, _react.useCallback)(function () {
|
|
61
56
|
if (nbRows < max) {
|
|
62
57
|
setNbRows(nbRows + 1);
|
|
@@ -84,16 +79,12 @@ var RosterForLoop = exports.RosterForLoop = (0, _customizedComponent.customizedC
|
|
|
84
79
|
return null;
|
|
85
80
|
}
|
|
86
81
|
var cols = 0;
|
|
87
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
type: "AFTER_QUESTION_TEXT",
|
|
94
|
-
declarations: declarations,
|
|
95
|
-
id: id
|
|
96
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Table.Table, {
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Loop.CustomLoop, _objectSpread(_objectSpread({}, props), {}, {
|
|
83
|
+
errors: (0, _ComponentErrors.getComponentErrors)(errors, props.id),
|
|
84
|
+
addRow: nbRows === max ? undefined : addRow,
|
|
85
|
+
removeRow: nbRows === 1 ? undefined : removeRow,
|
|
86
|
+
canControlRows: !!(min && max && min !== max),
|
|
87
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Table.Table, {
|
|
97
88
|
id: id,
|
|
98
89
|
children: [header && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Table.TableHeader, {
|
|
99
90
|
header: header,
|
|
@@ -140,19 +131,6 @@ var RosterForLoop = exports.RosterForLoop = (0, _customizedComponent.customizedC
|
|
|
140
131
|
}, n);
|
|
141
132
|
})
|
|
142
133
|
})]
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}), showButtons && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
147
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
148
|
-
onClick: addRow,
|
|
149
|
-
disabled: nbRows === max,
|
|
150
|
-
children: _i18n["default"].DEFAULT_BUTTON_ADD
|
|
151
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
152
|
-
onClick: removeRow,
|
|
153
|
-
disabled: nbRows === min,
|
|
154
|
-
children: _i18n["default"].DEFAULT_BUTTON_REMOVE
|
|
155
|
-
})]
|
|
156
|
-
})]
|
|
157
|
-
});
|
|
158
|
-
});
|
|
134
|
+
})
|
|
135
|
+
}));
|
|
136
|
+
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.CustomRoundabout = void 0;
|
|
7
7
|
var _RoundaboutItButton = require("./RoundaboutItButton");
|
|
8
|
-
var
|
|
8
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
9
9
|
var _extra = require("./extra");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function RoundaboutIteration(_ref) {
|
|
@@ -29,7 +29,7 @@ function RoundaboutIteration(_ref) {
|
|
|
29
29
|
})]
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
var CustomRoundabout = exports.CustomRoundabout = (0,
|
|
32
|
+
var CustomRoundabout = exports.CustomRoundabout = (0, _slottableComponent.slottableComponent)('Roundabout', function (_ref2) {
|
|
33
33
|
var iterations = _ref2.iterations,
|
|
34
34
|
expressions = _ref2.expressions,
|
|
35
35
|
goToIteration = _ref2.goToIteration,
|
|
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.RoundaboutItButton = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
-
var
|
|
10
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
11
11
|
var _Button = require("../shared/Button/Button");
|
|
12
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
14
14
|
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); }
|
|
15
15
|
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; }
|
|
16
|
-
var RoundaboutItButton = exports.RoundaboutItButton = (0,
|
|
16
|
+
var RoundaboutItButton = exports.RoundaboutItButton = (0, _slottableComponent.slottableComponent)('RoundaboutItButton', function (_ref) {
|
|
17
17
|
var complete = _ref.complete,
|
|
18
18
|
partial = _ref.partial,
|
|
19
19
|
iteration = _ref.iteration,
|
|
@@ -4,39 +4,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.RoundaboutPending = exports.RoundaboutLabel = exports.RoundaboutItTitle = exports.RoundaboutItContainer = exports.RoundaboutContainer = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _slottableComponent = require("../shared/HOC/slottableComponent");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
|
-
var RoundaboutContainer = exports.RoundaboutContainer = (0,
|
|
11
|
+
var RoundaboutContainer = exports.RoundaboutContainer = (0, _slottableComponent.slottableComponent)('RoundaboutContainer', function (_ref) {
|
|
12
12
|
var children = _ref.children;
|
|
13
13
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
14
14
|
className: "lunatic-roundabout",
|
|
15
15
|
children: children
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
-
var RoundaboutLabel = exports.RoundaboutLabel = (0,
|
|
18
|
+
var RoundaboutLabel = exports.RoundaboutLabel = (0, _slottableComponent.slottableComponent)('RoundaboutLabel', function (_ref2) {
|
|
19
19
|
var value = _ref2.value;
|
|
20
20
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
21
21
|
className: "roundabout-label",
|
|
22
22
|
children: value
|
|
23
23
|
});
|
|
24
24
|
});
|
|
25
|
-
var RoundaboutItTitle = exports.RoundaboutItTitle = (0,
|
|
25
|
+
var RoundaboutItTitle = exports.RoundaboutItTitle = (0, _slottableComponent.slottableComponent)('RoundaboutItTitle', function (_ref3) {
|
|
26
26
|
var label = _ref3.label;
|
|
27
27
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
28
28
|
className: "roundabout-it-title",
|
|
29
29
|
children: label
|
|
30
30
|
});
|
|
31
31
|
});
|
|
32
|
-
var RoundaboutItContainer = exports.RoundaboutItContainer = (0,
|
|
32
|
+
var RoundaboutItContainer = exports.RoundaboutItContainer = (0, _slottableComponent.slottableComponent)('RoundaboutItContainer', function (_ref4) {
|
|
33
33
|
var children = _ref4.children;
|
|
34
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
35
35
|
className: "roundabout-iteration-title",
|
|
36
36
|
children: children
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
|
-
var RoundaboutPending = exports.RoundaboutPending = (0,
|
|
39
|
+
var RoundaboutPending = exports.RoundaboutPending = (0, _slottableComponent.slottableComponent)('RoundaboutPending', function () {
|
|
40
40
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
41
41
|
className: "roundabout-pending",
|
|
42
42
|
children: "Pending..."
|