@inseefr/lunatic 0.4.0-v2 → 0.4.4-v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +25 -25
- package/lib/components/button/button.scss +24 -24
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +6 -3
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +6 -3
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +15 -2
- package/lib/components/commons/components/combo-box/combo-box.scss +218 -218
- package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +10 -10
- package/lib/components/commons/components/dragger/dragger.scss +7 -7
- package/lib/components/commons/components/errors/errors.js +35 -0
- package/lib/components/commons/components/errors/errors.scss +5 -0
- package/lib/components/commons/components/errors/index.js +15 -0
- package/lib/components/commons/components/fab/fab.scss +32 -32
- package/lib/components/commons/components/missing/missing.scss +30 -30
- package/lib/components/commons/components/variable-status/variable-status.scss +39 -39
- package/lib/components/commons/icons/lunatic-icon.scss +4 -4
- package/lib/components/commons/index.js +8 -0
- package/lib/components/commons/use-on-handle-change.js +1 -2
- package/lib/components/datepicker/datepicker.scss +1 -1
- package/lib/components/datepicker/lunatic-datepicker.js +16 -1
- package/lib/components/declarations/declarations.scss +36 -36
- package/lib/components/dropdown/dropdown.scss +41 -41
- package/lib/components/dropdown/lunatic-dropdown.js +6 -3
- package/lib/components/index.scss +139 -139
- package/lib/components/input/input.scss +31 -31
- package/lib/components/input/lunatic-input.js +20 -4
- package/lib/components/input-number/lunatic-input-number.js +17 -2
- package/lib/components/loop/block-for-loop/block-for-loop.js +6 -1
- package/lib/components/loop/loop.js +6 -3
- package/lib/components/loop/roster-for-loop/roster-for-loop.js +7 -2
- package/lib/components/loop/roster-for-loop/roster.scss +42 -42
- package/lib/components/modal-controls/close-or-skip.js +13 -3
- package/lib/components/modal-controls/modal-controls.js +1 -2
- package/lib/components/modal-controls/modal-controls.scss +63 -63
- package/lib/components/pairwise/links/pairwise-links.js +6 -1
- package/lib/components/radio/lunatic-radio-group.js +6 -3
- package/lib/components/radio/radio.scss +59 -59
- package/lib/components/sequence/sequence.scss +10 -10
- package/lib/components/suggester/default-style.scss +125 -125
- package/lib/components/suggester/find-best-label/find-best-label.js +5 -5
- package/lib/components/suggester/lunatic-suggester.js +6 -3
- package/lib/components/suggester-loader-widget/widget.scss +176 -176
- package/lib/components/switch/switch.scss +47 -47
- package/lib/components/table/components/table.scss +26 -26
- package/lib/components/table/lunatic-table.js +5 -2
- package/lib/components/textarea/lunatic-textarea.js +22 -6
- package/lib/components/textarea/textarea.scss +8 -8
- package/lib/i18n/build-dictionary.js +16 -16
- package/lib/stories/Introduction.stories.mdx +114 -114
- package/lib/stories/checkboxOne/source.json +36 -36
- package/lib/stories/custom-mui/textarea-mui.js +0 -5
- package/lib/stories/dropdown/data.json +16 -16
- package/lib/stories/dropdown/source.json +122 -122
- package/lib/stories/filter-description/source-options.json +81 -81
- package/lib/stories/filter-description/source.json +11 -11
- package/lib/stories/input/data.json +5 -5
- package/lib/stories/input/source.json +28 -28
- package/lib/stories/input-number/input-number.stories.js +35 -0
- package/lib/stories/input-number/source.json +37 -0
- package/lib/stories/pairwise/block/block.json +3 -3
- package/lib/stories/pairwise/links/data.json +12 -12
- package/lib/stories/pairwise/links/links.json +141 -141
- package/lib/stories/{questionnaires/test → paste-questionnaire}/source.json +6290 -6290
- package/lib/stories/{questionnaires/test → paste-questionnaire}/test.stories.js +7 -3
- package/lib/stories/questionnaires/logement/data.json +2691 -2691
- package/lib/stories/questionnaires/logement/source-sequence.json +34181 -34181
- package/lib/stories/questionnaires/logement/source.json +34191 -34191
- package/lib/stories/questionnaires/simpsons/source.json +6290 -6290
- package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +848 -0
- package/lib/stories/questionnaires-test/V2_MinMaxSum_Boucles.json +509 -0
- package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4091 -0
- package/lib/stories/questionnaires-test/V2_TCMRallyeGames.json +2892 -0
- package/lib/stories/questionnaires-test/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +490 -0
- package/lib/stories/questionnaires-test/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +1957 -0
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees2_PasPageFin.json +709 -0
- package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +368 -0
- package/lib/stories/{questionnaires → questionnaires-test}/controls/controls.stories.js +9 -6
- package/lib/stories/{questionnaires/samples/sample.json → questionnaires-test/test-dylan.json} +430 -430
- package/lib/stories/questionnaires-test/test.stories.js +45 -32
- package/lib/stories/radio/source.json +36 -36
- package/lib/stories/roster-for-loop/source.json +114 -114
- package/lib/stories/suggester/source.json +234 -234
- package/lib/stories/switch/README.md +31 -31
- package/lib/stories/switch/data-forced.json +48 -48
- package/lib/stories/switch/data.json +80 -80
- package/lib/stories/table/data-roster.json +1 -1
- package/lib/stories/table/data.json +1 -1
- package/lib/stories/table/source-roster.json +504 -504
- package/lib/stories/table/source.json +19 -19
- package/lib/stories/utils/custom-lunatic.scss +28 -28
- package/lib/stories/utils/default-arg-types.js +1 -1
- package/lib/stories/utils/orchestrator.js +38 -14
- package/lib/stories/utils/waiting/waiting.scss +21 -21
- package/lib/use-lunatic/actions.js +31 -17
- package/lib/use-lunatic/commons/create-map-pages.js +10 -10
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +16 -16
- package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +1 -0
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +21 -21
- package/lib/use-lunatic/commons/get-components-from-state.js +9 -2
- package/lib/use-lunatic/commons/get-data.js +90 -0
- package/lib/use-lunatic/commons/index.js +14 -2
- package/lib/use-lunatic/commons/page-tag.js +83 -0
- package/lib/use-lunatic/initial-state.js +3 -1
- package/lib/use-lunatic/reducer/commons/resize-array-variable.js +7 -7
- package/lib/use-lunatic/reducer/reduce-go-next-page.js +62 -37
- package/lib/use-lunatic/reducer/reduce-go-previous-page.js +25 -24
- package/lib/use-lunatic/reducer/reduce-go-to-page.js +59 -0
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +2 -1
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +19 -16
- package/lib/use-lunatic/reducer/reduce-on-init.js +10 -9
- package/lib/use-lunatic/reducer/reducer.js +8 -3
- package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +59 -0
- package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +88 -0
- package/lib/use-lunatic/reducer/validate-controls/index.js +11 -3
- package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +71 -0
- package/lib/use-lunatic/use-lunatic.js +33 -19
- package/lib/utils/store-tools/auto-load.js +2 -2
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -2
- package/package.json +159 -159
- package/lib/index.js.map +0 -1
- package/lib/stories/questionnaires/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -452
- package/lib/stories/questionnaires/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -1689
- package/lib/stories/questionnaires/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -775
- package/lib/stories/questionnaires/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -412
- package/lib/stories/questionnaires/samples/samples.stories.js +0 -64
- package/lib/stories/questionnaires-test/sources.json +0 -203
- package/lib/use-lunatic/commons/get-page-tag.js +0 -21
- package/lib/use-lunatic/reducer/commons/Insee.code-workspace +0 -47
- package/lib/use-lunatic/reducer/validate-controls/create-validate-reducer.js +0 -146
package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js
CHANGED
|
@@ -17,16 +17,16 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
17
17
|
|
|
18
18
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
19
19
|
|
|
20
|
-
/*
|
|
21
|
-
Pour le moment HOC utilisé pour :
|
|
22
|
-
Input
|
|
23
|
-
InputNumber
|
|
24
|
-
DatePicker
|
|
25
|
-
Switch
|
|
26
|
-
Dropdown
|
|
27
|
-
Suggester
|
|
28
|
-
|
|
29
|
-
|
|
20
|
+
/*
|
|
21
|
+
Pour le moment HOC utilisé pour :
|
|
22
|
+
Input
|
|
23
|
+
InputNumber
|
|
24
|
+
DatePicker
|
|
25
|
+
Switch
|
|
26
|
+
Dropdown
|
|
27
|
+
Suggester
|
|
28
|
+
|
|
29
|
+
|
|
30
30
|
*/
|
|
31
31
|
function getComponent(fieldset) {
|
|
32
32
|
if (fieldset) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.lunatic-dragger {
|
|
2
|
-
display: inline-block;;
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
-moz-user-select: -moz-none;
|
|
6
|
-
-khtml-user-select: none;
|
|
7
|
-
-webkit-user-select: none;
|
|
1
|
+
.lunatic-dragger {
|
|
2
|
+
display: inline-block;;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
-moz-user-select: -moz-none;
|
|
6
|
+
-khtml-user-select: none;
|
|
7
|
+
-webkit-user-select: none;
|
|
8
8
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
require("./errors.scss");
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
|
|
14
|
+
function Errors(_ref) {
|
|
15
|
+
var errors = _ref.errors;
|
|
16
|
+
|
|
17
|
+
if (Array.isArray(errors)) {
|
|
18
|
+
var content = errors.map(function (_ref2) {
|
|
19
|
+
var id = _ref2.id,
|
|
20
|
+
errorMessage = _ref2.errorMessage;
|
|
21
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
22
|
+
key: "error-".concat(id),
|
|
23
|
+
className: "lunatic-error"
|
|
24
|
+
}, errorMessage);
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
27
|
+
className: "lunatic-errors"
|
|
28
|
+
}, content);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
var _default = Errors;
|
|
35
|
+
exports["default"] = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _errors["default"];
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _errors = _interopRequireDefault(require("./errors"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
.lunatic-fab {
|
|
2
|
-
width: 32px;
|
|
3
|
-
height: 32px;
|
|
4
|
-
border-radius: 50%;
|
|
5
|
-
margin: 0;
|
|
6
|
-
padding: 0;
|
|
7
|
-
outline: inherit;
|
|
8
|
-
border: none;
|
|
9
|
-
background-color: royalblue;
|
|
10
|
-
box-shadow: 0px 3px 5px -1px rgb(0 0 0 / 20%),
|
|
11
|
-
0px 6px 10px 0px rgb(0 0 0 / 14%), 0px 1px 18px 0px rgb(0 0 0 / 12%);
|
|
12
|
-
|
|
13
|
-
&:hover {
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
background-color: navy;
|
|
16
|
-
transition: background-color 1s;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&.mini {
|
|
20
|
-
width: 18px;
|
|
21
|
-
height: 18px;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&:focus {
|
|
25
|
-
border: solid 1px black;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:disabled {
|
|
29
|
-
cursor: default;
|
|
30
|
-
background-color: darkgray;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
.lunatic-fab {
|
|
2
|
+
width: 32px;
|
|
3
|
+
height: 32px;
|
|
4
|
+
border-radius: 50%;
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
outline: inherit;
|
|
8
|
+
border: none;
|
|
9
|
+
background-color: royalblue;
|
|
10
|
+
box-shadow: 0px 3px 5px -1px rgb(0 0 0 / 20%),
|
|
11
|
+
0px 6px 10px 0px rgb(0 0 0 / 14%), 0px 1px 18px 0px rgb(0 0 0 / 12%);
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
background-color: navy;
|
|
16
|
+
transition: background-color 1s;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.mini {
|
|
20
|
+
width: 18px;
|
|
21
|
+
height: 18px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:focus {
|
|
25
|
+
border: solid 1px black;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:disabled {
|
|
29
|
+
cursor: default;
|
|
30
|
+
background-color: darkgray;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
.lunatic-component {
|
|
2
|
-
.missing-buttons {
|
|
3
|
-
margin-top: 1em;
|
|
4
|
-
.button-lunatic {
|
|
5
|
-
width: 4em;
|
|
6
|
-
font-size: 1em;
|
|
7
|
-
font-weight: normal;
|
|
8
|
-
}
|
|
9
|
-
.missing-button {
|
|
10
|
-
.button-lunatic {
|
|
11
|
-
background-color: var(--color-very-very-light);
|
|
12
|
-
color: var(--color-primary-dark);
|
|
13
|
-
&:hover {
|
|
14
|
-
background-color: white;
|
|
15
|
-
color: var(--color-primary-main);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
.missing-button-active {
|
|
20
|
-
.button-lunatic {
|
|
21
|
-
background-color: var(--color-primary-dark);
|
|
22
|
-
color: var(--color-very-very-light);
|
|
23
|
-
&:hover {
|
|
24
|
-
background-color: var(--color-primary-main);
|
|
25
|
-
color: white;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
.lunatic-component {
|
|
2
|
+
.missing-buttons {
|
|
3
|
+
margin-top: 1em;
|
|
4
|
+
.button-lunatic {
|
|
5
|
+
width: 4em;
|
|
6
|
+
font-size: 1em;
|
|
7
|
+
font-weight: normal;
|
|
8
|
+
}
|
|
9
|
+
.missing-button {
|
|
10
|
+
.button-lunatic {
|
|
11
|
+
background-color: var(--color-very-very-light);
|
|
12
|
+
color: var(--color-primary-dark);
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: white;
|
|
15
|
+
color: var(--color-primary-main);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.missing-button-active {
|
|
20
|
+
.button-lunatic {
|
|
21
|
+
background-color: var(--color-primary-dark);
|
|
22
|
+
color: var(--color-very-very-light);
|
|
23
|
+
&:hover {
|
|
24
|
+
background-color: var(--color-primary-main);
|
|
25
|
+
color: white;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
// Import index once for bundle
|
|
2
|
-
@import '../../../index.scss';
|
|
3
|
-
|
|
4
|
-
.lunatic-component-container-test {
|
|
5
|
-
display: flex;
|
|
6
|
-
|
|
7
|
-
.lunatic-component-body {
|
|
8
|
-
width: 80%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* Tooltip container */
|
|
12
|
-
.tooltip-lunatic {
|
|
13
|
-
margin: auto;
|
|
14
|
-
width: 20%;
|
|
15
|
-
position: relative;
|
|
16
|
-
display: block;
|
|
17
|
-
margin-left: auto;
|
|
18
|
-
margin-right: auto;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/* Tooltip text */
|
|
22
|
-
.tooltip-lunatic .tooltip-text {
|
|
23
|
-
min-width: 10em;
|
|
24
|
-
max-width: 20em;
|
|
25
|
-
background-color: var(--color-primary-dark);
|
|
26
|
-
color: #fff;
|
|
27
|
-
padding: 0.5em;
|
|
28
|
-
border-radius: 6px;
|
|
29
|
-
font-size: 1em;
|
|
30
|
-
&.place-left {
|
|
31
|
-
&::before {
|
|
32
|
-
border-left: 10px solid var(--color-primary-dark);
|
|
33
|
-
}
|
|
34
|
-
&::after {
|
|
35
|
-
content: none;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
// Import index once for bundle
|
|
2
|
+
@import '../../../index.scss';
|
|
3
|
+
|
|
4
|
+
.lunatic-component-container-test {
|
|
5
|
+
display: flex;
|
|
6
|
+
|
|
7
|
+
.lunatic-component-body {
|
|
8
|
+
width: 80%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* Tooltip container */
|
|
12
|
+
.tooltip-lunatic {
|
|
13
|
+
margin: auto;
|
|
14
|
+
width: 20%;
|
|
15
|
+
position: relative;
|
|
16
|
+
display: block;
|
|
17
|
+
margin-left: auto;
|
|
18
|
+
margin-right: auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Tooltip text */
|
|
22
|
+
.tooltip-lunatic .tooltip-text {
|
|
23
|
+
min-width: 10em;
|
|
24
|
+
max-width: 20em;
|
|
25
|
+
background-color: var(--color-primary-dark);
|
|
26
|
+
color: #fff;
|
|
27
|
+
padding: 0.5em;
|
|
28
|
+
border-radius: 6px;
|
|
29
|
+
font-size: 1em;
|
|
30
|
+
&.place-left {
|
|
31
|
+
&::before {
|
|
32
|
+
border-left: 10px solid var(--color-primary-dark);
|
|
33
|
+
}
|
|
34
|
+
&::after {
|
|
35
|
+
content: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.lunatic-icon {
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: center;
|
|
4
|
-
}
|
|
1
|
+
.lunatic-icon {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
}
|
|
@@ -23,6 +23,12 @@ Object.defineProperty(exports, "DefaultOptionRenderer", {
|
|
|
23
23
|
return _defaultOptionRenderer["default"];
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
+
Object.defineProperty(exports, "Errors", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _errors["default"];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
26
32
|
Object.defineProperty(exports, "FieldContainer", {
|
|
27
33
|
enumerable: true,
|
|
28
34
|
get: function get() {
|
|
@@ -147,6 +153,8 @@ var _safetyLabel = _interopRequireDefault(require("./safety-label"));
|
|
|
147
153
|
|
|
148
154
|
var _createLunaticComponent = _interopRequireDefault(require("./components/create-lunatic-component"));
|
|
149
155
|
|
|
156
|
+
var _errors = _interopRequireDefault(require("./components/errors"));
|
|
157
|
+
|
|
150
158
|
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); }
|
|
151
159
|
|
|
152
160
|
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; }
|
|
@@ -11,12 +11,11 @@ function useOnHandleChange(_ref) {
|
|
|
11
11
|
var handleChange = _ref.handleChange,
|
|
12
12
|
response = _ref.response,
|
|
13
13
|
value = _ref.value;
|
|
14
|
-
|
|
14
|
+
return (0, _react.useCallback)(function (valueOption) {
|
|
15
15
|
if (value !== valueOption) {
|
|
16
16
|
handleChange(response, valueOption);
|
|
17
17
|
}
|
|
18
18
|
}, [handleChange, response, value]);
|
|
19
|
-
return onHandlechange;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
var _default = useOnHandleChange;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
// see input.scss
|
|
1
|
+
// see input.scss
|
|
@@ -11,9 +11,24 @@ var _commons = require("../commons");
|
|
|
11
11
|
|
|
12
12
|
require("./datepicker.scss");
|
|
13
13
|
|
|
14
|
+
var _excluded = ["errors"];
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
17
|
|
|
16
|
-
var
|
|
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
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
var LunaticDatepicker = function LunaticDatepicker(_ref) {
|
|
23
|
+
var errors = _ref.errors,
|
|
24
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
+
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_datepicker["default"], props), /*#__PURE__*/React.createElement(_commons.Errors, {
|
|
27
|
+
errors: errors
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var _default = (0, _commons.createLunaticComponent)(LunaticDatepicker, {
|
|
17
32
|
inputId: 'lunatic-datepicker'
|
|
18
33
|
});
|
|
19
34
|
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.lunatic-component {
|
|
2
|
-
.lunatic-declarations {
|
|
3
|
-
margin-bottom: 0.4rem;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.declaration-instruction {
|
|
7
|
-
font-style: italic;
|
|
8
|
-
font-size: 80%;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.declaration-statement {
|
|
12
|
-
font-style: italic;
|
|
13
|
-
font-size: 80%;
|
|
14
|
-
color: blue;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.declaration-help {
|
|
18
|
-
font-style: italic;
|
|
19
|
-
font-size: 80%;
|
|
20
|
-
color: green;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.declaration-codecard {
|
|
24
|
-
font-style: bold;
|
|
25
|
-
font-size: 80%;
|
|
26
|
-
color: purple;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.declaration-message_filter {
|
|
30
|
-
font-size: 100%;
|
|
31
|
-
color: rgb(73, 66, 66);
|
|
32
|
-
&:before {
|
|
33
|
-
content: '→ ';
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
.lunatic-component {
|
|
2
|
+
.lunatic-declarations {
|
|
3
|
+
margin-bottom: 0.4rem;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.declaration-instruction {
|
|
7
|
+
font-style: italic;
|
|
8
|
+
font-size: 80%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.declaration-statement {
|
|
12
|
+
font-style: italic;
|
|
13
|
+
font-size: 80%;
|
|
14
|
+
color: blue;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.declaration-help {
|
|
18
|
+
font-style: italic;
|
|
19
|
+
font-size: 80%;
|
|
20
|
+
color: green;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.declaration-codecard {
|
|
24
|
+
font-style: bold;
|
|
25
|
+
font-size: 80%;
|
|
26
|
+
color: purple;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.declaration-message_filter {
|
|
30
|
+
font-size: 100%;
|
|
31
|
+
color: rgb(73, 66, 66);
|
|
32
|
+
&:before {
|
|
33
|
+
content: '→ ';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
@mixin defaultFont {
|
|
2
|
-
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
@mixin disableSelect {
|
|
6
|
-
-moz-user-select: none; /* Firefox */
|
|
7
|
-
-ms-user-select: none; /* Internet Explorer */
|
|
8
|
-
-khtml-user-select: none; /* KHTML browsers (e.g. Konqueror) */
|
|
9
|
-
-webkit-user-select: none; /* Chrome, Safari, and Opera */
|
|
10
|
-
-webkit-touch-callout: none; /* Disable Android and iOS callouts*/
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.lunatic-component {
|
|
14
|
-
.lunatic-dropdown {
|
|
15
|
-
.lunatic-dropdown-option {
|
|
16
|
-
text-overflow: ellipsis;
|
|
17
|
-
white-space: nowrap;
|
|
18
|
-
overflow: hidden;
|
|
19
|
-
margin-bottom: 0.1em;
|
|
20
|
-
line-height: 2rem;
|
|
21
|
-
display: block;
|
|
22
|
-
|
|
23
|
-
&.selected {
|
|
24
|
-
color: var(--color-primary-dark);
|
|
25
|
-
background-color: goldenrod;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&:hover {
|
|
29
|
-
background-color: var(--color-primary-main);
|
|
30
|
-
color: white;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.prefix {
|
|
34
|
-
color: red;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.normal {
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
1
|
+
@mixin defaultFont {
|
|
2
|
+
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@mixin disableSelect {
|
|
6
|
+
-moz-user-select: none; /* Firefox */
|
|
7
|
+
-ms-user-select: none; /* Internet Explorer */
|
|
8
|
+
-khtml-user-select: none; /* KHTML browsers (e.g. Konqueror) */
|
|
9
|
+
-webkit-user-select: none; /* Chrome, Safari, and Opera */
|
|
10
|
+
-webkit-touch-callout: none; /* Disable Android and iOS callouts*/
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.lunatic-component {
|
|
14
|
+
.lunatic-dropdown {
|
|
15
|
+
.lunatic-dropdown-option {
|
|
16
|
+
text-overflow: ellipsis;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
margin-bottom: 0.1em;
|
|
20
|
+
line-height: 2rem;
|
|
21
|
+
display: block;
|
|
22
|
+
|
|
23
|
+
&.selected {
|
|
24
|
+
color: var(--color-primary-dark);
|
|
25
|
+
background-color: goldenrod;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:hover {
|
|
29
|
+
background-color: var(--color-primary-main);
|
|
30
|
+
color: white;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.prefix {
|
|
34
|
+
color: red;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.normal {
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -23,8 +23,9 @@ function LunaticDropdown(_ref) {
|
|
|
23
23
|
disabled = _ref.disabled,
|
|
24
24
|
htmlFor = _ref.htmlFor,
|
|
25
25
|
labelId = _ref.labelId,
|
|
26
|
-
value = _ref.value
|
|
27
|
-
|
|
26
|
+
value = _ref.value,
|
|
27
|
+
errors = _ref.errors;
|
|
28
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_dropdown["default"], {
|
|
28
29
|
id: id,
|
|
29
30
|
htmlFor: id,
|
|
30
31
|
labelId: labelId,
|
|
@@ -35,7 +36,9 @@ function LunaticDropdown(_ref) {
|
|
|
35
36
|
onSelect: onChange,
|
|
36
37
|
value: value,
|
|
37
38
|
className: "lunatic-dropdown"
|
|
38
|
-
})
|
|
39
|
+
}), /*#__PURE__*/_react["default"].createElement(_commons.Errors, {
|
|
40
|
+
errors: errors
|
|
41
|
+
}));
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
LunaticDropdown.propTypes = {
|