vpt-sebraeds 0.0.31 → 0.0.32

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.
@@ -171,6 +171,8 @@ const Dropdown = ({
171
171
  onConfirm,
172
172
  displayMode = 'list',
173
173
  selectedValue,
174
+ showCloseButton = false,
175
+ itemGap = 0,
174
176
  }) => {
175
177
  // Estado centralizado para checkboxes
176
178
  const [checkedItems, setCheckedItems] = useState({});
@@ -353,7 +355,7 @@ const Dropdown = ({
353
355
  }
354
356
 
355
357
  return (
356
- <ScrollView style={styles.optionsList} contentContainerStyle={{ paddingBottom: 8 }} showsVerticalScrollIndicator={false} bounces={false}>
358
+ <ScrollView style={styles.optionsList} contentContainerStyle={{ paddingBottom: 8, gap: itemGap || 0 }} showsVerticalScrollIndicator={false} bounces={false}>
357
359
  {options.map((item, index) => (<RenderItem key={index.toString()} item={item} index={index} />))}
358
360
  </ScrollView>
359
361
  );
@@ -377,9 +379,25 @@ const Dropdown = ({
377
379
 
378
380
  {/* Conteúdo do modal - não propaga toque para o overlay */}
379
381
  <View style={styles.modalContainer}>
380
- <View style={styles.modalHeader}>
381
- <Text style={styles.modalTitle}>{title || "Título"}</Text>
382
- </View>
382
+ {showCloseButton ? (
383
+ <>
384
+ <View style={styles.modalHeaderWithClose}>
385
+ <TouchableOpacity
386
+ style={styles.closeButton}
387
+ onPress={() => setIsOpen(false)}
388
+ >
389
+ <Icon name="close-line" size={24} color="#666666" />
390
+ </TouchableOpacity>
391
+ </View>
392
+ <View style={styles.titleContainerCentered}>
393
+ <Text style={styles.modalTitle}>{title || "Título"}</Text>
394
+ </View>
395
+ </>
396
+ ) : (
397
+ <View style={styles.modalHeader}>
398
+ <Text style={styles.modalTitle}>{title || "Título"}</Text>
399
+ </View>
400
+ )}
383
401
 
384
402
  {renderContent()}
385
403
 
@@ -453,6 +471,18 @@ const styles = StyleSheet.create({
453
471
  paddingTop: 8,
454
472
  paddingBottom: 16,
455
473
  },
474
+ modalHeaderWithClose: {
475
+ alignItems: 'flex-end',
476
+ justifyContent: 'flex-end',
477
+ paddingHorizontal: 20,
478
+ paddingTop: 16,
479
+ paddingBottom: 8,
480
+ },
481
+ titleContainerCentered: {
482
+ alignItems: 'center',
483
+ paddingHorizontal: 20,
484
+ paddingBottom: 24,
485
+ },
456
486
  modalTitle: {
457
487
  fontSize: 18,
458
488
  fontWeight: '600',
@@ -460,7 +490,12 @@ const styles = StyleSheet.create({
460
490
  fontFamily: 'Nunito Sans',
461
491
  },
462
492
  closeButton: {
463
- margin: -4,
493
+ width: 32,
494
+ height: 32,
495
+ borderRadius: 16,
496
+ backgroundColor: '#F5F5F5',
497
+ alignItems: 'center',
498
+ justifyContent: 'center',
464
499
  },
465
500
  optionsList: {
466
501
  paddingHorizontal: 20,
@@ -20,6 +20,8 @@ interface NavigationItemProps {
20
20
  description?: string;
21
21
  layout?: 'standard' | 'expanded' | 'list';
22
22
  iconBackgroundColor?: string;
23
+ arrowSize?: number;
24
+ iconAlignment?: 'flex-start' | 'center';
23
25
  }
24
26
 
25
27
  const NavigationItem: React.FC<NavigationItemProps> = ({
@@ -39,6 +41,8 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
39
41
  description,
40
42
  layout = 'standard',
41
43
  iconBackgroundColor,
44
+ arrowSize,
45
+ iconAlignment = 'flex-start',
42
46
  }) => {
43
47
  // Estilos dinâmicos baseados nas props
44
48
  const containerStyle = [
@@ -57,7 +61,10 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
57
61
  styles.iconContainer,
58
62
  size === 'small' ? styles.iconContainerSmall : size === 'large' ? styles.iconContainerLarge : styles.iconContainerMedium,
59
63
  variant === 'selected' ? styles.iconContainerSelected : variant === 'disabled' ? styles.iconContainerDisabled : styles.iconContainerDefault,
60
- layout === 'expanded' && styles.iconContainerExpanded,
64
+ layout === 'expanded' && [
65
+ styles.iconContainerExpanded,
66
+ { alignSelf: iconAlignment }
67
+ ],
61
68
  layout === 'list' && styles.iconContainerHidden,
62
69
  iconBackgroundColor && { backgroundColor: iconBackgroundColor },
63
70
  ];
@@ -104,13 +111,15 @@ const NavigationItem: React.FC<NavigationItemProps> = ({
104
111
  };
105
112
 
106
113
  const getArrowSize = () => {
114
+ if (arrowSize !== undefined) return arrowSize;
115
+
107
116
  switch (size) {
108
117
  case 'small':
109
118
  return 11;
110
119
  case 'large':
111
- return 20;
120
+ return 16;
112
121
  default:
113
- return 20;
122
+ return 13.33;
114
123
  }
115
124
  };
116
125
 
@@ -359,7 +368,6 @@ const styles = StyleSheet.create({
359
368
  width: 48,
360
369
  height: 48,
361
370
  borderRadius: 12,
362
- alignSelf: 'center',
363
371
  },
364
372
  iconContainerHidden: {
365
373
  width: 0,
@@ -5,13 +5,14 @@ import Icon from '../Icon';
5
5
  import Select from '../Select';
6
6
  import { SEText } from 'vpt-sebraeds';
7
7
 
8
- const Table = ({
9
- data = [],
10
- showMoreComponent,
8
+ const Table = ({
9
+ data = [],
10
+ showMoreComponent,
11
11
  showFilters = false,
12
12
  onFilterChange,
13
13
  selectedRowIndex = null,
14
- onRowPress
14
+ onRowPress,
15
+ hideUnavailableStatus = false
15
16
  }) => {
16
17
  const [selectedYear, setSelectedYear] = useState(null);
17
18
  const [selectedStatuses, setSelectedStatuses] = useState([]);
@@ -53,7 +54,7 @@ const Table = ({
53
54
  // Função para mapear o status do backend para o status do componente
54
55
  const mapStatus = (statusObj) => {
55
56
  if (!statusObj) return 'overdue';
56
-
57
+
57
58
  switch (statusObj.label) {
58
59
  case 'PAGO':
59
60
  return 'paid';
@@ -68,11 +69,11 @@ const Table = ({
68
69
  // Função para formatar o valor
69
70
  const formatPrice = (valorTotal) => {
70
71
  if (!valorTotal || valorTotal === '0') return 'R$ 0,00';
71
-
72
+
72
73
  if (typeof valorTotal === 'string' && valorTotal.includes('R$')) {
73
74
  return valorTotal;
74
75
  }
75
-
76
+
76
77
  const numValue = parseFloat(valorTotal);
77
78
  return new Intl.NumberFormat('pt-BR', {
78
79
  style: 'currency',
@@ -123,7 +124,7 @@ const Table = ({
123
124
  if (statusData && statusData.label) {
124
125
  return statusData.label;
125
126
  }
126
-
127
+
127
128
  switch (statusData) {
128
129
  case 'paid':
129
130
  return 'Pago';
@@ -168,7 +169,7 @@ const Table = ({
168
169
  if (a.year !== b.year) {
169
170
  return b.year - a.year;
170
171
  }
171
-
172
+
172
173
  const aMonth = new Date(a.originalData.dtCompetenciaLocal).getMonth();
173
174
  const bMonth = new Date(b.originalData.dtCompetenciaLocal).getMonth();
174
175
  return aMonth - bMonth;
@@ -185,13 +186,18 @@ const Table = ({
185
186
  }, [transformedData]);
186
187
 
187
188
  const statusOptions = useMemo(() => {
188
- return [
189
+ const options = [
189
190
  { value: 'ATRASADO', label: 'Atrasado', isCheckbox: true },
190
191
  { value: 'A VENCER', label: 'A vencer', isCheckbox: true },
191
- { value: 'PAGO', label: 'Pago', isCheckbox: true },
192
- { value: 'INDISPONÍVEL', label: 'Indisponível', isCheckbox: true }
192
+ { value: 'PAGO', label: 'Pago', isCheckbox: true }
193
193
  ];
194
- }, []);
194
+
195
+ if (!hideUnavailableStatus) {
196
+ options.push({ value: 'INDISPONÍVEL', label: 'Indisponível', isCheckbox: true });
197
+ }
198
+
199
+ return options;
200
+ }, [hideUnavailableStatus]);
195
201
 
196
202
  // Handlers para os filtros
197
203
  const handleYearChange = (yearOption) => {
@@ -227,7 +233,7 @@ const Table = ({
227
233
  displayMode="picker"
228
234
  innerTitle="Escolha um ano para exibir:"
229
235
  disabled={yearOptions.length === 0}
230
- />
236
+ />
231
237
  </View>
232
238
 
233
239
  <View style={[styles.filterItem, { width: '60%' }]}>
@@ -237,7 +243,7 @@ const Table = ({
237
243
  .filter(option => selectedStatuses.includes(option.value))
238
244
  .map(option => option.value)
239
245
  .join(', ')
240
- .toLowerCase()
246
+ .toLowerCase()
241
247
  }
242
248
  onSelect={handleStatusChange}
243
249
  options={statusOptions}
@@ -247,7 +253,7 @@ const Table = ({
247
253
  </View>
248
254
  </View>
249
255
  )}
250
-
256
+
251
257
  {transformedData.length === 0 ? (
252
258
  <View style={styles.emptyContainer}>
253
259
  <SEText type="ns-sm-body" style={styles.emptyText}>Nenhum registro encontrado</SEText>
@@ -259,11 +265,11 @@ const Table = ({
259
265
  activeOpacity: 0.6,
260
266
  onPress: () => onRowPress(index, item)
261
267
  } : {};
262
-
268
+
263
269
  const isSelected = selectedRowIndex === index;
264
-
270
+
265
271
  return (
266
- <RowComponent
272
+ <RowComponent
267
273
  key={`${item.originalData.dtCompetenciaLocal}-${index}`}
268
274
  style={getRowStyle(index)}
269
275
  {...rowProps}
@@ -279,7 +285,7 @@ const Table = ({
279
285
  {item.month}
280
286
  </SEText>
281
287
  </View>
282
-
288
+
283
289
  <View style={styles.centerContent}>
284
290
  <SEText
285
291
  type="ns-sm-body"
@@ -291,7 +297,7 @@ const Table = ({
291
297
  {item.price}
292
298
  </SEText>
293
299
  </View>
294
-
300
+
295
301
  <View style={styles.rightContent}>
296
302
  <View style={styles.statusContainer}>
297
303
  <SEText
@@ -315,7 +321,7 @@ const Table = ({
315
321
  );
316
322
  })
317
323
  )}
318
-
324
+
319
325
  {showMoreComponent && transformedData.length !== 0 && (
320
326
  <View style={styles.showMoreContainer}>
321
327
  {showMoreComponent}
@@ -357,7 +363,7 @@ const styles = StyleSheet.create({
357
363
  rowSelected: {
358
364
  backgroundColor: '#E3E9FF',
359
365
  borderWidth: 2,
360
- borderRadius: 8,
366
+ borderRadius: 8,
361
367
  borderColor: '#3B82F6',
362
368
  borderTopColor: '#3B82F6',
363
369
  borderLeftColor: '#3B82F6',
@@ -409,7 +415,7 @@ const styles = StyleSheet.create({
409
415
  justifyContent: 'center',
410
416
  },
411
417
  emptyText: {
412
-
418
+
413
419
  fontSize: 16,
414
420
  color: '#6B7280',
415
421
  textAlign: 'center',
@@ -1,7 +1,7 @@
1
1
  export function DropdownCommitments(): React.JSX.Element;
2
2
  export default Dropdown;
3
3
  import React from 'react';
4
- declare function Dropdown({ title, onSelect, options, withSeparator, isOpen, isCheckbox, setIsOpen, confirmButtonLabel, onConfirm, displayMode, selectedValue, }: {
4
+ declare function Dropdown({ title, onSelect, options, withSeparator, isOpen, isCheckbox, setIsOpen, confirmButtonLabel, onConfirm, displayMode, selectedValue, showCloseButton, itemGap, }: {
5
5
  title: any;
6
6
  onSelect: any;
7
7
  options?: never[] | undefined;
@@ -13,5 +13,7 @@ declare function Dropdown({ title, onSelect, options, withSeparator, isOpen, isC
13
13
  onConfirm: any;
14
14
  displayMode?: string | undefined;
15
15
  selectedValue: any;
16
+ showCloseButton?: boolean | undefined;
17
+ itemGap?: number | undefined;
16
18
  }): React.JSX.Element;
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/index.jsx"],"names":[],"mappings":"AA+FO,yDA6DN;;kBA3JkD,OAAO;AAgK1D;;;;;;;;;;;;sBA6PC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Dropdown/index.jsx"],"names":[],"mappings":"AA+FO,yDA6DN;;kBA3JkD,OAAO;AAgK1D;;;;;;;;;;;;;;sBA+QC"}
@@ -136,7 +136,7 @@ export const DropdownCommitments = () => {
136
136
  };
137
137
  const { height: screenHeight } = Dimensions.get('window');
138
138
  const ITEM_HEIGHT = 50;
139
- const Dropdown = ({ title, onSelect, options = [], withSeparator = false, isOpen = false, isCheckbox = false, setIsOpen = () => { }, confirmButtonLabel, onConfirm, displayMode = 'list', selectedValue, }) => {
139
+ const Dropdown = ({ title, onSelect, options = [], withSeparator = false, isOpen = false, isCheckbox = false, setIsOpen = () => { }, confirmButtonLabel, onConfirm, displayMode = 'list', selectedValue, showCloseButton = false, itemGap = 0, }) => {
140
140
  // Estado centralizado para checkboxes
141
141
  const [checkedItems, setCheckedItems] = useState({});
142
142
  const scrollViewRef = useRef(null);
@@ -261,7 +261,7 @@ const Dropdown = ({ title, onSelect, options = [], withSeparator = false, isOpen
261
261
  </ScrollView>
262
262
  </View>);
263
263
  }
264
- return (<ScrollView style={styles.optionsList} contentContainerStyle={{ paddingBottom: 8 }} showsVerticalScrollIndicator={false} bounces={false}>
264
+ return (<ScrollView style={styles.optionsList} contentContainerStyle={{ paddingBottom: 8, gap: itemGap || 0 }} showsVerticalScrollIndicator={false} bounces={false}>
265
265
  {options.map((item, index) => (<RenderItem key={index.toString()} item={item} index={index}/>))}
266
266
  </ScrollView>);
267
267
  };
@@ -273,9 +273,18 @@ const Dropdown = ({ title, onSelect, options = [], withSeparator = false, isOpen
273
273
 
274
274
  {/* Conteúdo do modal - não propaga toque para o overlay */}
275
275
  <View style={styles.modalContainer}>
276
- <View style={styles.modalHeader}>
277
- <Text style={styles.modalTitle}>{title || "Título"}</Text>
278
- </View>
276
+ {showCloseButton ? (<>
277
+ <View style={styles.modalHeaderWithClose}>
278
+ <TouchableOpacity style={styles.closeButton} onPress={() => setIsOpen(false)}>
279
+ <Icon name="close-line" size={24} color="#666666"/>
280
+ </TouchableOpacity>
281
+ </View>
282
+ <View style={styles.titleContainerCentered}>
283
+ <Text style={styles.modalTitle}>{title || "Título"}</Text>
284
+ </View>
285
+ </>) : (<View style={styles.modalHeader}>
286
+ <Text style={styles.modalTitle}>{title || "Título"}</Text>
287
+ </View>)}
279
288
 
280
289
  {renderContent()}
281
290
 
@@ -344,6 +353,18 @@ const styles = StyleSheet.create({
344
353
  paddingTop: 8,
345
354
  paddingBottom: 16,
346
355
  },
356
+ modalHeaderWithClose: {
357
+ alignItems: 'flex-end',
358
+ justifyContent: 'flex-end',
359
+ paddingHorizontal: 20,
360
+ paddingTop: 16,
361
+ paddingBottom: 8,
362
+ },
363
+ titleContainerCentered: {
364
+ alignItems: 'center',
365
+ paddingHorizontal: 20,
366
+ paddingBottom: 24,
367
+ },
347
368
  modalTitle: {
348
369
  fontSize: 18,
349
370
  fontWeight: '600',
@@ -351,7 +372,12 @@ const styles = StyleSheet.create({
351
372
  fontFamily: 'Nunito Sans',
352
373
  },
353
374
  closeButton: {
354
- margin: -4,
375
+ width: 32,
376
+ height: 32,
377
+ borderRadius: 16,
378
+ backgroundColor: '#F5F5F5',
379
+ alignItems: 'center',
380
+ justifyContent: 'center',
355
381
  },
356
382
  optionsList: {
357
383
  paddingHorizontal: 20,
@@ -17,6 +17,8 @@ interface NavigationItemProps {
17
17
  description?: string;
18
18
  layout?: 'standard' | 'expanded' | 'list';
19
19
  iconBackgroundColor?: string;
20
+ arrowSize?: number;
21
+ iconAlignment?: 'flex-start' | 'center';
20
22
  }
21
23
  declare const NavigationItem: React.FC<NavigationItemProps>;
22
24
  export default NavigationItem;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/NavigationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsC,SAAS,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAInG,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAiOjD,CAAC;AAyQF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/NavigationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAsC,SAAS,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AAInG,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1C,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,YAAY,GAAG,QAAQ,CAAC;CACzC;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwOjD,CAAC;AAwQF,eAAe,cAAc,CAAC"}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { View, StyleSheet, TouchableOpacity } from 'react-native';
3
3
  import Icon from '../Icon';
4
4
  import SEText from '../SEText';
5
- const NavigationItem = ({ iconName, label, variant = 'default', size = 'medium', onPress, style, iconColor, textColor, backgroundColor, borderColor, showArrow = true, badge, badgeStyle = 'standard', description, layout = 'standard', iconBackgroundColor, }) => {
5
+ const NavigationItem = ({ iconName, label, variant = 'default', size = 'medium', onPress, style, iconColor, textColor, backgroundColor, borderColor, showArrow = true, badge, badgeStyle = 'standard', description, layout = 'standard', iconBackgroundColor, arrowSize, iconAlignment = 'flex-start', }) => {
6
6
  // Estilos dinâmicos baseados nas props
7
7
  const containerStyle = [
8
8
  styles.container,
@@ -19,7 +19,10 @@ const NavigationItem = ({ iconName, label, variant = 'default', size = 'medium',
19
19
  styles.iconContainer,
20
20
  size === 'small' ? styles.iconContainerSmall : size === 'large' ? styles.iconContainerLarge : styles.iconContainerMedium,
21
21
  variant === 'selected' ? styles.iconContainerSelected : variant === 'disabled' ? styles.iconContainerDisabled : styles.iconContainerDefault,
22
- layout === 'expanded' && styles.iconContainerExpanded,
22
+ layout === 'expanded' && [
23
+ styles.iconContainerExpanded,
24
+ { alignSelf: iconAlignment }
25
+ ],
23
26
  layout === 'list' && styles.iconContainerHidden,
24
27
  iconBackgroundColor && { backgroundColor: iconBackgroundColor },
25
28
  ];
@@ -62,13 +65,15 @@ const NavigationItem = ({ iconName, label, variant = 'default', size = 'medium',
62
65
  }
63
66
  };
64
67
  const getArrowSize = () => {
68
+ if (arrowSize !== undefined)
69
+ return arrowSize;
65
70
  switch (size) {
66
71
  case 'small':
67
72
  return 11;
68
73
  case 'large':
69
- return 20;
74
+ return 16;
70
75
  default:
71
- return 20;
76
+ return 13.33;
72
77
  }
73
78
  };
74
79
  const getBadgeStyle = () => {
@@ -260,7 +265,6 @@ const styles = StyleSheet.create({
260
265
  width: 48,
261
266
  height: 48,
262
267
  borderRadius: 12,
263
- alignSelf: 'center',
264
268
  },
265
269
  iconContainerHidden: {
266
270
  width: 0,
@@ -1,11 +1,12 @@
1
1
  export default Table;
2
- declare function Table({ data, showMoreComponent, showFilters, onFilterChange, selectedRowIndex, onRowPress }: {
2
+ declare function Table({ data, showMoreComponent, showFilters, onFilterChange, selectedRowIndex, onRowPress, hideUnavailableStatus }: {
3
3
  data?: never[] | undefined;
4
4
  showMoreComponent: any;
5
5
  showFilters?: boolean | undefined;
6
6
  onFilterChange: any;
7
7
  selectedRowIndex?: null | undefined;
8
8
  onRowPress: any;
9
+ hideUnavailableStatus?: boolean | undefined;
9
10
  }): React.JSX.Element;
10
11
  import React from 'react';
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Table/index.jsx"],"names":[],"mappings":";AAOA;;;;;;;sBA8TC;kBArUsE,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/Table/index.jsx"],"names":[],"mappings":";AAOA;;;;;;;;sBAoUC;kBA3UsE,OAAO"}
@@ -4,7 +4,7 @@ import moment from 'moment';
4
4
  import Icon from '../Icon';
5
5
  import Select from '../Select';
6
6
  import { SEText } from 'vpt-sebraeds';
7
- const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChange, selectedRowIndex = null, onRowPress }) => {
7
+ const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChange, selectedRowIndex = null, onRowPress, hideUnavailableStatus = false }) => {
8
8
  const [selectedYear, setSelectedYear] = useState(null);
9
9
  const [selectedStatuses, setSelectedStatuses] = useState([]);
10
10
  const [selectedFilter, setSelectedFilter] = useState({});
@@ -160,13 +160,16 @@ const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChan
160
160
  }));
161
161
  }, [transformedData]);
162
162
  const statusOptions = useMemo(() => {
163
- return [
163
+ const options = [
164
164
  { value: 'ATRASADO', label: 'Atrasado', isCheckbox: true },
165
165
  { value: 'A VENCER', label: 'A vencer', isCheckbox: true },
166
- { value: 'PAGO', label: 'Pago', isCheckbox: true },
167
- { value: 'INDISPONÍVEL', label: 'Indisponível', isCheckbox: true }
166
+ { value: 'PAGO', label: 'Pago', isCheckbox: true }
168
167
  ];
169
- }, []);
168
+ if (!hideUnavailableStatus) {
169
+ options.push({ value: 'INDISPONÍVEL', label: 'Indisponível', isCheckbox: true });
170
+ }
171
+ return options;
172
+ }, [hideUnavailableStatus]);
170
173
  // Handlers para os filtros
171
174
  const handleYearChange = (yearOption) => {
172
175
  const newYear = yearOption?.value || null;
@@ -198,7 +201,7 @@ const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChan
198
201
  .toLowerCase()} onSelect={handleStatusChange} options={statusOptions} placeholder="Selecione o status" innerTitle="Escolha qual status exibir:"/>
199
202
  </View>
200
203
  </View>)}
201
-
204
+
202
205
  {transformedData.length === 0 ? (<View style={styles.emptyContainer}>
203
206
  <SEText type="ns-sm-body" style={styles.emptyText}>Nenhum registro encontrado</SEText>
204
207
  </View>) : (transformedData.map((item, index) => {
@@ -217,7 +220,7 @@ const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChan
217
220
  {item.month}
218
221
  </SEText>
219
222
  </View>
220
-
223
+
221
224
  <View style={styles.centerContent}>
222
225
  <SEText type="ns-sm-body" style={[
223
226
  styles.priceText,
@@ -226,7 +229,7 @@ const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChan
226
229
  {item.price}
227
230
  </SEText>
228
231
  </View>
229
-
232
+
230
233
  <View style={styles.rightContent}>
231
234
  <View style={styles.statusContainer}>
232
235
  <SEText type="ns-sm-body" style={[
@@ -241,7 +244,7 @@ const Table = ({ data = [], showMoreComponent, showFilters = false, onFilterChan
241
244
  </View>
242
245
  </RowComponent>);
243
246
  }))}
244
-
247
+
245
248
  {showMoreComponent && transformedData.length !== 0 && (<View style={styles.showMoreContainer}>
246
249
  {showMoreComponent}
247
250
  </View>)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpt-sebraeds",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "Biblioteca de componentes React Native do Sebrae",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",