@teselagen/ui 0.8.6-beta.24 → 0.8.6-beta.26

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 (56) hide show
  1. package/DataTable/utils/formatPasteData.d.ts +11 -5
  2. package/DataTable/utils/getAllRows.d.ts +4 -1
  3. package/DataTable/utils/getCellCopyText.d.ts +1 -1
  4. package/DataTable/utils/getCellInfo.d.ts +20 -15
  5. package/DataTable/utils/getFieldPathToField.d.ts +5 -1
  6. package/DataTable/utils/getIdOrCodeOrIndex.d.ts +2 -1
  7. package/DataTable/utils/getLastSelectedEntity.d.ts +7 -1
  8. package/DataTable/utils/getNewEntToSelect.d.ts +7 -6
  9. package/DataTable/utils/getRowCopyText.d.ts +1 -1
  10. package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +22 -1
  11. package/DataTable/utils/types/Entity.d.ts +5 -0
  12. package/DataTable/utils/types/Field.d.ts +4 -0
  13. package/DataTable/utils/types/OrderBy.d.ts +11 -0
  14. package/DataTable/utils/types/Schema.d.ts +4 -0
  15. package/DataTable/utils/utils.d.ts +16 -5
  16. package/MenuBar/index.d.ts +3 -1
  17. package/Timeline/TimelineEvent.d.ts +7 -4
  18. package/Timeline/index.d.ts +5 -1
  19. package/index.cjs.js +1638 -1806
  20. package/index.d.ts +0 -1
  21. package/index.es.js +1638 -1806
  22. package/package.json +3 -3
  23. package/src/DataTable/utils/formatPasteData.ts +34 -0
  24. package/src/DataTable/utils/getAllRows.ts +11 -0
  25. package/src/DataTable/utils/getCellCopyText.ts +7 -0
  26. package/src/DataTable/utils/getCellInfo.ts +46 -0
  27. package/src/DataTable/utils/getFieldPathToField.ts +10 -0
  28. package/src/DataTable/utils/getIdOrCodeOrIndex.ts +14 -0
  29. package/src/DataTable/utils/getLastSelectedEntity.ts +15 -0
  30. package/src/DataTable/utils/getNewEntToSelect.ts +32 -0
  31. package/src/DataTable/utils/initializeHasuraWhereAndFilter.ts +35 -0
  32. package/src/DataTable/utils/types/Entity.ts +7 -0
  33. package/src/DataTable/utils/types/Field.ts +4 -0
  34. package/src/DataTable/utils/types/OrderBy.ts +15 -0
  35. package/src/DataTable/utils/types/Schema.ts +5 -0
  36. package/src/DataTable/utils/utils.ts +39 -0
  37. package/src/Timeline/TimelineEvent.tsx +36 -0
  38. package/src/Timeline/index.tsx +21 -0
  39. package/src/index.js +0 -1
  40. package/src/utils/browserUtils.ts +3 -0
  41. package/src/utils/determineBlackOrWhiteTextColor.ts +11 -0
  42. package/src/utils/getTextFromEl.ts +45 -0
  43. package/src/utils/handlerHelpers.ts +32 -0
  44. package/src/utils/hooks/index.ts +1 -0
  45. package/src/utils/hooks/useDeepEqualMemo.ts +10 -0
  46. package/src/utils/hooks/useStableReference.ts +9 -0
  47. package/src/utils/hotkeyUtils.tsx +155 -0
  48. package/src/utils/isBeingCalledExcessively.ts +37 -0
  49. package/utils/browserUtils.d.ts +1 -1
  50. package/utils/determineBlackOrWhiteTextColor.d.ts +1 -1
  51. package/utils/getTextFromEl.d.ts +8 -1
  52. package/utils/handlerHelpers.d.ts +7 -7
  53. package/utils/hooks/useDeepEqualMemo.d.ts +1 -2
  54. package/utils/hooks/useStableReference.d.ts +1 -1
  55. package/utils/hotkeyUtils.d.ts +21 -4
  56. package/utils/isBeingCalledExcessively.d.ts +3 -3
