@oliasoft-open-source/react-ui-library 5.13.3 → 5.13.5-beta-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/global.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +77 -76
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ export declare type AuditLogOperation = 'Created' | 'Cloned' | 'Reverted' | 'Imp
|
|
|
55
55
|
|
|
56
56
|
export declare type AuditLogSource = 'System' | 'Application' | 'API';
|
|
57
57
|
|
|
58
|
-
export declare const Badge: ({ children, color, title, dot, margin, small, }: IBadgeProps) => JSX_2.Element;
|
|
58
|
+
export declare const Badge: ({ children, color, textColor: textColorProp, title, dot, margin, small, }: IBadgeProps) => JSX_2.Element;
|
|
59
59
|
|
|
60
60
|
export declare const Breadcrumb: ({ links, small }: IBreadcrumbProps) => JSX_2.Element;
|
|
61
61
|
|
|
@@ -215,6 +215,7 @@ declare interface IAuditLogProps {
|
|
|
215
215
|
export declare interface IBadgeProps {
|
|
216
216
|
children?: ReactNode;
|
|
217
217
|
color?: string;
|
|
218
|
+
textColor?: string;
|
|
218
219
|
title?: TStringOrNumber | ReactNode | null;
|
|
219
220
|
dot?: boolean;
|
|
220
221
|
margin?: TStringOrNumber | null;
|
package/dist/index.js
CHANGED
|
@@ -22,10 +22,11 @@ import { useVirtualizer } from "@tanstack/react-virtual";
|
|
|
22
22
|
import { SimplifyAP } from "simplify-ts";
|
|
23
23
|
import Papa from "papaparse";
|
|
24
24
|
import { Slide, ToastContainer as Toaster, toast as toast$1 } from "react-toastify";
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import "
|
|
25
|
+
import { isNil as isNil$1 } from "es-toolkit";
|
|
26
|
+
import { EditorContent, useEditor } from "@tiptap/react";
|
|
27
|
+
import StarterKit from "@tiptap/starter-kit";
|
|
28
|
+
import Placeholder from "@tiptap/extension-placeholder";
|
|
29
|
+
import { Markdown } from "@tiptap/markdown";
|
|
29
30
|
import { DndProvider } from "react-dnd";
|
|
30
31
|
import { MultiBackend, Tree as Tree$1, getBackendOptions } from "@minoru/react-dnd-treeview";
|
|
31
32
|
import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
|
|
@@ -827,29 +828,28 @@ const Section$1 = ({ section: e, closeOnOptionClick: t, close: n, tree: r, path:
|
|
|
827
828
|
placement: e || (t ? "right-start" : "bottom-start")
|
|
828
829
|
}), isStringNumberOrNode = (e) => isString(e) || isNumber(e) || isValidElement(e), getType = (e) => Array.isArray(e) ? "array" : typeof e;
|
|
829
830
|
var badge_module_default = {
|
|
830
|
-
wrapper: "
|
|
831
|
-
badge: "
|
|
832
|
-
label: "
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
dot: "_dot_nwprz_33",
|
|
837
|
-
hasChildren: "_hasChildren_nwprz_39"
|
|
831
|
+
wrapper: "_wrapper_14vly_1",
|
|
832
|
+
badge: "_badge_14vly_5",
|
|
833
|
+
label: "_label_14vly_11",
|
|
834
|
+
small: "_small_14vly_23",
|
|
835
|
+
dot: "_dot_14vly_27",
|
|
836
|
+
hasChildren: "_hasChildren_14vly_33"
|
|
838
837
|
}, isDark = (e) => {
|
|
839
838
|
let t = e.substring(1), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, a = n >> 0 & 255;
|
|
840
839
|
return .2126 * r + .7152 * i + .0722 * a < 128;
|
|
841
840
|
};
|
|
842
|
-
const Badge = ({ children: e, color: t = "",
|
|
843
|
-
let
|
|
841
|
+
const Badge = ({ children: e, color: t = "", textColor: n = "", title: r = null, dot: i = !1, margin: a = null, small: o = !1 }) => {
|
|
842
|
+
let s = !(r === null && i === !1), c = n || (isDark(t) ? "#fff" : "rgba(0, 0, 0, 0.6)");
|
|
844
843
|
return /* @__PURE__ */ jsxs("div", {
|
|
845
844
|
className: badge_module_default.wrapper,
|
|
846
|
-
children: [
|
|
847
|
-
className: cx(badge_module_default.badge,
|
|
845
|
+
children: [s && /* @__PURE__ */ jsx("sup", {
|
|
846
|
+
className: cx(badge_module_default.badge, r === null ? badge_module_default.dot : badge_module_default.label, o ? badge_module_default.small : "", e ? badge_module_default.hasChildren : ""),
|
|
848
847
|
style: {
|
|
849
848
|
background: t || void 0,
|
|
850
|
-
margin:
|
|
849
|
+
margin: a || void 0,
|
|
850
|
+
color: c
|
|
851
851
|
},
|
|
852
|
-
children:
|
|
852
|
+
children: r
|
|
853
853
|
}), e]
|
|
854
854
|
});
|
|
855
855
|
}, Button$1 = ({ trigger: e, label: t, colored: n, small: r, width: i, disabled: a, groupOrder: o, loading: c, error: l, warning: u, active: d, tabIndex: f }) => {
|
|
@@ -5003,7 +5003,7 @@ const normalizeParsedResult = (e) => {
|
|
|
5003
5003
|
onClickCopyClipboard: useCallback(async (e) => {
|
|
5004
5004
|
let t = await v();
|
|
5005
5005
|
if (!t) return;
|
|
5006
|
-
let { fields: n = [], units: r = [], rows: a = [] } = t, o = (r == null ? [] : r).map((e) => e != null && e.length ? e : placeholder$1).slice(0, n.length), s = (e, t) => t === "comma" ? e.replace(/\./g, ",") : e, c = unParse(n, o, a.map((t) => t.map((t) =>
|
|
5006
|
+
let { fields: n = [], units: r = [], rows: a = [] } = t, o = (r == null ? [] : r).map((e) => e != null && e.length ? e : placeholder$1).slice(0, n.length), s = (e, t) => t === "comma" ? e.replace(/\./g, ",") : e, c = unParse(n, o, a.map((t) => t.map((t) => isNil$1(t) ? "" : s(t.toString(), e))), { delimiter: " " });
|
|
5007
5007
|
try {
|
|
5008
5008
|
await navigator.clipboard.writeText(c), transitionToast({ message: {
|
|
5009
5009
|
type: "Success",
|
|
@@ -6004,94 +6004,95 @@ var rich_text_toolbar_module_default = {
|
|
|
6004
6004
|
let RichTextIcon = /* @__PURE__ */ function(e) {
|
|
6005
6005
|
return e.BOLD = "bold", e.ITALIC = "italic", e.CODE = "code", e.UL = "ul", e.OL = "ol", e;
|
|
6006
6006
|
}({});
|
|
6007
|
-
const RichTextToolbar = ({
|
|
6008
|
-
|
|
6007
|
+
const RichTextToolbar = ({ editor: e, disabled: t = !1, toolbarComponent: n = null }) => {
|
|
6008
|
+
var r, i, a, o, s;
|
|
6009
|
+
let c = [
|
|
6009
6010
|
{
|
|
6010
6011
|
icon: RichTextIcon.BOLD,
|
|
6011
|
-
onClick:
|
|
6012
|
-
active:
|
|
6012
|
+
onClick: () => e == null ? void 0 : e.chain().focus().toggleBold().run(),
|
|
6013
|
+
active: (r = e == null ? void 0 : e.isActive("bold")) == null ? !1 : r
|
|
6013
6014
|
},
|
|
6014
6015
|
{
|
|
6015
6016
|
icon: RichTextIcon.ITALIC,
|
|
6016
|
-
onClick:
|
|
6017
|
-
active:
|
|
6017
|
+
onClick: () => e == null ? void 0 : e.chain().focus().toggleItalic().run(),
|
|
6018
|
+
active: (i = e == null ? void 0 : e.isActive("italic")) == null ? !1 : i
|
|
6018
6019
|
},
|
|
6019
6020
|
{
|
|
6020
6021
|
icon: RichTextIcon.CODE,
|
|
6021
|
-
onClick:
|
|
6022
|
-
active:
|
|
6022
|
+
onClick: () => e == null ? void 0 : e.chain().focus().toggleCode().run(),
|
|
6023
|
+
active: (a = e == null ? void 0 : e.isActive("code")) == null ? !1 : a
|
|
6023
6024
|
},
|
|
6024
6025
|
{
|
|
6025
6026
|
icon: RichTextIcon.UL,
|
|
6026
|
-
onClick:
|
|
6027
|
-
active:
|
|
6027
|
+
onClick: () => e == null ? void 0 : e.chain().focus().toggleBulletList().run(),
|
|
6028
|
+
active: (o = e == null ? void 0 : e.isActive("bulletList")) == null ? !1 : o
|
|
6028
6029
|
},
|
|
6029
6030
|
{
|
|
6030
6031
|
icon: RichTextIcon.OL,
|
|
6031
|
-
onClick:
|
|
6032
|
-
active:
|
|
6032
|
+
onClick: () => e == null ? void 0 : e.chain().focus().toggleOrderedList().run(),
|
|
6033
|
+
active: (s = e == null ? void 0 : e.isActive("orderedList")) == null ? !1 : s
|
|
6033
6034
|
}
|
|
6034
6035
|
];
|
|
6035
6036
|
return /* @__PURE__ */ jsxs("div", {
|
|
6036
6037
|
className: rich_text_toolbar_module_default.richTextToolbarContainer,
|
|
6037
6038
|
children: [/* @__PURE__ */ jsx("div", {
|
|
6038
6039
|
className: rich_text_toolbar_module_default.richTextToolbar,
|
|
6039
|
-
children:
|
|
6040
|
+
children: c.map((e, n) => /* @__PURE__ */ jsx(Button, {
|
|
6040
6041
|
small: !0,
|
|
6041
6042
|
round: !0,
|
|
6042
6043
|
basic: !0,
|
|
6043
|
-
icon:
|
|
6044
|
+
icon: e.icon,
|
|
6044
6045
|
colored: Color.MUTED,
|
|
6045
|
-
onClick:
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
}, r))
|
|
6051
|
-
}), t]
|
|
6046
|
+
onClick: e.onClick,
|
|
6047
|
+
active: e.active,
|
|
6048
|
+
disabled: t
|
|
6049
|
+
}, n))
|
|
6050
|
+
}), n]
|
|
6052
6051
|
});
|
|
6053
6052
|
};
|
|
6054
6053
|
var rich_text_input_module_default = {
|
|
6055
|
-
inputInTable: "
|
|
6056
|
-
inputHover: "
|
|
6057
|
-
inputFocus: "
|
|
6058
|
-
inputError: "
|
|
6059
|
-
inputWarning: "
|
|
6060
|
-
inputDisabled: "
|
|
6061
|
-
hideScrollbars: "
|
|
6062
|
-
richTextInput: "
|
|
6054
|
+
inputInTable: "_inputInTable_gb097_1",
|
|
6055
|
+
inputHover: "_inputHover_gb097_13",
|
|
6056
|
+
inputFocus: "_inputFocus_gb097_18",
|
|
6057
|
+
inputError: "_inputError_gb097_25",
|
|
6058
|
+
inputWarning: "_inputWarning_gb097_26",
|
|
6059
|
+
inputDisabled: "_inputDisabled_gb097_61",
|
|
6060
|
+
hideScrollbars: "_hideScrollbars_gb097_67",
|
|
6061
|
+
richTextInput: "_richTextInput_gb097_77"
|
|
6063
6062
|
};
|
|
6064
6063
|
const RichTextInput = memo(forwardRef(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i }, a) => {
|
|
6065
|
-
let
|
|
6066
|
-
extensions:
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
stringHandler: "markdown"
|
|
6064
|
+
let o = useContext(DisabledContext), u = r || o, d = useEditor({
|
|
6065
|
+
extensions: [
|
|
6066
|
+
StarterKit,
|
|
6067
|
+
Placeholder.configure({ placeholder: e }),
|
|
6068
|
+
Markdown
|
|
6069
|
+
],
|
|
6070
|
+
content: n == null ? "" : n,
|
|
6071
|
+
contentType: "markdown",
|
|
6072
|
+
editable: !u,
|
|
6073
|
+
onUpdate: ({ editor: e }) => {
|
|
6074
|
+
t == null || t(e.getMarkdown());
|
|
6075
|
+
}
|
|
6078
6076
|
});
|
|
6079
|
-
return
|
|
6077
|
+
return useEffect(() => {
|
|
6078
|
+
if (!d) return;
|
|
6079
|
+
let e = d.getMarkdown();
|
|
6080
|
+
n !== void 0 && n !== e && d.commands.setContent(n, {
|
|
6081
|
+
emitUpdate: !1,
|
|
6082
|
+
contentType: "markdown"
|
|
6083
|
+
});
|
|
6084
|
+
}, [n, d]), useEffect(() => {
|
|
6085
|
+
d && d.setEditable(!u);
|
|
6086
|
+
}, [u, d]), useImperativeHandle(a, () => ({
|
|
6087
|
+
clearContent: () => d == null ? void 0 : d.commands.clearContent(!0),
|
|
6088
|
+
editor: d
|
|
6089
|
+
}), [d]), /* @__PURE__ */ jsxs("div", {
|
|
6080
6090
|
className: rich_text_input_module_default.richTextInput,
|
|
6081
|
-
children: /* @__PURE__ */
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
let r = e.getMarkdown(n);
|
|
6087
|
-
t && t(r), p(n);
|
|
6088
|
-
},
|
|
6089
|
-
editable: !u,
|
|
6090
|
-
children: [/* @__PURE__ */ jsx(RichTextToolbar, {
|
|
6091
|
-
disabled: u,
|
|
6092
|
-
toolbarComponent: i
|
|
6093
|
-
}), /* @__PURE__ */ jsx(EditorComponent, {})]
|
|
6094
|
-
})
|
|
6091
|
+
children: [/* @__PURE__ */ jsx(RichTextToolbar, {
|
|
6092
|
+
editor: d,
|
|
6093
|
+
disabled: u,
|
|
6094
|
+
toolbarComponent: i
|
|
6095
|
+
}), /* @__PURE__ */ jsx(EditorContent, { editor: d })]
|
|
6095
6096
|
});
|
|
6096
6097
|
}));
|
|
6097
6098
|
var row_module_default = { row: "_row_n16je_1" };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/react-ui-library",
|
|
3
|
-
"version": "5.13.
|
|
3
|
+
"version": "5.13.5-beta-1",
|
|
4
4
|
"description": "Reusable UI components for React projects",
|
|
5
5
|
"homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
|
|
6
6
|
"bugs": {
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@fontsource/noto-sans": "^5.2.5",
|
|
41
41
|
"@minoru/react-dnd-treeview": "^3.5.0",
|
|
42
|
-
"@remirror/pm": "^3.0.1",
|
|
43
|
-
"@remirror/react": "^3.0.3",
|
|
44
42
|
"@tanstack/react-virtual": "^3.13.2",
|
|
43
|
+
"@tiptap/extension-placeholder": "^3.20.0",
|
|
44
|
+
"@tiptap/react": "^3.20.0",
|
|
45
|
+
"@tiptap/starter-kit": "^3.20.0",
|
|
45
46
|
"@types/rc-slider": "^9.3.1",
|
|
46
47
|
"@types/react-resizable": "^3.0.8",
|
|
47
48
|
"@types/react-window": "^1.8.8",
|
|
@@ -64,10 +65,10 @@
|
|
|
64
65
|
"react-toastify": "^9.1.3",
|
|
65
66
|
"react-transition-group": "^4.4.5",
|
|
66
67
|
"react-window": "^1.8.11",
|
|
67
|
-
"remirror": "^3.0.3",
|
|
68
68
|
"resize-observer-polyfill": "^1.5.1",
|
|
69
69
|
"simplify-ts": "^1.0.2",
|
|
70
|
-
"styled-components": "^6.1.15"
|
|
70
|
+
"styled-components": "^6.1.15",
|
|
71
|
+
"@tiptap/markdown": "^3.20.0"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
74
|
"@dmsnell/diff-match-patch": "^1.1.0",
|