@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.
Files changed (129) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +25 -25
  3. package/lib/components/button/button.scss +24 -24
  4. package/lib/components/checkbox/checkbox-boolean/lunatic-checkbox-boolean.js +6 -3
  5. package/lib/components/checkbox/checkbox-group/lunatic-checkbox-group.js +6 -3
  6. package/lib/components/checkbox/checkbox-one/lunatic-checkbox-one.js +15 -2
  7. package/lib/components/commons/components/combo-box/combo-box.scss +218 -218
  8. package/lib/components/commons/components/create-lunatic-component/create-lunatic-component.js +10 -10
  9. package/lib/components/commons/components/dragger/dragger.scss +7 -7
  10. package/lib/components/commons/components/errors/errors.js +35 -0
  11. package/lib/components/commons/components/errors/errors.scss +5 -0
  12. package/lib/components/commons/components/errors/index.js +15 -0
  13. package/lib/components/commons/components/fab/fab.scss +32 -32
  14. package/lib/components/commons/components/missing/missing.scss +30 -30
  15. package/lib/components/commons/components/variable-status/variable-status.scss +39 -39
  16. package/lib/components/commons/icons/lunatic-icon.scss +4 -4
  17. package/lib/components/commons/index.js +8 -0
  18. package/lib/components/commons/use-on-handle-change.js +1 -2
  19. package/lib/components/datepicker/datepicker.scss +1 -1
  20. package/lib/components/datepicker/lunatic-datepicker.js +16 -1
  21. package/lib/components/declarations/declarations.scss +36 -36
  22. package/lib/components/dropdown/dropdown.scss +41 -41
  23. package/lib/components/dropdown/lunatic-dropdown.js +6 -3
  24. package/lib/components/index.scss +139 -139
  25. package/lib/components/input/input.scss +31 -31
  26. package/lib/components/input/lunatic-input.js +20 -4
  27. package/lib/components/input-number/lunatic-input-number.js +17 -2
  28. package/lib/components/loop/block-for-loop/block-for-loop.js +6 -1
  29. package/lib/components/loop/loop.js +6 -3
  30. package/lib/components/loop/roster-for-loop/roster-for-loop.js +7 -2
  31. package/lib/components/loop/roster-for-loop/roster.scss +42 -42
  32. package/lib/components/modal-controls/close-or-skip.js +13 -3
  33. package/lib/components/modal-controls/modal-controls.js +1 -2
  34. package/lib/components/modal-controls/modal-controls.scss +63 -63
  35. package/lib/components/pairwise/links/pairwise-links.js +6 -1
  36. package/lib/components/radio/lunatic-radio-group.js +6 -3
  37. package/lib/components/radio/radio.scss +59 -59
  38. package/lib/components/sequence/sequence.scss +10 -10
  39. package/lib/components/suggester/default-style.scss +125 -125
  40. package/lib/components/suggester/find-best-label/find-best-label.js +5 -5
  41. package/lib/components/suggester/lunatic-suggester.js +6 -3
  42. package/lib/components/suggester-loader-widget/widget.scss +176 -176
  43. package/lib/components/switch/switch.scss +47 -47
  44. package/lib/components/table/components/table.scss +26 -26
  45. package/lib/components/table/lunatic-table.js +5 -2
  46. package/lib/components/textarea/lunatic-textarea.js +22 -6
  47. package/lib/components/textarea/textarea.scss +8 -8
  48. package/lib/i18n/build-dictionary.js +16 -16
  49. package/lib/stories/Introduction.stories.mdx +114 -114
  50. package/lib/stories/checkboxOne/source.json +36 -36
  51. package/lib/stories/custom-mui/textarea-mui.js +0 -5
  52. package/lib/stories/dropdown/data.json +16 -16
  53. package/lib/stories/dropdown/source.json +122 -122
  54. package/lib/stories/filter-description/source-options.json +81 -81
  55. package/lib/stories/filter-description/source.json +11 -11
  56. package/lib/stories/input/data.json +5 -5
  57. package/lib/stories/input/source.json +28 -28
  58. package/lib/stories/input-number/input-number.stories.js +35 -0
  59. package/lib/stories/input-number/source.json +37 -0
  60. package/lib/stories/pairwise/block/block.json +3 -3
  61. package/lib/stories/pairwise/links/data.json +12 -12
  62. package/lib/stories/pairwise/links/links.json +141 -141
  63. package/lib/stories/{questionnaires/test → paste-questionnaire}/source.json +6290 -6290
  64. package/lib/stories/{questionnaires/test → paste-questionnaire}/test.stories.js +7 -3
  65. package/lib/stories/questionnaires/logement/data.json +2691 -2691
  66. package/lib/stories/questionnaires/logement/source-sequence.json +34181 -34181
  67. package/lib/stories/questionnaires/logement/source.json +34191 -34191
  68. package/lib/stories/questionnaires/simpsons/source.json +6290 -6290
  69. package/lib/stories/questionnaires-test/V2_DeclarationsSimples.json +848 -0
  70. package/lib/stories/questionnaires-test/V2_MinMaxSum_Boucles.json +509 -0
  71. package/lib/stories/questionnaires-test/V2_QuestSimple_Boucles.json +4091 -0
  72. package/lib/stories/questionnaires-test/V2_TCMRallyeGames.json +2892 -0
  73. package/lib/stories/questionnaires-test/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +490 -0
  74. package/lib/stories/questionnaires-test/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +1957 -0
  75. package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees2_PasPageFin.json +709 -0
  76. package/lib/stories/questionnaires-test/controls/V2_Controles_BouclesLiees_PasPageFin.json +368 -0
  77. package/lib/stories/{questionnaires → questionnaires-test}/controls/controls.stories.js +9 -6
  78. package/lib/stories/{questionnaires/samples/sample.json → questionnaires-test/test-dylan.json} +430 -430
  79. package/lib/stories/questionnaires-test/test.stories.js +45 -32
  80. package/lib/stories/radio/source.json +36 -36
  81. package/lib/stories/roster-for-loop/source.json +114 -114
  82. package/lib/stories/suggester/source.json +234 -234
  83. package/lib/stories/switch/README.md +31 -31
  84. package/lib/stories/switch/data-forced.json +48 -48
  85. package/lib/stories/switch/data.json +80 -80
  86. package/lib/stories/table/data-roster.json +1 -1
  87. package/lib/stories/table/data.json +1 -1
  88. package/lib/stories/table/source-roster.json +504 -504
  89. package/lib/stories/table/source.json +19 -19
  90. package/lib/stories/utils/custom-lunatic.scss +28 -28
  91. package/lib/stories/utils/default-arg-types.js +1 -1
  92. package/lib/stories/utils/orchestrator.js +38 -14
  93. package/lib/stories/utils/waiting/waiting.scss +21 -21
  94. package/lib/use-lunatic/actions.js +31 -17
  95. package/lib/use-lunatic/commons/create-map-pages.js +10 -10
  96. package/lib/use-lunatic/commons/execute-expression/create-execute-expression.js +16 -16
  97. package/lib/use-lunatic/commons/execute-expression/create-refresh-calculated.js +1 -0
  98. package/lib/use-lunatic/commons/fill-components/fill-component-expressions.js +21 -21
  99. package/lib/use-lunatic/commons/get-components-from-state.js +9 -2
  100. package/lib/use-lunatic/commons/get-data.js +90 -0
  101. package/lib/use-lunatic/commons/index.js +14 -2
  102. package/lib/use-lunatic/commons/page-tag.js +83 -0
  103. package/lib/use-lunatic/initial-state.js +3 -1
  104. package/lib/use-lunatic/reducer/commons/resize-array-variable.js +7 -7
  105. package/lib/use-lunatic/reducer/reduce-go-next-page.js +62 -37
  106. package/lib/use-lunatic/reducer/reduce-go-previous-page.js +25 -24
  107. package/lib/use-lunatic/reducer/reduce-go-to-page.js +59 -0
  108. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-cleaning.js +2 -1
  109. package/lib/use-lunatic/reducer/reduce-handle-change/reduce-handle-change.js +19 -16
  110. package/lib/use-lunatic/reducer/reduce-on-init.js +10 -9
  111. package/lib/use-lunatic/reducer/reducer.js +8 -3
  112. package/lib/use-lunatic/reducer/validate-controls/create-controls-reducer.js +59 -0
  113. package/lib/use-lunatic/reducer/validate-controls/create-modal-controls-reducer.js +88 -0
  114. package/lib/use-lunatic/reducer/validate-controls/index.js +11 -3
  115. package/lib/use-lunatic/reducer/validate-controls/validation-utils.js +71 -0
  116. package/lib/use-lunatic/use-lunatic.js +33 -19
  117. package/lib/utils/store-tools/auto-load.js +2 -2
  118. package/lib/utils/suggester-workers/append-to-index/create-append-task.js +2 -2
  119. package/package.json +159 -159
  120. package/lib/index.js.map +0 -1
  121. package/lib/stories/questionnaires/controls/V2_ControlesNonNum_horsBoucle_PasPageFin.json +0 -452
  122. package/lib/stories/questionnaires/controls/V2_ControlesNum_horsBoucle_PasPageFin.json +0 -1689
  123. package/lib/stories/questionnaires/controls/V2_Controles_BouclesLiees2_PasPageFin.json +0 -775
  124. package/lib/stories/questionnaires/controls/V2_Controles_BouclesLiees_PasPageFin.json +0 -412
  125. package/lib/stories/questionnaires/samples/samples.stories.js +0 -64
  126. package/lib/stories/questionnaires-test/sources.json +0 -203
  127. package/lib/use-lunatic/commons/get-page-tag.js +0 -21
  128. package/lib/use-lunatic/reducer/commons/Insee.code-workspace +0 -47
  129. package/lib/use-lunatic/reducer/validate-controls/create-validate-reducer.js +0 -146
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2019
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2019
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,25 +1,25 @@
1
- <img align="right" src="docs/img/lunatic-logo.png" alt="Lunatic logo"/>
2
-
3
- # Lunatic
4
-
5
- Library of questionnaire components
6
-
7
- [![Lunatic CI](https://github.com/InseeFr/Lunatic/actions/workflows/ci.yml/badge.svg)](https://github.com/InseeFr/Lunatic/actions/workflows/ci.yml)
8
- [![npm version](https://badge.fury.io/js/%40inseefr%2Flunatic.svg)](https://badge.fury.io/js/%40inseefr%2Flunatic)
9
- [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=coverage)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
10
- [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=alert_status)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
11
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
12
-
13
- The documentation can be found in the [docs](https://github.com/InseeFr/Lunatic/tree/master/docs) folder and [browsed online](https://inseefr.github.io/Lunatic).
14
-
15
- [Storybook](https://inseefr.github.io/Lunatic/storybook) is also available online.
16
-
17
- [Storybook of the future major release](https://inseefr.github.io/Lunatic/storybook-v2) under construction is also available online.
18
-
19
- ## Usage
20
-
21
- An [example](https://github.com/InseeFr/Lunatic/tree/master/example/orchestrator) of use of Lunatic is available. This simple orchestrator is deployed [online](https://inseefr.github.io/Lunatic/orchestrator).
22
-
23
- ## Editor
24
-
25
- A Lunatic Model / Lunatic [Editor](https://github.com/InseeFr/Lunatic/tree/master/example/lunatic-editor) is avaible [online](https://inseefr.github.io/Lunatic/editor).
1
+ <img align="right" src="docs/img/lunatic-logo.png" alt="Lunatic logo"/>
2
+
3
+ # Lunatic
4
+
5
+ Library of questionnaire components
6
+
7
+ [![Lunatic CI](https://github.com/InseeFr/Lunatic/actions/workflows/ci.yml/badge.svg)](https://github.com/InseeFr/Lunatic/actions/workflows/ci.yml)
8
+ [![npm version](https://badge.fury.io/js/%40inseefr%2Flunatic.svg)](https://badge.fury.io/js/%40inseefr%2Flunatic)
9
+ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=coverage)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
10
+ [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=InseeFr_Lunatic&metric=alert_status)](https://sonarcloud.io/dashboard?id=InseeFr_Lunatic)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
12
+
13
+ The documentation can be found in the [docs](https://github.com/InseeFr/Lunatic/tree/master/docs) folder and [browsed online](https://inseefr.github.io/Lunatic).
14
+
15
+ [Storybook](https://inseefr.github.io/Lunatic/storybook) is also available online.
16
+
17
+ [Storybook of the future major release](https://inseefr.github.io/Lunatic/storybook-v2) under construction is also available online.
18
+
19
+ ## Usage
20
+
21
+ An [example](https://github.com/InseeFr/Lunatic/tree/master/example/orchestrator) of use of Lunatic is available. This simple orchestrator is deployed [online](https://inseefr.github.io/Lunatic/orchestrator).
22
+
23
+ ## Editor
24
+
25
+ A Lunatic Model / Lunatic [Editor](https://github.com/InseeFr/Lunatic/tree/master/example/lunatic-editor) is avaible [online](https://inseefr.github.io/Lunatic/editor).
@@ -1,24 +1,24 @@
1
- .button-lunatic {
2
- min-width: 20%;
3
- color: white;
4
- border-color: var(--color-primary-dark);
5
- background-color: var(--color-primary-dark);
6
- font-size: 1.2em;
7
- font-weight: bold;
8
- padding: 0.4em;
9
- &:hover,
10
- &:focus:hover {
11
- color: var(--color-primary-dark);
12
- background-color: white;
13
- border-color: var(--color-primary-dark);
14
- }
15
- &:focus {
16
- outline: none;
17
- background-color: var(--color-primary-light);
18
- border-color: var(--color-primary-light);
19
- }
20
- &:disabled {
21
- background: var(--color-disabled);
22
- color: var(--color-primary-dark);
23
- }
24
- }
1
+ .button-lunatic {
2
+ min-width: 20%;
3
+ color: white;
4
+ border-color: var(--color-primary-dark);
5
+ background-color: var(--color-primary-dark);
6
+ font-size: 1.2em;
7
+ font-weight: bold;
8
+ padding: 0.4em;
9
+ &:hover,
10
+ &:focus:hover {
11
+ color: var(--color-primary-dark);
12
+ background-color: white;
13
+ border-color: var(--color-primary-dark);
14
+ }
15
+ &:focus {
16
+ outline: none;
17
+ background-color: var(--color-primary-light);
18
+ border-color: var(--color-primary-light);
19
+ }
20
+ &:disabled {
21
+ background: var(--color-disabled);
22
+ color: var(--color-primary-dark);
23
+ }
24
+ }
@@ -19,15 +19,18 @@ function LunaticCheckboxBoolean(_ref) {
19
19
  options = _ref.options,
20
20
  disabled = _ref.disabled,
21
21
  onChange = _ref.onChange,
22
- custom = _ref.custom;
23
- return /*#__PURE__*/_react["default"].createElement(_checkboxBoolean["default"], {
22
+ custom = _ref.custom,
23
+ errors = _ref.errors;
24
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_checkboxBoolean["default"], {
24
25
  id: id,
25
26
  options: options,
26
27
  checked: value,
27
28
  onClick: onChange,
28
29
  disabled: disabled,
29
30
  custom: custom
30
- });
31
+ }), /*#__PURE__*/_react["default"].createElement(_commons.Errors, {
32
+ errors: errors
33
+ }));
31
34
  }
32
35
 
33
36
  LunaticCheckboxBoolean.defaultProps = {
@@ -18,14 +18,17 @@ function LunaticCheckboxGroup(_ref) {
18
18
  value = _ref.value,
19
19
  responses = _ref.responses,
20
20
  custom = _ref.custom,
21
- handleChange = _ref.handleChange;
22
- return /*#__PURE__*/_react["default"].createElement(_checkboxGroup["default"], {
21
+ handleChange = _ref.handleChange,
22
+ errors = _ref.errors;
23
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_checkboxGroup["default"], {
23
24
  id: id,
24
25
  options: responses,
25
26
  value: value,
26
27
  handleChange: handleChange,
27
28
  custom: custom
28
- });
29
+ }), /*#__PURE__*/_react["default"].createElement(_commons.Errors, {
30
+ errors: errors
31
+ }));
29
32
  }
30
33
 
31
34
  var _default = (0, _commons.createLunaticComponent)(LunaticCheckboxGroup, {
@@ -9,13 +9,26 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _radio = _interopRequireDefault(require("../../radio"));
11
11
 
12
+ var _commons = require("../../commons");
13
+
14
+ var _excluded = ["errors"];
15
+
12
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
17
 
14
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); }
15
19
 
16
- function LunaticCheckboxOne(props) {
17
- return /*#__PURE__*/_react["default"].createElement(_radio["default"], _extends({}, props, {
20
+ 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; }
21
+
22
+ 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; }
23
+
24
+ function LunaticCheckboxOne(_ref) {
25
+ var errors = _ref.errors,
26
+ props = _objectWithoutProperties(_ref, _excluded);
27
+
28
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_radio["default"], _extends({}, props, {
18
29
  checkboxStyle: true
30
+ })), /*#__PURE__*/_react["default"].createElement(_commons.Errors, {
31
+ errors: errors
19
32
  }));
20
33
  }
21
34
 
@@ -1,218 +1,218 @@
1
- @mixin preventSelect() {
2
- -moz-user-select: -moz-none;
3
- -khtml-user-select: none;
4
- -webkit-user-select: none;
5
- }
6
-
7
- @mixin placeholder {
8
- color: gray;
9
- @include defaultFont();
10
- font-size: 15px;
11
- line-height: 34px;
12
- vertical-align: middle;
13
- font-weight: normal;
14
- }
15
-
16
- @mixin defaultFont {
17
- font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
18
- }
19
-
20
- @mixin selection() {
21
- @include defaultFont();
22
- }
23
-
24
- .lunatic-combo-box-container {
25
- position: relative;
26
- width: 100%;
27
-
28
- &.default-style {
29
- --color-combo-box-selected: Cornsilk;
30
- --color-primary-dark: DarkGreen;
31
- --color-primary-main: FloralWhite;
32
- --color-combo-box-background: snow;
33
- --color-disabled: Gainsboro;
34
- --color-primary-light: GreenYellow;
35
-
36
- margin-bottom: 10px;
37
- .lunatic-combo-box {
38
- min-height: 30px;
39
- min-width: 260px;
40
- width: 100%;
41
-
42
- .lunatic-combo-box-content {
43
- .lunatic-combo-box-selection {
44
- border-radius: 5px;
45
- border: 2px solid var(--color-primary-dark);
46
- background-color: var(--color-combo-box-background);
47
- &:hover {
48
- border-color: var(--color-primary-main);
49
- }
50
- .lunatic-combo-box-input {
51
- height: 34;
52
- line-height: 34px;
53
- font-size: 15px;
54
- padding-left: 4px;
55
- @include selection();
56
-
57
- &::placeholder {
58
- @include placeholder();
59
- }
60
- }
61
-
62
- .lunatic-combo-box-selected {
63
- height: 34px;
64
- line-height: 34px;
65
- background-color: var(--color-combo-box-background);
66
- border-radius: 5px;
67
- padding-left: 4px;
68
- @include selection();
69
- outline: none;
70
-
71
- display: block;
72
- @include placeholder();
73
-
74
- .placeholder {
75
- }
76
-
77
- .selection {
78
- display: inline-block;
79
- line-height: 34px;
80
- font-size: 15px;
81
- }
82
-
83
- &.disabled {
84
- background-color: var(--color-disabled);
85
- }
86
- }
87
- }
88
-
89
- .lunatic-combo-box-panel {
90
- @include defaultFont();
91
- height: 0;
92
- opacity: 0;
93
- background-color: var(--color-combo-box-background);
94
- transition: opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
95
- transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
96
-
97
- &.expended {
98
- border: solid 1px var(--color-primary-light);
99
- opacity: 1;
100
- min-height: 30px;
101
- height: max-content;
102
- box-shadow: 0 2px 2px grey;
103
- border-radius: 4px;
104
- }
105
- &:focus {
106
- }
107
- .lunatic-combo-box-option {
108
- text-overflow: ellipsis;
109
- white-space: nowrap;
110
- overflow: hidden;
111
- margin-bottom: 0.1em;
112
- line-height: 2rem;
113
- display: block;
114
-
115
- &.selected {
116
- color: var(--color-primary-dark);
117
- background-color: var(--color-combo-box-selected);
118
- }
119
- &:hover {
120
- background-color: var(--color-primary-main);
121
- color: var(--color-combo-box-background);
122
- }
123
- }
124
- }
125
- }
126
- }
127
- }
128
-
129
- .lunatic-combo-box-fab {
130
- position: absolute;
131
- right: 4px;
132
- top: 8px;
133
- z-index: 0;
134
- &.focused {
135
- z-index: 1;
136
- }
137
-
138
- .lunatic-icon {
139
- svg {
140
- fill: white;
141
- width: 16px;
142
- height: 16px;
143
- }
144
- }
145
- }
146
-
147
- .lunatic-combo-box {
148
- position: relative;
149
- z-index: 0;
150
-
151
- &:focus {
152
- outline: none;
153
- }
154
-
155
- &.focused {
156
- z-index: 1;
157
- }
158
-
159
- .lunatic-combo-box-content {
160
- position: absolute;
161
- width: 100%;
162
-
163
- .lunatic-combo-box-selection {
164
- position: relative;
165
- .lunatic-combo-box-input {
166
- border: none;
167
- margin: 0;
168
- padding: 0;
169
- background-color: transparent;
170
- &:focus {
171
- outline: none;
172
- }
173
-
174
- width: 100%;
175
- /* */
176
- }
177
-
178
- .lunatic-combo-box-selected {
179
- // position: absolute;
180
- top: 0;
181
- white-space: nowrap;
182
- overflow-x: hidden;
183
- width: 100%;
184
- height: 100%;
185
- display: none;
186
- &.displayed {
187
- display: block;
188
- }
189
-
190
- .placeholder {
191
- }
192
- .selection {
193
- }
194
- }
195
- }
196
-
197
- ul,
198
- li,
199
- div,
200
- span {
201
- margin: 0;
202
- padding: 0;
203
- border: none;
204
- list-style: none;
205
- }
206
-
207
- .lunatic-combo-box-panel {
208
- &:focus {
209
- outline: none;
210
- }
211
- .lunatic-combo-box-option {
212
- white-space: nowrap;
213
- @include preventSelect();
214
- }
215
- }
216
- }
217
- }
218
- }
1
+ @mixin preventSelect() {
2
+ -moz-user-select: -moz-none;
3
+ -khtml-user-select: none;
4
+ -webkit-user-select: none;
5
+ }
6
+
7
+ @mixin placeholder {
8
+ color: gray;
9
+ @include defaultFont();
10
+ font-size: 15px;
11
+ line-height: 34px;
12
+ vertical-align: middle;
13
+ font-weight: normal;
14
+ }
15
+
16
+ @mixin defaultFont {
17
+ font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
18
+ }
19
+
20
+ @mixin selection() {
21
+ @include defaultFont();
22
+ }
23
+
24
+ .lunatic-combo-box-container {
25
+ position: relative;
26
+ width: 100%;
27
+
28
+ &.default-style {
29
+ --color-combo-box-selected: Cornsilk;
30
+ --color-primary-dark: DarkGreen;
31
+ --color-primary-main: FloralWhite;
32
+ --color-combo-box-background: snow;
33
+ --color-disabled: Gainsboro;
34
+ --color-primary-light: GreenYellow;
35
+
36
+ margin-bottom: 10px;
37
+ .lunatic-combo-box {
38
+ min-height: 30px;
39
+ min-width: 260px;
40
+ width: 100%;
41
+
42
+ .lunatic-combo-box-content {
43
+ .lunatic-combo-box-selection {
44
+ border-radius: 5px;
45
+ border: 2px solid var(--color-primary-dark);
46
+ background-color: var(--color-combo-box-background);
47
+ &:hover {
48
+ border-color: var(--color-primary-main);
49
+ }
50
+ .lunatic-combo-box-input {
51
+ height: 34;
52
+ line-height: 34px;
53
+ font-size: 15px;
54
+ padding-left: 4px;
55
+ @include selection();
56
+
57
+ &::placeholder {
58
+ @include placeholder();
59
+ }
60
+ }
61
+
62
+ .lunatic-combo-box-selected {
63
+ height: 34px;
64
+ line-height: 34px;
65
+ background-color: var(--color-combo-box-background);
66
+ border-radius: 5px;
67
+ padding-left: 4px;
68
+ @include selection();
69
+ outline: none;
70
+
71
+ display: block;
72
+ @include placeholder();
73
+
74
+ .placeholder {
75
+ }
76
+
77
+ .selection {
78
+ display: inline-block;
79
+ line-height: 34px;
80
+ font-size: 15px;
81
+ }
82
+
83
+ &.disabled {
84
+ background-color: var(--color-disabled);
85
+ }
86
+ }
87
+ }
88
+
89
+ .lunatic-combo-box-panel {
90
+ @include defaultFont();
91
+ height: 0;
92
+ opacity: 0;
93
+ background-color: var(--color-combo-box-background);
94
+ transition: opacity 267ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
95
+ transform 178ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
96
+
97
+ &.expended {
98
+ border: solid 1px var(--color-primary-light);
99
+ opacity: 1;
100
+ min-height: 30px;
101
+ height: max-content;
102
+ box-shadow: 0 2px 2px grey;
103
+ border-radius: 4px;
104
+ }
105
+ &:focus {
106
+ }
107
+ .lunatic-combo-box-option {
108
+ text-overflow: ellipsis;
109
+ white-space: nowrap;
110
+ overflow: hidden;
111
+ margin-bottom: 0.1em;
112
+ line-height: 2rem;
113
+ display: block;
114
+
115
+ &.selected {
116
+ color: var(--color-primary-dark);
117
+ background-color: var(--color-combo-box-selected);
118
+ }
119
+ &:hover {
120
+ background-color: var(--color-primary-main);
121
+ color: var(--color-combo-box-background);
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ .lunatic-combo-box-fab {
130
+ position: absolute;
131
+ right: 4px;
132
+ top: 8px;
133
+ z-index: 0;
134
+ &.focused {
135
+ z-index: 1;
136
+ }
137
+
138
+ .lunatic-icon {
139
+ svg {
140
+ fill: white;
141
+ width: 16px;
142
+ height: 16px;
143
+ }
144
+ }
145
+ }
146
+
147
+ .lunatic-combo-box {
148
+ position: relative;
149
+ z-index: 0;
150
+
151
+ &:focus {
152
+ outline: none;
153
+ }
154
+
155
+ &.focused {
156
+ z-index: 1;
157
+ }
158
+
159
+ .lunatic-combo-box-content {
160
+ position: absolute;
161
+ width: 100%;
162
+
163
+ .lunatic-combo-box-selection {
164
+ position: relative;
165
+ .lunatic-combo-box-input {
166
+ border: none;
167
+ margin: 0;
168
+ padding: 0;
169
+ background-color: transparent;
170
+ &:focus {
171
+ outline: none;
172
+ }
173
+
174
+ width: 100%;
175
+ /* */
176
+ }
177
+
178
+ .lunatic-combo-box-selected {
179
+ // position: absolute;
180
+ top: 0;
181
+ white-space: nowrap;
182
+ overflow-x: hidden;
183
+ width: 100%;
184
+ height: 100%;
185
+ display: none;
186
+ &.displayed {
187
+ display: block;
188
+ }
189
+
190
+ .placeholder {
191
+ }
192
+ .selection {
193
+ }
194
+ }
195
+ }
196
+
197
+ ul,
198
+ li,
199
+ div,
200
+ span {
201
+ margin: 0;
202
+ padding: 0;
203
+ border: none;
204
+ list-style: none;
205
+ }
206
+
207
+ .lunatic-combo-box-panel {
208
+ &:focus {
209
+ outline: none;
210
+ }
211
+ .lunatic-combo-box-option {
212
+ white-space: nowrap;
213
+ @include preventSelect();
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }