@monolith-forensics/monolith-ui 1.1.64 → 1.1.65
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/Loader/Loader.d.ts +3 -0
- package/dist/Loader/Loader.js +40 -0
- package/dist/Loader/index.d.ts +2 -0
- package/dist/Loader/index.js +1 -0
- package/dist/Loader/types.d.ts +7 -0
- package/dist/Loader/types.js +1 -0
- package/dist/SelectBox/SelectBox.js +14 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
const Loader = styled(({ className, style }) => {
|
|
4
|
+
return (_jsx("div", { className: className + " mf-Loader", style: style, children: _jsx("span", { className: "mf-Loader-root" }) }));
|
|
5
|
+
}) `
|
|
6
|
+
display: inline-block;
|
|
7
|
+
margin: auto;
|
|
8
|
+
|
|
9
|
+
.mf-Loader-root {
|
|
10
|
+
display: inline-block;
|
|
11
|
+
width: ${({ size }) => size || 20}px;
|
|
12
|
+
height: ${({ size }) => size || 20}px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.mf-Loader-root:after {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
content: "";
|
|
18
|
+
display: block;
|
|
19
|
+
width: ${({ size }) => size || 20}px;
|
|
20
|
+
height: ${({ size }) => size || 20}px;
|
|
21
|
+
border-radius: 50%;
|
|
22
|
+
border-width: calc(${({ size }) => size || 20}px / 10);
|
|
23
|
+
border-style: solid;
|
|
24
|
+
border-color: ${({ color, theme }) => color || theme.palette.primary.main}
|
|
25
|
+
${({ color, theme }) => color || theme.palette.primary.main}
|
|
26
|
+
${({ color, theme }) => color || theme.palette.primary.main} transparent;
|
|
27
|
+
|
|
28
|
+
animation: spin ${({ speed }) => speed || 600}ms linear infinite;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes spin {
|
|
32
|
+
0% {
|
|
33
|
+
transform: rotate(0deg);
|
|
34
|
+
}
|
|
35
|
+
100% {
|
|
36
|
+
transform: rotate(360deg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
export default Loader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Loader";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
13
13
|
import styled from "styled-components";
|
|
14
14
|
import { useFloating, flip, offset, FloatingPortal, autoUpdate, } from "@floating-ui/react";
|
|
15
15
|
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
16
|
-
import { Input, FieldLabel, Tooltip } from "..";
|
|
16
|
+
import { Input, FieldLabel, Tooltip, Loader } from "..";
|
|
17
17
|
import { useDebouncedCallback } from "use-debounce";
|
|
18
18
|
import { StyledContent, StyledFloatContainer, ArrowButton, ClearButton, } from "../core";
|
|
19
19
|
export const StyledInputContainer = styled.div `
|
|
@@ -465,19 +465,19 @@ DropDownProps = {}, debounceTime = 300, sort = false, }) => {
|
|
|
465
465
|
maxHeight: DropDownProps.autoHeight
|
|
466
466
|
? (dropDownHeight || 250) - 10
|
|
467
467
|
: "",
|
|
468
|
-
}, variant: variant, "data-empty": filteredItems.length === 0 }, DropDownProps, { children: [actionComponent && _jsx(ActionMenu, { children: actionComponent }),
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
468
|
+
}, variant: variant, "data-empty": filteredItems.length === 0 }, DropDownProps, { children: [loading && _jsx(Loader, {}), !loading && actionComponent && (_jsx(ActionMenu, { children: actionComponent })), !loading && (_jsx(StyledInnerItemContainer, { ref: scrollContainerRef, "data-scroll-active": scrollActive, onScroll: onScroll, children: grouped
|
|
469
|
+
? groups.map((group, index) => (_jsxs("div", { children: [_jsx(GroupTitle, { size: size, children: group.label }), group.items.map((item, index) => {
|
|
470
|
+
return (_jsx(Tooltip, { content: OptionTooltip ? (_jsx(OptionTooltip, { data: item.data })) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => handleItemClick(e, item), "data-selected": isObjectArray
|
|
471
|
+
? (selected === null || selected === void 0 ? void 0 : selected.value) ===
|
|
472
|
+
item.value
|
|
473
|
+
: selected === item, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || (_jsx(_Fragment, { children: (item === null || item === void 0 ? void 0 : item.label) || item })) }, index) }, index));
|
|
474
|
+
})] }, group.label)))
|
|
475
|
+
: filteredItems.map((item, index) => {
|
|
476
|
+
return (_jsx(Tooltip, { content: OptionTooltip ? (_jsx(OptionTooltip, { data: item.data })) : null, side: "left", children: _jsx(StyledItem, { className: "mfFloatingItem", onClick: (e) => handleItemClick(e, item), "data-selected": isObjectArray
|
|
477
|
+
? (selected === null || selected === void 0 ? void 0 : selected.value) ===
|
|
478
|
+
(item === null || item === void 0 ? void 0 : item.value)
|
|
479
|
+
: selected === item, size: size, children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || (_jsx(_Fragment, { children: (item === null || item === void 0 ? void 0 : item.label) || item })) }, index) }, index));
|
|
480
|
+
}) }))] })) }) }))] }));
|
|
481
481
|
}) `
|
|
482
482
|
position: relative;
|
|
483
483
|
cursor: pointer;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,3 +29,5 @@ export { default as MonolithUIProvider } from "./MonolithUIProvider";
|
|
|
29
29
|
export { useMonolithUITheme } from "./MonolithUIProvider";
|
|
30
30
|
export { default as RichTextEditor, Extensions, SlashCommands, Controls, } from "./RichTextEditor";
|
|
31
31
|
export type { CustomItem, ToolbarOptions } from "./RichTextEditor";
|
|
32
|
+
export { default as Loader } from "./Loader";
|
|
33
|
+
export type { LoaderProps } from "./Loader";
|
package/dist/index.js
CHANGED
|
@@ -25,3 +25,4 @@ export { Column } from "./Table";
|
|
|
25
25
|
export { default as MonolithUIProvider } from "./MonolithUIProvider";
|
|
26
26
|
export { useMonolithUITheme } from "./MonolithUIProvider";
|
|
27
27
|
export { default as RichTextEditor, Extensions, SlashCommands, Controls, } from "./RichTextEditor";
|
|
28
|
+
export { default as Loader } from "./Loader";
|