react-crud-mobile 1.0.607 → 1.0.609
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 +44 -41
- 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 +44 -41
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/core/UIList.tsx +16 -24
- package/src/elements/core/UIListRow.tsx +13 -1
|
@@ -657,6 +657,30 @@ var styles$6 = /*#__PURE__*/reactNative.StyleSheet.create({
|
|
|
657
657
|
}
|
|
658
658
|
});
|
|
659
659
|
|
|
660
|
+
function UIListRow(props) {
|
|
661
|
+
var parent = props.scope;
|
|
662
|
+
var item = props.item;
|
|
663
|
+
var index = props.index;
|
|
664
|
+
var name = "" + parent.key('row', index);
|
|
665
|
+
var row = {
|
|
666
|
+
parent: parent,
|
|
667
|
+
name: name,
|
|
668
|
+
crud: parent.crud,
|
|
669
|
+
index: index,
|
|
670
|
+
type: 'row',
|
|
671
|
+
data: item
|
|
672
|
+
};
|
|
673
|
+
var _useState = React.useState(reactCrudUtils.ScopeUtils.create(row)),
|
|
674
|
+
scope = _useState[0];
|
|
675
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
676
|
+
children: /*#__PURE__*/jsxRuntime.jsx(UIChildren, {
|
|
677
|
+
scope: scope,
|
|
678
|
+
crud: scope.crud,
|
|
679
|
+
children: props.children
|
|
680
|
+
})
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
|
|
660
684
|
function UIList(props) {
|
|
661
685
|
var _repeat$list;
|
|
662
686
|
var scope = props.scope;
|
|
@@ -671,6 +695,13 @@ function UIList(props) {
|
|
|
671
695
|
}) == null ? void 0 : _repeat$list[original.type];
|
|
672
696
|
var add = reactCrudUtils.ComponentUtils.getDefine(props, 'add');
|
|
673
697
|
var hideAddWhenEmpty = original.hideAddWhenEmpty;
|
|
698
|
+
var onClick = function onClick(item) {
|
|
699
|
+
scope.call('click', {
|
|
700
|
+
value: item,
|
|
701
|
+
item: item,
|
|
702
|
+
edit: true
|
|
703
|
+
});
|
|
704
|
+
};
|
|
674
705
|
var getStyle = function getStyle(key, extra) {
|
|
675
706
|
return scope.getStyle(key, _extends({}, extra, styles[key]));
|
|
676
707
|
};
|
|
@@ -718,39 +749,19 @@ function UIList(props) {
|
|
|
718
749
|
};
|
|
719
750
|
var RowItem = function RowItem(_ref) {
|
|
720
751
|
var item = _ref.item,
|
|
721
|
-
index = _ref.index
|
|
722
|
-
|
|
723
|
-
var
|
|
724
|
-
|
|
725
|
-
name: name,
|
|
726
|
-
crud: scope.crud,
|
|
727
|
-
index: index,
|
|
728
|
-
type: 'row',
|
|
729
|
-
data: item
|
|
730
|
-
};
|
|
731
|
-
var _useState = React.useState(reactCrudUtils.ScopeUtils.create(row)),
|
|
732
|
-
rowScope = _useState[0];
|
|
733
|
-
var getRowStyle = function getRowStyle(extra) {
|
|
734
|
-
var row = scope.getStyle('row', _extends({}, extra, styles.row));
|
|
752
|
+
index = _ref.index,
|
|
753
|
+
children = _ref.children;
|
|
754
|
+
var getRowStyle = function getRowStyle() {
|
|
755
|
+
var row = scope.getStyle('row', _extends({}, styles.row));
|
|
735
756
|
if (cols > 0) {
|
|
736
757
|
row.width = rowWidth;
|
|
737
758
|
}
|
|
738
759
|
return row;
|
|
739
760
|
};
|
|
740
|
-
var onClick = function onClick(item) {
|
|
741
|
-
scope.call('click', {
|
|
742
|
-
value: item,
|
|
743
|
-
item: item,
|
|
744
|
-
edit: true
|
|
745
|
-
});
|
|
746
|
-
};
|
|
747
761
|
if (!original.click) {
|
|
748
762
|
return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
|
|
749
763
|
style: getRowStyle(),
|
|
750
|
-
children:
|
|
751
|
-
scope: rowScope,
|
|
752
|
-
children: props.children
|
|
753
|
-
})
|
|
764
|
+
children: children
|
|
754
765
|
}, "k-" + index);
|
|
755
766
|
}
|
|
756
767
|
return /*#__PURE__*/jsxRuntime.jsx(reactNative.TouchableHighlight, {
|
|
@@ -760,10 +771,7 @@ function UIList(props) {
|
|
|
760
771
|
e.stopPropagation();
|
|
761
772
|
onClick(item);
|
|
762
773
|
},
|
|
763
|
-
children:
|
|
764
|
-
scope: rowScope,
|
|
765
|
-
children: props.children
|
|
766
|
-
})
|
|
774
|
+
children: children
|
|
767
775
|
}, "k-" + index);
|
|
768
776
|
};
|
|
769
777
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -781,7 +789,13 @@ function UIList(props) {
|
|
|
781
789
|
children: [/*#__PURE__*/jsxRuntime.jsx(Empty, {}), items.map(function (item, i) {
|
|
782
790
|
return /*#__PURE__*/jsxRuntime.jsx(RowItem, {
|
|
783
791
|
index: i,
|
|
784
|
-
item: item
|
|
792
|
+
item: item,
|
|
793
|
+
children: /*#__PURE__*/jsxRuntime.jsx(UIListRow, {
|
|
794
|
+
scope: scope,
|
|
795
|
+
item: item,
|
|
796
|
+
index: i,
|
|
797
|
+
children: props.children
|
|
798
|
+
})
|
|
785
799
|
});
|
|
786
800
|
}), isShowAdd() && /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
787
801
|
children: add
|
|
@@ -844,17 +858,6 @@ var stylesRepeat = /*#__PURE__*/reactNative.StyleSheet.create({
|
|
|
844
858
|
}
|
|
845
859
|
});
|
|
846
860
|
|
|
847
|
-
function UIListRow(props) {
|
|
848
|
-
var scope = props.scope;
|
|
849
|
-
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
850
|
-
children: /*#__PURE__*/jsxRuntime.jsx(UIChildren, {
|
|
851
|
-
scope: scope,
|
|
852
|
-
crud: scope.crud,
|
|
853
|
-
children: props.children
|
|
854
|
-
})
|
|
855
|
-
});
|
|
856
|
-
}
|
|
857
|
-
|
|
858
861
|
function UIToggle(props) {
|
|
859
862
|
var scope = props.scope;
|
|
860
863
|
var options = reactCrudUtils.Utils.nvl(scope.getOptions(), []);
|