react-crud-mobile 1.1.2 → 1.3.1

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