react-crud-mobile 1.3.58 → 1.3.59
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/react-crud-mobile.cjs.development.js +53 -81
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +53 -81
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIOrder.tsx +47 -67
|
@@ -1606,91 +1606,52 @@ function UIOrder(props) {
|
|
|
1606
1606
|
var crud = scope.crud;
|
|
1607
1607
|
var original = scope.original;
|
|
1608
1608
|
var cols = reactCrudUtils.Utils.nvl(scope.getPart('cols', undefined, 1));
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
var LocalData = function LocalData() {
|
|
1623
|
-
var _useState = React.useState(scope.updateIndex),
|
|
1624
|
-
index = _useState[0],
|
|
1625
|
-
setIndex = _useState[1];
|
|
1626
|
-
scope.update = function () {
|
|
1627
|
-
scope.updateIndex = ++index;
|
|
1628
|
-
setIndex(index);
|
|
1629
|
-
};
|
|
1630
|
-
var keyData = scope.key('data');
|
|
1631
|
-
var items = reactCrudUtils.Utils.call(function () {
|
|
1632
|
-
var _original$list;
|
|
1633
|
-
var list = reactCrudUtils.Utils.nvl(scope.getItems(), []);
|
|
1634
|
-
if (original.search && !((_original$list = original.list) != null && _original$list.url)) {
|
|
1635
|
-
var query = crud.get('query', '').toLowerCase().trim();
|
|
1636
|
-
if (query.length > 1) {
|
|
1637
|
-
var filters = [];
|
|
1638
|
-
var filterBy = reactCrudUtils.Utils.nvl(original.filterBy, 'label');
|
|
1639
|
-
reactCrudUtils.Utils.each(list, function (o) {
|
|
1640
|
-
var label = o[filterBy];
|
|
1641
|
-
if (label) {
|
|
1642
|
-
if (label.includes(query)) {
|
|
1643
|
-
filters.push(o);
|
|
1644
|
-
}
|
|
1609
|
+
var items = reactCrudUtils.Utils.call(function () {
|
|
1610
|
+
var _original$list;
|
|
1611
|
+
var list = reactCrudUtils.Utils.nvl(scope.getItems(), []);
|
|
1612
|
+
if (original.search && !((_original$list = original.list) != null && _original$list.url)) {
|
|
1613
|
+
var query = crud.get('query', '').toLowerCase().trim();
|
|
1614
|
+
if (query.length > 1) {
|
|
1615
|
+
var filters = [];
|
|
1616
|
+
var filterBy = reactCrudUtils.Utils.nvl(original.filterBy, 'label');
|
|
1617
|
+
reactCrudUtils.Utils.each(list, function (o) {
|
|
1618
|
+
var label = o[filterBy];
|
|
1619
|
+
if (label) {
|
|
1620
|
+
if (label.includes(query)) {
|
|
1621
|
+
filters.push(o);
|
|
1645
1622
|
}
|
|
1646
|
-
});
|
|
1647
|
-
return filters;
|
|
1648
|
-
}
|
|
1649
|
-
}
|
|
1650
|
-
return list;
|
|
1651
|
-
});
|
|
1652
|
-
var renderItem = function renderItem(_ref) {
|
|
1653
|
-
var item = _ref.item,
|
|
1654
|
-
drag = _ref.drag,
|
|
1655
|
-
isActive = _ref.isActive;
|
|
1656
|
-
return /*#__PURE__*/jsxRuntime.jsx(DraggableFlatList.ScaleDecorator, {
|
|
1657
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
|
|
1658
|
-
style: [styles$a.row, {
|
|
1659
|
-
backgroundColor: isActive ? 'lightblue' : 'white'
|
|
1660
|
-
}],
|
|
1661
|
-
onLongPress: drag // Initiate drag on long press
|
|
1662
|
-
,
|
|
1663
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1664
|
-
style: styles$a.text,
|
|
1665
|
-
children: scope.getItemLabel(item)
|
|
1666
|
-
})
|
|
1667
|
-
})
|
|
1668
|
-
});
|
|
1669
|
-
};
|
|
1670
|
-
var _useState2 = React.useState(items),
|
|
1671
|
-
setData = _useState2[1];
|
|
1672
|
-
return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
1673
|
-
style: getContainerStyle(),
|
|
1674
|
-
children: /*#__PURE__*/jsxRuntime.jsx(reactNativeGestureHandler.GestureHandlerRootView, {
|
|
1675
|
-
style: {
|
|
1676
|
-
flex: 1
|
|
1677
|
-
},
|
|
1678
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DraggableFlatList__default, {
|
|
1679
|
-
data: items,
|
|
1680
|
-
renderItem: renderItem,
|
|
1681
|
-
keyExtractor: function keyExtractor(item) {
|
|
1682
|
-
return scope.getItemValue(item);
|
|
1683
|
-
},
|
|
1684
|
-
onDragEnd: function onDragEnd(_ref2) {
|
|
1685
|
-
var data = _ref2.data;
|
|
1686
|
-
setData(data);
|
|
1687
|
-
scope.changeValue(data);
|
|
1688
1623
|
}
|
|
1624
|
+
});
|
|
1625
|
+
return filters;
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
return list;
|
|
1629
|
+
});
|
|
1630
|
+
var renderItem = function renderItem(_ref) {
|
|
1631
|
+
var item = _ref.item,
|
|
1632
|
+
drag = _ref.drag,
|
|
1633
|
+
isActive = _ref.isActive;
|
|
1634
|
+
return /*#__PURE__*/jsxRuntime.jsx(DraggableFlatList.ScaleDecorator, {
|
|
1635
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableOpacity, {
|
|
1636
|
+
style: [styles$a.row, {
|
|
1637
|
+
backgroundColor: isActive ? 'lightblue' : 'white'
|
|
1638
|
+
}],
|
|
1639
|
+
onLongPress: drag // Initiate drag on long press
|
|
1640
|
+
,
|
|
1641
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactNative.Text, {
|
|
1642
|
+
style: styles$a.text,
|
|
1643
|
+
children: scope.getItemLabel(item)
|
|
1689
1644
|
})
|
|
1690
1645
|
})
|
|
1691
|
-
}
|
|
1646
|
+
});
|
|
1692
1647
|
};
|
|
1693
|
-
|
|
1648
|
+
var _useState = React.useState(items),
|
|
1649
|
+
data = _useState[0],
|
|
1650
|
+
setData = _useState[1];
|
|
1651
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactNativeGestureHandler.GestureHandlerRootView, {
|
|
1652
|
+
style: _extends({
|
|
1653
|
+
flex: 1
|
|
1654
|
+
}, scope.getStyle('container')),
|
|
1694
1655
|
children: [original.search !== false && /*#__PURE__*/jsxRuntime.jsx(UI.Text, {
|
|
1695
1656
|
placeholder: "Pesquisar...",
|
|
1696
1657
|
field: "query",
|
|
@@ -1708,7 +1669,18 @@ function UIOrder(props) {
|
|
|
1708
1669
|
size: 20,
|
|
1709
1670
|
color: "#888"
|
|
1710
1671
|
})
|
|
1711
|
-
}), /*#__PURE__*/jsxRuntime.jsx(
|
|
1672
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DraggableFlatList__default, {
|
|
1673
|
+
data: data,
|
|
1674
|
+
renderItem: renderItem,
|
|
1675
|
+
keyExtractor: function keyExtractor(item) {
|
|
1676
|
+
return scope.getItemValue(item);
|
|
1677
|
+
},
|
|
1678
|
+
onDragEnd: function onDragEnd(_ref2) {
|
|
1679
|
+
var data = _ref2.data;
|
|
1680
|
+
setData(data);
|
|
1681
|
+
scope.changeValue(data);
|
|
1682
|
+
}
|
|
1683
|
+
})]
|
|
1712
1684
|
});
|
|
1713
1685
|
}
|
|
1714
1686
|
var styles$a = /*#__PURE__*/reactNative.StyleSheet.create({
|