@oliasoft-open-source/react-ui-library 5.13.7-beta-1 → 5.13.7-beta-2

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/index.d.ts CHANGED
@@ -1239,17 +1239,6 @@ export declare interface IRadioButtonProps {
1239
1239
  classForContainer?: 'grouped fields' | 'inline fields';
1240
1240
  }
1241
1241
 
1242
- declare interface IRadioCell extends TCommonCell {
1243
- type: TCellType;
1244
- name: TStringOrNumber;
1245
- value: TStringOrNumber;
1246
- selected: boolean;
1247
- disabled?: boolean;
1248
- small?: boolean;
1249
- onChange: (evt: default_2.MouseEvent<HTMLDivElement, MouseEvent>) => void;
1250
- testId?: string;
1251
- }
1252
-
1253
1242
  declare interface IReorderData {
1254
1243
  from?: number;
1255
1244
  to?: number;
@@ -2032,9 +2021,9 @@ export declare type TButtonPosition = 'top' | 'bottom';
2032
2021
 
2033
2022
  export declare type TButtonType = 'submit' | 'button' | 'reset';
2034
2023
 
2035
- declare type TCellShape = IPopoverCell | IStaticCell | ISelectCell | IHelpIconCell | ILibraryIconCell | ICheckBoxCell | IIconCell | IInputCell | ILinkCell | INumberInputCell | IActionCell | IRadioCell | ISortCell | ISliderCell | ISimpleCell;
2024
+ declare type TCellShape = IPopoverCell | IStaticCell | ISelectCell | IHelpIconCell | ILibraryIconCell | ICheckBoxCell | IIconCell | IInputCell | ILinkCell | INumberInputCell | IActionCell | ISortCell | ISliderCell | ISimpleCell;
2036
2025
 
2037
- declare type TCellType = 'Static' | 'Icon' | 'Select' | 'Input' | 'NumberInput' | 'Popover' | 'CheckBox' | 'Radio' | 'Actions' | 'Link' | 'Slider' | 'Unit' | string;
2026
+ declare type TCellType = 'Static' | 'Icon' | 'Select' | 'Input' | 'NumberInput' | 'Popover' | 'CheckBox' | 'Actions' | 'Link' | 'Slider' | 'Unit' | string;
2038
2027
 
2039
2028
  export declare type TChangeEvent<T extends HTMLElement = HTMLInputElement> = ChangeEvent<T> & {
2040
2029
  target: T | {
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 { isNullOrUndefined } from "remirror";
26
- import { BoldExtension, BulletListExtension, CodeExtension, ItalicExtension, MarkdownExtension, OrderedListExtension, PlaceholderExtension } from "remirror/extensions";
27
- import { EditorComponent, Remirror, useActive, useCommands, useRemirror } from "@remirror/react";
28
- import "remirror/styles/all.css";
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";
@@ -3586,55 +3587,7 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
3586
3587
  })
3587
3588
  })
3588
3589
  });
