@teselagen/ui 0.4.19-beta.1 → 0.4.19-beta.10

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 (45) hide show
  1. package/DataTable/Columns.d.ts +1 -0
  2. package/DataTable/DisplayOptions.d.ts +14 -14
  3. package/DataTable/EditabelCell.d.ts +3 -5
  4. package/DataTable/PagingTool.d.ts +24 -2
  5. package/DataTable/SearchBar.d.ts +2 -2
  6. package/DataTable/SortableColumns.d.ts +6 -9
  7. package/DataTable/ThComponent.d.ts +9 -0
  8. package/DataTable/utils/handleCopyTable.d.ts +1 -0
  9. package/DataTable/utils/index.d.ts +3 -2
  10. package/DataTable/utils/primarySelectedValue.d.ts +1 -0
  11. package/DataTable/utils/queryParams.d.ts +6 -0
  12. package/DataTable/utils/rowClick.d.ts +14 -1
  13. package/DataTable/utils/useTableParams.d.ts +49 -0
  14. package/FormComponents/index.d.ts +20 -4
  15. package/FormComponents/utils.d.ts +0 -23
  16. package/index.cjs.js +43719 -48320
  17. package/index.es.js +43591 -48192
  18. package/package.json +2 -2
  19. package/src/DataTable/CellDragHandle.js +65 -63
  20. package/src/DataTable/Columns.js +1064 -0
  21. package/src/DataTable/DisplayOptions.js +173 -192
  22. package/src/DataTable/EditabelCell.js +6 -16
  23. package/src/DataTable/PagingTool.js +39 -55
  24. package/src/DataTable/SearchBar.js +3 -3
  25. package/src/DataTable/SortableColumns.js +44 -39
  26. package/src/DataTable/ThComponent.js +44 -0
  27. package/src/DataTable/dataTableEnhancer.js +35 -294
  28. package/src/DataTable/index.js +2463 -3067
  29. package/src/DataTable/utils/convertSchema.js +2 -2
  30. package/src/DataTable/utils/handleCopyTable.js +16 -0
  31. package/src/DataTable/utils/index.js +4 -2
  32. package/src/DataTable/utils/primarySelectedValue.js +1 -0
  33. package/src/DataTable/utils/queryParams.js +28 -11
  34. package/src/DataTable/utils/rowClick.js +27 -5
  35. package/src/DataTable/utils/useTableParams.js +362 -0
  36. package/src/DataTable/utils/withTableParams.js +7 -34
  37. package/src/FormComponents/Uploader.js +2 -5
  38. package/src/FormComponents/index.js +679 -88
  39. package/src/FormComponents/utils.js +0 -145
  40. package/src/InfoHelper/index.js +2 -2
  41. package/src/UploadCsvWizard.js +160 -168
  42. package/src/utils/commandControls.js +4 -4
  43. package/src/utils/handlerHelpers.js +19 -25
  44. package/src/utils/hotkeyUtils.js +1 -1
  45. package/style.css +254 -254
