@teselagen/ui 0.9.5 → 0.9.7
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/DataTable/EditabelCell.d.ts +7 -0
- package/DataTable/ReactTable.d.ts +78 -0
- package/DataTable/defaultProps.d.ts +43 -0
- package/DataTable/index.d.ts +3 -3
- package/DataTable/utils/computePresets.d.ts +1 -0
- package/DataTable/utils/types/Entity.d.ts +9 -0
- package/DataTable/utils/types/Field.d.ts +4 -0
- package/DataTable/utils/types/OrderBy.d.ts +11 -0
- package/DataTable/utils/types/Schema.d.ts +4 -0
- package/DataTable/utils/useDeepEqualMemo.d.ts +1 -0
- package/DataTable/utils/useHotKeysWrapper.d.ts +29 -0
- package/DataTable/utils/useTableParams.d.ts +49 -0
- package/README.md +6 -2
- package/index.cjs.js +22410 -22287
- package/index.es.js +22462 -22339
- package/package.json +1 -2
- package/src/AdvancedOptions.spec.js +8 -23
- package/src/DataTable/Columns.jsx +945 -0
- package/src/DataTable/EditabelCell.js +44 -0
- package/src/DataTable/EditabelCell.jsx +44 -0
- package/src/DataTable/PagingTool.js +2 -2
- package/src/DataTable/ReactTable.js +738 -0
- package/src/DataTable/RenderCell.jsx +191 -0
- package/src/DataTable/defaultProps.js +45 -0
- package/src/DataTable/index.js +217 -1203
- package/src/DataTable/utils/computePresets.js +42 -0
- package/src/DataTable/utils/convertSchema.ts +79 -0
- package/src/DataTable/utils/formatPasteData.ts +34 -0
- package/src/DataTable/utils/getAllRows.ts +11 -0
- package/src/DataTable/utils/getCellCopyText.ts +7 -0
- package/src/DataTable/utils/getCellInfo.ts +46 -0
- package/src/DataTable/utils/getFieldPathToField.ts +10 -0
- package/src/DataTable/utils/getIdOrCodeOrIndex.ts +14 -0
- package/src/DataTable/utils/getLastSelectedEntity.ts +15 -0
- package/src/DataTable/utils/getNewEntToSelect.ts +32 -0
- package/src/DataTable/utils/initializeHasuraWhereAndFilter.ts +35 -0
- package/src/DataTable/utils/isBottomRightCornerOfRectangle.ts +27 -0
- package/src/DataTable/utils/isEntityClean.ts +15 -0
- package/src/DataTable/utils/primarySelectedValue.ts +1 -0
- package/src/DataTable/utils/removeCleanRows.ts +26 -0
- package/src/DataTable/utils/selection.ts +11 -0
- package/src/DataTable/utils/types/Entity.ts +13 -0
- package/src/DataTable/utils/types/Field.ts +4 -0
- package/src/DataTable/utils/types/OrderBy.ts +15 -0
- package/src/DataTable/utils/types/Schema.ts +5 -0
- package/src/DataTable/utils/useDeepEqualMemo.js +10 -0
- package/src/DataTable/utils/useHotKeysWrapper.js +395 -0
- package/src/DataTable/utils/useTableEntities.ts +60 -0
- package/src/DataTable/utils/useTableParams.js +361 -0
- package/src/DataTable/utils/utils.ts +39 -0
- package/src/DataTable/utils/withTableParams.js +1 -1
- package/src/Timeline/TimelineEvent.tsx +36 -0
- package/src/Timeline/index.tsx +21 -0
- package/src/utils/browserUtils.ts +3 -0
- package/src/utils/determineBlackOrWhiteTextColor.ts +11 -0
- package/src/utils/getTextFromEl.ts +45 -0
- package/src/utils/handlerHelpers.ts +32 -0
- package/src/utils/hooks/index.ts +1 -0
- package/src/utils/hooks/useDeepEqualMemo.ts +10 -0
- package/src/utils/hooks/useStableReference.ts +9 -0
- package/src/utils/hotkeyUtils.tsx +155 -0
- package/src/utils/isBeingCalledExcessively.ts +37 -0
- package/style.css +10537 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export function ReactTable({ addFilters, cellRenderer, change, columns, compact, contextMenu, currentParams, disabled, doNotShowEmptyRows, doNotValidateUntouchedRows, editingCellSelectAll, entities, expandedEntityIdMap, extraCompact, filters, formName, getCellHoverText, getRowClassName, handleCellClick, handleCopySelectedRows, history, insertRows, isCellEditable, isCopyable, isEntityDisabled, isLoading, isLocalCall, isSelectionARectangle, isSimple, isSingleSelect, maxHeight, moveColumnPersist, mustClickCheckboxToSelect, noDeselectAll, noRowsFoundMessage, noSelect, noUserSelect, noVirtual, numRows, onDeselect, onDoubleClick, onlyShowRowsWErrors, onMultiRowSelect, onRowClick, onRowSelect, onSingleRowSelect, order, primarySelectedCellId, ReactTableProps, recordIdToIsVisibleMap, reduxFormCellValidation, reduxFormEditingCell, reduxFormSelectedEntityIdMap, refocusTable, removeSingleFilter, resizePersist, schema, selectedCells, setColumns, setExpandedEntityIdMap, setNewParams, setOrder, setRecordIdToIsVisibleMap, setSelectedCells, shouldShowSubComponent, startCellEdit, style, SubComponent, tableConfig, tableRef, updateEntitiesHelper, updateValidation, withCheckboxes, withExpandAndCollapseAllButton, withFilter, withSort }: {
|
|
2
|
+
addFilters: any;
|
|
3
|
+
cellRenderer: any;
|
|
4
|
+
change: any;
|
|
5
|
+
columns: any;
|
|
6
|
+
compact: any;
|
|
7
|
+
contextMenu: any;
|
|
8
|
+
currentParams: any;
|
|
9
|
+
disabled: any;
|
|
10
|
+
doNotShowEmptyRows: any;
|
|
11
|
+
doNotValidateUntouchedRows: any;
|
|
12
|
+
editingCellSelectAll: any;
|
|
13
|
+
entities: any;
|
|
14
|
+
expandedEntityIdMap: any;
|
|
15
|
+
extraCompact: any;
|
|
16
|
+
filters: any;
|
|
17
|
+
formName: any;
|
|
18
|
+
getCellHoverText: any;
|
|
19
|
+
getRowClassName: any;
|
|
20
|
+
handleCellClick: any;
|
|
21
|
+
handleCopySelectedRows: any;
|
|
22
|
+
history: any;
|
|
23
|
+
insertRows: any;
|
|
24
|
+
isCellEditable: any;
|
|
25
|
+
isCopyable: any;
|
|
26
|
+
isEntityDisabled: any;
|
|
27
|
+
isLoading: any;
|
|
28
|
+
isLocalCall: any;
|
|
29
|
+
isSelectionARectangle: any;
|
|
30
|
+
isSimple: any;
|
|
31
|
+
isSingleSelect: any;
|
|
32
|
+
maxHeight: any;
|
|
33
|
+
moveColumnPersist: any;
|
|
34
|
+
mustClickCheckboxToSelect: any;
|
|
35
|
+
noDeselectAll: any;
|
|
36
|
+
noRowsFoundMessage: any;
|
|
37
|
+
noSelect: any;
|
|
38
|
+
noUserSelect: any;
|
|
39
|
+
noVirtual: any;
|
|
40
|
+
numRows: any;
|
|
41
|
+
onDeselect: any;
|
|
42
|
+
onDoubleClick: any;
|
|
43
|
+
onlyShowRowsWErrors: any;
|
|
44
|
+
onMultiRowSelect: any;
|
|
45
|
+
onRowClick: any;
|
|
46
|
+
onRowSelect: any;
|
|
47
|
+
onSingleRowSelect: any;
|
|
48
|
+
order: any;
|
|
49
|
+
primarySelectedCellId: any;
|
|
50
|
+
ReactTableProps: any;
|
|
51
|
+
recordIdToIsVisibleMap: any;
|
|
52
|
+
reduxFormCellValidation: any;
|
|
53
|
+
reduxFormEditingCell: any;
|
|
54
|
+
reduxFormSelectedEntityIdMap: any;
|
|
55
|
+
refocusTable: any;
|
|
56
|
+
removeSingleFilter: any;
|
|
57
|
+
resizePersist: any;
|
|
58
|
+
schema: any;
|
|
59
|
+
selectedCells: any;
|
|
60
|
+
setColumns: any;
|
|
61
|
+
setExpandedEntityIdMap: any;
|
|
62
|
+
setNewParams: any;
|
|
63
|
+
setOrder: any;
|
|
64
|
+
setRecordIdToIsVisibleMap: any;
|
|
65
|
+
setSelectedCells: any;
|
|
66
|
+
shouldShowSubComponent: any;
|
|
67
|
+
startCellEdit: any;
|
|
68
|
+
style: any;
|
|
69
|
+
SubComponent: any;
|
|
70
|
+
tableConfig: any;
|
|
71
|
+
tableRef: any;
|
|
72
|
+
updateEntitiesHelper: any;
|
|
73
|
+
updateValidation: any;
|
|
74
|
+
withCheckboxes: any;
|
|
75
|
+
withExpandAndCollapseAllButton: any;
|
|
76
|
+
withFilter: any;
|
|
77
|
+
withSort: any;
|
|
78
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { noop } from 'lodash-es';
|
|
2
|
+
declare namespace _default {
|
|
3
|
+
export { noop as addFilters };
|
|
4
|
+
export let className: string;
|
|
5
|
+
export { noop as clearFilters };
|
|
6
|
+
export { noop as contextMenu };
|
|
7
|
+
export let disabled: boolean;
|
|
8
|
+
export let entities: never[];
|
|
9
|
+
export let extraClasses: string;
|
|
10
|
+
export let filters: never[];
|
|
11
|
+
export let isCopyable: boolean;
|
|
12
|
+
export { noop as isEntityDisabled };
|
|
13
|
+
export let isLoading: boolean;
|
|
14
|
+
export let isSimple: boolean;
|
|
15
|
+
export let isSingleSelect: boolean;
|
|
16
|
+
export let maxHeight: number;
|
|
17
|
+
export let noHeader: boolean;
|
|
18
|
+
export let noSelect: boolean;
|
|
19
|
+
export let noUserSelect: boolean;
|
|
20
|
+
export { noop as onDeselect };
|
|
21
|
+
export { noop as onMultiRowSelect };
|
|
22
|
+
export { noop as onRowClick };
|
|
23
|
+
export { noop as onRowSelect };
|
|
24
|
+
export { noop as onSingleRowSelect };
|
|
25
|
+
export let page: number;
|
|
26
|
+
export let pageSize: number;
|
|
27
|
+
export let reduxFormExpandedEntityIdMap: {};
|
|
28
|
+
export let reduxFormSearchInput: string;
|
|
29
|
+
export let reduxFormSelectedEntityIdMap: {};
|
|
30
|
+
export { noop as removeSingleFilter };
|
|
31
|
+
export let resized: never[];
|
|
32
|
+
export { noop as resizePersist };
|
|
33
|
+
export { noop as setFilter };
|
|
34
|
+
export { noop as setOrder };
|
|
35
|
+
export { noop as setPage };
|
|
36
|
+
export { noop as setPageSize };
|
|
37
|
+
export { noop as setSearchTerm };
|
|
38
|
+
export let showCount: boolean;
|
|
39
|
+
export let style: {};
|
|
40
|
+
export let withCheckboxes: boolean;
|
|
41
|
+
export let withSort: boolean;
|
|
42
|
+
}
|
|
43
|
+
export default _default;
|
package/DataTable/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default
|
|
2
|
-
declare
|
|
3
|
-
export
|
|
1
|
+
export default ReduxFormDTWrapper;
|
|
2
|
+
declare function ReduxFormDTWrapper(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export function ConnectedPagingTool(props: any): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function computePresets(props?: {}): import('lodash').Dictionary<any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type OrderByClause<T = {
|
|
2
|
+
id: string;
|
|
3
|
+
}> = {
|
|
4
|
+
path?: string;
|
|
5
|
+
direction?: "asc" | "desc";
|
|
6
|
+
type?: string;
|
|
7
|
+
sortFn?: ((record: T) => unknown) | string | Array<((record: T) => unknown) | string>;
|
|
8
|
+
getValueToFilterOn?: (record: T) => unknown;
|
|
9
|
+
};
|
|
10
|
+
export type OrderBy = OrderByClause | OrderByClause[] | Record<string, "asc" | "desc">;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function useDeepEqualMemo(value: any): undefined;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function useHotKeysWrapper({ change, entities, entitiesUndoRedoStack, formatAndValidateEntities, handleCopySelectedRows, isCellEditable, isEntityDisabled, isSingleSelect, noDeselectAll, noSelect, onDeselect, onMultiRowSelect, onRowSelect, onSingleRowSelect, primarySelectedCellId, reduxFormCellValidation, reduxFormSelectedEntityIdMap, schema, selectedCells, setEntitiesUndoRedoStack, setNoVirtual, setSelectedCells, startCellEdit, tableRef, updateEntitiesHelper, updateValidation, waitUntilAllRowsAreRendered }: {
|
|
2
|
+
change: any;
|
|
3
|
+
entities: any;
|
|
4
|
+
entitiesUndoRedoStack: any;
|
|
5
|
+
formatAndValidateEntities: any;
|
|
6
|
+
handleCopySelectedRows: any;
|
|
7
|
+
isCellEditable: any;
|
|
8
|
+
isEntityDisabled: any;
|
|
9
|
+
isSingleSelect: any;
|
|
10
|
+
noDeselectAll: any;
|
|
11
|
+
noSelect: any;
|
|
12
|
+
onDeselect: any;
|
|
13
|
+
onMultiRowSelect: any;
|
|
14
|
+
onRowSelect: any;
|
|
15
|
+
onSingleRowSelect: any;
|
|
16
|
+
primarySelectedCellId: any;
|
|
17
|
+
reduxFormCellValidation: any;
|
|
18
|
+
reduxFormSelectedEntityIdMap: any;
|
|
19
|
+
schema: any;
|
|
20
|
+
selectedCells: any;
|
|
21
|
+
setEntitiesUndoRedoStack: any;
|
|
22
|
+
setNoVirtual: any;
|
|
23
|
+
setSelectedCells: any;
|
|
24
|
+
startCellEdit: any;
|
|
25
|
+
tableRef: any;
|
|
26
|
+
updateEntitiesHelper: any;
|
|
27
|
+
updateValidation: any;
|
|
28
|
+
waitUntilAllRowsAreRendered: any;
|
|
29
|
+
}): import('../../../../../node_modules/@blueprintjs/core').UseHotkeysReturnValue;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Note all these options can be passed at Design Time or at Runtime (like reduxForm())
|
|
3
|
+
*
|
|
4
|
+
* @export
|
|
5
|
+
*
|
|
6
|
+
* @param {compOrOpts} compOrOpts
|
|
7
|
+
* @typedef {object} compOrOpts
|
|
8
|
+
* @property {*string} formName - required unique identifier for the table
|
|
9
|
+
* @property {Object | Function} schema - The data table schema or a function returning it. The function wll be called with props as the argument.
|
|
10
|
+
* @property {boolean} urlConnected - whether the table should connect to/update the URL
|
|
11
|
+
* @property {boolean} withSelectedEntities - whether or not to pass the selected entities
|
|
12
|
+
* @property {boolean} isCodeModel - whether the model is keyed by code instead of id in the db
|
|
13
|
+
* @property {object} defaults - tableParam defaults such as pageSize, filter, etc
|
|
14
|
+
* @property {boolean} noOrderError - won't console an error if an order is not found on schema
|
|
15
|
+
*/
|
|
16
|
+
export default function useTableParams(props: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* Note all these options can be passed at Design Time or at Runtime (like reduxForm())
|
|
19
|
+
*/
|
|
20
|
+
export type compOrOpts = {
|
|
21
|
+
/**
|
|
22
|
+
* } formName - required unique identifier for the table
|
|
23
|
+
*/
|
|
24
|
+
string: any;
|
|
25
|
+
/**
|
|
26
|
+
* - The data table schema or a function returning it. The function wll be called with props as the argument.
|
|
27
|
+
*/
|
|
28
|
+
schema: Object | Function;
|
|
29
|
+
/**
|
|
30
|
+
* - whether the table should connect to/update the URL
|
|
31
|
+
*/
|
|
32
|
+
urlConnected: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* - whether or not to pass the selected entities
|
|
35
|
+
*/
|
|
36
|
+
withSelectedEntities: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* - whether the model is keyed by code instead of id in the db
|
|
39
|
+
*/
|
|
40
|
+
isCodeModel: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* - tableParam defaults such as pageSize, filter, etc
|
|
43
|
+
*/
|
|
44
|
+
defaults: object;
|
|
45
|
+
/**
|
|
46
|
+
* - won't console an error if an order is not found on schema
|
|
47
|
+
*/
|
|
48
|
+
noOrderError: boolean;
|
|
49
|
+
};
|
package/README.md
CHANGED
|
@@ -4,12 +4,16 @@ This library was generated with [Nx](https://nx.dev).
|
|
|
4
4
|
|
|
5
5
|
## Running unit tests
|
|
6
6
|
|
|
7
|
-
Run `
|
|
7
|
+
Run `bun test` from the root of the repo to execute all unit tests.
|
|
8
|
+
|
|
9
|
+
## Running end-to-end tests locally
|
|
10
|
+
|
|
11
|
+
Run `nx run ui:launch-e2e` to launch the Cypress test runner locally
|
|
8
12
|
|
|
9
13
|
## Installation (react)
|
|
10
14
|
|
|
11
15
|
```
|
|
12
|
-
yarn add @teselagen/
|
|
16
|
+
yarn add @teselagen/ui react react-dom
|
|
13
17
|
```
|
|
14
18
|
|
|
15
19
|
## Running locally
|