@oliasoft-open-source/react-ui-library 5.6.5-beta-3 → 5.7.4-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 +25 -13
- package/dist/index.js +232 -46
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,23 @@ export declare enum Align {
|
|
|
35
35
|
CENTER = "center"
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export declare interface AuditLogItem {
|
|
39
|
+
id: string;
|
|
40
|
+
userName: string;
|
|
41
|
+
operation: AuditLogOperation;
|
|
42
|
+
source: AuditLogSource;
|
|
43
|
+
date: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
diffs: any[];
|
|
46
|
+
operationMetaData?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare type AuditLogOperation = 'Created' | 'Cloned' | 'Reverted' | 'Imported' | 'Updated';
|
|
50
|
+
|
|
51
|
+
declare type AuditLogSource = 'System' | 'Application' | 'API';
|
|
52
|
+
|
|
53
|
+
export declare function AuditLogTable({ logs, loading }: IAuditLogTableProps): JSX_2.Element;
|
|
54
|
+
|
|
38
55
|
export declare const Badge: ({ children, color, title, dot, margin, small, }: IBadgeProps) => JSX_2.Element;
|
|
39
56
|
|
|
40
57
|
export declare const Breadcrumb: ({ links, small }: IBreadcrumbProps) => JSX_2.Element;
|
|
@@ -62,7 +79,7 @@ export declare enum ButtonType {
|
|
|
62
79
|
|
|
63
80
|
export declare const Card: ({ bordered, heading, children, margin, padding, raised, }: ICardProps) => JSX_2.Element;
|
|
64
81
|
|
|
65
|
-
export declare const CheckBox: ({ noMargin, dataix, isInTable, tabIndex, checked, indeterminate, name, label, disabled, small, onChange, testId, value, helpText, onClickHelp,
|
|
82
|
+
export declare const CheckBox: ({ noMargin, dataix, isInTable, tabIndex, checked, indeterminate, name, label, disabled, small, onChange, testId, value, helpText, onClickHelp, }: ICheckBoxProps) => JSX_2.Element;
|
|
66
83
|
|
|
67
84
|
export declare const Chevron: ({ expanded }: IChevronProps) => JSX_2.Element;
|
|
68
85
|
|
|
@@ -168,6 +185,11 @@ export declare interface IActionProps {
|
|
|
168
185
|
closeLayer?: TEmpty;
|
|
169
186
|
}
|
|
170
187
|
|
|
188
|
+
declare interface IAuditLogTableProps {
|
|
189
|
+
logs: AuditLogItem[];
|
|
190
|
+
loading?: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
171
193
|
export declare interface IBadgeProps {
|
|
172
194
|
children?: ReactNode;
|
|
173
195
|
color?: string;
|
|
@@ -278,7 +300,6 @@ export declare interface ICheckBoxProps {
|
|
|
278
300
|
value?: string;
|
|
279
301
|
helpText?: string;
|
|
280
302
|
onClickHelp?: TEmpty;
|
|
281
|
-
textTransform?: TTextTransform;
|
|
282
303
|
}
|
|
283
304
|
|
|
284
305
|
export declare interface IChevronProps {
|
|
@@ -1164,7 +1185,6 @@ declare interface IRadioButtonOption {
|
|
|
1164
1185
|
name?: string;
|
|
1165
1186
|
checked?: boolean;
|
|
1166
1187
|
disabled?: boolean;
|
|
1167
|
-
textTransform?: TTextTransform;
|
|
1168
1188
|
}
|
|
1169
1189
|
|
|
1170
1190
|
export declare interface IRadioButtonProps {
|
|
@@ -1624,7 +1644,6 @@ export declare interface IToggleProps {
|
|
|
1624
1644
|
testId?: string;
|
|
1625
1645
|
helpText?: string;
|
|
1626
1646
|
onClickHelp?: (evt: any) => void;
|
|
1627
|
-
textTransform?: TTextTransform;
|
|
1628
1647
|
}
|
|
1629
1648
|
|
|
1630
1649
|
export declare interface ITooltipProps {
|
|
@@ -1983,13 +2002,6 @@ export declare const TextArea: ({ name, value, placeholder, cols, rows, disabled
|
|
|
1983
2002
|
|
|
1984
2003
|
export declare const TextLink: ({ children, href, target, testId, onClick, component: Component, }: ITextLinkProps) => JSX_2.Element;
|
|
1985
2004
|
|
|
1986
|
-
export declare enum TextTransform {
|
|
1987
|
-
UPPERCASE = "uppercase",
|
|
1988
|
-
LOWERCASE = "lowercase",
|
|
1989
|
-
CAPITALIZE = "capitalize",
|
|
1990
|
-
NONE = "none"
|
|
1991
|
-
}
|
|
1992
|
-
|
|
1993
2005
|
declare type TFileReaderMethod = TInputReaderMethods | string;
|
|
1994
2006
|
|
|
1995
2007
|
declare type TFunction = (...args: any[]) => any;
|
|
@@ -2034,7 +2046,7 @@ export declare const toast: ({ id, message, autoClose, onClose, }: IToastProps)
|
|
|
2034
2046
|
|
|
2035
2047
|
export { Toaster }
|
|
2036
2048
|
|
|
2037
|
-
export declare const Toggle: ({ name, label, checked, disabled, display, small, onChange, noMargin, testId, helpText, onClickHelp,
|
|
2049
|
+
export declare const Toggle: ({ name, label, checked, disabled, display, small, onChange, noMargin, testId, helpText, onClickHelp, }: IToggleProps) => JSX_2.Element;
|
|
2038
2050
|
|
|
2039
2051
|
export declare type TOnChangeEvent = {
|
|
2040
2052
|
target: TOnChangeEventTarget;
|
|
@@ -2105,7 +2117,7 @@ declare type TStringNumberNull = string | number | null;
|
|
|
2105
2117
|
|
|
2106
2118
|
declare type TStringOrNumber = string | number;
|
|
2107
2119
|
|
|
2108
|
-
|
|
2120
|
+
declare type TTextTransform = 'uppercase' | 'lowercase' | 'capitalize' | 'none';
|
|
2109
2121
|
|
|
2110
2122
|
export declare type TTheme = 'dark' | 'white' | 'light' | 'inherit';
|
|
2111
2123
|
|
package/dist/index.js
CHANGED
|
@@ -385,15 +385,15 @@ const HelpIcon = ({ text: e, onClick: t, icon: n = "help", active: r = !1, maxWi
|
|
|
385
385
|
maxWidth: i,
|
|
386
386
|
children: /* @__PURE__ */ jsx(Icon, { icon: n })
|
|
387
387
|
})
|
|
388
|
-
}), CheckBox = ({ noMargin: e = !1, dataix: t = 0, isInTable: n = !1, tabIndex: r = 0, checked: i = !1, indeterminate: a = !1, name: o, label: l = "", disabled: u = !1, small: d = !1, onChange: f, testId: m, value: h, helpText: _, onClickHelp: v
|
|
389
|
-
let
|
|
388
|
+
}), CheckBox = ({ noMargin: e = !1, dataix: t = 0, isInTable: n = !1, tabIndex: r = 0, checked: i = !1, indeterminate: a = !1, name: o, label: l = "", disabled: u = !1, small: d = !1, onChange: f, testId: m, value: h, helpText: _, onClickHelp: v }) => {
|
|
389
|
+
let y = useContext(DisabledContext), b = _ || v, x = u || y, S = useRef(null);
|
|
390
390
|
return useEffect(() => {
|
|
391
|
-
|
|
391
|
+
S.current && (S.current.indeterminate = a);
|
|
392
392
|
}, [a]), /* @__PURE__ */ jsxs("div", {
|
|
393
|
-
className: cx(check_box_module_default.checkbox, e && check_box_module_default.noMargin, n && check_box_module_default.isInTable,
|
|
393
|
+
className: cx(check_box_module_default.checkbox, e && check_box_module_default.noMargin, n && check_box_module_default.isInTable, x && check_box_module_default.disabled, d && check_box_module_default.small, !l && check_box_module_default.noLabel),
|
|
394
394
|
"data-ix": t,
|
|
395
395
|
onClick: (e) => {
|
|
396
|
-
if (!
|
|
396
|
+
if (!x) {
|
|
397
397
|
let t = e.target;
|
|
398
398
|
t.name = o, t.checked = !i, f({
|
|
399
399
|
...e,
|
|
@@ -407,24 +407,23 @@ const HelpIcon = ({ text: e, onClick: t, icon: n = "help", active: r = !1, maxWi
|
|
|
407
407
|
"data-testid": m,
|
|
408
408
|
children: [
|
|
409
409
|
/* @__PURE__ */ jsx("input", {
|
|
410
|
-
ref:
|
|
410
|
+
ref: S,
|
|
411
411
|
type: "checkbox",
|
|
412
412
|
tabIndex: r,
|
|
413
413
|
checked: i,
|
|
414
414
|
name: o,
|
|
415
415
|
onChange: () => {},
|
|
416
|
-
disabled:
|
|
416
|
+
disabled: x,
|
|
417
417
|
"data-indeterminate": a
|
|
418
418
|
}),
|
|
419
419
|
/* @__PURE__ */ jsxs("label", {
|
|
420
420
|
htmlFor: o,
|
|
421
|
-
style: { textTransform: y },
|
|
422
421
|
children: [/* @__PURE__ */ jsx("span", {
|
|
423
422
|
className: check_box_module_default.checkmark,
|
|
424
423
|
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.CHECK })
|
|
425
424
|
}), l]
|
|
426
425
|
}),
|
|
427
|
-
|
|
426
|
+
b && /* @__PURE__ */ jsx("div", {
|
|
428
427
|
className: check_box_module_default.helpIconEnabled,
|
|
429
428
|
onClick: v,
|
|
430
429
|
children: /* @__PURE__ */ jsx(HelpIcon, { text: _ })
|
|
@@ -4288,13 +4287,13 @@ var toggle_module_default = {
|
|
|
4288
4287
|
noMargin: "_noMargin_1c9wf_110",
|
|
4289
4288
|
helpIconEnabled: "_helpIconEnabled_1c9wf_113"
|
|
4290
4289
|
};
|
|
4291
|
-
const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, small: a = !1, onChange: o, noMargin: c = !1, testId: l, helpText: u, onClickHelp: d
|
|
4292
|
-
let
|
|
4290
|
+
const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, small: a = !1, onChange: o, noMargin: c = !1, testId: l, helpText: u, onClickHelp: d }) => {
|
|
4291
|
+
let f = useContext(DisabledContext), p = u || d, m = r || f;
|
|
4293
4292
|
return /* @__PURE__ */ jsxs("div", {
|
|
4294
|
-
className: cx(toggle_module_default.toggle,
|
|
4293
|
+
className: cx(toggle_module_default.toggle, m ? toggle_module_default.disabled : null, a ? toggle_module_default.small : null, c ? toggle_module_default.noMargin : null),
|
|
4295
4294
|
style: { display: i },
|
|
4296
4295
|
onClick: (t) => {
|
|
4297
|
-
|
|
4296
|
+
m || (t.target.name = e, t.target.checked = !n, t.target.value = !n, o(t));
|
|
4298
4297
|
},
|
|
4299
4298
|
"data-testid": l,
|
|
4300
4299
|
children: [
|
|
@@ -4302,15 +4301,12 @@ const Toggle = ({ name: e, label: t, checked: n = !1, disabled: r, display: i, s
|
|
|
4302
4301
|
type: InputType.CHECKBOX,
|
|
4303
4302
|
name: e,
|
|
4304
4303
|
value: n?.toString(),
|
|
4305
|
-
disabled:
|
|
4304
|
+
disabled: m,
|
|
4306
4305
|
checked: n,
|
|
4307
4306
|
onChange: () => {}
|
|
4308
4307
|
}),
|
|
4309
|
-
/* @__PURE__ */ jsx("label", {
|
|
4310
|
-
|
|
4311
|
-
children: t
|
|
4312
|
-
}),
|
|
4313
|
-
m && /* @__PURE__ */ jsx("div", {
|
|
4308
|
+
/* @__PURE__ */ jsx("label", { children: t }),
|
|
4309
|
+
p && /* @__PURE__ */ jsx("div", {
|
|
4314
4310
|
className: toggle_module_default.helpIconEnabled,
|
|
4315
4311
|
onClick: d,
|
|
4316
4312
|
children: /* @__PURE__ */ jsx(HelpIcon, { text: u })
|
|
@@ -5686,8 +5682,8 @@ var radio_button_module_default = {
|
|
|
5686
5682
|
isInTable: "_isInTable_1fbik_106",
|
|
5687
5683
|
helpIconEnabled: "_helpIconEnabled_1fbik_111"
|
|
5688
5684
|
};
|
|
5689
|
-
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
|
|
5690
|
-
let
|
|
5685
|
+
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 }) => {
|
|
5686
|
+
let d = l || u;
|
|
5691
5687
|
return /* @__PURE__ */ jsxs("div", {
|
|
5692
5688
|
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),
|
|
5693
5689
|
onClick: o,
|
|
@@ -5703,10 +5699,9 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
|
|
|
5703
5699
|
/* @__PURE__ */ jsx("label", {
|
|
5704
5700
|
"data-name": e,
|
|
5705
5701
|
"data-value": n,
|
|
5706
|
-
style: { textTransform: d },
|
|
5707
5702
|
children: t
|
|
5708
5703
|
}),
|
|
5709
|
-
|
|
5704
|
+
d && /* @__PURE__ */ jsx("div", {
|
|
5710
5705
|
className: radio_button_module_default.helpIconEnabled,
|
|
5711
5706
|
onClick: u,
|
|
5712
5707
|
children: /* @__PURE__ */ jsx(HelpIcon, { text: l })
|
|
@@ -5739,8 +5734,7 @@ const RadioInput = ({ name: e, label: t, value: n, selected: r, disabled: i = !1
|
|
|
5739
5734
|
},
|
|
5740
5735
|
testId: t.testId,
|
|
5741
5736
|
helpText: t.helpText,
|
|
5742
|
-
onClickHelp: t.onClickHelp
|
|
5743
|
-
textTransform: t.textTransform
|
|
5737
|
+
onClickHelp: t.onClickHelp
|
|
5744
5738
|
}, n);
|
|
5745
5739
|
})]
|
|
5746
5740
|
});
|
|
@@ -6569,7 +6563,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6569
6563
|
} : {
|
|
6570
6564
|
value: G,
|
|
6571
6565
|
unit: U
|
|
6572
|
-
}),
|
|
6566
|
+
}), Ou = k || K?.value === void 0, [J, ku] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Au = !!(O || n), Y = C && C.find((e) => {
|
|
6573
6567
|
if (!e?.value) return;
|
|
6574
6568
|
if (E) return E === e.valueKey;
|
|
6575
6569
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -6578,7 +6572,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6578
6572
|
toUnit: t
|
|
6579
6573
|
});
|
|
6580
6574
|
return withUnit(n, t) === e.value;
|
|
6581
|
-
}),
|
|
6575
|
+
}), ju = () => {
|
|
6582
6576
|
let e = l ?? "", t = K.unit;
|
|
6583
6577
|
if (checkConversion({
|
|
6584
6578
|
value: e,
|
|
@@ -6592,7 +6586,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6592
6586
|
return null;
|
|
6593
6587
|
}
|
|
6594
6588
|
} else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
|
|
6595
|
-
},
|
|
6589
|
+
}, Mu = (t) => {
|
|
6596
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;
|
|
6597
6591
|
h({ target: {
|
|
6598
6592
|
value: s,
|
|
@@ -6605,7 +6599,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6605
6599
|
}), R(() => {
|
|
6606
6600
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6607
6601
|
});
|
|
6608
|
-
},
|
|
6602
|
+
}, Nu = (e, t) => {
|
|
6609
6603
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
6610
6604
|
value: e,
|
|
6611
6605
|
unit: t
|
|
@@ -6636,7 +6630,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6636
6630
|
e !== void 0 && q({
|
|
6637
6631
|
value: e,
|
|
6638
6632
|
unit: t
|
|
6639
|
-
}), C &&
|
|
6633
|
+
}), C && ku(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
6640
6634
|
}
|
|
6641
6635
|
}, [
|
|
6642
6636
|
U,
|
|
@@ -6644,7 +6638,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6644
6638
|
i,
|
|
6645
6639
|
T
|
|
6646
6640
|
]);
|
|
6647
|
-
let X =
|
|
6641
|
+
let X = ju(), Z = label(K.unit) || K.unit || "", Pu = p || !X || X && X.length === 1, Q = getStringName(e), $, Fu = (t) => {
|
|
6648
6642
|
let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
6649
6643
|
if (checkConversion({
|
|
6650
6644
|
value: r,
|
|
@@ -6664,7 +6658,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6664
6658
|
type: MenuType.OPTION,
|
|
6665
6659
|
inline: !0,
|
|
6666
6660
|
onClick: () => {
|
|
6667
|
-
validateNumber(i).valid && !n && (
|
|
6661
|
+
validateNumber(i).valid && !n && (ku(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
6668
6662
|
value: r,
|
|
6669
6663
|
name: typeof e == "string" ? e : e?.fieldName || "",
|
|
6670
6664
|
predefinedSelected: !0,
|
|
@@ -6691,10 +6685,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6691
6685
|
label: "Custom",
|
|
6692
6686
|
selected: J === PredefinedOptionsMenuState.CUSTOM
|
|
6693
6687
|
}], C?.length) {
|
|
6694
|
-
let e = C.map(
|
|
6688
|
+
let e = C.map(Fu);
|
|
6695
6689
|
$ = [...$, ...e];
|
|
6696
6690
|
}
|
|
6697
|
-
let
|
|
6691
|
+
let Iu = (e) => {
|
|
6698
6692
|
if (isValueWithUnit(e)) {
|
|
6699
6693
|
let t = getUnit(e), { value: n } = safeConvertValue({
|
|
6700
6694
|
value: e,
|
|
@@ -6706,7 +6700,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6706
6700
|
return n;
|
|
6707
6701
|
}
|
|
6708
6702
|
return e;
|
|
6709
|
-
},
|
|
6703
|
+
}, Lu = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Ru = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
6710
6704
|
return /* @__PURE__ */ jsx("div", {
|
|
6711
6705
|
className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
|
|
6712
6706
|
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -6738,31 +6732,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6738
6732
|
name: Q,
|
|
6739
6733
|
testId: x,
|
|
6740
6734
|
disabled: n,
|
|
6741
|
-
placeholder:
|
|
6735
|
+
placeholder: Iu(t),
|
|
6742
6736
|
value: K.value,
|
|
6743
|
-
onChange:
|
|
6737
|
+
onChange: Mu,
|
|
6744
6738
|
onFocus: v,
|
|
6745
6739
|
error: i === null ? void 0 : i,
|
|
6746
6740
|
warning: S === null ? void 0 : S,
|
|
6747
6741
|
left: a,
|
|
6748
|
-
allowEmpty:
|
|
6742
|
+
allowEmpty: Ou,
|
|
6749
6743
|
validationCallback: (e, t) => D(Q, t),
|
|
6750
6744
|
enableCosmeticRounding: j,
|
|
6751
6745
|
enableDisplayRounding: M,
|
|
6752
6746
|
roundDisplayValue: N,
|
|
6753
|
-
groupOrder:
|
|
6754
|
-
disableInternalErrorValidationMessages:
|
|
6747
|
+
groupOrder: Lu,
|
|
6748
|
+
disableInternalErrorValidationMessages: Au,
|
|
6755
6749
|
small: o,
|
|
6756
6750
|
selectOnFocus: P,
|
|
6757
6751
|
tooltip: I
|
|
6758
6752
|
}, Q)
|
|
6759
6753
|
}),
|
|
6760
|
-
Z && (
|
|
6761
|
-
groupOrder:
|
|
6754
|
+
Z && (Pu || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
6755
|
+
groupOrder: Ru,
|
|
6762
6756
|
small: o,
|
|
6763
6757
|
children: Z
|
|
6764
6758
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
6765
|
-
groupOrder:
|
|
6759
|
+
groupOrder: Ru,
|
|
6766
6760
|
maxHeight: 380,
|
|
6767
6761
|
disabled: r,
|
|
6768
6762
|
testId: x && `${x}-menu`,
|
|
@@ -6778,7 +6772,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6778
6772
|
label: j ? safeRoundNumbers(i) : i,
|
|
6779
6773
|
inline: !0,
|
|
6780
6774
|
onClick: (n) => {
|
|
6781
|
-
n.stopPropagation(),
|
|
6775
|
+
n.stopPropagation(), Nu(e, t);
|
|
6782
6776
|
},
|
|
6783
6777
|
description: r,
|
|
6784
6778
|
selected: r === Z,
|
|
@@ -7057,7 +7051,199 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
|
|
|
7057
7051
|
compareMethod: DiffMethod.WORDS
|
|
7058
7052
|
})
|
|
7059
7053
|
}) });
|
|
7060
|
-
}
|
|
7054
|
+
};
|
|
7055
|
+
function formatDate({ date: e, showTime: t, showSeconds: n, timeZone: r, showTimeZone: i, locale: a }) {
|
|
7056
|
+
return e ? new Date(e).toLocaleString(a, {
|
|
7057
|
+
year: "numeric",
|
|
7058
|
+
month: "short",
|
|
7059
|
+
day: "2-digit",
|
|
7060
|
+
hour: t ? "2-digit" : void 0,
|
|
7061
|
+
minute: t ? "2-digit" : void 0,
|
|
7062
|
+
second: n ? "2-digit" : void 0,
|
|
7063
|
+
timeZone: r,
|
|
7064
|
+
timeZoneName: i ? "short" : void 0
|
|
7065
|
+
}) : null;
|
|
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
|
+
function AuditLogTable({ logs: e, loading: t }) {
|
|
7104
|
+
let [n, r] = useState(!0), [i, a] = useState(!0), o = [
|
|
7105
|
+
{
|
|
7106
|
+
label: "10 / page",
|
|
7107
|
+
value: 10
|
|
7108
|
+
},
|
|
7109
|
+
{
|
|
7110
|
+
label: "20 / page",
|
|
7111
|
+
value: 20
|
|
7112
|
+
},
|
|
7113
|
+
{
|
|
7114
|
+
label: "50 / page",
|
|
7115
|
+
value: 50
|
|
7116
|
+
},
|
|
7117
|
+
{
|
|
7118
|
+
label: "Show all",
|
|
7119
|
+
value: 0
|
|
7120
|
+
}
|
|
7121
|
+
], [s, c] = useState(10), [l, u] = useState(1), [d, f] = useState(""), [p, h] = useState(""), [g, _] = useState(""), [v, y] = useState(""), b = (e) => f(e.target.value), x = (e) => h(e.target.value), S = ({ diffs: e = [], userName: t, source: n, operation: r, operationMetaData: i }) => {
|
|
7122
|
+
if (n === "API") return r === "Created" ? `Created through API by ${t || "Unknown user"}` : `Changed through API by ${t || "Unknown user"}`;
|
|
7123
|
+
switch (r) {
|
|
7124
|
+
case "Created": return `Created by ${t}`;
|
|
7125
|
+
case "Cloned": return `Cloned by ${t} (from ${i || "unknown"})`;
|
|
7126
|
+
case "Reverted": return `Reverted by ${t}`;
|
|
7127
|
+
case "Imported": return `Imported by ${t}`;
|
|
7128
|
+
case "Updated": return `Updated by ${t} (${e.length} changes)`;
|
|
7129
|
+
default: return `Change by ${t}`;
|
|
7130
|
+
}
|
|
7131
|
+
}, C = e.filter((e) => {
|
|
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: [
|
|
7135
|
+
{ value: "Change" },
|
|
7136
|
+
{ value: "Modified by" },
|
|
7137
|
+
{ value: "Using" },
|
|
7138
|
+
{ value: "Operation" },
|
|
7139
|
+
{ 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: [
|
|
7173
|
+
{
|
|
7174
|
+
value: S(e),
|
|
7175
|
+
type: "Static"
|
|
7176
|
+
},
|
|
7177
|
+
{
|
|
7178
|
+
value: e.userName || "Unknown",
|
|
7179
|
+
type: "Static"
|
|
7180
|
+
},
|
|
7181
|
+
{
|
|
7182
|
+
value: e.source || "System",
|
|
7183
|
+
type: "Static"
|
|
7184
|
+
},
|
|
7185
|
+
{
|
|
7186
|
+
value: e.operation,
|
|
7187
|
+
type: "Static"
|
|
7188
|
+
},
|
|
7189
|
+
{
|
|
7190
|
+
value: formatDate({
|
|
7191
|
+
date: e.date,
|
|
7192
|
+
showTime: !0
|
|
7193
|
+
}),
|
|
7194
|
+
type: "Static"
|
|
7195
|
+
}
|
|
7196
|
+
] }));
|
|
7197
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Card, {
|
|
7198
|
+
heading: /* @__PURE__ */ jsxs(Flex, {
|
|
7199
|
+
gap: !0,
|
|
7200
|
+
wrap: !0,
|
|
7201
|
+
children: [
|
|
7202
|
+
/* @__PURE__ */ jsx(Heading, { children: "CHANGES" }),
|
|
7203
|
+
/* @__PURE__ */ jsx(Toggle, {
|
|
7204
|
+
small: !0,
|
|
7205
|
+
checked: n,
|
|
7206
|
+
onChange: () => r(!n),
|
|
7207
|
+
label: "Include company settings"
|
|
7208
|
+
}),
|
|
7209
|
+
/* @__PURE__ */ jsx(Toggle, {
|
|
7210
|
+
small: !0,
|
|
7211
|
+
checked: i,
|
|
7212
|
+
onChange: () => a(!i),
|
|
7213
|
+
label: "Include migrations"
|
|
7214
|
+
})
|
|
7215
|
+
]
|
|
7216
|
+
}),
|
|
7217
|
+
padding: !1,
|
|
7218
|
+
children: t ? /* @__PURE__ */ jsx(Loader, {
|
|
7219
|
+
height: "100px",
|
|
7220
|
+
cover: !0,
|
|
7221
|
+
theme: Theme.WHITE,
|
|
7222
|
+
children: /* @__PURE__ */ jsx(Spinner, { dark: !0 })
|
|
7223
|
+
}) : /* @__PURE__ */ jsx(Table, { table: {
|
|
7224
|
+
headers: D,
|
|
7225
|
+
rows: O,
|
|
7226
|
+
fixedWidth: "100%",
|
|
7227
|
+
bordered: !1,
|
|
7228
|
+
actionsRight: !0,
|
|
7229
|
+
footer: { pagination: {
|
|
7230
|
+
rowCount: C.length,
|
|
7231
|
+
selectedPage: l,
|
|
7232
|
+
rowsPerPage: {
|
|
7233
|
+
onChange: (e) => {
|
|
7234
|
+
let { value: t } = e.target;
|
|
7235
|
+
c(Number(t)), u(1);
|
|
7236
|
+
},
|
|
7237
|
+
options: o,
|
|
7238
|
+
value: s
|
|
7239
|
+
},
|
|
7240
|
+
onSelectPage: (e) => u(e),
|
|
7241
|
+
small: !0
|
|
7242
|
+
} }
|
|
7243
|
+
} })
|
|
7244
|
+
}) });
|
|
7245
|
+
}
|
|
7246
|
+
const isPrimitiveValue = (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null, initializeGuiLibrary = (e) => {
|
|
7061
7247
|
setConfig(ConfigKeyType.LanguageKey, e.languageKey), Object.entries(e).forEach(([e, t]) => {
|
|
7062
7248
|
if (e === ConfigKeyType.Translations) setConfig(e, getTranslations(t));
|
|
7063
7249
|
else {
|
|
@@ -7066,4 +7252,4 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
|
|
|
7066
7252
|
}
|
|
7067
7253
|
});
|
|
7068
7254
|
};
|
|
7069
|
-
export { Accordion, AccordionWithDefaultToggle, Actions, Align, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Color, 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,
|
|
7255
|
+
export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLogTable, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Color, 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, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TriggerType, UnitInput, UnitTable, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
|
package/package.json
CHANGED