@draftbit/core 46.2.4-463c2c.0 → 46.2.4-47dc09.5
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/lib/commonjs/components/Config.js +1 -0
- package/lib/commonjs/components/DeprecatedButton.js +4 -22
- package/lib/commonjs/components/SVG.js +49 -0
- package/lib/commonjs/components/TabView/TabView.js +102 -0
- package/lib/commonjs/components/TabView/TabViewItem.js +26 -0
- package/lib/commonjs/components/TabView/index.js +23 -0
- package/lib/commonjs/components/TextField.js +2 -1
- package/lib/commonjs/index.js +22 -8
- package/lib/commonjs/mappings/Image.js +2 -2
- package/lib/commonjs/mappings/MapView.js +1 -0
- package/lib/commonjs/mappings/NumberInput.js +146 -149
- package/lib/commonjs/mappings/SVG.js +23 -0
- package/lib/commonjs/mappings/TabView.js +79 -0
- package/lib/commonjs/mappings/TextArea.js +188 -193
- package/lib/commonjs/mappings/TextField.js +7 -8
- package/lib/commonjs/mappings/TextInput.js +178 -180
- package/lib/module/components/Config.js +1 -0
- package/lib/module/components/SVG.js +32 -0
- package/lib/module/components/TabView/TabView.js +87 -0
- package/lib/module/components/TabView/TabViewItem.js +18 -0
- package/lib/module/components/TabView/index.js +2 -0
- package/lib/module/components/TextField.js +2 -1
- package/lib/module/index.js +3 -2
- package/lib/module/mappings/Image.js +2 -2
- package/lib/module/mappings/MapView.js +1 -0
- package/lib/module/mappings/NumberInput.js +146 -149
- package/lib/module/mappings/SVG.js +14 -0
- package/lib/module/mappings/TabView.js +70 -0
- package/lib/module/mappings/TextArea.js +188 -193
- package/lib/module/mappings/TextField.js +7 -8
- package/lib/module/mappings/TextInput.js +178 -180
- package/lib/typescript/src/components/Config.d.ts +1 -0
- package/lib/typescript/src/components/SVG.d.ts +8 -0
- package/lib/typescript/src/components/TabView/TabView.d.ts +19 -0
- package/lib/typescript/src/components/TabView/TabViewItem.d.ts +10 -0
- package/lib/typescript/src/components/TabView/index.d.ts +2 -0
- package/lib/typescript/src/components/TextField.d.ts +1 -0
- package/lib/typescript/src/index.d.ts +2 -1
- package/lib/typescript/src/mappings/MapView.d.ts +1 -0
- package/lib/typescript/src/mappings/SVG.d.ts +22 -0
- package/lib/typescript/src/mappings/TabView.d.ts +111 -0
- package/lib/typescript/src/mappings/TextArea.d.ts +42 -42
- package/lib/typescript/src/mappings/TextField.d.ts +120 -110
- package/package.json +7 -6
- package/src/components/Config.js +1 -0
- package/src/components/Config.ts +1 -0
- package/src/components/SVG.js +14 -0
- package/src/components/SVG.tsx +35 -0
- package/src/components/TabView/TabView.js +34 -0
- package/src/components/TabView/TabView.tsx +97 -0
- package/src/components/TabView/TabViewItem.js +5 -0
- package/src/components/TabView/TabViewItem.tsx +21 -0
- package/src/components/TabView/index.js +2 -0
- package/src/components/TabView/index.ts +2 -0
- package/src/components/TextField.js +2 -2
- package/src/components/TextField.tsx +3 -1
- package/src/index.js +2 -1
- package/src/index.tsx +2 -1
- package/src/mappings/Image.js +2 -2
- package/src/mappings/Image.ts +2 -2
- package/src/mappings/MapView.js +1 -0
- package/src/mappings/MapView.ts +1 -0
- package/src/mappings/NumberInput.js +160 -163
- package/src/mappings/NumberInput.ts +165 -168
- package/src/mappings/SVG.js +14 -0
- package/src/mappings/SVG.ts +15 -0
- package/src/mappings/TabView.js +73 -0
- package/src/mappings/TabView.ts +80 -0
- package/src/mappings/TextArea.js +213 -220
- package/src/mappings/TextArea.ts +219 -227
- package/src/mappings/TextField.js +6 -9
- package/src/mappings/TextField.ts +7 -11
- package/src/mappings/TextInput.js +205 -208
- package/src/mappings/TextInput.ts +212 -215
- package/lib/commonjs/components/Youtube.js +0 -73
- package/lib/module/components/Youtube.js +0 -59
- package/lib/typescript/src/components/Youtube.d.ts +0 -44
- package/src/components/Youtube.js +0 -38
- package/src/components/Youtube.tsx +0 -66
|
@@ -28,68 +28,17 @@ export declare const SEED_DATA: ({
|
|
|
28
28
|
formType: string;
|
|
29
29
|
propType: string;
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
group: string;
|
|
33
|
-
label: string;
|
|
34
|
-
description: string;
|
|
35
|
-
formType: string;
|
|
36
|
-
propType: string;
|
|
37
|
-
defaultValue: null;
|
|
38
|
-
editable: boolean;
|
|
39
|
-
required: boolean;
|
|
40
|
-
};
|
|
41
|
-
label: {
|
|
42
|
-
group: string;
|
|
43
|
-
label: string;
|
|
44
|
-
description: string;
|
|
45
|
-
formType: string;
|
|
46
|
-
propType: string;
|
|
47
|
-
defaultValue: null;
|
|
48
|
-
editable: boolean;
|
|
49
|
-
required: boolean;
|
|
50
|
-
};
|
|
51
|
-
assistiveText: {
|
|
52
|
-
group: string;
|
|
53
|
-
label: string;
|
|
54
|
-
description: string;
|
|
55
|
-
formType: string;
|
|
56
|
-
propType: string;
|
|
57
|
-
defaultValue: null;
|
|
58
|
-
editable: boolean;
|
|
59
|
-
required: boolean;
|
|
60
|
-
};
|
|
61
|
-
error: {
|
|
31
|
+
activeBorderColor: {
|
|
62
32
|
group: string;
|
|
63
33
|
label: string;
|
|
64
34
|
description: string;
|
|
65
|
-
formType: string;
|
|
66
|
-
propType: string;
|
|
67
|
-
defaultValue: null;
|
|
68
35
|
editable: boolean;
|
|
69
36
|
required: boolean;
|
|
70
|
-
};
|
|
71
|
-
leftIconName: {
|
|
72
|
-
group: string;
|
|
73
|
-
label: string;
|
|
74
|
-
description: string;
|
|
75
|
-
formType: string;
|
|
76
|
-
propType: string;
|
|
77
37
|
defaultValue: null;
|
|
78
|
-
editable: boolean;
|
|
79
|
-
required: boolean;
|
|
80
|
-
};
|
|
81
|
-
leftIconMode: {
|
|
82
|
-
group: string;
|
|
83
|
-
label: string;
|
|
84
|
-
description: string;
|
|
85
38
|
formType: string;
|
|
86
39
|
propType: string;
|
|
87
|
-
defaultValue: null;
|
|
88
|
-
options: string[];
|
|
89
|
-
editable: boolean;
|
|
90
|
-
required: boolean;
|
|
91
40
|
};
|
|
92
|
-
|
|
41
|
+
secureTextEntry: {
|
|
93
42
|
group: string;
|
|
94
43
|
label: string;
|
|
95
44
|
description: string;
|
|
@@ -99,18 +48,6 @@ export declare const SEED_DATA: ({
|
|
|
99
48
|
editable: boolean;
|
|
100
49
|
required: boolean;
|
|
101
50
|
};
|
|
102
|
-
fieldName: {
|
|
103
|
-
handlerPropName: string;
|
|
104
|
-
defaultValue: string;
|
|
105
|
-
group: string;
|
|
106
|
-
label: string;
|
|
107
|
-
description: string;
|
|
108
|
-
formType: string;
|
|
109
|
-
propType: string;
|
|
110
|
-
valuePropName: string;
|
|
111
|
-
editable: boolean;
|
|
112
|
-
required: boolean;
|
|
113
|
-
};
|
|
114
51
|
allowFontScaling: {
|
|
115
52
|
group: string;
|
|
116
53
|
label: string;
|
|
@@ -288,74 +225,58 @@ export declare const SEED_DATA: ({
|
|
|
288
225
|
formType: string;
|
|
289
226
|
propType: string;
|
|
290
227
|
};
|
|
291
|
-
|
|
292
|
-
layout: {};
|
|
293
|
-
stylesPanelSections?: undefined;
|
|
294
|
-
} | {
|
|
295
|
-
name: string;
|
|
296
|
-
tag: string;
|
|
297
|
-
description: string;
|
|
298
|
-
category: string;
|
|
299
|
-
stylesPanelSections: string[];
|
|
300
|
-
preview_image_url: string;
|
|
301
|
-
supports_list_render: boolean;
|
|
302
|
-
triggers: string[];
|
|
303
|
-
props: {
|
|
304
|
-
placeholder: {
|
|
305
|
-
defaultValue: string;
|
|
228
|
+
label: {
|
|
306
229
|
group: string;
|
|
307
230
|
label: string;
|
|
308
231
|
description: string;
|
|
309
|
-
editable: boolean;
|
|
310
|
-
required: boolean;
|
|
311
232
|
formType: string;
|
|
312
233
|
propType: string;
|
|
234
|
+
defaultValue: null;
|
|
235
|
+
editable: boolean;
|
|
236
|
+
required: boolean;
|
|
313
237
|
};
|
|
314
|
-
|
|
238
|
+
assistiveText: {
|
|
239
|
+
group: string;
|
|
315
240
|
label: string;
|
|
316
241
|
description: string;
|
|
317
242
|
formType: string;
|
|
318
243
|
propType: string;
|
|
319
|
-
defaultValue:
|
|
320
|
-
options: string[];
|
|
244
|
+
defaultValue: null;
|
|
321
245
|
editable: boolean;
|
|
322
246
|
required: boolean;
|
|
323
|
-
group: string;
|
|
324
247
|
};
|
|
325
|
-
|
|
248
|
+
error: {
|
|
249
|
+
group: string;
|
|
326
250
|
label: string;
|
|
327
251
|
description: string;
|
|
328
|
-
group: string;
|
|
329
252
|
formType: string;
|
|
330
253
|
propType: string;
|
|
331
|
-
defaultValue:
|
|
254
|
+
defaultValue: null;
|
|
332
255
|
editable: boolean;
|
|
333
256
|
required: boolean;
|
|
334
257
|
};
|
|
335
|
-
|
|
258
|
+
leftIconName: {
|
|
259
|
+
group: string;
|
|
336
260
|
label: string;
|
|
337
261
|
description: string;
|
|
338
262
|
formType: string;
|
|
339
263
|
propType: string;
|
|
340
|
-
group: string;
|
|
341
264
|
defaultValue: null;
|
|
342
265
|
editable: boolean;
|
|
343
266
|
required: boolean;
|
|
344
|
-
step: number;
|
|
345
267
|
};
|
|
346
|
-
|
|
347
|
-
handlerPropName: string;
|
|
268
|
+
leftIconMode: {
|
|
348
269
|
group: string;
|
|
349
270
|
label: string;
|
|
350
271
|
description: string;
|
|
351
272
|
formType: string;
|
|
352
273
|
propType: string;
|
|
353
|
-
defaultValue:
|
|
354
|
-
|
|
274
|
+
defaultValue: null;
|
|
275
|
+
options: string[];
|
|
355
276
|
editable: boolean;
|
|
356
277
|
required: boolean;
|
|
357
278
|
};
|
|
358
|
-
|
|
279
|
+
rightIconName: {
|
|
359
280
|
group: string;
|
|
360
281
|
label: string;
|
|
361
282
|
description: string;
|
|
@@ -365,54 +286,72 @@ export declare const SEED_DATA: ({
|
|
|
365
286
|
editable: boolean;
|
|
366
287
|
required: boolean;
|
|
367
288
|
};
|
|
368
|
-
|
|
289
|
+
fieldName: {
|
|
290
|
+
handlerPropName: string;
|
|
291
|
+
defaultValue: string;
|
|
369
292
|
group: string;
|
|
370
293
|
label: string;
|
|
371
294
|
description: string;
|
|
372
295
|
formType: string;
|
|
373
296
|
propType: string;
|
|
374
|
-
|
|
297
|
+
valuePropName: string;
|
|
375
298
|
editable: boolean;
|
|
376
299
|
required: boolean;
|
|
377
300
|
};
|
|
378
|
-
|
|
379
|
-
|
|
301
|
+
};
|
|
302
|
+
layout: {};
|
|
303
|
+
stylesPanelSections?: undefined;
|
|
304
|
+
} | {
|
|
305
|
+
name: string;
|
|
306
|
+
tag: string;
|
|
307
|
+
description: string;
|
|
308
|
+
category: string;
|
|
309
|
+
stylesPanelSections: string[];
|
|
310
|
+
preview_image_url: string;
|
|
311
|
+
supports_list_render: boolean;
|
|
312
|
+
triggers: string[];
|
|
313
|
+
props: {
|
|
314
|
+
type: {
|
|
380
315
|
label: string;
|
|
381
316
|
description: string;
|
|
382
317
|
formType: string;
|
|
383
318
|
propType: string;
|
|
384
|
-
defaultValue:
|
|
319
|
+
defaultValue: string;
|
|
320
|
+
options: string[];
|
|
385
321
|
editable: boolean;
|
|
386
322
|
required: boolean;
|
|
387
|
-
};
|
|
388
|
-
leftIconName: {
|
|
389
323
|
group: string;
|
|
324
|
+
};
|
|
325
|
+
multiline: {
|
|
390
326
|
label: string;
|
|
391
327
|
description: string;
|
|
328
|
+
group: string;
|
|
392
329
|
formType: string;
|
|
393
330
|
propType: string;
|
|
394
|
-
defaultValue:
|
|
331
|
+
defaultValue: boolean;
|
|
395
332
|
editable: boolean;
|
|
396
333
|
required: boolean;
|
|
397
334
|
};
|
|
398
|
-
|
|
399
|
-
group: string;
|
|
335
|
+
numberOfLines: {
|
|
400
336
|
label: string;
|
|
401
337
|
description: string;
|
|
402
338
|
formType: string;
|
|
403
339
|
propType: string;
|
|
340
|
+
group: string;
|
|
404
341
|
defaultValue: null;
|
|
405
|
-
options: string[];
|
|
406
342
|
editable: boolean;
|
|
407
343
|
required: boolean;
|
|
344
|
+
step: number;
|
|
408
345
|
};
|
|
409
|
-
|
|
346
|
+
fieldName: {
|
|
347
|
+
handlerPropName: string;
|
|
410
348
|
group: string;
|
|
411
349
|
label: string;
|
|
412
350
|
description: string;
|
|
413
351
|
formType: string;
|
|
414
352
|
propType: string;
|
|
415
|
-
defaultValue:
|
|
353
|
+
defaultValue: string;
|
|
354
|
+
valuePropName: string;
|
|
416
355
|
editable: boolean;
|
|
417
356
|
required: boolean;
|
|
418
357
|
};
|
|
@@ -532,6 +471,16 @@ export declare const SEED_DATA: ({
|
|
|
532
471
|
formType: string;
|
|
533
472
|
propType: string;
|
|
534
473
|
};
|
|
474
|
+
placeholder: {
|
|
475
|
+
group: string;
|
|
476
|
+
label: string;
|
|
477
|
+
description: string;
|
|
478
|
+
editable: boolean;
|
|
479
|
+
required: boolean;
|
|
480
|
+
defaultValue: string;
|
|
481
|
+
formType: string;
|
|
482
|
+
propType: string;
|
|
483
|
+
};
|
|
535
484
|
placeholderTextColor: {
|
|
536
485
|
group: string;
|
|
537
486
|
label: string;
|
|
@@ -593,6 +542,67 @@ export declare const SEED_DATA: ({
|
|
|
593
542
|
formType: string;
|
|
594
543
|
propType: string;
|
|
595
544
|
};
|
|
545
|
+
label: {
|
|
546
|
+
group: string;
|
|
547
|
+
label: string;
|
|
548
|
+
description: string;
|
|
549
|
+
formType: string;
|
|
550
|
+
propType: string;
|
|
551
|
+
defaultValue: null;
|
|
552
|
+
editable: boolean;
|
|
553
|
+
required: boolean;
|
|
554
|
+
};
|
|
555
|
+
assistiveText: {
|
|
556
|
+
group: string;
|
|
557
|
+
label: string;
|
|
558
|
+
description: string;
|
|
559
|
+
formType: string;
|
|
560
|
+
propType: string;
|
|
561
|
+
defaultValue: null;
|
|
562
|
+
editable: boolean;
|
|
563
|
+
required: boolean;
|
|
564
|
+
};
|
|
565
|
+
error: {
|
|
566
|
+
group: string;
|
|
567
|
+
label: string;
|
|
568
|
+
description: string;
|
|
569
|
+
formType: string;
|
|
570
|
+
propType: string;
|
|
571
|
+
defaultValue: null;
|
|
572
|
+
editable: boolean;
|
|
573
|
+
required: boolean;
|
|
574
|
+
};
|
|
575
|
+
leftIconName: {
|
|
576
|
+
group: string;
|
|
577
|
+
label: string;
|
|
578
|
+
description: string;
|
|
579
|
+
formType: string;
|
|
580
|
+
propType: string;
|
|
581
|
+
defaultValue: null;
|
|
582
|
+
editable: boolean;
|
|
583
|
+
required: boolean;
|
|
584
|
+
};
|
|
585
|
+
leftIconMode: {
|
|
586
|
+
group: string;
|
|
587
|
+
label: string;
|
|
588
|
+
description: string;
|
|
589
|
+
formType: string;
|
|
590
|
+
propType: string;
|
|
591
|
+
defaultValue: null;
|
|
592
|
+
options: string[];
|
|
593
|
+
editable: boolean;
|
|
594
|
+
required: boolean;
|
|
595
|
+
};
|
|
596
|
+
rightIconName: {
|
|
597
|
+
group: string;
|
|
598
|
+
label: string;
|
|
599
|
+
description: string;
|
|
600
|
+
formType: string;
|
|
601
|
+
propType: string;
|
|
602
|
+
defaultValue: null;
|
|
603
|
+
editable: boolean;
|
|
604
|
+
required: boolean;
|
|
605
|
+
};
|
|
596
606
|
};
|
|
597
607
|
layout: {};
|
|
598
608
|
})[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftbit/core",
|
|
3
|
-
"version": "46.2.4-
|
|
3
|
+
"version": "46.2.4-47dc09.5+47dc091f",
|
|
4
4
|
"description": "Core (non-native) Components",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@date-io/date-fns": "^1.3.13",
|
|
43
43
|
"@draftbit/react-theme-provider": "^2.1.1",
|
|
44
|
-
"@draftbit/types": "^46.2.
|
|
44
|
+
"@draftbit/types": "^46.2.4",
|
|
45
45
|
"@material-ui/core": "^4.11.0",
|
|
46
46
|
"@material-ui/pickers": "^3.2.10",
|
|
47
47
|
"@react-native-community/slider": "4.2.3",
|
|
@@ -53,10 +53,11 @@
|
|
|
53
53
|
"lodash.omit": "^4.5.0",
|
|
54
54
|
"lodash.tonumber": "^4.0.3",
|
|
55
55
|
"react-native-modal-datetime-picker": "^13.0.0",
|
|
56
|
+
"react-native-pager-view": "5.4.24",
|
|
57
|
+
"react-native-svg": "^12.3.0",
|
|
58
|
+
"react-native-tab-view": "^3.0.0",
|
|
56
59
|
"react-native-typography": "^1.4.1",
|
|
57
|
-
"react-native-web-swiper": "^2.2.3"
|
|
58
|
-
"react-native-web-webview": "^1.0.2",
|
|
59
|
-
"react-native-youtube-iframe": "^2.2.2"
|
|
60
|
+
"react-native-web-swiper": "^2.2.3"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@types/color": "^3.0.1",
|
|
@@ -81,5 +82,5 @@
|
|
|
81
82
|
]
|
|
82
83
|
]
|
|
83
84
|
},
|
|
84
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "47dc091f66a13724fe481e507bc1daee902dcf88"
|
|
85
86
|
}
|
package/src/components/Config.js
CHANGED
|
@@ -42,6 +42,7 @@ export default {
|
|
|
42
42
|
cardIconElevation: 1,
|
|
43
43
|
placeholderImageURL: "https://static.draftbit.com/images/placeholder-image" + getExtension(),
|
|
44
44
|
getPlaceholderImageUrl: (size) => buildImageUrl({ width: size.width, height: size.height }, "image-placeholder_1"),
|
|
45
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
|
|
45
46
|
squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
|
|
46
47
|
FABSize: 40,
|
|
47
48
|
FABBorderRadius: 20,
|
package/src/components/Config.ts
CHANGED
|
@@ -60,6 +60,7 @@ export default {
|
|
|
60
60
|
{ width: size.width, height: size.height },
|
|
61
61
|
"image-placeholder_1"
|
|
62
62
|
),
|
|
63
|
+
placeholderSvgURL: "https://static.draftbit.com/images/placeholder-svg.svg",
|
|
63
64
|
squareImageUrl: buildImageUrl({ width: 100, height: 100 }, "Avatar"),
|
|
64
65
|
FABSize: 40,
|
|
65
66
|
FABBorderRadius: 20,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Platform, Image } from "react-native";
|
|
3
|
+
import { SvgUri } from "react-native-svg";
|
|
4
|
+
import Config from "./Config";
|
|
5
|
+
const SVG = ({ source, style }) => {
|
|
6
|
+
let svgSource = source === null || source === undefined ? Config.placeholderSvgURL : source;
|
|
7
|
+
return (React.createElement(React.Fragment, null,
|
|
8
|
+
Platform.OS === "ios" && (React.createElement(View, { style: style },
|
|
9
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
|
|
10
|
+
Platform.OS === "android" && (React.createElement(View, { style: style },
|
|
11
|
+
React.createElement(SvgUri, { width: "100%", height: "100%", uri: svgSource }))),
|
|
12
|
+
Platform.OS === "web" && (React.createElement(Image, { style: style, source: { uri: svgSource } }))));
|
|
13
|
+
};
|
|
14
|
+
export default SVG;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { View, Platform, Image, StyleProp, ImageStyle } from "react-native";
|
|
3
|
+
import { SvgUri } from "react-native-svg";
|
|
4
|
+
|
|
5
|
+
import Config from "./Config";
|
|
6
|
+
|
|
7
|
+
type SVGComponentProps = {
|
|
8
|
+
source: string;
|
|
9
|
+
style?: StyleProp<ImageStyle>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const SVG = ({ source, style }: SVGComponentProps) => {
|
|
13
|
+
let svgSource =
|
|
14
|
+
source === null || source === undefined ? Config.placeholderSvgURL : source;
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
{Platform.OS === "ios" && (
|
|
19
|
+
<View style={style}>
|
|
20
|
+
<SvgUri width="100%" height="100%" uri={svgSource} />
|
|
21
|
+
</View>
|
|
22
|
+
)}
|
|
23
|
+
{Platform.OS === "android" && (
|
|
24
|
+
<View style={style}>
|
|
25
|
+
<SvgUri width="100%" height="100%" uri={svgSource} />
|
|
26
|
+
</View>
|
|
27
|
+
)}
|
|
28
|
+
{Platform.OS === "web" && (
|
|
29
|
+
<Image style={style} source={{ uri: svgSource }} />
|
|
30
|
+
)}
|
|
31
|
+
</>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default SVG;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
|
3
|
+
// import { withTheme } from "../../theming";
|
|
4
|
+
import TabViewItem from "./TabViewItem";
|
|
5
|
+
const TabViewComponent = ({ Icon, tabBarPosition, keyboardDismissMode, swipeEnabled, scrollEnabled, activeColor, inactiveColor, pressColor, indicatorColor, style, children, }) => {
|
|
6
|
+
const [index, setIndex] = React.useState(0);
|
|
7
|
+
const [routes, setRoutes] = React.useState([]);
|
|
8
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
9
|
+
React.useEffect(() => {
|
|
10
|
+
const newRoutes = [];
|
|
11
|
+
const scenes = {};
|
|
12
|
+
React.Children.toArray(children)
|
|
13
|
+
.filter((child) => child.type === TabViewItem)
|
|
14
|
+
.forEach((child) => {
|
|
15
|
+
var _a, _b, _c;
|
|
16
|
+
if ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.id) {
|
|
17
|
+
newRoutes.push({
|
|
18
|
+
key: (_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.id,
|
|
19
|
+
...child === null || child === void 0 ? void 0 : child.props,
|
|
20
|
+
});
|
|
21
|
+
scenes[(_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.id] = () => child;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
setRoutes(newRoutes);
|
|
25
|
+
setTabScenes(scenes);
|
|
26
|
+
}, [children]);
|
|
27
|
+
const indexChangeHandler = (i) => setIndex(i);
|
|
28
|
+
const renderTabBar = (props) => {
|
|
29
|
+
console.log(props);
|
|
30
|
+
return (React.createElement(TabBar, { ...props, activeColor: activeColor, inactiveColor: inactiveColor, pressColor: pressColor, scrollEnabled: scrollEnabled, indicatorStyle: { backgroundColor: indicatorColor }, renderIcon: ({ route, color }) => (route === null || route === void 0 ? void 0 : route.icon) ? (React.createElement(Icon, { name: route.icon, color: color, size: 36 })) : null, style: style }));
|
|
31
|
+
};
|
|
32
|
+
return (React.createElement(TabView, { navigationState: { index, routes }, renderScene: SceneMap(tabScenes), renderTabBar: renderTabBar, onIndexChange: indexChangeHandler, tabBarPosition: tabBarPosition, keyboardDismissMode: keyboardDismissMode, swipeEnabled: swipeEnabled }));
|
|
33
|
+
};
|
|
34
|
+
export default TabViewComponent;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
3
|
+
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
|
|
4
|
+
|
|
5
|
+
// import { withTheme } from "../../theming";
|
|
6
|
+
import TabViewItem from "./TabViewItem";
|
|
7
|
+
import type { IconSlot } from "../../interfaces/Icon";
|
|
8
|
+
|
|
9
|
+
type TabBarPosition = "top" | "bottom";
|
|
10
|
+
type KeyboardDismissMode = "none" | "auto" | "on-drag";
|
|
11
|
+
|
|
12
|
+
type TabViewProps = {
|
|
13
|
+
tabBarPosition?: TabBarPosition;
|
|
14
|
+
keyboardDismissMode?: KeyboardDismissMode;
|
|
15
|
+
swipeEnabled?: boolean;
|
|
16
|
+
scrollEnabled?: boolean;
|
|
17
|
+
activeColor?: string;
|
|
18
|
+
inactiveColor?: string;
|
|
19
|
+
pressColor?: string;
|
|
20
|
+
indicatorColor?: string;
|
|
21
|
+
style?: StyleProp<TextStyle | ViewStyle>;
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
} & IconSlot;
|
|
24
|
+
|
|
25
|
+
const TabViewComponent = ({
|
|
26
|
+
Icon,
|
|
27
|
+
tabBarPosition,
|
|
28
|
+
keyboardDismissMode,
|
|
29
|
+
swipeEnabled,
|
|
30
|
+
scrollEnabled,
|
|
31
|
+
activeColor,
|
|
32
|
+
inactiveColor,
|
|
33
|
+
pressColor,
|
|
34
|
+
indicatorColor,
|
|
35
|
+
style,
|
|
36
|
+
children,
|
|
37
|
+
}: TabViewProps) => {
|
|
38
|
+
const [index, setIndex] = React.useState(0);
|
|
39
|
+
const [routes, setRoutes] = React.useState([]);
|
|
40
|
+
const [tabScenes, setTabScenes] = React.useState({});
|
|
41
|
+
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
const newRoutes: any = [];
|
|
44
|
+
const scenes: any = {};
|
|
45
|
+
|
|
46
|
+
React.Children.toArray(children)
|
|
47
|
+
.filter((child: any) => child.type === TabViewItem)
|
|
48
|
+
.forEach((child: any) => {
|
|
49
|
+
if (child?.props?.id) {
|
|
50
|
+
newRoutes.push({
|
|
51
|
+
key: child?.props?.id,
|
|
52
|
+
...child?.props,
|
|
53
|
+
});
|
|
54
|
+
scenes[child?.props?.id] = () => child;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
setRoutes(newRoutes);
|
|
59
|
+
setTabScenes(scenes);
|
|
60
|
+
}, [children]);
|
|
61
|
+
|
|
62
|
+
const indexChangeHandler = (i: any) => setIndex(i);
|
|
63
|
+
|
|
64
|
+
const renderTabBar = (props: any) => {
|
|
65
|
+
console.log(props);
|
|
66
|
+
return (
|
|
67
|
+
<TabBar
|
|
68
|
+
{...props}
|
|
69
|
+
activeColor={activeColor}
|
|
70
|
+
inactiveColor={inactiveColor}
|
|
71
|
+
pressColor={pressColor}
|
|
72
|
+
scrollEnabled={scrollEnabled}
|
|
73
|
+
indicatorStyle={{ backgroundColor: indicatorColor }}
|
|
74
|
+
renderIcon={({ route, color }) =>
|
|
75
|
+
route?.icon ? (
|
|
76
|
+
<Icon name={route.icon} color={color} size={36} />
|
|
77
|
+
) : null
|
|
78
|
+
}
|
|
79
|
+
style={style}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<TabView
|
|
86
|
+
navigationState={{ index, routes }}
|
|
87
|
+
renderScene={SceneMap(tabScenes)}
|
|
88
|
+
renderTabBar={renderTabBar}
|
|
89
|
+
onIndexChange={indexChangeHandler}
|
|
90
|
+
tabBarPosition={tabBarPosition}
|
|
91
|
+
keyboardDismissMode={keyboardDismissMode}
|
|
92
|
+
swipeEnabled={swipeEnabled}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export default TabViewComponent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface TabViewItemProps {
|
|
3
|
+
title: string;
|
|
4
|
+
id: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
accessibilityLabel: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const TabViewItem = ({
|
|
11
|
+
title,
|
|
12
|
+
id,
|
|
13
|
+
icon,
|
|
14
|
+
children,
|
|
15
|
+
accessibilityLabel,
|
|
16
|
+
}: TabViewItemProps) => {
|
|
17
|
+
console.log({ title, id, icon, accessibilityLabel });
|
|
18
|
+
return children;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default TabViewItem;
|
|
@@ -136,7 +136,7 @@ class TextField extends React.Component {
|
|
|
136
136
|
return this._root && this._root.blur();
|
|
137
137
|
}
|
|
138
138
|
render() {
|
|
139
|
-
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
139
|
+
const { Icon, type = "underline", disabled = false, label, error = false, leftIconName, leftIconMode, rightIconName, assistiveText, underlineColor: underlineColorProp, activeBorderColor: activeBorderColorProp, multiline = false, numberOfLines = 4, style, theme: { colors, typography, roundness, disabledOpacity }, render = (props) => React.createElement(NativeTextInput, { ...props }), ...rest } = this.props;
|
|
140
140
|
const MINIMIZED_LABEL_Y_OFFSET = -(typography.caption.lineHeight + 4);
|
|
141
141
|
const OUTLINE_MINIMIZED_LABEL_Y_OFFSET = -(16 * 0.5 + 4);
|
|
142
142
|
const MAXIMIZED_LABEL_FONT_SIZE = typography.subtitle1.fontSize;
|
|
@@ -152,7 +152,7 @@ class TextField extends React.Component {
|
|
|
152
152
|
backgroundColor = colors.divider;
|
|
153
153
|
}
|
|
154
154
|
else {
|
|
155
|
-
activeColor = error ? colors.error :
|
|
155
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
156
156
|
placeholderColor = borderColor = colors.light;
|
|
157
157
|
underlineColor = underlineColorProp;
|
|
158
158
|
backgroundColor = colors.background;
|
|
@@ -42,6 +42,7 @@ export type Props = {
|
|
|
42
42
|
multiline?: boolean;
|
|
43
43
|
numberOfLines: number;
|
|
44
44
|
underlineColor?: string;
|
|
45
|
+
activeBorderColor?: string;
|
|
45
46
|
style?: StyleProp<ViewStyle> & { height?: number };
|
|
46
47
|
theme: Theme;
|
|
47
48
|
render?: (
|
|
@@ -237,6 +238,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
237
238
|
rightIconName,
|
|
238
239
|
assistiveText,
|
|
239
240
|
underlineColor: underlineColorProp,
|
|
241
|
+
activeBorderColor: activeBorderColorProp,
|
|
240
242
|
multiline = false,
|
|
241
243
|
numberOfLines = 4,
|
|
242
244
|
style,
|
|
@@ -269,7 +271,7 @@ class TextField extends React.Component<Props, State> {
|
|
|
269
271
|
underlineColor = "transparent";
|
|
270
272
|
backgroundColor = colors.divider;
|
|
271
273
|
} else {
|
|
272
|
-
activeColor = error ? colors.error :
|
|
274
|
+
activeColor = error ? colors.error : activeBorderColorProp;
|
|
273
275
|
placeholderColor = borderColor = colors.light;
|
|
274
276
|
underlineColor = underlineColorProp;
|
|
275
277
|
backgroundColor = colors.background;
|