@inseefr/lunatic 0.2.2-experimental → 0.2.3-prisme
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 -23
- package/lib/index.js +1191 -475
- package/lib/index.js.map +1 -1
- package/package.json +174 -172
- package/src/components/breadcrumb/breadcrumb.scss +22 -22
- package/src/components/checkbox/boolean.js +172 -172
- package/src/components/checkbox/checkbox.scss +73 -73
- package/src/components/checkbox/group.js +231 -231
- package/src/components/checkbox/one.js +11 -11
- package/src/components/component-wrapper/controls/component.js +70 -0
- package/src/components/component-wrapper/controls/controls.scss +6 -0
- package/src/components/component-wrapper/controls/index.js +1 -0
- package/src/components/component-wrapper/controls/validators/datepicker.js +44 -0
- package/src/components/component-wrapper/controls/validators/index.js +16 -0
- package/src/components/component-wrapper/controls/validators/input-number.js +23 -0
- package/src/components/{missing-wrapper → component-wrapper}/index.js +0 -0
- package/src/components/component-wrapper/missing/component.js +200 -0
- package/src/components/component-wrapper/missing/index.js +1 -0
- package/src/components/{missing-wrapper → component-wrapper/missing}/missing.scss +32 -32
- package/src/components/component-wrapper/wrapper.js +23 -0
- package/src/components/components.js +1 -0
- package/src/components/datepicker/component.js +26 -11
- package/src/components/declarations/component.js +46 -46
- package/src/components/declarations/declarations.scss +40 -40
- package/src/components/declarations/wrappers/input-declarations-wrapper.js +328 -274
- package/src/components/declarations/wrappers/simple-declarations-wrapper.js +54 -54
- package/src/components/dropdown/commons/actions.js +65 -56
- package/src/components/dropdown/commons/children-to-option.js +9 -9
- package/src/components/dropdown/commons/cleaner-callbacks.js +58 -58
- package/src/components/dropdown/commons/components/dropdown-container.js +29 -29
- package/src/components/dropdown/commons/components/dropdown.js +204 -183
- package/src/components/dropdown/commons/event-callbacks/on-mousedown-callback.js +15 -15
- package/src/components/dropdown/commons/reducer.js +3 -0
- package/src/components/dropdown/commons/tools/index.js +17 -17
- package/src/components/dropdown/component.js +135 -135
- package/src/components/dropdown/dropdown-edit/dropdown-edit.js +194 -185
- package/src/components/dropdown/dropdown-edit/index.js +11 -11
- package/src/components/dropdown/dropdown-simple/dropdown.js +173 -164
- package/src/components/dropdown/dropdown-simple/index.js +20 -20
- package/src/components/dropdown/dropdown.scss +178 -178
- package/src/components/icon/icon.scss +15 -15
- package/src/components/index.js +2 -0
- package/src/components/index.scss +177 -175
- package/src/components/input/input-number.js +30 -54
- package/src/components/input/input.js +11 -11
- package/src/components/input/input.scss +31 -37
- package/src/components/loop/component.js +170 -169
- package/src/components/loop/loop.scss +13 -13
- package/src/components/loop/wrapper.js +1 -1
- package/src/components/loop-constructor/block/block.scss +10 -10
- package/src/components/loop-constructor/block/component.js +9 -9
- package/src/components/loop-constructor/roster/component.js +8 -8
- package/src/components/loop-constructor/wrapper/body-component.js +146 -125
- package/src/components/modal/component.js +36 -0
- package/src/components/modal/index.js +1 -0
- package/src/components/modal/modal.scss +33 -0
- package/src/components/progress-bar/progress-bar.scss +54 -54
- package/src/components/radio/component.js +9 -9
- package/src/components/radio/radio.scss +59 -59
- package/src/components/sequence/component.js +50 -50
- package/src/components/sequence/sequence.scss +10 -10
- package/src/components/subsequence/component.js +49 -49
- package/src/components/suggester/check-store.js +2 -4
- package/src/components/suggester/components/panel/default-option-renderer.js +27 -27
- package/src/components/suggester/components/panel/option-container.js +61 -61
- package/src/components/suggester/components/panel/panel.js +47 -47
- package/src/components/suggester/components/selection/default-label-renderer.js +31 -31
- package/src/components/suggester/components/selection/label.js +35 -35
- package/src/components/suggester/components/selection/selection.js +50 -50
- package/src/components/suggester/components/suggester-content.js +2 -2
- package/src/components/suggester/components/suggester.js +128 -88
- package/src/components/suggester/components/suggester.scss +101 -101
- package/src/components/suggester/default-style.scss +125 -125
- package/src/components/suggester/find-best-label/find-best-label.js +51 -49
- package/src/components/suggester/find-best-label/index.js +1 -1
- package/src/components/suggester/idb-suggester.js +73 -67
- package/src/components/suggester/lunatic-suggester.js +140 -137
- package/src/components/suggester/searching/create-searching.js +49 -47
- package/src/components/suggester/searching/index.js +1 -1
- package/src/components/suggester/state-management/actions.js +38 -38
- package/src/components/suggester/state-management/reducer/reduce-on-delete-search.js +11 -11
- package/src/components/suggester/state-management/reducer/reduce-on-init.js +29 -29
- package/src/components/suggester/state-management/reducer/reducer.js +38 -38
- package/src/components/suggester/suggester-wrapper.js +127 -121
- package/src/components/suggester-loader-widget/loader.js +67 -67
- package/src/components/suggester-loader-widget/widget.js +123 -123
- package/src/components/table/table.js +173 -171
- package/src/components/table/table.scss +26 -26
- package/src/components/textarea/component.js +11 -11
- package/src/components/textarea/textarea.scss +8 -8
- package/src/components/tooltip/tooltip.scss +30 -30
- package/src/stories/checkbox-boolean/data.json +78 -78
- package/src/stories/datepicker/data.json +3 -1
- package/src/stories/dropdown/README.md +44 -44
- package/src/stories/dropdown/data.json +98 -98
- package/src/stories/dropdown/dropdown.stories.js +89 -89
- package/src/stories/progress-bar/progress-bar.stories.js +24 -24
- package/src/stories/questionnaire/arithmetic-management.json +47 -0
- package/src/stories/questionnaire/arithmetic.json +247 -247
- package/src/stories/questionnaire/kish.json +275 -0
- package/src/stories/questionnaire/logement-queen.json +23390 -0
- package/src/stories/questionnaire/logement-s2.json +46028 -0
- package/src/stories/questionnaire/logement.json +20347 -26087
- package/src/stories/questionnaire/loop-and-controls.json +481 -0
- package/src/stories/questionnaire/questionnaire.stories.js +236 -138
- package/src/stories/questionnaire/update-external/data.json +1 -0
- package/src/stories/questionnaire/update-external/questionnaire.json +75 -0
- package/src/stories/suggester/README.md +46 -46
- package/src/stories/suggester/bailleurs-sociaux/fetch-bailleurs.js +15 -15
- package/src/stories/suggester/bailleurs-sociaux/index.js +2 -2
- package/src/stories/suggester/bailleurs-sociaux/option-bailleur-renderer.js +58 -58
- package/src/stories/suggester/bailleurs-sociaux/preloader.svg +51 -51
- package/src/stories/suggester/bailleurs-sociaux/theme.scss +22 -22
- package/src/stories/suggester/bailleurs-sociaux-2021/fetch-bailleurs.js +12 -0
- package/src/stories/suggester/bailleurs-sociaux-2021/index.js +1 -0
- package/src/stories/suggester/cog-communes/fetch-cog.js +15 -15
- package/src/stories/suggester/data-auto.json +232 -231
- package/src/stories/suggester/data-vtl.json +82 -82
- package/src/stories/suggester/data.json +169 -136
- package/src/stories/suggester/naf-rev2/index.js +2 -2
- package/src/stories/suggester/naf-rev2/option-naf-renderer.js +17 -17
- package/src/stories/suggester/suggester-workers.stories.js +226 -179
- package/src/stories/suggester/suggester.stories.js +138 -133
- package/src/stories/utils/orchestrator-split.js +119 -0
- package/src/stories/utils/orchestrator.js +119 -108
- package/src/tests/components/input-number.spec.js +6 -12
- package/src/tests/components/missing-wrapper.spec.js +0 -1
- package/src/tests/utils/lib/table/roster.spec.js +25 -25
- package/src/tests/utils/to-expose/handler/results/res-input-edited.json +1 -1
- package/src/utils/components/dragger/dragger.scss +7 -7
- package/src/utils/idb-tools/create-db-opener.js +43 -43
- package/src/utils/idb-tools/create-open-db.js +25 -25
- package/src/utils/idb-tools/idb-bulk-insert.js +96 -96
- package/src/utils/idb-tools/index.js +10 -10
- package/src/utils/idb-tools/insert-entity.js +15 -15
- package/src/utils/idb-tools/open-db.js +13 -13
- package/src/utils/idb-tools/open-or-create-db.js +34 -34
- package/src/utils/lib/controls/index.js +1 -0
- package/src/utils/lib/controls/utils.js +152 -0
- package/src/utils/lib/decorator/title-decorator.js +16 -16
- package/src/utils/lib/env.js +2 -2
- package/src/utils/lib/index.js +2 -0
- package/src/utils/lib/input-number.js +1 -1
- package/src/utils/lib/options-positioning.js +9 -9
- package/src/utils/lib/pagination/navigation/shared.js +12 -9
- package/src/utils/lib/prop-types/lines.js +6 -6
- package/src/utils/lib/responses.js +11 -9
- package/src/utils/lib/splitting.js +142 -0
- package/src/utils/lib/style.js +10 -10
- package/src/utils/store-tools/auto-load.js +74 -73
- package/src/utils/suggester-workers/append-to-index/append.js +25 -25
- package/src/utils/suggester-workers/append-to-index/append.worker.js +16 -16
- package/src/utils/suggester-workers/append-to-index/create-append-task.js +45 -43
- package/src/utils/suggester-workers/append-to-index/index.js +2 -2
- package/src/utils/suggester-workers/append-to-index/prepare-entities.js +61 -61
- package/src/utils/suggester-workers/append-to-index/store-messages.js +21 -21
- package/src/utils/suggester-workers/commons-tokenizer/create-entity-tokenizer.js +56 -0
- package/src/utils/suggester-workers/commons-tokenizer/create-fields-tokenizer.js +56 -0
- package/src/utils/suggester-workers/commons-tokenizer/create-filter-stop-words.js +17 -17
- package/src/utils/suggester-workers/commons-tokenizer/filters/compose-filters.js +10 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.js +17 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/create-filter-stop-words.spec.js +14 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-accents.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/{filter-double.js → filters/filter-double.js} +12 -12
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-double.spec.js +20 -0
- package/src/utils/suggester-workers/commons-tokenizer/{filter-length.js → filters/filter-length.js} +7 -7
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-length.spec.js +18 -0
- package/src/utils/suggester-workers/commons-tokenizer/{filter-stemmer.js → filters/filter-stemmer.js} +13 -13
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-stemmer.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.js +36 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-synonyms.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.js +10 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/filter-to-lower.spec.js +12 -0
- package/src/utils/suggester-workers/commons-tokenizer/filters/index.js +2 -0
- package/src/utils/suggester-workers/commons-tokenizer/{stop-words.js → filters/stop-words.js} +118 -118
- package/src/utils/suggester-workers/commons-tokenizer/get-regexp-from-pattern.js +8 -8
- package/src/utils/suggester-workers/commons-tokenizer/get-stemmer.js +18 -18
- package/src/utils/suggester-workers/commons-tokenizer/index.js +9 -8
- package/src/utils/suggester-workers/commons-tokenizer/prepare-string-indexation.js +13 -9
- package/src/utils/suggester-workers/commons-tokenizer/soft-tokenizer.js +7 -7
- package/src/utils/suggester-workers/create-worker.js +56 -0
- package/src/utils/suggester-workers/find-best-label/find-best-label.js +39 -39
- package/src/utils/suggester-workers/find-best-label/find-best-label.worker.js +40 -40
- package/src/utils/suggester-workers/find-best-label/tokenize.js +30 -33
- package/src/utils/suggester-workers/find-best-label/tokenize.spec.js +19 -19
- package/src/utils/suggester-workers/searching/compute-score.js +33 -33
- package/src/utils/suggester-workers/searching/get-db.js +18 -18
- package/src/utils/suggester-workers/searching/index.js +1 -1
- package/src/utils/suggester-workers/searching/order/create-alphanumeric-orderer.js +20 -20
- package/src/utils/suggester-workers/searching/order/index.js +19 -19
- package/src/utils/suggester-workers/{query-parser → searching/query-parser}/index.js +2 -2
- package/src/utils/suggester-workers/searching/query-parser/query-parser-soft.js +7 -0
- package/src/utils/suggester-workers/{query-parser → searching/query-parser}/query-parser-soft.spec.js +24 -24
- package/src/utils/suggester-workers/searching/query-parser/query-parser-tokenized.js +34 -0
- package/src/utils/suggester-workers/searching/resolve-query-parser.js +27 -27
- package/src/utils/suggester-workers/searching/search-in-index.js +17 -17
- package/src/utils/suggester-workers/searching/searching.js +70 -70
- package/src/utils/suggester-workers/searching/searching.worker.js +11 -11
- package/src/utils/to-expose/calculated-variables.js +113 -113
- package/src/utils/to-expose/handler.js +149 -112
- package/src/utils/to-expose/hooks/filter-components.js +27 -12
- package/src/utils/to-expose/hooks/index.js +2 -1
- package/src/utils/to-expose/hooks/lunatic-split.js +428 -0
- package/src/utils/to-expose/hooks/lunatic.js +284 -187
- package/src/utils/to-expose/index.js +1 -1
- package/src/utils/to-expose/init-questionnaire.js +164 -164
- package/src/utils/to-expose/interpret/vtl.js +18 -18
- package/src/utils/to-expose/state.js +66 -58
- package/src/components/missing-wrapper/component.js +0 -120
- package/src/components/missing-wrapper/wrapper.js +0 -10
- package/src/tests/utils/to-expose/hooks/use-lunatic.spec.js +0 -46
- package/src/utils/suggester-workers/commons-tokenizer/create-tokenizer.js +0 -103
- package/src/utils/suggester-workers/commons-tokenizer/filter-accents-to-lower.js +0 -9
- package/src/utils/suggester-workers/commons-tokenizer/filter-synonyms.js +0 -10
- package/src/utils/suggester-workers/query-parser/query-parser-soft.js +0 -7
- package/src/utils/suggester-workers/query-parser/query-parser-tokenized.js +0 -31
- package/src/utils/suggester-workers/query-parser/query-parser-tokenized.spec.js +0 -32
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# Dropdown component
|
|
2
|
-
|
|
3
|
-
## Props
|
|
4
|
-
|
|
5
|
-
| Props | Type | Default value | Required | Description |
|
|
6
|
-
| :--------------: | :----: | :-----------: | :------: | ---------------------------------------------------- |
|
|
7
|
-
| id | string | - | ✓ | Id of the dropdown |
|
|
8
|
-
| label | string | "" | | Label of the dropdown |
|
|
9
|
-
| preferences \* | array | ["COLLECTED"] | | Preferences to manage dropdown response |
|
|
10
|
-
| response \* | object | {} | | Response concerned by the component |
|
|
11
|
-
| options \* | array | - | ✓ | Options of the dropdown |
|
|
12
|
-
| handleChange | func | - | ✓ | Handler of the dropdown |
|
|
13
|
-
| placeholderList | string | "" | | Placeholder of the dropdown |
|
|
14
|
-
| disabled | bool | false | | Is the dropdown disabled |
|
|
15
|
-
| writable | bool | false | | Is the dropdown writable |
|
|
16
|
-
| mandatory | bool | false | | Is the dropdown mandatory |
|
|
17
|
-
| widthAuto | bool | false | | Add the width-auto props for options of the Dropdown |
|
|
18
|
-
| labelPosition \* | string | "DEFAULT" | | Position of the dropdown label |
|
|
19
|
-
| declarations \* | array | [] | | Declarations of the dropdown |
|
|
20
|
-
| features | array | [ ] | | Component features for labels |
|
|
21
|
-
| bindings | object | [ ] | | Questionnaire bindings |
|
|
22
|
-
| management | bool | false | | Management mode of the dropdown |
|
|
23
|
-
| zIndex | number | 0 | | z-index of the dropdown |
|
|
24
|
-
| style | object | {} | | Style of the dropdown |
|
|
25
|
-
|
|
26
|
-
- `preferences` props has to be an ordered array of `COLLECTED`, `FORCED` or `EDITED`
|
|
27
|
-
- `response` props has to be a shape of `{name: string, values: object}`
|
|
28
|
-
- `options` props has to be an array made by objects with a shape of `{label: string, value: string}`
|
|
29
|
-
- `labelPosition` props has to be one of `DEFAULT`, `TOP`, `BOTTOM`, `RIGHT` or `LEFT`
|
|
30
|
-
- `declarations` are documented in the `Declarations` component
|
|
31
|
-
|
|
32
|
-
## Styles
|
|
33
|
-
|
|
34
|
-
**Dropdown** component has cascade classes:
|
|
35
|
-
|
|
36
|
-
- `lunatic-dropdown`
|
|
37
|
-
- `lunatic-dropdown-container`
|
|
38
|
-
- `lunatic-dropdown-content`
|
|
39
|
-
- `lunatic-dropdown-input`
|
|
40
|
-
- `lunatic-icon`
|
|
41
|
-
- `lunatic-transition`
|
|
42
|
-
- `lunatic-dropdown-panel`
|
|
43
|
-
- `lunatic-dropdown-option`
|
|
44
|
-
- `lunatic-prefix`
|
|
1
|
+
# Dropdown component
|
|
2
|
+
|
|
3
|
+
## Props
|
|
4
|
+
|
|
5
|
+
| Props | Type | Default value | Required | Description |
|
|
6
|
+
| :--------------: | :----: | :-----------: | :------: | ---------------------------------------------------- |
|
|
7
|
+
| id | string | - | ✓ | Id of the dropdown |
|
|
8
|
+
| label | string | "" | | Label of the dropdown |
|
|
9
|
+
| preferences \* | array | ["COLLECTED"] | | Preferences to manage dropdown response |
|
|
10
|
+
| response \* | object | {} | | Response concerned by the component |
|
|
11
|
+
| options \* | array | - | ✓ | Options of the dropdown |
|
|
12
|
+
| handleChange | func | - | ✓ | Handler of the dropdown |
|
|
13
|
+
| placeholderList | string | "" | | Placeholder of the dropdown |
|
|
14
|
+
| disabled | bool | false | | Is the dropdown disabled |
|
|
15
|
+
| writable | bool | false | | Is the dropdown writable |
|
|
16
|
+
| mandatory | bool | false | | Is the dropdown mandatory |
|
|
17
|
+
| widthAuto | bool | false | | Add the width-auto props for options of the Dropdown |
|
|
18
|
+
| labelPosition \* | string | "DEFAULT" | | Position of the dropdown label |
|
|
19
|
+
| declarations \* | array | [] | | Declarations of the dropdown |
|
|
20
|
+
| features | array | [ ] | | Component features for labels |
|
|
21
|
+
| bindings | object | [ ] | | Questionnaire bindings |
|
|
22
|
+
| management | bool | false | | Management mode of the dropdown |
|
|
23
|
+
| zIndex | number | 0 | | z-index of the dropdown |
|
|
24
|
+
| style | object | {} | | Style of the dropdown |
|
|
25
|
+
|
|
26
|
+
- `preferences` props has to be an ordered array of `COLLECTED`, `FORCED` or `EDITED`
|
|
27
|
+
- `response` props has to be a shape of `{name: string, values: object}`
|
|
28
|
+
- `options` props has to be an array made by objects with a shape of `{label: string, value: string}`
|
|
29
|
+
- `labelPosition` props has to be one of `DEFAULT`, `TOP`, `BOTTOM`, `RIGHT` or `LEFT`
|
|
30
|
+
- `declarations` are documented in the `Declarations` component
|
|
31
|
+
|
|
32
|
+
## Styles
|
|
33
|
+
|
|
34
|
+
**Dropdown** component has cascade classes:
|
|
35
|
+
|
|
36
|
+
- `lunatic-dropdown`
|
|
37
|
+
- `lunatic-dropdown-container`
|
|
38
|
+
- `lunatic-dropdown-content`
|
|
39
|
+
- `lunatic-dropdown-input`
|
|
40
|
+
- `lunatic-icon`
|
|
41
|
+
- `lunatic-transition`
|
|
42
|
+
- `lunatic-dropdown-panel`
|
|
43
|
+
- `lunatic-dropdown-option`
|
|
44
|
+
- `lunatic-prefix`
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
{
|
|
2
|
-
"components": [
|
|
3
|
-
{
|
|
4
|
-
"id": "j4nw5cqz",
|
|
5
|
-
"componentType": "Dropdown",
|
|
6
|
-
"mandatory": false,
|
|
7
|
-
"label": "In which state do The Simpsons reside?",
|
|
8
|
-
"response": {
|
|
9
|
-
"name": "STATE"
|
|
10
|
-
},
|
|
11
|
-
"declarations": [
|
|
12
|
-
{
|
|
13
|
-
"id": "d1",
|
|
14
|
-
"declarationType": "COMMENT",
|
|
15
|
-
"position": "BEFORE_QUESTION_TEXT",
|
|
16
|
-
"label": "Test declaration before"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "d2",
|
|
20
|
-
"declarationType": "COMMENT",
|
|
21
|
-
"position": "AFTER_QUESTION_TEXT",
|
|
22
|
-
"label": "Test declaration after"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"id": "d3",
|
|
26
|
-
"declarationType": "COMMENT",
|
|
27
|
-
"position": "DETACHABLE",
|
|
28
|
-
"label": "Test detachable declaration"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"options": [
|
|
32
|
-
{ "value": "1", "label": "Washington" },
|
|
33
|
-
{ "value": "2", "label": "Kentucky" },
|
|
34
|
-
{ "value": "3", "label": "Ohio" },
|
|
35
|
-
{ "value": "4", "label": "Maine" },
|
|
36
|
-
{ "value": "5", "label": "North Dakota" },
|
|
37
|
-
{ "value": "6", "label": "Florida" },
|
|
38
|
-
{ "value": "7", "label": "North Takoma" },
|
|
39
|
-
{ "value": "8", "label": "California" },
|
|
40
|
-
{ "value": "9", "label": "Texas" },
|
|
41
|
-
{ "value": "10", "label": "Massachusetts" },
|
|
42
|
-
{ "value": "11", "label": "Nevada" },
|
|
43
|
-
{ "value": "12", "label": "Illinois" },
|
|
44
|
-
{ "value": "13", "label": "Not in any state, you fool!" }
|
|
45
|
-
]
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"id": "j4nw5cqz-bis",
|
|
49
|
-
"componentType": "Dropdown",
|
|
50
|
-
"mandatory": false,
|
|
51
|
-
"label": "In which state do The Simpsons reside?",
|
|
52
|
-
"response": {
|
|
53
|
-
"name": "STATE2"
|
|
54
|
-
},
|
|
55
|
-
"options": [
|
|
56
|
-
{ "value": "1", "label": "Washington" },
|
|
57
|
-
{ "value": "2", "label": "Kentucky" },
|
|
58
|
-
{ "value": "3", "label": "Ohio" },
|
|
59
|
-
{ "value": "4", "label": "Maine" },
|
|
60
|
-
{ "value": "5", "label": "North Dakota" },
|
|
61
|
-
{ "value": "6", "label": "Florida" },
|
|
62
|
-
{ "value": "7", "label": "North Takoma" },
|
|
63
|
-
{ "value": "8", "label": "California" },
|
|
64
|
-
{ "value": "9", "label": "Texas" },
|
|
65
|
-
{ "value": "10", "label": "Massachusetts" },
|
|
66
|
-
{ "value": "11", "label": "Nevada" },
|
|
67
|
-
{ "value": "12", "label": "Illinois" },
|
|
68
|
-
{ "value": "13", "label": "Not in any state, you fool!" }
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"variables": [
|
|
73
|
-
{
|
|
74
|
-
"variableType": "COLLECTED",
|
|
75
|
-
"name": "STATE",
|
|
76
|
-
"componentRef": "j4nw5cqz",
|
|
77
|
-
"values": {
|
|
78
|
-
"PREVIOUS": null,
|
|
79
|
-
"COLLECTED": "2",
|
|
80
|
-
"FORCED": "3",
|
|
81
|
-
"EDITED": null,
|
|
82
|
-
"INPUTED": null
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"variableType": "COLLECTED",
|
|
87
|
-
"name": "STATE2",
|
|
88
|
-
"componentRef": "j4nw5cqz-bis",
|
|
89
|
-
"values": {
|
|
90
|
-
"PREVIOUS": null,
|
|
91
|
-
"COLLECTED": "3",
|
|
92
|
-
"FORCED": "2",
|
|
93
|
-
"EDITED": null,
|
|
94
|
-
"INPUTED": null
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"id": "j4nw5cqz",
|
|
5
|
+
"componentType": "Dropdown",
|
|
6
|
+
"mandatory": false,
|
|
7
|
+
"label": "In which state do The Simpsons reside?",
|
|
8
|
+
"response": {
|
|
9
|
+
"name": "STATE"
|
|
10
|
+
},
|
|
11
|
+
"declarations": [
|
|
12
|
+
{
|
|
13
|
+
"id": "d1",
|
|
14
|
+
"declarationType": "COMMENT",
|
|
15
|
+
"position": "BEFORE_QUESTION_TEXT",
|
|
16
|
+
"label": "Test declaration before"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "d2",
|
|
20
|
+
"declarationType": "COMMENT",
|
|
21
|
+
"position": "AFTER_QUESTION_TEXT",
|
|
22
|
+
"label": "Test declaration after"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "d3",
|
|
26
|
+
"declarationType": "COMMENT",
|
|
27
|
+
"position": "DETACHABLE",
|
|
28
|
+
"label": "Test detachable declaration"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"options": [
|
|
32
|
+
{ "value": "1", "label": "Washington" },
|
|
33
|
+
{ "value": "2", "label": "Kentucky" },
|
|
34
|
+
{ "value": "3", "label": "Ohio" },
|
|
35
|
+
{ "value": "4", "label": "Maine" },
|
|
36
|
+
{ "value": "5", "label": "North Dakota" },
|
|
37
|
+
{ "value": "6", "label": "Florida" },
|
|
38
|
+
{ "value": "7", "label": "North Takoma" },
|
|
39
|
+
{ "value": "8", "label": "California" },
|
|
40
|
+
{ "value": "9", "label": "Texas" },
|
|
41
|
+
{ "value": "10", "label": "Massachusetts" },
|
|
42
|
+
{ "value": "11", "label": "Nevada" },
|
|
43
|
+
{ "value": "12", "label": "Illinois" },
|
|
44
|
+
{ "value": "13", "label": "Not in any state, you fool!" }
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "j4nw5cqz-bis",
|
|
49
|
+
"componentType": "Dropdown",
|
|
50
|
+
"mandatory": false,
|
|
51
|
+
"label": "In which state do The Simpsons reside?",
|
|
52
|
+
"response": {
|
|
53
|
+
"name": "STATE2"
|
|
54
|
+
},
|
|
55
|
+
"options": [
|
|
56
|
+
{ "value": "1", "label": "Washington" },
|
|
57
|
+
{ "value": "2", "label": "Kentucky" },
|
|
58
|
+
{ "value": "3", "label": "Ohio" },
|
|
59
|
+
{ "value": "4", "label": "Maine" },
|
|
60
|
+
{ "value": "5", "label": "North Dakota" },
|
|
61
|
+
{ "value": "6", "label": "Florida" },
|
|
62
|
+
{ "value": "7", "label": "North Takoma" },
|
|
63
|
+
{ "value": "8", "label": "California" },
|
|
64
|
+
{ "value": "9", "label": "Texas" },
|
|
65
|
+
{ "value": "10", "label": "Massachusetts" },
|
|
66
|
+
{ "value": "11", "label": "Nevada" },
|
|
67
|
+
{ "value": "12", "label": "Illinois" },
|
|
68
|
+
{ "value": "13", "label": "Not in any state, you fool!" }
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"variables": [
|
|
73
|
+
{
|
|
74
|
+
"variableType": "COLLECTED",
|
|
75
|
+
"name": "STATE",
|
|
76
|
+
"componentRef": "j4nw5cqz",
|
|
77
|
+
"values": {
|
|
78
|
+
"PREVIOUS": null,
|
|
79
|
+
"COLLECTED": "2",
|
|
80
|
+
"FORCED": "3",
|
|
81
|
+
"EDITED": null,
|
|
82
|
+
"INPUTED": null
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"variableType": "COLLECTED",
|
|
87
|
+
"name": "STATE2",
|
|
88
|
+
"componentRef": "j4nw5cqz-bis",
|
|
89
|
+
"values": {
|
|
90
|
+
"PREVIOUS": null,
|
|
91
|
+
"COLLECTED": "3",
|
|
92
|
+
"FORCED": "2",
|
|
93
|
+
"EDITED": null,
|
|
94
|
+
"INPUTED": null
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
@@ -1,89 +1,89 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
import { withReadme } from 'storybook-readme';
|
|
4
|
-
import Orchestrator from '../utils/orchestrator';
|
|
5
|
-
import readme from './README.md';
|
|
6
|
-
import { titleDecorator } from 'utils/lib';
|
|
7
|
-
import data from './data';
|
|
8
|
-
import dataProps from './data-props';
|
|
9
|
-
import dataForced from './data-forced';
|
|
10
|
-
import dataNAF from './data-naf';
|
|
11
|
-
import { labelPositionOptions, featuresOptions } from '../utils/options';
|
|
12
|
-
import {
|
|
13
|
-
text,
|
|
14
|
-
boolean,
|
|
15
|
-
select,
|
|
16
|
-
object,
|
|
17
|
-
number,
|
|
18
|
-
} from '@storybook/addon-knobs/react';
|
|
19
|
-
|
|
20
|
-
const stories = storiesOf('Dropdown', module)
|
|
21
|
-
.addDecorator(withReadme(readme))
|
|
22
|
-
.addDecorator((Component) => {
|
|
23
|
-
const WrappedComponent = titleDecorator(Component);
|
|
24
|
-
return <WrappedComponent title="<Dropdown />" />;
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
stories.addWithJSX('Default', () => (
|
|
28
|
-
<Orchestrator id="default" source={data} />
|
|
29
|
-
));
|
|
30
|
-
|
|
31
|
-
stories.addWithJSX('Props', () => (
|
|
32
|
-
<Orchestrator
|
|
33
|
-
id="props"
|
|
34
|
-
source={dataProps}
|
|
35
|
-
placeholderList={text('Placeholder', 'Placeholder')}
|
|
36
|
-
missing={boolean('Missing', false)}
|
|
37
|
-
features={select('Features', featuresOptions, ['VTL', 'MD'])}
|
|
38
|
-
bindings={object('Bindings', { NAME: 'Simpsons', TEXAS: 'Texas' })}
|
|
39
|
-
disabled={boolean('Disabled', false)}
|
|
40
|
-
focused={boolean('Focused', false)}
|
|
41
|
-
writable={boolean('Writable', false)}
|
|
42
|
-
widthAuto={boolean('Options auto width', false)}
|
|
43
|
-
labelPosition={select('Label position', labelPositionOptions, 'DEFAULT')}
|
|
44
|
-
mandatory={boolean('Mandatory', false)}
|
|
45
|
-
management={boolean('Management', false)}
|
|
46
|
-
zIndex={number('zIndex', 0)}
|
|
47
|
-
freezeOptions={boolean('Freeze options', false)}
|
|
48
|
-
/>
|
|
49
|
-
));
|
|
50
|
-
|
|
51
|
-
stories.addWithJSX('External update', () => {
|
|
52
|
-
const Fake = () => {
|
|
53
|
-
const [up, setUp] = useState(false);
|
|
54
|
-
return (
|
|
55
|
-
<>
|
|
56
|
-
<button
|
|
57
|
-
type="button"
|
|
58
|
-
onClick={() => {
|
|
59
|
-
setUp(true);
|
|
60
|
-
}}
|
|
61
|
-
disabled={up}
|
|
62
|
-
>
|
|
63
|
-
Force external update
|
|
64
|
-
</button>
|
|
65
|
-
|
|
66
|
-
<Orchestrator id="default" source={up ? dataForced : dataProps} />
|
|
67
|
-
</>
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
return <Fake />;
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
stories.addWithJSX('Naf', () => (
|
|
74
|
-
<Orchestrator
|
|
75
|
-
id="props"
|
|
76
|
-
source={dataNAF}
|
|
77
|
-
placeholderList={text('Placeholder', 'Placeholder')}
|
|
78
|
-
features={select('Features', featuresOptions, ['VTL', 'MD'])}
|
|
79
|
-
bindings={object('Bindings', { NAME: 'Simpsons', TEXAS: 'Texas' })}
|
|
80
|
-
disabled={boolean('Disabled', false)}
|
|
81
|
-
focused={boolean('Focused', false)}
|
|
82
|
-
writable={boolean('Writable', false)}
|
|
83
|
-
labelPosition={select('Label position', labelPositionOptions, 'DEFAULT')}
|
|
84
|
-
mandatory={boolean('Mandatory', false)}
|
|
85
|
-
management={boolean('Management', false)}
|
|
86
|
-
zIndex={number('zIndex', 0)}
|
|
87
|
-
freezeOptions={boolean('Freeze options', true)}
|
|
88
|
-
/>
|
|
89
|
-
));
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { storiesOf } from '@storybook/react';
|
|
3
|
+
import { withReadme } from 'storybook-readme';
|
|
4
|
+
import Orchestrator from '../utils/orchestrator';
|
|
5
|
+
import readme from './README.md';
|
|
6
|
+
import { titleDecorator } from 'utils/lib';
|
|
7
|
+
import data from './data';
|
|
8
|
+
import dataProps from './data-props';
|
|
9
|
+
import dataForced from './data-forced';
|
|
10
|
+
import dataNAF from './data-naf';
|
|
11
|
+
import { labelPositionOptions, featuresOptions } from '../utils/options';
|
|
12
|
+
import {
|
|
13
|
+
text,
|
|
14
|
+
boolean,
|
|
15
|
+
select,
|
|
16
|
+
object,
|
|
17
|
+
number,
|
|
18
|
+
} from '@storybook/addon-knobs/react';
|
|
19
|
+
|
|
20
|
+
const stories = storiesOf('Dropdown', module)
|
|
21
|
+
.addDecorator(withReadme(readme))
|
|
22
|
+
.addDecorator((Component) => {
|
|
23
|
+
const WrappedComponent = titleDecorator(Component);
|
|
24
|
+
return <WrappedComponent title="<Dropdown />" />;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
stories.addWithJSX('Default', () => (
|
|
28
|
+
<Orchestrator id="default" source={data} />
|
|
29
|
+
));
|
|
30
|
+
|
|
31
|
+
stories.addWithJSX('Props', () => (
|
|
32
|
+
<Orchestrator
|
|
33
|
+
id="props"
|
|
34
|
+
source={dataProps}
|
|
35
|
+
placeholderList={text('Placeholder', 'Placeholder')}
|
|
36
|
+
missing={boolean('Missing', false)}
|
|
37
|
+
features={select('Features', featuresOptions, ['VTL', 'MD'])}
|
|
38
|
+
bindings={object('Bindings', { NAME: 'Simpsons', TEXAS: 'Texas' })}
|
|
39
|
+
disabled={boolean('Disabled', false)}
|
|
40
|
+
focused={boolean('Focused', false)}
|
|
41
|
+
writable={boolean('Writable', false)}
|
|
42
|
+
widthAuto={boolean('Options auto width', false)}
|
|
43
|
+
labelPosition={select('Label position', labelPositionOptions, 'DEFAULT')}
|
|
44
|
+
mandatory={boolean('Mandatory', false)}
|
|
45
|
+
management={boolean('Management', false)}
|
|
46
|
+
zIndex={number('zIndex', 0)}
|
|
47
|
+
freezeOptions={boolean('Freeze options', false)}
|
|
48
|
+
/>
|
|
49
|
+
));
|
|
50
|
+
|
|
51
|
+
stories.addWithJSX('External update', () => {
|
|
52
|
+
const Fake = () => {
|
|
53
|
+
const [up, setUp] = useState(false);
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<button
|
|
57
|
+
type="button"
|
|
58
|
+
onClick={() => {
|
|
59
|
+
setUp(true);
|
|
60
|
+
}}
|
|
61
|
+
disabled={up}
|
|
62
|
+
>
|
|
63
|
+
Force external update
|
|
64
|
+
</button>
|
|
65
|
+
|
|
66
|
+
<Orchestrator id="default" source={up ? dataForced : dataProps} />
|
|
67
|
+
</>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
return <Fake />;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
stories.addWithJSX('Naf', () => (
|
|
74
|
+
<Orchestrator
|
|
75
|
+
id="props"
|
|
76
|
+
source={dataNAF}
|
|
77
|
+
placeholderList={text('Placeholder', 'Placeholder')}
|
|
78
|
+
features={select('Features', featuresOptions, ['VTL', 'MD'])}
|
|
79
|
+
bindings={object('Bindings', { NAME: 'Simpsons', TEXAS: 'Texas' })}
|
|
80
|
+
disabled={boolean('Disabled', false)}
|
|
81
|
+
focused={boolean('Focused', false)}
|
|
82
|
+
writable={boolean('Writable', false)}
|
|
83
|
+
labelPosition={select('Label position', labelPositionOptions, 'DEFAULT')}
|
|
84
|
+
mandatory={boolean('Mandatory', false)}
|
|
85
|
+
management={boolean('Management', false)}
|
|
86
|
+
zIndex={number('zIndex', 0)}
|
|
87
|
+
freezeOptions={boolean('Freeze options', true)}
|
|
88
|
+
/>
|
|
89
|
+
));
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
import { withReadme } from 'storybook-readme';
|
|
4
|
-
import { ProgressBar } from 'components';
|
|
5
|
-
import readme from './README.md';
|
|
6
|
-
import { titleDecorator } from 'utils/lib';
|
|
7
|
-
|
|
8
|
-
const stories = storiesOf('ProgressBar', module)
|
|
9
|
-
.addDecorator(withReadme(readme))
|
|
10
|
-
.addDecorator((Component) => {
|
|
11
|
-
const WrappedComponent = titleDecorator(Component);
|
|
12
|
-
return <WrappedComponent title="<ProgressBar />" />;
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
stories.addWithJSX('Default', () => (
|
|
16
|
-
<div className="lunatic-component">
|
|
17
|
-
{Array.from(new Array(11), (a, i) => (
|
|
18
|
-
<React.Fragment key={i}>
|
|
19
|
-
<ProgressBar id={`default-${i * 10}`} value={i * 10} />
|
|
20
|
-
<br />
|
|
21
|
-
</React.Fragment>
|
|
22
|
-
))}
|
|
23
|
-
</div>
|
|
24
|
-
));
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { storiesOf } from '@storybook/react';
|
|
3
|
+
import { withReadme } from 'storybook-readme';
|
|
4
|
+
import { ProgressBar } from 'components';
|
|
5
|
+
import readme from './README.md';
|
|
6
|
+
import { titleDecorator } from 'utils/lib';
|
|
7
|
+
|
|
8
|
+
const stories = storiesOf('ProgressBar', module)
|
|
9
|
+
.addDecorator(withReadme(readme))
|
|
10
|
+
.addDecorator((Component) => {
|
|
11
|
+
const WrappedComponent = titleDecorator(Component);
|
|
12
|
+
return <WrappedComponent title="<ProgressBar />" />;
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
stories.addWithJSX('Default', () => (
|
|
16
|
+
<div className="lunatic-component">
|
|
17
|
+
{Array.from(new Array(11), (a, i) => (
|
|
18
|
+
<React.Fragment key={i}>
|
|
19
|
+
<ProgressBar id={`default-${i * 10}`} value={i * 10} />
|
|
20
|
+
<br />
|
|
21
|
+
</React.Fragment>
|
|
22
|
+
))}
|
|
23
|
+
</div>
|
|
24
|
+
));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
{
|
|
4
|
+
"id": "A",
|
|
5
|
+
"componentType": "InputNumber",
|
|
6
|
+
"mandatory": false,
|
|
7
|
+
"min": 0,
|
|
8
|
+
"max": 120,
|
|
9
|
+
"decimals": 0,
|
|
10
|
+
"label": "\"How old are you?\"",
|
|
11
|
+
"conditionFilter": {
|
|
12
|
+
"value": "true"
|
|
13
|
+
},
|
|
14
|
+
"bindingDependencies": ["AGE"],
|
|
15
|
+
"response": { "name": "AGE" }
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "AA",
|
|
19
|
+
"componentType": "Subsequence",
|
|
20
|
+
"label": "\"Multiply age by 10: \" || AGE_10",
|
|
21
|
+
"conditionFilter": {
|
|
22
|
+
"value": "true"
|
|
23
|
+
},
|
|
24
|
+
"bindingDependencies": ["AGE_10"]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"variables": [
|
|
28
|
+
{
|
|
29
|
+
"variableType": "COLLECTED",
|
|
30
|
+
"name": "AGE",
|
|
31
|
+
"componentRef": "A",
|
|
32
|
+
"values": {
|
|
33
|
+
"PREVIOUS": null,
|
|
34
|
+
"COLLECTED": "5",
|
|
35
|
+
"FORCED": null,
|
|
36
|
+
"EDITED": null,
|
|
37
|
+
"INPUTED": null
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"variableType": "CALCULATED",
|
|
42
|
+
"name": "AGE_10",
|
|
43
|
+
"expression": "cast(cast(AGE, integer) * 10, string)",
|
|
44
|
+
"bindingDependencies": ["AGE"]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|