3589
- };
3590
- var radio_button_module_default = {
3591
- wrapper: "_wrapper_1homz_1",
3592
- inline: "_inline_1homz_1",
3593
- radio: "_radio_1homz_5",
3594
- labelMargin: "_labelMargin_1homz_8",
3595
- small: "_small_1homz_27",
3596
- noMargin: "_noMargin_1homz_32",
3597
- noLabel: "_noLabel_1homz_36",
3598
- disabled: "_disabled_1homz_96",
3599
- isInTable: "_isInTable_1homz_112",
3600
- helpIconEnabled: "_helpIconEnabled_1homz_117"
3601
- };
3602
- const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1, small: a = !1, onChange: o, noMargin: s = !1, testId: c, helpText: l, onClickHelp: u, textTransform: d = TextTransform.CAPITALIZE }) => {
3603
- let f = l || u;
3604
- return /* @__PURE__ */ jsxs("div", {
3605
- className: cx(radio_button_module_default.radio, i ? radio_button_module_default.disabled : null, a ? radio_button_module_default.small : null, s ? radio_button_module_default.noMargin : null, t ? null : radio_button_module_default.noLabel),
3606
- onClick: o,
3607
- "data-testid": c,
3608
- children: [
3609
- /* @__PURE__ */ jsx("input", {
3610
- type: InputType.RADIO,
3611
- value: n,
3612
- checked: r,
3613
- onChange: () => {},
3614
- disabled: i
3615
- }),
3616
- /* @__PURE__ */ jsx("label", {
3617
- "data-name": e,
3618
- "data-value": n,
3619
- style: { textTransform: d },
3620
- children: t
3621
- }),
3622
- f && /* @__PURE__ */ jsx("div", {
3623
- className: radio_button_module_default.helpIconEnabled,
3624
- onClick: u,
3625
- children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
3626
- })
3627
- ]
3628
- });
3629
- }, RadioCell = ({ cell: e, testId: t }) => /* @__PURE__ */ jsx(RadioInput, {
3630
- selected: e.selected,
3631
- name: e.name,
3632
- value: e.value,
3633
- noMargin: !0,
3634
- disabled: e.disabled,
3635
- onChange: (t) => e.onChange(t),
3636
- testId: t
3637
- }), CellWrapper = ({ cell: e, isHeader: t, columnAlignment: n, testId: r }) => {
3590
+ }, CellWrapper = ({ cell: e, isHeader: t, columnAlignment: n, testId: r }) => {
3638
3591
  if (!e) return null;
3639
3592
  switch (e.type) {
3640
3593
  case "Input":
@@ -3653,10 +3606,6 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
3653
3606
  cell: e,
3654
3607
  testId: r
3655
3608
  });
3656
- case "Radio": return /* @__PURE__ */ jsx(RadioCell, {
3657
- cell: e,
3658
- testId: r
3659
- });
3660
3609
  case "Slider": return /* @__PURE__ */ jsx(SliderCell, { cell: e });
3661
3610
  case "Icon": return /* @__PURE__ */ jsx(IconCell, { cell: e });
3662
3611
  case "Actions": return /* @__PURE__ */ jsx(ActionsCell, { cell: e });
@@ -3669,7 +3618,7 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
3669
3618
  }
3670
3619
  };
3671
3620
  let CellType = /* @__PURE__ */ function(e) {
3672
- return e.INPUT = "Input", e.NUMBER_INPUT = "NumberInput", e.SELECT = "Select", e.POPOVER = "Popover", e.SLIDER = "Slider", e.CHECKBOX = "CheckBox", e.RADIO = "Radio", e.ACTIONS = "Actions", e.AUTO_UNIT = "AutoUnit", e.UNIT = "Unit", e.STATIC = "Static", e;
3621
+ return e.INPUT = "Input", e.NUMBER_INPUT = "NumberInput", e.SELECT = "Select", e.POPOVER = "Popover", e.SLIDER = "Slider", e.CHECKBOX = "CheckBox", e.ACTIONS = "Actions", e.AUTO_UNIT = "AutoUnit", e.UNIT = "Unit", e.STATIC = "Static", e;
3673
3622
  }({});
