@sito/dashboard 0.0.28 → 0.0.30

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 (78) hide show
  1. package/README.md +132 -15
  2. package/dist/components/Chip/Chip.d.ts +7 -0
  3. package/dist/components/Chip/index.d.ts +2 -0
  4. package/dist/components/Chip/types.d.ts +12 -0
  5. package/dist/components/Form/AutocompleteInput/AutocompleteInput.d.ts +7 -0
  6. package/dist/components/Form/AutocompleteInput/index.d.ts +2 -0
  7. package/dist/components/Form/AutocompleteInput/types.d.ts +6 -0
  8. package/dist/components/Form/CheckInput/CheckInput.d.ts +7 -0
  9. package/dist/components/Form/CheckInput/index.d.ts +2 -0
  10. package/dist/components/Form/CheckInput/types.d.ts +4 -0
  11. package/dist/components/Form/SelectInput/SelectInput.d.ts +1 -2
  12. package/dist/components/Form/SelectInput/index.d.ts +2 -0
  13. package/dist/components/Form/SelectInput/types.d.ts +2 -14
  14. package/dist/components/Form/TextInput/TextInput.d.ts +7 -0
  15. package/dist/components/Form/TextInput/index.d.ts +2 -0
  16. package/dist/components/Form/TextInput/types.d.ts +5 -0
  17. package/dist/components/Form/index.d.ts +6 -4
  18. package/dist/components/Form/types.d.ts +15 -0
  19. package/dist/components/Form/utils.d.ts +3 -3
  20. package/dist/components/Loading/Loading.d.ts +1 -7
  21. package/dist/components/Loading/index.d.ts +1 -1
  22. package/dist/components/Loading/types.d.ts +6 -0
  23. package/dist/components/SvgIcons/ChevronDown.d.ts +2 -0
  24. package/dist/components/SvgIcons/ChevronLeft.d.ts +2 -0
  25. package/dist/components/SvgIcons/ChevronRight.d.ts +2 -0
  26. package/dist/components/SvgIcons/ChevronUp.d.ts +2 -0
  27. package/dist/components/SvgIcons/Close.d.ts +2 -0
  28. package/dist/components/SvgIcons/Filters.d.ts +2 -0
  29. package/dist/components/SvgIcons/index.d.ts +7 -0
  30. package/dist/components/{Chevron → SvgIcons}/types.d.ts +1 -1
  31. package/dist/components/Table/components/Columns.d.ts +2 -2
  32. package/dist/components/Table/components/FilterPopup/FilterPopup.d.ts +2 -0
  33. package/dist/components/Table/components/FilterPopup/index.d.ts +3 -0
  34. package/dist/components/Table/components/FilterPopup/types.d.ts +7 -0
  35. package/dist/components/Table/components/FilterPopup/utils.d.ts +3 -0
  36. package/dist/components/Table/components/Footer/CountOfTotal.d.ts +1 -0
  37. package/dist/components/Table/components/Footer/Footer.d.ts +4 -0
  38. package/dist/components/Table/components/Footer/JumpToPage.d.ts +5 -0
  39. package/dist/components/Table/components/Footer/Navigation.d.ts +1 -0
  40. package/dist/components/Table/components/Footer/index.d.ts +4 -0
  41. package/dist/components/Table/components/Rows.d.ts +3 -0
  42. package/dist/components/Table/components/Widgets/AutocompleteWidget.d.ts +2 -0
  43. package/dist/components/Table/components/Widgets/CheckWidget.d.ts +2 -0
  44. package/dist/components/Table/components/Widgets/DateWidget.d.ts +2 -0
  45. package/dist/components/Table/components/Widgets/NumberWidget.d.ts +2 -0
  46. package/dist/components/Table/components/Widgets/SelectWidget.d.ts +2 -0
  47. package/dist/components/Table/components/Widgets/TextWidget.d.ts +2 -0
  48. package/dist/components/Table/components/Widgets/index.d.ts +7 -0
  49. package/dist/components/Table/components/Widgets/types.d.ts +14 -0
  50. package/dist/components/Table/components/index.d.ts +6 -0
  51. package/dist/components/Table/components/types.d.ts +37 -0
  52. package/dist/components/Table/index.d.ts +3 -4
  53. package/dist/components/Table/types.d.ts +6 -26
  54. package/dist/components/Tooltip/Tooltip.d.ts +1 -6
  55. package/dist/components/Tooltip/index.d.ts +2 -0
  56. package/dist/components/Tooltip/types.d.ts +5 -0
  57. package/dist/components/index.d.ts +6 -6
  58. package/dist/dashboard.cjs +1 -1
  59. package/dist/dashboard.js +886 -301
  60. package/dist/lib/filters.d.ts +45 -0
  61. package/dist/lib/index.d.ts +2 -0
  62. package/dist/main.css +1 -1
  63. package/dist/providers/FiltersProvider/FiltersProvider.d.ts +8 -0
  64. package/dist/providers/FiltersProvider/index.d.ts +3 -0
  65. package/dist/providers/FiltersProvider/types.d.ts +18 -0
  66. package/dist/providers/FiltersProvider/utils.d.ts +5 -0
  67. package/dist/{components/Table/hooks → providers/TableOptions}/TableOptionsProvider.d.ts +1 -1
  68. package/dist/providers/TableOptions/index.d.ts +2 -0
  69. package/dist/{components/Table/hooks → providers/TableOptions}/types.d.ts +9 -3
  70. package/dist/providers/Translation/index.d.ts +2 -0
  71. package/dist/providers/index.d.ts +3 -2
  72. package/package.json +4 -2
  73. package/dist/components/Chevron/ChevronDown.d.ts +0 -3
  74. package/dist/components/Chevron/ChevronUp.d.ts +0 -3
  75. package/dist/components/Chevron/index.d.ts +0 -3
  76. package/dist/components/Table/components/Navigation.d.ts +0 -5
  77. /package/dist/components/Table/components/{PageSize.d.ts → Footer/PageSize.d.ts} +0 -0
  78. /package/dist/lib/{models/query.d.ts → query.d.ts} +0 -0
