@teselagen/ui 0.7.27 → 0.7.32
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/getRowCopyText.d.ts +1 -3
- package/DataTable/utils/handleCopyRows.d.ts +1 -5
- package/DataTable/utils/index.d.ts +0 -1
- package/DataTable/utils/rowClick.d.ts +1 -1
- package/FormComponents/Uploader.d.ts +1 -3
- package/MenuBar/index.d.ts +1 -3
- package/ResizableDraggableDialog/index.d.ts +1 -3
- package/TagSelect/index.d.ts +1 -1
- package/index.cjs.js +25628 -24898
- package/index.es.js +24577 -23847
- package/package.json +8 -12
- package/src/DataTable/index.js +7 -5
- package/src/index.js +0 -1
- package/src/utils/isBeingCalledExcessively.js +1 -0
- package/utils/hotkeyUtils.d.ts +1 -3
- package/DataTable/EditabelCell.d.ts +0 -10
- package/DataTable/defaultProps.d.ts +0 -43
- package/DataTable/utils/computePresets.d.ts +0 -1
- package/src/DataTable/EditabelCell.js +0 -55
- package/src/DataTable/defaultProps.js +0 -45
- package/src/DataTable/utils/computePresets.js +0 -42
- /package/{style.css → ui.css} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.32",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,19 +11,13 @@
|
|
|
11
11
|
"./style.css": "./style.css"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@teselagen/file-utils": "0.3.20",
|
|
15
|
-
"@teselagen/bounce-loader": "0.3.11",
|
|
16
14
|
"@blueprintjs/core": "3.54.0",
|
|
17
15
|
"@blueprintjs/datetime": "^3.24.1",
|
|
18
|
-
"@blueprintjs/icons": "3.33.0",
|
|
19
16
|
"@blueprintjs/select": "3.18.11",
|
|
20
17
|
"@dnd-kit/core": "^6.1.0",
|
|
21
18
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
22
19
|
"@dnd-kit/sortable": "^8.0.0",
|
|
23
|
-
"@dnd-kit/utilities": "3.2.2",
|
|
24
20
|
"@teselagen/react-table": "6.10.16",
|
|
25
|
-
"bluebird": "3.7.2",
|
|
26
|
-
"buffer": "5.7.1",
|
|
27
21
|
"classnames": "^2.3.2",
|
|
28
22
|
"color": "^3.2.1",
|
|
29
23
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -33,12 +27,9 @@
|
|
|
33
27
|
"fuse.js": "^6.6.2",
|
|
34
28
|
"fuzzysearch": "^1.0.3",
|
|
35
29
|
"immer": "^9.0.15",
|
|
36
|
-
"is-mobile": "^3.0.0",
|
|
37
|
-
"jszip": "^3.10.1",
|
|
38
30
|
"lodash-es": "^4.17.21",
|
|
39
31
|
"math-expression-evaluator": "^1.3.7",
|
|
40
32
|
"mobx": "^6.10.2",
|
|
41
|
-
"mock-fs": "5.2.0",
|
|
42
33
|
"nanoid": "^4.0.0",
|
|
43
34
|
"papaparse": "5.3.2",
|
|
44
35
|
"qs": "^6.9.6",
|
|
@@ -49,7 +40,7 @@
|
|
|
49
40
|
"react-markdown": "9.0.1",
|
|
50
41
|
"react-redux": "^8.0.5",
|
|
51
42
|
"react-rnd": "^10.2.4",
|
|
52
|
-
"react-router-dom": "
|
|
43
|
+
"react-router-dom": "5",
|
|
53
44
|
"react-transition-group": "^2.4.0",
|
|
54
45
|
"recompose": "npm:react-recompose@0.31.1",
|
|
55
46
|
"redux": "^4.1.2",
|
|
@@ -59,7 +50,12 @@
|
|
|
59
50
|
"tippy.js": "^6.3.7",
|
|
60
51
|
"url-join": "^4.0.1",
|
|
61
52
|
"use-deep-compare-effect": "^1.6.1",
|
|
62
|
-
"write-excel-file": "^1.4.25"
|
|
53
|
+
"write-excel-file": "^1.4.25",
|
|
54
|
+
"cypress-real-events": "^1.13.0",
|
|
55
|
+
"chance": "^1.1.11",
|
|
56
|
+
"@dnd-kit/utilities": "3.2.2",
|
|
57
|
+
"@teselagen/file-utils": "0.3.20",
|
|
58
|
+
"@blueprintjs/icons": "3.33.0"
|
|
63
59
|
},
|
|
64
60
|
"license": "MIT"
|
|
65
61
|
}
|
package/src/DataTable/index.js
CHANGED
|
@@ -489,7 +489,8 @@ const DataTable = ({
|
|
|
489
489
|
withSearch = !isSimple,
|
|
490
490
|
withSelectAll,
|
|
491
491
|
withSort,
|
|
492
|
-
withTitle = !isSimple
|
|
492
|
+
withTitle = !isSimple,
|
|
493
|
+
noExcessiveCheck
|
|
493
494
|
} = props;
|
|
494
495
|
|
|
495
496
|
const _entities = useMemo(
|
|
@@ -504,7 +505,7 @@ const DataTable = ({
|
|
|
504
505
|
// This is because we need to maintain the reduxFormSelectedEntityIdMap and
|
|
505
506
|
// allOrderedEntities updated
|
|
506
507
|
useEffect(() => {
|
|
507
|
-
isBeingCalledExcessively({ uniqName: `dt_entities_${formName}` });
|
|
508
|
+
!noExcessiveCheck && isBeingCalledExcessively({ uniqName: `dt_entities_${formName}` });
|
|
508
509
|
change("allOrderedEntities", entitiesAcrossPages);
|
|
509
510
|
if (entities.length === 0 || isEmpty(reduxFormSelectedEntityIdMap)) return;
|
|
510
511
|
changeSelectedEntities({
|
|
@@ -513,7 +514,7 @@ const DataTable = ({
|
|
|
513
514
|
change
|
|
514
515
|
});
|
|
515
516
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
516
|
-
}, [entitiesAcrossPages, reduxFormSelectedEntityIdMap, change]);
|
|
517
|
+
}, [entitiesAcrossPages, reduxFormSelectedEntityIdMap, change, noExcessiveCheck]);
|
|
517
518
|
|
|
518
519
|
const [tableConfig, setTableConfig] = useState({ fieldOptions: [] });
|
|
519
520
|
|
|
@@ -525,7 +526,7 @@ const DataTable = ({
|
|
|
525
526
|
} else {
|
|
526
527
|
newTableConfig = getTableConfigFromStorage(formName);
|
|
527
528
|
}
|
|
528
|
-
isBeingCalledExcessively({ uniqName: `dt_setTableConfig_${formName}` });
|
|
529
|
+
!noExcessiveCheck && isBeingCalledExcessively({ uniqName: `dt_setTableConfig_${formName}` });
|
|
529
530
|
// if the tableConfig is the same as the newTableConfig, don't update
|
|
530
531
|
setTableConfig(prev => {
|
|
531
532
|
if (!newTableConfig) {
|
|
@@ -547,7 +548,8 @@ const DataTable = ({
|
|
|
547
548
|
formName,
|
|
548
549
|
syncDisplayOptionsToDb,
|
|
549
550
|
tableConfigurations,
|
|
550
|
-
withDisplayOptions
|
|
551
|
+
withDisplayOptions,
|
|
552
|
+
noExcessiveCheck
|
|
551
553
|
]);
|
|
552
554
|
|
|
553
555
|
const schema = useMemo(() => {
|
package/src/index.js
CHANGED
package/utils/hotkeyUtils.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export function comboToLabel(def: any, useSymbols?: boolean): any;
|
|
2
2
|
export function hotkeysById(hotkeys: any, mode?: string): (id: any) => any;
|
|
3
3
|
export function getHotkeyProps(def: any, id: any): any;
|
|
4
|
-
export function withHotkeys(hotkeys: any, handlers: any): ({ children }?: {
|
|
5
|
-
children: any;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export function withHotkeys(hotkeys: any, handlers: any): ({ children }?: {}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function EditableCell({ cancelEdit, dataTest, finishEdit, initialValue, isEditableCellInitialValue, isNumeric, shouldSelectAll, stopSelectAll }: {
|
|
2
|
-
cancelEdit: any;
|
|
3
|
-
dataTest: any;
|
|
4
|
-
finishEdit: any;
|
|
5
|
-
initialValue: any;
|
|
6
|
-
isEditableCellInitialValue: any;
|
|
7
|
-
isNumeric: any;
|
|
8
|
-
shouldSelectAll: any;
|
|
9
|
-
stopSelectAll: any;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { noop } from 'lodash-es';
|
|
2
|
-
declare namespace _default {
|
|
3
|
-
export { noop as addFilters };
|
|
4
|
-
export let className: string;
|
|
5
|
-
export { noop as clearFilters };
|
|
6
|
-
export { noop as contextMenu };
|
|
7
|
-
export let disabled: boolean;
|
|
8
|
-
export let entities: never[];
|
|
9
|
-
export let extraClasses: string;
|
|
10
|
-
export let filters: never[];
|
|
11
|
-
export let isCopyable: boolean;
|
|
12
|
-
export { noop as isEntityDisabled };
|
|
13
|
-
export let isLoading: boolean;
|
|
14
|
-
export let isSimple: boolean;
|
|
15
|
-
export let isSingleSelect: boolean;
|
|
16
|
-
export let maxHeight: number;
|
|
17
|
-
export let noHeader: boolean;
|
|
18
|
-
export let noSelect: boolean;
|
|
19
|
-
export let noUserSelect: boolean;
|
|
20
|
-
export { noop as onDeselect };
|
|
21
|
-
export { noop as onMultiRowSelect };
|
|
22
|
-
export { noop as onRowClick };
|
|
23
|
-
export { noop as onRowSelect };
|
|
24
|
-
export { noop as onSingleRowSelect };
|
|
25
|
-
export let page: number;
|
|
26
|
-
export let pageSize: number;
|
|
27
|
-
export let reduxFormExpandedEntityIdMap: {};
|
|
28
|
-
export let reduxFormSearchInput: string;
|
|
29
|
-
export let reduxFormSelectedEntityIdMap: {};
|
|
30
|
-
export { noop as removeSingleFilter };
|
|
31
|
-
export let resized: never[];
|
|
32
|
-
export { noop as resizePersist };
|
|
33
|
-
export { noop as setFilter };
|
|
34
|
-
export { noop as setOrder };
|
|
35
|
-
export { noop as setPage };
|
|
36
|
-
export { noop as setPageSize };
|
|
37
|
-
export { noop as setSearchTerm };
|
|
38
|
-
export let showCount: boolean;
|
|
39
|
-
export let style: {};
|
|
40
|
-
export let withCheckboxes: boolean;
|
|
41
|
-
export let withSort: boolean;
|
|
42
|
-
}
|
|
43
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function computePresets(props?: {}): import('lodash').Dictionary<any>;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
-
|
|
3
|
-
export const EditableCell = ({
|
|
4
|
-
cancelEdit,
|
|
5
|
-
dataTest,
|
|
6
|
-
finishEdit,
|
|
7
|
-
initialValue,
|
|
8
|
-
isEditableCellInitialValue,
|
|
9
|
-
isNumeric,
|
|
10
|
-
shouldSelectAll,
|
|
11
|
-
stopSelectAll
|
|
12
|
-
}) => {
|
|
13
|
-
const [value, setValue] = useState(initialValue);
|
|
14
|
-
const inputRef = useRef(null);
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
if (inputRef.current) {
|
|
18
|
-
inputRef.current.focus();
|
|
19
|
-
if (isEditableCellInitialValue && !isNumeric) {
|
|
20
|
-
inputRef.current.selectionStart = inputRef.current.value.length;
|
|
21
|
-
inputRef.current.selectionEnd = inputRef.current.value.length;
|
|
22
|
-
} else if (shouldSelectAll) {
|
|
23
|
-
inputRef.current.select();
|
|
24
|
-
stopSelectAll();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}, [isEditableCellInitialValue, isNumeric, shouldSelectAll, stopSelectAll]);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<input
|
|
31
|
-
style={{
|
|
32
|
-
border: 0,
|
|
33
|
-
width: "95%",
|
|
34
|
-
fontSize: 12,
|
|
35
|
-
background: "none"
|
|
36
|
-
}}
|
|
37
|
-
ref={inputRef}
|
|
38
|
-
{...dataTest}
|
|
39
|
-
autoFocus
|
|
40
|
-
onKeyDown={e => {
|
|
41
|
-
if (e.key === "Enter") {
|
|
42
|
-
finishEdit(value);
|
|
43
|
-
e.stopPropagation();
|
|
44
|
-
} else if (e.key === "Escape") {
|
|
45
|
-
e.stopPropagation();
|
|
46
|
-
cancelEdit();
|
|
47
|
-
}
|
|
48
|
-
}}
|
|
49
|
-
onBlur={() => finishEdit(value)}
|
|
50
|
-
onChange={e => setValue(e.target.value)}
|
|
51
|
-
type={isNumeric ? "number" : undefined}
|
|
52
|
-
value={value}
|
|
53
|
-
/>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { noop } from "lodash-es";
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line import/no-anonymous-default-export
|
|
4
|
-
export default {
|
|
5
|
-
//NOTE: DO NOT SET DEFAULTS HERE FOR PROPS THAT GET COMPUTED AS PART OF PRESET GROUPS IN computePresets
|
|
6
|
-
addFilters: noop,
|
|
7
|
-
className: "",
|
|
8
|
-
clearFilters: noop,
|
|
9
|
-
contextMenu: noop,
|
|
10
|
-
disabled: false,
|
|
11
|
-
entities: [],
|
|
12
|
-
extraClasses: "",
|
|
13
|
-
filters: [],
|
|
14
|
-
isCopyable: true,
|
|
15
|
-
isEntityDisabled: noop,
|
|
16
|
-
isLoading: false,
|
|
17
|
-
isSimple: false,
|
|
18
|
-
isSingleSelect: false,
|
|
19
|
-
maxHeight: 600,
|
|
20
|
-
noHeader: false,
|
|
21
|
-
noSelect: false,
|
|
22
|
-
noUserSelect: false,
|
|
23
|
-
onDeselect: noop,
|
|
24
|
-
onMultiRowSelect: noop,
|
|
25
|
-
onRowClick: noop,
|
|
26
|
-
onRowSelect: noop,
|
|
27
|
-
onSingleRowSelect: noop,
|
|
28
|
-
page: 1,
|
|
29
|
-
pageSize: 10,
|
|
30
|
-
reduxFormExpandedEntityIdMap: {},
|
|
31
|
-
reduxFormSearchInput: "",
|
|
32
|
-
reduxFormSelectedEntityIdMap: {},
|
|
33
|
-
removeSingleFilter: noop,
|
|
34
|
-
resized: [],
|
|
35
|
-
resizePersist: noop,
|
|
36
|
-
setFilter: noop,
|
|
37
|
-
setOrder: noop,
|
|
38
|
-
setPage: noop,
|
|
39
|
-
setPageSize: noop,
|
|
40
|
-
setSearchTerm: noop,
|
|
41
|
-
showCount: false,
|
|
42
|
-
style: {},
|
|
43
|
-
withCheckboxes: false,
|
|
44
|
-
withSort: true
|
|
45
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { omitBy, isNil } from "lodash-es";
|
|
2
|
-
//we use this to make adding preset prop groups simpler
|
|
3
|
-
export default function computePresets(props = {}) {
|
|
4
|
-
const { isSimple } = props;
|
|
5
|
-
let toReturn = omitBy(props, isNil);
|
|
6
|
-
toReturn.pageSize = toReturn.controlled_pageSize || toReturn.pageSize;
|
|
7
|
-
if (isSimple) {
|
|
8
|
-
//isSimplePreset
|
|
9
|
-
toReturn = {
|
|
10
|
-
noHeader: true,
|
|
11
|
-
noFooter: !props.withPaging,
|
|
12
|
-
noPadding: true,
|
|
13
|
-
noFullscreenButton: true,
|
|
14
|
-
hidePageSizeWhenPossible: !props.withPaging,
|
|
15
|
-
isInfinite: !props.withPaging,
|
|
16
|
-
hideSelectedCount: true,
|
|
17
|
-
withTitle: false,
|
|
18
|
-
withSearch: false,
|
|
19
|
-
compact: true,
|
|
20
|
-
withPaging: false,
|
|
21
|
-
withFilter: false,
|
|
22
|
-
...toReturn
|
|
23
|
-
};
|
|
24
|
-
} else {
|
|
25
|
-
toReturn = {
|
|
26
|
-
// the usual defaults:
|
|
27
|
-
noFooter: false,
|
|
28
|
-
noPadding: false,
|
|
29
|
-
compact: true,
|
|
30
|
-
noFullscreenButton: false,
|
|
31
|
-
hidePageSizeWhenPossible: false,
|
|
32
|
-
isInfinite: false,
|
|
33
|
-
hideSelectedCount: false,
|
|
34
|
-
withTitle: true,
|
|
35
|
-
withSearch: true,
|
|
36
|
-
withPaging: true,
|
|
37
|
-
withFilter: true,
|
|
38
|
-
...toReturn
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
return toReturn || {};
|
|
42
|
-
}
|
/package/{style.css → ui.css}
RENAMED
|
File without changes
|