@teselagen/ui 0.7.35 → 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 (160) hide show
  1. package/isBeingCalledExcessively.js +1 -0
  2. package/package.json +1 -1
  3. package/DataTable/utils/filterLocalEntitiesToHasura.d.ts +0 -5
  4. package/DataTable/utils/initializeHasuraWhereAndFilter.d.ts +0 -2
  5. package/DataTable/utils/tableQueryParamsToHasuraClauses.d.ts +0 -26
  6. package/src/AdvancedOptions.js +0 -33
  7. package/src/AdvancedOptions.spec.js +0 -26
  8. package/src/AssignDefaultsModeContext.js +0 -22
  9. package/src/AsyncValidateFieldSpinner/index.js +0 -12
  10. package/src/BlueprintError/index.js +0 -14
  11. package/src/BounceLoader/index.js +0 -16
  12. package/src/BounceLoader/style.css +0 -45
  13. package/src/CollapsibleCard/index.js +0 -68
  14. package/src/CollapsibleCard/style.css +0 -23
  15. package/src/DNALoader/index.js +0 -20
  16. package/src/DNALoader/style.css +0 -251
  17. package/src/DataTable/CellDragHandle.js +0 -132
  18. package/src/DataTable/ColumnFilterMenu.js +0 -62
  19. package/src/DataTable/Columns.js +0 -979
  20. package/src/DataTable/DisabledLoadingComponent.js +0 -15
  21. package/src/DataTable/DisplayOptions.js +0 -199
  22. package/src/DataTable/DropdownCell.js +0 -61
  23. package/src/DataTable/EditableCell.js +0 -44
  24. package/src/DataTable/FilterAndSortMenu.js +0 -388
  25. package/src/DataTable/PagingTool.js +0 -225
  26. package/src/DataTable/RenderCell.js +0 -191
  27. package/src/DataTable/SearchBar.js +0 -69
  28. package/src/DataTable/SortableColumns.js +0 -100
  29. package/src/DataTable/TableFormTrackerContext.js +0 -10
  30. package/src/DataTable/ThComponent.js +0 -44
  31. package/src/DataTable/dataTableEnhancer.js +0 -41
  32. package/src/DataTable/defaultFormatters.js +0 -32
  33. package/src/DataTable/defaultValidators.js +0 -40
  34. package/src/DataTable/editCellHelper.js +0 -44
  35. package/src/DataTable/getCellVal.js +0 -20
  36. package/src/DataTable/getVals.js +0 -8
  37. package/src/DataTable/index.js +0 -3209
  38. package/src/DataTable/isTruthy.js +0 -12
  39. package/src/DataTable/isValueEmpty.js +0 -3
  40. package/src/DataTable/style.css +0 -608
  41. package/src/DataTable/utils/convertSchema.js +0 -69
  42. package/src/DataTable/utils/filterLocalEntitiesToHasura.js +0 -236
  43. package/src/DataTable/utils/filterLocalEntitiesToHasura.test.js +0 -587
  44. package/src/DataTable/utils/formatPasteData.js +0 -16
  45. package/src/DataTable/utils/getAllRows.js +0 -11
  46. package/src/DataTable/utils/getCellCopyText.js +0 -7
  47. package/src/DataTable/utils/getCellInfo.js +0 -36
  48. package/src/DataTable/utils/getFieldPathToField.js +0 -7
  49. package/src/DataTable/utils/getIdOrCodeOrIndex.js +0 -9
  50. package/src/DataTable/utils/getLastSelectedEntity.js +0 -11
  51. package/src/DataTable/utils/getNewEntToSelect.js +0 -25
  52. package/src/DataTable/utils/getRowCopyText.js +0 -28
  53. package/src/DataTable/utils/getTableConfigFromStorage.js +0 -5
  54. package/src/DataTable/utils/handleCopyColumn.js +0 -21
  55. package/src/DataTable/utils/handleCopyHelper.js +0 -15
  56. package/src/DataTable/utils/handleCopyRows.js +0 -23
  57. package/src/DataTable/utils/handleCopyTable.js +0 -16
  58. package/src/DataTable/utils/index.js +0 -55
  59. package/src/DataTable/utils/initializeHasuraWhereAndFilter.js +0 -26
  60. package/src/DataTable/utils/isBottomRightCornerOfRectangle.js +0 -20
  61. package/src/DataTable/utils/isEntityClean.js +0 -15
  62. package/src/DataTable/utils/primarySelectedValue.js +0 -1
  63. package/src/DataTable/utils/queryParams.js +0 -350
  64. package/src/DataTable/utils/removeCleanRows.js +0 -22
  65. package/src/DataTable/utils/rowClick.js +0 -181
  66. package/src/DataTable/utils/selection.js +0 -8
  67. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.js +0 -253
  68. package/src/DataTable/utils/tableQueryParamsToHasuraClauses.test.js +0 -206
  69. package/src/DataTable/utils/useTableEntities.js +0 -38
  70. package/src/DataTable/utils/utils.js +0 -37
  71. package/src/DataTable/utils/withSelectedEntities.js +0 -65
  72. package/src/DataTable/utils/withTableParams.js +0 -288
  73. package/src/DataTable/validateTableWideErrors.js +0 -160
  74. package/src/DataTable/viewColumn.js +0 -97
  75. package/src/DialogFooter/index.js +0 -86
  76. package/src/DialogFooter/style.css +0 -9
  77. package/src/DropdownButton.js +0 -36
  78. package/src/FillWindow.css +0 -6
  79. package/src/FillWindow.js +0 -69
  80. package/src/FormComponents/FormSeparator.js +0 -9
  81. package/src/FormComponents/LoadingDots.js +0 -14
  82. package/src/FormComponents/Uploader.js +0 -1278
  83. package/src/FormComponents/getNewName.js +0 -31
  84. package/src/FormComponents/index.js +0 -1266
  85. package/src/FormComponents/itemUpload.js +0 -84
  86. package/src/FormComponents/sortify.js +0 -73
  87. package/src/FormComponents/style.css +0 -275
  88. package/src/FormComponents/tryToMatchSchemas.js +0 -264
  89. package/src/FormComponents/utils.js +0 -6
  90. package/src/HotkeysDialog/index.js +0 -79
  91. package/src/HotkeysDialog/style.css +0 -54
  92. package/src/InfoHelper/index.js +0 -78
  93. package/src/InfoHelper/style.css +0 -7
  94. package/src/IntentText/index.js +0 -18
  95. package/src/Loading/index.js +0 -70
  96. package/src/Loading/style.css +0 -4
  97. package/src/MatchHeaders.js +0 -234
  98. package/src/MenuBar/index.js +0 -423
  99. package/src/MenuBar/style.css +0 -45
  100. package/src/PromptUnsavedChanges/index.js +0 -38
  101. package/src/ResizableDraggableDialog/index.js +0 -141
  102. package/src/ResizableDraggableDialog/style.css +0 -42
  103. package/src/ScrollToTop/index.js +0 -72
  104. package/src/SimpleStepViz.js +0 -22
  105. package/src/Tag.js +0 -112
  106. package/src/TagSelect/index.js +0 -69
  107. package/src/TagSelect/style.css +0 -13
  108. package/src/TgHtmlSelect/index.js +0 -20
  109. package/src/TgSelect/index.js +0 -537
  110. package/src/TgSelect/style.css +0 -61
  111. package/src/TgSuggest/index.js +0 -124
  112. package/src/Timeline/TimelineEvent.js +0 -31
  113. package/src/Timeline/index.js +0 -15
  114. package/src/Timeline/style.css +0 -29
  115. package/src/UploadCsvWizard.css +0 -4
  116. package/src/UploadCsvWizard.js +0 -719
  117. package/src/autoTooltip.js +0 -201
  118. package/src/constants.js +0 -1
  119. package/src/customIcons.js +0 -361
  120. package/src/enhancers/withDialog/index.js +0 -196
  121. package/src/enhancers/withDialog/tg_modalState.js +0 -47
  122. package/src/enhancers/withField.js +0 -20
  123. package/src/enhancers/withFields.js +0 -11
  124. package/src/enhancers/withLocalStorage.js +0 -11
  125. package/src/index.js +0 -88
  126. package/src/rerenderOnWindowResize.js +0 -26
  127. package/src/showAppSpinner.js +0 -12
  128. package/src/showConfirmationDialog/index.js +0 -148
  129. package/src/showDialogOnDocBody.js +0 -33
  130. package/src/style.css +0 -265
  131. package/src/throwFormError.js +0 -16
  132. package/src/toastr.js +0 -148
  133. package/src/typeToCommonType.js +0 -6
  134. package/src/useDialog.js +0 -63
  135. package/src/utils/adHoc.js +0 -10
  136. package/src/utils/basicHandleActionsWithFullState.js +0 -14
  137. package/src/utils/browserUtils.js +0 -3
  138. package/src/utils/combineReducersWithFullState.js +0 -14
  139. package/src/utils/commandControls.js +0 -82
  140. package/src/utils/commandUtils.js +0 -112
  141. package/src/utils/determineBlackOrWhiteTextColor.js +0 -4
  142. package/src/utils/getDayjsFormatter.js +0 -35
  143. package/src/utils/getTextFromEl.js +0 -28
  144. package/src/utils/handlerHelpers.js +0 -24
  145. package/src/utils/hooks/index.js +0 -1
  146. package/src/utils/hooks/useDeepEqualMemo.js +0 -15
  147. package/src/utils/hooks/useStableReference.js +0 -9
  148. package/src/utils/hotkeyUtils.js +0 -131
  149. package/src/utils/isBeingCalledExcessively.js +0 -24
  150. package/src/utils/menuUtils.js +0 -433
  151. package/src/utils/popoverOverflowModifiers.js +0 -11
  152. package/src/utils/pureNoFunc.js +0 -31
  153. package/src/utils/renderOnDoc.js +0 -32
  154. package/src/utils/showProgressToast.js +0 -22
  155. package/src/utils/tagUtils.js +0 -45
  156. package/src/utils/tgFormValues.js +0 -35
  157. package/src/utils/useTraceUpdate.js +0 -19
  158. package/src/utils/withSelectTableRecords.js +0 -43
  159. package/src/utils/withStore.js +0 -10
  160. 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
- }