@tecsinapse/react-web-kit 3.4.1 → 3.4.2
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.
|
@@ -26,6 +26,9 @@ const Select = ({
|
|
|
26
26
|
displayTextProps,
|
|
27
27
|
selectAllLabel = "Select all",
|
|
28
28
|
multiLabels,
|
|
29
|
+
variant = "default",
|
|
30
|
+
hint,
|
|
31
|
+
hintComponent,
|
|
29
32
|
...rest
|
|
30
33
|
}) => {
|
|
31
34
|
const [dropDownVisible, setDropDownVisible] = React.useState(false);
|
|
@@ -33,6 +36,7 @@ const Select = ({
|
|
|
33
36
|
const refDropDown = React.useRef(null);
|
|
34
37
|
const transitionRef = React.useRef(null);
|
|
35
38
|
useClickAwayListener.useClickAwayListener(refDropDown, setDropDownVisible);
|
|
39
|
+
const _hint = hintComponent || /* @__PURE__ */ React.createElement(reactCore.Hint, { text: hint, variant });
|
|
36
40
|
const instanceid = React.useId();
|
|
37
41
|
React.useEffect(() => {
|
|
38
42
|
if (typeof options !== "function") {
|
|
@@ -134,7 +138,7 @@ const Select = ({
|
|
|
134
138
|
},
|
|
135
139
|
displayValue
|
|
136
140
|
)
|
|
137
|
-
)), /* @__PURE__ */ React.createElement(
|
|
141
|
+
)), _hint, /* @__PURE__ */ React.createElement(
|
|
138
142
|
reactTransitionGroup.Transition,
|
|
139
143
|
{
|
|
140
144
|
in: dropDownVisible,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PressableInputContainer, Text } from '@tecsinapse/react-core';
|
|
1
|
+
import { PressableInputContainer, Text, Hint } from '@tecsinapse/react-core';
|
|
2
2
|
import React__default, { useState, useId, useEffect, useMemo } from 'react';
|
|
3
3
|
import { Transition } from 'react-transition-group';
|
|
4
4
|
import { useClickAwayListener } from '../../../hooks/useClickAwayListener.js';
|
|
@@ -24,6 +24,9 @@ const Select = ({
|
|
|
24
24
|
displayTextProps,
|
|
25
25
|
selectAllLabel = "Select all",
|
|
26
26
|
multiLabels,
|
|
27
|
+
variant = "default",
|
|
28
|
+
hint,
|
|
29
|
+
hintComponent,
|
|
27
30
|
...rest
|
|
28
31
|
}) => {
|
|
29
32
|
const [dropDownVisible, setDropDownVisible] = React__default.useState(false);
|
|
@@ -31,6 +34,7 @@ const Select = ({
|
|
|
31
34
|
const refDropDown = React__default.useRef(null);
|
|
32
35
|
const transitionRef = React__default.useRef(null);
|
|
33
36
|
useClickAwayListener(refDropDown, setDropDownVisible);
|
|
37
|
+
const _hint = hintComponent || /* @__PURE__ */ React__default.createElement(Hint, { text: hint, variant });
|
|
34
38
|
const instanceid = useId();
|
|
35
39
|
useEffect(() => {
|
|
36
40
|
if (typeof options !== "function") {
|
|
@@ -132,7 +136,7 @@ const Select = ({
|
|
|
132
136
|
},
|
|
133
137
|
displayValue
|
|
134
138
|
)
|
|
135
|
-
)), /* @__PURE__ */ React__default.createElement(
|
|
139
|
+
)), _hint, /* @__PURE__ */ React__default.createElement(
|
|
136
140
|
Transition,
|
|
137
141
|
{
|
|
138
142
|
in: dropDownVisible,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextProps } from '@tecsinapse/react-core';
|
|
1
|
+
import { InputVariantType, TextProps } from '@tecsinapse/react-core';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MultiLabels } from './types';
|
|
4
4
|
export interface SelectProps<Data, Type extends 'single' | 'multi'> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
@@ -18,6 +18,9 @@ export interface SelectProps<Data, Type extends 'single' | 'multi'> extends Omit
|
|
|
18
18
|
anchor?: 'top' | 'bottom';
|
|
19
19
|
displayTextProps?: TextProps;
|
|
20
20
|
multiLabels?: MultiLabels;
|
|
21
|
+
variant?: InputVariantType;
|
|
22
|
+
hint?: string;
|
|
23
|
+
hintComponent?: JSX.Element;
|
|
21
24
|
}
|
|
22
|
-
declare const Select: <Data, Type extends "single" | "multi">({ value, options, keyExtractor, onSelect, type, labelExtractor, placeholder, onSearch, searchBarPlaceholder, hideSearchBar, label, disabled, anchor, displayTextProps, selectAllLabel, multiLabels, ...rest }: SelectProps<Data, Type>) => JSX.Element;
|
|
25
|
+
declare const Select: <Data, Type extends "single" | "multi">({ value, options, keyExtractor, onSelect, type, labelExtractor, placeholder, onSearch, searchBarPlaceholder, hideSearchBar, label, disabled, anchor, displayTextProps, selectAllLabel, multiLabels, variant, hint, hintComponent, ...rest }: SelectProps<Data, Type>) => JSX.Element;
|
|
23
26
|
export default Select;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/react-web-kit",
|
|
3
3
|
"description": "TecSinapse React components",
|
|
4
|
-
"version": "3.4.
|
|
4
|
+
"version": "3.4.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"module": "dist/esm/index.js",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"react-dom": "^18.0.0",
|
|
41
41
|
"react-native-web": ">=0.18.0 <1"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "c990b8df085b943b02ce3d1aa7fb63c0b8aa6910"
|
|
44
44
|
}
|