react-crud-mobile 1.3.413 → 1.3.503
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.d.mts +58 -0
- package/dist/index.d.ts +58 -1
- package/dist/index.js +2531 -5
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2556 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +75 -75
- package/src/elements/core/UIAutoComplete.tsx +17 -17
- package/src/elements/core/UILink.tsx +17 -17
- package/src/elements/core/UIListItem.tsx +32 -32
- package/src/elements/core/UIListRow.tsx +2 -1
- package/src/elements/core/UIOption.tsx +17 -17
- package/src/elements/core/UIRadio.tsx +17 -17
- package/src/elements/core/UISlider.tsx +61 -61
- package/src/elements/core/UIStatusBar.tsx +5 -5
- package/src/elements/core/UISwitch.tsx +27 -27
- package/src/hooks/useIsVisible.ts +39 -39
- package/src/utils/MobileUtils.ts +13 -13
- package/dist/elements/UI.d.ts +0 -49
- package/dist/elements/UIChildren.d.ts +0 -15
- package/dist/elements/UIComplete.d.ts +0 -3
- package/dist/elements/UIElement.d.ts +0 -3
- package/dist/elements/UITag.d.ts +0 -7
- package/dist/elements/charts/ElChart.d.ts +0 -3
- package/dist/elements/core/SafeView.d.ts +0 -9
- package/dist/elements/core/UIAutoComplete.d.ts +0 -2
- package/dist/elements/core/UIButton.d.ts +0 -3
- package/dist/elements/core/UIHeader.d.ts +0 -3
- package/dist/elements/core/UIIcon.d.ts +0 -3
- package/dist/elements/core/UIInclude.d.ts +0 -3
- package/dist/elements/core/UIInput.d.ts +0 -3
- package/dist/elements/core/UILink.d.ts +0 -2
- package/dist/elements/core/UIList.d.ts +0 -3
- package/dist/elements/core/UIListItem.d.ts +0 -7
- package/dist/elements/core/UIListRow.d.ts +0 -8
- package/dist/elements/core/UIModal.d.ts +0 -8
- package/dist/elements/core/UIOption.d.ts +0 -2
- package/dist/elements/core/UIOrder.d.ts +0 -3
- package/dist/elements/core/UIQuantity.d.ts +0 -3
- package/dist/elements/core/UIRadio.d.ts +0 -2
- package/dist/elements/core/UISelect.d.ts +0 -3
- package/dist/elements/core/UISlider.d.ts +0 -3
- package/dist/elements/core/UIStatusBar.d.ts +0 -2
- package/dist/elements/core/UISwitch.d.ts +0 -3
- package/dist/elements/core/UIToast.d.ts +0 -2
- package/dist/elements/core/UIToggle.d.ts +0 -3
- package/dist/elements/core/UIView.d.ts +0 -3
- package/dist/elements/index.d.ts +0 -1
- package/dist/elements/tabs/ElTabs.d.ts +0 -3
- package/dist/hooks/useIsVisible.d.ts +0 -2
- package/dist/react-crud-mobile.cjs.development.js +0 -2906
- package/dist/react-crud-mobile.cjs.development.js.map +0 -1
- package/dist/react-crud-mobile.cjs.production.min.js +0 -2
- package/dist/react-crud-mobile.cjs.production.min.js.map +0 -1
- package/dist/react-crud-mobile.esm.js +0 -2898
- package/dist/react-crud-mobile.esm.js.map +0 -1
- package/dist/utils/MobileUtils.d.ts +0 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,2534 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
28
|
|
|
2
|
-
|
|
29
|
+
// src/index.ts
|
|
30
|
+
var index_exports = {};
|
|
31
|
+
__export(index_exports, {
|
|
32
|
+
UI: () => UI_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(index_exports);
|
|
3
35
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
36
|
+
// src/elements/UIElement.tsx
|
|
37
|
+
var import_react16 = __toESM(require("react"));
|
|
38
|
+
|
|
39
|
+
// src/elements/UIChildren.tsx
|
|
40
|
+
var import_react = __toESM(require("react"));
|
|
41
|
+
var import_react_crud_utils = require("react-crud-utils");
|
|
42
|
+
var import_react_native = require("react-native");
|
|
43
|
+
function UIChildren(props) {
|
|
44
|
+
let [scope] = (0, import_react.useState)(import_react_crud_utils.Utils.nvl(props.scope, import_react_crud_utils.ScopeUtils.create(props)));
|
|
45
|
+
let crud = import_react_crud_utils.Utils.nvl(props.crud, scope.crud);
|
|
46
|
+
let validateScope = import_react_crud_utils.Utils.nvl(props.validateScope, "global");
|
|
47
|
+
let name = import_react_crud_utils.Utils.nvl(props.part, "child");
|
|
48
|
+
if (scope.isInput()) {
|
|
49
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
50
|
+
}
|
|
51
|
+
let Paint = ({ child }) => {
|
|
52
|
+
if (!child) {
|
|
53
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
54
|
+
}
|
|
55
|
+
if (typeof child === "string") {
|
|
56
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, child);
|
|
57
|
+
}
|
|
58
|
+
let Custom = child.type;
|
|
59
|
+
let pps = { ...child.props };
|
|
60
|
+
delete pps.children;
|
|
61
|
+
if (typeof Custom === "string") {
|
|
62
|
+
if (import_react_crud_utils.Utils.isEmpty(child.props.children)) {
|
|
63
|
+
return /* @__PURE__ */ import_react.default.createElement(Custom, { ...pps });
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ import_react.default.createElement(Custom, { ...pps }, /* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
UIChildren,
|
|
67
|
+
{
|
|
68
|
+
transient: true,
|
|
69
|
+
validateScope,
|
|
70
|
+
...child.props,
|
|
71
|
+
scope,
|
|
72
|
+
crud
|
|
73
|
+
}
|
|
74
|
+
));
|
|
75
|
+
} else if (typeof Custom === "function") {
|
|
76
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
77
|
+
Custom,
|
|
78
|
+
{
|
|
79
|
+
validateScope,
|
|
80
|
+
...child.props,
|
|
81
|
+
parent: scope,
|
|
82
|
+
crud
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
if (!import_react_crud_utils.Utils.isEmpty(child.props?.children)) {
|
|
87
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
88
|
+
UIChildren,
|
|
89
|
+
{
|
|
90
|
+
validateScope,
|
|
91
|
+
...child.props,
|
|
92
|
+
scope,
|
|
93
|
+
crud,
|
|
94
|
+
transient: true
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
99
|
+
};
|
|
100
|
+
const Draw = () => {
|
|
101
|
+
if (props.elements) {
|
|
102
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, Object.entries(props.elements).map((t, k) => {
|
|
103
|
+
return /* @__PURE__ */ import_react.default.createElement(UIElement, { crud, ...t[1] });
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, import_react.default.Children.map(props.children, (child) => {
|
|
107
|
+
return /* @__PURE__ */ import_react.default.createElement(Paint, { child });
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
if (props.transient) {
|
|
111
|
+
return /* @__PURE__ */ import_react.default.createElement(Draw, null);
|
|
112
|
+
}
|
|
113
|
+
if (import_react_crud_utils.Utils.isEmpty(props.children) && import_react_crud_utils.Utils.isEmpty(props.elements)) {
|
|
114
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
|
|
115
|
+
}
|
|
116
|
+
const getStyle = (part) => {
|
|
117
|
+
let key = import_react_crud_utils.Utils.nvl(part, "root");
|
|
118
|
+
let def = styles[key];
|
|
119
|
+
let css = {};
|
|
120
|
+
if (!import_react_crud_utils.Utils.isEmpty(props.style)) {
|
|
121
|
+
if (props.style?.push) {
|
|
122
|
+
import_react_crud_utils.Utils.each(props.style, (s) => {
|
|
123
|
+
if (s) {
|
|
124
|
+
css = { ...css, ...s };
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
} else {
|
|
128
|
+
css = { ...props.style };
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return { ...def, ...css, ...scope.getStyle(part) };
|
|
132
|
+
};
|
|
133
|
+
if (props.transient) {
|
|
134
|
+
return /* @__PURE__ */ import_react.default.createElement(Draw, null);
|
|
135
|
+
}
|
|
136
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_react_native.View, { style: getStyle(name) }, /* @__PURE__ */ import_react.default.createElement(Draw, null)));
|
|
137
|
+
}
|
|
138
|
+
var styles = import_react_native.StyleSheet.create({
|
|
139
|
+
child: { width: "100%" },
|
|
140
|
+
inner: { width: "100%" }
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
// src/elements/tabs/ElTabs.tsx
|
|
144
|
+
var import_react2 = __toESM(require("react"));
|
|
145
|
+
var import_Ionicons = __toESM(require("@expo/vector-icons/Ionicons"));
|
|
146
|
+
var import_react_crud_utils2 = require("react-crud-utils");
|
|
147
|
+
function ElTabs(props) {
|
|
148
|
+
let scope = props.scope;
|
|
149
|
+
let [selectedIndex, setSelectedIndex] = (0, import_react2.useState)(0);
|
|
150
|
+
let element = scope.original;
|
|
151
|
+
let items = scope.getItems();
|
|
152
|
+
let counter = 0;
|
|
153
|
+
let tabs = [];
|
|
154
|
+
let [selected, setSelected] = (0, import_react2.useState)(null);
|
|
155
|
+
const onChangeTab = (tab, validate = true) => {
|
|
156
|
+
if (tab) {
|
|
157
|
+
scope.execute({
|
|
158
|
+
event: {
|
|
159
|
+
validate,
|
|
160
|
+
validateScope: element.validateScope,
|
|
161
|
+
action: () => {
|
|
162
|
+
scope.changeValue(tab.data);
|
|
163
|
+
selected = tab;
|
|
164
|
+
selectedIndex = tab.index;
|
|
165
|
+
setSelectedIndex(selectedIndex);
|
|
166
|
+
setSelected(tab);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const getStyleClass = (t) => {
|
|
173
|
+
let s = "ui-tabs-item ui-click";
|
|
174
|
+
if (selected?.index === t.index) {
|
|
175
|
+
s = s + " ui-tab-selected";
|
|
176
|
+
}
|
|
177
|
+
return s;
|
|
178
|
+
};
|
|
179
|
+
const addTab = (child, item) => {
|
|
180
|
+
let original = { ...child.props };
|
|
181
|
+
if (!item) {
|
|
182
|
+
item = scope.crud.data;
|
|
183
|
+
}
|
|
184
|
+
let crudTab = import_react_crud_utils2.CrudUtils.create("tabs", {
|
|
185
|
+
data: item,
|
|
186
|
+
changed: item,
|
|
187
|
+
parent: scope.crud
|
|
188
|
+
});
|
|
189
|
+
let element2 = import_react_crud_utils2.Utils.resolve(original, crudTab);
|
|
190
|
+
if (element2.rendered === false) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
tabs.push({
|
|
194
|
+
...element2,
|
|
195
|
+
child,
|
|
196
|
+
element: element2,
|
|
197
|
+
original,
|
|
198
|
+
index: counter++,
|
|
199
|
+
data: item
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
import_react2.default.Children.map(props.children, (child, index) => {
|
|
203
|
+
if (import_react_crud_utils2.Utils.isEmpty(items)) {
|
|
204
|
+
addTab(child, {});
|
|
205
|
+
} else {
|
|
206
|
+
for (const i in items) {
|
|
207
|
+
let o = items[i];
|
|
208
|
+
addTab(child, o);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
if (!selected) {
|
|
213
|
+
onChangeTab(tabs[selectedIndex], false);
|
|
214
|
+
}
|
|
215
|
+
const nav = (i) => {
|
|
216
|
+
let t = tabs[selectedIndex + i];
|
|
217
|
+
onChangeTab(t);
|
|
218
|
+
};
|
|
219
|
+
const previous = () => {
|
|
220
|
+
nav(-1);
|
|
221
|
+
};
|
|
222
|
+
const next = () => {
|
|
223
|
+
nav(1);
|
|
224
|
+
};
|
|
225
|
+
let isStepper = element.layout === "stepper";
|
|
226
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
227
|
+
"div",
|
|
228
|
+
{
|
|
229
|
+
className: scope.getStyleClass("inner"),
|
|
230
|
+
style: scope.getStyle("inner")
|
|
231
|
+
},
|
|
232
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tabs-content" }, /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tabs-items" }, tabs.map((t, i) => /* @__PURE__ */ import_react2.default.createElement(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
key: import_react_crud_utils2.Utils.key(element.id, "tab", i),
|
|
236
|
+
className: getStyleClass(t),
|
|
237
|
+
onClick: () => {
|
|
238
|
+
onChangeTab(t);
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
isStepper && /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tab-item-divisor" }),
|
|
242
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tab-item-inner" }, isStepper && /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-step-line" }), /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tab-item-label" }, isStepper ? t.index + 1 : t.label))
|
|
243
|
+
))), selected && /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, isStepper && /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tabs-label" }, selected.label), /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tabs-area" }, /* @__PURE__ */ import_react2.default.createElement(UIChildren, { ...props, scope }, selected.child)), element.layout === "stepper" && /* @__PURE__ */ import_react2.default.createElement("div", { className: "ui-tabs-actions" }, /* @__PURE__ */ import_react2.default.createElement(UI_default.Output, { space: 6, layout: "left" }, /* @__PURE__ */ import_react2.default.createElement(
|
|
244
|
+
UI_default.Include,
|
|
245
|
+
{
|
|
246
|
+
...props,
|
|
247
|
+
transient: true,
|
|
248
|
+
name: "left",
|
|
249
|
+
default: /* @__PURE__ */ import_react2.default.createElement(
|
|
250
|
+
UI_default.Button,
|
|
251
|
+
{
|
|
252
|
+
rendered: selectedIndex > 0,
|
|
253
|
+
icon: /* @__PURE__ */ import_react2.default.createElement(import_Ionicons.default, null),
|
|
254
|
+
click: previous
|
|
255
|
+
}
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
)), /* @__PURE__ */ import_react2.default.createElement(UI_default.Output, { space: 6, layout: "right" }, /* @__PURE__ */ import_react2.default.createElement(
|
|
259
|
+
UI_default.Include,
|
|
260
|
+
{
|
|
261
|
+
...props,
|
|
262
|
+
transient: true,
|
|
263
|
+
name: "right",
|
|
264
|
+
default: /* @__PURE__ */ import_react2.default.createElement(
|
|
265
|
+
UI_default.Button,
|
|
266
|
+
{
|
|
267
|
+
rendered: selectedIndex < tabs.length - 1,
|
|
268
|
+
icon: /* @__PURE__ */ import_react2.default.createElement(import_Ionicons.default, null),
|
|
269
|
+
click: next
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
)))))
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// src/elements/charts/ElChart.tsx
|
|
278
|
+
var import_react3 = __toESM(require("react"));
|
|
279
|
+
var import_react_crud_utils3 = require("react-crud-utils");
|
|
280
|
+
function ElChart(props) {
|
|
281
|
+
let scope = props.scope;
|
|
282
|
+
let items = scope.getItems();
|
|
283
|
+
let columns = import_react_crud_utils3.Utils.asList(scope.original.columns);
|
|
284
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", { className: "ui-chart-data" });
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// src/elements/core/UIAutoComplete.tsx
|
|
288
|
+
var import_react_native2 = require("react-native");
|
|
289
|
+
function UIAutoComplete(props) {
|
|
290
|
+
const handlePress = () => {
|
|
291
|
+
import_react_native2.Linking.openURL("https://reactnative.dev/");
|
|
292
|
+
};
|
|
293
|
+
return /* @__PURE__ */ React.createElement(import_react_native2.TouchableOpacity, { onPress: handlePress }, /* @__PURE__ */ React.createElement(import_react_native2.Text, { style: styles2.link }, "Clique aqui para acessar o React Native"));
|
|
294
|
+
}
|
|
295
|
+
var styles2 = {
|
|
296
|
+
link: {}
|
|
297
|
+
};
|
|
298
|
+
|
|
299
|
+
// src/elements/UIComplete.tsx
|
|
300
|
+
function UIComplete({
|
|
301
|
+
defaultsInput,
|
|
302
|
+
defaultsUI,
|
|
303
|
+
scope
|
|
304
|
+
}) {
|
|
305
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UIAutoComplete, { ...defaultsInput, ...defaultsUI }));
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/elements/UIElement.tsx
|
|
309
|
+
var import_react_crud_utils18 = require("react-crud-utils");
|
|
310
|
+
|
|
311
|
+
// src/elements/core/UILink.tsx
|
|
312
|
+
var import_react_native3 = require("react-native");
|
|
313
|
+
function UILink(props) {
|
|
314
|
+
const handlePress = () => {
|
|
315
|
+
import_react_native3.Linking.openURL("https://reactnative.dev/");
|
|
316
|
+
};
|
|
317
|
+
return /* @__PURE__ */ React.createElement(import_react_native3.TouchableOpacity, { onPress: handlePress }, /* @__PURE__ */ React.createElement(import_react_native3.Text, { style: styles3.link }, "Clique aqui para acessar o React Native"));
|
|
318
|
+
}
|
|
319
|
+
var styles3 = {
|
|
320
|
+
link: {}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
// src/elements/core/UIIcon.tsx
|
|
324
|
+
var import_vector_icons = require("@expo/vector-icons");
|
|
325
|
+
var import_react_crud_utils4 = require("react-crud-utils");
|
|
326
|
+
function UIIcon({ scope }) {
|
|
327
|
+
let name = scope.getValue();
|
|
328
|
+
let libs = {
|
|
329
|
+
ion: import_vector_icons.Ionicons,
|
|
330
|
+
ant: import_vector_icons.AntDesign,
|
|
331
|
+
entypo: import_vector_icons.Entypo,
|
|
332
|
+
evil: import_vector_icons.EvilIcons,
|
|
333
|
+
material: import_vector_icons.MaterialCommunityIcons
|
|
334
|
+
};
|
|
335
|
+
let library = import_react_crud_utils4.Utils.nvl(scope.original.library, "ion");
|
|
336
|
+
let Aux = libs[library];
|
|
337
|
+
let css = scope.getStyle("icon");
|
|
338
|
+
let fontSize = scope.part("size", 20);
|
|
339
|
+
let size = scope.part("iconSize", fontSize);
|
|
340
|
+
if (scope.original?.transient) {
|
|
341
|
+
css = { ...css, ...scope.getStyle() };
|
|
342
|
+
}
|
|
343
|
+
return /* @__PURE__ */ React.createElement(Aux, { size, name, style: css });
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/elements/core/UIButton.tsx
|
|
347
|
+
var import_react_crud_utils5 = require("react-crud-utils");
|
|
348
|
+
var import_react_native4 = require("react-native");
|
|
349
|
+
var BUTTONS_SIZE = { small: { minWidth: 30, height: 30 } };
|
|
350
|
+
function UIButton(props) {
|
|
351
|
+
let scope = props.scope;
|
|
352
|
+
let element = scope.original;
|
|
353
|
+
let size = import_react_crud_utils5.Utils.nvl(element.size, "default");
|
|
354
|
+
let align = import_react_crud_utils5.Utils.nvl(element.align, "center");
|
|
355
|
+
let variant = import_react_crud_utils5.Utils.nvl(element.variant, "default");
|
|
356
|
+
let color = element.color;
|
|
357
|
+
let label = scope.getLabel();
|
|
358
|
+
let icon = scope.getPart("icon");
|
|
359
|
+
if (!color) color = "primaryLight";
|
|
360
|
+
const styles13 = {
|
|
361
|
+
buttonLabel: {
|
|
362
|
+
color: "#ffffff",
|
|
363
|
+
fontWeight: 400,
|
|
364
|
+
fontSize: 15
|
|
365
|
+
},
|
|
366
|
+
buttonInner: {
|
|
367
|
+
flexDirection: "row",
|
|
368
|
+
alignItems: "center",
|
|
369
|
+
justifyContent: "center",
|
|
370
|
+
height: 44,
|
|
371
|
+
minWidth: 44
|
|
372
|
+
},
|
|
373
|
+
buttonIcon: {
|
|
374
|
+
color: "#fff",
|
|
375
|
+
fontSize: 16
|
|
376
|
+
},
|
|
377
|
+
button: {
|
|
378
|
+
backgroundColor: color,
|
|
379
|
+
borderRadius: 20,
|
|
380
|
+
gap: 10,
|
|
381
|
+
justifyContent: "center",
|
|
382
|
+
alignItems: "center",
|
|
383
|
+
flexDirection: "row"
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
const onClick = (e) => {
|
|
387
|
+
scope.call("click", {});
|
|
388
|
+
};
|
|
389
|
+
const style = (part, extra2) => {
|
|
390
|
+
let css = { ...styles13[part], ...extra2 };
|
|
391
|
+
if (variant === "text" || variant === "outlined") {
|
|
392
|
+
css.backgroundColor = "transparent";
|
|
393
|
+
css.color = import_react_crud_utils5.Utils.nvl(color, "text");
|
|
394
|
+
}
|
|
395
|
+
if (size === "small") {
|
|
396
|
+
css.fontSize = 12;
|
|
397
|
+
css.fontWeight = 500;
|
|
398
|
+
}
|
|
399
|
+
if (size === "medium") {
|
|
400
|
+
css.fontSize = 14;
|
|
401
|
+
css.fontWeight = 500;
|
|
402
|
+
}
|
|
403
|
+
if (align === "left") {
|
|
404
|
+
css.justifyContent = "flex-start";
|
|
405
|
+
}
|
|
406
|
+
return scope.getStyle(part, css);
|
|
407
|
+
};
|
|
408
|
+
let extra = {};
|
|
409
|
+
if (icon) {
|
|
410
|
+
extra.button = { height: 40, padding: 0 };
|
|
411
|
+
} else {
|
|
412
|
+
extra.button = { height: 50 };
|
|
413
|
+
}
|
|
414
|
+
const buttonStyle = import_react_crud_utils5.Utils.call(() => {
|
|
415
|
+
let def = { ...extra?.button };
|
|
416
|
+
if (variant === "outlined") {
|
|
417
|
+
def.borderWidth = 1;
|
|
418
|
+
def.borderColor = import_react_crud_utils5.Utils.nvl(color, "text");
|
|
419
|
+
}
|
|
420
|
+
if (size) {
|
|
421
|
+
def = { ...def, ...BUTTONS_SIZE[size] };
|
|
422
|
+
}
|
|
423
|
+
if (!label) {
|
|
424
|
+
def = { ...def, borderRadius: 20 };
|
|
425
|
+
}
|
|
426
|
+
let css = style("button", def);
|
|
427
|
+
if (!css.width) {
|
|
428
|
+
let h = css.height;
|
|
429
|
+
if (typeof h === "number") {
|
|
430
|
+
css.minWidth = h;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return css;
|
|
434
|
+
});
|
|
435
|
+
const buttonLabel = style("buttonLabel");
|
|
436
|
+
const iconStyle = import_react_crud_utils5.Utils.call(() => {
|
|
437
|
+
let css = style("buttonIcon", extra.icon);
|
|
438
|
+
css.fontSize = import_react_crud_utils5.Utils.nvl(buttonLabel.fontSize, css.fontSize);
|
|
439
|
+
return css;
|
|
440
|
+
});
|
|
441
|
+
return /* @__PURE__ */ React.createElement(
|
|
442
|
+
import_react_native4.TouchableHighlight,
|
|
443
|
+
{
|
|
444
|
+
underlayColor: "transparent",
|
|
445
|
+
onPress: onClick,
|
|
446
|
+
style: buttonStyle
|
|
447
|
+
},
|
|
448
|
+
/* @__PURE__ */ React.createElement(React.Fragment, null, icon && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
449
|
+
UI_default.Icon,
|
|
450
|
+
{
|
|
451
|
+
size: import_react_crud_utils5.Utils.nvl(element.iconSize, 30),
|
|
452
|
+
style: iconStyle,
|
|
453
|
+
value: icon
|
|
454
|
+
}
|
|
455
|
+
)), label && /* @__PURE__ */ React.createElement(import_react_native4.Text, { style: buttonLabel }, label))
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// src/elements/core/UISelect.tsx
|
|
460
|
+
var import_react4 = require("react");
|
|
461
|
+
var import_react_crud_utils6 = require("react-crud-utils");
|
|
462
|
+
var import_react_native5 = require("react-native");
|
|
463
|
+
var import_vector_icons2 = require("@expo/vector-icons");
|
|
464
|
+
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
465
|
+
function UISelect(props) {
|
|
466
|
+
const [modalVisible, setModalVisible] = (0, import_react4.useState)(false);
|
|
467
|
+
const scope = props.scope;
|
|
468
|
+
const original = scope.original;
|
|
469
|
+
const items = import_react_crud_utils6.Utils.nvl(scope.getOptions(), []);
|
|
470
|
+
const placeholder = scope.attr("placeholder", "Selecione...");
|
|
471
|
+
const value = scope.getDisplayValue();
|
|
472
|
+
const theme = scope.getTheme();
|
|
473
|
+
const headerStyle = import_react_crud_utils6.Utils.nvl(theme.styles?.defaults?.header, {});
|
|
474
|
+
const handlePress = () => {
|
|
475
|
+
setModalVisible(!modalVisible);
|
|
476
|
+
};
|
|
477
|
+
const scrollRef = (0, import_react4.useRef)(null);
|
|
478
|
+
const iconColor = import_react_crud_utils6.Utils.nvl(theme.colors?.text, "#100e0e");
|
|
479
|
+
const modalColor = import_react_crud_utils6.Utils.nvl(headerStyle.color, "white");
|
|
480
|
+
const defaults = { color: modalColor };
|
|
481
|
+
const onClick = ({ crud, value: value2 }) => {
|
|
482
|
+
let val = value2;
|
|
483
|
+
if (original.isObject && val?.object) {
|
|
484
|
+
scope.changeValue(val?.object);
|
|
485
|
+
} else if (val?.value) {
|
|
486
|
+
scope.changeValue(val?.value);
|
|
487
|
+
} else {
|
|
488
|
+
scope.changeValue(value2);
|
|
489
|
+
}
|
|
490
|
+
setModalVisible(false);
|
|
491
|
+
};
|
|
492
|
+
const style = (part, extra) => {
|
|
493
|
+
let all = { ...styles4[part], ...extra };
|
|
494
|
+
return scope.getStyle(part, all);
|
|
495
|
+
};
|
|
496
|
+
const isModalVisible = () => {
|
|
497
|
+
return modalVisible;
|
|
498
|
+
};
|
|
499
|
+
const getLabelStyle = () => {
|
|
500
|
+
const css = style("selectLabel");
|
|
501
|
+
let fs = parseInt(css.fontSize);
|
|
502
|
+
if (!fs) {
|
|
503
|
+
fs = 14;
|
|
504
|
+
}
|
|
505
|
+
let lh = import_react_crud_utils6.Utils.nvl(css.lineHeight, fs + 2);
|
|
506
|
+
css.fontSize = fs;
|
|
507
|
+
css.lineHeight = lh;
|
|
508
|
+
return css;
|
|
509
|
+
};
|
|
510
|
+
const labelStyle = getLabelStyle();
|
|
511
|
+
const defIconSize = import_react_crud_utils6.Utils.nvl(labelStyle.fontSize, 14) + 2;
|
|
512
|
+
const iconSize = scope.getPart("iconSize", null, defIconSize);
|
|
513
|
+
return /* @__PURE__ */ React.createElement(
|
|
514
|
+
import_react_native5.View,
|
|
515
|
+
{
|
|
516
|
+
key: scope.getName(`${scope.getPart("modal")}_${modalVisible}`),
|
|
517
|
+
style: style("selectRoot")
|
|
518
|
+
},
|
|
519
|
+
/* @__PURE__ */ React.createElement(import_react_native5.TouchableOpacity, { onPress: handlePress, style: style("selectInput") }, /* @__PURE__ */ React.createElement(import_react_native5.Text, { style: labelStyle }, import_react_crud_utils6.Utils.nvl(value, placeholder)), /* @__PURE__ */ React.createElement(
|
|
520
|
+
import_vector_icons2.Ionicons,
|
|
521
|
+
{
|
|
522
|
+
name: "chevron-down-outline",
|
|
523
|
+
size: iconSize,
|
|
524
|
+
color: scope.getPart("iconColor", null, iconColor),
|
|
525
|
+
style: style("iconStyle", {})
|
|
526
|
+
}
|
|
527
|
+
)),
|
|
528
|
+
/* @__PURE__ */ React.createElement(
|
|
529
|
+
import_react_native5.Modal,
|
|
530
|
+
{
|
|
531
|
+
animationType: "slide",
|
|
532
|
+
transparent: true,
|
|
533
|
+
visible: isModalVisible(),
|
|
534
|
+
onRequestClose: () => setModalVisible(false)
|
|
535
|
+
},
|
|
536
|
+
/* @__PURE__ */ React.createElement(import_react_native_safe_area_context.SafeAreaView, { style: style("modalTop") }),
|
|
537
|
+
/* @__PURE__ */ React.createElement(import_react_native_safe_area_context.SafeAreaView, { style: style("modalSafe") }, /* @__PURE__ */ React.createElement(import_react_native5.View, { style: scope.getStyle("header", headerStyle) }, /* @__PURE__ */ React.createElement(
|
|
538
|
+
import_react_native5.TouchableOpacity,
|
|
539
|
+
{
|
|
540
|
+
onPress: handlePress,
|
|
541
|
+
style: style("modalCloseButton")
|
|
542
|
+
},
|
|
543
|
+
/* @__PURE__ */ React.createElement(
|
|
544
|
+
import_vector_icons2.Ionicons,
|
|
545
|
+
{
|
|
546
|
+
name: "close",
|
|
547
|
+
size: 24,
|
|
548
|
+
color: modalColor,
|
|
549
|
+
style: style("modalCloseText", defaults)
|
|
550
|
+
}
|
|
551
|
+
)
|
|
552
|
+
), /* @__PURE__ */ React.createElement(import_react_native5.Text, { style: style("modalTitle", defaults) }, placeholder)), /* @__PURE__ */ React.createElement(
|
|
553
|
+
import_react_native5.ScrollView,
|
|
554
|
+
{
|
|
555
|
+
contentContainerStyle: { flexGrow: 1, paddingBottom: 50 },
|
|
556
|
+
style: style("modalContent"),
|
|
557
|
+
nestedScrollEnabled: true,
|
|
558
|
+
ref: scrollRef
|
|
559
|
+
},
|
|
560
|
+
/* @__PURE__ */ React.createElement(
|
|
561
|
+
import_react_native5.View,
|
|
562
|
+
{
|
|
563
|
+
style: {
|
|
564
|
+
flex: 1,
|
|
565
|
+
paddingLeft: 15,
|
|
566
|
+
paddingRight: 15,
|
|
567
|
+
paddingTop: 10,
|
|
568
|
+
paddingBottom: 10
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
/* @__PURE__ */ React.createElement(
|
|
572
|
+
UI_default.List,
|
|
573
|
+
{
|
|
574
|
+
data: items,
|
|
575
|
+
name: scope.getName("list"),
|
|
576
|
+
layout: "card",
|
|
577
|
+
search: original.search === true,
|
|
578
|
+
click: onClick,
|
|
579
|
+
rowStyle: {
|
|
580
|
+
paddingLeft: 15,
|
|
581
|
+
paddinRight: 15,
|
|
582
|
+
...original?.rowStyle
|
|
583
|
+
},
|
|
584
|
+
...original?.listProps
|
|
585
|
+
},
|
|
586
|
+
/* @__PURE__ */ React.createElement(UI_default.Value, { value: "#{@this.label}" })
|
|
587
|
+
)
|
|
588
|
+
)
|
|
589
|
+
))
|
|
590
|
+
)
|
|
591
|
+
);
|
|
592
|
+
}
|
|
593
|
+
var styles4 = import_react_native5.StyleSheet.create({
|
|
594
|
+
selectRoot: {
|
|
595
|
+
justifyContent: "flex-start",
|
|
596
|
+
alignItems: "flex-start",
|
|
597
|
+
flex: 1
|
|
598
|
+
},
|
|
599
|
+
selectInput: {
|
|
600
|
+
width: "100%",
|
|
601
|
+
flexDirection: "row",
|
|
602
|
+
borderRadius: 5,
|
|
603
|
+
paddingHorizontal: 15,
|
|
604
|
+
borderWidth: 1,
|
|
605
|
+
borderStyle: "solid",
|
|
606
|
+
borderColor: "#dedede",
|
|
607
|
+
paddingVertical: 10
|
|
608
|
+
},
|
|
609
|
+
selectLabel: { flex: 1, fontSize: 14 },
|
|
610
|
+
modalTop: {
|
|
611
|
+
backgroundColor: "primary",
|
|
612
|
+
width: "100%"
|
|
613
|
+
},
|
|
614
|
+
modalSafe: {
|
|
615
|
+
flex: 1,
|
|
616
|
+
width: "100%",
|
|
617
|
+
backgroundColor: "background"
|
|
618
|
+
},
|
|
619
|
+
modalCloseButton: {
|
|
620
|
+
padding: 10
|
|
621
|
+
},
|
|
622
|
+
modalCloseText: {
|
|
623
|
+
fontSize: 18,
|
|
624
|
+
color: "white"
|
|
625
|
+
},
|
|
626
|
+
modalTitle: {
|
|
627
|
+
fontSize: 18,
|
|
628
|
+
fontWeight: "bold",
|
|
629
|
+
marginLeft: 10
|
|
630
|
+
},
|
|
631
|
+
modalContent: {
|
|
632
|
+
flex: 1,
|
|
633
|
+
backgroundColor: "background"
|
|
634
|
+
}
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
// src/elements/core/UISwitch.tsx
|
|
638
|
+
var import_react5 = require("react");
|
|
639
|
+
var import_react_crud_utils7 = require("react-crud-utils");
|
|
640
|
+
var import_react_native6 = require("react-native");
|
|
641
|
+
function UISwitch(props) {
|
|
642
|
+
const scope = props.scope;
|
|
643
|
+
const initial = import_react_crud_utils7.Utils.nvl(scope.getValue(), false);
|
|
644
|
+
const [value, setValue] = (0, import_react5.useState)(initial);
|
|
645
|
+
let onChange = (v) => {
|
|
646
|
+
scope.changeValue(v);
|
|
647
|
+
setValue(v);
|
|
648
|
+
};
|
|
649
|
+
return /* @__PURE__ */ React.createElement(
|
|
650
|
+
import_react_native6.Switch,
|
|
651
|
+
{
|
|
652
|
+
value,
|
|
653
|
+
style: scope.getStyle("element"),
|
|
654
|
+
onValueChange: onChange
|
|
655
|
+
}
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// src/elements/core/UISlider.tsx
|
|
660
|
+
var import_react6 = require("react");
|
|
661
|
+
var import_react_crud_utils8 = require("react-crud-utils");
|
|
662
|
+
var import_slider = __toESM(require("@react-native-community/slider"));
|
|
663
|
+
function UISlider(props) {
|
|
664
|
+
const scope = props.scope;
|
|
665
|
+
const initial = import_react_crud_utils8.Utils.nvl(scope.getValue(), 0);
|
|
666
|
+
const [value, setValue] = (0, import_react6.useState)(initial);
|
|
667
|
+
let onChange = (v) => {
|
|
668
|
+
v = import_react_crud_utils8.Utils.nvl(v, 0);
|
|
669
|
+
console.log(v);
|
|
670
|
+
scope.changeValue(v);
|
|
671
|
+
setValue(v);
|
|
672
|
+
};
|
|
673
|
+
let step = scope.attr("step", 1);
|
|
674
|
+
let min = scope.attr("min", 0);
|
|
675
|
+
let max = scope.attr("min", 100);
|
|
676
|
+
let onSlideScroll = (scrollEnabled) => {
|
|
677
|
+
let viewScope = import_react_crud_utils8.ComponentUtils.getViewScope();
|
|
678
|
+
if (scope.original.debug) {
|
|
679
|
+
console.log(viewScope);
|
|
680
|
+
}
|
|
681
|
+
if (viewScope) {
|
|
682
|
+
let scrollRef = viewScope.get("scrollRef");
|
|
683
|
+
if (scrollRef) scrollRef.current?.setNativeProps?.({ scrollEnabled });
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
687
|
+
import_slider.default,
|
|
688
|
+
{
|
|
689
|
+
minimumValue: min,
|
|
690
|
+
maximumValue: max,
|
|
691
|
+
step,
|
|
692
|
+
minimumTrackTintColor: "#1EB1FC",
|
|
693
|
+
maximumTrackTintColor: "#d3d3d3",
|
|
694
|
+
thumbTintColor: "#1EB1FC",
|
|
695
|
+
value,
|
|
696
|
+
onSlidingStart: () => onSlideScroll(false),
|
|
697
|
+
onSlidingComplete: () => onSlideScroll(true),
|
|
698
|
+
style: { width: "100%", height: 40, ...scope.getStyle("element") },
|
|
699
|
+
onValueChange: onChange
|
|
700
|
+
}
|
|
701
|
+
));
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// src/elements/core/UIOption.tsx
|
|
705
|
+
var import_react_native7 = require("react-native");
|
|
706
|
+
function UIOption(props) {
|
|
707
|
+
const handlePress = () => {
|
|
708
|
+
import_react_native7.Linking.openURL("https://reactnative.dev/");
|
|
709
|
+
};
|
|
710
|
+
return /* @__PURE__ */ React.createElement(import_react_native7.TouchableOpacity, { onPress: handlePress }, /* @__PURE__ */ React.createElement(import_react_native7.Text, { style: styles5.link }, "Clique aqui para acessar o React Native"));
|
|
711
|
+
}
|
|
712
|
+
var styles5 = {
|
|
713
|
+
link: {}
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
// src/elements/core/UIRadio.tsx
|
|
717
|
+
var import_react_native8 = require("react-native");
|
|
718
|
+
function UIRadio(props) {
|
|
719
|
+
const handlePress = () => {
|
|
720
|
+
import_react_native8.Linking.openURL("https://reactnative.dev/");
|
|
721
|
+
};
|
|
722
|
+
return /* @__PURE__ */ React.createElement(import_react_native8.TouchableOpacity, { onPress: handlePress }, /* @__PURE__ */ React.createElement(import_react_native8.Text, { style: styles6.link }, "Clique aqui para acessar o React Native"));
|
|
723
|
+
}
|
|
724
|
+
var styles6 = {
|
|
725
|
+
link: {}
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
// src/elements/core/UIInput.tsx
|
|
729
|
+
var import_react7 = require("react");
|
|
730
|
+
var import_react_crud_utils9 = require("react-crud-utils");
|
|
731
|
+
var import_react_native9 = require("react-native");
|
|
732
|
+
var import_vector_icons3 = require("@expo/vector-icons");
|
|
733
|
+
function UIInput(props) {
|
|
734
|
+
let scope = props.scope;
|
|
735
|
+
let initial = import_react_crud_utils9.Utils.call(() => {
|
|
736
|
+
let val = import_react_crud_utils9.Utils.nvl(scope.getValue(), "");
|
|
737
|
+
if (val && val?.push) {
|
|
738
|
+
return val.join(", ").trim();
|
|
739
|
+
}
|
|
740
|
+
return val;
|
|
741
|
+
});
|
|
742
|
+
let label = scope.getLabel();
|
|
743
|
+
let placeholder = scope.getPart("placeholder", null, label);
|
|
744
|
+
let el = scope.original;
|
|
745
|
+
const element = scope.original;
|
|
746
|
+
const [height, setHeight] = (0, import_react7.useState)(80);
|
|
747
|
+
const [value, setValue] = (0, import_react7.useState)(initial);
|
|
748
|
+
let onChange = (v) => {
|
|
749
|
+
v = scope.changeValue(v);
|
|
750
|
+
setValue(v);
|
|
751
|
+
};
|
|
752
|
+
const style = (part, extra) => {
|
|
753
|
+
return { ...scope.getStyle(part, { ...styles7[part], ...extra }) };
|
|
754
|
+
};
|
|
755
|
+
const CustomIcon = () => {
|
|
756
|
+
let icon = el.icon;
|
|
757
|
+
if (icon) {
|
|
758
|
+
if (typeof icon === "string") {
|
|
759
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, el.icon && /* @__PURE__ */ React.createElement(
|
|
760
|
+
import_vector_icons3.Ionicons,
|
|
761
|
+
{
|
|
762
|
+
name: el.icon,
|
|
763
|
+
size: scope.attr("iconSize", 20),
|
|
764
|
+
color: scope.attr("iconColor", "#888")
|
|
765
|
+
}
|
|
766
|
+
));
|
|
767
|
+
}
|
|
768
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, icon);
|
|
769
|
+
}
|
|
770
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
771
|
+
};
|
|
772
|
+
let type = scope.getPart("type", null, "text");
|
|
773
|
+
let decode = {
|
|
774
|
+
textarea: {
|
|
775
|
+
multiline: true,
|
|
776
|
+
autoHeight: element.autoHeight !== false,
|
|
777
|
+
textAlignVertical: "top",
|
|
778
|
+
numberOfLines: 5,
|
|
779
|
+
style: { height: Math.max(80, height) },
|
|
780
|
+
baseStyle: { paddingVertical: 10 }
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
let defs = { ...import_react_crud_utils9.Utils.nvl(decode[type], {}), ...element.inputProps };
|
|
784
|
+
let inputStyle = import_react_crud_utils9.Utils.call(() => {
|
|
785
|
+
let size = element.size;
|
|
786
|
+
let css = {};
|
|
787
|
+
if (size === "small") {
|
|
788
|
+
css.height = 30;
|
|
789
|
+
css.fontSize = 12;
|
|
790
|
+
}
|
|
791
|
+
css.fontSize = import_react_crud_utils9.Utils.nvl(element.fontSize, css.fontSize);
|
|
792
|
+
css = { ...style("input"), ...style(type, css) };
|
|
793
|
+
css.lineHeight = parseInt(css.fontSize) + 2;
|
|
794
|
+
return css;
|
|
795
|
+
});
|
|
796
|
+
if (defs.autoHeight) {
|
|
797
|
+
defs.onContentSizeChange = (event) => {
|
|
798
|
+
setHeight(event.nativeEvent.contentSize.height);
|
|
799
|
+
};
|
|
800
|
+
inputStyle = { ...inputStyle, ...defs.style };
|
|
801
|
+
}
|
|
802
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(import_react_native9.View, { style: style("base", defs?.baseStyle) }, scope.getPart("left"), /* @__PURE__ */ React.createElement(
|
|
803
|
+
import_react_native9.TextInput,
|
|
804
|
+
{
|
|
805
|
+
onChangeText: onChange,
|
|
806
|
+
value,
|
|
807
|
+
placeholder,
|
|
808
|
+
...defs,
|
|
809
|
+
style: inputStyle
|
|
810
|
+
}
|
|
811
|
+
), /* @__PURE__ */ React.createElement(CustomIcon, null)), scope.getPart("right"));
|
|
812
|
+
}
|
|
813
|
+
var styles7 = import_react_native9.StyleSheet.create({
|
|
814
|
+
base: {
|
|
815
|
+
flex: 1,
|
|
816
|
+
width: "100%",
|
|
817
|
+
paddingBottom: 0,
|
|
818
|
+
paddingTop: 0,
|
|
819
|
+
alignItems: "center",
|
|
820
|
+
borderWidth: 1,
|
|
821
|
+
borderColor: "borderColor",
|
|
822
|
+
borderRadius: 5,
|
|
823
|
+
paddingHorizontal: 10,
|
|
824
|
+
alignSelf: "flex-start",
|
|
825
|
+
flexDirection: "row",
|
|
826
|
+
flexWrap: "wrap",
|
|
827
|
+
gap: 10
|
|
828
|
+
},
|
|
829
|
+
icon: {
|
|
830
|
+
marginRight: 10
|
|
831
|
+
// Espaço entre ícone e input
|
|
832
|
+
},
|
|
833
|
+
input: {
|
|
834
|
+
marginHorizontal: 0,
|
|
835
|
+
marginVertical: 0,
|
|
836
|
+
paddingVertical: 0,
|
|
837
|
+
height: 40,
|
|
838
|
+
width: "100%",
|
|
839
|
+
flex: 1
|
|
840
|
+
// Para o input ocupar o espaço restante
|
|
841
|
+
},
|
|
842
|
+
textarea: {
|
|
843
|
+
marginHorizontal: 0,
|
|
844
|
+
marginVertical: 0,
|
|
845
|
+
paddingVertical: 10,
|
|
846
|
+
width: "100%",
|
|
847
|
+
height: "auto",
|
|
848
|
+
alignSelf: "stretch",
|
|
849
|
+
flex: 1
|
|
850
|
+
// Para o input ocupar o espaço restante
|
|
851
|
+
}
|
|
852
|
+
});
|
|
853
|
+
|
|
854
|
+
// src/elements/UIElement.tsx
|
|
855
|
+
var import_react_native20 = require("react-native");
|
|
856
|
+
|
|
857
|
+
// src/elements/core/UIList.tsx
|
|
858
|
+
var import_react10 = __toESM(require("react"));
|
|
859
|
+
var import_react_crud_utils11 = require("react-crud-utils");
|
|
860
|
+
var import_react_native12 = require("react-native");
|
|
861
|
+
|
|
862
|
+
// src/elements/core/UIListRow.tsx
|
|
863
|
+
var import_react9 = __toESM(require("react"));
|
|
864
|
+
var import_react_crud_utils10 = require("react-crud-utils");
|
|
865
|
+
var import_react_native11 = require("react-native");
|
|
866
|
+
|
|
867
|
+
// src/hooks/useIsVisible.ts
|
|
868
|
+
var import_react8 = require("react");
|
|
869
|
+
var import_react_native10 = require("react-native");
|
|
870
|
+
function useIsVisible(ref, scope) {
|
|
871
|
+
const [isVisible, setIsVisible] = (0, import_react8.useState)(scope.visible === true);
|
|
872
|
+
(0, import_react8.useEffect)(() => {
|
|
873
|
+
const checkVisibility = () => {
|
|
874
|
+
if (!ref.current || isVisible || !scope.original?.useIsInView) return;
|
|
875
|
+
if (import_react_native10.Platform.OS === "web") {
|
|
876
|
+
const rect = ref.current.getBoundingClientRect?.();
|
|
877
|
+
if (rect && typeof window !== "undefined") {
|
|
878
|
+
const windowHeight = window.innerHeight;
|
|
879
|
+
const visible = rect.top < windowHeight && rect.bottom > 0;
|
|
880
|
+
if (visible) scope.visible = visible;
|
|
881
|
+
setIsVisible(visible);
|
|
882
|
+
}
|
|
883
|
+
} else {
|
|
884
|
+
ref.current.measureInWindow?.((x, y, width, height) => {
|
|
885
|
+
const windowHeight = import_react_native10.Dimensions.get("window").height;
|
|
886
|
+
const visible = y < windowHeight && y + height > 0;
|
|
887
|
+
if (visible) scope.visible = visible;
|
|
888
|
+
setIsVisible(visible);
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
const interval = setInterval(checkVisibility, 300);
|
|
893
|
+
return () => clearInterval(interval);
|
|
894
|
+
}, [ref]);
|
|
895
|
+
return isVisible;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// src/elements/core/UIListRow.tsx
|
|
899
|
+
function UIListRow(props) {
|
|
900
|
+
const scope = props.scope;
|
|
901
|
+
const index = props.index;
|
|
902
|
+
const original = scope.original;
|
|
903
|
+
const item = props.item;
|
|
904
|
+
const cols = scope.getPart("cols", void 0, -1);
|
|
905
|
+
const rowWidth = Math.floor(100 / cols) + "%";
|
|
906
|
+
const styles13 = { repeat: stylesRepeat, list: stylesList }?.[original.type];
|
|
907
|
+
const name = `${scope.key("row", index, "")}`;
|
|
908
|
+
const [row] = (0, import_react9.useState)(
|
|
909
|
+
import_react_crud_utils10.ScopeUtils.create({
|
|
910
|
+
...original,
|
|
911
|
+
parent: scope,
|
|
912
|
+
name,
|
|
913
|
+
crud: scope.crud,
|
|
914
|
+
index,
|
|
915
|
+
type: "row",
|
|
916
|
+
data: item
|
|
917
|
+
})
|
|
918
|
+
);
|
|
919
|
+
const targetRef = (0, import_react9.useRef)(null);
|
|
920
|
+
const isVisible = useIsVisible(targetRef, row);
|
|
921
|
+
const onClick = (item2) => {
|
|
922
|
+
row.call("click", { value: item2, item: item2, edit: true, index });
|
|
923
|
+
};
|
|
924
|
+
const Child = () => {
|
|
925
|
+
if (!isVisible && original.useIsInView && !row.visible && index > 20) {
|
|
926
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null);
|
|
927
|
+
}
|
|
928
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(UIChildren, { transient: true, scope: row, crud: row.crud }, props.children));
|
|
929
|
+
};
|
|
930
|
+
const ListItem = () => {
|
|
931
|
+
let [updateIndex, setUpdateIndex] = (0, import_react9.useState)(0);
|
|
932
|
+
let key = scope.key("item");
|
|
933
|
+
row.selected = row.getPart("isSelectedRow", void 0, false);
|
|
934
|
+
const getRowStyle = () => {
|
|
935
|
+
let css = row.getStyle("row", { ...styles13.row, minHeight: 30 });
|
|
936
|
+
if (row.selected) {
|
|
937
|
+
css = { ...css, ...row.getStyle("rowSelected", {}) };
|
|
938
|
+
} else {
|
|
939
|
+
css = { ...css, ...row.getStyle("rowUnSelected", {}) };
|
|
940
|
+
}
|
|
941
|
+
if (cols > 0) {
|
|
942
|
+
css.width = rowWidth;
|
|
943
|
+
}
|
|
944
|
+
return css;
|
|
945
|
+
};
|
|
946
|
+
row.update = () => {
|
|
947
|
+
scope.updateIndex = scope.updateIndex + 1;
|
|
948
|
+
setUpdateIndex(++updateIndex);
|
|
949
|
+
};
|
|
950
|
+
let renderedRow = row.getPart("renderedItem", void 0, true);
|
|
951
|
+
if (renderedRow === false) {
|
|
952
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null);
|
|
953
|
+
}
|
|
954
|
+
if (!original.click) {
|
|
955
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react_native11.View, { key, style: getRowStyle(), ref: targetRef }, /* @__PURE__ */ import_react9.default.createElement(Child, null));
|
|
956
|
+
}
|
|
957
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
958
|
+
import_react_native11.TouchableHighlight,
|
|
959
|
+
{
|
|
960
|
+
key,
|
|
961
|
+
style: getRowStyle(),
|
|
962
|
+
underlayColor: "transparent",
|
|
963
|
+
ref: targetRef,
|
|
964
|
+
onPress: (e) => {
|
|
965
|
+
e.stopPropagation();
|
|
966
|
+
onClick(item);
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
/* @__PURE__ */ import_react9.default.createElement(Child, null)
|
|
970
|
+
);
|
|
971
|
+
};
|
|
972
|
+
return /* @__PURE__ */ import_react9.default.createElement(ListItem, null);
|
|
973
|
+
}
|
|
974
|
+
var stylesList = import_react_native11.StyleSheet.create({
|
|
975
|
+
row: {
|
|
976
|
+
padding: 5,
|
|
977
|
+
margin: 0,
|
|
978
|
+
width: "100%",
|
|
979
|
+
backgroundColor: "background",
|
|
980
|
+
gap: 10,
|
|
981
|
+
borderRadius: 8,
|
|
982
|
+
justifyContent: "center"
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
var stylesRepeat = import_react_native11.StyleSheet.create({
|
|
986
|
+
row: {
|
|
987
|
+
padding: 0,
|
|
988
|
+
width: "100%",
|
|
989
|
+
justifyContent: "center"
|
|
990
|
+
}
|
|
991
|
+
});
|
|
992
|
+
|
|
993
|
+
// src/elements/core/UIList.tsx
|
|
994
|
+
var import_vector_icons4 = require("@expo/vector-icons");
|
|
995
|
+
function UIList(props) {
|
|
996
|
+
const scope = props.scope;
|
|
997
|
+
const crud = scope.crud;
|
|
998
|
+
const original = scope.original;
|
|
999
|
+
const cols = import_react_crud_utils11.Utils.nvl(scope.getPart("cols", void 0, 1));
|
|
1000
|
+
const styles13 = { repeat: stylesRepeat2, list: stylesList2 }?.[original.type];
|
|
1001
|
+
const add = import_react_crud_utils11.ComponentUtils.getDefine(props, "add");
|
|
1002
|
+
const hideAddWhenEmpty = original.hideAddWhenEmpty;
|
|
1003
|
+
const hideEmpty = original.hideEmpty;
|
|
1004
|
+
const getStyle = (key, extra) => {
|
|
1005
|
+
return scope.getStyle(key, { ...extra, ...styles13[key] });
|
|
1006
|
+
};
|
|
1007
|
+
const getContainerStyle = (extra) => {
|
|
1008
|
+
let row = getStyle("container", {});
|
|
1009
|
+
if (cols > 1) {
|
|
1010
|
+
row = { ...row, flexDirection: "row", flexWrap: "wrap" };
|
|
1011
|
+
}
|
|
1012
|
+
return row;
|
|
1013
|
+
};
|
|
1014
|
+
const LocalData = () => {
|
|
1015
|
+
let [index, setIndex] = (0, import_react10.useState)(scope.updateIndex);
|
|
1016
|
+
let empty = scope.attr("empty", "Sem registro");
|
|
1017
|
+
scope.update = () => {
|
|
1018
|
+
scope.updateIndex = ++index;
|
|
1019
|
+
setIndex(index);
|
|
1020
|
+
};
|
|
1021
|
+
const items2 = import_react_crud_utils11.Utils.call(() => {
|
|
1022
|
+
let list = import_react_crud_utils11.Utils.nvl(scope.getItems(), []);
|
|
1023
|
+
if (original.search !== false && !original.list?.url) {
|
|
1024
|
+
let query = crud.get("query", "").toLowerCase().trim();
|
|
1025
|
+
if (query.length > 1) {
|
|
1026
|
+
let filters = [];
|
|
1027
|
+
let filterBy = import_react_crud_utils11.Utils.nvl(original.filterBy, "label");
|
|
1028
|
+
import_react_crud_utils11.Utils.each(list, (o) => {
|
|
1029
|
+
let label = import_react_crud_utils11.Utils.getValue(filterBy, "none", o).toLowerCase();
|
|
1030
|
+
if (label) {
|
|
1031
|
+
if (label.includes(query)) {
|
|
1032
|
+
filters.push(o);
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
return filters;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return list;
|
|
1040
|
+
});
|
|
1041
|
+
let isEmpty = import_react_crud_utils11.Utils.isEmpty(items2);
|
|
1042
|
+
const isShowAdd = () => {
|
|
1043
|
+
if (!isEmpty) {
|
|
1044
|
+
return true;
|
|
1045
|
+
}
|
|
1046
|
+
return hideAddWhenEmpty !== true;
|
|
1047
|
+
};
|
|
1048
|
+
let Empty = () => {
|
|
1049
|
+
if (!isEmpty) {
|
|
1050
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null);
|
|
1051
|
+
}
|
|
1052
|
+
if (!empty) {
|
|
1053
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null);
|
|
1054
|
+
}
|
|
1055
|
+
if (typeof empty === "string") {
|
|
1056
|
+
return /* @__PURE__ */ import_react10.default.createElement(
|
|
1057
|
+
import_react_native12.Text,
|
|
1058
|
+
{
|
|
1059
|
+
style: scope.getStyle("empty", {
|
|
1060
|
+
flex: 1,
|
|
1061
|
+
fontWeight: 400,
|
|
1062
|
+
fontSize: 18,
|
|
1063
|
+
padding: 10,
|
|
1064
|
+
textAlign: "center",
|
|
1065
|
+
width: "100%",
|
|
1066
|
+
justifyContent: "center",
|
|
1067
|
+
alignItems: "center"
|
|
1068
|
+
})
|
|
1069
|
+
},
|
|
1070
|
+
empty
|
|
1071
|
+
);
|
|
1072
|
+
}
|
|
1073
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, empty);
|
|
1074
|
+
};
|
|
1075
|
+
if (empty === false && isEmpty) {
|
|
1076
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null);
|
|
1077
|
+
}
|
|
1078
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react_native12.View, { style: getContainerStyle() }, /* @__PURE__ */ import_react10.default.createElement(Empty, null), items2.map((item, i) => /* @__PURE__ */ import_react10.default.createElement(UIListRow, { index: i, item, scope }, props.children)), isShowAdd() && /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, add));
|
|
1079
|
+
};
|
|
1080
|
+
let items = import_react_crud_utils11.Utils.nvl(scope.getItems(), []);
|
|
1081
|
+
if (hideEmpty && import_react_crud_utils11.Utils.isEmpty(items)) {
|
|
1082
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null);
|
|
1083
|
+
}
|
|
1084
|
+
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, original.search !== false && /* @__PURE__ */ import_react10.default.createElement(
|
|
1085
|
+
UI_default.Text,
|
|
1086
|
+
{
|
|
1087
|
+
placeholder: "Pesquisar...",
|
|
1088
|
+
field: "query",
|
|
1089
|
+
crud,
|
|
1090
|
+
style: { marginBottom: 10 },
|
|
1091
|
+
change: {
|
|
1092
|
+
action: () => {
|
|
1093
|
+
scope.search();
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
icon: /* @__PURE__ */ import_react10.default.createElement(import_vector_icons4.Ionicons, { name: "search", size: 20, color: "#888" })
|
|
1097
|
+
}
|
|
1098
|
+
), /* @__PURE__ */ import_react10.default.createElement(LocalData, null));
|
|
1099
|
+
}
|
|
1100
|
+
var stylesList2 = import_react_native12.StyleSheet.create({
|
|
1101
|
+
container: {
|
|
1102
|
+
display: "flex",
|
|
1103
|
+
flexWrap: "wrap",
|
|
1104
|
+
gap: 10,
|
|
1105
|
+
width: "100%"
|
|
1106
|
+
},
|
|
1107
|
+
text: {
|
|
1108
|
+
fontSize: 18,
|
|
1109
|
+
fontWeight: "bold"
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
var stylesRepeat2 = import_react_native12.StyleSheet.create({
|
|
1113
|
+
container: {
|
|
1114
|
+
display: "flex",
|
|
1115
|
+
flexWrap: "wrap",
|
|
1116
|
+
gap: 10,
|
|
1117
|
+
width: "100%"
|
|
1118
|
+
},
|
|
1119
|
+
text: {
|
|
1120
|
+
fontSize: 18,
|
|
1121
|
+
fontWeight: "bold"
|
|
1122
|
+
}
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1125
|
+
// src/elements/core/UIToggle.tsx
|
|
1126
|
+
var import_react11 = __toESM(require("react"));
|
|
1127
|
+
var import_react_crud_utils12 = require("react-crud-utils");
|
|
1128
|
+
var import_react_native13 = require("react-native");
|
|
1129
|
+
function UIToggle(props) {
|
|
1130
|
+
const scope = props.scope;
|
|
1131
|
+
const options = import_react_crud_utils12.Utils.nvl(scope.getOptions(), []);
|
|
1132
|
+
const value = scope.getInputValue();
|
|
1133
|
+
let [index, setIndex] = (0, import_react11.useState)(0);
|
|
1134
|
+
const isSelected = (item) => {
|
|
1135
|
+
return item?.value === value;
|
|
1136
|
+
};
|
|
1137
|
+
const onClick = (item) => {
|
|
1138
|
+
scope.changeValue(item.object);
|
|
1139
|
+
setIndex(++index);
|
|
1140
|
+
};
|
|
1141
|
+
const Item = ({ item, index: index2 }) => {
|
|
1142
|
+
let selected = isSelected(item);
|
|
1143
|
+
let style = { ...styles8.text, ...scope.getStyle("text") };
|
|
1144
|
+
if (selected) style.color = "#ffffff";
|
|
1145
|
+
if (import_react_crud_utils12.Utils.isEmpty(props.children)) {
|
|
1146
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_native13.Text, { style }, item.label);
|
|
1147
|
+
}
|
|
1148
|
+
return /* @__PURE__ */ import_react11.default.createElement(UIListRow, { scope, item: item.object, index: index2 }, props.children);
|
|
1149
|
+
};
|
|
1150
|
+
const getItemStyle = (item) => {
|
|
1151
|
+
let style = { ...styles8.item, ...scope.getStyle("item") };
|
|
1152
|
+
let wPart = 100 / options.length;
|
|
1153
|
+
let width = Math.floor(wPart) + "%";
|
|
1154
|
+
if (isSelected(item)) {
|
|
1155
|
+
let selectedColor = scope.getPart("selectedColor", void 0, "primary");
|
|
1156
|
+
let st = scope.getStyle("selected", {
|
|
1157
|
+
backgroundColor: selectedColor,
|
|
1158
|
+
color: "#ffffff"
|
|
1159
|
+
});
|
|
1160
|
+
style = { ...style, ...st };
|
|
1161
|
+
if (!style.color) {
|
|
1162
|
+
style.color = "#ffffff";
|
|
1163
|
+
}
|
|
1164
|
+
const backgroundColor = item.backgroundColor;
|
|
1165
|
+
const color = item.color;
|
|
1166
|
+
if (item.backgroundColor) style = { ...style, backgroundColor };
|
|
1167
|
+
if (item.color) style = { ...style, color };
|
|
1168
|
+
} else {
|
|
1169
|
+
style.backgroundColor = "#fff";
|
|
1170
|
+
style.color = "#000";
|
|
1171
|
+
}
|
|
1172
|
+
style.width = width;
|
|
1173
|
+
return style;
|
|
1174
|
+
};
|
|
1175
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_native13.View, { style: { ...styles8.container, ...scope.getStyle("items") } }, options.map((item, i) => /* @__PURE__ */ import_react11.default.createElement(
|
|
1176
|
+
import_react_native13.TouchableHighlight,
|
|
1177
|
+
{
|
|
1178
|
+
key: `k-${i}`,
|
|
1179
|
+
style: getItemStyle(item),
|
|
1180
|
+
onPress: (e) => {
|
|
1181
|
+
onClick(item);
|
|
1182
|
+
}
|
|
1183
|
+
},
|
|
1184
|
+
/* @__PURE__ */ import_react11.default.createElement(Item, { item, index: i })
|
|
1185
|
+
)));
|
|
8
1186
|
}
|
|
1187
|
+
var styles8 = import_react_native13.StyleSheet.create({
|
|
1188
|
+
container: {
|
|
1189
|
+
flex: 1,
|
|
1190
|
+
width: "100%",
|
|
1191
|
+
justifyContent: "center",
|
|
1192
|
+
flexDirection: "row",
|
|
1193
|
+
alignItems: "center",
|
|
1194
|
+
margin: 3,
|
|
1195
|
+
gap: 5
|
|
1196
|
+
},
|
|
1197
|
+
item: {
|
|
1198
|
+
backgroundColor: "background",
|
|
1199
|
+
justifyContent: "center",
|
|
1200
|
+
alignItems: "center",
|
|
1201
|
+
width: "auto",
|
|
1202
|
+
flexDirection: "row",
|
|
1203
|
+
flex: 1,
|
|
1204
|
+
padding: 5,
|
|
1205
|
+
borderRadius: 2
|
|
1206
|
+
},
|
|
1207
|
+
text: {
|
|
1208
|
+
fontSize: 13,
|
|
1209
|
+
fontWeight: "400"
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
|
|
1213
|
+
// src/elements/core/UIQuantity.tsx
|
|
1214
|
+
var import_vector_icons5 = require("@expo/vector-icons");
|
|
1215
|
+
var import_react12 = require("react");
|
|
1216
|
+
var import_react_crud_utils13 = require("react-crud-utils");
|
|
1217
|
+
var import_react_native14 = require("react-native");
|
|
1218
|
+
function UIQuantity(props) {
|
|
1219
|
+
const scope = props.scope;
|
|
1220
|
+
const element = scope.original;
|
|
1221
|
+
let [index, setIndex] = (0, import_react12.useState)(0);
|
|
1222
|
+
const value = scope.getValue(0);
|
|
1223
|
+
let color = element.color;
|
|
1224
|
+
if (!color) color = "primary";
|
|
1225
|
+
const btn = {
|
|
1226
|
+
padding: 0,
|
|
1227
|
+
alignItems: "center",
|
|
1228
|
+
height: 30,
|
|
1229
|
+
width: 30,
|
|
1230
|
+
textAlign: "center",
|
|
1231
|
+
verticalAling: "middle",
|
|
1232
|
+
borderRadius: 24,
|
|
1233
|
+
backgroundColor: color,
|
|
1234
|
+
color: "#ffffff",
|
|
1235
|
+
justifyContent: "center"
|
|
1236
|
+
};
|
|
1237
|
+
const styles13 = {
|
|
1238
|
+
buttonLabel: {
|
|
1239
|
+
color: "#ffffff",
|
|
1240
|
+
fontWeight: "500",
|
|
1241
|
+
fontSize: 16
|
|
1242
|
+
},
|
|
1243
|
+
value: {
|
|
1244
|
+
flex: 1,
|
|
1245
|
+
flexDirection: "row",
|
|
1246
|
+
textAlign: "center",
|
|
1247
|
+
fontWeight: "500"
|
|
1248
|
+
},
|
|
1249
|
+
buttonInner: {
|
|
1250
|
+
flexDirection: "row",
|
|
1251
|
+
alignItems: "center",
|
|
1252
|
+
justifyContent: "center"
|
|
1253
|
+
},
|
|
1254
|
+
buttonIcon: {
|
|
1255
|
+
color: "#fff",
|
|
1256
|
+
fontSize: 18
|
|
1257
|
+
},
|
|
1258
|
+
button: btn,
|
|
1259
|
+
addButton: {
|
|
1260
|
+
...btn
|
|
1261
|
+
},
|
|
1262
|
+
delButton: {
|
|
1263
|
+
...btn
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
const change = (val) => {
|
|
1267
|
+
scope.changeValue(value + val);
|
|
1268
|
+
setIndex(++index);
|
|
1269
|
+
};
|
|
1270
|
+
const onClickAdd = () => {
|
|
1271
|
+
change(1);
|
|
1272
|
+
};
|
|
1273
|
+
const onClickDel = () => {
|
|
1274
|
+
change(-1);
|
|
1275
|
+
};
|
|
1276
|
+
const style = (part, extra) => {
|
|
1277
|
+
let s = { ...styles13[part], ...extra };
|
|
1278
|
+
return scope.getStyle(part, s);
|
|
1279
|
+
};
|
|
1280
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
1281
|
+
import_react_native14.TouchableHighlight,
|
|
1282
|
+
{
|
|
1283
|
+
underlayColor: "transparent",
|
|
1284
|
+
onPress: onClickDel,
|
|
1285
|
+
style: style("delButton")
|
|
1286
|
+
},
|
|
1287
|
+
/* @__PURE__ */ React.createElement(import_vector_icons5.Ionicons, { size: 30, style: style("buttonIcon"), name: "remove" })
|
|
1288
|
+
), /* @__PURE__ */ React.createElement(import_react_native14.Text, { style: style("value") }, import_react_crud_utils13.Utils.nvl(value, 0)), /* @__PURE__ */ React.createElement(
|
|
1289
|
+
import_react_native14.TouchableHighlight,
|
|
1290
|
+
{
|
|
1291
|
+
underlayColor: "transparent",
|
|
1292
|
+
onPress: onClickAdd,
|
|
1293
|
+
style: style("addButton")
|
|
1294
|
+
},
|
|
1295
|
+
/* @__PURE__ */ React.createElement(import_vector_icons5.Ionicons, { size: 30, style: style("buttonIcon"), name: "add" })
|
|
1296
|
+
));
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
// src/elements/core/UIModal.tsx
|
|
1300
|
+
var import_react13 = require("react");
|
|
1301
|
+
var import_react_crud_utils14 = require("react-crud-utils");
|
|
1302
|
+
var import_react_native16 = require("react-native");
|
|
1303
|
+
var import_Ionicons2 = __toESM(require("@expo/vector-icons/Ionicons"));
|
|
1304
|
+
|
|
1305
|
+
// src/elements/core/UIToast.tsx
|
|
1306
|
+
var import_react_native15 = require("react-native");
|
|
1307
|
+
var import_react_native_toast_message = __toESM(require("react-native-toast-message"));
|
|
1308
|
+
function UIToast() {
|
|
1309
|
+
const toastConfig = {
|
|
1310
|
+
success: (props) => /* @__PURE__ */ React.createElement(
|
|
1311
|
+
import_react_native_toast_message.BaseToast,
|
|
1312
|
+
{
|
|
1313
|
+
...props,
|
|
1314
|
+
style: styles13.darkToast,
|
|
1315
|
+
contentContainerStyle: { paddingHorizontal: 15 },
|
|
1316
|
+
text1Style: styles13.text,
|
|
1317
|
+
text2Style: styles13.text
|
|
1318
|
+
}
|
|
1319
|
+
),
|
|
1320
|
+
error: (props) => /* @__PURE__ */ React.createElement(
|
|
1321
|
+
import_react_native_toast_message.ErrorToast,
|
|
1322
|
+
{
|
|
1323
|
+
...props,
|
|
1324
|
+
style: styles13.darkToast,
|
|
1325
|
+
text1Style: styles13.text,
|
|
1326
|
+
text2Style: styles13.text
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
info: (props) => /* @__PURE__ */ React.createElement(
|
|
1330
|
+
import_react_native_toast_message.BaseToast,
|
|
1331
|
+
{
|
|
1332
|
+
...props,
|
|
1333
|
+
style: styles13.darkToast,
|
|
1334
|
+
text1Style: styles13.text,
|
|
1335
|
+
text2Style: styles13.text
|
|
1336
|
+
}
|
|
1337
|
+
)
|
|
1338
|
+
};
|
|
1339
|
+
const styles13 = import_react_native15.StyleSheet.create({
|
|
1340
|
+
darkToast: {
|
|
1341
|
+
backgroundColor: "rgba(34, 34, 34, 0.85)",
|
|
1342
|
+
borderLeftColor: "#222"
|
|
1343
|
+
// borda mais escura
|
|
1344
|
+
},
|
|
1345
|
+
text: {
|
|
1346
|
+
color: "#fff",
|
|
1347
|
+
// letras brancas
|
|
1348
|
+
textAlign: "center"
|
|
1349
|
+
}
|
|
1350
|
+
});
|
|
1351
|
+
return /* @__PURE__ */ React.createElement(import_react_native_toast_message.default, { config: toastConfig });
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
// src/elements/core/UIModal.tsx
|
|
1355
|
+
var import_react_native_safe_area_context2 = require("react-native-safe-area-context");
|
|
1356
|
+
function UIModal(props) {
|
|
1357
|
+
const scrollRef = (0, import_react13.useRef)(null);
|
|
1358
|
+
let owner = props.scope;
|
|
1359
|
+
let [index, setIndex] = (0, import_react13.useState)(0);
|
|
1360
|
+
let dialog = owner.currentDialog;
|
|
1361
|
+
let curr = dialog?.crud;
|
|
1362
|
+
if (!dialog) {
|
|
1363
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
1364
|
+
}
|
|
1365
|
+
dialog.update = () => {
|
|
1366
|
+
setIndex(++index);
|
|
1367
|
+
};
|
|
1368
|
+
if (dialog.debug) console.log(dialog);
|
|
1369
|
+
const scope = dialog.scope;
|
|
1370
|
+
const label = scope.getLabel();
|
|
1371
|
+
const theme = scope.getTheme();
|
|
1372
|
+
const headerStyle = import_react_crud_utils14.Utils.nvl(theme.styles?.defaults?.header, {});
|
|
1373
|
+
const headerRight = import_react_crud_utils14.ComponentUtils.getDefine(props, "header", "right");
|
|
1374
|
+
const bottom = import_react_crud_utils14.ComponentUtils.getDefine(props, "bottom");
|
|
1375
|
+
const style = (part, extra) => {
|
|
1376
|
+
let st = { ...styles9[part], ...extra };
|
|
1377
|
+
return { ...scope.getStyle(part, st) };
|
|
1378
|
+
};
|
|
1379
|
+
const onClose = () => {
|
|
1380
|
+
scope.close({ scope, crud: dialog?.crud, event: {} });
|
|
1381
|
+
};
|
|
1382
|
+
scope.put("scrollRef", scrollRef);
|
|
1383
|
+
const original = owner.original;
|
|
1384
|
+
import_react_crud_utils14.ComponentUtils.setViewScope(scope);
|
|
1385
|
+
let color = import_react_crud_utils14.Utils.nvl(headerStyle.color, "white");
|
|
1386
|
+
let defaults = { color };
|
|
1387
|
+
let key = `${curr.name}-${index}`;
|
|
1388
|
+
let ModalContent = ({ children }) => {
|
|
1389
|
+
let disableScroll = scope.part("disableScroll", false);
|
|
1390
|
+
let disableContent = scope.part("disableContent", false);
|
|
1391
|
+
if (disableContent) {
|
|
1392
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
1393
|
+
}
|
|
1394
|
+
if (disableScroll) {
|
|
1395
|
+
return /* @__PURE__ */ React.createElement(import_react_native16.View, { style: style("modalContent") }, children);
|
|
1396
|
+
}
|
|
1397
|
+
return /* @__PURE__ */ React.createElement(
|
|
1398
|
+
import_react_native16.ScrollView,
|
|
1399
|
+
{
|
|
1400
|
+
contentContainerStyle: { flexGrow: 1, paddingBottom: 50 },
|
|
1401
|
+
style: style("modalContent"),
|
|
1402
|
+
nestedScrollEnabled: true,
|
|
1403
|
+
ref: scrollRef
|
|
1404
|
+
},
|
|
1405
|
+
children
|
|
1406
|
+
);
|
|
1407
|
+
};
|
|
1408
|
+
const ModalInner = () => {
|
|
1409
|
+
let Content = () => {
|
|
1410
|
+
if (dialog?.component) {
|
|
1411
|
+
let cprops = dialog.props;
|
|
1412
|
+
let Aux = dialog.component;
|
|
1413
|
+
return /* @__PURE__ */ React.createElement(Aux, { key: curr.uuid, crud: curr, ...cprops });
|
|
1414
|
+
}
|
|
1415
|
+
return /* @__PURE__ */ React.createElement(UIChildren, { scope, crud: curr }, props.children);
|
|
1416
|
+
};
|
|
1417
|
+
let content = /* @__PURE__ */ React.createElement(Content, null);
|
|
1418
|
+
let area = {};
|
|
1419
|
+
if (original.transient) {
|
|
1420
|
+
return /* @__PURE__ */ React.createElement(import_react_native_safe_area_context2.SafeAreaView, { style: style("modalSafe", area) }, content);
|
|
1421
|
+
}
|
|
1422
|
+
return /* @__PURE__ */ React.createElement(import_react_native_safe_area_context2.SafeAreaView, { style: style("modalSafe", area) }, /* @__PURE__ */ React.createElement(import_react_native16.View, { style: scope.getStyle("header", headerStyle) }, /* @__PURE__ */ React.createElement(import_react_native16.TouchableOpacity, { onPress: onClose, style: style("modalCloseButton") }, /* @__PURE__ */ React.createElement(
|
|
1423
|
+
import_Ionicons2.default,
|
|
1424
|
+
{
|
|
1425
|
+
name: "chevron-back-outline",
|
|
1426
|
+
size: 24,
|
|
1427
|
+
color,
|
|
1428
|
+
style: style("modalCloseText", defaults)
|
|
1429
|
+
}
|
|
1430
|
+
)), /* @__PURE__ */ React.createElement(import_react_native16.Text, { style: style("modalTitle", defaults) }, label), !import_react_crud_utils14.Utils.isEmpty(headerRight) && /* @__PURE__ */ React.createElement(UIChildren, { scope, crud: curr, transient: true }, headerRight)), /* @__PURE__ */ React.createElement(ModalContent, null, content), bottom, /* @__PURE__ */ React.createElement(UIToast, null));
|
|
1431
|
+
};
|
|
1432
|
+
return /* @__PURE__ */ React.createElement(
|
|
1433
|
+
import_react_native16.Modal,
|
|
1434
|
+
{
|
|
1435
|
+
key,
|
|
1436
|
+
animationType: "slide",
|
|
1437
|
+
transparent: true,
|
|
1438
|
+
visible: true,
|
|
1439
|
+
onRequestClose: onClose
|
|
1440
|
+
},
|
|
1441
|
+
/* @__PURE__ */ React.createElement(ModalInner, null)
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
var styles9 = import_react_native16.StyleSheet.create({
|
|
1445
|
+
modalTop: {
|
|
1446
|
+
backgroundColor: "background",
|
|
1447
|
+
width: "100%"
|
|
1448
|
+
},
|
|
1449
|
+
modalSafe: {
|
|
1450
|
+
flex: 1,
|
|
1451
|
+
width: "100%",
|
|
1452
|
+
backgroundColor: "background"
|
|
1453
|
+
},
|
|
1454
|
+
modalCloseButton: {
|
|
1455
|
+
padding: 10
|
|
1456
|
+
},
|
|
1457
|
+
modalCloseText: {
|
|
1458
|
+
fontSize: 18,
|
|
1459
|
+
color: "white"
|
|
1460
|
+
},
|
|
1461
|
+
modalTitle: {
|
|
1462
|
+
fontSize: 22,
|
|
1463
|
+
fontWeight: 600,
|
|
1464
|
+
marginLeft: 10
|
|
1465
|
+
},
|
|
1466
|
+
modalContent: {
|
|
1467
|
+
flex: 1,
|
|
1468
|
+
backgroundColor: "background",
|
|
1469
|
+
paddingLeft: 15,
|
|
1470
|
+
paddingRight: 15,
|
|
1471
|
+
paddingTop: 10,
|
|
1472
|
+
paddingBottom: 10
|
|
1473
|
+
}
|
|
1474
|
+
});
|
|
1475
|
+
|
|
1476
|
+
// src/elements/UIElement.tsx
|
|
1477
|
+
var import_vector_icons6 = require("@expo/vector-icons");
|
|
1478
|
+
|
|
1479
|
+
// src/elements/core/UIView.tsx
|
|
1480
|
+
var import_react_native18 = require("react-native");
|
|
1481
|
+
var import_react_crud_utils16 = require("react-crud-utils");
|
|
1482
|
+
var import_react14 = require("react");
|
|
1483
|
+
|
|
1484
|
+
// src/elements/core/UIHeader.tsx
|
|
1485
|
+
var import_react_native17 = require("react-native");
|
|
1486
|
+
var import_react_crud_utils15 = require("react-crud-utils");
|
|
1487
|
+
function UIHeader({ scope }) {
|
|
1488
|
+
const theme = scope.getTheme();
|
|
1489
|
+
const header = scope.getPart("header", null, []);
|
|
1490
|
+
const headerStyle = import_react_crud_utils15.Utils.nvl(theme.styles?.defaults?.header, {});
|
|
1491
|
+
const headerTextStyle = import_react_crud_utils15.Utils.nvl(theme.styles?.defaults?.headerText, {});
|
|
1492
|
+
let headerStyleFull = import_react_crud_utils15.Utils.call(() => {
|
|
1493
|
+
let css = scope.getStyle("header", headerStyle);
|
|
1494
|
+
let bg = css.backgroundColor;
|
|
1495
|
+
if (bg) {
|
|
1496
|
+
css.color = import_react_crud_utils15.HtmlUtils.getTextColor(bg);
|
|
1497
|
+
}
|
|
1498
|
+
return css;
|
|
1499
|
+
});
|
|
1500
|
+
let hasHeader = !import_react_crud_utils15.Utils.isEmpty(header);
|
|
1501
|
+
let AuxHeader = () => {
|
|
1502
|
+
if (typeof header === "string") {
|
|
1503
|
+
return /* @__PURE__ */ React.createElement(import_react_native17.Text, { style: headerTextStyle }, header);
|
|
1504
|
+
}
|
|
1505
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, header);
|
|
1506
|
+
};
|
|
1507
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, hasHeader && /* @__PURE__ */ React.createElement(import_react_native17.View, { style: headerStyleFull }, /* @__PURE__ */ React.createElement(AuxHeader, null)));
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
// src/elements/core/UIView.tsx
|
|
1511
|
+
function UIView({ scope, children }) {
|
|
1512
|
+
const scrollRef = (0, import_react14.useRef)(null);
|
|
1513
|
+
const original = scope.original;
|
|
1514
|
+
const onScroll = () => {
|
|
1515
|
+
const crud = import_react_crud_utils16.ViewUtils.getCrud();
|
|
1516
|
+
import_react_crud_utils16.Utils.each(crud.scroll, (s) => {
|
|
1517
|
+
if (s.onScroll) {
|
|
1518
|
+
s.onScroll.call(s);
|
|
1519
|
+
}
|
|
1520
|
+
});
|
|
1521
|
+
};
|
|
1522
|
+
scope.put("scrollRef", scrollRef);
|
|
1523
|
+
import_react_crud_utils16.ComponentUtils.setViewScope(scope);
|
|
1524
|
+
let Container = () => {
|
|
1525
|
+
if (original.scroll === false) {
|
|
1526
|
+
return /* @__PURE__ */ React.createElement(UIChildren, { scope }, children);
|
|
1527
|
+
}
|
|
1528
|
+
return /* @__PURE__ */ React.createElement(import_react_native18.View, { style: scope.getStyle("container", styles10.container) }, /* @__PURE__ */ React.createElement(
|
|
1529
|
+
import_react_native18.ScrollView,
|
|
1530
|
+
{
|
|
1531
|
+
onScroll,
|
|
1532
|
+
scrollEventThrottle: 16,
|
|
1533
|
+
ref: scrollRef,
|
|
1534
|
+
nestedScrollEnabled: true,
|
|
1535
|
+
keyboardShouldPersistTaps: "handled",
|
|
1536
|
+
contentContainerStyle: scope.getStyle("contentContainer", {
|
|
1537
|
+
paddingBottom: 50
|
|
1538
|
+
}),
|
|
1539
|
+
style: scope.getStyle("scroll", styles10.scroll)
|
|
1540
|
+
},
|
|
1541
|
+
/* @__PURE__ */ React.createElement(UIChildren, { scope }, children)
|
|
1542
|
+
));
|
|
1543
|
+
};
|
|
1544
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UIHeader, { scope }), /* @__PURE__ */ React.createElement(Container, null), /* @__PURE__ */ React.createElement(UIToast, null), " ");
|
|
1545
|
+
}
|
|
1546
|
+
var styles10 = import_react_native18.StyleSheet.create({
|
|
1547
|
+
scroll: {
|
|
1548
|
+
paddingTop: 10,
|
|
1549
|
+
paddingBottom: 10,
|
|
1550
|
+
paddingLeft: 15,
|
|
1551
|
+
paddingRight: 15
|
|
1552
|
+
},
|
|
1553
|
+
container: {},
|
|
1554
|
+
view: {}
|
|
1555
|
+
});
|
|
1556
|
+
|
|
1557
|
+
// src/elements/UIElement.tsx
|
|
1558
|
+
var import_react_native_toast_message2 = __toESM(require("react-native-toast-message"));
|
|
1559
|
+
|
|
1560
|
+
// src/elements/core/UIOrder.tsx
|
|
1561
|
+
var import_react15 = __toESM(require("react"));
|
|
1562
|
+
var import_react_crud_utils17 = require("react-crud-utils");
|
|
1563
|
+
var import_react_native19 = require("react-native");
|
|
1564
|
+
var ITEM_HEIGHT = 70;
|
|
1565
|
+
function UIOrder(props) {
|
|
1566
|
+
const scope = props.scope;
|
|
1567
|
+
const element = scope.original;
|
|
1568
|
+
const initial = scope.getOptions();
|
|
1569
|
+
const [items, setItems] = (0, import_react15.useState)(initial);
|
|
1570
|
+
const [draggingId, setDraggingId] = (0, import_react15.useState)(null);
|
|
1571
|
+
const positions = (0, import_react15.useRef)(
|
|
1572
|
+
Object.fromEntries(
|
|
1573
|
+
initial.map((it, i) => [it.value, new import_react_native19.Animated.Value(i * ITEM_HEIGHT)])
|
|
1574
|
+
)
|
|
1575
|
+
).current;
|
|
1576
|
+
const panRespondersRef = (0, import_react15.useRef)({});
|
|
1577
|
+
const activeItem = (0, import_react15.useRef)(null);
|
|
1578
|
+
const activeIndex = (0, import_react15.useRef)(-1);
|
|
1579
|
+
const offsetY = (0, import_react15.useRef)(0);
|
|
1580
|
+
const itemsRef = (0, import_react15.useRef)(items);
|
|
1581
|
+
(0, import_react15.useEffect)(() => {
|
|
1582
|
+
itemsRef.current = items;
|
|
1583
|
+
}, [items]);
|
|
1584
|
+
(0, import_react15.useEffect)(() => {
|
|
1585
|
+
items.forEach((it, idx) => {
|
|
1586
|
+
if (!positions[it.value])
|
|
1587
|
+
positions[it.value] = new import_react_native19.Animated.Value(idx * ITEM_HEIGHT);
|
|
1588
|
+
import_react_native19.Animated.spring(positions[it.value], {
|
|
1589
|
+
toValue: idx * ITEM_HEIGHT,
|
|
1590
|
+
useNativeDriver: false
|
|
1591
|
+
}).start();
|
|
1592
|
+
});
|
|
1593
|
+
}, [items]);
|
|
1594
|
+
const onChange = (updated) => {
|
|
1595
|
+
const array = [];
|
|
1596
|
+
const items2 = scope.getItems();
|
|
1597
|
+
items2.splice(0);
|
|
1598
|
+
import_react_crud_utils17.Utils.each(updated, (o) => {
|
|
1599
|
+
const v = o.object;
|
|
1600
|
+
array.push(v);
|
|
1601
|
+
items2.push(v);
|
|
1602
|
+
});
|
|
1603
|
+
scope.changeValue(array);
|
|
1604
|
+
};
|
|
1605
|
+
const createPanResponder = (item) => import_react_native19.PanResponder.create({
|
|
1606
|
+
onStartShouldSetPanResponder: () => true,
|
|
1607
|
+
onPanResponderGrant: () => {
|
|
1608
|
+
const currentItems = itemsRef.current;
|
|
1609
|
+
if (!positions[item.value] || !currentItems.find((it) => it.value === item.value))
|
|
1610
|
+
return;
|
|
1611
|
+
activeItem.current = item;
|
|
1612
|
+
activeIndex.current = currentItems.findIndex(
|
|
1613
|
+
(it) => it.value === item.value
|
|
1614
|
+
);
|
|
1615
|
+
offsetY.current = positions[item.value]._value;
|
|
1616
|
+
setDraggingId(item.value);
|
|
1617
|
+
},
|
|
1618
|
+
onPanResponderMove: (_, gesture) => {
|
|
1619
|
+
const currentItems = itemsRef.current;
|
|
1620
|
+
if (!positions[item.value] || !currentItems.find((it) => it.value === item.value))
|
|
1621
|
+
return;
|
|
1622
|
+
const y = offsetY.current + gesture.dy;
|
|
1623
|
+
positions[item.value].setValue(y);
|
|
1624
|
+
const targetIndex = Math.max(
|
|
1625
|
+
0,
|
|
1626
|
+
Math.min(
|
|
1627
|
+
currentItems.length - 1,
|
|
1628
|
+
Math.floor((y + ITEM_HEIGHT / 2) / ITEM_HEIGHT)
|
|
1629
|
+
)
|
|
1630
|
+
);
|
|
1631
|
+
currentItems.forEach((other, idx) => {
|
|
1632
|
+
if (other.value === item.value || !positions[other.value]) return;
|
|
1633
|
+
let targetY = idx * ITEM_HEIGHT;
|
|
1634
|
+
if (idx > activeIndex.current && idx <= targetIndex)
|
|
1635
|
+
targetY = (idx - 1) * ITEM_HEIGHT;
|
|
1636
|
+
else if (idx < activeIndex.current && idx >= targetIndex)
|
|
1637
|
+
targetY = (idx + 1) * ITEM_HEIGHT;
|
|
1638
|
+
import_react_native19.Animated.timing(positions[other.value], {
|
|
1639
|
+
toValue: targetY,
|
|
1640
|
+
duration: 120,
|
|
1641
|
+
useNativeDriver: false
|
|
1642
|
+
}).start();
|
|
1643
|
+
});
|
|
1644
|
+
},
|
|
1645
|
+
onPanResponderRelease: () => {
|
|
1646
|
+
const moved = activeItem.current;
|
|
1647
|
+
const currentItems = itemsRef.current;
|
|
1648
|
+
if (!moved || !positions[moved.value] || !currentItems.find((it) => it.value === moved.value))
|
|
1649
|
+
return;
|
|
1650
|
+
const finalY = positions[moved.value]._value;
|
|
1651
|
+
const newIndex = Math.max(
|
|
1652
|
+
0,
|
|
1653
|
+
Math.min(
|
|
1654
|
+
currentItems.length - 1,
|
|
1655
|
+
Math.floor((finalY + ITEM_HEIGHT / 2) / ITEM_HEIGHT)
|
|
1656
|
+
)
|
|
1657
|
+
);
|
|
1658
|
+
const oldIndex = activeIndex.current;
|
|
1659
|
+
const updated = [...currentItems];
|
|
1660
|
+
const [removed] = updated.splice(oldIndex, 1);
|
|
1661
|
+
updated.splice(newIndex, 0, removed);
|
|
1662
|
+
setItems(updated);
|
|
1663
|
+
onChange(updated);
|
|
1664
|
+
setDraggingId(null);
|
|
1665
|
+
activeItem.current = null;
|
|
1666
|
+
activeIndex.current = -1;
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
items.forEach((it) => {
|
|
1670
|
+
if (!panRespondersRef.current[it.value]) {
|
|
1671
|
+
panRespondersRef.current[it.value] = createPanResponder(it);
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
const removeItem = (id) => {
|
|
1675
|
+
if (draggingId === id) {
|
|
1676
|
+
setDraggingId(null);
|
|
1677
|
+
activeItem.current = null;
|
|
1678
|
+
activeIndex.current = -1;
|
|
1679
|
+
}
|
|
1680
|
+
if (positions[id]) {
|
|
1681
|
+
delete positions[id];
|
|
1682
|
+
}
|
|
1683
|
+
if (panRespondersRef.current[id]) {
|
|
1684
|
+
delete panRespondersRef.current[id];
|
|
1685
|
+
}
|
|
1686
|
+
setItems((prev) => {
|
|
1687
|
+
const updated = prev.filter((it) => it.value !== id);
|
|
1688
|
+
updated.forEach((it, idx) => {
|
|
1689
|
+
if (positions[it.value])
|
|
1690
|
+
import_react_native19.Animated.spring(positions[it.value], {
|
|
1691
|
+
toValue: idx * ITEM_HEIGHT,
|
|
1692
|
+
useNativeDriver: false
|
|
1693
|
+
}).start();
|
|
1694
|
+
});
|
|
1695
|
+
onChange(updated);
|
|
1696
|
+
return updated;
|
|
1697
|
+
});
|
|
1698
|
+
};
|
|
1699
|
+
const Empty = () => {
|
|
1700
|
+
if (import_react_crud_utils17.Utils.isEmpty(items)) {
|
|
1701
|
+
let empty = scope.part("empty", "Sem registro");
|
|
1702
|
+
if (empty !== false) return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, empty);
|
|
1703
|
+
}
|
|
1704
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null);
|
|
1705
|
+
};
|
|
1706
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react_native19.View, { style: styles11.container }, /* @__PURE__ */ import_react15.default.createElement(Empty, null), /* @__PURE__ */ import_react15.default.createElement(import_react_native19.View, { style: { height: items.length * ITEM_HEIGHT, width: "100%" } }, items.map((item) => {
|
|
1707
|
+
const y = positions[item.value];
|
|
1708
|
+
if (!y) return null;
|
|
1709
|
+
const isDragging = draggingId === item.value;
|
|
1710
|
+
const itemStyle = scope.getStyle("row", { ...styles11.item });
|
|
1711
|
+
return /* @__PURE__ */ import_react15.default.createElement(
|
|
1712
|
+
import_react_native19.Animated.View,
|
|
1713
|
+
{
|
|
1714
|
+
key: item.value,
|
|
1715
|
+
...panRespondersRef.current[item.value]?.panHandlers ?? {},
|
|
1716
|
+
style: [
|
|
1717
|
+
itemStyle,
|
|
1718
|
+
{
|
|
1719
|
+
position: "absolute",
|
|
1720
|
+
left: 0,
|
|
1721
|
+
right: 0,
|
|
1722
|
+
height: ITEM_HEIGHT - 8,
|
|
1723
|
+
transform: [{ translateY: y }],
|
|
1724
|
+
zIndex: isDragging ? 999 : 0,
|
|
1725
|
+
elevation: isDragging ? 999 : 0
|
|
1726
|
+
}
|
|
1727
|
+
]
|
|
1728
|
+
},
|
|
1729
|
+
/* @__PURE__ */ import_react15.default.createElement(import_react_native19.View, { style: styles11.handle }, /* @__PURE__ */ import_react15.default.createElement(import_react_native19.Text, { style: styles11.handleText }, "\u2261")),
|
|
1730
|
+
/* @__PURE__ */ import_react15.default.createElement(import_react_native19.Text, { style: styles11.itemText }, item.label),
|
|
1731
|
+
element.remove && /* @__PURE__ */ import_react15.default.createElement(
|
|
1732
|
+
import_react_native19.TouchableOpacity,
|
|
1733
|
+
{
|
|
1734
|
+
onPress: () => removeItem(item.value),
|
|
1735
|
+
style: styles11.del
|
|
1736
|
+
},
|
|
1737
|
+
/* @__PURE__ */ import_react15.default.createElement(import_react_native19.Text, { style: { color: "#fff" } }, "X")
|
|
1738
|
+
)
|
|
1739
|
+
);
|
|
1740
|
+
})));
|
|
1741
|
+
}
|
|
1742
|
+
var styles11 = import_react_native19.StyleSheet.create({
|
|
1743
|
+
container: { flex: 1 },
|
|
1744
|
+
title: { fontSize: 18, fontWeight: "600", marginBottom: 12 },
|
|
1745
|
+
item: {
|
|
1746
|
+
backgroundColor: "#fff",
|
|
1747
|
+
borderRadius: 10,
|
|
1748
|
+
marginVertical: 4,
|
|
1749
|
+
paddingHorizontal: 12,
|
|
1750
|
+
alignItems: "center",
|
|
1751
|
+
flexDirection: "row",
|
|
1752
|
+
elevation: 3,
|
|
1753
|
+
shadowColor: "#000",
|
|
1754
|
+
shadowOpacity: 0.05,
|
|
1755
|
+
shadowRadius: 6
|
|
1756
|
+
},
|
|
1757
|
+
handle: { width: 40, alignItems: "center", justifyContent: "center" },
|
|
1758
|
+
handleText: { fontSize: 22, color: "#666" },
|
|
1759
|
+
itemText: { fontSize: 16, flex: 1 },
|
|
1760
|
+
del: {
|
|
1761
|
+
backgroundColor: "#e74c3c",
|
|
1762
|
+
height: 34,
|
|
1763
|
+
width: 34,
|
|
1764
|
+
borderRadius: 6,
|
|
1765
|
+
alignItems: "center",
|
|
1766
|
+
justifyContent: "center"
|
|
1767
|
+
}
|
|
1768
|
+
});
|
|
1769
|
+
|
|
1770
|
+
// src/elements/UIElement.tsx
|
|
1771
|
+
var CrudContext = (0, import_react16.createContext)({});
|
|
1772
|
+
function UIElement(props) {
|
|
1773
|
+
const ctx = (0, import_react16.useContext)(CrudContext);
|
|
1774
|
+
const theme = import_react_crud_utils18.Utils.nvl(props.theme, ctx?.theme);
|
|
1775
|
+
let crud = import_react_crud_utils18.Utils.nvl(props.crud, ctx?.crud);
|
|
1776
|
+
let [scope] = (0, import_react16.useState)(import_react_crud_utils18.ScopeUtils.create({ crud, ...props, theme }));
|
|
1777
|
+
let [index, setIndex] = (0, import_react16.useState)(0);
|
|
1778
|
+
let [error, setError] = (0, import_react16.useState)(null);
|
|
1779
|
+
scope.compile(props);
|
|
1780
|
+
crud = scope.crud;
|
|
1781
|
+
let options = scope.getOptions();
|
|
1782
|
+
let original = scope.original;
|
|
1783
|
+
let ref = (0, import_react16.useRef)(null);
|
|
1784
|
+
scope.update = () => {
|
|
1785
|
+
setIndex(++index);
|
|
1786
|
+
};
|
|
1787
|
+
scope.updateElement = () => {
|
|
1788
|
+
setIndex(++index);
|
|
1789
|
+
};
|
|
1790
|
+
scope.toast = (message, type = "info", args) => {
|
|
1791
|
+
import_react_native_toast_message2.default.show({
|
|
1792
|
+
type,
|
|
1793
|
+
// 'success' | 'error' | 'info'
|
|
1794
|
+
text1: message,
|
|
1795
|
+
position: "bottom",
|
|
1796
|
+
// 'top' é outra opção
|
|
1797
|
+
visibilityTime: 3e3,
|
|
1798
|
+
// tempo que fica visível em ms
|
|
1799
|
+
...args
|
|
1800
|
+
});
|
|
1801
|
+
};
|
|
1802
|
+
scope.prompt = (args) => {
|
|
1803
|
+
let event = args.event;
|
|
1804
|
+
if (event) {
|
|
1805
|
+
let message = "Voc\xEA tem certeza que deseja continuar?";
|
|
1806
|
+
let title = "Aten\xE7\xE3o";
|
|
1807
|
+
let prompt = event.prompt;
|
|
1808
|
+
if (typeof prompt === "string") {
|
|
1809
|
+
message = prompt;
|
|
1810
|
+
}
|
|
1811
|
+
if (typeof prompt === "object") {
|
|
1812
|
+
message = import_react_crud_utils18.Utils.nvl(prompt.message, message);
|
|
1813
|
+
title = import_react_crud_utils18.Utils.nvl(prompt.title, title);
|
|
1814
|
+
}
|
|
1815
|
+
import_react_native20.Alert.alert(
|
|
1816
|
+
title,
|
|
1817
|
+
message,
|
|
1818
|
+
[
|
|
1819
|
+
{
|
|
1820
|
+
text: "Cancelar",
|
|
1821
|
+
style: "cancel"
|
|
1822
|
+
},
|
|
1823
|
+
{
|
|
1824
|
+
text: "Confirmar",
|
|
1825
|
+
onPress: () => scope.execute(args)
|
|
1826
|
+
}
|
|
1827
|
+
],
|
|
1828
|
+
{ cancelable: false }
|
|
1829
|
+
);
|
|
1830
|
+
}
|
|
1831
|
+
};
|
|
1832
|
+
const Custom = () => {
|
|
1833
|
+
let c = original.custom;
|
|
1834
|
+
if (c) {
|
|
1835
|
+
if (typeof c === "string") {
|
|
1836
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1837
|
+
UIElement,
|
|
1838
|
+
{
|
|
1839
|
+
element: { value: c, type: "dummy" },
|
|
1840
|
+
crud
|
|
1841
|
+
}
|
|
1842
|
+
);
|
|
1843
|
+
}
|
|
1844
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
1845
|
+
UIElement,
|
|
1846
|
+
{
|
|
1847
|
+
type: c.type,
|
|
1848
|
+
tag: c.type,
|
|
1849
|
+
...c.props,
|
|
1850
|
+
crud
|
|
1851
|
+
}
|
|
1852
|
+
);
|
|
1853
|
+
}
|
|
1854
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null);
|
|
1855
|
+
};
|
|
1856
|
+
if (scope.is("type", "dummy")) {
|
|
1857
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, scope.getDisplayValue());
|
|
1858
|
+
}
|
|
1859
|
+
let onCheck = () => {
|
|
1860
|
+
let v = scope.getValue();
|
|
1861
|
+
let check = !(v === true);
|
|
1862
|
+
onChange({ target: { value: check } });
|
|
1863
|
+
};
|
|
1864
|
+
let onChange = (e) => {
|
|
1865
|
+
let val = e.target.value;
|
|
1866
|
+
if (scope.isType("integer", "int", "number")) {
|
|
1867
|
+
val = parseInt(val);
|
|
1868
|
+
} else if (scope.isType("decimal")) {
|
|
1869
|
+
val = parseFloat(val);
|
|
1870
|
+
}
|
|
1871
|
+
if (scope.isType("select", "complete")) {
|
|
1872
|
+
val = scope.getSelectedItem(val);
|
|
1873
|
+
}
|
|
1874
|
+
scope.changeValue(val);
|
|
1875
|
+
scope.update();
|
|
1876
|
+
};
|
|
1877
|
+
let onClick = (e) => {
|
|
1878
|
+
if (scope.currentDialog?.component) return;
|
|
1879
|
+
scope.call("click");
|
|
1880
|
+
};
|
|
1881
|
+
let defaultsInput = {
|
|
1882
|
+
scope,
|
|
1883
|
+
crud,
|
|
1884
|
+
onChange
|
|
1885
|
+
};
|
|
1886
|
+
if (scope.isType("password")) {
|
|
1887
|
+
defaultsInput.type = "password";
|
|
1888
|
+
}
|
|
1889
|
+
let isChecked = () => {
|
|
1890
|
+
let v = scope.getValue();
|
|
1891
|
+
return v === true;
|
|
1892
|
+
};
|
|
1893
|
+
let hasChildren = () => {
|
|
1894
|
+
if (scope.isInput()) {
|
|
1895
|
+
return false;
|
|
1896
|
+
}
|
|
1897
|
+
return !import_react_crud_utils18.Utils.isEmpty(props.children) || !import_react_crud_utils18.Utils.isEmpty(props.elements);
|
|
1898
|
+
};
|
|
1899
|
+
let isInput = scope.is(
|
|
1900
|
+
"type",
|
|
1901
|
+
"text",
|
|
1902
|
+
"textarea",
|
|
1903
|
+
"number",
|
|
1904
|
+
"integer",
|
|
1905
|
+
"int",
|
|
1906
|
+
"phone",
|
|
1907
|
+
"postalCode",
|
|
1908
|
+
"money",
|
|
1909
|
+
"password",
|
|
1910
|
+
"email"
|
|
1911
|
+
);
|
|
1912
|
+
const getStyle = (part, extra) => {
|
|
1913
|
+
let type = import_react_crud_utils18.Utils.nvl(original.type, "none");
|
|
1914
|
+
let key = import_react_crud_utils18.Utils.nvl(part, "root");
|
|
1915
|
+
let def = { ...styles12[key] };
|
|
1916
|
+
let hasChild = hasChildren();
|
|
1917
|
+
type = import_react_crud_utils18.Utils.nvl(original.layout, type);
|
|
1918
|
+
if (!part && !hasChild) {
|
|
1919
|
+
def = { ...def };
|
|
1920
|
+
}
|
|
1921
|
+
if (scope.isInput()) {
|
|
1922
|
+
def = { ...def, ...elementStyle.input[key] };
|
|
1923
|
+
}
|
|
1924
|
+
def = { ...def, ...elementStyle?.[type]?.[key] };
|
|
1925
|
+
if (hasChild && part) {
|
|
1926
|
+
def = { ...def, ...withChildStyles[part] };
|
|
1927
|
+
}
|
|
1928
|
+
return { ...def, ...scope.getStyle(part, { ...def, ...extra }) };
|
|
1929
|
+
};
|
|
1930
|
+
let elStyle = getStyle("element");
|
|
1931
|
+
let defaultsUI = {
|
|
1932
|
+
required: scope.isRequired(),
|
|
1933
|
+
size: "small",
|
|
1934
|
+
scope,
|
|
1935
|
+
crud,
|
|
1936
|
+
style: elStyle,
|
|
1937
|
+
placeholder: scope.attr("placeholder", "Digite aqui")
|
|
1938
|
+
};
|
|
1939
|
+
scope.error = (msg) => {
|
|
1940
|
+
error = msg;
|
|
1941
|
+
setError(msg);
|
|
1942
|
+
};
|
|
1943
|
+
if (!original.list?.url && !original.load?.url) {
|
|
1944
|
+
scope.start();
|
|
1945
|
+
}
|
|
1946
|
+
(0, import_react16.useEffect)(() => {
|
|
1947
|
+
scope.start();
|
|
1948
|
+
});
|
|
1949
|
+
const CustomIcon = () => {
|
|
1950
|
+
if (typeof original.icon === "string") {
|
|
1951
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_vector_icons6.Ionicons, { name: original.icon, style: scope.getStyle("icon") });
|
|
1952
|
+
}
|
|
1953
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, original.icon);
|
|
1954
|
+
};
|
|
1955
|
+
scope.open = (args) => {
|
|
1956
|
+
import_react_native20.Linking.openURL(args.url);
|
|
1957
|
+
};
|
|
1958
|
+
(0, import_react16.useLayoutEffect)(() => {
|
|
1959
|
+
if (ref?.current && scope.is("type", "card", "list", "tabs", "stepper")) {
|
|
1960
|
+
let el = ref?.current;
|
|
1961
|
+
if (el?.classList) {
|
|
1962
|
+
let bg = import_react_crud_utils18.HtmlUtils.getBGColor(el);
|
|
1963
|
+
if (bg === "rgb(255, 255, 255)") {
|
|
1964
|
+
el.classList.add("ui-dark");
|
|
1965
|
+
} else {
|
|
1966
|
+
el.classList.add("ui-light");
|
|
1967
|
+
}
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
const isShowLabel = () => {
|
|
1972
|
+
if (typeof original.label !== "undefined" && original.label !== false && !scope.isType("button", "dialog", "modal")) {
|
|
1973
|
+
return true;
|
|
1974
|
+
}
|
|
1975
|
+
return false;
|
|
1976
|
+
};
|
|
1977
|
+
const isShowInner = () => {
|
|
1978
|
+
if (scope.isType("icon")) return false;
|
|
1979
|
+
if (hasChildren()) {
|
|
1980
|
+
return false;
|
|
1981
|
+
}
|
|
1982
|
+
return true;
|
|
1983
|
+
};
|
|
1984
|
+
if (!scope.isRendered() || scope.is("type", "define")) {
|
|
1985
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null);
|
|
1986
|
+
}
|
|
1987
|
+
const isShowChild = () => {
|
|
1988
|
+
if (scope.isType(
|
|
1989
|
+
"tabs",
|
|
1990
|
+
"view",
|
|
1991
|
+
"grid",
|
|
1992
|
+
"list",
|
|
1993
|
+
"define",
|
|
1994
|
+
"repeat",
|
|
1995
|
+
"modal",
|
|
1996
|
+
"dialog",
|
|
1997
|
+
"chart"
|
|
1998
|
+
)) {
|
|
1999
|
+
return false;
|
|
2000
|
+
}
|
|
2001
|
+
return true;
|
|
2002
|
+
};
|
|
2003
|
+
let isTouch = !scope.isType("input", "grid", "list", "order", "repeat") && original.click;
|
|
2004
|
+
let custom = {};
|
|
2005
|
+
if (isTouch) {
|
|
2006
|
+
custom.underlayColor = "transparent";
|
|
2007
|
+
custom.onPress = onClick;
|
|
2008
|
+
}
|
|
2009
|
+
let Tag = (props2) => {
|
|
2010
|
+
let Aux = import_react_native20.View;
|
|
2011
|
+
if (isTouch) {
|
|
2012
|
+
Aux = import_react_native20.TouchableHighlight;
|
|
2013
|
+
}
|
|
2014
|
+
if (scope.isType("dialog", "order") || original.transient) {
|
|
2015
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, props2.children);
|
|
2016
|
+
}
|
|
2017
|
+
return /* @__PURE__ */ import_react16.default.createElement(Aux, { ...props2 });
|
|
2018
|
+
};
|
|
2019
|
+
let Inner = () => {
|
|
2020
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, scope.getPart("render", null, /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null)), scope.is("type", "button") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2021
|
+
UIButton,
|
|
2022
|
+
{
|
|
2023
|
+
...defaultsUI,
|
|
2024
|
+
onClick,
|
|
2025
|
+
variant: scope.attr("variant", "outlined")
|
|
2026
|
+
},
|
|
2027
|
+
original.icon && /* @__PURE__ */ import_react16.default.createElement(CustomIcon, null),
|
|
2028
|
+
original.label && /* @__PURE__ */ import_react16.default.createElement(import_react_native20.Text, { style: scope.getPart("label", "button") }, scope.getLabel())
|
|
2029
|
+
), scope.is("type", "link") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2030
|
+
UILink,
|
|
2031
|
+
{
|
|
2032
|
+
...defaultsUI,
|
|
2033
|
+
onClick,
|
|
2034
|
+
variant: scope.attr("variant", "outlined")
|
|
2035
|
+
},
|
|
2036
|
+
original.icon && /* @__PURE__ */ import_react16.default.createElement(CustomIcon, null),
|
|
2037
|
+
original.label && /* @__PURE__ */ import_react16.default.createElement(import_react_native20.Text, { style: scope.getPart("label", "link") }, scope.getLabel())
|
|
2038
|
+
), isInput && /* @__PURE__ */ import_react16.default.createElement(
|
|
2039
|
+
UIInput,
|
|
2040
|
+
{
|
|
2041
|
+
...defaultsInput,
|
|
2042
|
+
...defaultsUI,
|
|
2043
|
+
InputProps: { ...original.inputProps }
|
|
2044
|
+
}
|
|
2045
|
+
), scope.is("type", "complete", "autocomplete") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2046
|
+
UIComplete,
|
|
2047
|
+
{
|
|
2048
|
+
scope,
|
|
2049
|
+
defaultsInput,
|
|
2050
|
+
defaultsUI
|
|
2051
|
+
}
|
|
2052
|
+
), scope.is("type", "quantity") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2053
|
+
UIQuantity,
|
|
2054
|
+
{
|
|
2055
|
+
scope,
|
|
2056
|
+
defaultsInput,
|
|
2057
|
+
defaultsUI
|
|
2058
|
+
}
|
|
2059
|
+
), scope.is("type", "checkbox", "boolean", "switch") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2060
|
+
UISwitch,
|
|
2061
|
+
{
|
|
2062
|
+
checked: isChecked(),
|
|
2063
|
+
...defaultsInput,
|
|
2064
|
+
onChange: onCheck
|
|
2065
|
+
}
|
|
2066
|
+
), scope.isType("slider") && /* @__PURE__ */ import_react16.default.createElement(UISlider, { ...defaultsInput, onChange: onCheck }), scope.is("type", "select") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2067
|
+
UISelect,
|
|
2068
|
+
{
|
|
2069
|
+
...defaultsInput,
|
|
2070
|
+
...defaultsUI,
|
|
2071
|
+
value: scope.getSelectedValue()
|
|
2072
|
+
}
|
|
2073
|
+
), scope.is("type", "toggle") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2074
|
+
UIToggle,
|
|
2075
|
+
{
|
|
2076
|
+
...defaultsInput,
|
|
2077
|
+
...defaultsUI,
|
|
2078
|
+
value: scope.getSelectedValue()
|
|
2079
|
+
}
|
|
2080
|
+
), scope.is("type", "radio") && /* @__PURE__ */ import_react16.default.createElement(UIRadio, { ...defaultsInput, ...defaultsUI, row: true }, options.map((row, i) => /* @__PURE__ */ import_react16.default.createElement(
|
|
2081
|
+
UIOption,
|
|
2082
|
+
{
|
|
2083
|
+
key: "i" + i,
|
|
2084
|
+
control: /* @__PURE__ */ import_react16.default.createElement(UIRadio, { ...defaultsUI }),
|
|
2085
|
+
label: row.label,
|
|
2086
|
+
value: row.value
|
|
2087
|
+
}
|
|
2088
|
+
))), scope.is("type", "custom") && /* @__PURE__ */ import_react16.default.createElement(Custom, null), scope.is("type", "column") && /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, scope.is("format", "img") && /* @__PURE__ */ import_react16.default.createElement(import_react_native20.Image, { source: scope.getDisplayValue() }), scope.is("format", "icon") && /* @__PURE__ */ import_react16.default.createElement(UIIcon, { scope, crud }), !scope.is("format", "icon", "img") && /* @__PURE__ */ import_react16.default.createElement(import_react_native20.Text, null, scope.getDisplayValue())), scope.is("type", "output", "value") && /* @__PURE__ */ import_react16.default.createElement(import_react_native20.Text, { style: getStyle("value") }, scope.getDisplayValue()));
|
|
2089
|
+
};
|
|
2090
|
+
let Include = ({ name, style }) => {
|
|
2091
|
+
if (props[name]) {
|
|
2092
|
+
let define = import_react_crud_utils18.ComponentUtils.getDefine(props, name);
|
|
2093
|
+
if (!import_react_crud_utils18.Utils.isEmpty(define)) {
|
|
2094
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2095
|
+
UIChildren,
|
|
2096
|
+
{
|
|
2097
|
+
...props,
|
|
2098
|
+
scope,
|
|
2099
|
+
crud,
|
|
2100
|
+
style: getStyle(name, style)
|
|
2101
|
+
},
|
|
2102
|
+
define
|
|
2103
|
+
);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null);
|
|
2107
|
+
};
|
|
2108
|
+
let Container = () => {
|
|
2109
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, isShowLabel() && /* @__PURE__ */ import_react16.default.createElement(
|
|
2110
|
+
import_react_native20.View,
|
|
2111
|
+
{
|
|
2112
|
+
style: getStyle("outerLabel", {
|
|
2113
|
+
alignSelf: "flex-start",
|
|
2114
|
+
flexDirection: "row",
|
|
2115
|
+
display: "flex",
|
|
2116
|
+
justifyContent: "space-between",
|
|
2117
|
+
alignItems: "center",
|
|
2118
|
+
width: "100%"
|
|
2119
|
+
})
|
|
2120
|
+
},
|
|
2121
|
+
/* @__PURE__ */ import_react16.default.createElement(import_react_native20.Text, { style: getStyle("label") }, scope.getLabel()),
|
|
2122
|
+
/* @__PURE__ */ import_react16.default.createElement(Include, { name: "actions", style: { width: "auto" } })
|
|
2123
|
+
), isShowInner() && /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native20.View, { style: getStyle("inner") }, /* @__PURE__ */ import_react16.default.createElement(Inner, null)), error && /* @__PURE__ */ import_react16.default.createElement(
|
|
2124
|
+
import_react_native20.View,
|
|
2125
|
+
{
|
|
2126
|
+
style: getStyle("error", {
|
|
2127
|
+
fontSize: 12,
|
|
2128
|
+
paddingTop: 4,
|
|
2129
|
+
color: "#e55b5b"
|
|
2130
|
+
})
|
|
2131
|
+
},
|
|
2132
|
+
error
|
|
2133
|
+
)), scope.isType("list", "repeat") && /* @__PURE__ */ import_react16.default.createElement(UIList, { ...props, scope, crud }), scope.isType("order") && /* @__PURE__ */ import_react16.default.createElement(UIOrder, { ...props, scope, crud }), scope.isType("chart") && /* @__PURE__ */ import_react16.default.createElement(ElChart, { ...props, scope, crud }), scope.isType("tabs") && /* @__PURE__ */ import_react16.default.createElement(ElTabs, { ...props, scope, crud }), scope.isType("view") && /* @__PURE__ */ import_react16.default.createElement(UIView, { ...props, scope, crud }), scope.is("type", "icon") && /* @__PURE__ */ import_react16.default.createElement(
|
|
2134
|
+
UIIcon,
|
|
2135
|
+
{
|
|
2136
|
+
...defaultsUI,
|
|
2137
|
+
onClick,
|
|
2138
|
+
variant: scope.attr("variant", "outlined")
|
|
2139
|
+
},
|
|
2140
|
+
scope.getDisplayValue()
|
|
2141
|
+
), isShowChild() && /* @__PURE__ */ import_react16.default.createElement(
|
|
2142
|
+
UIChildren,
|
|
2143
|
+
{
|
|
2144
|
+
...props,
|
|
2145
|
+
scope,
|
|
2146
|
+
crud,
|
|
2147
|
+
style: getStyle("inner")
|
|
2148
|
+
}
|
|
2149
|
+
), /* @__PURE__ */ import_react16.default.createElement(UIModal, { ...props, scope, crud }));
|
|
2150
|
+
};
|
|
2151
|
+
let Card = (props2) => {
|
|
2152
|
+
let isCard = scope.is("type|layout", "card");
|
|
2153
|
+
if (scope.isType("list")) {
|
|
2154
|
+
let empty = scope.getPart("empty", null, void 0);
|
|
2155
|
+
let items = scope.getItems();
|
|
2156
|
+
if (empty === false && import_react_crud_utils18.Utils.isEmpty(items)) {
|
|
2157
|
+
isCard = false;
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
if (isCard) {
|
|
2161
|
+
let box2 = {
|
|
2162
|
+
...getStyle("box", { ...boxStyle.box, alignSelf: "stretch" })
|
|
2163
|
+
};
|
|
2164
|
+
let borderWidth = original.boxBorder;
|
|
2165
|
+
if (borderWidth || borderWidth === 0) {
|
|
2166
|
+
if (borderWidth === true) {
|
|
2167
|
+
borderWidth = 1;
|
|
2168
|
+
}
|
|
2169
|
+
box2 = { ...box2, borderWidth };
|
|
2170
|
+
}
|
|
2171
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react_native20.View, { style: getStyle("card", { ...box2 }) }, /* @__PURE__ */ import_react16.default.createElement(
|
|
2172
|
+
import_react_native20.View,
|
|
2173
|
+
{
|
|
2174
|
+
style: getStyle("boxInner", {
|
|
2175
|
+
paddingHorizontal: 15,
|
|
2176
|
+
paddingVertical: 10
|
|
2177
|
+
})
|
|
2178
|
+
},
|
|
2179
|
+
props2.children
|
|
2180
|
+
));
|
|
2181
|
+
}
|
|
2182
|
+
if (scope.isInput() || original.container) {
|
|
2183
|
+
return /* @__PURE__ */ import_react16.default.createElement(
|
|
2184
|
+
import_react_native20.View,
|
|
2185
|
+
{
|
|
2186
|
+
style: getStyle("container", { paddingVertical: 5, width: "100%" })
|
|
2187
|
+
},
|
|
2188
|
+
props2.children
|
|
2189
|
+
);
|
|
2190
|
+
}
|
|
2191
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, props2.children);
|
|
2192
|
+
};
|
|
2193
|
+
scope.dialogShow = (args) => {
|
|
2194
|
+
let event = import_react_crud_utils18.Utils.nvl(args?.event, {});
|
|
2195
|
+
if (event?.debug) console.log(args);
|
|
2196
|
+
let caller = args.caller;
|
|
2197
|
+
let main = import_react_crud_utils18.ViewUtils.getCrud("view");
|
|
2198
|
+
let parent = main.dialog;
|
|
2199
|
+
let { crud: crud2 } = args;
|
|
2200
|
+
let name = scope.getName("modal");
|
|
2201
|
+
let edit = args.edit === true;
|
|
2202
|
+
let def = {};
|
|
2203
|
+
let rowItem = null;
|
|
2204
|
+
let component = event?.component;
|
|
2205
|
+
let elo = import_react_crud_utils18.Utils.nvl(caller?.original, original);
|
|
2206
|
+
if (crud2.is("row")) {
|
|
2207
|
+
def.parent = crud2.parent.parent;
|
|
2208
|
+
def.search = crud2.parent;
|
|
2209
|
+
rowItem = crud2.data;
|
|
2210
|
+
} else if (crud2.is("search")) {
|
|
2211
|
+
def.parent = crud2.parent;
|
|
2212
|
+
def.search = crud2;
|
|
2213
|
+
}
|
|
2214
|
+
let crudData = crud2.data;
|
|
2215
|
+
let eventData = import_react_crud_utils18.Utils.nvl(event.data, event.send);
|
|
2216
|
+
if (typeof eventData === "function") {
|
|
2217
|
+
eventData = eventData.call(this, args);
|
|
2218
|
+
}
|
|
2219
|
+
if (event.send === false || event.data === false) {
|
|
2220
|
+
crudData = {};
|
|
2221
|
+
}
|
|
2222
|
+
let data = import_react_crud_utils18.Utils.nvl(eventData, args.item, rowItem, crudData, {});
|
|
2223
|
+
let d = import_react_crud_utils18.CrudUtils.create("dialog", {
|
|
2224
|
+
parent: crud2,
|
|
2225
|
+
root: crud2,
|
|
2226
|
+
name,
|
|
2227
|
+
data,
|
|
2228
|
+
edit,
|
|
2229
|
+
scope,
|
|
2230
|
+
...def
|
|
2231
|
+
});
|
|
2232
|
+
let el = {
|
|
2233
|
+
label: elo.label,
|
|
2234
|
+
icon: elo.icon,
|
|
2235
|
+
type: "dialog"
|
|
2236
|
+
};
|
|
2237
|
+
let close = event.dialog?.close;
|
|
2238
|
+
if (typeof event.dialog === "object") {
|
|
2239
|
+
el = { ...el, ...event.dialog };
|
|
2240
|
+
}
|
|
2241
|
+
if (event.header) el.header = event.header;
|
|
2242
|
+
if (event.label) el.label = event.label;
|
|
2243
|
+
if (event.title) el.title = event.title;
|
|
2244
|
+
let label = import_react_crud_utils18.Utils.nvl(el.title, el.label);
|
|
2245
|
+
el.label = label;
|
|
2246
|
+
let dialogScope = import_react_crud_utils18.ScopeUtils.create({
|
|
2247
|
+
parent: scope,
|
|
2248
|
+
crud: d,
|
|
2249
|
+
...el,
|
|
2250
|
+
owner: scope
|
|
2251
|
+
});
|
|
2252
|
+
let dialog = {
|
|
2253
|
+
crud: d,
|
|
2254
|
+
label,
|
|
2255
|
+
parent,
|
|
2256
|
+
component,
|
|
2257
|
+
scope: dialogScope,
|
|
2258
|
+
close,
|
|
2259
|
+
props: event.props,
|
|
2260
|
+
debug: event.debug
|
|
2261
|
+
};
|
|
2262
|
+
main.dialog = dialog;
|
|
2263
|
+
scope.currentDialog = dialog;
|
|
2264
|
+
if (parent) parent.update?.();
|
|
2265
|
+
scope.update();
|
|
2266
|
+
};
|
|
2267
|
+
scope.dialogHide = (args) => {
|
|
2268
|
+
let main = import_react_crud_utils18.ViewUtils.getCrud("view");
|
|
2269
|
+
let current = main.dialog;
|
|
2270
|
+
let next = import_react_crud_utils18.Utils.nvl(current.parent, null);
|
|
2271
|
+
main.dialog = next;
|
|
2272
|
+
scope.currentDialog = next;
|
|
2273
|
+
let nextScope = next?.scope?.parent;
|
|
2274
|
+
let currScope = current?.scope?.parent;
|
|
2275
|
+
if (currScope) {
|
|
2276
|
+
const close = current.close;
|
|
2277
|
+
currScope.update();
|
|
2278
|
+
if (close) {
|
|
2279
|
+
if (close?.debug) console.log("Fechando");
|
|
2280
|
+
current.scope.call("close", { close });
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
if (nextScope) {
|
|
2284
|
+
nextScope.update();
|
|
2285
|
+
}
|
|
2286
|
+
};
|
|
2287
|
+
if (original.hideEmpty && !scope.isType("list", "select", "complete")) {
|
|
2288
|
+
let value = scope.getValue();
|
|
2289
|
+
if (import_react_crud_utils18.Utils.isEmpty(value)) return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null);
|
|
2290
|
+
}
|
|
2291
|
+
return /* @__PURE__ */ import_react16.default.createElement(CrudContext.Provider, { value: { crud, theme } }, /* @__PURE__ */ import_react16.default.createElement(Tag, { ref, style: getStyle(), ...custom }, /* @__PURE__ */ import_react16.default.createElement(Card, null, /* @__PURE__ */ import_react16.default.createElement(Container, null))));
|
|
2292
|
+
}
|
|
2293
|
+
var boxStyle = import_react_native20.StyleSheet.create({
|
|
2294
|
+
box: {
|
|
2295
|
+
borderWidth: 1,
|
|
2296
|
+
borderColor: "#dedede",
|
|
2297
|
+
borderStyle: "solid",
|
|
2298
|
+
backgroundColor: "white",
|
|
2299
|
+
borderRadius: 10,
|
|
2300
|
+
width: "100%",
|
|
2301
|
+
shadowColor: "#000",
|
|
2302
|
+
shadowOpacity: 0.1,
|
|
2303
|
+
shadowRadius: 4,
|
|
2304
|
+
elevation: 3
|
|
2305
|
+
}
|
|
2306
|
+
});
|
|
2307
|
+
var box = {
|
|
2308
|
+
...boxStyle.box
|
|
2309
|
+
};
|
|
2310
|
+
var elementStyle = {};
|
|
2311
|
+
elementStyle.view = {
|
|
2312
|
+
inner: {
|
|
2313
|
+
width: "100%",
|
|
2314
|
+
alignItems: "normal",
|
|
2315
|
+
flex: 1
|
|
2316
|
+
},
|
|
2317
|
+
container: {
|
|
2318
|
+
width: "100%",
|
|
2319
|
+
backgroundColor: "background",
|
|
2320
|
+
flex: 1,
|
|
2321
|
+
gap: 10
|
|
2322
|
+
},
|
|
2323
|
+
root: {
|
|
2324
|
+
width: "100%",
|
|
2325
|
+
flex: 1,
|
|
2326
|
+
alignItems: "normal",
|
|
2327
|
+
padding: 0
|
|
2328
|
+
}
|
|
2329
|
+
};
|
|
2330
|
+
elementStyle.input = import_react_native20.StyleSheet.create({
|
|
2331
|
+
label: {
|
|
2332
|
+
paddingLeft: 0
|
|
2333
|
+
},
|
|
2334
|
+
inner: {
|
|
2335
|
+
flex: 1,
|
|
2336
|
+
width: "100%",
|
|
2337
|
+
padding: 0,
|
|
2338
|
+
gap: 10,
|
|
2339
|
+
alignSelf: "flex-start",
|
|
2340
|
+
flexDirection: "row",
|
|
2341
|
+
flexWrap: "wrap"
|
|
2342
|
+
}
|
|
2343
|
+
});
|
|
2344
|
+
elementStyle.quantity = {
|
|
2345
|
+
inner: {
|
|
2346
|
+
...box,
|
|
2347
|
+
backgroundColor: "primarySoft",
|
|
2348
|
+
fontWeight: 600,
|
|
2349
|
+
fontSize: 16,
|
|
2350
|
+
borderRadius: 25,
|
|
2351
|
+
borderWidth: 0,
|
|
2352
|
+
paddingHorizontal: 5,
|
|
2353
|
+
paddingVertical: 5,
|
|
2354
|
+
flexWrap: "nowrap",
|
|
2355
|
+
flex: 1,
|
|
2356
|
+
flexDirection: "row",
|
|
2357
|
+
justifyContent: "center",
|
|
2358
|
+
alignItems: "center"
|
|
2359
|
+
}
|
|
2360
|
+
};
|
|
2361
|
+
elementStyle.toggle = import_react_native20.StyleSheet.create({
|
|
2362
|
+
root: {
|
|
2363
|
+
height: "auto"
|
|
2364
|
+
},
|
|
2365
|
+
inner: {
|
|
2366
|
+
...box,
|
|
2367
|
+
flex: 1,
|
|
2368
|
+
width: "100%",
|
|
2369
|
+
gap: 10,
|
|
2370
|
+
borderRadius: 2,
|
|
2371
|
+
justifyContent: "center",
|
|
2372
|
+
flexDirection: "row",
|
|
2373
|
+
alignSelf: "flex-start",
|
|
2374
|
+
flexWrap: "nowrap"
|
|
2375
|
+
}
|
|
2376
|
+
});
|
|
2377
|
+
var styles12 = import_react_native20.StyleSheet.create({
|
|
2378
|
+
root: {
|
|
2379
|
+
gap: 5,
|
|
2380
|
+
flexDirection: "column",
|
|
2381
|
+
flexWrap: "wrap",
|
|
2382
|
+
width: "100%",
|
|
2383
|
+
alignItems: "flex-start"
|
|
2384
|
+
},
|
|
2385
|
+
label: {
|
|
2386
|
+
fontWeight: 600,
|
|
2387
|
+
fontSize: 12,
|
|
2388
|
+
paddingVertical: 3,
|
|
2389
|
+
color: "labelColor"
|
|
2390
|
+
},
|
|
2391
|
+
inner: { width: "100%", justifyContent: "space-between" }
|
|
2392
|
+
});
|
|
2393
|
+
var withChildStyles = import_react_native20.StyleSheet.create({
|
|
2394
|
+
root: {
|
|
2395
|
+
gap: 10
|
|
2396
|
+
},
|
|
2397
|
+
label: {
|
|
2398
|
+
width: "100%",
|
|
2399
|
+
fontWeight: 500,
|
|
2400
|
+
fontSize: 24
|
|
2401
|
+
}
|
|
2402
|
+
});
|
|
2403
|
+
|
|
2404
|
+
// src/elements/core/UIInclude.tsx
|
|
2405
|
+
var import_react_crud_utils19 = require("react-crud-utils");
|
|
2406
|
+
function UIInclude(props) {
|
|
2407
|
+
if (props.rendered === false) {
|
|
2408
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
2409
|
+
}
|
|
2410
|
+
let includes = import_react_crud_utils19.ComponentUtils.getDefine(props, props.name, props.position);
|
|
2411
|
+
if (import_react_crud_utils19.Utils.isEmpty(includes)) {
|
|
2412
|
+
includes = props.default;
|
|
2413
|
+
}
|
|
2414
|
+
if (!import_react_crud_utils19.Utils.isEmpty(includes)) {
|
|
2415
|
+
let Aux = (tagProp) => {
|
|
2416
|
+
let Tag = props.tag;
|
|
2417
|
+
if (!import_react_crud_utils19.Utils.isEmpty(Tag)) {
|
|
2418
|
+
return /* @__PURE__ */ React.createElement(Tag, { ...tagProp }, tagProp.children);
|
|
2419
|
+
}
|
|
2420
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, tagProp.children);
|
|
2421
|
+
};
|
|
2422
|
+
return /* @__PURE__ */ React.createElement(Aux, { ...props.tagProps }, /* @__PURE__ */ React.createElement(
|
|
2423
|
+
UIChildren,
|
|
2424
|
+
{
|
|
2425
|
+
transient: true,
|
|
2426
|
+
...props,
|
|
2427
|
+
scope: props.scope,
|
|
2428
|
+
crud: props.crud,
|
|
2429
|
+
part: props.name
|
|
2430
|
+
},
|
|
2431
|
+
includes
|
|
2432
|
+
));
|
|
2433
|
+
}
|
|
2434
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, includes);
|
|
2435
|
+
}
|
|
2436
|
+
|
|
2437
|
+
// src/elements/core/SafeView.tsx
|
|
2438
|
+
var import_react_native21 = require("react-native");
|
|
2439
|
+
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
2440
|
+
var import_react_crud_utils20 = require("react-crud-utils");
|
|
2441
|
+
function SafeView(props) {
|
|
2442
|
+
let theme = import_react_crud_utils20.ThemeUtils.getCurrentTheme();
|
|
2443
|
+
if (import_react_crud_utils20.Utils.isEmpty(theme)) {
|
|
2444
|
+
theme = (0, import_react_crud_utils20.useTheme)();
|
|
2445
|
+
}
|
|
2446
|
+
const dismissKeyboard = () => {
|
|
2447
|
+
if (import_react_native21.Platform.OS !== "web") {
|
|
2448
|
+
import_react_native21.Keyboard.dismiss();
|
|
2449
|
+
}
|
|
2450
|
+
};
|
|
2451
|
+
return /* @__PURE__ */ React.createElement(import_react_native_safe_area_context3.SafeAreaProvider, null, /* @__PURE__ */ React.createElement(
|
|
2452
|
+
import_react_native_safe_area_context3.SafeAreaView,
|
|
2453
|
+
{
|
|
2454
|
+
style: {
|
|
2455
|
+
backgroundColor: theme.colors?.theme,
|
|
2456
|
+
...props.viewStyle,
|
|
2457
|
+
flex: 1
|
|
2458
|
+
}
|
|
2459
|
+
},
|
|
2460
|
+
/* @__PURE__ */ React.createElement(import_react_native21.StatusBar, { barStyle: "dark-content", backgroundColor: "#f5f5f5" }),
|
|
2461
|
+
/* @__PURE__ */ React.createElement(
|
|
2462
|
+
import_react_native21.KeyboardAvoidingView,
|
|
2463
|
+
{
|
|
2464
|
+
behavior: import_react_native21.Platform.OS === "ios" ? "padding" : "height",
|
|
2465
|
+
style: {
|
|
2466
|
+
flex: 1,
|
|
2467
|
+
// 🔹 Ocupa 100% da tela
|
|
2468
|
+
justifyContent: "flex-start"
|
|
2469
|
+
}
|
|
2470
|
+
},
|
|
2471
|
+
/* @__PURE__ */ React.createElement(
|
|
2472
|
+
import_react_native21.TouchableWithoutFeedback,
|
|
2473
|
+
{
|
|
2474
|
+
onPress: dismissKeyboard,
|
|
2475
|
+
accessible: false
|
|
2476
|
+
},
|
|
2477
|
+
/* @__PURE__ */ React.createElement(React.Fragment, null, props.children)
|
|
2478
|
+
)
|
|
2479
|
+
)
|
|
2480
|
+
));
|
|
2481
|
+
}
|
|
2482
|
+
|
|
2483
|
+
// src/elements/UI.tsx
|
|
2484
|
+
var UI = {
|
|
2485
|
+
Order: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "order" }),
|
|
2486
|
+
List: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "list" }),
|
|
2487
|
+
Row: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "row" }),
|
|
2488
|
+
Value: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "value" }),
|
|
2489
|
+
Label: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "label" }),
|
|
2490
|
+
Repeat: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "repeat", props: { search: false } }),
|
|
2491
|
+
Define: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "define" }),
|
|
2492
|
+
Include: (props) => /* @__PURE__ */ React.createElement(UIInclude, { ...props }),
|
|
2493
|
+
Column: ({ type = "column", ...props }) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "column" }),
|
|
2494
|
+
Input: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props }),
|
|
2495
|
+
Text: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "text" }),
|
|
2496
|
+
Textarea: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "textarea" }),
|
|
2497
|
+
Email: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "email" }),
|
|
2498
|
+
Button: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "button" }),
|
|
2499
|
+
Link: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "link" }),
|
|
2500
|
+
Icon: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "icon", transient: true }),
|
|
2501
|
+
Output: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "output" }),
|
|
2502
|
+
Form: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "form" }),
|
|
2503
|
+
Crud: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "crud" }),
|
|
2504
|
+
View: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "view", transient: true }),
|
|
2505
|
+
Bottom: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "bottom" }),
|
|
2506
|
+
Dialog: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "dialog" }),
|
|
2507
|
+
Content: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "content" }),
|
|
2508
|
+
Top: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "top" }),
|
|
2509
|
+
Card: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "card" }),
|
|
2510
|
+
Tab: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "tab" }),
|
|
2511
|
+
Tabs: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "tabs" }),
|
|
2512
|
+
Step: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "tab", layout: "step" }),
|
|
2513
|
+
Stepper: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "tabs", layout: "stepper" }),
|
|
2514
|
+
Money: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "money" }),
|
|
2515
|
+
Chart: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "chart" }),
|
|
2516
|
+
Password: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "password" }),
|
|
2517
|
+
Complete: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "complete" }),
|
|
2518
|
+
Checkbox: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "switch" }),
|
|
2519
|
+
Switch: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "switch" }),
|
|
2520
|
+
Radio: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "radio" }),
|
|
2521
|
+
Select: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "select" }),
|
|
2522
|
+
Toggle: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "toggle" }),
|
|
2523
|
+
Entity: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "entity" }),
|
|
2524
|
+
Element: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "element" }),
|
|
2525
|
+
Quantity: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "quantity" }),
|
|
2526
|
+
Slider: (props) => /* @__PURE__ */ React.createElement(UIElement, { ...props, type: "slider" }),
|
|
2527
|
+
SafeView
|
|
2528
|
+
};
|
|
2529
|
+
var UI_default = UI;
|
|
2530
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
2531
|
+
0 && (module.exports = {
|
|
2532
|
+
UI
|
|
2533
|
+
});
|
|
2534
|
+
//# sourceMappingURL=index.js.map
|