@monolith-forensics/monolith-ui 1.1.91 → 1.2.1
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/DateInput/DateInput.d.ts +2 -1
- package/dist/DateInput/DateInput.js +9 -6
- package/dist/DropDownMenu/DropDownMenu.js +41 -35
- package/dist/Input/Input.d.ts +1 -3
- package/dist/Input/Input.js +5 -4
- package/dist/Loader/Loader.js +0 -1
- package/dist/MonolithUIProvider/MonolithUIProvider.d.ts +131 -7
- package/dist/MonolithUIProvider/MonolithUIProvider.js +4 -4
- package/dist/MonolithUIProvider/index.d.ts +1 -1
- package/dist/MonolithUIProvider/index.js +1 -1
- package/dist/QueryFilter/DefaultOperators.d.ts +77 -0
- package/dist/QueryFilter/DefaultOperators.js +22 -0
- package/dist/QueryFilter/QueryFilter.d.ts +5 -0
- package/dist/QueryFilter/QueryFilter.js +224 -0
- package/dist/QueryFilter/index.d.ts +3 -0
- package/dist/QueryFilter/index.js +3 -0
- package/dist/QueryFilter/types.d.ts +51 -0
- package/dist/QueryFilter/useQueryFilter.d.ts +3 -0
- package/dist/QueryFilter/useQueryFilter.js +36 -0
- package/dist/{NewTable → Table}/ActionCell.js +4 -3
- package/dist/{NewTable → Table}/ColumnResizer.js +1 -1
- package/dist/Table/LoadingIndicator.d.ts +4 -0
- package/dist/Table/LoadingIndicator.js +76 -0
- package/dist/Table/RenderSkeleton.d.ts +6 -0
- package/dist/Table/RenderSkeleton.js +25 -0
- package/dist/{NewTable → Table}/StateStorage.d.ts +9 -0
- package/dist/{NewTable → Table}/StateStorage.js +26 -0
- package/dist/Table/Table.d.ts +2 -92
- package/dist/Table/Table.js +78 -675
- package/dist/{NewTable → Table}/TableComponents.js +27 -22
- package/dist/{NewTable → Table}/TableDefaults.d.ts +5 -0
- package/dist/{NewTable → Table}/TableDefaults.js +6 -1
- package/dist/{NewTable → Table}/TableHeader.js +9 -8
- package/dist/Table/TableMenu/InfoBadge.d.ts +10 -0
- package/dist/Table/TableMenu/InfoBadge.js +23 -0
- package/dist/Table/TableMenu/TableMenu.d.ts +2 -0
- package/dist/Table/TableMenu/TableMenu.js +108 -0
- package/dist/Table/TableMenu/index.d.ts +2 -0
- package/dist/Table/TableMenu/index.js +2 -0
- package/dist/{NewTable → Table}/TableProvider.d.ts +1 -1
- package/dist/{NewTable → Table}/TableProvider.js +199 -30
- package/dist/{NewTable → Table}/TableRow.js +1 -1
- package/dist/{NewTable → Table}/VirtualIzedRows.d.ts +0 -1
- package/dist/{NewTable → Table}/VirtualIzedRows.js +6 -6
- package/dist/{NewTable → Table}/enums.d.ts +4 -0
- package/dist/{NewTable → Table}/enums.js +5 -0
- package/dist/Table/index.d.ts +4 -3
- package/dist/Table/index.js +4 -2
- package/dist/{NewTable → Table}/types.d.ts +77 -1
- package/dist/Table/types.js +1 -0
- package/dist/{NewTable → Table}/useTable.js +1 -1
- package/dist/TextInput/TextInput.d.ts +2 -3
- package/dist/TextInput/TextInput.js +5 -4
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useDelayedBoolean.d.ts +2 -0
- package/dist/hooks/useDelayedBoolean.js +17 -0
- package/dist/index.d.ts +3 -5
- package/dist/index.js +3 -3
- package/dist/theme/getTheme.d.ts +3 -0
- package/dist/theme/getTheme.js +13 -0
- package/dist/theme/index.d.ts +3 -168
- package/dist/theme/index.js +3 -12
- package/dist/theme/variants.d.ts +7 -172
- package/dist/theme/variants.js +6 -5
- package/package.json +2 -2
- package/dist/NewTable/Table.d.ts +0 -3
- package/dist/NewTable/Table.js +0 -83
- package/dist/NewTable/index.d.ts +0 -4
- package/dist/NewTable/index.js +0 -4
- /package/dist/{NewTable → QueryFilter}/types.js +0 -0
- /package/dist/{NewTable → Table}/ActionButton.d.ts +0 -0
- /package/dist/{NewTable → Table}/ActionButton.js +0 -0
- /package/dist/{NewTable → Table}/ActionCell.d.ts +0 -0
- /package/dist/{NewTable → Table}/Column.d.ts +0 -0
- /package/dist/{NewTable → Table}/Column.js +0 -0
- /package/dist/{NewTable → Table}/ColumnResizer.d.ts +0 -0
- /package/dist/{NewTable → Table}/SelectionCell.d.ts +0 -0
- /package/dist/{NewTable → Table}/SelectionCell.js +0 -0
- /package/dist/{NewTable → Table}/StaticRows.d.ts +0 -0
- /package/dist/{NewTable → Table}/StaticRows.js +0 -0
- /package/dist/{NewTable → Table}/TableComponents.d.ts +0 -0
- /package/dist/{NewTable → Table}/TableHeader.d.ts +0 -0
- /package/dist/{NewTable → Table}/TableRow.d.ts +0 -0
- /package/dist/{NewTable → Table}/Utils/index.d.ts +0 -0
- /package/dist/{NewTable → Table}/Utils/index.js +0 -0
- /package/dist/{NewTable → Table}/Utils/resizeHandler.d.ts +0 -0
- /package/dist/{NewTable → Table}/Utils/resizeHandler.js +0 -0
- /package/dist/{NewTable → Table}/Utils/resolveColumnReorder.d.ts +0 -0
- /package/dist/{NewTable → Table}/Utils/resolveColumnReorder.js +0 -0
- /package/dist/{NewTable → Table}/Utils/resolveColumnResize.d.ts +0 -0
- /package/dist/{NewTable → Table}/Utils/resolveColumnResize.js +0 -0
- /package/dist/{NewTable → Table}/Utils/syncColumnState.d.ts +0 -0
- /package/dist/{NewTable → Table}/Utils/syncColumnState.js +0 -0
- /package/dist/{NewTable → Table}/useTable.d.ts +0 -0
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Size, Variant } from "../core";
|
|
4
4
|
interface DateInputProps {
|
|
5
5
|
className?: string;
|
|
6
|
+
style?: React.CSSProperties;
|
|
6
7
|
defaultValue?: string | null | undefined;
|
|
7
8
|
format?: FormatOptions;
|
|
8
9
|
label?: string;
|
|
@@ -33,5 +34,5 @@ export type Segment = {
|
|
|
33
34
|
momentType?: moment.unitOfTime.All | moment.unitOfTime.DurationConstructor;
|
|
34
35
|
pattern?: string;
|
|
35
36
|
};
|
|
36
|
-
declare const DateInput:
|
|
37
|
+
declare const DateInput: React.ForwardRefExoticComponent<DateInputProps & React.RefAttributes<HTMLElement>>;
|
|
37
38
|
export default DateInput;
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import moment from "moment";
|
|
12
12
|
import { useFloating, flip, offset, FloatingPortal, useDismiss, useInteractions, autoUpdate, } from "@floating-ui/react";
|
|
13
|
-
import { useEffect, useMemo, useRef, useState, } from "react";
|
|
13
|
+
import { forwardRef, useEffect, useMemo, useRef, useState, } from "react";
|
|
14
14
|
import styled from "styled-components";
|
|
15
15
|
import { FieldLabel, Calendar } from "..";
|
|
16
16
|
import { StyledContent, StyledFloatContainer, ArrowButton, ClearButton, } from "../core";
|
|
@@ -178,7 +178,7 @@ const InputSegment = styled.div `
|
|
|
178
178
|
: "10px"};
|
|
179
179
|
}
|
|
180
180
|
`;
|
|
181
|
-
const DateInput =
|
|
181
|
+
const DateInput = forwardRef(({ className, style = {}, defaultValue, format = "YYYY-MM-DD HH:mm:ss", label, description, arrow = true, size = "sm", variant = "outlined", clearable = false, required = false, onChange = () => { }, min, max, error, enableCalendar = false, utc = false, closeOnSelect = true, }, _ref) => {
|
|
182
182
|
const [value, setValue] = useState(defaultValue);
|
|
183
183
|
const [selectedSegment, setSelectedSegment] = useState();
|
|
184
184
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -460,15 +460,18 @@ const DateInput = styled(({ className, defaultValue, format = "YYYY-MM-DD HH:mm:
|
|
|
460
460
|
document.removeEventListener("wheel", handleWheelEvent);
|
|
461
461
|
};
|
|
462
462
|
}, [selectedSegment]);
|
|
463
|
-
return (_jsxs("div", { className:
|
|
463
|
+
return (_jsxs("div", { className: "mfui-DateInput", children: [label && (_jsx(FieldLabel, { error: error, asterisk: required, size: size, description: description, children: label })), _jsxs(StyledInputContainer, { ref: (ref) => {
|
|
464
|
+
if (typeof _ref === "function") {
|
|
465
|
+
_ref(ref);
|
|
466
|
+
}
|
|
464
467
|
mainRef.current = ref;
|
|
465
468
|
refs.setReference(ref);
|
|
466
|
-
}, onClick: handleContainerClick, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, onFocus: (e) => {
|
|
469
|
+
}, className: className, onClick: handleContainerClick, onMouseDown: handleMouseDown, onKeyDown: handleKeyDown, onFocus: (e) => {
|
|
467
470
|
e.preventDefault();
|
|
468
471
|
setSelectedSegment(segments[0]);
|
|
469
472
|
}, onBlur: () => {
|
|
470
473
|
setSelectedSegment(null);
|
|
471
|
-
}, "data-empty": !value, role: "textbox", size: size, variant: variant, "data-button-right": arrow || clearable, children: [segments.map((segment, i) => {
|
|
474
|
+
}, "data-empty": !value, role: "textbox", size: size, variant: variant, "data-button-right": arrow || clearable, style: style, children: [segments.map((segment, i) => {
|
|
472
475
|
if (segment.type === "separator") {
|
|
473
476
|
return (_jsx("div", { className: "separator", tabIndex: -1, onClick: (e) => {
|
|
474
477
|
e.preventDefault();
|
|
@@ -492,5 +495,5 @@ const DateInput = styled(({ className, defaultValue, format = "YYYY-MM-DD HH:mm:
|
|
|
492
495
|
return isoResult;
|
|
493
496
|
});
|
|
494
497
|
}, includeTime: false }, 1) }) }) })) }))] }));
|
|
495
|
-
})
|
|
498
|
+
});
|
|
496
499
|
export default DateInput;
|
|
@@ -21,6 +21,12 @@ const StyledFloatContainer = styled.div `
|
|
|
21
21
|
outline: none;
|
|
22
22
|
`;
|
|
23
23
|
const StyledInnerItemContainer = styled.div `
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
flex: 1 1 auto;
|
|
27
|
+
overflow: hidden;
|
|
28
|
+
`;
|
|
29
|
+
const MenuScrollContainer = styled.div `
|
|
24
30
|
overflow-y: auto;
|
|
25
31
|
|
|
26
32
|
&[data-scroll-active="true"] {
|
|
@@ -247,7 +253,7 @@ const MenuComponent = React.forwardRef((_a, forwardedRef) => {
|
|
|
247
253
|
tree.events.emit("menuopen", { parentId, nodeId });
|
|
248
254
|
}
|
|
249
255
|
}, [tree, isOpen, nodeId, parentId]);
|
|
250
|
-
return (_jsxs(FloatingNode, { id: nodeId, children: [_jsx(MenuItem, Object.assign({ ref: useMergeRefs([refs.setReference, item.ref, forwardedRef]), tabIndex: !isNested ? undefined : parent.activeIndex === item.index ? 0 : -1, role: isNested ? "menuitem" : undefined, className: isNested ?
|
|
256
|
+
return (_jsxs(FloatingNode, { id: nodeId, children: [_jsx(MenuItem, Object.assign({ ref: useMergeRefs([refs.setReference, item.ref, forwardedRef]), tabIndex: !isNested ? undefined : parent.activeIndex === item.index ? 0 : -1, role: isNested ? "menuitem" : undefined, className: isNested ? `MenuItem` : "mfui-DropDownMenu RootMenu", "data-open": isOpen ? "" : undefined, "data-nested": isNested ? "" : undefined, "data-focus-inside": hasFocusInside ? "" : undefined }, getReferenceProps(parent.getItemProps(Object.assign(Object.assign({}, props), { onFocus(event) {
|
|
251
257
|
var _a;
|
|
252
258
|
(_a = props.onFocus) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
253
259
|
setHasFocusInside(false);
|
|
@@ -295,41 +301,41 @@ const DropDownMenu = ({ data, children, defaultValue, variant, arrow, size, sear
|
|
|
295
301
|
};
|
|
296
302
|
const scrollActive = (((_b = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current) === null || _b === void 0 ? void 0 : _b.scrollHeight) || 0) >
|
|
297
303
|
(((_c = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight) || 0);
|
|
298
|
-
return (_jsx(Menu, { label: children, arrow: arrow, buttonSize: size, variant: variant, multiselect: multiselect, buttonProps: buttonProps, children: _jsxs(StyledInnerItemContainer, {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
304
|
+
return (_jsx(Menu, { label: children, arrow: arrow, buttonSize: size, variant: variant, multiselect: multiselect, buttonProps: buttonProps, children: _jsxs(StyledInnerItemContainer, { children: [loading && _jsx("div", { children: "Loading..." }), searchable && (_jsx(SearchInput, { ref: searchInputRef, variant: "outlined", size: size, placeholder: "Search", onChange: handleSearch })), _jsx(MenuScrollContainer, { ref: scrollContainerRef, "data-scroll-active": scrollActive, onScroll: onScroll, children: !loading &&
|
|
305
|
+
data
|
|
306
|
+
.filter((item) => {
|
|
307
|
+
var _a, _b, _c;
|
|
308
|
+
if (!searchable)
|
|
309
|
+
return true;
|
|
310
|
+
if (isObjectArray) {
|
|
311
|
+
return (((_a = item === null || item === void 0 ? void 0 : item.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchValue.toLowerCase())) ||
|
|
312
|
+
((_b = item === null || item === void 0 ? void 0 : item.value) === null || _b === void 0 ? void 0 : _b.toLowerCase().includes(searchValue.toLowerCase())));
|
|
313
|
+
}
|
|
314
|
+
return (_c = item.toLowerCase) === null || _c === void 0 ? void 0 : _c.call(item).includes(searchValue.toLowerCase());
|
|
315
|
+
})
|
|
316
|
+
.map((item, index) => {
|
|
317
|
+
const isSelected = !!(selected === null || selected === void 0 ? void 0 : selected.find((s) => isObjectArray ? (s === null || s === void 0 ? void 0 : s.value) === (item === null || item === void 0 ? void 0 : item.value) : s === item));
|
|
318
|
+
if (item.items) {
|
|
319
|
+
return (_jsx(DropDownMenu, { data: item.items, children: item.label }));
|
|
320
|
+
}
|
|
321
|
+
return (_jsx(Tooltip, { content: TooltipContent ? (_jsx(TooltipContent, { data: item.data })) : null, side: "left", children: _jsxs(MenuItem, { className: "MenuItem", "data-selected": isSelected, leftSection: multiselect && (_jsx(CheckBox, { value: isSelected, size: size, onChange: (newValue) => {
|
|
322
|
+
var _a;
|
|
323
|
+
newValue
|
|
324
|
+
? handleAddItem(item)
|
|
325
|
+
: handleRemoveItem(item);
|
|
326
|
+
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, item);
|
|
327
|
+
} })), multiselect: multiselect, size: size, onClick: (e) => {
|
|
316
328
|
var _a;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
329
|
+
e.preventDefault();
|
|
330
|
+
e.stopPropagation();
|
|
331
|
+
if (multiselect) {
|
|
332
|
+
isSelected
|
|
333
|
+
? handleRemoveItem(item)
|
|
334
|
+
: handleAddItem(item);
|
|
335
|
+
}
|
|
336
|
+
onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(item);
|
|
320
337
|
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, item);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
e.preventDefault();
|
|
324
|
-
e.stopPropagation();
|
|
325
|
-
if (multiselect) {
|
|
326
|
-
isSelected
|
|
327
|
-
? handleRemoveItem(item)
|
|
328
|
-
: handleAddItem(item);
|
|
329
|
-
}
|
|
330
|
-
onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(item);
|
|
331
|
-
(_a = item === null || item === void 0 ? void 0 : item.onClick) === null || _a === void 0 ? void 0 : _a.call(item, item);
|
|
332
|
-
}, children: [(item === null || item === void 0 ? void 0 : item.leftSection) || null, _jsx(_Fragment, { children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || (item === null || item === void 0 ? void 0 : item.label) || item }), (item === null || item === void 0 ? void 0 : item.rightSection) || null] }, index) }, index));
|
|
333
|
-
})] }) }));
|
|
338
|
+
}, children: [(item === null || item === void 0 ? void 0 : item.leftSection) || null, _jsx(_Fragment, { children: (renderOption === null || renderOption === void 0 ? void 0 : renderOption(item)) || (item === null || item === void 0 ? void 0 : item.label) || item }), (item === null || item === void 0 ? void 0 : item.rightSection) || null] }, index) }, index));
|
|
339
|
+
}) })] }) }));
|
|
334
340
|
};
|
|
335
341
|
export default DropDownMenu;
|
package/dist/Input/Input.d.ts
CHANGED
|
@@ -6,7 +6,5 @@ export interface InputProps {
|
|
|
6
6
|
variant?: Variant;
|
|
7
7
|
width?: string | number | null | undefined;
|
|
8
8
|
}
|
|
9
|
-
declare const Input: import("
|
|
10
|
-
ref?: ((instance: HTMLInputElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
11
|
-
}, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>, keyof import("react").Component<any, {}, any>>;
|
|
9
|
+
declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
10
|
export default Input;
|
package/dist/Input/Input.js
CHANGED
|
@@ -12,10 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import styled from "styled-components";
|
|
14
14
|
import { forwardRef } from "react";
|
|
15
|
-
const
|
|
16
|
-
var { className, size = "sm", variant = "outlined", width } = _a, rest = __rest(_a, ["className", "size", "variant", "width"]);
|
|
17
|
-
return _jsx("input", Object.assign({ ref: ref, className: className }, rest));
|
|
18
|
-
})) `
|
|
15
|
+
const StyledInput = styled.input `
|
|
19
16
|
font-family: ${({ theme }) => theme.typography.fontFamily};
|
|
20
17
|
pointer-events: "all";
|
|
21
18
|
user-select: "all";
|
|
@@ -141,4 +138,8 @@ const Input = styled(forwardRef((_a, ref) => {
|
|
|
141
138
|
cursor: pointer;
|
|
142
139
|
}
|
|
143
140
|
`;
|
|
141
|
+
const Input = forwardRef((_a, ref) => {
|
|
142
|
+
var { className } = _a, props = __rest(_a, ["className"]);
|
|
143
|
+
return _jsx(StyledInput, Object.assign({ ref: ref, className: className }, props));
|
|
144
|
+
});
|
|
144
145
|
export default Input;
|
package/dist/Loader/Loader.js
CHANGED
|
@@ -4,7 +4,6 @@ const Loader = styled(({ className, style }) => {
|
|
|
4
4
|
return (_jsx("div", { className: className + " mf-Loader", style: style, children: _jsx("span", { className: "mf-Loader-root" }) }));
|
|
5
5
|
}) `
|
|
6
6
|
display: inline-block;
|
|
7
|
-
margin: auto;
|
|
8
7
|
|
|
9
8
|
.mf-Loader-root {
|
|
10
9
|
display: inline-block;
|
|
@@ -1,20 +1,144 @@
|
|
|
1
1
|
import { DefaultTheme } from "styled-components";
|
|
2
2
|
import { Themes } from "../theme";
|
|
3
3
|
import React from "react";
|
|
4
|
-
|
|
4
|
+
import typography from "../theme/typography";
|
|
5
|
+
export interface MonolithDefaultTheme extends DefaultTheme {
|
|
6
|
+
name?: Themes;
|
|
7
|
+
typography?: typeof typography;
|
|
8
|
+
palette: {
|
|
9
|
+
mode: Themes;
|
|
10
|
+
primary: {
|
|
11
|
+
main: string;
|
|
12
|
+
contrastText: string;
|
|
13
|
+
};
|
|
14
|
+
error: {
|
|
15
|
+
main: string;
|
|
16
|
+
contrastText: string;
|
|
17
|
+
};
|
|
18
|
+
secondary: {
|
|
19
|
+
main: string;
|
|
20
|
+
contrastText: string;
|
|
21
|
+
};
|
|
22
|
+
third: {
|
|
23
|
+
main: string;
|
|
24
|
+
contrastText: string;
|
|
25
|
+
};
|
|
26
|
+
fourth: {
|
|
27
|
+
main: string;
|
|
28
|
+
contrastText: string;
|
|
29
|
+
};
|
|
30
|
+
background: {
|
|
31
|
+
default: string;
|
|
32
|
+
paper: string;
|
|
33
|
+
alt: string;
|
|
34
|
+
secondary: string;
|
|
35
|
+
gradient: string;
|
|
36
|
+
};
|
|
37
|
+
menu: {
|
|
38
|
+
background: string;
|
|
39
|
+
};
|
|
40
|
+
signature: {
|
|
41
|
+
penColor: string;
|
|
42
|
+
borderColor: string;
|
|
43
|
+
backgroundColor: string;
|
|
44
|
+
};
|
|
45
|
+
text: {
|
|
46
|
+
primary: string;
|
|
47
|
+
secondary: string;
|
|
48
|
+
};
|
|
49
|
+
input: {
|
|
50
|
+
background: string;
|
|
51
|
+
border: string;
|
|
52
|
+
borderHover: string;
|
|
53
|
+
borderFocus: string;
|
|
54
|
+
borderError: string;
|
|
55
|
+
borderDisabled: string;
|
|
56
|
+
text: string;
|
|
57
|
+
textDisabled: string;
|
|
58
|
+
placeholder: string;
|
|
59
|
+
};
|
|
60
|
+
textArea: {
|
|
61
|
+
background: string;
|
|
62
|
+
border: string;
|
|
63
|
+
borderHover: string;
|
|
64
|
+
borderFocus: string;
|
|
65
|
+
borderError: string;
|
|
66
|
+
borderDisabled: string;
|
|
67
|
+
text: string;
|
|
68
|
+
textDisabled: string;
|
|
69
|
+
placeholder: string;
|
|
70
|
+
};
|
|
71
|
+
dataGrid: {
|
|
72
|
+
hover: string;
|
|
73
|
+
};
|
|
74
|
+
action: {
|
|
75
|
+
hover: string;
|
|
76
|
+
};
|
|
77
|
+
divider: string;
|
|
78
|
+
};
|
|
79
|
+
header: {
|
|
80
|
+
color: string;
|
|
81
|
+
background: string;
|
|
82
|
+
search: {
|
|
83
|
+
color: string;
|
|
84
|
+
};
|
|
85
|
+
indicator: {
|
|
86
|
+
background: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
footer: {
|
|
90
|
+
color: string;
|
|
91
|
+
background: string;
|
|
92
|
+
};
|
|
93
|
+
sidebar: {
|
|
94
|
+
color: string;
|
|
95
|
+
background: string;
|
|
96
|
+
active: string;
|
|
97
|
+
header: {
|
|
98
|
+
color: string;
|
|
99
|
+
background: string;
|
|
100
|
+
brand: {
|
|
101
|
+
color: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
footer: {
|
|
105
|
+
color: string;
|
|
106
|
+
background: string;
|
|
107
|
+
online: {
|
|
108
|
+
background: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
badge: {
|
|
112
|
+
color: string;
|
|
113
|
+
background: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
scrollbar: {
|
|
117
|
+
track: string;
|
|
118
|
+
thumb: string;
|
|
119
|
+
thumbHover: string;
|
|
120
|
+
};
|
|
121
|
+
mfBorder: {
|
|
122
|
+
primary: string;
|
|
123
|
+
secondary: string;
|
|
124
|
+
};
|
|
125
|
+
zIndex: {
|
|
126
|
+
snackbar: number;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
5
129
|
export interface MonolithUIContextType {
|
|
6
|
-
theme:
|
|
130
|
+
theme: MonolithDefaultTheme;
|
|
7
131
|
Themes: typeof Themes;
|
|
8
|
-
colorScheme:
|
|
132
|
+
colorScheme: Themes;
|
|
9
133
|
toggleColorScheme: () => void;
|
|
10
|
-
setColorScheme: React.Dispatch<React.SetStateAction<
|
|
134
|
+
setColorScheme: React.Dispatch<React.SetStateAction<Themes>>;
|
|
11
135
|
}
|
|
12
136
|
export declare const MonolithUIContext: React.Context<MonolithUIContextType | undefined>;
|
|
13
137
|
interface MonolithUIProviderProps {
|
|
14
138
|
children?: React.ReactNode | React.ReactNode[];
|
|
15
|
-
theme?:
|
|
16
|
-
defaultColorScheme?:
|
|
17
|
-
colorScheme?:
|
|
139
|
+
theme?: MonolithDefaultTheme;
|
|
140
|
+
defaultColorScheme?: Themes;
|
|
141
|
+
colorScheme?: Themes;
|
|
18
142
|
}
|
|
19
143
|
declare const MonolithUIProvider: ({ children, theme, defaultColorScheme, colorScheme, }: MonolithUIProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
144
|
export default MonolithUIProvider;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import merge from "deepmerge";
|
|
3
3
|
import { ThemeProvider } from "styled-components";
|
|
4
|
-
import
|
|
4
|
+
import { Themes, getTheme } from "../theme";
|
|
5
5
|
import { createContext, useState } from "react";
|
|
6
6
|
import GlobalStyle from "./GlobalStyle";
|
|
7
7
|
export const MonolithUIContext = createContext(undefined);
|
|
8
|
-
const MonolithUIProvider = ({ children, theme
|
|
8
|
+
const MonolithUIProvider = ({ children, theme, defaultColorScheme = Themes.DARK, colorScheme, }) => {
|
|
9
9
|
const [colorSchemeState, setColorSchemeState] = useState(defaultColorScheme);
|
|
10
10
|
const toggleColorScheme = () => {
|
|
11
|
-
setColorSchemeState((prev) =>
|
|
11
|
+
setColorSchemeState((prev) => prev === Themes.LIGHT ? Themes.DARK : Themes.LIGHT);
|
|
12
12
|
};
|
|
13
13
|
const _scheme = colorScheme || colorSchemeState;
|
|
14
14
|
const defaultTheme = getTheme(_scheme);
|
|
15
15
|
// override default theme with the provided theme
|
|
16
|
-
const _theme = merge(defaultTheme, theme);
|
|
16
|
+
const _theme = merge(defaultTheme, theme || {});
|
|
17
17
|
return (_jsx(MonolithUIContext.Provider, { value: {
|
|
18
18
|
theme: _theme,
|
|
19
19
|
Themes,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Operator } from "./types";
|
|
2
|
+
export declare const Operators: {
|
|
3
|
+
Equals: {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
NotEquals: {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
LessThan: {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
GreaterThan: {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
};
|
|
19
|
+
LessThanOrEqual: {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
GreaterThanOrEqual: {
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
};
|
|
27
|
+
Contains: {
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
};
|
|
31
|
+
BeginsWith: {
|
|
32
|
+
value: string;
|
|
33
|
+
label: string;
|
|
34
|
+
};
|
|
35
|
+
EndsWith: {
|
|
36
|
+
value: string;
|
|
37
|
+
label: string;
|
|
38
|
+
};
|
|
39
|
+
DoesNotContain: {
|
|
40
|
+
value: string;
|
|
41
|
+
label: string;
|
|
42
|
+
};
|
|
43
|
+
DoesNotBeginWith: {
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
};
|
|
47
|
+
DoesNotEndWith: {
|
|
48
|
+
value: string;
|
|
49
|
+
label: string;
|
|
50
|
+
};
|
|
51
|
+
IsNull: {
|
|
52
|
+
value: string;
|
|
53
|
+
label: string;
|
|
54
|
+
};
|
|
55
|
+
IsNotNull: {
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
In: {
|
|
60
|
+
value: string;
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
63
|
+
NIn: {
|
|
64
|
+
value: string;
|
|
65
|
+
label: string;
|
|
66
|
+
};
|
|
67
|
+
Between: {
|
|
68
|
+
value: string;
|
|
69
|
+
label: string;
|
|
70
|
+
};
|
|
71
|
+
NotBetween: {
|
|
72
|
+
value: string;
|
|
73
|
+
label: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export declare const DefaultOperators: Operator[];
|
|
77
|
+
export default DefaultOperators;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const Operators = {
|
|
2
|
+
Equals: { value: "=", label: "is" },
|
|
3
|
+
NotEquals: { value: "!=", label: "is not" },
|
|
4
|
+
LessThan: { value: "<", label: "less than" },
|
|
5
|
+
GreaterThan: { value: ">", label: "greater than" },
|
|
6
|
+
LessThanOrEqual: { value: "<=", label: "less than or equal" },
|
|
7
|
+
GreaterThanOrEqual: { value: ">=", label: "greater than or equal" },
|
|
8
|
+
Contains: { value: "contains", label: "contains" },
|
|
9
|
+
BeginsWith: { value: "beginsWith", label: "begins with" },
|
|
10
|
+
EndsWith: { value: "endsWith", label: "ends with" },
|
|
11
|
+
DoesNotContain: { value: "doesNotContain", label: "does not contain" },
|
|
12
|
+
DoesNotBeginWith: { value: "doesNotBeginWith", label: "does not begin with" },
|
|
13
|
+
DoesNotEndWith: { value: "doesNotEndWith", label: "does not end with" },
|
|
14
|
+
IsNull: { value: "null", label: "is null" },
|
|
15
|
+
IsNotNull: { value: "notNull", label: "is not null" },
|
|
16
|
+
In: { value: "in", label: "is any of" },
|
|
17
|
+
NIn: { value: "nin", label: "is none of" },
|
|
18
|
+
Between: { value: "between", label: "between" },
|
|
19
|
+
NotBetween: { value: "notBetween", label: "not between" },
|
|
20
|
+
};
|
|
21
|
+
export const DefaultOperators = Object.values(Operators);
|
|
22
|
+
export default DefaultOperators;
|