react-crud-mobile 1.3.514 → 1.3.515
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 +32 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -171
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/elements/UIElement.tsx +635 -757
- package/src/elements/core/UIButton.tsx +140 -134
package/dist/index.js
CHANGED
|
@@ -460,25 +460,16 @@ function UIButton(props) {
|
|
|
460
460
|
css.fontSize = import_react_crud_utils5.Utils.nvl(buttonLabel.fontSize, css.fontSize);
|
|
461
461
|
return css;
|
|
462
462
|
});
|
|
463
|
-
|
|
464
|
-
import_react_native4.TouchableHighlight,
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
size: import_react_crud_utils5.Utils.nvl(element.iconSize, 30),
|
|
474
|
-
style: iconStyle,
|
|
475
|
-
value: icon
|
|
476
|
-
}
|
|
477
|
-
) }),
|
|
478
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native4.Text, { style: buttonLabel, children: label })
|
|
479
|
-
] })
|
|
480
|
-
}
|
|
481
|
-
);
|
|
463
|
+
if (scope.loading) {
|
|
464
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native4.TouchableHighlight, { underlayColor: "transparent", style: buttonStyle, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
465
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(UI_default.Icon, { size: import_react_crud_utils5.Utils.nvl(element.iconSize, 30), style: iconStyle, value: icon }) }),
|
|
466
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native4.Text, { style: buttonLabel, children: scope.lng("loading", "Aguarde...") })
|
|
467
|
+
] }) });
|
|
468
|
+
}
|
|
469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native4.TouchableHighlight, { underlayColor: "transparent", onPress: onClick, style: buttonStyle, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
470
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(UI_default.Icon, { size: import_react_crud_utils5.Utils.nvl(element.iconSize, 30), style: iconStyle, value: icon }) }),
|
|
471
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_native4.Text, { style: buttonLabel, children: label })
|
|
472
|
+
] }) });
|
|
482
473
|
}
|
|
483
474
|
|
|
484
475
|
// src/elements/core/UISelect.tsx
|
|
@@ -1924,23 +1915,9 @@ function UIElement(props) {
|
|
|
1924
1915
|
let c = original.custom;
|
|
1925
1916
|
if (c) {
|
|
1926
1917
|
if (typeof c === "string") {
|
|
1927
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1928
|
-
UIElement,
|
|
1929
|
-
{
|
|
1930
|
-
element: { value: c, type: "dummy" },
|
|
1931
|
-
crud
|
|
1932
|
-
}
|
|
1933
|
-
);
|
|
1918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIElement, { element: { value: c, type: "dummy" }, crud });
|
|
1934
1919
|
}
|
|
1935
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1936
|
-
UIElement,
|
|
1937
|
-
{
|
|
1938
|
-
type: c.type,
|
|
1939
|
-
tag: c.type,
|
|
1940
|
-
...c.props,
|
|
1941
|
-
crud
|
|
1942
|
-
}
|
|
1943
|
-
);
|
|
1920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIElement, { type: c.type, tag: c.type, ...c.props, crud });
|
|
1944
1921
|
}
|
|
1945
1922
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {});
|
|
1946
1923
|
};
|
|
@@ -2076,17 +2053,7 @@ function UIElement(props) {
|
|
|
2076
2053
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {});
|
|
2077
2054
|
}
|
|
2078
2055
|
const isShowChild = () => {
|
|
2079
|
-
if (scope.isType(
|
|
2080
|
-
"tabs",
|
|
2081
|
-
"view",
|
|
2082
|
-
"grid",
|
|
2083
|
-
"list",
|
|
2084
|
-
"define",
|
|
2085
|
-
"repeat",
|
|
2086
|
-
"modal",
|
|
2087
|
-
"dialog",
|
|
2088
|
-
"chart"
|
|
2089
|
-
)) {
|
|
2056
|
+
if (scope.isType("tabs", "view", "grid", "list", "define", "repeat", "modal", "dialog", "chart")) {
|
|
2090
2057
|
return false;
|
|
2091
2058
|
}
|
|
2092
2059
|
return true;
|
|
@@ -2110,79 +2077,21 @@ function UIElement(props) {
|
|
|
2110
2077
|
let Inner = () => {
|
|
2111
2078
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
2112
2079
|
scope.getPart("render", null, /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {})),
|
|
2113
|
-
scope.is("type", "button") && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2114
|
-
|
|
2115
|
-
{
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
),
|
|
2125
|
-
scope.is("type", "link") && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2126
|
-
UILink,
|
|
2127
|
-
{
|
|
2128
|
-
...defaultsUI,
|
|
2129
|
-
onClick,
|
|
2130
|
-
variant: scope.attr("variant", "outlined"),
|
|
2131
|
-
children: [
|
|
2132
|
-
original.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CustomIcon, {}),
|
|
2133
|
-
original.label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native20.Text, { style: scope.getPart("label", "link"), children: scope.getLabel() })
|
|
2134
|
-
]
|
|
2135
|
-
}
|
|
2136
|
-
),
|
|
2137
|
-
isInput && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2138
|
-
UIInput,
|
|
2139
|
-
{
|
|
2140
|
-
...defaultsInput,
|
|
2141
|
-
...defaultsUI,
|
|
2142
|
-
InputProps: { ...original.inputProps }
|
|
2143
|
-
}
|
|
2144
|
-
),
|
|
2145
|
-
scope.is("type", "complete", "autocomplete") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2146
|
-
UIComplete,
|
|
2147
|
-
{
|
|
2148
|
-
scope,
|
|
2149
|
-
defaultsInput,
|
|
2150
|
-
defaultsUI
|
|
2151
|
-
}
|
|
2152
|
-
),
|
|
2153
|
-
scope.is("type", "quantity") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2154
|
-
UIQuantity,
|
|
2155
|
-
{
|
|
2156
|
-
scope,
|
|
2157
|
-
defaultsInput,
|
|
2158
|
-
defaultsUI
|
|
2159
|
-
}
|
|
2160
|
-
),
|
|
2161
|
-
scope.is("type", "checkbox", "boolean", "switch") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2162
|
-
UISwitch,
|
|
2163
|
-
{
|
|
2164
|
-
checked: isChecked(),
|
|
2165
|
-
...defaultsInput,
|
|
2166
|
-
onChange: onCheck
|
|
2167
|
-
}
|
|
2168
|
-
),
|
|
2080
|
+
scope.is("type", "button") && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(UIButton, { ...defaultsUI, onClick, variant: scope.attr("variant", "outlined"), children: [
|
|
2081
|
+
original.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CustomIcon, {}),
|
|
2082
|
+
original.label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native20.Text, { style: scope.getPart("label", "button"), children: scope.getLabel() })
|
|
2083
|
+
] }),
|
|
2084
|
+
scope.is("type", "link") && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(UILink, { ...defaultsUI, onClick, variant: scope.attr("variant", "outlined"), children: [
|
|
2085
|
+
original.icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CustomIcon, {}),
|
|
2086
|
+
original.label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native20.Text, { style: scope.getPart("label", "link"), children: scope.getLabel() })
|
|
2087
|
+
] }),
|
|
2088
|
+
isInput && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIInput, { ...defaultsInput, ...defaultsUI, InputProps: { ...original.inputProps } }),
|
|
2089
|
+
scope.is("type", "complete", "autocomplete") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIComplete, { scope, defaultsInput, defaultsUI }),
|
|
2090
|
+
scope.is("type", "quantity") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIQuantity, { scope, defaultsInput, defaultsUI }),
|
|
2091
|
+
scope.is("type", "checkbox", "boolean", "switch") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UISwitch, { checked: isChecked(), ...defaultsInput, onChange: onCheck }),
|
|
2169
2092
|
scope.isType("slider") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UISlider, { ...defaultsInput, onChange: onCheck }),
|
|
2170
|
-
scope.is("type", "select") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2171
|
-
|
|
2172
|
-
{
|
|
2173
|
-
...defaultsInput,
|
|
2174
|
-
...defaultsUI,
|
|
2175
|
-
value: scope.getSelectedValue()
|
|
2176
|
-
}
|
|
2177
|
-
),
|
|
2178
|
-
scope.is("type", "toggle") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2179
|
-
UIToggle,
|
|
2180
|
-
{
|
|
2181
|
-
...defaultsInput,
|
|
2182
|
-
...defaultsUI,
|
|
2183
|
-
value: scope.getSelectedValue()
|
|
2184
|
-
}
|
|
2185
|
-
),
|
|
2093
|
+
scope.is("type", "select") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UISelect, { ...defaultsInput, ...defaultsUI, value: scope.getSelectedValue() }),
|
|
2094
|
+
scope.is("type", "toggle") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIToggle, { ...defaultsInput, ...defaultsUI, value: scope.getSelectedValue() }),
|
|
2186
2095
|
scope.is("type", "radio") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIRadio, { ...defaultsInput, ...defaultsUI, row: true, children: options.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2187
2096
|
UIOption,
|
|
2188
2097
|
{
|
|
@@ -2205,16 +2114,7 @@ function UIElement(props) {
|
|
|
2205
2114
|
if (props[name]) {
|
|
2206
2115
|
let define = import_react_crud_utils18.ComponentUtils.getDefine(props, name);
|
|
2207
2116
|
if (!import_react_crud_utils18.Utils.isEmpty(define)) {
|
|
2208
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2209
|
-
UIChildren,
|
|
2210
|
-
{
|
|
2211
|
-
...props,
|
|
2212
|
-
scope,
|
|
2213
|
-
crud,
|
|
2214
|
-
style: getStyle(name, style),
|
|
2215
|
-
children: define
|
|
2216
|
-
}
|
|
2217
|
-
);
|
|
2117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIChildren, { ...props, scope, crud, style: getStyle(name, style), children: define });
|
|
2218
2118
|
}
|
|
2219
2119
|
}
|
|
2220
2120
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, {});
|
|
@@ -2257,24 +2157,8 @@ function UIElement(props) {
|
|
|
2257
2157
|
scope.isType("chart") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ElChart, { ...props, scope, crud }),
|
|
2258
2158
|
scope.isType("tabs") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ElTabs, { ...props, scope, crud }),
|
|
2259
2159
|
scope.isType("view") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIView, { ...props, scope, crud }),
|
|
2260
|
-
scope.is("type", "icon") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2261
|
-
|
|
2262
|
-
{
|
|
2263
|
-
...defaultsUI,
|
|
2264
|
-
onClick,
|
|
2265
|
-
variant: scope.attr("variant", "outlined"),
|
|
2266
|
-
children: scope.getDisplayValue()
|
|
2267
|
-
}
|
|
2268
|
-
),
|
|
2269
|
-
isShowChild() && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2270
|
-
UIChildren,
|
|
2271
|
-
{
|
|
2272
|
-
...props,
|
|
2273
|
-
scope,
|
|
2274
|
-
crud,
|
|
2275
|
-
style: getStyle("inner")
|
|
2276
|
-
}
|
|
2277
|
-
),
|
|
2160
|
+
scope.is("type", "icon") && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIIcon, { ...defaultsUI, onClick, variant: scope.attr("variant", "outlined"), children: scope.getDisplayValue() }),
|
|
2161
|
+
isShowChild() && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIChildren, { ...props, scope, crud, style: getStyle("inner") }),
|
|
2278
2162
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(UIModal, { ...props, scope, crud })
|
|
2279
2163
|
] });
|
|
2280
2164
|
};
|
|
@@ -2310,13 +2194,7 @@ function UIElement(props) {
|
|
|
2310
2194
|
) });
|
|
2311
2195
|
}
|
|
2312
2196
|
if (scope.isInput() || original.container) {
|
|
2313
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2314
|
-
import_react_native20.View,
|
|
2315
|
-
{
|
|
2316
|
-
style: getStyle("container", { paddingVertical: 5, width: "100%" }),
|
|
2317
|
-
children: props2.children
|
|
2318
|
-
}
|
|
2319
|
-
);
|
|
2197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_native20.View, { style: getStyle("container", { paddingVertical: 5, width: "100%" }), children: props2.children });
|
|
2320
2198
|
}
|
|
2321
2199
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_jsx_runtime24.Fragment, { children: props2.children });
|
|
2322
2200
|
};
|
|
@@ -2430,7 +2308,7 @@ var boxStyle = import_react_native20.StyleSheet.create({
|
|
|
2430
2308
|
width: "100%",
|
|
2431
2309
|
shadowColor: "#000",
|
|
2432
2310
|
shadowOpacity: 0.1,
|
|
2433
|
-
shadowRadius:
|
|
2311
|
+
shadowRadius: 8,
|
|
2434
2312
|
elevation: 3
|
|
2435
2313
|
}
|
|
2436
2314
|
});
|