@inseefr/lunatic 2.5.1-beta → 2.5.1-panelContainer
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/combo-box/combo-box-container.js +15 -7
- package/lib/components/commons/components/combo-box/combo-box-container.spec.js +5 -5
- package/lib/components/commons/components/combo-box/combo-box-content-box.js +30 -0
- package/lib/components/commons/components/combo-box/combo-box-content.js +8 -9
- package/lib/components/commons/components/combo-box/combo-box.js +6 -7
- package/lib/components/commons/components/combo-box/panel/panel-container.js +5 -2
- package/lib/components/commons/components/combo-box/panel/panel-container.spec.js +7 -6
- package/lib/components/commons/components/combo-box/panel/panel.js +2 -2
- package/lib/components/commons/components/combo-box/selection/selection-container.js +3 -2
- package/lib/components/commons/components/combo-box/selection/selection.js +3 -1
- package/lib/components/suggester/html/suggester.js +1 -1
- package/lib/components/suggester/lunatic-suggester.js +3 -1
- package/lib/src/components/commons/components/combo-box/combo-box-container.d.ts +4 -2
- package/lib/src/components/commons/components/combo-box/combo-box-content-box.d.ts +11 -0
- package/lib/src/components/commons/components/combo-box/combo-box-content.d.ts +2 -1
- package/lib/src/components/commons/components/combo-box/combo-box.stories.d.ts +1 -0
- package/lib/src/components/commons/components/combo-box/panel/panel-container.d.ts +2 -2
- package/lib/src/components/commons/components/combo-box/selection/selection-container.d.ts +2 -1
- package/lib/src/components/commons/components/combo-box/selection/selection.d.ts +2 -1
- package/lib/src/components/suggester/lunatic-suggester.d.ts +1 -1
- package/lib/stories/suggester/simple.json +15 -0
- package/package.json +1 -1
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _createCustomizableField = _interopRequireDefault(require("../../create-customizable-field"));
|
|
9
|
+
var _errors = _interopRequireDefault(require("../errors"));
|
|
8
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
12
|
function ComboBoxContainer(_ref) {
|
|
@@ -12,10 +14,16 @@ function ComboBoxContainer(_ref) {
|
|
|
12
14
|
className = _ref.className,
|
|
13
15
|
id = _ref.id,
|
|
14
16
|
_ref$classStyle = _ref.classStyle,
|
|
15
|
-
classStyle = _ref$classStyle === void 0 ? 'default-style' : _ref$classStyle
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
classStyle = _ref$classStyle === void 0 ? 'default-style' : _ref$classStyle,
|
|
18
|
+
errors = _ref.errors;
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
20
|
+
id: "".concat(className !== null && className !== void 0 ? className : 'lunatic', "-combo-box-container-").concat(id),
|
|
21
|
+
className: (0, _classnames["default"])("".concat(className !== null && className !== void 0 ? className : 'lunatic', "-combo-box-container"), "".concat(className !== null && className !== void 0 ? className : 'lunatic', "-suggester-").concat(classStyle), "lunatic-suggester-default-style", classStyle),
|
|
22
|
+
children: [children, errors && /*#__PURE__*/(0, _jsxRuntime.jsx)(_errors["default"], {
|
|
23
|
+
errors: errors,
|
|
24
|
+
activeId: id
|
|
25
|
+
})]
|
|
20
26
|
});
|
|
21
|
-
}
|
|
27
|
+
}
|
|
28
|
+
var _default = (0, _createCustomizableField["default"])(ComboBoxContainer, 'ComboboxContainer');
|
|
29
|
+
exports["default"] = _default;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = _interopRequireDefault(require("react"));
|
|
4
4
|
var _react2 = require("@testing-library/react");
|
|
5
|
-
var _comboBoxContainer = require("./combo-box-container");
|
|
5
|
+
var _comboBoxContainer = _interopRequireDefault(require("./combo-box-container"));
|
|
6
6
|
var _vitest = require("vitest");
|
|
7
7
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
9
9
|
(0, _vitest.describe)('ComboBoxContainer', function () {
|
|
10
10
|
(0, _vitest.it)('renders with default styles when no classStyle prop is provided', function () {
|
|
11
|
-
var _render = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer
|
|
11
|
+
var _render = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer["default"], {
|
|
12
12
|
id: "test-id",
|
|
13
13
|
children: "Content"
|
|
14
14
|
})),
|
|
@@ -16,7 +16,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
16
16
|
(0, _vitest.expect)(container.firstChild).toHaveClass('default-style');
|
|
17
17
|
});
|
|
18
18
|
(0, _vitest.it)('renders with additional styles when classStyle prop is provided', function () {
|
|
19
|
-
var _render2 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer
|
|
19
|
+
var _render2 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer["default"], {
|
|
20
20
|
id: "test-id",
|
|
21
21
|
classStyle: "custom-style",
|
|
22
22
|
children: "Content"
|
|
@@ -26,7 +26,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
26
26
|
(0, _vitest.expect)(container.firstChild).toHaveClass('custom-style');
|
|
27
27
|
});
|
|
28
28
|
(0, _vitest.it)('renders children inside the component', function () {
|
|
29
|
-
var _render3 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer
|
|
29
|
+
var _render3 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer["default"], {
|
|
30
30
|
id: "test-id",
|
|
31
31
|
children: "Content"
|
|
32
32
|
})),
|
|
@@ -34,7 +34,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
34
34
|
(0, _vitest.expect)(getByText('Content')).toBeInTheDocument();
|
|
35
35
|
});
|
|
36
36
|
(0, _vitest.it)('passes className prop to the component', function () {
|
|
37
|
-
var _render4 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer
|
|
37
|
+
var _render4 = (0, _react2.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContainer["default"], {
|
|
38
38
|
id: "test-id",
|
|
39
39
|
className: "test-class",
|
|
40
40
|
children: "Content"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ComboBoxContentBox = ComboBoxContentBox;
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
10
|
+
var _index = require("../../index");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function ComboBoxContentBox(_ref) {
|
|
14
|
+
var children = _ref.children,
|
|
15
|
+
className = _ref.className,
|
|
16
|
+
onFocus = _ref.onFocus,
|
|
17
|
+
onKeyDown = _ref.onKeyDown,
|
|
18
|
+
focused = _ref.focused;
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
20
|
+
className: (0, _classnames["default"])("".concat(className !== null && className !== void 0 ? className : 'lunatic', "-combo-box"), {
|
|
21
|
+
focused: focused
|
|
22
|
+
}),
|
|
23
|
+
onFocus: onFocus,
|
|
24
|
+
onClick: onFocus,
|
|
25
|
+
onKeyDown: onKeyDown,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
var _default = (0, _index.createCustomizableLunaticField)(ComboBoxContentBox, 'ComboboxContentBox');
|
|
30
|
+
exports["default"] = _default;
|
|
@@ -10,6 +10,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
11
|
var _keyboardKeyCodes = require("./state-management/reduce-on-keydown/keyboard-key-codes");
|
|
12
12
|
var _index = require("../../index");
|
|
13
|
+
var _comboBoxContentBox = _interopRequireDefault(require("./combo-box-content-box"));
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
15
16
|
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); }
|
|
@@ -19,7 +20,8 @@ function ComboBoxContent(_ref) {
|
|
|
19
20
|
focused = _ref.focused,
|
|
20
21
|
onFocus = _ref.onFocus,
|
|
21
22
|
onBlur = _ref.onBlur,
|
|
22
|
-
onKeyDown = _ref.onKeyDown
|
|
23
|
+
onKeyDown = _ref.onKeyDown,
|
|
24
|
+
className = _ref.className;
|
|
23
25
|
var ref = (0, _react.useRef)(null);
|
|
24
26
|
var onClick = (0, _react.useCallback)(function (e) {
|
|
25
27
|
var _ref$current;
|
|
@@ -44,19 +46,16 @@ function ComboBoxContent(_ref) {
|
|
|
44
46
|
|
|
45
47
|
onKeyDown(key);
|
|
46
48
|
}, [onKeyDown]);
|
|
47
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("
|
|
48
|
-
className:
|
|
49
|
-
focused: focused
|
|
50
|
-
}),
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_comboBoxContentBox["default"], {
|
|
50
|
+
className: className,
|
|
51
51
|
onFocus: onFocus,
|
|
52
|
-
onClick: onFocus,
|
|
53
52
|
onKeyDown: handleKeyDown,
|
|
54
|
-
ref: ref,
|
|
55
|
-
tabIndex: 0,
|
|
56
53
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
57
|
-
className: (0, _classnames["default"])('lunatic-combo-box-content
|
|
54
|
+
className: (0, _classnames["default"])("".concat(className !== null && className !== void 0 ? className : 'lunatic', "-combo-box-content"), {
|
|
58
55
|
focused: focused
|
|
59
56
|
}),
|
|
57
|
+
ref: ref,
|
|
58
|
+
tabIndex: 0,
|
|
60
59
|
children: children
|
|
61
60
|
})
|
|
62
61
|
});
|
|
@@ -12,10 +12,9 @@ var _stateManagement = require("./state-management");
|
|
|
12
12
|
require("./combo-box.scss");
|
|
13
13
|
var _selection = require("./selection/selection");
|
|
14
14
|
var _panel = require("./panel/panel");
|
|
15
|
-
var _comboBoxContainer = require("./combo-box-container");
|
|
15
|
+
var _comboBoxContainer = _interopRequireDefault(require("./combo-box-container"));
|
|
16
16
|
var _comboBoxContent = _interopRequireDefault(require("./combo-box-content"));
|
|
17
17
|
var _label = _interopRequireDefault(require("../label"));
|
|
18
|
-
var _errors = _interopRequireDefault(require("../errors"));
|
|
19
18
|
var _index = require("../../index");
|
|
20
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -103,10 +102,11 @@ function ComboBox(_ref) {
|
|
|
103
102
|
children: messageError
|
|
104
103
|
});
|
|
105
104
|
}
|
|
106
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_comboBoxContainer
|
|
105
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_comboBoxContainer["default"], {
|
|
107
106
|
id: id,
|
|
108
107
|
classStyle: classStyle,
|
|
109
108
|
className: className,
|
|
109
|
+
errors: errors,
|
|
110
110
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_label["default"], {
|
|
111
111
|
htmlFor: id,
|
|
112
112
|
id: labelId,
|
|
@@ -117,6 +117,7 @@ function ComboBox(_ref) {
|
|
|
117
117
|
onFocus: onFocus,
|
|
118
118
|
onBlur: onBlur,
|
|
119
119
|
onKeyDown: onKeyDown,
|
|
120
|
+
className: className,
|
|
120
121
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_selection.Selection, {
|
|
121
122
|
labelRenderer: labelRenderer,
|
|
122
123
|
placeholder: placeholder,
|
|
@@ -129,7 +130,8 @@ function ComboBox(_ref) {
|
|
|
129
130
|
editable: editable,
|
|
130
131
|
selectedIndex: selectedIndex,
|
|
131
132
|
options: options,
|
|
132
|
-
onChange: handleChange
|
|
133
|
+
onChange: handleChange,
|
|
134
|
+
className: className
|
|
133
135
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panel.Panel, {
|
|
134
136
|
optionRenderer: optionRenderer,
|
|
135
137
|
options: options,
|
|
@@ -147,9 +149,6 @@ function ComboBox(_ref) {
|
|
|
147
149
|
search: search,
|
|
148
150
|
onClick: onDelete,
|
|
149
151
|
editable: editable
|
|
150
|
-
}), errors && /*#__PURE__*/(0, _jsxRuntime.jsx)(_errors["default"], {
|
|
151
|
-
errors: errors,
|
|
152
|
-
activeId: id
|
|
153
152
|
})]
|
|
154
153
|
});
|
|
155
154
|
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports["default"] = void 0;
|
|
7
7
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
8
|
+
var _createCustomizableField = _interopRequireDefault(require("../../../create-customizable-field"));
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
11
|
function PanelContainer(_ref) {
|
|
@@ -22,4 +23,6 @@ function PanelContainer(_ref) {
|
|
|
22
23
|
role: "listbox",
|
|
23
24
|
children: children
|
|
24
25
|
});
|
|
25
|
-
}
|
|
26
|
+
}
|
|
27
|
+
var _default = (0, _createCustomizableField["default"])(PanelContainer, 'ComboboxPanelContainer');
|
|
28
|
+
exports["default"] = _default;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var _react = require("@testing-library/react");
|
|
4
4
|
var _vitest = require("vitest");
|
|
5
|
-
var _panelContainer = require("./panel-container");
|
|
5
|
+
var _panelContainer = _interopRequireDefault(require("./panel-container"));
|
|
6
6
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
7
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
7
8
|
(0, _vitest.describe)('PanelContainer', function () {
|
|
8
9
|
(0, _vitest.it)('should render children', function () {
|
|
9
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_panelContainer
|
|
10
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsxs)(_panelContainer["default"], {
|
|
10
11
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
11
12
|
children: "Item 1"
|
|
12
13
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
@@ -20,7 +21,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
20
21
|
});
|
|
21
22
|
(0, _vitest.it)('should set the id attribute', function () {
|
|
22
23
|
var id = 'test-panel';
|
|
23
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer
|
|
24
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer["default"], {
|
|
24
25
|
id: id,
|
|
25
26
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
26
27
|
children: "Item 1"
|
|
@@ -29,7 +30,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
29
30
|
(0, _vitest.expect)(_react.screen.getByRole('listbox')).toHaveAttribute('id', "lunatic-combo-box-panel-".concat(id));
|
|
30
31
|
});
|
|
31
32
|
(0, _vitest.it)('should set the aria-label attribute', function () {
|
|
32
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer
|
|
33
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer["default"], {
|
|
33
34
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
34
35
|
children: "Item 1"
|
|
35
36
|
})
|
|
@@ -37,7 +38,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
37
38
|
(0, _vitest.expect)(_react.screen.getByRole('listbox')).toHaveAttribute('aria-label', 'suggestions');
|
|
38
39
|
});
|
|
39
40
|
(0, _vitest.it)('should set the focused class when focused prop is true', function () {
|
|
40
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer
|
|
41
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer["default"], {
|
|
41
42
|
focused: true,
|
|
42
43
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
43
44
|
children: "Item 1"
|
|
@@ -46,7 +47,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
46
47
|
(0, _vitest.expect)(_react.screen.getByRole('listbox')).toHaveClass('focused');
|
|
47
48
|
});
|
|
48
49
|
(0, _vitest.it)('should set the expanded class when expanded prop is true', function () {
|
|
49
|
-
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer
|
|
50
|
+
(0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer["default"], {
|
|
50
51
|
expanded: true,
|
|
51
52
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
52
53
|
children: "Item 1"
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Panel = Panel;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _panelContainer = require("./panel-container");
|
|
8
|
+
var _panelContainer = _interopRequireDefault(require("./panel-container"));
|
|
9
9
|
var _optionContainer = require("./option-container");
|
|
10
10
|
var _comboBoxOption = _interopRequireDefault(require("./combo-box-option"));
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -22,7 +22,7 @@ function Panel(_ref) {
|
|
|
22
22
|
onSelect = _ref.onSelect;
|
|
23
23
|
var visibleOptions = expanded ? options : [];
|
|
24
24
|
var ComboBoxOptionComponent = OptionRender !== null && OptionRender !== void 0 ? OptionRender : _comboBoxOption["default"];
|
|
25
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_panelContainer["default"], {
|
|
26
26
|
expanded: expanded,
|
|
27
27
|
focused: focused,
|
|
28
28
|
id: "".concat(id, "-list"),
|
|
@@ -14,11 +14,12 @@ function SelectionContainer(_ref) {
|
|
|
14
14
|
expanded = _ref.expanded,
|
|
15
15
|
focused = _ref.focused,
|
|
16
16
|
disabled = _ref.disabled,
|
|
17
|
-
labelId = _ref.labelId
|
|
17
|
+
labelId = _ref.labelId,
|
|
18
|
+
className = _ref.className;
|
|
18
19
|
var comboBoxId = "".concat(id);
|
|
19
20
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
20
21
|
id: comboBoxId,
|
|
21
|
-
className: (0, _classnames["default"])('lunatic-combo-box-selection
|
|
22
|
+
className: (0, _classnames["default"])("".concat(className !== null && className !== void 0 ? className : 'lunatic', "-combo-box-selection"), {
|
|
22
23
|
focused: focused,
|
|
23
24
|
disabled: disabled
|
|
24
25
|
}),
|
|
@@ -21,7 +21,8 @@ function Selection(_ref) {
|
|
|
21
21
|
options = _ref.options,
|
|
22
22
|
editable = _ref.editable,
|
|
23
23
|
labelId = _ref.labelId,
|
|
24
|
-
id = _ref.id
|
|
24
|
+
id = _ref.id,
|
|
25
|
+
className = _ref.className;
|
|
25
26
|
var onChangeEx = (0, _react.useCallback)(function (e) {
|
|
26
27
|
onChange === null || onChange === void 0 ? void 0 : onChange(e.target.value);
|
|
27
28
|
}, [onChange]);
|
|
@@ -30,6 +31,7 @@ function Selection(_ref) {
|
|
|
30
31
|
labelId: labelId,
|
|
31
32
|
expanded: expanded,
|
|
32
33
|
"aria-owns": "".concat(id, "-list"),
|
|
34
|
+
className: className,
|
|
33
35
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_LabelOrInput.LabelOrInput, {
|
|
34
36
|
labelRenderer: labelRenderer,
|
|
35
37
|
placeholder: placeholder,
|
|
@@ -25,7 +25,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
26
|
function Suggester(_ref) {
|
|
27
27
|
var _ref$className = _ref.className,
|
|
28
|
-
className = _ref$className === void 0 ? 'lunatic
|
|
28
|
+
className = _ref$className === void 0 ? 'lunatic' : _ref$className,
|
|
29
29
|
_ref$placeholder = _ref.placeholder,
|
|
30
30
|
placeholder = _ref$placeholder === void 0 ? _i18n["default"].PLACEHOLDER : _ref$placeholder,
|
|
31
31
|
_ref$onSelect = _ref.onSelect,
|
|
@@ -28,6 +28,7 @@ function LunaticSuggester(_ref) {
|
|
|
28
28
|
missingResponse = _ref.missingResponse,
|
|
29
29
|
management = _ref.management,
|
|
30
30
|
response = _ref.response,
|
|
31
|
+
className = _ref.className,
|
|
31
32
|
getSuggesterStatus = _ref.getSuggesterStatus;
|
|
32
33
|
var onChange = (0, _useOnHandleChange["default"])({
|
|
33
34
|
handleChange: handleChange,
|
|
@@ -55,7 +56,8 @@ function LunaticSuggester(_ref) {
|
|
|
55
56
|
value: value,
|
|
56
57
|
errors: errors,
|
|
57
58
|
label: label,
|
|
58
|
-
getSuggesterStatus: getSuggesterStatus
|
|
59
|
+
getSuggesterStatus: getSuggesterStatus,
|
|
60
|
+
className: className
|
|
59
61
|
})
|
|
60
62
|
});
|
|
61
63
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import { LunaticBaseProps } from '../../../type';
|
|
2
3
|
type Props = PropsWithChildren<{
|
|
3
4
|
className?: string;
|
|
4
5
|
id?: string;
|
|
5
6
|
classStyle?: string;
|
|
7
|
+
errors?: LunaticBaseProps['errors'];
|
|
6
8
|
}>;
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
+
declare const _default: import("react").ComponentType<Props>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
import React, { PropsWithChildren } from 'react';
|
|
3
|
+
type Props = PropsWithChildren<{
|
|
4
|
+
focused?: boolean;
|
|
5
|
+
onFocus: () => void;
|
|
6
|
+
onKeyDown: (e: KeyboardEvent<Element>) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function ComboBoxContentBox({ children, className, onFocus, onKeyDown, focused, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const _default: React.ComponentType<Props>;
|
|
11
|
+
export default _default;
|
|
@@ -4,6 +4,7 @@ type Props = PropsWithChildren<{
|
|
|
4
4
|
onBlur: () => void;
|
|
5
5
|
onFocus: () => void;
|
|
6
6
|
onKeyDown: (key: string) => void;
|
|
7
|
+
className?: string;
|
|
7
8
|
}>;
|
|
8
|
-
export declare function ComboBoxContent({ children, focused, onFocus, onBlur, onKeyDown, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function ComboBoxContent({ children, focused, onFocus, onBlur, onKeyDown, className, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export default ComboBoxContent;
|
|
@@ -10,6 +10,7 @@ export declare const Default: Story<{
|
|
|
10
10
|
editable?: boolean | undefined;
|
|
11
11
|
labelId?: string | undefined;
|
|
12
12
|
id?: string | undefined;
|
|
13
|
+
className?: string | undefined;
|
|
13
14
|
} & import("./selection/label-selection").LabelSelectionProps & import("./panel/panel").PanelProps & {
|
|
14
15
|
className?: string | undefined;
|
|
15
16
|
classStyle?: string | undefined;
|
|
@@ -4,5 +4,5 @@ type Props = PropsWithChildren<{
|
|
|
4
4
|
expanded?: boolean;
|
|
5
5
|
id?: string;
|
|
6
6
|
}>;
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
declare const _default: import("react").ComponentType<Props>;
|
|
8
|
+
export default _default;
|
|
@@ -5,6 +5,7 @@ type Props = PropsWithChildren<{
|
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
labelId?: string;
|
|
7
7
|
id?: string;
|
|
8
|
+
className?: string;
|
|
8
9
|
}>;
|
|
9
|
-
declare function SelectionContainer({ children, id, expanded, focused, disabled, labelId, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function SelectionContainer({ children, id, expanded, focused, disabled, labelId, className, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default SelectionContainer;
|
|
@@ -6,5 +6,6 @@ export type SelectionProps = {
|
|
|
6
6
|
editable?: boolean;
|
|
7
7
|
labelId?: string;
|
|
8
8
|
id?: string;
|
|
9
|
+
className?: string;
|
|
9
10
|
} & LabelSelectionProps;
|
|
10
|
-
export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, focused, onChange, selectedIndex, options, editable, labelId, id, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function Selection({ labelRenderer, placeholder, search, expanded, disabled, focused, onChange, selectedIndex, options, editable, labelId, id, className, }: SelectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { LunaticComponentProps } from '../type';
|
|
2
|
-
declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, errors, label, description, preferences, declarations, missing, missingResponse, management, response, getSuggesterStatus, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare function LunaticSuggester({ id, storeName, optionRenderer, labelRenderer, idbVersion, focused, value, handleChange, disabled, errors, label, description, preferences, declarations, missing, missingResponse, management, response, className, getSuggesterStatus, }: LunaticComponentProps<'Suggester'>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default LunaticSuggester;
|
|
@@ -46,6 +46,21 @@
|
|
|
46
46
|
"value": "true",
|
|
47
47
|
"type": "VTL"
|
|
48
48
|
},
|
|
49
|
+
"controls": [
|
|
50
|
+
{
|
|
51
|
+
"id": "age-controls",
|
|
52
|
+
"criticality": "ERROR",
|
|
53
|
+
"typeOfControl": "FORMAT",
|
|
54
|
+
"control": {
|
|
55
|
+
"value": "not(isnull(HELLO))",
|
|
56
|
+
"type": "VTL"
|
|
57
|
+
},
|
|
58
|
+
"errorMessage": {
|
|
59
|
+
"value": "\"Veuillez selectionner quelquechose\"",
|
|
60
|
+
"type": "VTL"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
],
|
|
49
64
|
"response": {
|
|
50
65
|
"name": "HELLO"
|
|
51
66
|
},
|