@kaushverse/pickify 1.0.10 → 1.0.11
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +17 -5
- package/dist/index.mjs +26 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3,9 +3,9 @@ import React$1 from 'react';
|
|
|
3
3
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
5
|
type IconRenderer = (props: {
|
|
6
|
-
name
|
|
7
|
-
size
|
|
8
|
-
color
|
|
6
|
+
name?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
color?: string;
|
|
9
9
|
}) => React.ReactNode;
|
|
10
10
|
|
|
11
11
|
type Option = {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import React$1 from 'react';
|
|
|
3
3
|
import { TextStyle, ViewStyle } from 'react-native';
|
|
4
4
|
|
|
5
5
|
type IconRenderer = (props: {
|
|
6
|
-
name
|
|
7
|
-
size
|
|
8
|
-
color
|
|
6
|
+
name?: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
color?: string;
|
|
9
9
|
}) => React.ReactNode;
|
|
10
10
|
|
|
11
11
|
type Option = {
|
package/dist/index.js
CHANGED
|
@@ -274,14 +274,27 @@ var toggleValue = (arr, value) => {
|
|
|
274
274
|
var import_react2 = require("react");
|
|
275
275
|
var import_react_native2 = require("react-native");
|
|
276
276
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
277
|
+
if (import_react_native2.Platform.OS === "android") {
|
|
278
|
+
import_react_native2.UIManager.setLayoutAnimationEnabledExperimental?.(true);
|
|
279
|
+
}
|
|
277
280
|
function MultiPickerGroup({
|
|
278
281
|
label,
|
|
279
282
|
children,
|
|
280
283
|
renderGroupIcon
|
|
281
284
|
}) {
|
|
282
285
|
const [open, setOpen] = (0, import_react2.useState)(true);
|
|
286
|
+
const toggle = () => {
|
|
287
|
+
import_react_native2.LayoutAnimation.configureNext(
|
|
288
|
+
import_react_native2.LayoutAnimation.create(
|
|
289
|
+
250,
|
|
290
|
+
import_react_native2.LayoutAnimation.Types.easeInEaseOut,
|
|
291
|
+
import_react_native2.LayoutAnimation.Properties.opacity
|
|
292
|
+
)
|
|
293
|
+
);
|
|
294
|
+
setOpen((prev) => !prev);
|
|
295
|
+
};
|
|
283
296
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_native2.View, { style: styles.group, children: [
|
|
284
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_native2.TouchableOpacity, { style: styles.header, onPress:
|
|
297
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react_native2.TouchableOpacity, { style: styles.header, onPress: toggle, children: [
|
|
285
298
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.Text, { style: styles.title, children: label }),
|
|
286
299
|
renderGroupIcon?.({
|
|
287
300
|
name: open ? "chevron-up" : "chevron-down",
|
|
@@ -289,7 +302,7 @@ function MultiPickerGroup({
|
|
|
289
302
|
color: "#6B7280"
|
|
290
303
|
})
|
|
291
304
|
] }),
|
|
292
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { style:
|
|
305
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { style: styles.content, children })
|
|
293
306
|
] });
|
|
294
307
|
}
|
|
295
308
|
var styles = import_react_native2.StyleSheet.create({
|
|
@@ -305,9 +318,8 @@ var styles = import_react_native2.StyleSheet.create({
|
|
|
305
318
|
fontWeight: "600",
|
|
306
319
|
fontSize: 14
|
|
307
320
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
color: "#6B7280"
|
|
321
|
+
content: {
|
|
322
|
+
marginTop: 6
|
|
311
323
|
}
|
|
312
324
|
});
|
|
313
325
|
|
package/dist/index.mjs
CHANGED
|
@@ -255,16 +255,37 @@ var toggleValue = (arr, value) => {
|
|
|
255
255
|
|
|
256
256
|
// src/components/MultiPickerGroup.tsx
|
|
257
257
|
import { useState as useState2 } from "react";
|
|
258
|
-
import {
|
|
258
|
+
import {
|
|
259
|
+
View as View2,
|
|
260
|
+
Text as Text2,
|
|
261
|
+
TouchableOpacity as TouchableOpacity2,
|
|
262
|
+
StyleSheet as StyleSheet2,
|
|
263
|
+
LayoutAnimation,
|
|
264
|
+
Platform,
|
|
265
|
+
UIManager
|
|
266
|
+
} from "react-native";
|
|
259
267
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
268
|
+
if (Platform.OS === "android") {
|
|
269
|
+
UIManager.setLayoutAnimationEnabledExperimental?.(true);
|
|
270
|
+
}
|
|
260
271
|
function MultiPickerGroup({
|
|
261
272
|
label,
|
|
262
273
|
children,
|
|
263
274
|
renderGroupIcon
|
|
264
275
|
}) {
|
|
265
276
|
const [open, setOpen] = useState2(true);
|
|
277
|
+
const toggle = () => {
|
|
278
|
+
LayoutAnimation.configureNext(
|
|
279
|
+
LayoutAnimation.create(
|
|
280
|
+
250,
|
|
281
|
+
LayoutAnimation.Types.easeInEaseOut,
|
|
282
|
+
LayoutAnimation.Properties.opacity
|
|
283
|
+
)
|
|
284
|
+
);
|
|
285
|
+
setOpen((prev) => !prev);
|
|
286
|
+
};
|
|
266
287
|
return /* @__PURE__ */ jsxs2(View2, { style: styles.group, children: [
|
|
267
|
-
/* @__PURE__ */ jsxs2(TouchableOpacity2, { style: styles.header, onPress:
|
|
288
|
+
/* @__PURE__ */ jsxs2(TouchableOpacity2, { style: styles.header, onPress: toggle, children: [
|
|
268
289
|
/* @__PURE__ */ jsx2(Text2, { style: styles.title, children: label }),
|
|
269
290
|
renderGroupIcon?.({
|
|
270
291
|
name: open ? "chevron-up" : "chevron-down",
|
|
@@ -272,7 +293,7 @@ function MultiPickerGroup({
|
|
|
272
293
|
color: "#6B7280"
|
|
273
294
|
})
|
|
274
295
|
] }),
|
|
275
|
-
open && /* @__PURE__ */ jsx2(View2, { style:
|
|
296
|
+
open && /* @__PURE__ */ jsx2(View2, { style: styles.content, children })
|
|
276
297
|
] });
|
|
277
298
|
}
|
|
278
299
|
var styles = StyleSheet2.create({
|
|
@@ -288,9 +309,8 @@ var styles = StyleSheet2.create({
|
|
|
288
309
|
fontWeight: "600",
|
|
289
310
|
fontSize: 14
|
|
290
311
|
},
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
color: "#6B7280"
|
|
312
|
+
content: {
|
|
313
|
+
marginTop: 6
|
|
294
314
|
}
|
|
295
315
|
});
|
|
296
316
|
|
package/package.json
CHANGED