react-crud-mobile 1.0.104 → 1.0.106
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/elements/core/UIInclude.d.ts +3 -0
- package/dist/elements/{grid/ElGrid.d.ts → core/UIList.d.ts} +1 -1
- package/dist/react-crud-mobile.cjs.development.js +59 -465
- package/dist/react-crud-mobile.cjs.development.js.map +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js +1 -1
- package/dist/react-crud-mobile.cjs.production.min.js.map +1 -1
- package/dist/react-crud-mobile.esm.js +62 -468
- package/dist/react-crud-mobile.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/elements/UI.tsx +2 -2
- package/src/elements/UIElement.tsx +2 -7
- package/src/elements/{grid/ElInclude.tsx → core/UIInclude.tsx} +3 -3
- package/src/elements/core/UIList.tsx +38 -0
- package/src/elements/grid/ElInclude +0 -0
- package/dist/elements/grid/ElGridBotom.d.ts +0 -3
- package/dist/elements/grid/ElGridCheck.d.ts +0 -3
- package/dist/elements/grid/ElGridColumn.d.ts +0 -11
- package/dist/elements/grid/ElGridFilter.d.ts +0 -3
- package/dist/elements/grid/ElGridPaginator.d.ts +0 -12
- package/dist/elements/grid/ElGridRow.d.ts +0 -3
- package/dist/elements/grid/ElGridTop.d.ts +0 -3
- package/dist/elements/grid/ElInclude.d.ts +0 -3
- package/dist/elements/grid/ElLabel.d.ts +0 -7
- package/dist/elements/grid/ElRepeat.d.ts +0 -3
- package/dist/elements/grid/ElRepeatRow.d.ts +0 -3
- package/src/elements/grid/ElGrid.tsx +0 -48
- package/src/elements/grid/ElGridBotom.tsx +0 -21
- package/src/elements/grid/ElGridCheck.tsx +0 -67
- package/src/elements/grid/ElGridColumn.tsx +0 -32
- package/src/elements/grid/ElGridFilter.tsx +0 -5
- package/src/elements/grid/ElGridPaginator.tsx +0 -82
- package/src/elements/grid/ElGridRow.tsx +0 -123
- package/src/elements/grid/ElGridTop.tsx +0 -44
- package/src/elements/grid/ElLabel.tsx +0 -50
- package/src/elements/grid/ElRepeat.tsx +0 -24
- package/src/elements/grid/ElRepeatRow.tsx +0 -40
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useState,
|
|
2
|
-
import { Utils, ScopeUtils,
|
|
3
|
-
import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Switch, TextInput, Image } from 'react-native';
|
|
1
|
+
import React, { useState, useRef, useEffect, useLayoutEffect } from 'react';
|
|
2
|
+
import { Utils, ScopeUtils, CrudUtils, HtmlUtils, ComponentUtils } from 'react-crud-utils';
|
|
3
|
+
import { View, StyleSheet, TouchableOpacity, Text, Linking, TouchableHighlight, Switch, TextInput, FlatList, Image } from 'react-native';
|
|
4
4
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
import Ionicons from '@expo/vector-icons/Ionicons';
|
|
6
6
|
import { Ionicons as Ionicons$1 } from '@expo/vector-icons';
|
|
@@ -125,413 +125,6 @@ var styles = /*#__PURE__*/StyleSheet.create({
|
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
-
function ElGridColumn(props) {
|
|
129
|
-
var _props$column;
|
|
130
|
-
var scope = props.scope;
|
|
131
|
-
var col = Utils.nvl((_props$column = props.column) == null ? void 0 : _props$column.props, {});
|
|
132
|
-
var _useState = useState(new Scope(col, scope, scope.crud)),
|
|
133
|
-
colScope = _useState[0];
|
|
134
|
-
var getStyleClass = function getStyleClass() {
|
|
135
|
-
var def = Utils.nvl(props.styleClass, "");
|
|
136
|
-
return "ui-grid-col " + def + " " + colScope.getStyleClass("column");
|
|
137
|
-
};
|
|
138
|
-
return /*#__PURE__*/jsx("td", {
|
|
139
|
-
className: getStyleClass(),
|
|
140
|
-
style: colScope.getStyle("column"),
|
|
141
|
-
colSpan: props.colspan,
|
|
142
|
-
children: /*#__PURE__*/jsx(UIChildren, {
|
|
143
|
-
scope: scope,
|
|
144
|
-
children: props.children
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function ElGridCheck(_ref) {
|
|
150
|
-
var scope = _ref.scope,
|
|
151
|
-
value = _ref.value,
|
|
152
|
-
rowIndex = _ref.rowIndex;
|
|
153
|
-
var original = scope.original;
|
|
154
|
-
var _useState = useState(0),
|
|
155
|
-
index = _useState[0],
|
|
156
|
-
setIndex = _useState[1];
|
|
157
|
-
var key = scope.key('check', rowIndex, 's', index);
|
|
158
|
-
var check = function check() {
|
|
159
|
-
var cs = scope.crudSearch;
|
|
160
|
-
if (cs) {
|
|
161
|
-
if (!cs.selecteds) {
|
|
162
|
-
cs.selecteds = {};
|
|
163
|
-
}
|
|
164
|
-
var itemValue = Utils.nvl(original.itemValue, 'id');
|
|
165
|
-
var _key = value[itemValue];
|
|
166
|
-
if (typeof _key !== 'undefined') {
|
|
167
|
-
if (typeof cs.selecteds[_key] === 'undefined') {
|
|
168
|
-
cs.selecteds[_key] = value;
|
|
169
|
-
} else {
|
|
170
|
-
delete cs.selecteds[_key];
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
setIndex(++index);
|
|
175
|
-
};
|
|
176
|
-
var getCheckIcon = function getCheckIcon() {
|
|
177
|
-
if (isChecked()) {
|
|
178
|
-
return /*#__PURE__*/jsx(Ionicons, {});
|
|
179
|
-
}
|
|
180
|
-
return /*#__PURE__*/jsx(Ionicons, {});
|
|
181
|
-
};
|
|
182
|
-
var isChecked = function isChecked() {
|
|
183
|
-
var cs = scope.crudSearch;
|
|
184
|
-
if (cs) {
|
|
185
|
-
if (!cs.selecteds) {
|
|
186
|
-
cs.selecteds = {};
|
|
187
|
-
}
|
|
188
|
-
var itemValue = Utils.nvl(original.itemValue, 'id');
|
|
189
|
-
var _key2 = value[itemValue];
|
|
190
|
-
if (typeof _key2 !== 'undefined') {
|
|
191
|
-
if (typeof cs.selecteds[_key2] !== 'undefined') {
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return false;
|
|
197
|
-
};
|
|
198
|
-
return /*#__PURE__*/jsx(UI.Button, {
|
|
199
|
-
icon: getCheckIcon(),
|
|
200
|
-
click: {
|
|
201
|
-
action: check
|
|
202
|
-
}
|
|
203
|
-
}, key);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function ElGridRow(props) {
|
|
207
|
-
var expansion = props.expansion;
|
|
208
|
-
var value = props.value;
|
|
209
|
-
var scope = props.scope;
|
|
210
|
-
var index = props.index;
|
|
211
|
-
var original = scope.original;
|
|
212
|
-
var row = CrudUtils.create('row', {
|
|
213
|
-
index: index,
|
|
214
|
-
row: true,
|
|
215
|
-
itemVar: scope.original.itemVar,
|
|
216
|
-
parent: scope.crudSearch,
|
|
217
|
-
data: value
|
|
218
|
-
});
|
|
219
|
-
var _useState = useState(false),
|
|
220
|
-
expanded = _useState[0],
|
|
221
|
-
setExpanded = _useState[1];
|
|
222
|
-
var _useState2 = useState(new Scope(scope.original, scope, row)),
|
|
223
|
-
rowScope = _useState2[0];
|
|
224
|
-
var getRowStyleClass = function getRowStyleClass() {
|
|
225
|
-
var s = 'ui-grid-row';
|
|
226
|
-
s = s + ' ui-grid-row-';
|
|
227
|
-
if (index % 2 == 0) {
|
|
228
|
-
s = s + 'even';
|
|
229
|
-
} else {
|
|
230
|
-
s = s + 'odd';
|
|
231
|
-
}
|
|
232
|
-
return s;
|
|
233
|
-
};
|
|
234
|
-
var cols = ComponentUtils.getChild(props, 'Column');
|
|
235
|
-
var colspan = cols.length;
|
|
236
|
-
var ExpansionStatus = function ExpansionStatus() {
|
|
237
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
238
|
-
children: [!expanded && /*#__PURE__*/jsx(Ionicons, {}), expanded && /*#__PURE__*/jsx(Ionicons, {})]
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
var onExpansion = function onExpansion() {
|
|
242
|
-
setExpanded(!expanded);
|
|
243
|
-
};
|
|
244
|
-
var hasExpansion = !Utils.isEmpty(expansion);
|
|
245
|
-
var multiple = original.multiple;
|
|
246
|
-
if (hasExpansion) colspan++;
|
|
247
|
-
if (multiple) colspan++;
|
|
248
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
249
|
-
children: [/*#__PURE__*/jsxs("tr", {
|
|
250
|
-
className: getRowStyleClass(),
|
|
251
|
-
style: rowScope.getStyle('row'),
|
|
252
|
-
children: [hasExpansion && /*#__PURE__*/jsx(ElGridColumn, {
|
|
253
|
-
scope: rowScope,
|
|
254
|
-
styleClass: "ui-click ui-icon-only ui-expansion",
|
|
255
|
-
children: /*#__PURE__*/jsx(UI.Button, {
|
|
256
|
-
icon: /*#__PURE__*/jsx(ExpansionStatus, {}),
|
|
257
|
-
click: onExpansion
|
|
258
|
-
})
|
|
259
|
-
}, 'r' + index + 'e'), multiple && /*#__PURE__*/jsx(ElGridColumn, {
|
|
260
|
-
scope: rowScope,
|
|
261
|
-
styleClass: "ui-click ui-icon-only ui-multiple",
|
|
262
|
-
children: /*#__PURE__*/jsx(ElGridCheck, {
|
|
263
|
-
scope: scope,
|
|
264
|
-
value: value,
|
|
265
|
-
rowIndex: index
|
|
266
|
-
}, 'check-' + index)
|
|
267
|
-
}, 'r' + index + 'c'), cols.map(function (col, i) {
|
|
268
|
-
return /*#__PURE__*/jsx(ElGridColumn, {
|
|
269
|
-
column: col,
|
|
270
|
-
scope: rowScope,
|
|
271
|
-
children: col
|
|
272
|
-
}, 'r' + index + 'c' + i);
|
|
273
|
-
})]
|
|
274
|
-
}), expanded && /*#__PURE__*/jsx("tr", {
|
|
275
|
-
className: getRowStyleClass(),
|
|
276
|
-
style: rowScope.getStyle('row'),
|
|
277
|
-
children: /*#__PURE__*/jsx(ElGridColumn, {
|
|
278
|
-
scope: rowScope,
|
|
279
|
-
colspan: colspan,
|
|
280
|
-
children: /*#__PURE__*/jsx(UIChildren, _extends({}, props, {
|
|
281
|
-
crud: row,
|
|
282
|
-
children: expansion
|
|
283
|
-
}))
|
|
284
|
-
}, 'r' + index + '-expanded')
|
|
285
|
-
})]
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
function ElGridPaginator(_ref) {
|
|
290
|
-
var scope = _ref.scope,
|
|
291
|
-
next = _ref.next,
|
|
292
|
-
previous = _ref.previous,
|
|
293
|
-
first = _ref.first,
|
|
294
|
-
size = _ref.size,
|
|
295
|
-
last = _ref.last,
|
|
296
|
-
position = _ref.position;
|
|
297
|
-
var _useState = useState([10, 20, 30, 50, 100, 200, 500]),
|
|
298
|
-
sizes = _useState[0];
|
|
299
|
-
var defaults = {
|
|
300
|
-
crud: scope.crudSearch,
|
|
301
|
-
owner: scope,
|
|
302
|
-
variant: scope.attr('variant', 'text')
|
|
303
|
-
};
|
|
304
|
-
var paginatorPosition = Utils.nvl(scope.original.paginatorPosition, 'bottom');
|
|
305
|
-
if (paginatorPosition !== position) {
|
|
306
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
307
|
-
}
|
|
308
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
309
|
-
children: [/*#__PURE__*/jsx(UI.Button, _extends({
|
|
310
|
-
field: "first",
|
|
311
|
-
space: 0,
|
|
312
|
-
rendered: first !== false
|
|
313
|
-
}, defaults, {
|
|
314
|
-
click: "first",
|
|
315
|
-
icon: /*#__PURE__*/jsx(Ionicons, {})
|
|
316
|
-
})), /*#__PURE__*/jsx(UI.Button, _extends({
|
|
317
|
-
field: "previous",
|
|
318
|
-
space: 0,
|
|
319
|
-
rendered: previous !== false,
|
|
320
|
-
click: "previous"
|
|
321
|
-
}, defaults, {
|
|
322
|
-
icon: /*#__PURE__*/jsx(Ionicons, {})
|
|
323
|
-
})), /*#__PURE__*/jsx(UI.Select, _extends({
|
|
324
|
-
field: "size",
|
|
325
|
-
space: 0,
|
|
326
|
-
rendered: size !== false,
|
|
327
|
-
"default": 10
|
|
328
|
-
}, defaults, {
|
|
329
|
-
data: sizes,
|
|
330
|
-
change: "search"
|
|
331
|
-
})), /*#__PURE__*/jsx(UI.Button, _extends({
|
|
332
|
-
field: "next",
|
|
333
|
-
space: 0,
|
|
334
|
-
rendered: next !== false
|
|
335
|
-
}, defaults, {
|
|
336
|
-
click: "next",
|
|
337
|
-
icon: /*#__PURE__*/jsx(Ionicons, {})
|
|
338
|
-
})), /*#__PURE__*/jsx(UI.Button, _extends({
|
|
339
|
-
field: "last",
|
|
340
|
-
space: 0,
|
|
341
|
-
rendered: last !== false
|
|
342
|
-
}, defaults, {
|
|
343
|
-
click: "last",
|
|
344
|
-
icon: /*#__PURE__*/jsx(Ionicons, {})
|
|
345
|
-
}))]
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
function ElGridTop(props) {
|
|
350
|
-
var scope = props.scope;
|
|
351
|
-
return /*#__PURE__*/jsx(Fragment, {
|
|
352
|
-
children: /*#__PURE__*/jsxs(UI.Output, {
|
|
353
|
-
styleClass: "ui-grid-top",
|
|
354
|
-
children: [/*#__PURE__*/jsxs(UI.Output, {
|
|
355
|
-
field: "search",
|
|
356
|
-
position: "left",
|
|
357
|
-
space: 4,
|
|
358
|
-
children: [/*#__PURE__*/jsx(UI.Include, _extends({}, props, {
|
|
359
|
-
"transient": true,
|
|
360
|
-
name: "top",
|
|
361
|
-
position: "left"
|
|
362
|
-
})), /*#__PURE__*/jsx(UI.Text, {
|
|
363
|
-
field: "query",
|
|
364
|
-
space: 0,
|
|
365
|
-
label: "Pesquisar",
|
|
366
|
-
placeholder: scope.attr('placeholder', 'Pesquisar'),
|
|
367
|
-
children: /*#__PURE__*/jsx(UI.Define, {
|
|
368
|
-
name: "right",
|
|
369
|
-
children: /*#__PURE__*/jsx(UI.Button, {
|
|
370
|
-
field: "search",
|
|
371
|
-
icon: /*#__PURE__*/jsx(Ionicons, {}),
|
|
372
|
-
space: 0,
|
|
373
|
-
variant: "text",
|
|
374
|
-
owner: scope,
|
|
375
|
-
click: 'search'
|
|
376
|
-
})
|
|
377
|
-
})
|
|
378
|
-
})]
|
|
379
|
-
}), /*#__PURE__*/jsxs(UI.Output, {
|
|
380
|
-
position: "right",
|
|
381
|
-
space: 8,
|
|
382
|
-
children: [/*#__PURE__*/jsx(UI.Include, _extends({}, props, {
|
|
383
|
-
"transient": true,
|
|
384
|
-
name: "top",
|
|
385
|
-
position: "right"
|
|
386
|
-
})), /*#__PURE__*/jsx(ElGridPaginator, {
|
|
387
|
-
scope: scope,
|
|
388
|
-
last: false,
|
|
389
|
-
first: false,
|
|
390
|
-
position: "top"
|
|
391
|
-
})]
|
|
392
|
-
})]
|
|
393
|
-
})
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
function ElGridFilter(props) {
|
|
398
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
function ElGridBotom(props) {
|
|
402
|
-
var scope = props.scope;
|
|
403
|
-
var children = props.children;
|
|
404
|
-
return /*#__PURE__*/jsx("div", {
|
|
405
|
-
className: "ui-grid-bottom",
|
|
406
|
-
children: /*#__PURE__*/jsxs("div", {
|
|
407
|
-
className: "ui-grid-bottom-inner",
|
|
408
|
-
children: [/*#__PURE__*/jsx(UI.Include, _extends({}, props, {
|
|
409
|
-
"transient": true,
|
|
410
|
-
name: "bottomLeft"
|
|
411
|
-
})), /*#__PURE__*/jsx(ElGridPaginator, {
|
|
412
|
-
scope: scope,
|
|
413
|
-
position: "bottom",
|
|
414
|
-
children: children
|
|
415
|
-
}), /*#__PURE__*/jsx(UI.Include, _extends({}, props, {
|
|
416
|
-
"transient": true,
|
|
417
|
-
name: "bottomRight"
|
|
418
|
-
}))]
|
|
419
|
-
})
|
|
420
|
-
});
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
function UIIcon(props) {
|
|
424
|
-
var handlePress = function handlePress() {
|
|
425
|
-
Linking.openURL('https://reactnative.dev/');
|
|
426
|
-
};
|
|
427
|
-
return /*#__PURE__*/jsx(TouchableOpacity, {
|
|
428
|
-
onPress: handlePress,
|
|
429
|
-
children: /*#__PURE__*/jsx(Text, {
|
|
430
|
-
style: styles$1.link,
|
|
431
|
-
children: "Clique aqui para acessar o React Native"
|
|
432
|
-
})
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
var styles$1 = {
|
|
436
|
-
link: {}
|
|
437
|
-
};
|
|
438
|
-
|
|
439
|
-
function ElLabel(props) {
|
|
440
|
-
var scope = props.scope;
|
|
441
|
-
var original = scope.original;
|
|
442
|
-
var defaultPos = 'outside';
|
|
443
|
-
var elPos = Utils.nvl(original.labelPos, defaultPos);
|
|
444
|
-
var lbPos = Utils.nvl(props.position, defaultPos);
|
|
445
|
-
if (elPos != lbPos) {
|
|
446
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
447
|
-
}
|
|
448
|
-
var CustomIcon = function CustomIcon() {
|
|
449
|
-
if (!scope.is('type', 'list', 'grid')) {
|
|
450
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
451
|
-
}
|
|
452
|
-
if (typeof original.icon === 'string') {
|
|
453
|
-
return /*#__PURE__*/jsx("div", {
|
|
454
|
-
className: "ui-label-icon",
|
|
455
|
-
children: /*#__PURE__*/jsx(UIIcon, {
|
|
456
|
-
className: scope.getIcon()
|
|
457
|
-
})
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
return /*#__PURE__*/jsx("div", {
|
|
461
|
-
className: "ui-label-icon",
|
|
462
|
-
children: original.icon
|
|
463
|
-
});
|
|
464
|
-
};
|
|
465
|
-
var label = scope.getLabel();
|
|
466
|
-
return /*#__PURE__*/jsxs("div", {
|
|
467
|
-
className: 'ui-label ui-label-' + lbPos,
|
|
468
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
469
|
-
className: "ui-label-left",
|
|
470
|
-
children: [/*#__PURE__*/jsx(UI.Include, _extends({}, props, {
|
|
471
|
-
"transient": true,
|
|
472
|
-
name: "label",
|
|
473
|
-
position: "left"
|
|
474
|
-
})), /*#__PURE__*/jsx(CustomIcon, {}), label && /*#__PURE__*/jsx("div", {
|
|
475
|
-
className: "ui-label-value",
|
|
476
|
-
children: label
|
|
477
|
-
})]
|
|
478
|
-
}), /*#__PURE__*/jsx("div", {
|
|
479
|
-
className: "ui-label-right",
|
|
480
|
-
children: /*#__PURE__*/jsx(UI.Include, _extends({}, props, {
|
|
481
|
-
"transient": true,
|
|
482
|
-
name: "label",
|
|
483
|
-
position: "right"
|
|
484
|
-
}))
|
|
485
|
-
})]
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
function ElGrid(props) {
|
|
490
|
-
var scope = props.scope;
|
|
491
|
-
var items = scope.getItems();
|
|
492
|
-
var expansion = ComponentUtils.getDefine(props, 'expansion');
|
|
493
|
-
return /*#__PURE__*/jsxs("div", {
|
|
494
|
-
className: scope.getStyleClass('inner'),
|
|
495
|
-
style: scope.getStyle('inner'),
|
|
496
|
-
children: [/*#__PURE__*/jsx(ElLabel, _extends({}, props, {
|
|
497
|
-
scope: scope,
|
|
498
|
-
position: "outside"
|
|
499
|
-
})), /*#__PURE__*/jsxs("div", {
|
|
500
|
-
className: scope.getStyleClass('child'),
|
|
501
|
-
style: scope.getStyle('child'),
|
|
502
|
-
children: [/*#__PURE__*/jsx(ElLabel, _extends({}, props, {
|
|
503
|
-
scope: scope,
|
|
504
|
-
position: "inside"
|
|
505
|
-
})), /*#__PURE__*/jsxs("div", {
|
|
506
|
-
className: "ui-data",
|
|
507
|
-
children: [/*#__PURE__*/jsx(ElGridTop, _extends({}, props, {
|
|
508
|
-
scope: scope
|
|
509
|
-
})), /*#__PURE__*/jsx(ElGridFilter, {
|
|
510
|
-
scope: scope
|
|
511
|
-
}), /*#__PURE__*/jsx("div", {
|
|
512
|
-
className: "ui-grid-data",
|
|
513
|
-
children: /*#__PURE__*/jsx("table", {
|
|
514
|
-
className: "ui-grid ui-table",
|
|
515
|
-
children: /*#__PURE__*/jsx("tbody", {
|
|
516
|
-
children: items.map(function (row, i) {
|
|
517
|
-
return /*#__PURE__*/createElement(ElGridRow, _extends({}, props, {
|
|
518
|
-
expansion: expansion,
|
|
519
|
-
key: 'r' + i,
|
|
520
|
-
scope: scope,
|
|
521
|
-
value: row,
|
|
522
|
-
index: i
|
|
523
|
-
}));
|
|
524
|
-
})
|
|
525
|
-
})
|
|
526
|
-
})
|
|
527
|
-
})]
|
|
528
|
-
}), /*#__PURE__*/jsx(ElGridBotom, _extends({}, props, {
|
|
529
|
-
scope: scope
|
|
530
|
-
}))]
|
|
531
|
-
})]
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
|
|
535
128
|
function ElTabs(props) {
|
|
536
129
|
var scope = props.scope;
|
|
537
130
|
var _useState = useState(0),
|
|
@@ -703,12 +296,12 @@ function UIAutoComplete(props) {
|
|
|
703
296
|
return /*#__PURE__*/jsx(TouchableOpacity, {
|
|
704
297
|
onPress: handlePress,
|
|
705
298
|
children: /*#__PURE__*/jsx(Text, {
|
|
706
|
-
style: styles$
|
|
299
|
+
style: styles$1.link,
|
|
707
300
|
children: "Clique aqui para acessar o React Native"
|
|
708
301
|
})
|
|
709
302
|
});
|
|
710
303
|
}
|
|
711
|
-
var styles$
|
|
304
|
+
var styles$1 = {
|
|
712
305
|
link: {}
|
|
713
306
|
};
|
|
714
307
|
|
|
@@ -720,59 +313,23 @@ function UIComplete(_ref) {
|
|
|
720
313
|
});
|
|
721
314
|
}
|
|
722
315
|
|
|
723
|
-
function
|
|
724
|
-
var
|
|
725
|
-
|
|
726
|
-
var index = props.index;
|
|
727
|
-
var row = CrudUtils.create("row", {
|
|
728
|
-
index: index,
|
|
729
|
-
row: true,
|
|
730
|
-
itemVar: scope.original.itemVar,
|
|
731
|
-
parent: scope.crudSearch,
|
|
732
|
-
data: value
|
|
733
|
-
});
|
|
734
|
-
var _useState = useState(new Scope(scope.original, scope, row)),
|
|
735
|
-
rowScope = _useState[0];
|
|
736
|
-
var getRowStyleClass = function getRowStyleClass() {
|
|
737
|
-
var s = rowScope.getStyleClass("row");
|
|
738
|
-
s = s + " ui-repeat-row-";
|
|
739
|
-
if (index % 2 == 0) {
|
|
740
|
-
s = s + "even";
|
|
741
|
-
} else {
|
|
742
|
-
s = s + "odd";
|
|
743
|
-
}
|
|
744
|
-
return s;
|
|
316
|
+
function UILink(props) {
|
|
317
|
+
var handlePress = function handlePress() {
|
|
318
|
+
Linking.openURL('https://reactnative.dev/');
|
|
745
319
|
};
|
|
746
|
-
return /*#__PURE__*/jsx(
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
"
|
|
751
|
-
}, props, {
|
|
752
|
-
crud: row,
|
|
753
|
-
children: props.children
|
|
754
|
-
}))
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
function ElRepeat(props) {
|
|
759
|
-
var scope = props.scope;
|
|
760
|
-
var items = scope.getItems();
|
|
761
|
-
return /*#__PURE__*/jsx("div", {
|
|
762
|
-
className: scope.getStyleClass('inner'),
|
|
763
|
-
style: scope.getStyle('inner'),
|
|
764
|
-
children: items.map(function (row, i) {
|
|
765
|
-
return /*#__PURE__*/createElement(ElRepeatRow, _extends({}, props, {
|
|
766
|
-
key: 'r' + i,
|
|
767
|
-
scope: scope,
|
|
768
|
-
value: row,
|
|
769
|
-
index: i
|
|
770
|
-
}));
|
|
320
|
+
return /*#__PURE__*/jsx(TouchableOpacity, {
|
|
321
|
+
onPress: handlePress,
|
|
322
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
323
|
+
style: styles$2.link,
|
|
324
|
+
children: "Clique aqui para acessar o React Native"
|
|
771
325
|
})
|
|
772
326
|
});
|
|
773
327
|
}
|
|
328
|
+
var styles$2 = {
|
|
329
|
+
link: {}
|
|
330
|
+
};
|
|
774
331
|
|
|
775
|
-
function
|
|
332
|
+
function UIIcon(props) {
|
|
776
333
|
var handlePress = function handlePress() {
|
|
777
334
|
Linking.openURL('https://reactnative.dev/');
|
|
778
335
|
};
|
|
@@ -951,6 +508,46 @@ var styles$7 = /*#__PURE__*/StyleSheet.create({
|
|
|
951
508
|
}
|
|
952
509
|
});
|
|
953
510
|
|
|
511
|
+
function UIList(props) {
|
|
512
|
+
var scope = props.scope;
|
|
513
|
+
var items = scope.getItems();
|
|
514
|
+
return /*#__PURE__*/jsx(FlatList, {
|
|
515
|
+
data: items // Dados da lista
|
|
516
|
+
,
|
|
517
|
+
keyExtractor: function keyExtractor(item) {
|
|
518
|
+
return item.id;
|
|
519
|
+
} // Chave única
|
|
520
|
+
,
|
|
521
|
+
renderItem: function renderItem(_ref) {
|
|
522
|
+
var item = _ref.item;
|
|
523
|
+
return /*#__PURE__*/jsx(View, {
|
|
524
|
+
style: styles$8.item,
|
|
525
|
+
children: /*#__PURE__*/jsx(Text, {
|
|
526
|
+
style: styles$8.text,
|
|
527
|
+
children: item.name
|
|
528
|
+
})
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
var styles$8 = /*#__PURE__*/StyleSheet.create({
|
|
534
|
+
container: {
|
|
535
|
+
flex: 1,
|
|
536
|
+
padding: 20,
|
|
537
|
+
backgroundColor: '#fff'
|
|
538
|
+
},
|
|
539
|
+
item: {
|
|
540
|
+
padding: 15,
|
|
541
|
+
marginVertical: 8,
|
|
542
|
+
backgroundColor: '#f9c2ff',
|
|
543
|
+
borderRadius: 8
|
|
544
|
+
},
|
|
545
|
+
text: {
|
|
546
|
+
fontSize: 18,
|
|
547
|
+
fontWeight: 'bold'
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
|
|
954
551
|
function UIElement(props) {
|
|
955
552
|
var _useState = useState(ScopeUtils.create(props)),
|
|
956
553
|
scope = _useState[0];
|
|
@@ -969,10 +566,7 @@ function UIElement(props) {
|
|
|
969
566
|
setIndex(++index);
|
|
970
567
|
};
|
|
971
568
|
var router = {
|
|
972
|
-
list:
|
|
973
|
-
grid: ElGrid,
|
|
974
|
-
label: ElLabel,
|
|
975
|
-
repeat: ElRepeat,
|
|
569
|
+
list: UIList,
|
|
976
570
|
tabs: ElTabs,
|
|
977
571
|
chart: ElChart
|
|
978
572
|
};
|
|
@@ -1060,7 +654,7 @@ function UIElement(props) {
|
|
|
1060
654
|
var _elementStyle$type, _elementStyle$type2;
|
|
1061
655
|
var type = Utils.nvl(original.type, 'none');
|
|
1062
656
|
var key = Utils.nvl(part, 'root');
|
|
1063
|
-
var def = _extends({}, styles$
|
|
657
|
+
var def = _extends({}, styles$9[key], elementStyle == null || (_elementStyle$type = elementStyle[type]) == null ? void 0 : _elementStyle$type[key]);
|
|
1064
658
|
var hasChild = hasChildren();
|
|
1065
659
|
if (!part && !hasChild) {
|
|
1066
660
|
def = _extends({}, def);
|
|
@@ -1260,7 +854,7 @@ elementStyle.card = /*#__PURE__*/StyleSheet.create({
|
|
|
1260
854
|
paddingTop: 5
|
|
1261
855
|
}
|
|
1262
856
|
});
|
|
1263
|
-
var styles$
|
|
857
|
+
var styles$9 = /*#__PURE__*/StyleSheet.create({
|
|
1264
858
|
root: {
|
|
1265
859
|
gap: 5,
|
|
1266
860
|
flexDirection: 'column',
|
|
@@ -1287,7 +881,7 @@ var withChildStyles = /*#__PURE__*/StyleSheet.create({
|
|
|
1287
881
|
}
|
|
1288
882
|
});
|
|
1289
883
|
|
|
1290
|
-
function
|
|
884
|
+
function UIInclude(props) {
|
|
1291
885
|
if (props.rendered === false) {
|
|
1292
886
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
1293
887
|
}
|
|
@@ -1341,7 +935,7 @@ var UI = {
|
|
|
1341
935
|
}));
|
|
1342
936
|
},
|
|
1343
937
|
Include: function Include(props) {
|
|
1344
|
-
return /*#__PURE__*/jsx(
|
|
938
|
+
return /*#__PURE__*/jsx(UIInclude, _extends({}, props));
|
|
1345
939
|
},
|
|
1346
940
|
Column: function Column(_ref) {
|
|
1347
941
|
var props = _objectWithoutPropertiesLoose(_ref, _excluded);
|