@inseefr/lunatic 2.4.5-beta → 2.4.6-beta
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/commons/components/dragger/dragger.scss +7 -7
- package/lib/components/commons/components/is-network/use-online-status.spec.js +0 -4
- package/lib/components/commons/components/lunatic-component-without-label.js +4 -11
- package/lib/components/commons/components/md-label/md-label.js +2 -1
- package/lib/components/commons/components/orchestrated-component.js +3 -2
- package/lib/components/component-set/html/component-set-components.js +6 -2
- package/lib/components/component-set/lunatic-component-set.js +3 -1
- package/lib/components/declarations/declarations.spec.js +0 -1
- package/lib/components/dropdown/html/dropdown-simple/simple-label-renderer.js +1 -1
- package/lib/components/dropdown/html/dropdown-simple/simple-option-renderer.js +5 -7
- package/lib/components/dropdown/html/dropdown-writable/writable-label-renderer.js +1 -1
- package/lib/components/dropdown/html/dropdown-writable/writable-option-renderer.js +1 -1
- package/lib/components/dropdown/html/dropdown.scss +0 -3
- package/lib/components/index.js +14 -0
- package/lib/components/loop/roster-for-loop/roster-table.js +0 -1
- package/lib/components/loop/roster-for-loop/roster.scss +0 -3
- package/lib/components/modal-controls/modal-controls.spec.js +0 -14
- package/lib/components/pairwise-links/pairwise-links.js +0 -1
- package/lib/components/questions/question-context.js +21 -7
- package/lib/components/questions/question-context.scss +1 -0
- package/lib/components/questions/question-information.js +19 -5
- package/lib/components/questions/question-information.scss +1 -0
- package/lib/components/roundabout/components/roundabout.scss +0 -3
- package/lib/components/sequence/html/sequence.js +8 -3
- package/lib/components/sequence/lunatic-sequence.js +1 -5
- package/lib/components/sequence/sequence.spec.js +0 -3
- package/lib/components/suggester/html/default-style.scss +1 -6
- package/lib/components/suggester/idb-suggester/check-store.js +2 -1
- package/lib/components/suggester-loader-widget/loader-row.js +2 -1
- package/lib/components/switch/html/switch.scss +0 -2
- package/lib/components/switch/lunatic-switch.js +1 -1
- package/lib/src/components/commons/components/lunatic-component-without-label.d.ts +1 -1
- package/lib/src/components/commons/components/orchestrated-component.d.ts +1 -1
- package/lib/src/components/commons/create-row-orchestrator.d.ts +2 -2
- package/lib/src/components/component-set/html/component-set-components.d.ts +3 -2
- package/lib/src/components/index.d.ts +2 -0
- package/lib/src/components/loop/commons/handle-row-button.d.ts +1 -2
- package/lib/src/components/questions/question-context.d.ts +1 -2
- package/lib/src/components/questions/question-information.d.ts +1 -2
- package/lib/src/components/sequence/html/sequence.d.ts +1 -1
- package/lib/src/components/sequence/lunatic-sequence.d.ts +1 -1
- package/lib/src/components/suggester/idb-suggester/suggester-notification.d.ts +1 -3
- package/lib/src/components/type.d.ts +2 -3
- package/lib/src/hooks/use-ref-sync.d.ts +1 -1
- package/lib/src/use-lunatic/reducer/commons/resize-array-variable.d.ts +1 -1
- package/lib/src/utils/logger.d.ts +6 -0
- package/lib/stories/component-set/data2.json +7 -0
- package/lib/stories/component-set/source2.json +31 -31
- package/lib/stories/custom-mui/suggester-mui/suggester-mui.js +0 -1
- package/lib/stories/input/input.stories.js +9 -1
- package/lib/stories/input/source-with-question.json +74 -0
- package/lib/stories/questionnaires/simpsons/simpsons.stories.js +2 -1
- package/lib/stories/sequence/sequence.stories.js +1 -8
- package/lib/stories/sequence/source-declarations.json +9 -0
- package/lib/stories/suggester/suggester-workers.stories.js +6 -5
- package/lib/stories/suggester/suggester.stories.js +0 -1
- package/lib/stories/utils/orchestrator.js +4 -3
- package/lib/use-lunatic/commons/calculated-variables.js +1 -1
- package/lib/use-lunatic/commons/compile-controls.js +1 -1
- package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +1 -4
- package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +1 -1
- package/lib/use-lunatic/commons/load-suggesters.js +46 -46
- package/lib/utils/logger.js +44 -0
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -1
- package/lib/utils/suggester-workers/create-worker-ts.js +2 -1
- package/lib/utils/suggester-workers/create-worker.js +2 -1
- package/package.json +1 -1
- package/lib/components/questions/type.js +0 -5
- package/lib/src/components/questions/type.d.ts +0 -4
- package/lib/stories/sequence/source-questions.json +0 -19
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Logger = void 0;
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
+
var Logger = /*#__PURE__*/function () {
|
|
14
|
+
function Logger() {
|
|
15
|
+
_classCallCheck(this, Logger);
|
|
16
|
+
}
|
|
17
|
+
_createClass(Logger, null, [{
|
|
18
|
+
key: "info",
|
|
19
|
+
value: function info() {
|
|
20
|
+
var _console;
|
|
21
|
+
(_console = console).info.apply(_console, arguments);
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
key: "error",
|
|
25
|
+
value: function error() {
|
|
26
|
+
var _console2;
|
|
27
|
+
(_console2 = console).error.apply(_console2, arguments);
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
key: "log",
|
|
31
|
+
value: function log() {
|
|
32
|
+
var _console3;
|
|
33
|
+
(_console3 = console).log.apply(_console3, arguments);
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "warn",
|
|
37
|
+
value: function warn() {
|
|
38
|
+
var _console4;
|
|
39
|
+
(_console4 = console).warn.apply(_console4, arguments);
|
|
40
|
+
}
|
|
41
|
+
}]);
|
|
42
|
+
return Logger;
|
|
43
|
+
}();
|
|
44
|
+
exports.Logger = Logger;
|
|
@@ -5,13 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.createAppendTask = createAppendTask;
|
|
7
7
|
var _createWorkerTs = require("../create-worker-ts");
|
|
8
|
+
var _logger = require("../../logger");
|
|
8
9
|
var workerPath = process.env.LUNATIC_LOADER_WORKER_PATH || process.env.REACT_APP_LUNATIC_LOADER_WORKER_PATH || 'workers/lunatic-loader-worker-0.1.0.js';
|
|
9
10
|
function consoleLogging() {
|
|
10
11
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
11
12
|
args[_key] = arguments[_key];
|
|
12
13
|
}
|
|
13
14
|
args.forEach(function (any) {
|
|
14
|
-
|
|
15
|
+
_logger.Logger.log("suggester: ".concat(JSON.stringify(any)));
|
|
15
16
|
});
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createWorker = void 0;
|
|
7
|
+
var _logger = require("../logger");
|
|
7
8
|
// Enable cross domain workers
|
|
8
9
|
|
|
9
10
|
var testSameOrigin = function testSameOrigin(url) {
|
|
@@ -13,7 +14,7 @@ var testSameOrigin = function testSameOrigin(url) {
|
|
|
13
14
|
return a.hostname === loc.hostname && a.port === loc.port && a.protocol === loc.protocol;
|
|
14
15
|
};
|
|
15
16
|
var createWorkerFallback = function createWorkerFallback(workerUrl) {
|
|
16
|
-
|
|
17
|
+
_logger.Logger.info('Create worker for MFE');
|
|
17
18
|
var worker = null;
|
|
18
19
|
try {
|
|
19
20
|
var blob;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createWorker = void 0;
|
|
7
|
+
var _logger = require("../logger");
|
|
7
8
|
// Enable cross domain workers
|
|
8
9
|
|
|
9
10
|
var testSameOrigin = function testSameOrigin(url) {
|
|
@@ -13,7 +14,7 @@ var testSameOrigin = function testSameOrigin(url) {
|
|
|
13
14
|
return a.hostname === loc.hostname && a.port === loc.port && a.protocol === loc.protocol;
|
|
14
15
|
};
|
|
15
16
|
var createWorkerFallback = function createWorkerFallback(workerUrl) {
|
|
16
|
-
|
|
17
|
+
_logger.Logger.info('Create worker for MFE');
|
|
17
18
|
var worker = null;
|
|
18
19
|
try {
|
|
19
20
|
var blob;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"maxPages": "1",
|
|
3
|
-
"components": [
|
|
4
|
-
{
|
|
5
|
-
"componentType": "Sequence",
|
|
6
|
-
"page": "1",
|
|
7
|
-
"conditionFilter": { "value": "true", "type": "VTL" },
|
|
8
|
-
"label": { "value": "\"Sequence example\"", "type": "VTL|MD" },
|
|
9
|
-
"questionInformation": {
|
|
10
|
-
"value": "\"Question Information\"",
|
|
11
|
-
"type": "VTL|MD"
|
|
12
|
-
},
|
|
13
|
-
"questionContext": {
|
|
14
|
-
"value": "\"Question Context\"",
|
|
15
|
-
"type": "VTL|MD"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|