@ballistix.digital/react-components 0.4.78 → 0.4.80
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/dist/index.d.ts +13 -9
- package/dist/index.esm.js +25 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +25 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { TButtonElementStyles as TButtonElementStyles$1 } from 'components/Eleme
|
|
|
7
7
|
import { TDropdownElementStyles as TDropdownElementStyles$1 } from 'components/Element/Dropdown';
|
|
8
8
|
import { TPagePaginationNavigationStyles as TPagePaginationNavigationStyles$1 } from 'components/Navigation/PagePagination';
|
|
9
9
|
export { createColumnHelper } from 'helpers/table';
|
|
10
|
+
import { Option, SelectValue } from 'react-tailwindcss-select/dist/components/type';
|
|
10
11
|
|
|
11
12
|
declare const base$j: {
|
|
12
13
|
loading: string;
|
|
@@ -783,23 +784,17 @@ type TSelectMenuFormProps = {
|
|
|
783
784
|
value: string;
|
|
784
785
|
disabled?: boolean;
|
|
785
786
|
};
|
|
786
|
-
error?: string;
|
|
787
|
+
error?: string | Option | Option[];
|
|
787
788
|
isLoading?: boolean;
|
|
788
789
|
isRequired?: boolean;
|
|
789
790
|
isTouched?: boolean;
|
|
790
791
|
isDisabled?: boolean;
|
|
791
792
|
isClearable?: boolean;
|
|
792
793
|
isSearchable?: boolean;
|
|
793
|
-
|
|
794
|
+
isMultiple?: boolean;
|
|
794
795
|
isDarkMode?: boolean;
|
|
795
796
|
isSolo?: boolean;
|
|
796
|
-
onChange?: (value:
|
|
797
|
-
value: string;
|
|
798
|
-
label: string;
|
|
799
|
-
}[] | {
|
|
800
|
-
value: string;
|
|
801
|
-
label: string;
|
|
802
|
-
} | string) => void;
|
|
797
|
+
onChange?: (value: SelectValue) => void;
|
|
803
798
|
onSearchInputChange?: ((e: ChangeEvent<HTMLInputElement>) => void) | undefined;
|
|
804
799
|
onClear: (name: string) => void;
|
|
805
800
|
onBlur?: any;
|
|
@@ -819,9 +814,18 @@ declare const base: {
|
|
|
819
814
|
input: string;
|
|
820
815
|
menuButton: string;
|
|
821
816
|
menu: string;
|
|
817
|
+
tagItem: string;
|
|
818
|
+
tagItemText: string;
|
|
819
|
+
tagItemIconContainer: string;
|
|
820
|
+
tagItemIcon: string;
|
|
822
821
|
list: string;
|
|
822
|
+
listGroupLabel: string;
|
|
823
823
|
listItem: string;
|
|
824
|
+
listDisabledItem: string;
|
|
824
825
|
searchContainer: string;
|
|
826
|
+
searchBox: string;
|
|
827
|
+
searchIcon: string;
|
|
828
|
+
closeIcon: string;
|
|
825
829
|
emptyState: string;
|
|
826
830
|
trailing: string;
|
|
827
831
|
description: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -2618,7 +2618,7 @@ const Select = ({ options = [], value = null, onChange, onSearchInputChange, pla
|
|
|
2618
2618
|
|
|
2619
2619
|
var SelectMenuForm = function (props) {
|
|
2620
2620
|
var _a;
|
|
2621
|
-
var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.type, type = _c === void 0 ? 'normal' : _c, _d = props.isRequired, isRequired = _d === void 0 ? false : _d, isLoading = props.isLoading, _e = props.isTouched, isTouched = _e === void 0 ? false : _e, isDisabled = props.isDisabled, _f = props.isClearable, isClearable = _f === void 0 ? true : _f, _g = props.
|
|
2621
|
+
var _b = props.name, name = _b === void 0 ? 'select-menu-form' : _b, label = props.label, description = props.description, placeholder = props.placeholder, options = props.options, required = props.required, value = props.value, error = props.error, _c = props.type, type = _c === void 0 ? 'normal' : _c, _d = props.isRequired, isRequired = _d === void 0 ? false : _d, isLoading = props.isLoading, _e = props.isTouched, isTouched = _e === void 0 ? false : _e, isDisabled = props.isDisabled, _f = props.isClearable, isClearable = _f === void 0 ? true : _f, _g = props.isMultiple, isMultiple = _g === void 0 ? false : _g, _h = props.isSearchable, isSearchable = _h === void 0 ? true : _h, _j = props.isSolo, isSolo = _j === void 0 ? false : _j, onChange = props.onChange, onSearchInputChange = props.onSearchInputChange, onClear = props.onClear, onBlur = props.onBlur, stylesOverrides = props.styles;
|
|
2622
2622
|
var _k = useState(value !== null && value !== void 0 ? value : null), state = _k[0], setState = _k[1];
|
|
2623
2623
|
var _l = useState(true), isFocus = _l[0], setIsFocus = _l[1];
|
|
2624
2624
|
var isValid = error === undefined;
|
|
@@ -2630,9 +2630,9 @@ var SelectMenuForm = function (props) {
|
|
|
2630
2630
|
});
|
|
2631
2631
|
return result;
|
|
2632
2632
|
};
|
|
2633
|
-
var handleChange = function (
|
|
2634
|
-
setState(
|
|
2635
|
-
onChange && onChange(
|
|
2633
|
+
var handleChange = function (selectValue) {
|
|
2634
|
+
setState(selectValue);
|
|
2635
|
+
onChange && onChange(selectValue);
|
|
2636
2636
|
setIsFocus(false);
|
|
2637
2637
|
};
|
|
2638
2638
|
var styles$1 = handleGenerateStyle();
|
|
@@ -2654,7 +2654,7 @@ var SelectMenuForm = function (props) {
|
|
|
2654
2654
|
//
|
|
2655
2655
|
placeholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.select, noOptionsMessage: (jsx("p", __assign({ className: styles$1.emptyState }, { children: (_a = placeholder === null || placeholder === void 0 ? void 0 : placeholder.emptyState) !== null && _a !== void 0 ? _a : 'No results found' }))), searchInputPlaceholder: placeholder === null || placeholder === void 0 ? void 0 : placeholder.searchInput,
|
|
2656
2656
|
//
|
|
2657
|
-
loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple:
|
|
2657
|
+
loading: isLoading, isDisabled: isDisabled, isClearable: isClearable, isMultiple: isMultiple, isSearchable: isSearchable,
|
|
2658
2658
|
//
|
|
2659
2659
|
options: options,
|
|
2660
2660
|
//
|
|
@@ -2662,13 +2662,22 @@ var SelectMenuForm = function (props) {
|
|
|
2662
2662
|
//
|
|
2663
2663
|
classNames: {
|
|
2664
2664
|
menuButton: function () {
|
|
2665
|
-
return toClassName(styles$1.input, state === null && '[&>*]:!text-gray-300 ');
|
|
2665
|
+
return toClassName(styles$1.input, state === null && isValid && '[&>*]:!text-gray-300 ', state === null && !isValid && '[&>*]:!text-red-300');
|
|
2666
2666
|
},
|
|
2667
2667
|
menu: styles$1.menu,
|
|
2668
|
+
tagItem: function () { return styles$1.tagItem; },
|
|
2669
|
+
tagItemText: styles$1.tagItemText,
|
|
2670
|
+
tagItemIconContainer: styles$1.tagItemIconContainer,
|
|
2671
|
+
tagItemIcon: styles$1.tagItemIcon,
|
|
2668
2672
|
list: styles$1.list,
|
|
2669
2673
|
listItem: function () { return styles$1.listItem; },
|
|
2674
|
+
listDisabledItem: styles$1.listDisabledItem,
|
|
2675
|
+
listGroupLabel: styles$1.listGroupLabel,
|
|
2670
2676
|
searchContainer: styles$1.searchContainer,
|
|
2671
|
-
|
|
2677
|
+
searchBox: styles$1.searchBox,
|
|
2678
|
+
searchIcon: styles$1.searchIcon,
|
|
2679
|
+
closeIcon: styles$1.closeIcon,
|
|
2680
|
+
} }), !isSolo && (jsxs("div", __assign({ className: styles$1.foot }, { children: [description && !(error && isTouched) && (jsx("p", __assign({ className: styles$1.description }, { children: description }))), error && isTouched && (jsx("p", __assign({ className: styles$1.error }, { children: JSON.stringify(error) })))] })))] }))] })));
|
|
2672
2681
|
};
|
|
2673
2682
|
|
|
2674
2683
|
var base = {
|
|
@@ -2682,9 +2691,18 @@ var base = {
|
|
|
2682
2691
|
input: 'block w-full flex border',
|
|
2683
2692
|
menuButton: '',
|
|
2684
2693
|
menu: '!px-0 !py-0 !w-full rounded-md overflow-hidden border !mt-1 absolute bg-white',
|
|
2694
|
+
tagItem: '',
|
|
2695
|
+
tagItemText: '',
|
|
2696
|
+
tagItemIconContainer: '',
|
|
2697
|
+
tagItemIcon: '',
|
|
2685
2698
|
list: '!px-0 !w-full [&>*]:px-0 max-h-56 overflow-scroll !py-1',
|
|
2699
|
+
listGroupLabel: '',
|
|
2686
2700
|
listItem: '!w-full !list-none hover:bg-primary-500 hover:text-white !py-2 !px-2',
|
|
2701
|
+
listDisabledItem: '',
|
|
2687
2702
|
searchContainer: '!w-full !px-2 !py-2 border-b',
|
|
2703
|
+
searchBox: '',
|
|
2704
|
+
searchIcon: '',
|
|
2705
|
+
closeIcon: '',
|
|
2688
2706
|
emptyState: 'w-full inline-flex items-start justify-start px-4',
|
|
2689
2707
|
trailing: 'pointer-events-none absolute inset-y-0 right-0 flex items-center',
|
|
2690
2708
|
description: 'text-gray-400 text-xs mt-1',
|