wca-designsystem 1.0.90 → 1.0.97

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.90",
2
+ "version": "1.0.97",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import React, { useCallback } from 'react'
1
+ import React, { useCallback, useMemo } from 'react'
2
2
  import * as S from './styles'
3
3
  import InputDeTexto from '../../atomos/InputDeTexto'
4
4
  import SelectCustomizado from '../../atomos/Select'
@@ -26,6 +26,7 @@ export type TabelaHeaderProps<
26
26
  setOrdenarPor?: React.Dispatch<React.SetStateAction<SelectDataProps>>
27
27
  handleAdicionar?: () => void
28
28
  ordenarPor?: SelectDataProps
29
+ ordenarOpcoes?: Array<{ value: string; label: string }>;
29
30
  hasFiltersButtons?: boolean
30
31
  columns: Column<T>[]
31
32
  setFormatedColumns: React.Dispatch<React.SetStateAction<Column<T>[]>>
@@ -41,6 +42,7 @@ const TabelaHeader = <T extends { id: string | number; children?: Array<T> }>({
41
42
  hasFiltersButtons,
42
43
  handleAdicionar,
43
44
  ordenarPor,
45
+ ordenarOpcoes,
44
46
  setOrdenarPor,
45
47
  setFormatedColumns,
46
48
  hasOrder,
@@ -56,6 +58,7 @@ const TabelaHeader = <T extends { id: string | number; children?: Array<T> }>({
56
58
  }, [])
57
59
 
58
60
  const columnsToHide = ['expand', 'select', 'acoes']
61
+
59
62
  return (
60
63
  <S.HeaderTableContent className="header-table-content">
61
64
  <InputDeTexto
@@ -70,7 +73,7 @@ const TabelaHeader = <T extends { id: string | number; children?: Array<T> }>({
70
73
  {hasOrder && (
71
74
  <SelectCustomizado
72
75
  tipo="table"
73
- data={[
76
+ data={ordenarOpcoes ?? [
74
77
  { value: 'Maior', label: 'Ordenar por: Decrescente' },
75
78
  { value: 'Menor', label: 'Ordenar por: Crescente' },
76
79
  ]}
@@ -52,6 +52,7 @@ export type CustomTableProps<
52
52
  hasFiltersButtons?: boolean
53
53
  hasInfinitScrool?: boolean
54
54
  setOrdenarPor?: React.Dispatch<React.SetStateAction<SelectDataProps>>
55
+ ordenarOpcoes?: Array<{ value: string; label: string }>
55
56
  ordenarPor?: SelectDataProps
56
57
  filtrosPor: {
57
58
  value: string
@@ -85,6 +86,7 @@ const Tabela = <
85
86
  isLoading,
86
87
  hasSelect,
87
88
  hasExpand,
89
+ ordenarOpcoes,
88
90
  ordenarPor,
89
91
  setSimples,
90
92
  selectedLine,
@@ -187,6 +189,7 @@ const Tabela = <
187
189
  hasFiltersButtons={hasFiltersButtons}
188
190
  hasOrder={hasOrder}
189
191
  ordenarPor={ordenarPor}
192
+ ordenarOpcoes={ordenarOpcoes}
190
193
  setOrdenarPor={setOrdenarPor}
191
194
  />
192
195