@apia/table 0.1.3 → 0.2.2
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/LICENSE.md +20 -20
- package/README.md +27 -27
- package/dist/index.d.ts +27 -22
- package/dist/index.js +3212 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -9
- package/cleanDist.json +0 -3
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) [year] [fullname]
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [year] [fullname]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
# Initiator
|
|
2
|
-
|
|
3
|
-
Este package se creó con la única utilidad de copiarlo entero y pegarlo a la hora de crear un nuevo package.
|
|
4
|
-
|
|
5
|
-
Este iniciador permite crear un paquete que compila typescript y puede ser importado desde otros packages.
|
|
6
|
-
|
|
7
|
-
## IMPORTANTE
|
|
8
|
-
|
|
9
|
-
Los archivos **tsconfig.json** y **tsup.config.ts** no son archivos únicos sino symlinks a archivos de configuración comunes a todos los packages. En caso de que sea necesario modificar alguno de ellos **que en la gran mayoría de los casos no sería necesario**, es necesario eliminar el archivo a modificar y crear uno nuevo.
|
|
10
|
-
|
|
11
|
-
## Procedimiento
|
|
12
|
-
|
|
13
|
-
- Copiar la carpeta initiator y pegarla con otro nombre dentro de packages.
|
|
14
|
-
- Modificar el package.json:
|
|
15
|
-
- Eliminar la línea ```private: true```.
|
|
16
|
-
- Cambiar la ocurrencia `initiator` por el nombre del nuevo paquete.
|
|
17
|
-
- Agregar los scripts convenientes: dev, build, etc.
|
|
18
|
-
- Ejecutar el comando lerna bootstrap desde la carpeta raíz.
|
|
19
|
-
|
|
20
|
-
Luego de ejecutar estos pasos, el package estaría listo para comenzar a usarse.
|
|
21
|
-
|
|
22
|
-
Este package trae como dependencias por defecto theme-ui y react. Si se desea agregar más dependencias se debe ejecutar el comando ```lerna add --scope="@apia/packageName" dependencyName```. Ejemplo, si creamos un paquete con el nombre @apia/myPackage y queremos agregar lodash como dependencia, ejecutamos el comando ```lerna add --scope="@apia/myPackage" lodash```.
|
|
23
|
-
|
|
24
|
-
**Importante 1**: Dado que estamos desarrollando packages, es importante determinar si las dependencias que vamos a agregar son de tipo dependency o de tipo peerDependency.
|
|
25
|
-
|
|
26
|
-
**Importante 2**: lerna no permite instalar de a varias dependencias a la vez como lo hace npm, por lo tanto, si se desea agregar varias dependencias se debe ejecutar el comando anterior tantas veces como dependencias se quiera agregar.
|
|
27
|
-
|
|
1
|
+
# Initiator
|
|
2
|
+
|
|
3
|
+
Este package se creó con la única utilidad de copiarlo entero y pegarlo a la hora de crear un nuevo package.
|
|
4
|
+
|
|
5
|
+
Este iniciador permite crear un paquete que compila typescript y puede ser importado desde otros packages.
|
|
6
|
+
|
|
7
|
+
## IMPORTANTE
|
|
8
|
+
|
|
9
|
+
Los archivos **tsconfig.json** y **tsup.config.ts** no son archivos únicos sino symlinks a archivos de configuración comunes a todos los packages. En caso de que sea necesario modificar alguno de ellos **que en la gran mayoría de los casos no sería necesario**, es necesario eliminar el archivo a modificar y crear uno nuevo.
|
|
10
|
+
|
|
11
|
+
## Procedimiento
|
|
12
|
+
|
|
13
|
+
- Copiar la carpeta initiator y pegarla con otro nombre dentro de packages.
|
|
14
|
+
- Modificar el package.json:
|
|
15
|
+
- Eliminar la línea ```private: true```.
|
|
16
|
+
- Cambiar la ocurrencia `initiator` por el nombre del nuevo paquete.
|
|
17
|
+
- Agregar los scripts convenientes: dev, build, etc.
|
|
18
|
+
- Ejecutar el comando lerna bootstrap desde la carpeta raíz.
|
|
19
|
+
|
|
20
|
+
Luego de ejecutar estos pasos, el package estaría listo para comenzar a usarse.
|
|
21
|
+
|
|
22
|
+
Este package trae como dependencias por defecto theme-ui y react. Si se desea agregar más dependencias se debe ejecutar el comando ```lerna add --scope="@apia/packageName" dependencyName```. Ejemplo, si creamos un paquete con el nombre @apia/myPackage y queremos agregar lodash como dependencia, ejecutamos el comando ```lerna add --scope="@apia/myPackage" lodash```.
|
|
23
|
+
|
|
24
|
+
**Importante 1**: Dado que estamos desarrollando packages, es importante determinar si las dependencias que vamos a agregar son de tipo dependency o de tipo peerDependency.
|
|
25
|
+
|
|
26
|
+
**Importante 2**: lerna no permite instalar de a varias dependencias a la vez como lo hace npm, por lo tanto, si se desea agregar varias dependencias se debe ejecutar el comando anterior tantas veces como dependencias se quiera agregar.
|
|
27
|
+
|
|
28
28
|
**Importante 3**: React y theme-ui vienen instalados como peerDependencies. En caso de no ser necesarios pueden ser removidos, pero en cualquier caso asegurarse de que estas dependencias no sean instaladas como dependencies puesto que esto causaría comportamientos indeseados en la aplicación.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default, { FunctionComponent } from 'react';
|
|
3
|
+
import { BoxProps } from '@apia/theme';
|
|
4
4
|
import { IconType } from '@meronex/icons';
|
|
5
5
|
import * as _apia_util from '@apia/util';
|
|
6
6
|
import { TApiaFilter, TModify } from '@apia/util';
|
|
@@ -65,8 +65,8 @@ type TResponsiveTableCellRendererProps<RendererPropsType extends Partial<Record<
|
|
|
65
65
|
cell: TResponsiveTableCell<RendererPropsType>;
|
|
66
66
|
column: TResponsiveTableColumn;
|
|
67
67
|
row: TResponsiveTableRow;
|
|
68
|
-
} &
|
|
69
|
-
type TResponsiveTableCellRenderer<RendererPropsType extends Partial<Record<keyof RendererPropsType, unknown>> = Record<string, unknown>> =
|
|
68
|
+
} & React__default.AllHTMLAttributes<HTML>;
|
|
69
|
+
type TResponsiveTableCellRenderer<RendererPropsType extends Partial<Record<keyof RendererPropsType, unknown>> = Record<string, unknown>> = React__default.FunctionComponent<TResponsiveTableCellRendererProps<RendererPropsType>>;
|
|
70
70
|
/**
|
|
71
71
|
* Algunos elementos de la tabla admiten un
|
|
72
72
|
* Renderer personalizado. Dichos elementos
|
|
@@ -110,8 +110,8 @@ type TResponsiveTableCell<RendererPropsType extends Partial<Record<keyof Rendere
|
|
|
110
110
|
type TResponsiveTableRowRendererProps<RendererPropsType extends Partial<Record<keyof RendererPropsType, unknown>> = Record<string, unknown>> = {
|
|
111
111
|
row: TResponsiveTableRow<RendererPropsType>;
|
|
112
112
|
rowIndex: number;
|
|
113
|
-
} &
|
|
114
|
-
type TResponsiveTableRowRenderer<RendererPropsType extends Partial<Record<keyof RendererPropsType, unknown>> = Record<string, unknown>> =
|
|
113
|
+
} & React__default.AllHTMLAttributes<HTMLTableRowElement>;
|
|
114
|
+
type TResponsiveTableRowRenderer<RendererPropsType extends Partial<Record<keyof RendererPropsType, unknown>> = Record<string, unknown>> = React__default.FunctionComponent<TResponsiveTableRowRendererProps<RendererPropsType>>;
|
|
115
115
|
type TResponsiveTableRow<RendererPropsType extends Partial<Record<keyof RendererPropsType, unknown>> = Record<string, unknown>> = TBasicRow & TColoredElement & {
|
|
116
116
|
cells: TResponsiveTableCell[];
|
|
117
117
|
/**
|
|
@@ -150,7 +150,7 @@ type TResponsiveTableColumn = TResponsiveTableWithRendererElement & {
|
|
|
150
150
|
* Determina si la columna admite ordenamiento.
|
|
151
151
|
*/
|
|
152
152
|
allowSorting?: boolean;
|
|
153
|
-
children?:
|
|
153
|
+
children?: React__default.ReactNode;
|
|
154
154
|
/**
|
|
155
155
|
* Cuando la columna admite ordenamiento, muestra
|
|
156
156
|
* una flecha indicando el orden actual. Esta
|
|
@@ -261,7 +261,7 @@ type TResponsiveTableContextProps = TResponsiveTableStoreProps & Pick<ISelectabl
|
|
|
261
261
|
* en true**, este comportamiento es deshabilitado.
|
|
262
262
|
*/
|
|
263
263
|
avoidReparseSelectionOnRowChange?: boolean;
|
|
264
|
-
children?:
|
|
264
|
+
children?: React__default.ReactNode;
|
|
265
265
|
className?: string;
|
|
266
266
|
/**
|
|
267
267
|
* Permite redefinir el comportamiento de los breakpoints pasando un índice
|
|
@@ -314,6 +314,11 @@ type TResponsiveTableContext = TModify<Pick<TResponsiveTableContextProps, 'curre
|
|
|
314
314
|
labels: typeof defaultLabels;
|
|
315
315
|
name: string;
|
|
316
316
|
}>;
|
|
317
|
+
declare global {
|
|
318
|
+
interface Window {
|
|
319
|
+
FINDER_NO_DATA: string;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
317
322
|
declare const defaultLabels: {
|
|
318
323
|
noRegisters: string;
|
|
319
324
|
};
|
|
@@ -350,7 +355,7 @@ interface INewFocus {
|
|
|
350
355
|
* de un evento de teclado.
|
|
351
356
|
*/
|
|
352
357
|
type THandleKey = {
|
|
353
|
-
ev:
|
|
358
|
+
ev: React__default.KeyboardEvent;
|
|
354
359
|
};
|
|
355
360
|
/**
|
|
356
361
|
* Son los elementos mínimos que toda columna debe
|
|
@@ -476,9 +481,9 @@ interface ISelectableState<ColumnType extends IBasicColumn = IBasicColumn, Filte
|
|
|
476
481
|
statesColumns: number;
|
|
477
482
|
}
|
|
478
483
|
|
|
479
|
-
declare const ResponsiveTable:
|
|
484
|
+
declare const ResponsiveTable: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<BoxProps & React__default.RefAttributes<HTMLDivElement>>>;
|
|
480
485
|
|
|
481
|
-
declare const ResponsiveTableContext:
|
|
486
|
+
declare const ResponsiveTableContext: React__default.MemoExoticComponent<({ allowEdition, allowRowsKeyboardSorting, allowSelection, allowSorting, avoidReparseSelectionOnRowChange, children, className, currentBreakPoint, customLabels, columns, filters, rows, label, isMultiple, name, onChangeSelection, onFilterBlur, onFilterChange, onFilterPressEnter, onSelectRows, onSortChange, reserveColumnsForStates, variant, }: TResponsiveTableContextProps) => React__default.JSX.Element>;
|
|
482
487
|
|
|
483
488
|
declare const responsiveTableStore: redux.Store<redux.CombinedState<{
|
|
484
489
|
responsiveTableSlice: TResponsiveTableSlice;
|
|
@@ -554,21 +559,21 @@ interface IAccordionElement {
|
|
|
554
559
|
row: TResponsiveTableRow;
|
|
555
560
|
rowIndex: number;
|
|
556
561
|
}
|
|
557
|
-
declare const AccordionElement: ({ row, rowIndex }: IAccordionElement) =>
|
|
562
|
+
declare const AccordionElement: React__default.MemoExoticComponent<({ row, rowIndex }: IAccordionElement) => React__default.JSX.Element | null>;
|
|
558
563
|
|
|
559
564
|
declare const AccordionHTMLCellRenderer: TAccordionCellRenderer<{
|
|
560
565
|
html: string;
|
|
561
566
|
}>;
|
|
562
567
|
|
|
563
|
-
declare const AccordionRenderer:
|
|
568
|
+
declare const AccordionRenderer: React__default.MemoExoticComponent<() => React__default.JSX.Element>;
|
|
564
569
|
|
|
565
|
-
declare const AdditionalColumnDefaultRenderer:
|
|
570
|
+
declare const AdditionalColumnDefaultRenderer: React__default.MemoExoticComponent<({ column, cell, }: TResponsiveTableCellRendererProps) => React__default.JSX.Element>;
|
|
566
571
|
|
|
567
|
-
declare const DefaultCellRenderer:
|
|
572
|
+
declare const DefaultCellRenderer: React__default.ForwardRefExoticComponent<{
|
|
568
573
|
cell: TResponsiveTableCell<Record<string, unknown>>;
|
|
569
574
|
column: TResponsiveTableColumn;
|
|
570
575
|
row: TResponsiveTableRow<Record<string, unknown>>;
|
|
571
|
-
} &
|
|
576
|
+
} & React__default.AllHTMLAttributes<HTMLTableCellElement> & React__default.RefAttributes<HTMLTableCellElement>>;
|
|
572
577
|
|
|
573
578
|
declare const DefaultRowRenderer: TResponsiveTableRowRenderer<Record<string, unknown>>;
|
|
574
579
|
|
|
@@ -576,7 +581,7 @@ declare const HTMLCellRenderer: TResponsiveTableCellRenderer<{
|
|
|
576
581
|
html: string;
|
|
577
582
|
}>;
|
|
578
583
|
|
|
579
|
-
declare const IsLoadingRenderer: () =>
|
|
584
|
+
declare const IsLoadingRenderer: () => React.JSX.Element;
|
|
580
585
|
|
|
581
586
|
declare function makeAccordionAsyncRenderer(additionalInfoGetter: (row: TResponsiveTableRow) => Promise<{
|
|
582
587
|
label?: string;
|
|
@@ -589,7 +594,7 @@ declare function makeAsyncRenderer(additionalInfoGetter: (row: TResponsiveTableR
|
|
|
589
594
|
newline?: boolean;
|
|
590
595
|
}[]>): TResponsiveTableCellRenderer<Record<string, unknown>>;
|
|
591
596
|
|
|
592
|
-
declare const NoRegistersRenderer: () =>
|
|
597
|
+
declare const NoRegistersRenderer: () => React.JSX.Element;
|
|
593
598
|
|
|
594
599
|
declare const PriorityAccordionRenderer: TAccordionCellRenderer<Record<string, unknown>>;
|
|
595
600
|
|
|
@@ -598,9 +603,9 @@ declare const PriorityRenderer: TResponsiveTableCellRenderer<{
|
|
|
598
603
|
src: string;
|
|
599
604
|
}>;
|
|
600
605
|
|
|
601
|
-
declare const RowStatesRenderer:
|
|
606
|
+
declare const RowStatesRenderer: React__default.MemoExoticComponent<({ state, }: {
|
|
602
607
|
state: TResponsiveTableRowState;
|
|
603
|
-
}) =>
|
|
608
|
+
}) => React__default.JSX.Element>;
|
|
604
609
|
|
|
605
610
|
declare const StatusAccordionRenderer: TAccordionCellRenderer<Record<string, unknown>>;
|
|
606
611
|
|
|
@@ -609,6 +614,6 @@ declare const StatusRenderer: TResponsiveTableCellRenderer<{
|
|
|
609
614
|
src: string;
|
|
610
615
|
}>;
|
|
611
616
|
|
|
612
|
-
declare const TableRenderer:
|
|
617
|
+
declare const TableRenderer: React__default.MemoExoticComponent<() => React__default.JSX.Element>;
|
|
613
618
|
|
|
614
619
|
export { AccordionCell, AccordionDocNameCellRenderer, AccordionElement, AccordionHTMLCellRenderer, AccordionRenderer, AdditionalColumnDefaultRenderer, DefaultCellRenderer, DefaultRowRenderer, DocNameCellRenderer, HTMLCellRenderer, IAccordionElement, IsLoadingRenderer, NoRegistersRenderer, PriorityAccordionRenderer, PriorityRenderer, ResponsiveTable, ResponsiveTableContext, RowStatesRenderer, StatusAccordionRenderer, StatusRenderer, TAccordionCellRenderer, TAccordionCellRendererProps, TColoredElement, TDocNameCellRenderer, TDocNameCellRendererProps, TResponsiveTableCell, TResponsiveTableCellRenderer, TResponsiveTableCellRendererProps, TResponsiveTableColumn, TResponsiveTableContext, TResponsiveTableContextProps, TResponsiveTableRow, TResponsiveTableRowRenderer, TResponsiveTableRowRendererProps, TResponsiveTableRowState, TResponsiveTableRowsSelectionEvent, TResponsiveTableSortChangeEvent, TResponsiveTableSortValue, TResponsiveTableStoreProps, TResponsiveTableWithRendererElement, TableRenderer, defaultLabels, getPriorityHandler, getStatusRendererClassName, makeAccordionAsyncRenderer, makeAsyncRenderer, responsiveTableActions, responsiveTableStore, useResponsiveTable };
|