package/README.md CHANGED
@@ -35,12 +35,6 @@ const App = () => {
35
35
  { id: 2, name: "Jane Smith", age: 25 },
36
36
  ];
37
37
 
38
- const parseRows = (row) => ({
39
- id: row.id,
40
- name: row.name,
41
- age: row.age,
42
- });
43
-
44
38
  const columns = [
45
39
  { key: "name", label: "Name" },
46
40
  { key: "age", label: "Age" },
@@ -49,8 +43,7 @@ const App = () => {
49
43
  return (
50
44
  <Table
51
45
  title="User Table"
52
- rows={rows}
53
- parseRows={parseRows}
46
+ data={rows}
54
47
  columns={columns}
55
48
  />
56
49
  );
@@ -92,13 +85,19 @@ export default App;
92
85
  The Table component is a flexible and feature-rich table for displaying data.
93
86
 
94
87
  #### Props
95
- - `title` (string): The title of the table.
96
- - `rows` (array): The data to display in the table.
97
- - `parseRows` (function): A function to parse rows for rendering.
98
- - `columns` (array): Column definitions, including keys and labels.
99
- - `isLoading` (boolean): Whether the table is in a loading state.
100
- - `actions` (function): A function to render actions for each row.
101
- - `className` (string): Custom class for the table container.
88
+ | Propiedad | Tipo | Valor por defecto | Descripción |
89
+ |-----------------------|--------------|-------------------------|---------------------------------------------------------------------|
90
+ | `title` | `string` | `""` | El título de la tabla. |
91
+ | `data` | `array` | — | Los datos a mostrar en la tabla. |
92
+ | `columns` | `array` | `[]` | Definiciones de columnas, incluyendo claves (`key`) y etiquetas. |
93
+ | `isLoading` | `boolean` | `false` | Indica si la tabla está en estado de carga. |
94
+ | `actions` | `Action[]` | — | Función para renderizar acciones por fila. |
95
+ | `className` | `string` | `""` | Clase personalizada para el contenedor de la tabla. |
96
+ | `contentClassName` | `string` | `""` | Clase personalizada para el contenido de la tabla. |
97
+ | `softDeleteProperty` | `string` | `"deleted"` | Propiedad usada para lógica de borrado suave. |
98
+ | `toolbar` | `ReactNode` | `<></>` | Componente personalizado para la barra de herramientas. |
99
+ | `onSort` | `function` | — | Callback que se llama cuando se cambia el orden de la tabla. |
100
+
102
101
 
103
102
  ### TranslationProvider
104
103
 
@@ -107,6 +106,124 @@ Provides translation support for your application.
107
106
  #### Props
108
107
  - `t` (function): A translation function that takes a key and returns the translated string.
109
108
 
109
+ ### Examples
110
+
111
+ #### Columns definition
112
+
113
+ ```
114
+ key: string;
115
+ label: string;
116
+ sortable?: boolean;
117
+ sortOptions: {
118
+ icons: {
119
+ className: string;
120
+ asc: string;
121
+ desc: string;
122
+ };
123
+ };
124
+ className?: string;
125
+ display?: "visible" | "none";
126
+ pos?: number;
127
+ renderBody?: (value: any, row: any) => ReactNode;
128
+ renderHead?: () => void;
129
+ filterOptions?: ColumnFilterOptions;
130
+ ```
131
+
132
+ ColumnFilterOptions
133
+
134
+ ```
135
+ {
136
+ type: FilterTypes;
137
+ defaultValue: any;
138
+ label?: string;
139
+ }
140
+ ```
141
+
142
+ FilterTypes enum
143
+
144
+ ```
145
+ text,
146
+ number,
147
+ select,
148
+ autocomplete,
149
+ date,
150
+ check,
151
+ ```
152
+
153
+ ```
154
+ import { Table } from "@sito/dashboard";
155
+
156
+ const columns = [
157
+ {
158
+ key: "tagIds",
159
+ label: t("_entities:news.tags.label"),
160
+ filterOptions: {
161
+ type: FilterTypes.autocomplete,
162
+ options: tagsList,
163
+ defaultValue: [],
164
+ },
165
+ sortable: false,
166
+ renderBody: (_, news) =>
167
+ (
168
+ <div className="flex flex-wrap gap-3">
169
+ {news.tags?.map(({ name, id }) => (
170
+ <Chip key={id} label={name} spanClassName="text-xs" />
171
+ ))}
172
+ </div>
173
+ ) ?? " - ",
174
+ },
175
+ ]
176
+
177
+ <Table data={...} columns={columns} />
178
+ ```
179
+
180
+ #### Actions definition
181
+
182
+ ```
183
+ {
184
+ id: string;
185
+ onClick: (entity: object) => void;
186
+ icon: any;
187
+ tooltip: string;
188
+ hidden: (entity: object) => boolean;
189
+ }
190
+ ```
191
+
192
+ ```
193
+ import { Table } from "@sito/dashboard";
194
+
195
+ const addAction = {
196
+ id: "add",
197
+ hidden: false,
198
+ onClick: async () => {
199
+ // do some stuff here
200
+ },
201
+ icon: (
202
+ <FontAwesomeIcon
203
+ icon={isLoading ? faSpinner : faAdd}
204
+ className={`text-success ${isLoading ? "rotate" : ""}`}
205
+ />
206
+ ),
207
+ tooltip: t("_accessibility:buttons.add"),
208
+ }
209
+
210
+ <Table data={...} columns={...} actions={[addAction]} />
211
+ ```
212
+
213
+ #### Your custom toolbar
214
+
215
+ ```
216
+ import { Table } from "@sito/dashboard";
217
+
218
+ const Toolbar = () => {
219
+ return <div>
220
+ <h1>My custom toolbar</h1>
221
+ </div>
222
+ }
223
+
224
+ <Table data={...} columns={...} toolbar={<Toolbar />} />
225
+ ```
226
+
110
227
  ## Development
111
228
 
112
229
  Running Locally
@@ -0,0 +1,7 @@
1
+ import { ChipPropsType } from './types';
2
+ /**
3
+ * Chip component
4
+ * @param {object} props - component props
5
+ * @returns Chip component
6
+ */
7
+ export declare function Chip(props: ChipPropsType): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export * from './Chip';
2
+ export * from './types';
@@ -0,0 +1,12 @@
1
+ export declare enum ChipVariant {
2
+ empty = "empty",
3
+ outlined = "outlined",
4
+ default = "default"
5
+ }
6
+ export type ChipPropsType = {
7
+ variant?: ChipVariant;
8
+ label?: string;
9
+ onDelete?: () => void;
10
+ className?: string;
11
+ spanClassName?: string;
12
+ };
@@ -0,0 +1,7 @@
1
+ import { AutocompleteInputPropsType } from './types';
2
+ /**
3
+ *
4
+ * @param {object} props
5
+ * @returns
6
+ */
7
+ export declare const AutocompleteInput: import('react').ForwardRefExoticComponent<Omit<AutocompleteInputPropsType, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export * from './AutocompleteInput';
2
+ export * from './types';
@@ -0,0 +1,6 @@
1
+ import { TextInputPropsType, Option } from '../..';
2
+ export interface AutocompleteInputPropsType extends TextInputPropsType {
3
+ multiple?: boolean;
4
+ inputContainerClassName?: string;
5
+ options: Option[];
6
+ }
@@ -0,0 +1,7 @@
1
+ import { CheckInputPropsType } from './types';
2
+ /**
3
+ * CheckInput
4
+ * @param {object} props
5
+ * @returns CheckInput component
6
+ */
7
+ export declare const CheckInput: import('react').ForwardRefExoticComponent<Omit<CheckInputPropsType, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export * from './CheckInput';
2
+ export * from './types';
@@ -0,0 +1,4 @@
1
+ import { HTMLProps } from 'react';
2
+ import { BaseInputPropsType } from '../types';
3
+ export interface CheckInputPropsType extends HTMLProps<HTMLInputElement>, Omit<BaseInputPropsType, "value" | "onChange"> {
4
+ }
@@ -4,5 +4,4 @@ import { SelectInputPropsType } from './types';
4
4
  * @param {object} props
5
5
  * @returns
6
6
  */
7
- declare const SelectInput: import('react').ForwardRefExoticComponent<Omit<SelectInputPropsType, "ref"> & import('react').RefAttributes<HTMLSelectElement>>;
8
- export default SelectInput;
7
+ export declare const SelectInput: import('react').ForwardRefExoticComponent<Omit<SelectInputPropsType, "ref"> & import('react').RefAttributes<HTMLSelectElement>>;
@@ -0,0 +1,2 @@
1
+ export * from './SelectInput';
2
+ export * from './types';
@@ -1,21 +1,9 @@
1
1
  import { HTMLProps } from 'react';
2
- import { State } from '../utils';
2
+ import { BaseInputPropsType } from '../types';
3
3
  export type Option = {
4
4
  id: number | string;
5
5
  value: number | string;
6
6
  };
7
- export interface SelectInputPropsType extends HTMLProps<HTMLSelectElement> {
8
- state?: State;
9
- value: any;
10
- onChange: (e: any) => void;
7
+ export interface SelectInputPropsType extends Omit<HTMLProps<HTMLSelectElement>, "value" | "onChange">, BaseInputPropsType {
11
8
  options: Option[];
12
- name?: string;
13
- id?: string;
14
- label?: string;
15
- containerClassName?: string;
16
- inputClassName?: string;
17
- labelClassName?: string;
18
- helperText?: string;
19
- helperTextClassName?: string;
20
- placeholder?: string;
21
9
  }
@@ -0,0 +1,7 @@
1
+ import { TextInputPropsType } from './types';
2
+ /**
3
+ * TextInput
4
+ * @param {object} props
5
+ * @returns TextInput Component
6
+ */
7
+ export declare const TextInput: import('react').ForwardRefExoticComponent<Omit<TextInputPropsType, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,2 @@
1
+ export * from './TextInput';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ import { HTMLProps, ReactNode } from 'react';
2
+ import { BaseInputPropsType } from '../types';
3
+ export interface TextInputPropsType extends Omit<HTMLProps<HTMLInputElement>, "value" | "onChange">, BaseInputPropsType {
4
+ children?: ReactNode;
5
+ }
@@ -1,4 +1,6 @@
1
- import { default as SelectInput } from './SelectInput/SelectInput';
2
- import { Option, SelectInputPropsType } from './SelectInput/types';
3
- export type { Option, SelectInputPropsType };
4
- export { SelectInput };
1
+ export * from './SelectInput';
2
+ export * from './TextInput';
3
+ export * from './CheckInput';
4
+ export * from './AutocompleteInput';
5
+ export * from './utils';
6
+ export * from './types';
@@ -0,0 +1,15 @@
1
+ import { State } from './utils';
2
+ export type BaseInputPropsType = {
3
+ state?: State;
4
+ value: any;
5
+ onChange: (e: any) => void;
6
+ name?: string;
7
+ id?: string;
8
+ label?: string;
9
+ containerClassName?: string;
10
+ inputClassName?: string;
11
+ labelClassName?: string;
12
+ helperText?: string;
13
+ helperTextClassName?: string;
14
+ placeholder?: string;
15
+ };
@@ -8,16 +8,16 @@ export declare enum State {
8
8
  * @param {string} state - input state
9
9
  * @returns input class name by
10
10
  */
11
- export declare const inputStateClassName: (state: State) => "border-red-500 text-red-900 placeholder-red-700 focus:ring-red-500 focus:border-red-500" | "border-green-500 text-green-900 placeholder-green-700 focus:ring-green-500 focus:border-green-500" | "text-gray-900 border-gray-300 focus:border-blue-600";
11
+ export declare const inputStateClassName: (state: State) => "input-error" | "input-good" | "input-normal";
12
12
  /**
13
13
  * Label State Class Name
14
14
  * @param {string} state - input state
15
15
  * @returns input class name by
16
16
  */
17
- export declare const labelStateClassName: (state: State) => "peer-focus:text-red-700 text-red-700" | "peer-focus:text-green-700 text-green-700" | "peer-focus:text-blue-600 text-gray-500";
17
+ export declare const labelStateClassName: (state: State) => "input-label-error" | "input-label-good" | "input-label-normal";
18
18
  /**
19
19
  * Helper Text State Class Name
20
20
  * @param {string} state - input state
21
21
  * @returns input class name by
22
22
  */
23
- export declare const helperTextStateClassName: (state: State) => "text-red-600" | "text-green-600" | "text-gray-500";
23
+ export declare const helperTextStateClassName: (state: State) => "input-helper-text-error" | "input-helper-text-good" | "input-helper-text-normal";
@@ -1,13 +1,7 @@
1
- import { HTMLProps } from 'react';
2
- interface LoadingPropsType extends HTMLProps<HTMLDivElement> {
3
- color?: string;
4
- loaderClass?: string;
5
- strokeWidth?: string;
6
- }
1
+ import { LoadingPropsType } from './types';
7
2
  /**
8
3
  * Loading
9
4
  * @param {object} props - Props
10
5
  * @returns Loading component
11
6
  */
12
7
  export declare function Loading(props: LoadingPropsType): import("react/jsx-runtime").JSX.Element;
13
- export {};
@@ -1 +1 @@
1
- export { Loading } from './Loading';
1
+ export * from './Loading';
@@ -0,0 +1,6 @@
1
+ import { HTMLProps } from 'react';
2
+ export interface LoadingPropsType extends HTMLProps<HTMLDivElement> {
3
+ color?: string;
4
+ loaderClass?: string;
5
+ strokeWidth?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export declare function ChevronDown(props: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export declare function ChevronLeft(props: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export declare function ChevronRight(props: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export declare function ChevronUp(props: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export declare function Close(props: IconProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { IconProps } from './types';
2
+ export declare const Filters: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export * from './ChevronDown';
2
+ export * from './ChevronUp';
3
+ export * from './ChevronRight';
4
+ export * from './ChevronLeft';
5
+ export * from './Filters';
6
+ export * from './Close';
7
+ export * from './types';
@@ -1,3 +1,3 @@
1
1
  export type IconProps = {
2
- className: string;
2
+ className?: string;
3
3
  };
@@ -1,7 +1,7 @@
1
- import { ColumnPropTypes } from '../types';
1
+ import { ColumnPropsType } from './types';
2
2
  /**
3
3
  * Columns component
4
4
  * @param {object} props properties for the columns
5
5
  * @returns Row of columns
6
6
  */
7
- export declare function Columns(props: ColumnPropTypes): import("react/jsx-runtime").JSX.Element;
7
+ export declare function Columns(props: ColumnPropsType): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { FilterPopupPropsType } from './types';
2
+ export declare const FilterPopup: (props: FilterPopupPropsType) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './FilterPopup';
2
+ export * from './types';
3
+ export * from './utils';
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ import { FilterType } from '../../../../lib';
3
+ export type FilterPopupPropsType = {
4
+ align?: "right" | "left";
5
+ icon?: ReactNode | string;
6
+ filters?: FilterType[];
7
+ };
@@ -0,0 +1,3 @@
1
+ import { ReactNode } from 'react';
2
+ import { WidgetFilterProps } from '../../../../lib';
3
+ export declare const renderFilterComponent: (filter: WidgetFilterProps) => ReactNode;
@@ -0,0 +1 @@
1
+ export declare const CountOfTotal: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @returns Footer component
3
+ */
4
+ export declare function Footer(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Page size component
3
+ * @returns Page size component
4
+ */
5
+ export declare function JumpToPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const Navigation: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export * from './Footer';
2
+ export * from './Navigation';
3
+ export * from './PageSize';
4
+ export * from './CountOfTotal';
@@ -0,0 +1,3 @@
1
+ import { RowsPropsType } from './types';
2
+ export declare const Rows: (props: RowsPropsType) => import("react/jsx-runtime").JSX.Element[];
3
+ export default Rows;
@@ -0,0 +1,2 @@
1
+ import { AutocompleteWidgetPropsType } from './types';
2
+ export declare function AutocompleteWidget(props: AutocompleteWidgetPropsType): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { CheckWidgetPropsType } from './types';
2
+ export declare const CheckWidget: (props: CheckWidgetPropsType) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { DateWidgetPropsType } from './types';
2
+ export declare const DateWidget: (props: DateWidgetPropsType) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { NumberWidgetPropsType } from './types';
2
+ export declare const NumberWidget: (props: NumberWidgetPropsType) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SelectWidgetPropsType } from './types';
2
+ export declare function SelectWidget(props: SelectWidgetPropsType): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { TextWidgetPropsType } from './types';
2
+ export declare const TextWidget: (props: TextWidgetPropsType) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export * from './SelectWidget';
2
+ export * from './TextWidget';
3
+ export * from './NumberWidget';
4
+ export * from './CheckWidget';
5
+ export * from './AutocompleteWidget';
6
+ export * from './DateWidget';
7
+ export * from './types';
@@ -0,0 +1,14 @@
1
+ import { AutocompleteFilterType, CheckFilterType, DateFilterType, NumberFilterType, SelectFilterType, TextFilterType } from '../../../../lib';
2
+ export interface SelectWidgetPropsType extends SelectFilterType {
3
+ }
4
+ export interface DateWidgetPropsType extends DateFilterType {
5
+ }
6
+ export interface AutocompleteWidgetPropsType extends AutocompleteFilterType {
7
+ multiple?: boolean;
8
+ }
9
+ export interface CheckWidgetPropsType extends CheckFilterType {
10
+ }
11
+ export interface TextWidgetPropsType extends TextFilterType {
12
+ }
13
+ export interface NumberWidgetPropsType extends NumberFilterType {
14
+ }
@@ -0,0 +1,6 @@
1
+ export * from './Columns';
2
+ export * from './Empty';
3
+ export * from './Footer';
4
+ export * from './FilterPopup';
5
+ export * from './Rows';
6
+ export * from './types';
@@ -0,0 +1,37 @@
1
+ import { FilterTypes, SortOrder } from '../../../lib';
2
+ import { Action } from '../types';
3
+ export type ColumnType = {
4
+ key: string;
5
+ label: string;
6
+ sortable?: boolean;
7
+ sortOptions: {
8
+ icons: {
9
+ className: string;
10
+ asc: string;
11
+ desc: string;
12
+ };
13
+ };
14
+ className?: string;
15
+ display?: "visible" | "none";
16
+ pos?: number;
17
+ renderBody?: (value: any, row: any) => React.ReactNode;
18
+ renderHead?: () => void;
19
+ filterOptions?: ColumnFilterOptions;
20
+ };
21
+ export type ColumnPropsType = {
22
+ entity: string;
23
+ columns: ColumnType[];
24
+ hasAction: boolean;
25
+ onSortCallback: (prop: string, sortOrder: SortOrder) => void;
26
+ };
27
+ export type ColumnFilterOptions = {
28
+ type: FilterTypes;
29
+ defaultValue: any;
30
+ label?: string;
31
+ };
32
+ export type RowsPropsType = {
33
+ data: any[];
34
+ columns: ColumnType[];
35
+ softDeleteProperty: string;
36
+ actions: ((row: any) => Action[]) | undefined;
37
+ };
@@ -1,4 +1,3 @@
1
- export { useTableOptions, TableOptionsProvider, } from './hooks/TableOptionsProvider';
2
- export { Table } from './Table';
3
- export type { Action as TableAction } from './types';
4
- export type { TableOptionsContextType, TableOptionsProviderPropsType, } from './hooks/types';
1
+ export * from './Table';
2
+ export * from './components';
3
+ export * from './types';
@@ -1,3 +1,6 @@
1
+ import { SortOrder } from '../../lib';
2
+ import { ColumnType } from './components';
3
+ import { ReactNode } from 'react';
1
4
  export type Action = {
2
5
  id: string;
3
6
  onClick: (entity: object) => void;
@@ -5,40 +8,17 @@ export type Action = {
5
8
  tooltip: string;
6
9
  hidden: (entity: object) => boolean;
7
10
  };
8
- export type ColumnsOptionsType = {
9
- noSortableColumns: {
10
- [key: string]: boolean;
11
- };
12
- columnClassNames: {
13
- [key: string]: string;
14
- };
15
- icons: {
16
- className: string;
17
- asc: string;
18
- desc: string;
19
- };
20
- };
21
- export type ColumnType = {
22
- key: string;
23
- label: string;
24
- };
25
- export type ColumnPropTypes = {
26
- entity: string;
27
- columns: ColumnType[];
28
- columnsOptions?: ColumnsOptionsType;
29
- hasAction: boolean;
30
- };
31
11
  export type TablePropsType = {
32
12
  entity: string;
33
13
  title?: string;
34
14
  subtitle?: string;
35
- rows: object[];
36
- parseRows?: any;
15
+ data: object[];
37
16
  isLoading?: boolean;
38
17
  actions?: (row: object) => Action[];
39
18
  columns?: ColumnType[];
40
- columnsOptions?: ColumnsOptionsType;
41
19
  contentClassName?: string;
42
20
  className?: string;
43
21
  softDeleteProperty?: string;
22
+ toolbar?: ReactNode;
23
+ onSort: (prop: string, sortOrder: SortOrder) => void;
44
24
  };