@teselagen/ui 0.7.34 → 0.7.36

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 (161) hide show
  1. package/isBeingCalledExcessively.js +2 -0
  2. package/package.json +1 -1
  3. package/style.css +26 -10
  4. package/DataTable/utils/filterLocalEntitiesToHasura.d.ts +0 -5
  5. package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +0 -2
  6. package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +0 -26
  7. package/src/AdvancedOptions.js +0 -33
  8. package/src/AdvancedOptions.spec.js +0 -26
  9. package/src/AssignDefaultsModeContext.js +0 -22
  10. package/src/AsyncValidateFieldSpinner/index.js +0 -12
  11. package/src/BlueprintError/index.js +0 -14
  12. package/src/BounceLoader/index.js +0 -16
  13. package/src/BounceLoader/style.css +0 -45
  14. package/src/CollapsibleCard/index.js +0 -68
  15. package/src/CollapsibleCard/style.css +0 -23
  16. package/src/DNALoader/index.js +0 -20
  17. package/src/DNALoader/style.css +0 -251
  18. package/src/DataTable/CellDragHandle.js +0 -132
  19. package/src/DataTable/ColumnFilterMenu.js +0 -62
  20. package/src/DataTable/Columns.js +0 -979
  21. package/src/DataTable/DisabledLoadingComponent.js +0 -15
  22. package/src/DataTable/DisplayOptions.js +0 -199
  23. package/src/DataTable/DropdownCell.js +0 -61
  24. package/src/DataTable/EditableCell.js +0 -44
  25. package/src/DataTable/FilterAndSortMenu.js +0 -388
  26. package/src/DataTable/PagingTool.js +0 -225
  27. package/src/DataTable/RenderCell.js +0 -191
  28. package/src/DataTable/SearchBar.js +0 -69
  29. package/src/DataTable/SortableColumns.js +0 -100
  30. package/src/DataTable/TableFormTrackerContext.js +0 -10
  31. package/src/DataTable/ThComponent.js +0 -44
  32. package/src/DataTable/dataTableEnhancer.js +0 -41
  33. package/src/DataTable/defaultFormatters.js +0 -32
  34. package/src/DataTable/defaultValidators.js +0 -40
  35. package/src/DataTable/editCellHelper.js +0 -44
  36. package/src/DataTable/getCellVal.js +0 -20
  37. package/src/DataTable/getVals.js +0 -8
  38. package/src/DataTable/index.js +0 -3209
  39. package/src/DataTable/isTruthy.js +0 -12
  40. package/src/DataTable/isValueEmpty.js +0 -3
  41. package/src/DataTable/style.css +0 -608
  42. package/src/DataTable/utils/convertSchema.js +0 -69
  43. package/src/DataTable/utils/filterLocalEntitiesToHasura.js +0 -236
  44. package/src/DataTable/utils/filterLocalEntitiesToHasura.test.js +0 -587
  45. package/src/DataTable/utils/formatPasteData.js +0 -16
  46. package/src/DataTable/utils/getAllRows.js +0 -11
  47. package/src/DataTable/utils/getCellCopyText.js +0 -7
  48. package/src/DataTable/utils/getCellInfo.js +0 -36
  49. package/src/DataTable/utils/getFieldPathToField.js +0 -7
  50. package/src/DataTable/utils/getIdOrCodeOrIndex.js +0 -9
  51. package/src/DataTable/utils/getLastSelectedEntity.js +0 -11
  52. package/src/DataTable/utils/getNewEntToSelect.js +0 -25
  53. package/src/DataTable/utils/getRowCopyText.js +0 -28
  54. package/src/DataTable/utils/getTableConfigFromStorage.js +0 -5
  55. package/src/DataTable/utils/handleCopyColumn.js +0 -21
  56. package/src/DataTable/utils/handleCopyHelper.js +0 -15
  57. package/src/DataTable/utils/handleCopyRows.js +0 -23
  58. package/src/DataTable/utils/handleCopyTable.js +0 -16
  59. package/src/DataTable/utils/index.js +0 -55
  60. package/src/DataTable/utils/initializeHasuraWhereAndFilter.js +0 -26
  61. package/src/DataTable/utils/isBottomRightCornerOfRectangle.js +0 -20
  62. package/src/DataTable/utils/isEntityClean.js +0 -15
  63. package/src/DataTable/utils/primarySelectedValue.js +0 -1
  64. package/src/DataTable/utils/queryParams.js +0 -350
  65. package/src/DataTable/utils/removeCleanRows.js +0 -22
  66. package/src/DataTable/utils/rowClick.js +0 -181
  67. package/src/DataTable/utils/selection.js +0 -8
  68. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +0 -253
  69. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +0 -206
  70. package/src/DataTable/utils/useTableEntities.js +0 -38
  71. package/src/DataTable/utils/utils.js +0 -37
  72. package/src/DataTable/utils/withSelectedEntities.js +0 -65
  73. package/src/DataTable/utils/withTableParams.js +0 -288
  74. package/src/DataTable/validateTableWideErrors.js +0 -160
  75. package/src/DataTable/viewColumn.js +0 -97
  76. package/src/DialogFooter/index.js +0 -86
  77. package/src/DialogFooter/style.css +0 -9
  78. package/src/DropdownButton.js +0 -36
  79. package/src/FillWindow.css +0 -6
  80. package/src/FillWindow.js +0 -69
  81. package/src/FormComponents/FormSeparator.js +0 -9
  82. package/src/FormComponents/LoadingDots.js +0 -14
  83. package/src/FormComponents/Uploader.js +0 -1278
  84. package/src/FormComponents/getNewName.js +0 -31
  85. package/src/FormComponents/index.js +0 -1266
  86. package/src/FormComponents/itemUpload.js +0 -84
  87. package/src/FormComponents/sortify.js +0 -73
  88. package/src/FormComponents/style.css +0 -275
  89. package/src/FormComponents/tryToMatchSchemas.js +0 -264
  90. package/src/FormComponents/utils.js +0 -6
  91. package/src/HotkeysDialog/index.js +0 -79
  92. package/src/HotkeysDialog/style.css +0 -54
  93. package/src/InfoHelper/index.js +0 -78
  94. package/src/InfoHelper/style.css +0 -7
  95. package/src/IntentText/index.js +0 -18
  96. package/src/Loading/index.js +0 -70
  97. package/src/Loading/style.css +0 -4
  98. package/src/MatchHeaders.js +0 -234
  99. package/src/MenuBar/index.js +0 -423
  100. package/src/MenuBar/style.css +0 -45
  101. package/src/PromptUnsavedChanges/index.js +0 -38
  102. package/src/ResizableDraggableDialog/index.js +0 -141
  103. package/src/ResizableDraggableDialog/style.css +0 -42
  104. package/src/ScrollToTop/index.js +0 -72
  105. package/src/SimpleStepViz.js +0 -22
  106. package/src/Tag.js +0 -112
  107. package/src/TagSelect/index.js +0 -69
  108. package/src/TagSelect/style.css +0 -13
  109. package/src/TgHtmlSelect/index.js +0 -20
  110. package/src/TgSelect/index.js +0 -537
  111. package/src/TgSelect/style.css +0 -61
  112. package/src/TgSuggest/index.js +0 -124
  113. package/src/Timeline/TimelineEvent.js +0 -31
  114. package/src/Timeline/index.js +0 -15
  115. package/src/Timeline/style.css +0 -29
  116. package/src/UploadCsvWizard.css +0 -4
  117. package/src/UploadCsvWizard.js +0 -719
  118. package/src/autoTooltip.js +0 -201
  119. package/src/constants.js +0 -1
  120. package/src/customIcons.js +0 -361
  121. package/src/enhancers/withDialog/index.js +0 -196
  122. package/src/enhancers/withDialog/tg_modalState.js +0 -47
  123. package/src/enhancers/withField.js +0 -20
  124. package/src/enhancers/withFields.js +0 -11
  125. package/src/enhancers/withLocalStorage.js +0 -11
  126. package/src/index.js +0 -88
  127. package/src/rerenderOnWindowResize.js +0 -26
  128. package/src/showAppSpinner.js +0 -12
  129. package/src/showConfirmationDialog/index.js +0 -148
  130. package/src/showDialogOnDocBody.js +0 -33
  131. package/src/style.css +0 -265
  132. package/src/throwFormError.js +0 -16
  133. package/src/toastr.js +0 -148
  134. package/src/typeToCommonType.js +0 -6
  135. package/src/useDialog.js +0 -63
  136. package/src/utils/adHoc.js +0 -10
  137. package/src/utils/basicHandleActionsWithFullState.js +0 -14
  138. package/src/utils/browserUtils.js +0 -3
  139. package/src/utils/combineReducersWithFullState.js +0 -14
  140. package/src/utils/commandControls.js +0 -82
  141. package/src/utils/commandUtils.js +0 -112
  142. package/src/utils/determineBlackOrWhiteTextColor.js +0 -4
  143. package/src/utils/getDayjsFormatter.js +0 -35
  144. package/src/utils/getTextFromEl.js +0 -28
  145. package/src/utils/handlerHelpers.js +0 -24
  146. package/src/utils/hooks/index.js +0 -1
  147. package/src/utils/hooks/useDeepEqualMemo.js +0 -15
  148. package/src/utils/hooks/useStableReference.js +0 -9
  149. package/src/utils/hotkeyUtils.js +0 -131
  150. package/src/utils/isBeingCalledExcessively.js +0 -24
  151. package/src/utils/menuUtils.js +0 -433
  152. package/src/utils/popoverOverflowModifiers.js +0 -11
  153. package/src/utils/pureNoFunc.js +0 -31
  154. package/src/utils/renderOnDoc.js +0 -32
  155. package/src/utils/showProgressToast.js +0 -22
  156. package/src/utils/tagUtils.js +0 -45
  157. package/src/utils/tgFormValues.js +0 -35
  158. package/src/utils/useTraceUpdate.js +0 -19
  159. package/src/utils/withSelectTableRecords.js +0 -43
  160. package/src/utils/withStore.js +0 -10
  161. package/src/wrapDialog.js +0 -116
