@teselagen/ui 0.8.8 → 0.9.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/utils/filterLocalEntitiesToHasura.d.ts +5 -0
  2. package/DataTable/utils/getAllRows.d.ts +1 -1
  3. package/DataTable/utils/getRowCopyText.d.ts +1 -3
  4. package/DataTable/utils/handleCopyColumn.d.ts +1 -1
  5. package/DataTable/utils/handleCopyRows.d.ts +1 -5
  6. package/DataTable/utils/handleCopyTable.d.ts +1 -1
  7. package/DataTable/utils/index.d.ts +0 -1
  8. package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +1 -0
  9. package/DataTable/utils/queryParams.d.ts +16 -12
  10. package/DataTable/utils/rowClick.d.ts +1 -1
  11. package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +26 -0
  12. package/FormComponents/Uploader.d.ts +1 -3
  13. package/FormComponents/tryToMatchSchemas.d.ts +1 -1
  14. package/MenuBar/index.d.ts +1 -3
  15. package/README.md +1 -1
  16. package/ResizableDraggableDialog/index.d.ts +1 -3
  17. package/TagSelect/index.d.ts +1 -1
  18. package/index.cjs.js +39715 -36506
  19. package/index.d.ts +2 -0
  20. package/index.es.js +38714 -35505
  21. package/package.json +2 -2
  22. package/src/DataTable/Columns.js +2 -2
  23. package/src/DataTable/DisplayOptions.js +1 -1
  24. package/src/DataTable/FilterAndSortMenu.js +27 -30
  25. package/src/DataTable/index.js +101 -84
  26. package/src/DataTable/style.css +1 -1
  27. package/src/DataTable/utils/filterLocalEntitiesToHasura.js +356 -0
  28. package/src/DataTable/utils/filterLocalEntitiesToHasura.test.js +1285 -0
  29. package/src/DataTable/utils/getAllRows.js +2 -6
  30. package/src/DataTable/utils/handleCopyColumn.js +2 -2
  31. package/src/DataTable/utils/handleCopyTable.js +2 -2
  32. package/src/DataTable/utils/initializeHasuraWhereAndFilter.js +15 -0
  33. package/src/DataTable/utils/queryParams.js +153 -770
  34. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +277 -0
  35. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +245 -0
  36. package/src/DataTable/utils/withTableParams.js +3 -16
  37. package/src/FormComponents/index.js +2 -2
  38. package/src/TgSelect/index.js +15 -0
  39. package/src/index.js +2 -0
  40. package/src/utils/determineBlackOrWhiteTextColor.js +8 -1
  41. package/ui.css +10537 -0
  42. package/utils/determineBlackOrWhiteTextColor.d.ts +1 -2
  43. package/utils/hotkeyUtils.d.ts +1 -3
@@ -0,0 +1,5 @@
1
+ export function filterLocalEntitiesToHasura(records: any, { where, order_by, limit, offset, isInfinite }?: {}): {
2
+ entities: any[];
3
+ entitiesAcrossPages: any[];
4
+ entityCount: number;
5
+ };
@@ -1 +1 @@
1
- export function getAllRows(e: any): any;
1
+ export function getAllRows(tableRef: any): any;
@@ -1,3 +1 @@
1
- export function getRowCopyText(rowEl: any, { specificColumn }?: {
2
- specificColumn: any;
3
- }): (string | any[])[];
1
+ export function getRowCopyText(rowEl: any, { specificColumn }?: {}): (string | any[])[];
@@ -1 +1 @@
1
- export function handleCopyColumn(e: any, cellWrapper: any, selectedRecords: any): void;
1
+ export function handleCopyColumn(tableRef: any, cellWrapper: any, selectedRecords: any): void;
@@ -1,5 +1 @@
1
- export function handleCopyRows(rowElsToCopy: any, { specificColumn, onFinishMsg, isDownload }?: {
2
- specificColumn: any;
3
- onFinishMsg: any;
4
- isDownload: any;
5
- }): any;
1
+ export function handleCopyRows(rowElsToCopy: any, { specificColumn, onFinishMsg, isDownload }?: {}): any;
@@ -1 +1 @@
1
- export function handleCopyTable(e: any, opts: any): void;
1
+ export function handleCopyTable(tableRef: any, opts: any): void;
@@ -19,5 +19,4 @@ import { isEntityClean } from './isEntityClean';
19
19
  import { PRIMARY_SELECTED_VAL } from './primarySelectedValue';
