@dreamcommerce/aurora 2.6.1-1 → 2.6.2-1
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/custom_label.js +7 -2
- package/build/cjs/packages/aurora/src/components/dropdown/components/custom_label.js.map +1 -1
- package/build/cjs/packages/aurora/src/components/dropdown/components/label.js +11 -2
- package/build/cjs/packages/aurora/src/components/dropdown/components/label.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/custom_label.js +7 -2
- package/build/esm/packages/aurora/src/components/dropdown/components/custom_label.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/components/label.js +11 -2
- package/build/esm/packages/aurora/src/components/dropdown/components/label.js.map +1 -1
- package/build/esm/packages/aurora/src/components/dropdown/types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -10,11 +10,16 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
12
|
|
|
13
|
-
const CustomLabel = ({ children }) => {
|
|
13
|
+
const CustomLabel = ({ children, disabled }) => {
|
|
14
14
|
const { toggleDropdown, isOpen } = index.useDropdownContext();
|
|
15
15
|
const ref = React.useRef(null);
|
|
16
16
|
use_keyboard_open_close.useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
17
|
-
|
|
17
|
+
const handleOnClick = () => {
|
|
18
|
+
if (disabled)
|
|
19
|
+
return;
|
|
20
|
+
toggleDropdown && toggleDropdown();
|
|
21
|
+
};
|
|
22
|
+
return (React__default['default'].createElement("div", { onClick: handleOnClick, ref: ref, tabIndex: 0 }, children));
|
|
18
23
|
};
|
|
19
24
|
|
|
20
25
|
exports.default = CustomLabel;
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -25,11 +25,20 @@ label,
|
|
|
25
25
|
/**
|
|
26
26
|
* Custom className
|
|
27
27
|
*/
|
|
28
|
-
cssClass
|
|
28
|
+
cssClass,
|
|
29
|
+
/**
|
|
30
|
+
* Allow to disable dropdown
|
|
31
|
+
*/
|
|
32
|
+
disabled }) => {
|
|
29
33
|
const { toggleDropdown, isOpen } = index.useDropdownContext();
|
|
30
34
|
const ref = React.useRef(null);
|
|
31
35
|
use_keyboard_open_close.useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
32
|
-
|
|
36
|
+
const handleOnClick = () => {
|
|
37
|
+
if (disabled)
|
|
38
|
+
return;
|
|
39
|
+
toggleDropdown && toggleDropdown();
|
|
40
|
+
};
|
|
41
|
+
return (React__default['default'].createElement("span", { onClick: handleOnClick, tabIndex: 0, ref: ref, className: cssClass, "data-test-id": constants.DROPDOWN_TEST_ID.label }, label));
|
|
33
42
|
};
|
|
34
43
|
|
|
35
44
|
exports.default = Label;
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -2,11 +2,16 @@ import React, { useRef } from 'react';
|
|
|
2
2
|
import { useDropdownContext } from '../context/index.js';
|
|
3
3
|
import { useKeyboardOpenClose } from '../hooks/use_keyboard_open_close.js';
|
|
4
4
|
|
|
5
|
-
const CustomLabel = ({ children }) => {
|
|
5
|
+
const CustomLabel = ({ children, disabled }) => {
|
|
6
6
|
const { toggleDropdown, isOpen } = useDropdownContext();
|
|
7
7
|
const ref = useRef(null);
|
|
8
8
|
useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
9
|
-
|
|
9
|
+
const handleOnClick = () => {
|
|
10
|
+
if (disabled)
|
|
11
|
+
return;
|
|
12
|
+
toggleDropdown && toggleDropdown();
|
|
13
|
+
};
|
|
14
|
+
return (React.createElement("div", { onClick: handleOnClick, ref: ref, tabIndex: 0 }, children));
|
|
10
15
|
};
|
|
11
16
|
|
|
12
17
|
export default CustomLabel;
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -17,11 +17,20 @@ label,
|
|
|
17
17
|
/**
|
|
18
18
|
* Custom className
|
|
19
19
|
*/
|
|
20
|
-
cssClass
|
|
20
|
+
cssClass,
|
|
21
|
+
/**
|
|
22
|
+
* Allow to disable dropdown
|
|
23
|
+
*/
|
|
24
|
+
disabled }) => {
|
|
21
25
|
const { toggleDropdown, isOpen } = useDropdownContext();
|
|
22
26
|
const ref = useRef(null);
|
|
23
27
|
useKeyboardOpenClose(toggleDropdown, isOpen, ref);
|
|
24
|
-
|
|
28
|
+
const handleOnClick = () => {
|
|
29
|
+
if (disabled)
|
|
30
|
+
return;
|
|
31
|
+
toggleDropdown && toggleDropdown();
|
|
32
|
+
};
|
|
33
|
+
return (React.createElement("span", { onClick: handleOnClick, tabIndex: 0, ref: ref, className: cssClass, "data-test-id": DROPDOWN_TEST_ID.label }, label));
|
|
25
34
|
};
|
|
26
35
|
|
|
27
36
|
export default Label;
|
|
@@ -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;"}
|
|
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;"}
|
|
@@ -33,8 +33,10 @@ export interface IDropdownSelectProps {
|
|
|
33
33
|
export interface IDropdownLabelProps {
|
|
34
34
|
label: string;
|
|
35
35
|
cssClass?: string;
|
|
36
|
+
disabled?: boolean;
|
|
36
37
|
}
|
|
37
38
|
export interface IDropdownCustomLabelProps {
|
|
39
|
+
disabled?: boolean;
|
|
38
40
|
}
|
|
39
41
|
export interface IDropdownContentProps {
|
|
40
42
|
search?: ReactNode;
|