@teselagen/ui 0.5.23 → 0.6.1-beta.1

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 (43) hide show
  1. package/DataTable/ColumnFilterMenu.d.ts +2 -1
  2. package/DataTable/Columns.d.ts +51 -0
  3. package/DataTable/EditabelCell.d.ts +2 -5
  4. package/DataTable/EditableCell.d.ts +7 -0
  5. package/DataTable/RenderCell.d.ts +18 -0
  6. package/DataTable/ThComponent.d.ts +9 -0
  7. package/DataTable/utils/handleCopyTable.d.ts +1 -0
  8. package/DataTable/utils/index.d.ts +4 -2
  9. package/DataTable/utils/primarySelectedValue.d.ts +1 -0
  10. package/DataTable/utils/removeCleanRows.d.ts +1 -1
  11. package/DataTable/utils/useDeepEqualMemo.d.ts +1 -0
  12. package/DataTable/utils/useTableEntities.d.ts +5 -0
  13. package/DataTable/utils/useTableParams.d.ts +49 -0
  14. package/FormComponents/AbstractField.d.ts +1 -0
  15. package/index.cjs.js +12540 -11335
  16. package/index.es.js +12540 -11335
  17. package/package.json +3 -3
  18. package/src/DataTable/ColumnFilterMenu.js +23 -21
  19. package/src/DataTable/Columns.js +948 -0
  20. package/src/DataTable/Columns.jsx +945 -0
  21. package/src/DataTable/EditabelCell.js +7 -18
  22. package/src/DataTable/EditabelCell.jsx +44 -0
  23. package/src/DataTable/EditableCell.js +44 -0
  24. package/src/DataTable/RenderCell.js +191 -0
  25. package/src/DataTable/RenderCell.jsx +191 -0
  26. package/src/DataTable/ThComponent.js +44 -0
  27. package/src/DataTable/utils/handleCopyTable.js +16 -0
  28. package/src/DataTable/utils/index.js +7 -3
  29. package/src/DataTable/utils/primarySelectedValue.js +1 -0
  30. package/src/DataTable/utils/removeCleanRows.js +3 -3
  31. package/src/DataTable/utils/useDeepEqualMemo.js +10 -0
  32. package/src/DataTable/utils/useTableEntities.js +38 -0
  33. package/src/DataTable/utils/useTableParams.js +362 -0
  34. package/src/FormComponents/AbstractField.js +388 -0
  35. package/src/utils/hooks/index.js +1 -0
  36. package/src/utils/hooks/useDeepEqualMemo.js +10 -0
  37. package/src/utils/hooks/useStableReference.js +9 -0
  38. package/src/utils/useTraceUpdate.js +19 -0
  39. package/utils/hooks/index.d.ts +1 -0
  40. package/utils/hooks/useDeepEqualMemo.d.ts +1 -0
  41. package/utils/hooks/useStableReference.d.ts +1 -0
  42. package/utils/useTraceUpdate.d.ts +1 -0
  43. package/src/ExcelCell.js +0 -38