20
20
  import { removeCleanRows } from './removeCleanRows';
21
21
  import { useTableEntities } from './useTableEntities';
22
-
23
22
  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 function initializeHasuraWhereAndFilter(additionalFilter: any, where: {} | undefined, currentParams: any): void;
@@ -3,12 +3,6 @@ export function getMergedOpts(topLevel?: {}, instanceLevel?: {}): {
3
3
  defaults: any;
4
4
  formName: string;
5
5
  };
6
- /**
7
- *
8
- * @param {object} field
9
- * @returns the camelCase display name of the field, to be used for filters, sorting, etc
10
- */
11
- export function getCCDisplayName(field: object): string;
12
6
  export function getCurrentParamsFromUrl(location: any, isSimple: any): any;
13
7
  export function setCurrentParamsOnUrl(newParams: any, replace: any, isSimple: any): void;
14
8
  export function makeDataTableHandlers({ setNewParams, defaults, onlyOneFilter }: {
@@ -25,7 +19,7 @@ export function makeDataTableHandlers({ setNewParams, defaults, onlyOneFilter }:
25
19
  setOrder: (order: any, isRemove: any, shiftHeld: any) => any;
26
20
  setNewParams: any;
27
21
  };
28
- export function getQueryParams({ currentParams, urlConnected, defaults, schema, isInfinite, entities, isLocalCall, additionalFilter, additionalOrFilter, doNotCoercePageSize, noOrderError, isCodeModel, ownProps }: {
22
+ export function getQueryParams({ currentParams, urlConnected, defaults, schema, isInfinite, entities, isLocalCall, additionalFilter, doNotCoercePageSize, noOrderError, isCodeModel, ownProps }: {
29
23
  currentParams: any;
30
24
  urlConnected: any;
31
25
  defaults: any;
@@ -34,7 +28,6 @@ export function getQueryParams({ currentParams, urlConnected, defaults, schema,
34
28
  entities: any;
35
29
  isLocalCall: any;
36
30
  additionalFilter: any;
37
- additionalOrFilter: any;
38
31
  doNotCoercePageSize: any;
39
32
  noOrderError: any;
40
33
  isCodeModel: any;
@@ -42,18 +35,29 @@ export function getQueryParams({ currentParams, urlConnected, defaults, schema,
42
35
  }): {
43
36
  page: any;
44
37
  pageSize: any;
45
- order: any;
38
+ order: any[];
46
39
  filters: any;
47
40
  searchTerm: any;
48
41
  } | {
49
42
  variables: {
50
- sort: never[];
43
+ where: {};
44
+ order_by: any[];
45
+ limit: any;
46
+ offset: number;
51
47
  };
52
- errorParsingUrlString: unknown;
53
48
  page: any;
54
49
  pageSize: any;
55
- order: any;
50
+ order: any[];
56
51
  filters: any;
57
52
  searchTerm: any;
53
+ errorParsingUrlString?: undefined;
54
+ } | {
55
+ errorParsingUrlString: unknown;
56
+ variables: {
57
+ where: {};
58
+ order_by: never[];
59
+ limit: number;
60
+ offset: number;
61
+ };
58
62
  };
59
63
  export const defaultPageSizes: number[];
@@ -14,7 +14,7 @@ export default function rowClick(e: any, rowInfo: any, entities: any, { reduxFor
14
14
  }): void;
15
15
  export function changeSelectedEntities({ idMap, entities, change }: {
16
16
  idMap: any;
17
- entities?: any[] | undefined;
17
+ entities?: never[] | undefined;
18
18
  change: any;
19
19
  }): void;
20
20
  export function finalizeSelection({ idMap, entities, props: { onDeselect, onSingleRowSelect, onMultiRowSelect, noDeselectAll, onRowSelect, noSelect, change } }: {
@@ -0,0 +1,26 @@
1
+ export function tableQueryParamsToHasuraClauses({ page, pageSize, searchTerm, filters, order, schema, additionalFilter }: {
2
+ page: any;
3
+ pageSize: any;
4
+ searchTerm: any;
5
+ filters: any;
6
+ order: any;
7
+ schema: any;
8
+ additionalFilter: any;
9
+ }): {
10
+ where: {};
11
+ order_by: any[];
12
+ limit: any;
13
+ offset: number;
14
+ };
15
+ /**
16
+ * Takes a schema and returns an object with the fields mapped by their camelCased display name.
17
+ * If the displayName is not set or is a jsx element, the path is used instead.
18
+ * The same conversion must be done when using the result of this method
19
+ */
20
+ export function getFieldsMappedByCCDisplayName(schema: any): any;
21
+ /**
22
+ *
23
+ * @param {object} field
24
+ * @returns the camelCase display name of the field, to be used for filters, sorting, etc
25
+ */
26
+ export function getCCDisplayName(field: object): string;
@@ -13,9 +13,7 @@ declare function Uploader({ accept: __accept, action, autoUnzip, beforeUpload, c
13
13
  fileList: any;
14
14
  innerIcon: any;
15
15
  innerText: any;
16
- meta?: {
17
- form: any;
18
- } | undefined;
16
+ meta?: {} | undefined;
19
17
  minimal: any;
20
18
  name: any;
21
19
  noBuildCsvOption: any;
@@ -7,7 +7,7 @@ export default function tryToMatchSchemas({ incomingData, validateAgainstSchema
7
7
  matchedHeaders: {};
8
8
  userSchema: {
9
9
  fields: {
10
- path: string;
10
+ path: never;
11
11
  type: string;
12
12
  }[];
13
13
  userData: any;
@@ -6,9 +6,7 @@ declare class MenuBar extends React.Component<any, any, any> {
6
6
  style: {};
7
7
  };
8
8
  constructor(props: any);
9
- hotkeyEnabler: ({ children }?: {
10
- children: any;
11
- }) => import("react/jsx-runtime").JSX.Element;
9
+ hotkeyEnabler: ({ children }?: {}) => import("react/jsx-runtime").JSX.Element;
12
10
  state: {
13
11
  isOpen: boolean;
14
12
  openIndex: null;
package/README.md CHANGED
@@ -4,7 +4,7 @@ This library was generated with [Nx](https://nx.dev).
4
4
 
5
5
  ## Running unit tests
6
6
 
7
- Run `nx test ui` to execute the unit tests via [Vitest](https://vitest.dev/).
7
+ Run `nx test ui` to execute the unit tests via bun test
8
8
 
9
9
  ## Installation (react)
10
10
 
@@ -10,9 +10,7 @@ export default class ResizableDraggableDialog extends React.Component<any, any,
10
10
  width: number;
11
11
  height: number;
12
12
  };
13
- setDefaults: ({ doNotSetXOrWidth }?: {
14
- doNotSetXOrWidth: any;
15
- }) => void;
13
+ setDefaults: ({ doNotSetXOrWidth }?: {}) => void;
16
14
  onWindowResize: () => void;
17
15
  componentWillUnmount(): void;
18
16
  getWindowWidthAndHeight: () => {
@@ -1,6 +1,6 @@
1
1
  declare function _default({ value, options, onChange }: {
2
2
  value?: {} | undefined;
3
- options?: any[] | undefined;
3
+ options?: never[] | undefined;
4
4
  onChange: any;
5
5
  }): import("react/jsx-runtime").JSX.Element;
6
6
  export default _default;