@@ -1,5 +1,11 @@
1
- export function formatPasteData({ schema, newVal, path }: {
2
- schema: any;
3
- newVal: any;
4
- path: any;
5
- }): any;
1
+ import { Schema } from './types/Schema';
2
+ type GenericSelectValue = {
3
+ __strVal: string;
4
+ __genSelCol: string;
5
+ };
6
+ export declare const formatPasteData: ({ schema, newVal, path }: {
7
+ schema: Schema;
8
+ newVal: GenericSelectValue | string | number | boolean | null | undefined;
9
+ path: string;
10
+ }) => string | number | boolean | null | undefined;
11
+ export {};
@@ -1 +1,4 @@
1
- export function getAllRows(tableRef: any): any;
1
+ import { RefObject } from '../../../../../node_modules/react';
2
+ export declare const getAllRows: (tableRef: RefObject<{
3
+ tableRef: HTMLDivElement;
4
+ }>) => NodeListOf<Element> | undefined;
@@ -1 +1 @@
1
- export function getCellCopyText(cellWrapper: any): any[];
1
+ export declare const getCellCopyText: (cellWrapper: HTMLElement | null) => (string | null | undefined)[];
@@ -1,17 +1,22 @@
1
- export function getCellInfo({ columnIndex, columnPath, rowId, schema, entities, rowIndex, isEntityDisabled, entity }: {
2
- columnIndex: any;
3
- columnPath: any;
4
- rowId: any;
5
- schema: any;
6
- entities: any;
7
- rowIndex: any;
8
- isEntityDisabled: any;
9
- entity: any;
10
- }): {
1
+ import { Entity } from './types/Entity';
2
+ export declare const getCellInfo: <T extends Entity>({ columnIndex, columnPath, rowId, schema, entities, rowIndex, isEntityDisabled, entity }: {
3
+ columnIndex: number;
4
+ columnPath: string;
5
+ rowId: string | number;
6
+ schema: {
7
+ fields: {
8
+ path: string;
9
+ }[];
10
+ };
11
+ entities: T[];
12
+ rowIndex: number;
13
+ isEntityDisabled: (entity: T) => boolean;
14
+ entity: T;
15
+ }) => {
11
16
  cellId: string;
12
- cellIdAbove: any;
13
- cellIdToRight: any;
14
- cellIdBelow: any;
15
- cellIdToLeft: any;
16
- rowDisabled: any;
17
+ cellIdAbove: string | 0;
18
+ cellIdToRight: string;
19
+ cellIdBelow: string | 0;
20
+ cellIdToLeft: string;
21
+ rowDisabled: boolean;
17
22
  };
@@ -1 +1,5 @@
1
- export function getFieldPathToField(schema: any): {};
1
+ import { Field } from './types/Field';
2
+ import { Schema } from './types/Schema';
3
+ export declare const getFieldPathToField: (schema: Schema) => {
4
+ [path: string]: Field;
5
+ };
@@ -1 +1,2 @@
1
- export function getIdOrCodeOrIndex(record: any, rowIndex: any): any;
1
+ import { Entity } from './types/Entity';
2
+ export declare const getIdOrCodeOrIndex: (record: Entity, rowIndex?: number) => string | number;
@@ -1 +1,7 @@
1
- export function getLastSelectedEntity(idMap: any): undefined;
1
+ import { Entity } from './types/Entity';
2
+ export declare const getLastSelectedEntity: (idMap: {
3
+ [id: string]: {
4
+ time: number;
5
+ entity: Entity;
6
+ };
7
+ }) => undefined;
@@ -1,6 +1,7 @@
1
- export function getNewEntToSelect({ type, lastSelectedIndex, entities, isEntityDisabled }: {
2
- type: any;
3
- lastSelectedIndex: any;
4
- entities: any;
5
- isEntityDisabled: any;
6
- }): any;
1
+ import { Entity } from './types/Entity';
2
+ export declare const getNewEntToSelect: ({ type, lastSelectedIndex, entities, isEntityDisabled }: {
3
+ type: "up" | "down";
4
+ lastSelectedIndex: number;
5
+ entities: Entity[];
6
+ isEntityDisabled?: (entity: Entity) => boolean;
7
+ }) => Entity | undefined;
@@ -1 +1 @@
1
- export function getRowCopyText(rowEl: any, { specificColumn }?: {}): (string | any[])[];
1
+ export function getRowCopyText(rowEl: any, { specificColumn }?: {}): (string | (string | null | undefined)[])[];
@@ -1 +1,22 @@
1
- export function initializeHasuraWhereAndFilter(additionalFilter: any, where: {} | undefined, currentParams: any): void;
1
+ type Filter = {
2
+ [key: string]: {
3
+ _eq: string | number | boolean;
4
+ } | {
5
+ _in: (string | number | boolean)[];
6
+ } | {
7
+ _gt: number;
8
+ } | {
9
+ _lt: number;
10
+ } | {
11
+ _gte: number;
12
+ } | {
13
+ _lte: number;
14
+ };
15
+ };
16
+ type Where = {
17
+ _and?: Filter[];
18
+ _or?: Filter[];
19
+ };
20
+ type CurrentParams = object;
21
+ export declare function initializeHasuraWhereAndFilter(additionalFilter: ((where: Where, currentParams: CurrentParams) => Filter | void) | Filter | undefined | null, where: Where | undefined, currentParams: CurrentParams): void;
22
+ export {};
@@ -0,0 +1,5 @@
1
+ export type Entity = {
2
+ id?: string | number;
3
+ } | {
4
+ code?: string;
5
+ };
@@ -0,0 +1,4 @@
1
+ export type Field = {
2
+ path: string;
3
+ type: "genericSelect" | string;
4
+ };
@@ -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,4 @@
1
+ import { Field } from './Field';
2
+ export type Schema = {
3
+ fields: Field[];
4
+ };
@@ -1,5 +1,16 @@
1
- export function getFieldPathToIndex(schema: any): {};
2
- export function defaultParsePaste(str: any): any;
3
- export function getEntityIdToEntity(entities: any): {};
4
- export function getNumberStrAtEnd(str: any): any;
5
- export function stripNumberAtEnd(str: any): any;
1
+ import { Entity } from './types/Entity';
2
+ import { Field } from './types/Field';
3
+ export declare const getFieldPathToIndex: (schema: {
4
+ fields: Field[];
5
+ }) => {
6
+ [path: string]: number;
7
+ };
8
+ export declare const defaultParsePaste: (str: string) => string[][];
9
+ export declare const getEntityIdToEntity: (entities: Entity[]) => {
10
+ [id: string]: {
11
+ e: Entity;
12
+ i: number;
13
+ };
14
+ };
15
+ export declare const getNumberStrAtEnd: (str: string) => string | null | undefined;
16
+ export declare const stripNumberAtEnd: (str: string) => string;
@@ -6,7 +6,9 @@ declare class MenuBar extends React.Component<any, any, any> {
6
6
  style: {};
7
7
  };
8
8
  constructor(props: any);
9
- hotkeyEnabler: ({ children }?: {}) => import("react/jsx-runtime").JSX.Element;
9
+ hotkeyEnabler: ({ children }?: {
10
+ children?: React.ReactElement;
11
+ }) => import("react/jsx-runtime").JSX.Element;
10
12
  state: {
11
13
  isOpen: boolean;
12
14
  openIndex: null;
@@ -1,5 +1,8 @@
1
+ import { default as React } from '../../../../node_modules/react';
2
+ import { default as dayjs } from 'dayjs';
3
+ interface TimelineEventProps {
4
+ date: string | number | Date | dayjs.Dayjs;
5
+ children?: React.ReactNode;
6
+ }
7
+ declare function TimelineEvent({ date, children }: TimelineEventProps): import("react/jsx-runtime").JSX.Element;
1
8
  export default TimelineEvent;
2
- declare function TimelineEvent({ date, children }: {
3
- date: any;
4
- children: any;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,7 @@
1
+ import { ReactNode, FC } from '../../../../node_modules/react';
2
+ interface TimelineProps {
3
+ children: ReactNode;
4
+ }
5
+ declare const Timeline: FC<TimelineProps>;
1
6
  export { default as TimelineEvent } from './TimelineEvent';
2
7
  export default Timeline;
3
- declare function Timeline(props: any): import("react/jsx-runtime").JSX.Element;