@@ -1,4 +1,4 @@
1
- export function ColumnFilterMenu({ addFilters, compact, currentFilter, currentParams, dataType, extraCompact, filterActiveForColumn, FilterMenu, filterOn, removeSingleFilter, schemaForField, setNewParams }: {
1
+ export function ColumnFilterMenu({ addFilters, compact, currentFilter, currentParams, dataType, extraCompact, filterActiveForColumn, FilterMenu, filterOn, removeSingleFilter, schemaForField, setNewParams, formName }: {
2
2
  addFilters: any;
3
3
  compact: any;
4
4
  currentFilter: any;
@@ -11,4 +11,5 @@ export function ColumnFilterMenu({ addFilters, compact, currentFilter, currentPa
11
11
  removeSingleFilter: any;
12
12
  schemaForField: any;
13
13
  setNewParams: any;
14
+ formName: any;
14
15
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,51 @@
1
+ export function useColumns({ addFilters, cellRenderer, columns, currentParams, compact, editingCell, editingCellSelectAll, entities, expandedEntityIdMap, extraCompact, filters, formName, getCellHoverText, isCellEditable, isEntityDisabled, isLocalCall, isSimple, isSingleSelect, isSelectionARectangle, noDeselectAll, noSelect, noUserSelect, onDeselect, onMultiRowSelect, onRowClick, onRowSelect, onSingleRowSelect, order, primarySelectedCellId, reduxFormCellValidation, reduxFormSelectedEntityIdMap, refocusTable, removeSingleFilter, schema, selectedCells, setExpandedEntityIdMap, setNewParams, setOrder, setSelectedCells, shouldShowSubComponent, startCellEdit, SubComponent, tableRef, updateEntitiesHelper, updateValidation, withCheckboxes, withExpandAndCollapseAllButton, withFilter: _withFilter, withSort }: {
2
+ addFilters: any;
3
+ cellRenderer: any;
4
+ columns: any;
5
+ currentParams: any;
6
+ compact: any;
7
+ editingCell: any;
8
+ editingCellSelectAll: any;
9
+ entities: any;
10
+ expandedEntityIdMap: any;
11
+ extraCompact: any;
12
+ filters: any;
13
+ formName: any;
14
+ getCellHoverText: any;
15
+ isCellEditable: any;
16
+ isEntityDisabled: any;
17
+ isLocalCall: any;
18
+ isSimple: any;
19
+ isSingleSelect: any;
20
+ isSelectionARectangle: any;
21
+ noDeselectAll: any;
22
+ noSelect: any;
23
+ noUserSelect: any;
24
+ onDeselect: any;
25
+ onMultiRowSelect: any;
26
+ onRowClick: any;
27
+ onRowSelect: any;
28
+ onSingleRowSelect: any;
29
+ order: any;
30
+ primarySelectedCellId: any;
31
+ reduxFormCellValidation: any;
32
+ reduxFormSelectedEntityIdMap: any;
33
+ refocusTable: any;
34
+ removeSingleFilter?: ((...args: any[]) => void) | undefined;
35
+ schema: any;
36
+ selectedCells: any;
37
+ setExpandedEntityIdMap: any;
38
+ setNewParams: any;
39
+ setOrder?: ((...args: any[]) => void) | undefined;
40
+ setSelectedCells: any;
41
+ shouldShowSubComponent: any;
42
+ startCellEdit: any;
43
+ SubComponent: any;
44
+ tableRef: any;
45
+ updateEntitiesHelper: any;
46
+ updateValidation: any;
47
+ withCheckboxes: any;
48
+ withExpandAndCollapseAllButton: any;
49
+ withFilter: any;
50
+ withSort?: boolean | undefined;
51
+ }): any;
@@ -1,10 +1,7 @@
1
- export function EditableCell({ cancelEdit, dataTest, finishEdit, initialValue, isEditableCellInitialValue, isNumeric, shouldSelectAll, stopSelectAll }: {
1
+ export function EditableCell({ cancelEdit, dataTest, finishEdit, isNumeric, initialValue }: {
2
2
  cancelEdit: any;
3
3
  dataTest: any;
4
4
  finishEdit: any;
5
- initialValue: any;
6
- isEditableCellInitialValue: any;
7
5
  isNumeric: any;
8
- shouldSelectAll: any;
9
- stopSelectAll: any;
6
+ initialValue: any;
10
7
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ export function EditableCell({ cancelEdit, dataTest, finishEdit, isNumeric, initialValue }: {
2
+ cancelEdit: any;
3
+ dataTest: any;
4
+ finishEdit: any;
5
+ isNumeric: any;
6
+ initialValue: any;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,18 @@
1
+ export function RenderCell({ oldFunc, getCopyTextForCell, column, isCellEditable, isEntityDisabled, finishCellEdit, formName, noEllipsis, cancelCellEdit, getCellHoverText, selectedCells, isSelectionARectangle, startCellEdit, tableRef, onDragEnd, args }: {
2
+ oldFunc: any;
3
+ getCopyTextForCell: any;
4
+ column: any;
5
+ isCellEditable: any;
6
+ isEntityDisabled: any;
7
+ finishCellEdit: any;
8
+ formName: any;
9
+ noEllipsis: any;
10
+ cancelCellEdit: any;
11
+ getCellHoverText: any;
12
+ selectedCells: any;
13
+ isSelectionARectangle: any;
14
+ startCellEdit: any;
15
+ tableRef: any;
16
+ onDragEnd: any;
17
+ args: any;
18
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export function ThComponent({ toggleSort, immovable, className, children, style, columnindex, ...rest }: {
2
+ [x: string]: any;
3
+ toggleSort: any;
4
+ immovable: any;
5
+ className: any;
6
+ children: any;
7
+ style: any;
8
+ columnindex: any;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export function handleCopyTable(e: any, opts: any): void;
@@ -1,4 +1,3 @@
1
- import { default as computePresets } from './computePresets';
2
1
  import { defaultParsePaste, getEntityIdToEntity, getFieldPathToIndex, getNumberStrAtEnd, stripNumberAtEnd } from './utils';
3
2
  import { formatPasteData } from './formatPasteData';
4
3
  import { getAllRows } from './getAllRows';
@@ -14,8 +13,11 @@ import { getSelectedRowsFromEntities } from './selection';
14
13
  import { handleCopyColumn } from './handleCopyColumn';
15
14
  import { handleCopyHelper } from './handleCopyHelper';
16
15
  import { handleCopyRows } from './handleCopyRows';
16
+ import { handleCopyTable } from './handleCopyTable';
17
17
  import { isBottomRightCornerOfRectangle } from './isBottomRightCornerOfRectangle';
18
18
  import { isEntityClean } from './isEntityClean';
19
+ import { PRIMARY_SELECTED_VAL } from './primarySelectedValue';
19
20
  import { removeCleanRows } from './removeCleanRows';
21
+ import { useTableEntities } from './useTableEntities';
20
22
 
21
- export { computePresets, defaultParsePaste, formatPasteData, getAllRows, getCellCopyText, getCellInfo, getEntityIdToEntity, getFieldPathToIndex, getFieldPathToField, getIdOrCodeOrIndex, getLastSelectedEntity, getNewEntToSelect, getNumberStrAtEnd, getRecordsFromIdMap, getRowCopyText, getSelectedRowsFromEntities, handleCopyColumn, handleCopyHelper, handleCopyRows, isBottomRightCornerOfRectangle, isEntityClean, removeCleanRows, stripNumberAtEnd };
23
+ export { defaultParsePaste, formatPasteData, getAllRows, getCellCopyText, getCellInfo, getEntityIdToEntity, getFieldPathToIndex, getFieldPathToField, getIdOrCodeOrIndex, getLastSelectedEntity, getNewEntToSelect, getNumberStrAtEnd, getRecordsFromIdMap, getRowCopyText, getSelectedRowsFromEntities, handleCopyColumn, handleCopyHelper, handleCopyRows, handleCopyTable, isBottomRightCornerOfRectangle, isEntityClean, PRIMARY_SELECTED_VAL, removeCleanRows, stripNumberAtEnd, useTableEntities };
@@ -0,0 +1 @@
1
+ export const PRIMARY_SELECTED_VAL: "main_cell";
@@ -1,4 +1,4 @@
1
- export function removeCleanRows(reduxFormEntities: any, reduxFormCellValidation: any): {
1
+ export function removeCleanRows(entities: any, cellValidation: any): {
2
2
  entsToUse: any;
3
3
  validationToUse: {};
4
4
  };
@@ -0,0 +1 @@
1
+ export function useDeepEqualMemo(value: any): undefined;
@@ -0,0 +1,5 @@
1
+ export function useTableEntities(tableFormName: any): {
2
+ selectTableEntities: (entities?: any[]) => void;
3
+ allOrderedEntities: any;
4
+ selectedEntities: any;
5
+ };
@@ -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
+ };
@@ -0,0 +1 @@
1
+ export function withAbstractWrapper(ComponentToWrap: any, opts?: {}): (props: any) => import("react/jsx-runtime").JSX.Element;