@monolith-forensics/monolith-ui 1.9.3-dev.3 → 2.0.0
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/dist/Button/Button.js +11 -4
- package/dist/DropDownMenu/DropDownMenu.js +12 -2
- package/dist/DropDownMenu/components/MenuComponent.js +7 -1
- package/dist/DropDownMenu/components/MenuItem.js +4 -2
- package/dist/DropDownMenu/components/MenuItemList.d.ts +1 -0
- package/dist/DropDownMenu/components/MenuItemList.js +17 -7
- package/dist/DropDownMenu/components/SearchInput.js +2 -1
- package/dist/DropDownMenu/components/StyledContent.js +3 -2
- package/dist/DropDownMenu/constants.d.ts +4 -0
- package/dist/DropDownMenu/constants.js +4 -0
- package/dist/QueryFilter/DefaultOperators.d.ts +76 -0
- package/dist/QueryFilter/DefaultOperators.js +21 -0
- package/dist/QueryFilter/types.d.ts +66 -0
- package/dist/QueryFilter/types.js +1 -0
- package/dist/RichTextEditor/Enums/Controls.d.ts +2 -0
- package/dist/RichTextEditor/Enums/Controls.js +2 -0
- package/dist/RichTextEditor/Enums/Extensions.d.ts +1 -0
- package/dist/RichTextEditor/Enums/Extensions.js +1 -0
- package/dist/RichTextEditor/Enums/SlashCommands.d.ts +2 -0
- package/dist/RichTextEditor/Enums/SlashCommands.js +2 -0
- package/dist/RichTextEditor/Extensions/BubbleMenuExtension.d.ts +7 -0
- package/dist/RichTextEditor/Extensions/BubbleMenuExtension.js +157 -0
- package/dist/RichTextEditor/Extensions/getSlashCommand.js +19 -1
- package/dist/RichTextEditor/Extensions/getTiptapExtensions.js +16 -1
- package/dist/RichTextEditor/RichTextEditor.js +65 -28
- package/dist/RichTextEditor/Toolbar/Controls.d.ts +14 -0
- package/dist/RichTextEditor/Toolbar/Controls.js +147 -3
- package/dist/RichTextEditor/Toolbar/Labels.d.ts +1 -0
- package/dist/RichTextEditor/Toolbar/Labels.js +1 -0
- package/dist/RichTextEditor/Toolbar/Toolbar.js +28 -2
- package/dist/Table/Utils/resizeHandler.d.ts +3 -0
- package/dist/Table/Utils/resizeHandler.js +84 -0
- package/package.json +4 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import TableDefaults from "../TableDefaults";
|
|
2
|
+
const enableResizeClass = (dataField) => {
|
|
3
|
+
if (dataField === undefined) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
document.querySelectorAll(`.resizer.col-${dataField}`).forEach((resizer) => {
|
|
7
|
+
resizer.classList.add("isResizing");
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
const disableResizeClass = (dataField) => {
|
|
11
|
+
if (dataField === undefined) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
document.querySelectorAll(`.resizer.col-${dataField}`).forEach((resizer) => {
|
|
15
|
+
resizer.classList.remove("isResizing");
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
const resizeHandler = ({ event, columnId, columnProps, onResize, onResizeFinished, }) => {
|
|
19
|
+
let col = event.target
|
|
20
|
+
.parentElement;
|
|
21
|
+
let newColumns = [];
|
|
22
|
+
let x = 0;
|
|
23
|
+
let w = 0;
|
|
24
|
+
const mouseMoveHandler = function (e) {
|
|
25
|
+
const selectedColumn = document.querySelectorAll(`.column-${columnId}`);
|
|
26
|
+
const columnHeaders = document.querySelectorAll(`.mfui-th.column-${columnId}`);
|
|
27
|
+
const dx = e.clientX - x;
|
|
28
|
+
let newWidth = w + dx;
|
|
29
|
+
// Calculate what the minimum width should be
|
|
30
|
+
// min width should be the defined column width or the default min width
|
|
31
|
+
if (columnProps.minWidth === undefined) {
|
|
32
|
+
if (newWidth < TableDefaults.td.minWidth)
|
|
33
|
+
newWidth = TableDefaults.td.minWidth;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if (newWidth < columnProps.minWidth)
|
|
37
|
+
newWidth = columnProps.minWidth;
|
|
38
|
+
}
|
|
39
|
+
selectedColumn.forEach((col) => {
|
|
40
|
+
var _a;
|
|
41
|
+
col.style.width = `${newWidth}px`;
|
|
42
|
+
col.style.flex = "0 0 auto";
|
|
43
|
+
// col.style.maxWidth = `${newWidth}px`;
|
|
44
|
+
// col.style.minWidth = `${newWidth}px`;
|
|
45
|
+
newColumns.push({
|
|
46
|
+
dataField: ((_a = col === null || col === void 0 ? void 0 : col.dataset) === null || _a === void 0 ? void 0 : _a.field) || "",
|
|
47
|
+
width: newWidth,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
newColumns = Array.from(columnHeaders).map((col) => {
|
|
51
|
+
var _a;
|
|
52
|
+
return {
|
|
53
|
+
dataField: ((_a = col === null || col === void 0 ? void 0 : col.dataset) === null || _a === void 0 ? void 0 : _a.field) || "",
|
|
54
|
+
width: newWidth,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
onResize({
|
|
58
|
+
columns: newColumns,
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const mouseUpHandler = function () {
|
|
62
|
+
var _a, _b, _c;
|
|
63
|
+
let newWidth = ((_c = (_b = (_a = document === null || document === void 0 ? void 0 : document.querySelector) === null || _a === void 0 ? void 0 : _a.call(document, `.column-${columnId}`)) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.width) || null;
|
|
64
|
+
if (newWidth) {
|
|
65
|
+
newWidth = newWidth.replace("px", "");
|
|
66
|
+
}
|
|
67
|
+
disableResizeClass(columnId);
|
|
68
|
+
document.removeEventListener("mousemove", mouseMoveHandler);
|
|
69
|
+
document.removeEventListener("mouseup", mouseUpHandler);
|
|
70
|
+
onResizeFinished === null || onResizeFinished === void 0 ? void 0 : onResizeFinished({
|
|
71
|
+
column: columnProps,
|
|
72
|
+
columnId: columnId,
|
|
73
|
+
targetColumn: document.querySelector(`.column-${columnId}`),
|
|
74
|
+
newWidth,
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
x = event.clientX;
|
|
78
|
+
const styles = window.getComputedStyle(col);
|
|
79
|
+
w = parseInt(styles.width, 10);
|
|
80
|
+
document.addEventListener("mousemove", mouseMoveHandler);
|
|
81
|
+
document.addEventListener("mouseup", mouseUpHandler);
|
|
82
|
+
enableResizeClass(columnId);
|
|
83
|
+
};
|
|
84
|
+
export default resizeHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monolith-forensics/monolith-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"author": "Matt Danner (Monolith Forensics LLC)",
|
|
@@ -48,7 +48,10 @@
|
|
|
48
48
|
"@tiptap/extension-horizontal-rule": "3.22.4",
|
|
49
49
|
"@tiptap/extension-image": "3.22.4",
|
|
50
50
|
"@tiptap/extension-link": "3.22.4",
|
|
51
|
+
"@tiptap/extension-list": "3.22.4",
|
|
51
52
|
"@tiptap/extension-table": "3.22.4",
|
|
53
|
+
"@tiptap/extension-task-item": "3.22.4",
|
|
54
|
+
"@tiptap/extension-task-list": "3.22.4",
|
|
52
55
|
"@tiptap/extension-text-align": "3.22.4",
|
|
53
56
|
"@tiptap/extension-text-style": "3.22.4",
|
|
54
57
|
"@tiptap/extensions": "3.22.4",
|