@dreamcommerce/aurora 0.3.8 → 0.3.9
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/build/cjs/packages/aurora/src/components/dropdown/components/search.js +6 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/search.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/select.js +3 -2
- package/build/cjs/packages/aurora/src/components/dropdown/components/select.js.map +1 -1
- package/build/cjs/packages/aurora/src/constants/positions.js +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/search.js +7 -2
- package/build/esm/packages/aurora/src/components/dropdown/components/search.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/select.js +4 -3
- package/build/esm/packages/aurora/src/components/dropdown/components/select.js.map +1 -1
- package/build/esm/packages/aurora/src/constants/positions.d.ts +1 -1
- package/build/esm/packages/aurora/src/constants/positions.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var input = require('../../controls/components/input.js');
|
|
7
|
+
var index = require('../context/index.js');
|
|
7
8
|
var main_module = require('../../../css/dropdown/main.module.less.js');
|
|
9
|
+
var use_keyboard_open_close = require('../hooks/use_keyboard_open_close.js');
|
|
8
10
|
var css_classes = require('../css_classes.js');
|
|
9
11
|
|
|
10
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -23,7 +25,10 @@ var Search = function (_a) {
|
|
|
23
25
|
* on key up callback
|
|
24
26
|
*/
|
|
25
27
|
onKeyUp = _a.onKeyUp;
|
|
26
|
-
|
|
28
|
+
var _b = index.useDropdownContext(), toggleDropdown = _b.toggleDropdown, isOpen = _b.isOpen;
|
|
29
|
+
var ref = React.useRef(null);
|
|
30
|
+
use_keyboard_open_close.useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
31
|
+
return (React__default['default'].createElement("aside", { className: main_module['default'][css_classes.cssDropdownSearch], ref: ref },
|
|
27
32
|
React__default['default'].createElement(input['default'], { placeholder: "Szukaj", padding: "small", onKeyUp: onKeyUp, autoFocus: true })));
|
|
28
33
|
};
|
|
29
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -44,6 +44,7 @@ var Select = function (_a) {
|
|
|
44
44
|
* array of selected options
|
|
45
45
|
*/
|
|
46
46
|
selectedOptions = _a.selectedOptions;
|
|
47
|
+
var ref = React.useRef(null);
|
|
47
48
|
/**
|
|
48
49
|
* get values from dropdown context
|
|
49
50
|
*/
|
|
@@ -57,8 +58,8 @@ var Select = function (_a) {
|
|
|
57
58
|
*/
|
|
58
59
|
var notDisabled = selectedOptions.filter(function (option) { return !option.isDisabled; });
|
|
59
60
|
var $hiddenInputs = notDisabled.map(function (option) { return (React__default['default'].createElement("input", { key: option.value, type: "hidden", name: name, value: option.value, disabled: isDisabled, readOnly: isReadonly })); });
|
|
60
|
-
use_keyboard_open_close.useKeyboardOpenClose(toggleDropdown, isOpen);
|
|
61
|
-
return (React__default['default'].createElement("div", { className: main_module['default']['select'], "aria-expanded": isOpen, "aria-haspopup": "listbox" },
|
|
61
|
+
use_keyboard_open_close.useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
62
|
+
return (React__default['default'].createElement("div", { className: main_module['default']['select'], "aria-expanded": isOpen, "aria-haspopup": "listbox", ref: ref },
|
|
62
63
|
React__default['default'].createElement(input_wrapper['default'], { value: value, isFocused: Boolean(isOpen), isDisabled: isDisabled, isReadOnly: isReadonly, onClick: toggleDropdown }),
|
|
63
64
|
$hiddenInputs));
|
|
64
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import Input from '../../controls/components/input.js';
|
|
3
|
+
import { useDropdownContext } from '../context/index.js';
|
|
3
4
|
import cssClasses from '../../../css/dropdown/main.module.less.js';
|
|
5
|
+
import { useKeyboardOpenClose } from '../hooks/use_keyboard_open_close.js';
|
|
4
6
|
import { cssDropdownSearch } from '../css_classes.js';
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -15,7 +17,10 @@ var Search = function (_a) {
|
|
|
15
17
|
* on key up callback
|
|
16
18
|
*/
|
|
17
19
|
onKeyUp = _a.onKeyUp;
|
|
18
|
-
|
|
20
|
+
var _b = useDropdownContext(), toggleDropdown = _b.toggleDropdown, isOpen = _b.isOpen;
|
|
21
|
+
var ref = useRef(null);
|
|
22
|
+
useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
23
|
+
return (React.createElement("aside", { className: cssClasses[cssDropdownSearch], ref: ref },
|
|
19
24
|
React.createElement(Input, { placeholder: "Szukaj", padding: "small", onKeyUp: onKeyUp, autoFocus: true })));
|
|
20
25
|
};
|
|
21
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
2
|
import { useDropdownContext } from '../context/index.js';
|
|
3
3
|
import cssClasses from '../../../css/dropdown/main.module.less.js';
|
|
4
4
|
import InputWrapper from '../../controls/components/input_wrapper.js';
|
|
@@ -36,6 +36,7 @@ var Select = function (_a) {
|
|
|
36
36
|
* array of selected options
|
|
37
37
|
*/
|
|
38
38
|
selectedOptions = _a.selectedOptions;
|
|
39
|
+
var ref = useRef(null);
|
|
39
40
|
/**
|
|
40
41
|
* get values from dropdown context
|
|
41
42
|
*/
|
|
@@ -49,8 +50,8 @@ var Select = function (_a) {
|
|
|
49
50
|
*/
|
|
50
51
|
var notDisabled = selectedOptions.filter(function (option) { return !option.isDisabled; });
|
|
51
52
|
var $hiddenInputs = notDisabled.map(function (option) { return (React.createElement("input", { key: option.value, type: "hidden", name: name, value: option.value, disabled: isDisabled, readOnly: isReadonly })); });
|
|
52
|
-
useKeyboardOpenClose(toggleDropdown, isOpen);
|
|
53
|
-
return (React.createElement("div", { className: cssClasses['select'], "aria-expanded": isOpen, "aria-haspopup": "listbox" },
|
|
53
|
+
useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
54
|
+
return (React.createElement("div", { className: cssClasses['select'], "aria-expanded": isOpen, "aria-haspopup": "listbox", ref: ref },
|
|
54
55
|
React.createElement(InputWrapper, { value: value, isFocused: Boolean(isOpen), isDisabled: isDisabled, isReadOnly: isReadonly, onClick: toggleDropdown }),
|
|
55
56
|
$hiddenInputs));
|
|
56
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|
|
1
|
+
{"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
|