@kaushverse/pickify 1.0.2 → 1.0.3
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.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -54,7 +54,7 @@ type Props = {
|
|
|
54
54
|
onClose: () => void;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
declare function PickerModal({ visible, selectedValue, options, groups, styles, theme, renderTab, renderItem, renderContainer, onSelect, onClose, renderIcon, label, placeholder, error, labelStyle, selectBoxStyle, selectTextStyle, errorStyle }: Props & {
|
|
57
|
+
declare function PickerModal({ visible, selectedValue, options, groups, styles, theme, renderTab, renderItem, renderContainer, onSelect, onClose, renderIcon, label, placeholder, error, labelStyle, selectBoxStyle, selectTextStyle, errorStyle, }: Props & {
|
|
58
58
|
label?: string;
|
|
59
59
|
placeholder?: string;
|
|
60
60
|
error?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ type Props = {
|
|
|
54
54
|
onClose: () => void;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
declare function PickerModal({ visible, selectedValue, options, groups, styles, theme, renderTab, renderItem, renderContainer, onSelect, onClose, renderIcon, label, placeholder, error, labelStyle, selectBoxStyle, selectTextStyle, errorStyle }: Props & {
|
|
57
|
+
declare function PickerModal({ visible, selectedValue, options, groups, styles, theme, renderTab, renderItem, renderContainer, onSelect, onClose, renderIcon, label, placeholder, error, labelStyle, selectBoxStyle, selectTextStyle, errorStyle, }: Props & {
|
|
58
58
|
label?: string;
|
|
59
59
|
placeholder?: string;
|
|
60
60
|
error?: string;
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,8 @@ function PickerModal({
|
|
|
53
53
|
}) {
|
|
54
54
|
const [activeTab, setActiveTab] = (0, import_react.useState)(0);
|
|
55
55
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
56
|
-
const
|
|
56
|
+
const isControlled = visible !== void 0;
|
|
57
|
+
const isVisible = isControlled ? visible : open;
|
|
57
58
|
const hasGroups = groups.length > 0;
|
|
58
59
|
const currentOptions = hasGroups ? groups[activeTab]?.data || [] : options;
|
|
59
60
|
(0, import_react.useEffect)(() => {
|
package/dist/index.mjs
CHANGED
|
@@ -33,7 +33,8 @@ function PickerModal({
|
|
|
33
33
|
}) {
|
|
34
34
|
const [activeTab, setActiveTab] = useState(0);
|
|
35
35
|
const [open, setOpen] = useState(false);
|
|
36
|
-
const
|
|
36
|
+
const isControlled = visible !== void 0;
|
|
37
|
+
const isVisible = isControlled ? visible : open;
|
|
37
38
|
const hasGroups = groups.length > 0;
|
|
38
39
|
const currentOptions = hasGroups ? groups[activeTab]?.data || [] : options;
|
|
39
40
|
useEffect(() => {
|
package/package.json
CHANGED