@teselagen/ui 0.7.35 → 0.8.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 (128) hide show
  1. package/index.cjs.js +1 -2
  2. package/index.es.js +1 -2
  3. package/package.json +1 -1
  4. package/src/DataTable/Columns.js +1 -1
  5. package/src/DataTable/DisplayOptions.js +1 -1
  6. package/src/DataTable/FilterAndSortMenu.js +30 -27
  7. package/src/DataTable/index.js +14 -3
  8. package/src/DataTable/utils/queryParams.js +771 -64
  9. package/src/DataTable/utils/withTableParams.js +16 -3
  10. package/src/index.js +0 -1
  11. package/src/utils/isBeingCalledExcessively.js +14 -7
  12. package/AdvancedOptions.js +0 -33
  13. package/AssignDefaultsModeContext.js +0 -22
  14. package/CellDragHandle.js +0 -132
  15. package/ColumnFilterMenu.js +0 -62
  16. package/Columns.js +0 -979
  17. package/DataTable/utils/filterLocalEntitiesToHasura.d.ts +0 -5
  18. package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +0 -2
  19. package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +0 -26
  20. package/DisabledLoadingComponent.js +0 -15
  21. package/DisplayOptions.js +0 -199
  22. package/DropdownButton.js +0 -36
  23. package/DropdownCell.js +0 -61
  24. package/EditableCell.js +0 -44
  25. package/FillWindow.css +0 -6
  26. package/FillWindow.js +0 -69
  27. package/FilterAndSortMenu.js +0 -391
  28. package/FormSeparator.js +0 -9
  29. package/LoadingDots.js +0 -14
  30. package/MatchHeaders.js +0 -234
  31. package/PagingTool.js +0 -225
  32. package/RenderCell.js +0 -191
  33. package/SearchBar.js +0 -69
  34. package/SimpleStepViz.js +0 -22
  35. package/SortableColumns.js +0 -100
  36. package/TableFormTrackerContext.js +0 -10
  37. package/Tag.js +0 -112
  38. package/ThComponent.js +0 -44
  39. package/TimelineEvent.js +0 -31
  40. package/UploadCsvWizard.css +0 -4
  41. package/UploadCsvWizard.js +0 -719
  42. package/Uploader.js +0 -1278
  43. package/adHoc.js +0 -10
  44. package/autoTooltip.js +0 -201
  45. package/basicHandleActionsWithFullState.js +0 -14
  46. package/browserUtils.js +0 -3
  47. package/combineReducersWithFullState.js +0 -14
  48. package/commandControls.js +0 -82
  49. package/commandUtils.js +0 -112
  50. package/constants.js +0 -1
  51. package/convertSchema.js +0 -69
  52. package/customIcons.js +0 -361
  53. package/dataTableEnhancer.js +0 -41
  54. package/defaultFormatters.js +0 -32
  55. package/defaultValidators.js +0 -40
  56. package/determineBlackOrWhiteTextColor.js +0 -4
  57. package/editCellHelper.js +0 -44
  58. package/formatPasteData.js +0 -16
  59. package/getAllRows.js +0 -11
  60. package/getCellCopyText.js +0 -7
  61. package/getCellInfo.js +0 -36
  62. package/getCellVal.js +0 -20
  63. package/getDayjsFormatter.js +0 -35
  64. package/getFieldPathToField.js +0 -7
  65. package/getIdOrCodeOrIndex.js +0 -9
  66. package/getLastSelectedEntity.js +0 -11
  67. package/getNewEntToSelect.js +0 -25
  68. package/getNewName.js +0 -31
  69. package/getRowCopyText.js +0 -28
  70. package/getTableConfigFromStorage.js +0 -5
  71. package/getTextFromEl.js +0 -28
  72. package/getVals.js +0 -8
  73. package/handleCopyColumn.js +0 -21
  74. package/handleCopyHelper.js +0 -15
  75. package/handleCopyRows.js +0 -23
  76. package/handleCopyTable.js +0 -16
  77. package/handlerHelpers.js +0 -24
  78. package/hotkeyUtils.js +0 -131
  79. package/index.js +0 -1
  80. package/isBeingCalledExcessively.js +0 -32
  81. package/isBottomRightCornerOfRectangle.js +0 -20
  82. package/isEntityClean.js +0 -15
  83. package/isTruthy.js +0 -12
  84. package/isValueEmpty.js +0 -3
  85. package/itemUpload.js +0 -84
  86. package/menuUtils.js +0 -433
  87. package/popoverOverflowModifiers.js +0 -11
  88. package/primarySelectedValue.js +0 -1
  89. package/pureNoFunc.js +0 -31
  90. package/queryParams.js +0 -1058
  91. package/removeCleanRows.js +0 -22
  92. package/renderOnDoc.js +0 -32
  93. package/rerenderOnWindowResize.js +0 -26
  94. package/rowClick.js +0 -181
  95. package/selection.js +0 -8
  96. package/showAppSpinner.js +0 -12
  97. package/showDialogOnDocBody.js +0 -33
  98. package/showProgressToast.js +0 -22
  99. package/sortify.js +0 -73
  100. package/src/DataTable/utils/filterLocalEntitiesToHasura.js +0 -236
  101. package/src/DataTable/utils/filterLocalEntitiesToHasura.test.js +0 -587
  102. package/src/DataTable/utils/initializeHasuraWhereAndFilter.js +0 -26
  103. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +0 -253
  104. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +0 -206
  105. package/style.css +0 -29
  106. package/tagUtils.js +0 -45
  107. package/tgFormValues.js +0 -35
  108. package/tg_modalState.js +0 -47
  109. package/throwFormError.js +0 -16
  110. package/toastr.js +0 -148
  111. package/tryToMatchSchemas.js +0 -264
  112. package/typeToCommonType.js +0 -6
  113. package/useDeepEqualMemo.js +0 -15
  114. package/useDialog.js +0 -63
  115. package/useStableReference.js +0 -9
  116. package/useTableEntities.js +0 -38
  117. package/useTraceUpdate.js +0 -19
  118. package/utils.js +0 -37
  119. package/validateTableWideErrors.js +0 -160
  120. package/viewColumn.js +0 -97
  121. package/withField.js +0 -20
  122. package/withFields.js +0 -11
  123. package/withLocalStorage.js +0 -11
  124. package/withSelectTableRecords.js +0 -43
  125. package/withSelectedEntities.js +0 -65
  126. package/withStore.js +0 -10
  127. package/withTableParams.js +0 -301
  128. package/wrapDialog.js +0 -116
