@oliasoft-open-source/react-ui-library 5.17.0-beta-4 → 5.17.1-beta-3
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 +2 -2
- package/dist/index.js +41 -17
- 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;
|
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";
|
|
@@ -8911,7 +8911,7 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8911
8911
|
case 1: {
|
|
8912
8912
|
let [t] = e;
|
|
8913
8913
|
return {
|
|
8914
|
-
type: "
|
|
8914
|
+
type: "created",
|
|
8915
8915
|
before: "",
|
|
8916
8916
|
after: toText(t)
|
|
8917
8917
|
};
|
|
@@ -8919,7 +8919,7 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8919
8919
|
case 2: {
|
|
8920
8920
|
let [t, n] = e;
|
|
8921
8921
|
return {
|
|
8922
|
-
type: "
|
|
8922
|
+
type: "modified",
|
|
8923
8923
|
before: toText(t),
|
|
8924
8924
|
after: toText(n)
|
|
8925
8925
|
};
|
|
@@ -8927,13 +8927,13 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8927
8927
|
case 3: {
|
|
8928
8928
|
let [t] = e;
|
|
8929
8929
|
return {
|
|
8930
|
-
type: "
|
|
8930
|
+
type: "deleted",
|
|
8931
8931
|
before: toText(t),
|
|
8932
8932
|
after: ""
|
|
8933
8933
|
};
|
|
8934
8934
|
}
|
|
8935
8935
|
default: return {
|
|
8936
|
-
type: "
|
|
8936
|
+
type: "modified",
|
|
8937
8937
|
before: "",
|
|
8938
8938
|
after: ""
|
|
8939
8939
|
};
|
|
@@ -8963,22 +8963,46 @@ const createDiffJson = (e, t, n) => {
|
|
|
8963
8963
|
oldJson: a,
|
|
8964
8964
|
newJson: o
|
|
8965
8965
|
};
|
|
8966
|
-
}
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
|
|
8973
|
-
|
|
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" }] }],
|
|
8974
8993
|
rows: n.map((n) => {
|
|
8975
8994
|
let { deltaFormat: r, path: i } = n, a = getSectionName(e, i), { type: o, before: s, after: c } = defaultMessage(r);
|
|
8976
8995
|
return { cells: [
|
|
8977
|
-
{ value:
|
|
8978
|
-
|
|
8996
|
+
{ value: buildChangeSentence({
|
|
8997
|
+
userName: t,
|
|
8998
|
+
type: o,
|
|
8999
|
+
property: findReasonableProperty(i),
|
|
9000
|
+
before: s,
|
|
9001
|
+
after: c,
|
|
9002
|
+
sectionName: a
|
|
9003
|
+
}) },
|
|
8979
9004
|
{ value: s },
|
|
8980
|
-
{ value: c }
|
|
8981
|
-
{ value: a }
|
|
9005
|
+
{ value: c }
|
|
8982
9006
|
] };
|
|
8983
9007
|
})
|
|
8984
9008
|
} }), viewTypes = Object.freeze({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/react-ui-library",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.1-beta-3",
|
|
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",
|