@teselagen/ui 0.8.8 → 0.9.3
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/utils/filterLocalEntitiesToHasura.d.ts +5 -0
- package/DataTable/utils/getAllRows.d.ts +1 -1
- package/DataTable/utils/getRowCopyText.d.ts +1 -3
- package/DataTable/utils/handleCopyColumn.d.ts +1 -1
- package/DataTable/utils/handleCopyRows.d.ts +1 -5
- package/DataTable/utils/handleCopyTable.d.ts +1 -1
- package/DataTable/utils/index.d.ts +0 -1
- package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +1 -0
- package/DataTable/utils/queryParams.d.ts +16 -12
- package/DataTable/utils/rowClick.d.ts +1 -1
- package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +26 -0
- package/FormComponents/Uploader.d.ts +1 -3
- package/FormComponents/tryToMatchSchemas.d.ts +1 -1
- package/MenuBar/index.d.ts +1 -3
- package/README.md +1 -1
- package/ResizableDraggableDialog/index.d.ts +1 -3
- package/TagSelect/index.d.ts +1 -1
- package/index.cjs.js +40098 -36878
- package/index.d.ts +2 -0
- package/index.es.js +39112 -35892
- package/package.json +2 -4
- package/src/DataTable/Columns.js +2 -2
- package/src/DataTable/DisplayOptions.js +1 -1
- package/src/DataTable/FilterAndSortMenu.js +27 -30
- package/src/DataTable/index.js +113 -90
- package/src/DataTable/style.css +1 -1
- package/src/DataTable/utils/filterLocalEntitiesToHasura.js +356 -0
- package/src/DataTable/utils/filterLocalEntitiesToHasura.test.js +1285 -0
- package/src/DataTable/utils/getAllRows.js +2 -6
- package/src/DataTable/utils/handleCopyColumn.js +2 -2
- package/src/DataTable/utils/handleCopyTable.js +2 -2
- package/src/DataTable/utils/initializeHasuraWhereAndFilter.js +15 -0
- package/src/DataTable/utils/queryParams.js +153 -770
- package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +277 -0
- package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +245 -0
- package/src/DataTable/utils/withTableParams.js +3 -16
- package/src/FormComponents/index.js +2 -2
- package/src/TgSelect/index.js +15 -0
- package/src/index.js +2 -0
- package/src/utils/determineBlackOrWhiteTextColor.js +8 -1
- package/ui.css +10537 -0
- package/utils/determineBlackOrWhiteTextColor.d.ts +1 -2
- package/utils/hotkeyUtils.d.ts +1 -3
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export const getAllRows =
|
|
2
|
-
const
|
|
3
|
-
? e.target.querySelector(".data-table-container")
|
|
4
|
-
: e.target.closest(".data-table-container");
|
|
5
|
-
|
|
6
|
-
const allRowEls = el.querySelectorAll(".rt-tr");
|
|
1
|
+
export const getAllRows = tableRef => {
|
|
2
|
+
const allRowEls = tableRef.current?.tableRef?.querySelectorAll(".rt-tr");
|
|
7
3
|
if (!allRowEls || !allRowEls.length) {
|
|
8
4
|
return;
|
|
9
5
|
}
|
|
@@ -2,9 +2,9 @@ import { getAllRows } from "./getAllRows";
|
|
|
2
2
|
import { getIdOrCodeOrIndex } from "./getIdOrCodeOrIndex";
|
|
3
3
|
import { handleCopyRows } from "./handleCopyRows";
|
|
4
4
|
|
|
5
|
-
export const handleCopyColumn = (
|
|
5
|
+
export const handleCopyColumn = (tableRef, cellWrapper, selectedRecords) => {
|
|
6
6
|
const specificColumn = cellWrapper.getAttribute("data-test");
|
|
7
|
-
let rowElsToCopy = getAllRows(
|
|
7
|
+
let rowElsToCopy = getAllRows(tableRef);
|
|
8
8
|
if (!rowElsToCopy) return;
|
|
9
9
|
if (selectedRecords) {
|
|
10
10
|
const ids = selectedRecords.map(e => getIdOrCodeOrIndex(e)?.toString());
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getAllRows } from "./getAllRows";
|
|
2
2
|
import { handleCopyRows } from "./handleCopyRows";
|
|
3
3
|
|
|
4
|
-
export const handleCopyTable = (
|
|
4
|
+
export const handleCopyTable = (tableRef, opts) => {
|
|
5
5
|
try {
|
|
6
|
-
const allRowEls = getAllRows(
|
|
6
|
+
const allRowEls = getAllRows(tableRef);
|
|
7
7
|
if (!allRowEls) return;
|
|
8
8
|
handleCopyRows(allRowEls, {
|
|
9
9
|
...opts,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function initializeHasuraWhereAndFilter(
|
|
2
|
+
additionalFilter,
|
|
3
|
+
where = {},
|
|
4
|
+
currentParams
|
|
5
|
+
) {
|
|
6
|
+
where._and = where._and || [];
|
|
7
|
+
where._or = where._or || [];
|
|
8
|
+
if (typeof additionalFilter === "function") {
|
|
9
|
+
const newWhere = additionalFilter(where, currentParams);
|
|
10
|
+
if (newWhere) {
|
|
11
|
+
Object.assign(where, newWhere);
|
|
12
|
+
}
|
|
13
|
+
} else if (typeof additionalFilter === "object")
|
|
14
|
+
where._and.push(additionalFilter);
|
|
15
|
+
}
|