react-crud-mobile 1.3.556 → 1.3.558
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.js +2 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIButton.tsx +4 -10
- package/src/elements/core/UIModal.tsx +1 -1
package/dist/index.mjs
CHANGED
|
@@ -375,7 +375,6 @@ function LoadingIcon({ color }) {
|
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
// src/elements/core/UIButton.tsx
|
|
378
|
-
import Animated2, { useSharedValue, useAnimatedStyle, withTiming } from "react-native-reanimated";
|
|
379
378
|
import { Fragment as Fragment5, jsx as jsx9, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
380
379
|
var BUTTONS_SIZE = { small: { minWidth: 30, height: 30 } };
|
|
381
380
|
function UIButton(props) {
|
|
@@ -390,11 +389,6 @@ function UIButton(props) {
|
|
|
390
389
|
let label = scope.getLabel();
|
|
391
390
|
let icon = scope.getPart("icon");
|
|
392
391
|
let children = ComponentUtils.getChild(props, "button");
|
|
393
|
-
const pressed = useSharedValue(0);
|
|
394
|
-
const animatedStyle = useAnimatedStyle(() => ({
|
|
395
|
-
transform: [{ translateY: withTiming(pressed.value ? 2 : 0, { duration: 80 }) }],
|
|
396
|
-
opacity: withTiming(pressed.value ? 0.9 : 1, { duration: 80 })
|
|
397
|
-
}));
|
|
398
392
|
if (!color) color = "primaryLight";
|
|
399
393
|
const styles13 = {
|
|
400
394
|
buttonLabel: {
|
|
@@ -504,7 +498,7 @@ function UIButton(props) {
|
|
|
504
498
|
] }) });
|
|
505
499
|
}
|
|
506
500
|
return /* @__PURE__ */ jsxs2(Fragment5, { children: [
|
|
507
|
-
/* @__PURE__ */ jsx9(Pressable, { onPress: onClick,
|
|
501
|
+
/* @__PURE__ */ jsx9(Pressable, { onPress: onClick, style: ({ pressed }) => [buttonStyle, pressed && { opacity: 0.5 }], children: /* @__PURE__ */ jsxs2(Fragment5, { children: [
|
|
508
502
|
icon && /* @__PURE__ */ jsx9(UI_default.Icon, { size: iconSize, style: iconStyle, value: icon }),
|
|
509
503
|
label && /* @__PURE__ */ jsx9(Text3, { style: buttonLabel, children: label })
|
|
510
504
|
] }) }),
|
|
@@ -1508,7 +1502,7 @@ function UIModal(props) {
|
|
|
1508
1502
|
/* @__PURE__ */ jsx22(UIToast, {})
|
|
1509
1503
|
] });
|
|
1510
1504
|
};
|
|
1511
|
-
return /* @__PURE__ */ jsx22(Modal3, { animationType: "slide",
|
|
1505
|
+
return /* @__PURE__ */ jsx22(Modal3, { animationType: "slide", visible: true, onRequestClose: onClose, children: /* @__PURE__ */ jsx22(ModalInner, {}) }, key);
|
|
1512
1506
|
}
|
|
1513
1507
|
var styles9 = StyleSheet12.create({
|
|
1514
1508
|
modalTop: {
|
|
@@ -1664,7 +1658,7 @@ import {
|
|
|
1664
1658
|
View as View12,
|
|
1665
1659
|
Text as Text12,
|
|
1666
1660
|
StyleSheet as StyleSheet14,
|
|
1667
|
-
Animated as
|
|
1661
|
+
Animated as Animated2,
|
|
1668
1662
|
PanResponder,
|
|
1669
1663
|
TouchableOpacity as TouchableOpacity7
|
|
1670
1664
|
} from "react-native";
|
|
@@ -1678,7 +1672,7 @@ function UIOrder(props) {
|
|
|
1678
1672
|
const [draggingId, setDraggingId] = useState15(null);
|
|
1679
1673
|
const positions = useRef5(
|
|
1680
1674
|
Object.fromEntries(
|
|
1681
|
-
initial.map((it, i) => [it.value, new
|
|
1675
|
+
initial.map((it, i) => [it.value, new Animated2.Value(i * ITEM_HEIGHT)])
|
|
1682
1676
|
)
|
|
1683
1677
|
).current;
|
|
1684
1678
|
const panRespondersRef = useRef5({});
|
|
@@ -1692,8 +1686,8 @@ function UIOrder(props) {
|
|
|
1692
1686
|
useEffect3(() => {
|
|
1693
1687
|
items.forEach((it, idx) => {
|
|
1694
1688
|
if (!positions[it.value])
|
|
1695
|
-
positions[it.value] = new
|
|
1696
|
-
|
|
1689
|
+
positions[it.value] = new Animated2.Value(idx * ITEM_HEIGHT);
|
|
1690
|
+
Animated2.spring(positions[it.value], {
|
|
1697
1691
|
toValue: idx * ITEM_HEIGHT,
|
|
1698
1692
|
useNativeDriver: false
|
|
1699
1693
|
}).start();
|
|
@@ -1743,7 +1737,7 @@ function UIOrder(props) {
|
|
|
1743
1737
|
targetY = (idx - 1) * ITEM_HEIGHT;
|
|
1744
1738
|
else if (idx < activeIndex.current && idx >= targetIndex)
|
|
1745
1739
|
targetY = (idx + 1) * ITEM_HEIGHT;
|
|
1746
|
-
|
|
1740
|
+
Animated2.timing(positions[other.value], {
|
|
1747
1741
|
toValue: targetY,
|
|
1748
1742
|
duration: 120,
|
|
1749
1743
|
useNativeDriver: false
|
|
@@ -1795,7 +1789,7 @@ function UIOrder(props) {
|
|
|
1795
1789
|
const updated = prev.filter((it) => it.value !== id);
|
|
1796
1790
|
updated.forEach((it, idx) => {
|
|
1797
1791
|
if (positions[it.value])
|
|
1798
|
-
|
|
1792
|
+
Animated2.spring(positions[it.value], {
|
|
1799
1793
|
toValue: idx * ITEM_HEIGHT,
|
|
1800
1794
|
useNativeDriver: false
|
|
1801
1795
|
}).start();
|
|
@@ -1819,7 +1813,7 @@ function UIOrder(props) {
|
|
|
1819
1813
|
const isDragging = draggingId === item.value;
|
|
1820
1814
|
const itemStyle = scope.getStyle("row", { ...styles11.item });
|
|
1821
1815
|
return /* @__PURE__ */ jsxs11(
|
|
1822
|
-
|
|
1816
|
+
Animated2.View,
|
|
1823
1817
|
{
|
|
1824
1818
|
...panRespondersRef.current[item.value]?.panHandlers ?? {},
|
|
1825
1819
|
style: [
|