@@ -0,0 +1 @@
1
+ export function renderColumns(props: any): any;
@@ -1,14 +1,14 @@
1
- import { default as React } from '../../../../node_modules/react';
2
- export default class DisplayOptions extends React.Component<any, any, any> {
3
- constructor(props: any);
4
- constructor(props: any, context: any);
5
- state: {
6
- isOpen: boolean;
7
- searchTerms: {};
8
- };
9
- openPopover: () => void;
10
- closePopover: () => void;
11
- changeTableDensity: (e: any) => void;
12
- toggleForcedHidden: (e: any) => any;
13
- render(): import("react/jsx-runtime").JSX.Element | null;
14
- }
1
+ export default DisplayOptions;
2
+ declare function DisplayOptions({ compact, extraCompact, disabled, hideDisplayOptionsIcon, resetDefaultVisibility, updateColumnVisibility, updateTableDisplayDensity, showForcedHiddenColumns, setShowForcedHidden, hasOptionForForcedHidden, schema }: {
3
+ compact: any;
4
+ extraCompact: any;
5
+ disabled: any;
6
+ hideDisplayOptionsIcon: any;
7
+ resetDefaultVisibility?: ((...args: any[]) => void) | undefined;
8
+ updateColumnVisibility?: ((...args: any[]) => void) | undefined;
9
+ updateTableDisplayDensity: any;
10
+ showForcedHiddenColumns: any;
11
+ setShowForcedHidden: any;
12
+ hasOptionForForcedHidden: any;
13
+ schema: any;
14
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,10 +1,8 @@
1
- export function EditableCell({ cancelEdit, dataTest, finishEdit, initialValue, isEditableCellInitialValue, isNumeric, shouldSelectAll, stopSelectAll }: {
1
+ export function EditableCell({ value, setValue, cancelEdit, dataTest, finishEdit, isNumeric }: {
2
+ value: any;
3
+ setValue: any;
2
4
  cancelEdit: any;
3
5
  dataTest: any;
4
6
  finishEdit: any;
5
- initialValue: any;
6
- isEditableCellInitialValue: any;
7
7
  isNumeric: any;
8
- shouldSelectAll: any;
9
- stopSelectAll: any;
10
8
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,24 @@
1
- declare const _default: any;
2
- export default _default;
1
+ export default PagingTool;
2
+ declare function PagingTool({ controlled_hasNextPage, controlled_onRefresh, controlled_page, controlled_setPage, controlled_setPageSize, controlled_total, disabled: _disabled, disableSetPageSize, entities, entityCount, hideSetPageSize, hideTotalPages, keepSelectionOnPageChange, onRefresh: _onRefresh, page: _page, pageSize, pagingDisabled, persistPageSize, setPage: _setPage, setPageSize: _setPageSize, setSelectedEntityIdMap }: {
3
+ controlled_hasNextPage: any;
4
+ controlled_onRefresh: any;
5
+ controlled_page: any;
6
+ controlled_setPage: any;
7
+ controlled_setPageSize: any;
8
+ controlled_total: any;
9
+ disabled: any;
10
+ disableSetPageSize: any;
11
+ entities: any;
12
+ entityCount: any;
13
+ hideSetPageSize: any;
14
+ hideTotalPages: any;
15
+ keepSelectionOnPageChange: any;
16
+ onRefresh: any;
17
+ page: any;
18
+ pageSize: any;
19
+ pagingDisabled: any;
20
+ persistPageSize?: ((...args: any[]) => void) | undefined;
21
+ setPage: any;
22
+ setPageSize: any;
23
+ setSelectedEntityIdMap: any;
24
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  export default SearchBar;
2
- declare function SearchBar({ reduxFormSearchInput, setSearchTerm, loading, searchMenuButton, disabled, autoFocusSearch }: {
3
- reduxFormSearchInput: any;
2
+ declare function SearchBar({ searchInput, setSearchTerm, loading, searchMenuButton, disabled, autoFocusSearch }: {
3
+ searchInput: any;
4
4
  setSearchTerm: any;
5
5
  loading: any;
6
6
  searchMenuButton: any;
@@ -1,10 +1,7 @@
1
- import { default as React } from '../../../../node_modules/react';
2
1
  export default SortableColumns;
3
- declare class SortableColumns extends React.Component<any, any, any> {
4
- constructor(props: any);
5
- constructor(props: any, context: any);
6
- shouldCancelStart: (e: any) => boolean;
7
- onSortEnd: (...args: any[]) => void;
8
- onSortStart: () => void;
9
- render(): import("react/jsx-runtime").JSX.Element;
10
- }
2
+ declare function SortableColumns({ className, style, children, moveColumn }: {
3
+ className: any;
4
+ style: any;
5
+ children: any;
6
+ moveColumn: any;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export function ThComponent({ toggleSort, immovable, className, children, style, columnindex, ...rest }: {
2
+ [x: string]: any;
3
+ toggleSort: any;
4
+ immovable: any;
5
+ className: any;
6
+ children: any;
7
+ style: any;
8
+ columnindex: any;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export function handleCopyTable(e: any, opts: any): void;
@@ -1,4 +1,3 @@
1
- import { default as computePresets } from './computePresets';
2
1
  import { defaultParsePaste, getEntityIdToEntity, getFieldPathToIndex, getNumberStrAtEnd, stripNumberAtEnd } from './utils';
3
2
  import { formatPasteData } from './formatPasteData';
4
3
  import { getAllRows } from './getAllRows';
@@ -14,8 +13,10 @@ import { getSelectedRowsFromEntities } from './selection';
14
13
  import { handleCopyColumn } from './handleCopyColumn';
15
14
  import { handleCopyHelper } from './handleCopyHelper';
16
15
  import { handleCopyRows } from './handleCopyRows';
16
+ import { handleCopyTable } from './handleCopyTable';
17
17
  import { isBottomRightCornerOfRectangle } from './isBottomRightCornerOfRectangle';
18
18
  import { isEntityClean } from './isEntityClean';
19
+ import { PRIMARY_SELECTED_VAL } from './primarySelectedValue';
19
20
  import { removeCleanRows } from './removeCleanRows';
20
21
 
21
- export { computePresets, defaultParsePaste, formatPasteData, getAllRows, getCellCopyText, getCellInfo, getEntityIdToEntity, getFieldPathToIndex, getFieldPathToField, getIdOrCodeOrIndex, getLastSelectedEntity, getNewEntToSelect, getNumberStrAtEnd, getRecordsFromIdMap, getRowCopyText, getSelectedRowsFromEntities, handleCopyColumn, handleCopyHelper, handleCopyRows, isBottomRightCornerOfRectangle, isEntityClean, removeCleanRows, stripNumberAtEnd };
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 };
@@ -0,0 +1 @@
1
+ export const PRIMARY_SELECTED_VAL: "main_cell";
@@ -3,6 +3,12 @@ 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;
6
12
  export function getCurrentParamsFromUrl(location: any, isSimple: any): any;
7
13
  export function setCurrentParamsOnUrl(newParams: any, replace: any, isSimple: any): void;
8
14
  export function makeDataTableHandlers({ setNewParams, updateSearch, defaults, onlyOneFilter }: {
@@ -1,4 +1,17 @@
1
- export default function rowClick(e: any, rowInfo: any, entities: any, props: any): void;
1
+ export default function rowClick(e: any, rowInfo: any, entities: any, { reduxFormSelectedEntityIdMap, isSingleSelect, noSelect, onRowClick, isEntityDisabled, withCheckboxes, onDeselect, onSingleRowSelect, onMultiRowSelect, noDeselectAll, onRowSelect, change }: {
2
+ reduxFormSelectedEntityIdMap: any;
3
+ isSingleSelect: any;
4
+ noSelect: any;
5
+ onRowClick: any;
6
+ isEntityDisabled: any;
7
+ withCheckboxes: any;
8
+ onDeselect: any;
9
+ onSingleRowSelect: any;
10
+ onMultiRowSelect: any;
11
+ noDeselectAll: any;
12
+ onRowSelect: any;
13
+ change: any;
14
+ }): void;
2
15
  export function changeSelectedEntities({ idMap, entities, change }: {
3
16
  idMap: any;
4
17
  entities?: any[] | undefined;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Note all these options can be passed at Design Time or at Runtime (like reduxForm())
3
+ *
4
+ * @export
5
+ *
6
+ * @param {compOrOpts} compOrOpts
7
+ * @typedef {object} compOrOpts
8
+ * @property {*string} formName - required unique identifier for the table
9
+ * @property {Object | Function} schema - The data table schema or a function returning it. The function wll be called with props as the argument.
10
+ * @property {boolean} urlConnected - whether the table should connect to/update the URL
11
+ * @property {boolean} withSelectedEntities - whether or not to pass the selected entities
12
+ * @property {boolean} isCodeModel - whether the model is keyed by code instead of id in the db
13
+ * @property {object} defaults - tableParam defaults such as pageSize, filter, etc
14
+ * @property {boolean} noOrderError - won't console an error if an order is not found on schema
15
+ */
16
+ export default function useTableParams(props: any): any;
17
+ /**
18
+ * Note all these options can be passed at Design Time or at Runtime (like reduxForm())
19
+ */
20
+ export type compOrOpts = {
21
+ /**
22
+ * } formName - required unique identifier for the table
23
+ */
24
+ string: any;
25
+ /**
26
+ * - The data table schema or a function returning it. The function wll be called with props as the argument.
27
+ */
28
+ schema: Object | Function;
29
+ /**
30
+ * - whether the table should connect to/update the URL
31
+ */
32
+ urlConnected: boolean;
33
+ /**
34
+ * - whether or not to pass the selected entities
35
+ */
36
+ withSelectedEntities: boolean;
37
+ /**
38
+ * - whether the model is keyed by code instead of id in the db
39
+ */
40
+ isCodeModel: boolean;
41
+ /**
42
+ * - tableParam defaults such as pageSize, filter, etc
43
+ */
44
+ defaults: object;
45
+ /**
46
+ * - won't console an error if an order is not found on schema
47
+ */
48
+ noOrderError: boolean;
49
+ };
@@ -1,6 +1,5 @@
1
1
  import { fieldRequired } from './utils';
2
2
  import { default as React } from '../../../../node_modules/react';
3
- /** RENDER UTILS */
4
3
  export function generateField(component: any, opts: any): ({ name, isRequired, onFieldSubmit, noRedux, ...rest }: {
5
4
  [x: string]: any;
6
5
  name: any;
@@ -12,9 +11,20 @@ export { fieldRequired };
12
11
  export function renderBlueprintDateInput(props: any): import("react/jsx-runtime").JSX.Element;
13
12
  export function renderBlueprintDateRangeInput(props: any): import("react/jsx-runtime").JSX.Element;
14
13
  export function RenderBlueprintInput(props: any): import("react/jsx-runtime").JSX.Element;
15
- export function renderBlueprintCheckbox(props: any): import("react/jsx-runtime").JSX.Element;
14
+ export function renderBlueprintCheckbox({ input, label, tooltipInfo, beforeOnChange, onFieldSubmit, ...rest }: {
15
+ [x: string]: any;
16
+ input: any;
17
+ label: any;
18
+ tooltipInfo: any;
19
+ beforeOnChange: any;
20
+ onFieldSubmit: any;
21
+ }): import("react/jsx-runtime").JSX.Element;
16
22
  export function renderBlueprintSwitch(props: any): import("react/jsx-runtime").JSX.Element;
17
- export function renderFileUpload(props: any): import("react/jsx-runtime").JSX.Element;
23
+ export function renderFileUpload({ input, onFieldSubmit, ...rest }: {
24
+ [x: string]: any;
25
+ input: any;
26
+ onFieldSubmit: any;
27
+ }): import("react/jsx-runtime").JSX.Element;
18
28
  export class renderBlueprintTextarea extends React.Component<any, any, any> {
19
29
  constructor(props: any);
20
30
  constructor(props: any, context: any);
@@ -46,7 +56,13 @@ export function renderBlueprintRadioGroup({ input, options, onFieldSubmit, ...re
46
56
  options: any;
47
57
  onFieldSubmit: any;
48
58
  }): import("react/jsx-runtime").JSX.Element;
49
- export function renderReactColorPicker(props: any): import("react/jsx-runtime").JSX.Element;
59
+ export class RenderReactColorPicker extends React.Component<any, any, any> {
60
+ constructor(props: any);
61
+ constructor(props: any, context: any);
62
+ handleChange: (color: any) => void;
63
+ render(): import("react/jsx-runtime").JSX.Element;
64
+ }
65
+ export function withAbstractWrapper(ComponentToWrap: any, opts?: {}): (props: any) => import("react/jsx-runtime").JSX.Element;
50
66
  export function InputField({ name, isRequired, onFieldSubmit, noRedux, ...rest }: {
51
67
  [x: string]: any;
52
68
  name: any;
@@ -1,25 +1,2 @@
1
- export function getIntent({ showErrorIfUntouched, meta: { touched, error, warning } }: {
2
- showErrorIfUntouched: any;
3
- meta: {
4
- touched: any;
5
- error: any;
6
- warning: any;
7
- };
8
- }): "warning" | "danger" | undefined;
9
- export function getIntentClass(...args: any[]): string;
10
- export function removeUnwantedProps(props: any): any;
11
- export function LabelWithTooltipInfo({ label, tooltipInfo, labelStyle }: {
12
- label: any;
13
- tooltipInfo: any;
14
- labelStyle: any;
15
- }): any;
16
- export function getNewName(list: any, targetName: any): any;
17
1
  export const REQUIRED_ERROR: "This field is required.";
18
2
  export function fieldRequired(value: any): "This field is required." | undefined;
19
- export function getOptions(options: any): any;
20
- export function fakeWait(): Promise<any>;
21
- export function getCheckboxOrSwitchOnChange({ beforeOnChange, input, onFieldSubmit }: {
22
- beforeOnChange: any;
23
- input: any;
24
- onFieldSubmit: any;
25
- }): (e: any, val: any) => Promise<void>;