package/index.cjs.js CHANGED
@@ -15848,7 +15848,6 @@ var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
15848
15848
  return 41.36;
15849
15849
  }, "itemSizeEstimator");
15850
15850
  var ReactTableDefaults = defaultProps;
15851
- var VIRTUALIZE_CUTOFF_LENGTH = 200;
15852
15851
  var ReactTable = function(_Methods) {
15853
15852
  _inherits$8(ReactTable2, _Methods);
15854
15853
  function ReactTable2(props) {
@@ -16434,7 +16433,7 @@ var ReactTable = function(_Methods) {
16434
16433
  minWidth: rowMinWidth + "px"
16435
16434
  })
16436
16435
  }, tBodyProps.rest),
16437
- _this2.props.noVirtual || pageRows.length < VIRTUALIZE_CUTOFF_LENGTH ? pageRows.map(function(d2, i2) {
16436
+ pageRows.length < 200 ? pageRows.map(function(d2, i2) {
16438
16437
  return makePageRow(d2, i2);
16439
16438
  }) : React.createElement(ReactList, {
16440
16439
  type: "variable",
package/index.es.js CHANGED
@@ -15830,7 +15830,6 @@ var itemSizeEstimator = /* @__PURE__ */ __name(function itemSizeEstimator2() {
15830
15830
  return 41.36;
15831
15831
  }, "itemSizeEstimator");
15832
15832
  var ReactTableDefaults = defaultProps;
15833
- var VIRTUALIZE_CUTOFF_LENGTH = 200;
15834
15833
  var ReactTable = function(_Methods) {
15835
15834
  _inherits$8(ReactTable2, _Methods);
15836
15835
  function ReactTable2(props) {
@@ -16416,7 +16415,7 @@ var ReactTable = function(_Methods) {
16416
16415
  minWidth: rowMinWidth + "px"
16417
16416
  })
16418
16417
  }, tBodyProps.rest),
16419
- _this2.props.noVirtual || pageRows.length < VIRTUALIZE_CUTOFF_LENGTH ? pageRows.map(function(d2, i2) {
16418
+ pageRows.length < 200 ? pageRows.map(function(d2, i2) {
16420
16419
  return makePageRow(d2, i2);
16421
16420
  }) : React__default.createElement(ReactList, {
16422
16421
  type: "variable",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.7.35",
3
+ "version": "0.8.1",
4
4
  "main": "./src/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -33,10 +33,10 @@ import getTextFromEl from "../utils/getTextFromEl";
33
33
  import rowClick, { finalizeSelection } from "./utils/rowClick";
34
34
  import { editCellHelper } from "./editCellHelper";
35
35
  import { getCellVal } from "./getCellVal";
36
+ import { getCCDisplayName } from "./utils/queryParams";
36
37
  import { useDispatch } from "react-redux";
37
38
  import { change as _change } from "redux-form";
38
39
  import { RenderCell } from "./RenderCell";
39
- import { getCCDisplayName } from "./utils/tableQueryParamsToHasuraClauses";
40
40
 
41
41
  dayjs.extend(localizedFormat);
42
42
 
@@ -10,7 +10,7 @@ import {
10
10
  Popover,
11
11
  Switch
12
12
  } from "@blueprintjs/core";
13
- import { getCCDisplayName } from "./utils/tableQueryParamsToHasuraClauses";
13
+ import { getCCDisplayName } from "./utils/queryParams";
14
14
 
15
15
  const DisplayOptions = ({
16
16
  compact,
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { DateInput, DateRangeInput } from "@blueprintjs/datetime";
3
- import { camelCase, startCase } from "lodash-es";
3
+ import { camelCase } from "lodash-es";
4
4
  import classNames from "classnames";
5
5
  import {
6
6
  Menu,
@@ -349,40 +349,43 @@ function getFilterMenuItems(dataType) {
349
349
  let filterMenuItems = [];
350
350
  if (dataType === "string") {
351
351
  filterMenuItems = [
352
- "contains",
353
- "notContains",
354
- "startsWith",
355
- "endsWith",
356
- "isExactly",
357
- "regex",
358
- "inList",
359
- "notInList",
360
- "isEmpty",
361
- "notEmpty"
352
+ "Contains",
353
+ "Not Contains",
354
+ "Starts With",
355
+ "Ends With",
356
+ "Is Exactly",
357
+ "Regex",
358
+ "In List",
359
+ "Not In List",
360
+ "Is Empty",
361
+ "Not Empty"
362
362
  ];
363
363
  } else if (dataType === "lookup") {
364
364
  filterMenuItems = [
365
- "contains",
366
- "notContains",
367
- "startsWith",
368
- "endsWith",
369
- "isExactly",
370
- "regex"
365
+ "Contains",
366
+ "Not Contains",
367
+ "Starts With",
368
+ "Ends With",
369
+ "Is Exactly",
370
+ "Regex"
371
371
  ];
372
372
  } else if (dataType === "boolean") {
373
- filterMenuItems = ["true", "false"];
373
+ filterMenuItems = ["True", "False"];
374
374
  } else if (dataType === "number" || dataType === "integer") {
375
+ // else if (dataType === "lookup") {
376
+ // filterMenuItems = ["None"];
377
+ // }
375
378
  filterMenuItems = [
376
- "greaterThan",
377
- "lessThan",
378
- "inRange",
379
- "outsideRange",
380
- "equalTo",
381
- "inList",
382
- "notInList"
379
+ "Greater Than",
380
+ "Less Than",
381
+ "In Range",
382
+ "Outside Range",
383
+ "Equal To",
384
+ "In List",
385
+ "Not In List"
383
386
  ];
384
387
  } else if (dataType === "timestamp") {
385
- filterMenuItems = ["isBetween", "notBetween", "isBefore", "isAfter"];
388
+ filterMenuItems = ["Is Between", "Not Between", "Is Before", "Is After"];
386
389
  }
387
- return filterMenuItems.map(item => startCase(item));
390
+ return filterMenuItems;
388
391
  }
@@ -92,6 +92,7 @@ import { viewColumn, openColumn, multiViewColumn } from "./viewColumn";
92
92
  import convertSchema from "./utils/convertSchema";
93
93
  import TableFormTrackerContext from "./TableFormTrackerContext";
94
94
  import {
95
+ getCCDisplayName,
95
96
  getCurrentParamsFromUrl,
96
97
  getQueryParams,
97
98
  makeDataTableHandlers,
@@ -102,7 +103,6 @@ import { formValueSelector, change as _change } from "redux-form";
102
103
  import { throwFormError } from "../throwFormError";
103
104
  import { isObservableArray, toJS } from "mobx";
104
105
  import { isBeingCalledExcessively } from "../utils/isBeingCalledExcessively";
105
- import { getCCDisplayName } from "./utils/tableQueryParamsToHasuraClauses";
106
106
 
107
107
  enablePatches();
108
108
  const IS_LINUX = window.navigator.platform.toLowerCase().search("linux") > -1;
@@ -337,6 +337,16 @@ const DataTable = ({
337
337
 
338
338
  const queryParams = useMemo(() => {
339
339
  if (!isTableParamsConnected) {
340
+ const additionalFilterToUse =
341
+ typeof props.additionalFilter === "function"
342
+ ? props.additionalFilter
343
+ : () => props.additionalFilter;
344
+
345
+ const additionalOrFilterToUse =
346
+ typeof props.additionalOrFilter === "function"
347
+ ? props.additionalOrFilter
348
+ : () => props.additionalOrFilter;
349
+
340
350
  return getQueryParams({
341
351
  doNotCoercePageSize,
342
352
  currentParams,
@@ -346,7 +356,8 @@ const DataTable = ({
346
356
  schema: convertedSchema,
347
357
  isInfinite,
348
358
  isLocalCall,
349
- additionalFilter: props.additionalFilter,
359
+ additionalFilter: additionalFilterToUse,
360
+ additionalOrFilter: additionalOrFilterToUse,
350
361
  noOrderError: props.noOrderError,
351
362
  isCodeModel: props.isCodeModel,
352
363
  ownProps: props
@@ -603,7 +614,7 @@ const DataTable = ({
603
614
  : !val;
604
615
  });
605
616
  }
606
- if (noValsForField && entities.length) {
617
+ if (noValsForField) {
607
618
  return {
608
619
  ...field,
609
620
  isHidden: true,