@majoo-ui/react 1.59.3-rc.7 → 1.59.3-rc.8
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ControllerStateAndHelpers, DownshiftProps } from 'downshift';
|
|
2
|
+
import { ControllerStateAndHelpers, DownshiftProps, StateChangeOptions } from 'downshift';
|
|
3
3
|
import { CSS } from '../../../../config/stitches.config';
|
|
4
4
|
export declare const SelectContainer: import("@stitches/react/types/styled-component").StyledComponent<"div", {
|
|
5
5
|
mobileOnly?: boolean | "true" | undefined;
|
|
@@ -824,6 +824,10 @@ interface InputSelectProps extends Omit<DownshiftProps<Option>, 'initialSelected
|
|
|
824
824
|
* Only show in desktop view.
|
|
825
825
|
*/
|
|
826
826
|
desktopOnly?: boolean;
|
|
827
|
+
/**
|
|
828
|
+
* Called whenever the InputSelect state changes.
|
|
829
|
+
*/
|
|
830
|
+
onStateChange?(state: StateChangeOptions<Option>): void;
|
|
827
831
|
}
|
|
828
832
|
export declare const InputSelect: React.ForwardRefExoticComponent<InputSelectProps & React.RefAttributes<HTMLInputElement>>;
|
|
829
833
|
export default InputSelect;
|
package/index.esm.js
CHANGED
|
@@ -11530,9 +11530,10 @@ const InputSelect = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
11530
11530
|
optionCss,
|
|
11531
11531
|
emptyDataMessage,
|
|
11532
11532
|
mobileOnly,
|
|
11533
|
-
desktopOnly
|
|
11533
|
+
desktopOnly,
|
|
11534
|
+
onStateChange
|
|
11534
11535
|
} = _a,
|
|
11535
|
-
props = __rest(_a, ["option", "onChange", "value", "placeholder", "searchPlaceholder", "embedSearch", "size", "disabled", "search", "iconColor", "hideArrowicon", "showLeadingIcon", "placement", "disabledOptions", "textSelector", "valueSelector", "readOnly", "isInvalid", "noOptionIcon", "fetchData", "onSearch", "isLoading", "showTooltip", "css", "renderFooter", "optionCss", "emptyDataMessage", "mobileOnly", "desktopOnly"]);
|
|
11536
|
+
props = __rest(_a, ["option", "onChange", "value", "placeholder", "searchPlaceholder", "embedSearch", "size", "disabled", "search", "iconColor", "hideArrowicon", "showLeadingIcon", "placement", "disabledOptions", "textSelector", "valueSelector", "readOnly", "isInvalid", "noOptionIcon", "fetchData", "onSearch", "isLoading", "showTooltip", "css", "renderFooter", "optionCss", "emptyDataMessage", "mobileOnly", "desktopOnly", "onStateChange"]);
|
|
11536
11537
|
const {
|
|
11537
11538
|
t
|
|
11538
11539
|
} = useTranslation(['MajooUI/inputSelect', 'translation']);
|
|
@@ -11607,6 +11608,7 @@ const InputSelect = /*#__PURE__*/React.forwardRef((_a, ref) => {
|
|
|
11607
11608
|
onSearch('');
|
|
11608
11609
|
setQuery('');
|
|
11609
11610
|
}
|
|
11611
|
+
if (onStateChange) onStateChange(state);
|
|
11610
11612
|
}
|
|
11611
11613
|
}, {
|
|
11612
11614
|
children: ({
|
package/index.umd.js
CHANGED
|
@@ -11622,7 +11622,8 @@
|
|
|
11622
11622
|
emptyDataMessage = _a.emptyDataMessage,
|
|
11623
11623
|
mobileOnly = _a.mobileOnly,
|
|
11624
11624
|
desktopOnly = _a.desktopOnly,
|
|
11625
|
-
|
|
11625
|
+
onStateChange = _a.onStateChange,
|
|
11626
|
+
props = __rest(_a, ["option", "onChange", "value", "placeholder", "searchPlaceholder", "embedSearch", "size", "disabled", "search", "iconColor", "hideArrowicon", "showLeadingIcon", "placement", "disabledOptions", "textSelector", "valueSelector", "readOnly", "isInvalid", "noOptionIcon", "fetchData", "onSearch", "isLoading", "showTooltip", "css", "renderFooter", "optionCss", "emptyDataMessage", "mobileOnly", "desktopOnly", "onStateChange"]);
|
|
11626
11627
|
var t = reactI18next.useTranslation(['MajooUI/inputSelect', 'translation']).t;
|
|
11627
11628
|
var _r = React.useState([]),
|
|
11628
11629
|
options = _r[0],
|
|
@@ -11725,6 +11726,7 @@
|
|
|
11725
11726
|
onSearch('');
|
|
11726
11727
|
setQuery('');
|
|
11727
11728
|
}
|
|
11729
|
+
if (onStateChange) onStateChange(state);
|
|
11728
11730
|
}
|
|
11729
11731
|
}, {
|
|
11730
11732
|
children: function (_a) {
|