react-crud-mobile 1.3.378 → 1.3.380
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 +7 -2
- 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 +7 -2
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIOrder.tsx +10 -3
package/package.json
CHANGED
@@ -13,6 +13,7 @@ const ITEM_HEIGHT = 70;
|
|
13
13
|
|
14
14
|
export default function UIOrder(props: ChildType) {
|
15
15
|
const scope = props.scope;
|
16
|
+
const element = scope.original;
|
16
17
|
const initial: OptionType[] = scope.getOptions();
|
17
18
|
|
18
19
|
const [items, setItems] = useState<OptionType[]>(initial);
|
@@ -53,10 +54,16 @@ export default function UIOrder(props: ChildType) {
|
|
53
54
|
}, [items]);
|
54
55
|
|
55
56
|
const onChange = (updated: any[]) => {
|
56
|
-
|
57
|
+
const array: any[] = [];
|
58
|
+
const items = scope.getItems();
|
59
|
+
|
60
|
+
items.splice(0);
|
57
61
|
|
58
62
|
Utils.each(updated, o => {
|
59
|
-
|
63
|
+
const v = o.object;
|
64
|
+
|
65
|
+
array.push(v);
|
66
|
+
items.push(v);
|
60
67
|
});
|
61
68
|
|
62
69
|
scope.changeValue(array);
|
@@ -221,7 +228,7 @@ export default function UIOrder(props: ChildType) {
|
|
221
228
|
<Text style={styles.handleText}>≡</Text>
|
222
229
|
</View>
|
223
230
|
<Text style={styles.itemText}>{item.label}</Text>
|
224
|
-
{
|
231
|
+
{element.remove && (
|
225
232
|
<TouchableOpacity
|
226
233
|
onPress={() => removeItem(item.value)}
|
227
234
|
style={styles.del}
|