@kaushverse/pickify 1.1.4 → 1.1.5
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +9 -5
- package/dist/index.mjs +9 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -97,6 +97,7 @@ type MultiPickerGroupProps = {
|
|
|
97
97
|
children: React.ReactNode;
|
|
98
98
|
renderGroupIcon?: IconRenderer;
|
|
99
99
|
styles?: MultiPickerGroupStyles;
|
|
100
|
+
defaultOpen: boolean;
|
|
100
101
|
};
|
|
101
102
|
type MultiPickerStyles = {
|
|
102
103
|
overlay?: ViewStyle;
|
|
@@ -160,7 +161,7 @@ declare class FloatingButton extends React$1.Component<Props> {
|
|
|
160
161
|
|
|
161
162
|
declare function MultiPickerItem({ label, selected, onPress, renderItemIcon, styles: customStyles, }: MultiPickerItemProps): react_jsx_runtime.JSX.Element;
|
|
162
163
|
|
|
163
|
-
declare function MultiPickerGroup({ label, children, renderGroupIcon, }: MultiPickerGroupProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
declare function MultiPickerGroup({ label, children, renderGroupIcon, defaultOpen, }: MultiPickerGroupProps): react_jsx_runtime.JSX.Element;
|
|
164
165
|
|
|
165
166
|
declare const toggleValue: (arr: string[], value: string) => string[];
|
|
166
167
|
|
package/dist/index.d.ts
CHANGED
|
@@ -97,6 +97,7 @@ type MultiPickerGroupProps = {
|
|
|
97
97
|
children: React.ReactNode;
|
|
98
98
|
renderGroupIcon?: IconRenderer;
|
|
99
99
|
styles?: MultiPickerGroupStyles;
|
|
100
|
+
defaultOpen: boolean;
|
|
100
101
|
};
|
|
101
102
|
type MultiPickerStyles = {
|
|
102
103
|
overlay?: ViewStyle;
|
|
@@ -160,7 +161,7 @@ declare class FloatingButton extends React$1.Component<Props> {
|
|
|
160
161
|
|
|
161
162
|
declare function MultiPickerItem({ label, selected, onPress, renderItemIcon, styles: customStyles, }: MultiPickerItemProps): react_jsx_runtime.JSX.Element;
|
|
162
163
|
|
|
163
|
-
declare function MultiPickerGroup({ label, children, renderGroupIcon, }: MultiPickerGroupProps): react_jsx_runtime.JSX.Element;
|
|
164
|
+
declare function MultiPickerGroup({ label, children, renderGroupIcon, defaultOpen, }: MultiPickerGroupProps): react_jsx_runtime.JSX.Element;
|
|
164
165
|
|
|
165
166
|
declare const toggleValue: (arr: string[], value: string) => string[];
|
|
166
167
|
|
package/dist/index.js
CHANGED
|
@@ -288,9 +288,10 @@ var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
|
288
288
|
function MultiPickerGroup({
|
|
289
289
|
label,
|
|
290
290
|
children,
|
|
291
|
-
renderGroupIcon
|
|
291
|
+
renderGroupIcon,
|
|
292
|
+
defaultOpen = false
|
|
292
293
|
}) {
|
|
293
|
-
const [open, setOpen] = (0, import_react2.useState)(
|
|
294
|
+
const [open, setOpen] = (0, import_react2.useState)(defaultOpen);
|
|
294
295
|
const [contentHeight, setContentHeight] = (0, import_react2.useState)(0);
|
|
295
296
|
const animatedHeight = (0, import_react2.useRef)(new import_react_native2.Animated.Value(0)).current;
|
|
296
297
|
const toggle = () => {
|
|
@@ -464,11 +465,12 @@ function MultiPickerModal({
|
|
|
464
465
|
};
|
|
465
466
|
const renderList = () => {
|
|
466
467
|
if (groups.length > 0) {
|
|
467
|
-
return groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
468
|
+
return groups.map((group, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
468
469
|
MultiPickerGroup,
|
|
469
470
|
{
|
|
470
471
|
label: group.label,
|
|
471
472
|
renderGroupIcon,
|
|
473
|
+
defaultOpen: index === 0,
|
|
472
474
|
children: group.data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
473
475
|
MultiPickerItem,
|
|
474
476
|
{
|
|
@@ -611,8 +613,10 @@ var FloatingButton = class extends import_react4.default.Component {
|
|
|
611
613
|
if (mode === "circle") {
|
|
612
614
|
const angleStep = Math.PI / 2;
|
|
613
615
|
const angle = index / (actions.length - 1 || 1) * angleStep;
|
|
614
|
-
|
|
615
|
-
|
|
616
|
+
const adjustedRadiusX = radius * 0.7;
|
|
617
|
+
const adjustedRadiusY = radius;
|
|
618
|
+
translateX = -adjustedRadiusX * Math.cos(angle);
|
|
619
|
+
translateY = -adjustedRadiusY * Math.sin(angle);
|
|
616
620
|
}
|
|
617
621
|
const animStyle = {
|
|
618
622
|
transform: [
|
package/dist/index.mjs
CHANGED
|
@@ -266,9 +266,10 @@ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
|
266
266
|
function MultiPickerGroup({
|
|
267
267
|
label,
|
|
268
268
|
children,
|
|
269
|
-
renderGroupIcon
|
|
269
|
+
renderGroupIcon,
|
|
270
|
+
defaultOpen = false
|
|
270
271
|
}) {
|
|
271
|
-
const [open, setOpen] = useState2(
|
|
272
|
+
const [open, setOpen] = useState2(defaultOpen);
|
|
272
273
|
const [contentHeight, setContentHeight] = useState2(0);
|
|
273
274
|
const animatedHeight = useRef(new Animated.Value(0)).current;
|
|
274
275
|
const toggle = () => {
|
|
@@ -442,11 +443,12 @@ function MultiPickerModal({
|
|
|
442
443
|
};
|
|
443
444
|
const renderList = () => {
|
|
444
445
|
if (groups.length > 0) {
|
|
445
|
-
return groups.map((group) => /* @__PURE__ */ jsx4(
|
|
446
|
+
return groups.map((group, index) => /* @__PURE__ */ jsx4(
|
|
446
447
|
MultiPickerGroup,
|
|
447
448
|
{
|
|
448
449
|
label: group.label,
|
|
449
450
|
renderGroupIcon,
|
|
451
|
+
defaultOpen: index === 0,
|
|
450
452
|
children: group.data.map((item) => /* @__PURE__ */ jsx4(
|
|
451
453
|
MultiPickerItem,
|
|
452
454
|
{
|
|
@@ -594,8 +596,10 @@ var FloatingButton = class extends React4.Component {
|
|
|
594
596
|
if (mode === "circle") {
|
|
595
597
|
const angleStep = Math.PI / 2;
|
|
596
598
|
const angle = index / (actions.length - 1 || 1) * angleStep;
|
|
597
|
-
|
|
598
|
-
|
|
599
|
+
const adjustedRadiusX = radius * 0.7;
|
|
600
|
+
const adjustedRadiusY = radius;
|
|
601
|
+
translateX = -adjustedRadiusX * Math.cos(angle);
|
|
602
|
+
translateY = -adjustedRadiusY * Math.sin(angle);
|
|
599
603
|
}
|
|
600
604
|
const animStyle = {
|
|
601
605
|
transform: [
|
package/package.json
CHANGED