@oliasoft-open-source/react-ui-library 5.7.4-beta-2 → 5.7.4-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 +1 -2
- package/dist/index.js +27 -98
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6563,7 +6563,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6563
6563
|
} : {
|
|
6564
6564
|
value: G,
|
|
6565
6565
|
unit: U
|
|
6566
|
-
}),
|
|
6566
|
+
}), Eu = k || K?.value === void 0, [J, Du] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Ou = !!(O || n), Y = C && C.find((e) => {
|
|
6567
6567
|
if (!e?.value) return;
|
|
6568
6568
|
if (E) return E === e.valueKey;
|
|
6569
6569
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -6572,7 +6572,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6572
6572
|
toUnit: t
|
|
6573
6573
|
});
|
|
6574
6574
|
return withUnit(n, t) === e.value;
|
|
6575
|
-
}),
|
|
6575
|
+
}), ku = () => {
|
|
6576
6576
|
let e = l ?? "", t = K.unit;
|
|
6577
6577
|
if (checkConversion({
|
|
6578
6578
|
value: e,
|
|
@@ -6586,7 +6586,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6586
6586
|
return null;
|
|
6587
6587
|
}
|
|
6588
6588
|
} else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
|
|
6589
|
-
},
|
|
6589
|
+
}, Au = (t) => {
|
|
6590
6590
|
let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, K?.unit || ""), s = A ? withUnit(convertAndGetValue(o, B), B) : o;
|
|
6591
6591
|
h({ target: {
|
|
6592
6592
|
value: s,
|
|
@@ -6599,7 +6599,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6599
6599
|
}), R(() => {
|
|
6600
6600
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6601
6601
|
});
|
|
6602
|
-
},
|
|
6602
|
+
}, ju = (e, t) => {
|
|
6603
6603
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
6604
6604
|
value: e,
|
|
6605
6605
|
unit: t
|
|
@@ -6630,7 +6630,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6630
6630
|
e !== void 0 && q({
|
|
6631
6631
|
value: e,
|
|
6632
6632
|
unit: t
|
|
6633
|
-
}), C &&
|
|
6633
|
+
}), C && Du(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
6634
6634
|
}
|
|
6635
6635
|
}, [
|
|
6636
6636
|
U,
|
|
@@ -6638,7 +6638,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6638
6638
|
i,
|
|
6639
6639
|
T
|
|
6640
6640
|
]);
|
|
6641
|
-
let X =
|
|
6641
|
+
let X = ku(), Z = label(K.unit) || K.unit || "", Mu = p || !X || X && X.length === 1, Q = getStringName(e), $, Nu = (t) => {
|
|
6642
6642
|
let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
6643
6643
|
if (checkConversion({
|
|
6644
6644
|
value: r,
|
|
@@ -6658,7 +6658,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6658
6658
|
type: MenuType.OPTION,
|
|
6659
6659
|
inline: !0,
|
|
6660
6660
|
onClick: () => {
|
|
6661
|
-
validateNumber(i).valid && !n && (
|
|
6661
|
+
validateNumber(i).valid && !n && (Du(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
6662
6662
|
value: r,
|
|
6663
6663
|
name: typeof e == "string" ? e : e?.fieldName || "",
|
|
6664
6664
|
predefinedSelected: !0,
|
|
@@ -6685,10 +6685,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6685
6685
|
label: "Custom",
|
|
6686
6686
|
selected: J === PredefinedOptionsMenuState.CUSTOM
|
|
6687
6687
|
}], C?.length) {
|
|
6688
|
-
let e = C.map(
|
|
6688
|
+
let e = C.map(Nu);
|
|
6689
6689
|
$ = [...$, ...e];
|
|
6690
6690
|
}
|
|
6691
|
-
let
|
|
6691
|
+
let Pu = (e) => {
|
|
6692
6692
|
if (isValueWithUnit(e)) {
|
|
6693
6693
|
let t = getUnit(e), { value: n } = safeConvertValue({
|
|
6694
6694
|
value: e,
|
|
@@ -6700,7 +6700,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6700
6700
|
return n;
|
|
6701
6701
|
}
|
|
6702
6702
|
return e;
|
|
6703
|
-
},
|
|
6703
|
+
}, Fu = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Iu = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
6704
6704
|
return /* @__PURE__ */ jsx("div", {
|
|
6705
6705
|
className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
|
|
6706
6706
|
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -6732,31 +6732,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6732
6732
|
name: Q,
|
|
6733
6733
|
testId: x,
|
|
6734
6734
|
disabled: n,
|
|
6735
|
-
placeholder:
|
|
6735
|
+
placeholder: Pu(t),
|
|
6736
6736
|
value: K.value,
|
|
6737
|
-
onChange:
|
|
6737
|
+
onChange: Au,
|
|
6738
6738
|
onFocus: v,
|
|
6739
6739
|
error: i === null ? void 0 : i,
|
|
6740
6740
|
warning: S === null ? void 0 : S,
|
|
6741
6741
|
left: a,
|
|
6742
|
-
allowEmpty:
|
|
6742
|
+
allowEmpty: Eu,
|
|
6743
6743
|
validationCallback: (e, t) => D(Q, t),
|
|
6744
6744
|
enableCosmeticRounding: j,
|
|
6745
6745
|
enableDisplayRounding: M,
|
|
6746
6746
|
roundDisplayValue: N,
|
|
6747
|
-
groupOrder:
|
|
6748
|
-
disableInternalErrorValidationMessages:
|
|
6747
|
+
groupOrder: Fu,
|
|
6748
|
+
disableInternalErrorValidationMessages: Ou,
|
|
6749
6749
|
small: o,
|
|
6750
6750
|
selectOnFocus: P,
|
|
6751
6751
|
tooltip: I
|
|
6752
6752
|
}, Q)
|
|
6753
6753
|
}),
|
|
6754
|
-
Z && (
|
|
6755
|
-
groupOrder:
|
|
6754
|
+
Z && (Mu || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
6755
|
+
groupOrder: Iu,
|
|
6756
6756
|
small: o,
|
|
6757
6757
|
children: Z
|
|
6758
6758
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
6759
|
-
groupOrder:
|
|
6759
|
+
groupOrder: Iu,
|
|
6760
6760
|
maxHeight: 380,
|
|
6761
6761
|
disabled: r,
|
|
6762
6762
|
testId: x && `${x}-menu`,
|
|
@@ -6772,7 +6772,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6772
6772
|
label: j ? safeRoundNumbers(i) : i,
|
|
6773
6773
|
inline: !0,
|
|
6774
6774
|
onClick: (n) => {
|
|
6775
|
-
n.stopPropagation(),
|
|
6775
|
+
n.stopPropagation(), ju(e, t);
|
|
6776
6776
|
},
|
|
6777
6777
|
description: r,
|
|
6778
6778
|
selected: r === Z,
|
|
@@ -7064,42 +7064,6 @@ function formatDate({ date: e, showTime: t, showSeconds: n, timeZone: r, showTim
|
|
|
7064
7064
|
timeZoneName: i ? "short" : void 0
|
|
7065
7065
|
}) : null;
|
|
7066
7066
|
}
|
|
7067
|
-
var SOURCE_OPTIONS = [
|
|
7068
|
-
{
|
|
7069
|
-
label: "System",
|
|
7070
|
-
value: "System"
|
|
7071
|
-
},
|
|
7072
|
-
{
|
|
7073
|
-
label: "Application",
|
|
7074
|
-
value: "Application"
|
|
7075
|
-
},
|
|
7076
|
-
{
|
|
7077
|
-
label: "API",
|
|
7078
|
-
value: "API"
|
|
7079
|
-
}
|
|
7080
|
-
];
|
|
7081
|
-
const OPERATION_OPTIONS = [
|
|
7082
|
-
{
|
|
7083
|
-
label: "Created",
|
|
7084
|
-
value: "Created"
|
|
7085
|
-
},
|
|
7086
|
-
{
|
|
7087
|
-
label: "Updated",
|
|
7088
|
-
value: "Updated"
|
|
7089
|
-
},
|
|
7090
|
-
{
|
|
7091
|
-
label: "Imported",
|
|
7092
|
-
value: "Imported"
|
|
7093
|
-
},
|
|
7094
|
-
{
|
|
7095
|
-
label: "Cloned",
|
|
7096
|
-
value: "Cloned"
|
|
7097
|
-
},
|
|
7098
|
-
{
|
|
7099
|
-
label: "Reverted",
|
|
7100
|
-
value: "Reverted"
|
|
7101
|
-
}
|
|
7102
|
-
];
|
|
7103
7067
|
function AuditLogTable({ logs: e, loading: t }) {
|
|
7104
7068
|
let [n, r] = useState(!0), [i, a] = useState(!0), o = [
|
|
7105
7069
|
{
|
|
@@ -7118,7 +7082,7 @@ function AuditLogTable({ logs: e, loading: t }) {
|
|
|
7118
7082
|
label: "Show all",
|
|
7119
7083
|
value: 0
|
|
7120
7084
|
}
|
|
7121
|
-
], [s, c] = useState(10), [l, u] = useState(1),
|
|
7085
|
+
], [s, c] = useState(10), [l, u] = useState(1), d = ({ diffs: e = [], userName: t, source: n, operation: r, operationMetaData: i }) => {
|
|
7122
7086
|
if (n === "API") return r === "Created" ? `Created through API by ${t || "Unknown user"}` : `Changed through API by ${t || "Unknown user"}`;
|
|
7123
7087
|
switch (r) {
|
|
7124
7088
|
case "Created": return `Created by ${t}`;
|
|
@@ -7128,50 +7092,15 @@ function AuditLogTable({ logs: e, loading: t }) {
|
|
|
7128
7092
|
case "Updated": return `Updated by ${t} (${e.length} changes)`;
|
|
7129
7093
|
default: return `Change by ${t}`;
|
|
7130
7094
|
}
|
|
7131
|
-
},
|
|
7132
|
-
let t = e.description?.toLowerCase().includes(d.toLowerCase()) || !1, n = p ? e.userName?.toLowerCase().includes(p.toLowerCase()) : !0, r = g ? e.operation === g : !0, i = v ? e.source === v : !0;
|
|
7133
|
-
return t && n && r && i;
|
|
7134
|
-
}), w = (l - 1) * (s || C.length || 1), T = s === 0 ? C.length : w + s, E = C.slice(w, T), D = [{ cells: [
|
|
7095
|
+
}, f = (l - 1) * (s || e.length || 1), p = s === 0 ? e.length : f + s, h = e.slice(f, p), g = [{ cells: [
|
|
7135
7096
|
{ value: "Change" },
|
|
7136
7097
|
{ value: "Modified by" },
|
|
7137
7098
|
{ value: "Using" },
|
|
7138
7099
|
{ value: "Operation" },
|
|
7139
7100
|
{ value: "Date" }
|
|
7140
|
-
] }, { cells: [
|
|
7141
|
-
{
|
|
7142
|
-
value: d,
|
|
7143
|
-
type: "Input",
|
|
7144
|
-
placeholder: "Search",
|
|
7145
|
-
onChange: b
|
|
7146
|
-
},
|
|
7147
|
-
{
|
|
7148
|
-
value: p,
|
|
7149
|
-
type: "Input",
|
|
7150
|
-
placeholder: "Search user",
|
|
7151
|
-
onChange: x
|
|
7152
|
-
},
|
|
7153
|
-
{
|
|
7154
|
-
value: v,
|
|
7155
|
-
type: "Select",
|
|
7156
|
-
placeholder: "Select",
|
|
7157
|
-
options: SOURCE_OPTIONS,
|
|
7158
|
-
onChange: (e) => y(e)
|
|
7159
|
-
},
|
|
7160
|
-
{
|
|
7161
|
-
value: g,
|
|
7162
|
-
type: "Select",
|
|
7163
|
-
placeholder: "Select",
|
|
7164
|
-
options: OPERATION_OPTIONS,
|
|
7165
|
-
onChange: (e) => _(e)
|
|
7166
|
-
},
|
|
7167
|
-
{
|
|
7168
|
-
value: "",
|
|
7169
|
-
type: "Input",
|
|
7170
|
-
placeholder: "Search"
|
|
7171
|
-
}
|
|
7172
|
-
] }], O = E.map((e) => ({ cells: [
|
|
7101
|
+
] }], _ = h.map((e) => ({ cells: [
|
|
7173
7102
|
{
|
|
7174
|
-
value:
|
|
7103
|
+
value: d(e),
|
|
7175
7104
|
type: "Static"
|
|
7176
7105
|
},
|
|
7177
7106
|
{
|
|
@@ -7188,7 +7117,7 @@ function AuditLogTable({ logs: e, loading: t }) {
|
|
|
7188
7117
|
},
|
|
7189
7118
|
{
|
|
7190
7119
|
value: formatDate({
|
|
7191
|
-
date: e.
|
|
7120
|
+
date: e.createdAt,
|
|
7192
7121
|
showTime: !0
|
|
7193
7122
|
}),
|
|
7194
7123
|
type: "Static"
|
|
@@ -7221,13 +7150,13 @@ function AuditLogTable({ logs: e, loading: t }) {
|
|
|
7221
7150
|
theme: Theme.WHITE,
|
|
7222
7151
|
children: /* @__PURE__ */ jsx(Spinner, { dark: !0 })
|
|
7223
7152
|
}) : /* @__PURE__ */ jsx(Table, { table: {
|
|
7224
|
-
headers:
|
|
7225
|
-
rows:
|
|
7153
|
+
headers: g,
|
|
7154
|
+
rows: _,
|
|
7226
7155
|
fixedWidth: "100%",
|
|
7227
7156
|
bordered: !1,
|
|
7228
7157
|
actionsRight: !0,
|
|
7229
7158
|
footer: { pagination: {
|
|
7230
|
-
rowCount:
|
|
7159
|
+
rowCount: e.length,
|
|
7231
7160
|
selectedPage: l,
|
|
7232
7161
|
rowsPerPage: {
|
|
7233
7162
|
onChange: (e) => {
|
package/package.json
CHANGED