3674
3623
  const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment: r = Align.LEFT, width: i, testId: a }) => {
3675
3624
  var o;
@@ -3678,7 +3627,7 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
3678
3627
  bodyAlignment: r,
3679
3628
  headerAlignment: n,
3680
3629
  isHeader: t
3681
- }, m = getCellAlignment(f, cell_module_default), h = getCellAlignment(f, cell_module_default, !0), _ = e.type === CellType.INPUT || e.type === CellType.NUMBER_INPUT || e.type === CellType.SELECT || e.type === CellType.POPOVER ? cell_module_default.inputCell : e.type === CellType.SLIDER ? cell_module_default.sliderCell : e.type === CellType.CHECKBOX || e.type === CellType.RADIO ? cell_module_default.checkBoxCell : e.type === CellType.ACTIONS ? cell_module_default.actionsCell : cell_module_default.staticCell, v = cx(cell_module_default.cell, _, e.hasSort ? cell_module_default.sortingCell : null, m, e.breakWord ? cell_module_default.breakWord : ""), y = (o = u == null ? i : u) == null ? void 0 : o, b = e.type === CellType.STATIC || !e.type, x = {
3630
+ }, m = getCellAlignment(f, cell_module_default), h = getCellAlignment(f, cell_module_default, !0), _ = e.type === CellType.INPUT || e.type === CellType.NUMBER_INPUT || e.type === CellType.SELECT || e.type === CellType.POPOVER ? cell_module_default.inputCell : e.type === CellType.SLIDER ? cell_module_default.sliderCell : e.type === CellType.CHECKBOX ? cell_module_default.checkBoxCell : e.type === CellType.ACTIONS ? cell_module_default.actionsCell : cell_module_default.staticCell, v = cx(cell_module_default.cell, _, e.hasSort ? cell_module_default.sortingCell : null, m, e.breakWord ? cell_module_default.breakWord : ""), y = (o = u == null ? i : u) == null ? void 0 : o, b = e.type === CellType.STATIC || !e.type, x = {
3682
3631
  width: y,
3683
3632
  minWidth: y,
3684
3633
  textTransform: t && b ? TextTransform.CAPITALIZE : void 0,
@@ -5054,7 +5003,7 @@ const normalizeParsedResult = (e) => {
5054
5003
  onClickCopyClipboard: useCallback(async (e) => {
5055
5004
  let t = await v();
5056
5005
  if (!t) return;
5057
- 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) => isNullOrUndefined(t) ? "" : s(t.toString(), e))), { delimiter: " " });
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: " " });
5058
5007
  try {
5059
5008
  await navigator.clipboard.writeText(c), transitionToast({ message: {
5060
5009
  type: "Success",
@@ -5977,7 +5926,46 @@ const PrintHeader = ({ logo: e, alt: t, logoWidth: n = "100px" }) => /* @__PURE_
5977
5926
  alt: t,
5978
5927
  className: print_header_module_default.printHeader,
5979
5928
  style: { width: n }
5980
- }), RadioButton = ({ name: e, label: t, options: n, value: r, onChange: i, disabled: a = !1, small: o = !1, noMargin: c = !1, onClick: l = () => {}, inline: u = !1, mainLabel: d = "", radioButtonsData: f, classForContainer: p = "grouped fields" }) => {
5929
+ });
5930
+ var radio_button_module_default = {
5931
+ wrapper: "_wrapper_1fbik_1",
5932
+ inline: "_inline_1fbik_1",
5933
+ radio: "_radio_1fbik_5",
5934
+ labelMargin: "_labelMargin_1fbik_8",
5935
+ small: "_small_1fbik_27",
5936
+ noMargin: "_noMargin_1fbik_32",
5937
+ disabled: "_disabled_1fbik_90",
5938
+ isInTable: "_isInTable_1fbik_106",
5939
+ helpIconEnabled: "_helpIconEnabled_1fbik_111"
5940
+ };
5941
+ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1, small: a = !1, onChange: o, noMargin: s = !1, testId: c, helpText: l, onClickHelp: u, textTransform: d = TextTransform.CAPITALIZE }) => {
5942
+ let f = l || u;
5943
+ return /* @__PURE__ */ jsxs("div", {
5944
+ className: cx(radio_button_module_default.radio, i ? radio_button_module_default.disabled : null, a ? radio_button_module_default.small : null, s ? radio_button_module_default.noMargin : null),
5945
+ onClick: o,
5946
+ "data-testid": c,
5947
+ children: [
5948
+ /* @__PURE__ */ jsx("input", {
5949
+ type: InputType.RADIO,
5950
+ value: n,
5951
+ checked: r,
5952
+ onChange: () => {},
5953
+ disabled: i
5954
+ }),
5955
+ /* @__PURE__ */ jsx("label", {
5956
+ "data-name": e,
5957
+ "data-value": n,
5958
+ style: { textTransform: d },
5959
+ children: t
5960
+ }),
5961
+ f && /* @__PURE__ */ jsx("div", {
5962
+ className: radio_button_module_default.helpIconEnabled,
5963
+ onClick: u,
5964
+ children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
5965
+ })
5966
+ ]
5967
+ });
5968
+ }, RadioButton = ({ name: e, label: t, options: n, value: r, onChange: i, disabled: a = !1, small: o = !1, noMargin: c = !1, onClick: l = () => {}, inline: u = !1, mainLabel: d = "", radioButtonsData: f, classForContainer: p = "grouped fields" }) => {
5981
5969
  let m = useContext(DisabledContext), h = f !== void 0, { simpleInputs: _, options: v, selectedOptions: y } = h ? {
5982
5970
  simpleInputs: !1,
5983
5971
  options: f,
@@ -6016,94 +6004,95 @@ var rich_text_toolbar_module_default = {
6016
6004
  let RichTextIcon = /* @__PURE__ */ function(e) {
6017
6005
  return e.BOLD = "bold", e.ITALIC = "italic", e.CODE = "code", e.UL = "ul", e.OL = "ol", e;
6018
6006
  }({});
6019
- const RichTextToolbar = ({ disabled: e = !1, toolbarComponent: t = null }) => {
6020
- let { focus: n, toggleBold: r, toggleBulletList: i, toggleCode: a, toggleItalic: o, toggleOrderedList: s } = useCommands(), c = useActive(), l = [
6007
+ const RichTextToolbar = ({ editor: e, disabled: t = !1, toolbarComponent: n = null }) => {
6008
+ var r, i, a, o, s;
6009
+ let c = [
6021
6010
  {
6022
6011
  icon: RichTextIcon.BOLD,
6023
- onClick: r,
6024
- active: c.bold()
6012
+ onClick: () => e == null ? void 0 : e.chain().focus().toggleBold().run(),
6013
+ active: (r = e == null ? void 0 : e.isActive("bold")) == null ? !1 : r
6025
6014
  },
6026
6015
  {
6027
6016
  icon: RichTextIcon.ITALIC,
6028
- onClick: o,
6029
- active: c.italic()
6017
+ onClick: () => e == null ? void 0 : e.chain().focus().toggleItalic().run(),
6018
+ active: (i = e == null ? void 0 : e.isActive("italic")) == null ? !1 : i
6030
6019
  },
6031
6020
  {
6032
6021
  icon: RichTextIcon.CODE,
6033
- onClick: a,
6034
- active: c.code()
6022
+ onClick: () => e == null ? void 0 : e.chain().focus().toggleCode().run(),
6023
+ active: (a = e == null ? void 0 : e.isActive("code")) == null ? !1 : a
6035
6024
  },
6036
6025
  {
6037
6026
  icon: RichTextIcon.UL,
6038
- onClick: i,
6039
- active: c.bulletList()
6027
+ onClick: () => e == null ? void 0 : e.chain().focus().toggleBulletList().run(),
6028
+ active: (o = e == null ? void 0 : e.isActive("bulletList")) == null ? !1 : o
6040
6029
  },
6041
6030
  {
6042
6031
  icon: RichTextIcon.OL,
6043
- onClick: s,
6044
- active: c.orderedList()
6032
+ onClick: () => e == null ? void 0 : e.chain().focus().toggleOrderedList().run(),
6033
+ active: (s = e == null ? void 0 : e.isActive("orderedList")) == null ? !1 : s
6045
6034
  }
6046
6035
  ];
6047
6036
  return /* @__PURE__ */ jsxs("div", {
6048
6037
  className: rich_text_toolbar_module_default.richTextToolbarContainer,
6049
6038
  children: [/* @__PURE__ */ jsx("div", {
6050
6039
  className: rich_text_toolbar_module_default.richTextToolbar,
6051
- children: l.map((t, r) => /* @__PURE__ */ jsx(Button, {
6040
+ children: c.map((e, n) => /* @__PURE__ */ jsx(Button, {
6052
6041
  small: !0,
6053
6042
  round: !0,
6054
6043
  basic: !0,
6055
- icon: t.icon,
6044
+ icon: e.icon,
6056
6045
  colored: Color.MUTED,
6057
- onClick: () => {
6058
- t.onClick(), n();
6059
- },
6060
- active: t.active,
6061
- disabled: e
6062
- }, r))
6063
- }), t]
6046
+ onClick: e.onClick,
6047
+ active: e.active,
6048
+ disabled: t
6049
+ }, n))
6050
+ }), n]
6064
6051
  });
6065
6052
  };
6066
6053
  var rich_text_input_module_default = {
6067
- inputInTable: "_inputInTable_1fb4l_1",
6068
- inputHover: "_inputHover_1fb4l_13",
6069
- inputFocus: "_inputFocus_1fb4l_18",
6070
- inputError: "_inputError_1fb4l_25",
6071
- inputWarning: "_inputWarning_1fb4l_26",
6072
- inputDisabled: "_inputDisabled_1fb4l_61",
6073
- hideScrollbars: "_hideScrollbars_1fb4l_67",
6074
- richTextInput: "_richTextInput_1fb4l_77"
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"
6075
6062
  };
6076
6063
  const RichTextInput = memo(forwardRef(({ placeholder: e, onChange: t, value: n, disabled: r, toolbarComponent: i }, a) => {
6077
- let c = useContext(DisabledContext), u = r || c, { manager: d, state: f, setState: p, getContext: m } = useRemirror({
6078
- extensions: useCallback(() => [
6079
- new BoldExtension({}),
6080
- new BulletListExtension({}),
6081
- new CodeExtension(),
6082
- new ItalicExtension(),
6083
- new MarkdownExtension({}),
6084
- new OrderedListExtension(),
6085
- new PlaceholderExtension({ placeholder: e })
6086
- ], [e]),
6087
- content: n,
6088
- selection: "start",
6089
- 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
+ }
6090
6076
  });
6091
- return useImperativeHandle(a, () => m(), [m]), /* @__PURE__ */ jsx("div", {
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(!1),
6088
+ editor: d
6089
+ }), [d]), /* @__PURE__ */ jsxs("div", {
6092
6090
  className: rich_text_input_module_default.richTextInput,
6093
- children: /* @__PURE__ */ jsxs(Remirror, {
6094
- manager: d,
6095
- state: f,
6096
- placeholder: e,
6097
- onChange: ({ helpers: e, state: n }) => {
6098
- let r = e.getMarkdown(n);
6099
- t && t(r), p(n);
6100
- },
6101
- editable: !u,
6102
- children: [/* @__PURE__ */ jsx(RichTextToolbar, {
6103
- disabled: u,
6104
- toolbarComponent: i
6105
- }), /* @__PURE__ */ jsx(EditorComponent, {})]
6106
- })
6091
+ children: [/* @__PURE__ */ jsx(RichTextToolbar, {
6092
+ editor: d,
6093
+ disabled: u,
6094
+ toolbarComponent: i
6095
+ }), /* @__PURE__ */ jsx(EditorContent, { editor: d })]
6107
6096
  });
6108
6097
  }));
6109
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.7-beta-1",
3
+ "version": "5.13.7-beta-2",
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,11 @@
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/markdown": "^3.20.0",
45
+ "@tiptap/react": "^3.20.0",
46
+ "@tiptap/starter-kit": "^3.20.0",
45
47
  "@types/rc-slider": "^9.3.1",
46
48
  "@types/react-resizable": "^3.0.8",
47
49
  "@types/react-window": "^1.8.8",
@@ -64,7 +66,6 @@
64
66
  "react-toastify": "^9.1.3",
65
67
  "react-transition-group": "^4.4.5",
66
68
  "react-window": "^1.8.11",
67
- "remirror": "^3.0.3",
68
69
  "resize-observer-polyfill": "^1.5.1",
69
70
  "simplify-ts": "^1.0.2",
70
71
  "styled-components": "^6.1.15"