@@ -1,32 +0,0 @@
1
- import { toNumber } from "lodash-es";
2
- import { getVals } from "./getVals";
3
- import { isValueEmpty } from "./isValueEmpty";
4
- import { isTruthy } from "./isTruthy";
5
-
6
- export const defaultFormatters = {
7
- boolean: newVal => {
8
- return isTruthy(newVal);
9
- },
10
- dropdown: (newVal, field) => {
11
- const valsMap = {};
12
- getVals(field.values).forEach(v => {
13
- valsMap[v.toLowerCase().trim()] = v;
14
- });
15
- return valsMap[newVal?.toLowerCase().trim()] || newVal;
16
- },
17
- dropdownMulti: (newVal, field) => {
18
- const valsMap = {};
19
- getVals(field.values).forEach(v => {
20
- valsMap[v.toLowerCase().trim()] = v;
21
- });
22
- if (!newVal) return;
23
- return newVal
24
- .split(",")
25
- .map(v => valsMap[v.toLowerCase().trim()] || v)
26
- .join(",");
27
- },
28
- number: newVal => {
29
- if (isValueEmpty(newVal)) return newVal;
30
- return toNumber(newVal);
31
- }
32
- };
@@ -1,40 +0,0 @@
1
- import { isNumber } from "lodash-es";
2
- import { getVals } from "./getVals";
3
- import { isValueEmpty } from "./isValueEmpty";
4
-
5
- export const defaultValidators = {
6
- dropdown: (newVal, field) => {
7
- const err = "Please choose one of the accepted values";
8
- if (!newVal) {
9
- if (field.isRequired) return err;
10
- } else if (!getVals(field.values).includes(newVal)) {
11
- return err;
12
- }
13
- },
14
- dropdownMulti: (newVal, field) => {
15
- const err = "Please choose one of the accepted values";
16
- if (!newVal) {
17
- if (field.isRequired) return err;
18
- } else {
19
- let err;
20
- newVal.split(",").some(v => {
21
- if (!getVals(field.values).includes(v)) {
22
- err = `${v} is not an accepted value`;
23
- return true;
24
- }
25
- return false;
26
- });
27
- return err;
28
- }
29
- },
30
- number: (newVal, field) => {
31
- if (isValueEmpty(newVal) && !field.isRequired) return;
32
- if (isNaN(newVal) || !isNumber(newVal)) {
33
- return "Must be a number";
34
- }
35
- },
36
- string: (newVal, field) => {
37
- if (!field.isRequired) return false;
38
- if (!newVal) return "Please enter a value here";
39
- }
40
- };
@@ -1,44 +0,0 @@
1
- import { set } from "lodash-es";
2
- import { defaultValidators } from "./defaultValidators";
3
- import { defaultFormatters } from "./defaultFormatters";
4
-
5
- //(mutative) responsible for formatting and then validating the
6
-
7
- export const editCellHelper = ({
8
- entity,
9
- path,
10
- schema,
11
- columnSchema,
12
- newVal
13
- }) => {
14
- let nv = newVal;
15
-
16
- const colSchema =
17
- columnSchema || schema?.fields?.find(({ path: p }) => p === path) || {};
18
- path = path || colSchema.path;
19
- const { format, validate, type } = colSchema;
20
- let error;
21
- if (nv === undefined && colSchema.defaultValue !== undefined)
22
- nv = colSchema.defaultValue;
23
-
24
- if (format) {
25
- nv = format(nv, colSchema);
26
- }
27
- if (defaultFormatters[type]) {
28
- nv = defaultFormatters[type](nv, colSchema);
29
- }
30
- if (validate) {
31
- error = validate(nv, colSchema, entity);
32
- }
33
- if (!error) {
34
- const validator =
35
- defaultValidators[type] ||
36
- type === "string" ||
37
- (type === undefined && defaultValidators.string);
38
- if (validator) {
39
- error = validator(nv, colSchema);
40
- }
41
- }
42
- set(entity, path, nv);
43
- return { entity, error };
44
- };
@@ -1,20 +0,0 @@
1
- import { get } from "lodash-es";
2
- import { isString } from "lodash-es";
3
- import { isTruthy } from "./isTruthy";
4
-
5
- export const getCellVal = (ent, path, col) => {
6
- const isBool = col?.type === "boolean";
7
- let selectedCellVal = get(ent, path, "");
8
- if (isBool) {
9
- if (isString(selectedCellVal)) {
10
- selectedCellVal = selectedCellVal.toLowerCase();
11
- }
12
- selectedCellVal =
13
- selectedCellVal === "true" ||
14
- selectedCellVal === true ||
15
- selectedCellVal === 1 ||
16
- selectedCellVal === "yes";
17
- selectedCellVal = isTruthy(selectedCellVal);
18
- }
19
- return selectedCellVal;
20
- };
@@ -1,8 +0,0 @@
1
- import { isFunction } from "lodash-es";
2
-
3
- export function getVals(values) {
4
- if (isFunction(values)) {
5
- return values();
6
- }
7
- return values;
8
- }