@inseefr/lunatic 2.6.2 → 2.6.3
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/README.md +49 -3
- package/lib/components/checkbox/checkbox-boolean/html/checkbox-boolean.js +3 -3
- package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +7 -1
- package/lib/components/checkbox/checkbox-group/checkbox-group-content.js +0 -2
- package/lib/components/checkbox/checkbox-group/html/checkbox-group-content.js +4 -2
- package/lib/components/checkbox/checkbox-group/html/checkbox-group.js +3 -3
- package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +2 -1
- package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +2 -1
- package/lib/components/checkbox/commons/checkbox-option.js +3 -1
- package/lib/components/commons/components/combo-box/combo-box-container.js +1 -2
- package/lib/components/commons/components/combo-box/combo-box.js +2 -2
- package/lib/components/commons/components/combo-box/selection/LabelOrInput.js +3 -1
- package/lib/components/commons/components/combo-box/selection/input.js +3 -1
- package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
- package/lib/components/commons/components/errors/errors.js +12 -10
- package/lib/components/commons/components/errors/errors.spec.js +6 -6
- package/lib/components/component-set/html/__snapshots__/component-set.spec.tsx.snap +2 -0
- package/lib/components/component-set/html/component-set.js +2 -2
- package/lib/components/datepicker/html/__snapshots__/datepicker.spec.tsx.snap +2 -0
- package/lib/components/datepicker/html/datepicker-input.js +4 -2
- package/lib/components/datepicker/html/datepicker.js +3 -3
- package/lib/components/datepicker/lunatic-datepicker.js +2 -1
- package/lib/components/dropdown/lunatic-dropdown.js +2 -1
- package/lib/components/input/html/__snapshots__/input.spec.tsx.snap +2 -0
- package/lib/components/input/html/input.js +3 -3
- package/lib/components/input/lunatic-input.js +2 -1
- package/lib/components/input-number/html/__snapshots__/input-number.spec.tsx.snap +2 -2
- package/lib/components/input-number/html/input-number-thousand.js +4 -17
- package/lib/components/input-number/html/input-number.js +3 -5
- package/lib/components/input-number/lunatic-input-number.js +2 -3
- package/lib/components/lunatic-components.js +2 -11
- package/lib/components/radio/html/radio-group-content.js +4 -2
- package/lib/components/radio/html/radio-group.js +3 -3
- package/lib/components/radio/html/radio-option.js +3 -1
- package/lib/components/radio/lunatic-radio-group.js +2 -1
- package/lib/components/suggester/find-best-label/find-best-label.js +6 -6
- package/lib/components/suggester/idb-suggester/idb-suggester.js +4 -3
- package/lib/components/suggester/lunatic-suggester.js +7 -4
- package/lib/components/suggester/searching/create-searching.js +20 -39
- package/lib/components/switch/html/switch.js +2 -2
- package/lib/components/switch/lunatic-switch.js +2 -1
- package/lib/components/table/lunatic-table.js +2 -2
- package/lib/components/textarea/html/__snapshots__/textarea.spec.tsx.snap +2 -0
- package/lib/components/textarea/html/textarea.js +6 -4
- package/lib/components/textarea/lunatic-textarea.js +6 -3
- package/lib/hooks/use-auto-focus.js +26 -0
- package/lib/src/components/checkbox/checkbox-boolean/html/checkbox-boolean.d.ts +1 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group-content.d.ts +2 -1
- package/lib/src/components/checkbox/checkbox-group/html/checkbox-group.d.ts +1 -1
- package/lib/src/components/checkbox/commons/checkbox-option.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/combo-box.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +4 -6
- package/lib/src/components/commons/components/combo-box/selection/LabelOrInput.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/selection/input.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
- package/lib/src/components/commons/components/errors/errors.d.ts +6 -3
- package/lib/src/components/datepicker/html/datepicker-input.d.ts +2 -1
- package/lib/src/components/datepicker/html/datepicker.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown-writable/dropdown-writable.d.ts +1 -1
- package/lib/src/components/dropdown/html/dropdown.d.ts +3 -1
- package/lib/src/components/input/html/input.d.ts +2 -2
- package/lib/src/components/input-number/html/input-number-thousand.d.ts +2 -2
- package/lib/src/components/input-number/html/input-number.d.ts +2 -3
- package/lib/src/components/radio/html/radio-group-content.d.ts +2 -1
- package/lib/src/components/radio/html/radio-group.d.ts +1 -1
- package/lib/src/components/radio/html/radio-option.d.ts +1 -0
- package/lib/src/components/suggester/find-best-label/find-best-label.d.ts +1 -1
- package/lib/src/components/suggester/html/suggester.d.ts +1 -1
- package/lib/src/components/suggester/idb-suggester/idb-suggester.d.ts +5 -2
- package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
- package/lib/src/components/suggester/searching/create-searching.d.ts +1 -1
- package/lib/src/components/switch/html/switch.d.ts +1 -1
- package/lib/src/components/textarea/html/textarea.d.ts +3 -2
- package/lib/src/components/type.d.ts +4 -3
- package/lib/src/hooks/use-auto-focus.d.ts +6 -0
- package/lib/src/use-lunatic/actions.d.ts +3 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +418 -0
- package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +20 -0
- package/lib/src/use-lunatic/reducer/overview/overview-on-init.d.ts +1 -0
- package/lib/src/use-lunatic/type.d.ts +2 -1
- package/lib/src/use-lunatic/use-lunatic.d.ts +8 -5
- package/lib/src/use-lunatic/use-suggesters.d.ts +2 -1
- package/lib/src/utils/suggester-workers/append-to-index/create-append-task.d.ts +1 -1
- package/lib/src/utils/suggester-workers/worker-path.d.ts +6 -0
- package/lib/stories/behaviour/cleaning/source.json +151 -0
- package/lib/stories/behaviour/cleaning/test.stories.js +84 -0
- package/lib/stories/{questionnaires-test → behaviour}/controls/controls.stories.js +5 -5
- package/lib/stories/{questionnaires-test → behaviour/others}/test.stories.js +7 -7
- package/lib/stories/{paste-questionnaire → behaviour/paste}/test.stories.js +3 -3
- package/lib/stories/{resizing-questionnaire → behaviour/resizing}/test.stories.js +3 -3
- package/lib/use-lunatic/commons/fill-components/fill-component-required.js +23 -0
- package/lib/use-lunatic/commons/fill-components/fill-components.js +2 -1
- package/lib/use-lunatic/commons/fill-components/fill-from-state.js +2 -0
- package/lib/use-lunatic/initial-state.js +2 -1
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +7 -1
- package/lib/use-lunatic/reducer/reduce-handle-change/reduce-resizing.js +12 -3
- package/lib/use-lunatic/reducer/reduce-on-init.js +4 -2
- package/lib/use-lunatic/use-lunatic.js +19 -8
- package/lib/use-lunatic/use-lunatic.test.js +34 -2
- package/lib/use-lunatic/use-suggesters.js +4 -3
- package/lib/utils/suggester-workers/append-to-index/create-append-task.js +4 -3
- package/lib/utils/suggester-workers/worker-path.js +29 -0
- package/package.json +15 -10
- package/scripts/build/add-workers-to-public.js +44 -0
- package/scripts/build/workers-paths.js +44 -0
- package/workers-release/lunatic-append-worker-0.3.0-experimental.js +2 -0
- package/workers-release/lunatic-append-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
- package/workers-release/lunatic-label-worker-0.3.0-experimental.js +2 -0
- package/workers-release/lunatic-label-worker-0.3.0-experimental.js.LICENSE.txt +13 -0
- package/workers-release/lunatic-searching-worker-0.3.0-experimental.js +2 -0
- package/workers-release/lunatic-searching-worker-0.3.0-experimental.js.LICENSE.txt +34 -0
- package/lib/src/utils/store-tools/worker-path.d.ts +0 -1
- package/lib/utils/store-tools/worker-path.js +0 -13
- package/lib/utils/suggester-workers/create-worker.js +0 -55
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/boucles-n.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.stories.js +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_DeclarationsSimples.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_MinMaxSum_Boucles.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_QuestSimple_Boucles.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/V2_TCMRallyeGames.json +0 -0
- /package/lib/stories/{questionnaires-test → behaviour/others}/test-dylan.json +0 -0
- /package/lib/stories/{paste-questionnaire → behaviour/paste}/source.json +0 -0
- /package/lib/stories/{resizing-questionnaire → behaviour/resizing}/source.json +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Snowball JavaScript Library v0.3
|
|
3
|
+
* http://code.google.com/p/urim/
|
|
4
|
+
* http://snowball.tartarus.org/
|
|
5
|
+
*
|
|
6
|
+
* Copyright 2010, Oleg Mazko
|
|
7
|
+
* http://www.mozilla.org/MPL/
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*!
|
|
11
|
+
* array-last <https://github.com/jonschlinkert/array-last>
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
14
|
+
* Released under the MIT License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/*!
|
|
18
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
19
|
+
*
|
|
20
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
21
|
+
* Released under the MIT License.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getWorkerPath(): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getWorkerPath = getWorkerPath;
|
|
7
|
-
function getWorkerPath() {
|
|
8
|
-
var _ref, _process$env$LUNATIC_;
|
|
9
|
-
if ('LUNATIC_WORKER_PATH' in window) {
|
|
10
|
-
return window.LUNATIC_WORKER_PATH;
|
|
11
|
-
}
|
|
12
|
-
return (_ref = (_process$env$LUNATIC_ = process.env.LUNATIC_LOADER_WORKER_PATH) !== null && _process$env$LUNATIC_ !== void 0 ? _process$env$LUNATIC_ : process.env.REACT_APP_LUNATIC_LOADER_WORKER_PATH) !== null && _ref !== void 0 ? _ref : 'workers/lunatic-loader-worker-0.1.0.js';
|
|
13
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createWorker = void 0;
|
|
7
|
-
var _logger = require("../logger");
|
|
8
|
-
// Enable cross domain workers
|
|
9
|
-
|
|
10
|
-
var testSameOrigin = function testSameOrigin(url) {
|
|
11
|
-
var loc = window.location;
|
|
12
|
-
var a = document.createElement('a');
|
|
13
|
-
a.href = url;
|
|
14
|
-
return a.hostname === loc.hostname && a.port === loc.port && a.protocol === loc.protocol;
|
|
15
|
-
};
|
|
16
|
-
var createWorkerFallback = function createWorkerFallback(workerUrl) {
|
|
17
|
-
_logger.Logger.info('Create worker for MFE');
|
|
18
|
-
var worker = null;
|
|
19
|
-
try {
|
|
20
|
-
var blob;
|
|
21
|
-
try {
|
|
22
|
-
blob = new Blob(["importScripts('".concat(workerUrl, "');")], {
|
|
23
|
-
type: 'application/javascript'
|
|
24
|
-
});
|
|
25
|
-
} catch (e) {
|
|
26
|
-
var blobBuilder = new (window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder)();
|
|
27
|
-
blobBuilder.append("importScripts('".concat(workerUrl, "');"));
|
|
28
|
-
blob = blobBuilder.getBlob('application/javascript');
|
|
29
|
-
}
|
|
30
|
-
var url = window.URL || window.webkitURL;
|
|
31
|
-
var blobUrl = url.createObjectURL(blob);
|
|
32
|
-
worker = new Worker(blobUrl);
|
|
33
|
-
} catch (e1) {
|
|
34
|
-
console.error("Lunatic-worker : Failed to load web worker : ".concat(workerUrl));
|
|
35
|
-
}
|
|
36
|
-
return worker;
|
|
37
|
-
};
|
|
38
|
-
var createWorker = function createWorker(workerUrl) {
|
|
39
|
-
var worker = null;
|
|
40
|
-
try {
|
|
41
|
-
if (testSameOrigin(workerUrl)) {
|
|
42
|
-
worker = new Worker(workerUrl);
|
|
43
|
-
worker.onerror = function (event) {
|
|
44
|
-
event.preventDefault();
|
|
45
|
-
worker = createWorkerFallback(workerUrl);
|
|
46
|
-
};
|
|
47
|
-
} else {
|
|
48
|
-
worker = createWorkerFallback(workerUrl);
|
|
49
|
-
}
|
|
50
|
-
} catch (e) {
|
|
51
|
-
worker = createWorkerFallback(workerUrl);
|
|
52
|
-
}
|
|
53
|
-
return worker;
|
|
54
|
-
};
|
|
55
|
-
exports.createWorker = createWorker;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/lib/stories/{questionnaires-test → behaviour}/controls/controls-externes.stories.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|