@oliasoft-open-source/react-ui-library 5.17.0-beta-5 → 5.17.0-beta-9
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 -10
- package/dist/index.js +42 -33
- package/package.json +1 -2
package/dist/index.d.ts
CHANGED
|
@@ -793,8 +793,8 @@ declare interface IListItem {
|
|
|
793
793
|
disabled?: boolean;
|
|
794
794
|
onClick?: (evt: any) => void;
|
|
795
795
|
title?: string;
|
|
796
|
-
details?: string
|
|
797
|
-
metadata?: string
|
|
796
|
+
details?: string;
|
|
797
|
+
metadata?: string;
|
|
798
798
|
testId?: string;
|
|
799
799
|
level?: number;
|
|
800
800
|
label?: ILabel;
|
|
@@ -1393,12 +1393,6 @@ declare interface ISimpleCell extends TCommonCell {
|
|
|
1393
1393
|
type?: TCellType;
|
|
1394
1394
|
}
|
|
1395
1395
|
|
|
1396
|
-
export declare interface ISkeletonProps {
|
|
1397
|
-
count?: number;
|
|
1398
|
-
width?: string | number;
|
|
1399
|
-
height?: string | number;
|
|
1400
|
-
}
|
|
1401
|
-
|
|
1402
1396
|
declare interface ISliderCell extends TCommonCell {
|
|
1403
1397
|
type: TCellType;
|
|
1404
1398
|
label?: string | null;
|
|
@@ -2014,8 +2008,6 @@ export declare const SettingField: ({ helpText, disabled, showCustom, children,
|
|
|
2014
2008
|
|
|
2015
2009
|
export declare const SideBar: default_2.MemoExoticComponent<({ options, startOpen, onShiftClickToggleOpen, top, }: ISideBarProps) => JSX_2.Element>;
|
|
2016
2010
|
|
|
2017
|
-
export declare const Skeleton: ({ count, width, height }: ISkeletonProps) => JSX_2.Element;
|
|
2018
|
-
|
|
2019
2011
|
export declare const Slider: ({ name, label, width, labelWidth, value, min, max, step, marks, showArrows, showTooltip, tooltipFormatter, disabled, range, small, vertical, onChange, }: ISliderProps) => JSX_2.Element;
|
|
2020
2012
|
|
|
2021
2013
|
export declare const SmartUploadModal: ({ visible, prompt, onCloseModal, onUpload, onComplete, onFailed, onError, width, heading, dialogText, fileInputText, fileInputPlaceholder, uploadText, cancelText, testId, }: ISmartUploadModalProps) => JSX_2.Element;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { cloneDeep, cloneDeepWith, debounce, every, get, isArray, isBoolean, isE
|
|
|
10
10
|
import styled, { css } from "styled-components";
|
|
11
11
|
import { Resizable } from "react-resizable";
|
|
12
12
|
import { createPortal } from "react-dom";
|
|
13
|
-
import { ALT_UNITS, KNOWN_UNITS, altUnitsList, cleanNumStr, convertAndGetValue, convertSamePrecision, getAltUnitsListByQuantity, getUnit, getUnitsForQuantity, getValue, isScientificStringNum, isValidNum, isValueWithUnit, label, roundByMagnitude, roundByMagnitudeToFixed, roundToFixed, roundToPrecision, split, stripLeadingZeros, toNum, toString, unitFromQuantity, validateNumber, withPrettyUnitLabel, withUnit } from "@oliasoft-open-source/units";
|
|
13
|
+
import { ALT_UNITS, KNOWN_UNITS, altUnitsList, cleanNumStr, convertAndGetValue, convertSamePrecision, getAltUnitsListByQuantity, getUnit, getUnitsForQuantity, getValue, isNumeric, isScientificStringNum, isValidNum, isValueWithUnit, label, roundByMagnitude, roundByMagnitudeToFixed, roundToFixed, roundToPrecision, split, stripLeadingZeros, toNum, toString, unitFromQuantity, validateNumber, withPrettyUnitLabel, withUnit } from "@oliasoft-open-source/units";
|
|
14
14
|
import { FixedSizeList } from "react-window";
|
|
15
15
|
import { SortableContext, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
16
16
|
import { CSS } from "@dnd-kit/utilities";
|
|
@@ -27,8 +27,6 @@ import { EditorContent, useEditor } from "@tiptap/react";
|
|
|
27
27
|
import StarterKit from "@tiptap/starter-kit";
|
|
28
28
|
import Placeholder from "@tiptap/extension-placeholder";
|
|
29
29
|
import { Markdown } from "@tiptap/markdown";
|
|
30
|
-
import ReactLoadingSkeleton from "react-loading-skeleton";
|
|
31
|
-
import "react-loading-skeleton/dist/skeleton.css";
|
|
32
30
|
import { DndProvider } from "react-dnd";
|
|
33
31
|
import { MultiBackend, Tree as Tree$1, getBackendOptions } from "@minoru/react-dnd-treeview";
|
|
34
32
|
import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
|
|
@@ -6285,19 +6283,6 @@ const Link$1 = ({ isOpen: e, items: t, sectionIndex: n, onClick: r, testId: i })
|
|
|
6285
6283
|
})
|
|
6286
6284
|
});
|
|
6287
6285
|
}, (e, t) => isEqual$1(e, t));
|
|
6288
|
-
var skeleton_module_default = {
|
|
6289
|
-
skeletonContainer: "_skeletonContainer_k2td0_9",
|
|
6290
|
-
skeleton: "_skeleton_k2td0_9"
|
|
6291
|
-
};
|
|
6292
|
-
const Skeleton = ({ count: e, width: t, height: n }) => /* @__PURE__ */ jsx(ReactLoadingSkeleton, {
|
|
6293
|
-
baseColor: "var(--color-skeleton-base)",
|
|
6294
|
-
highlightColor: "var(--color-skeleton-highlight)",
|
|
6295
|
-
containerClassName: skeleton_module_default.skeletonContainer,
|
|
6296
|
-
className: skeleton_module_default.skeleton,
|
|
6297
|
-
count: e,
|
|
6298
|
-
width: t,
|
|
6299
|
-
height: n
|
|
6300
|
-
});
|
|
6301
6286
|
var tabs_module_default = {
|
|
6302
6287
|
tabs: "_tabs_1y79t_1",
|
|
6303
6288
|
padding: "_padding_1y79t_7",
|
|
@@ -8926,7 +8911,7 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8926
8911
|
case 1: {
|
|
8927
8912
|
let [t] = e;
|
|
8928
8913
|
return {
|
|
8929
|
-
type: "
|
|
8914
|
+
type: "created",
|
|
8930
8915
|
before: "",
|
|
8931
8916
|
after: toText(t)
|
|
8932
8917
|
};
|
|
@@ -8934,7 +8919,7 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8934
8919
|
case 2: {
|
|
8935
8920
|
let [t, n] = e;
|
|
8936
8921
|
return {
|
|
8937
|
-
type: "
|
|
8922
|
+
type: "modified",
|
|
8938
8923
|
before: toText(t),
|
|
8939
8924
|
after: toText(n)
|
|
8940
8925
|
};
|
|
@@ -8942,13 +8927,13 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8942
8927
|
case 3: {
|
|
8943
8928
|
let [t] = e;
|
|
8944
8929
|
return {
|
|
8945
|
-
type: "
|
|
8930
|
+
type: "deleted",
|
|
8946
8931
|
before: toText(t),
|
|
8947
8932
|
after: ""
|
|
8948
8933
|
};
|
|
8949
8934
|
}
|
|
8950
8935
|
default: return {
|
|
8951
|
-
type: "
|
|
8936
|
+
type: "modified",
|
|
8952
8937
|
before: "",
|
|
8953
8938
|
after: ""
|
|
8954
8939
|
};
|
|
@@ -8978,22 +8963,46 @@ const createDiffJson = (e, t, n) => {
|
|
|
8978
8963
|
oldJson: a,
|
|
8979
8964
|
newJson: o
|
|
8980
8965
|
};
|
|
8981
|
-
}
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8966
|
+
};
|
|
8967
|
+
var humanize = (e) => e.replace(/\[\d+\]/g, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\s+/g, " ").trim().replace(/^./, (e) => e.toUpperCase()), formatValue = (e) => {
|
|
8968
|
+
if (e == null || e === "") return "empty";
|
|
8969
|
+
if (typeof e == "boolean") return e ? "true" : "false";
|
|
8970
|
+
if (typeof e == "string") return e;
|
|
8971
|
+
if (typeof e == "number") return String(e);
|
|
8972
|
+
if (Array.isArray(e)) return e.length ? e.join(", ") : "empty";
|
|
8973
|
+
try {
|
|
8974
|
+
return JSON.stringify(e);
|
|
8975
|
+
} catch {
|
|
8976
|
+
return String(e);
|
|
8977
|
+
}
|
|
8978
|
+
}, findReasonableProperty = (e, t = 0) => {
|
|
8979
|
+
if (t >= e.length) return "Value";
|
|
8980
|
+
let n = e[t];
|
|
8981
|
+
return !n || isNumeric(n) ? findReasonableProperty(e, t + 1) : humanize(n);
|
|
8982
|
+
}, buildChangeSentence = ({ userName: e, type: t, property: n, before: r, after: i, sectionName: a }) => {
|
|
8983
|
+
let o = formatValue(r), s = formatValue(i);
|
|
8984
|
+
switch (t) {
|
|
8985
|
+
case "modified": return `${e} updated ${n} from ${o} to ${s} in ${a}.`;
|
|
8986
|
+
case "created": return `${e} created ${s} in ${a}.`;
|
|
8987
|
+
case "deleted": return `${e} deleted ${o} in ${a}.`;
|
|
8988
|
+
default: return `${e} changed ${n} in ${a}.`;
|
|
8989
|
+
}
|
|
8990
|
+
};
|
|
8991
|
+
const ChangesOverview = ({ sectionNames: e, userName: t, diffs: n }) => /* @__PURE__ */ jsx(Table, { table: {
|
|
8992
|
+
headers: [{ cells: [{ value: "Changes" }] }],
|
|
8989
8993
|
rows: n.map((n) => {
|
|
8990
8994
|
let { deltaFormat: r, path: i } = n, a = getSectionName(e, i), { type: o, before: s, after: c } = defaultMessage(r);
|
|
8991
8995
|
return { cells: [
|
|
8992
|
-
{ value:
|
|
8993
|
-
|
|
8996
|
+
{ value: buildChangeSentence({
|
|
8997
|
+
userName: t,
|
|
8998
|
+
type: o,
|
|
8999
|
+
property: findReasonableProperty(i),
|
|
9000
|
+
before: s,
|
|
9001
|
+
after: c,
|
|
9002
|
+
sectionName: a
|
|
9003
|
+
}) },
|
|
8994
9004
|
{ value: s },
|
|
8995
|
-
{ value: c }
|
|
8996
|
-
{ value: a }
|
|
9005
|
+
{ value: c }
|
|
8997
9006
|
] };
|
|
8998
9007
|
})
|
|
8999
9008
|
} }), viewTypes = Object.freeze({
|
|
@@ -9193,4 +9202,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
|
|
|
9193
9202
|
e === ConfigKeyType.Translations ? setConfig(e, getTranslations(t)) : setConfig(e, isPrimitiveValue(t) ? t : { ...t });
|
|
9194
9203
|
});
|
|
9195
9204
|
};
|
|
9196
|
-
export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar,
|
|
9205
|
+
export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/react-ui-library",
|
|
3
|
-
"version": "5.17.0-beta-
|
|
3
|
+
"version": "5.17.0-beta-9",
|
|
4
4
|
"description": "Reusable UI components for React projects",
|
|
5
5
|
"homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
|
|
6
6
|
"bugs": {
|
|
@@ -60,7 +60,6 @@
|
|
|
60
60
|
"react-fast-compare": "^3.2.2",
|
|
61
61
|
"react-icons": "^5.5.0",
|
|
62
62
|
"react-laag": "^2.0.5",
|
|
63
|
-
"react-loading-skeleton": "^3.5.0",
|
|
64
63
|
"react-resizable": "^3.0.5",
|
|
65
64
|
"react-router-dom": "^7.2.0",
|
|
66
65
|
"react-svg": "^16.3.0",
|