@oliasoft-open-source/react-ui-library 10.1.0 → 10.1.1-beta-1

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
@@ -54,7 +54,7 @@ export declare interface AuditLogItem {
54
54
  snapshot?: string | null;
55
55
  }
56
56
 
57
- export declare type AuditLogOperation = 'Created' | 'Cloned' | 'Reverted' | 'Imported' | 'Updated';
57
+ export declare type AuditLogOperation = 'Created' | 'Cloned' | 'Reverted' | 'Restored' | 'Imported' | 'Updated';
58
58
 
59
59
  export declare const Badge: ({ children, color, textColor: textColorProp, title, dot, margin, small, }: IBadgeProps) => JSX.Element;
60
60
 
@@ -254,6 +254,7 @@ declare interface IAuditLogProps {
254
254
  snapshotLoading?: boolean;
255
255
  getActions?: (log: AuditLogItem) => any[];
256
256
  isLogDisabled?: (log: AuditLogItem) => boolean;
257
+ onClickNavigateToDesgin?: (operationMetaData: string | number) => void;
257
258
  }
258
259
 
259
260
  export declare interface IBadgeProps {
package/dist/index.js CHANGED
@@ -10085,35 +10085,36 @@ var Jm = (e = {}) => qm({
10085
10085
  if (i === "API" && !r) return a === "Created" ? "Created through API" : "Changed through API";
10086
10086
  switch (a) {
10087
10087
  case "Created": return `Created by ${r}`;
10088
- case "Cloned": return `Cloned by ${r} (from ${o || "unknown"})`;
10089
- case "Reverted": return `Restored by ${r} ${o ? `(from ${o})` : ""}`;
10088
+ case "Cloned": return `Cloned from ${o}`;
10089
+ case "Reverted": return `Reverted by ${r} ${o ? `(from ${o})` : ""}`;
10090
+ case "Restored": return `Restored from ${o}`;
10090
10091
  case "Imported": return `Imported by ${r}`;
10091
10092
  case "Updated": return `Updated by ${r} (${c})`;
10092
10093
  default: return `Change by ${r}`;
10093
10094
  }
10094
- }, hh = ({ logs: e, data: t, total: n, loading: r, selectedPage: i, rowsPerPage: a, sectionNames: o, defaultSectionName: s, filterToggles: c = [], transformDiffsConfig: l, onChangeRowsPerPage: u, onSelectPage: d, onClickSnapshot: f, snapshotLoading: p, getActions: m, isLogDisabled: h }) => {
10095
- let [g, _] = v(!1), [y, b] = v(null), w = (e) => {
10095
+ }, hh = ({ logs: e, data: t, total: n, loading: r, selectedPage: i, rowsPerPage: a, sectionNames: o, defaultSectionName: s, filterToggles: c = [], transformDiffsConfig: l, onChangeRowsPerPage: u, onSelectPage: d, onClickSnapshot: f, snapshotLoading: p, getActions: m, isLogDisabled: h, onClickNavigateToDesgin: g }) => {
10096
+ let [_, y] = v(!1), [b, w] = v(null), T = (e) => {
10096
10097
  if (e.snapshot) {
10097
10098
  f == null || f(e.snapshot, e);
10098
10099
  return;
10099
10100
  }
10100
- b(e), _(!0);
10101
- }, T = [{ cells: [
10101
+ w(e), y(!0);
10102
+ }, E = [{ cells: [
10102
10103
  { value: "Change" },
10103
10104
  { value: "Modified by" },
10104
10105
  { value: "Using" },
10105
10106
  { value: "Operation" },
10106
10107
  { value: "Date" }
10107
- ] }], E = e.map((e) => {
10108
+ ] }], D = e.map((e) => {
10108
10109
  var t;
10109
- let n = (t = h == null ? void 0 : h(e)) == null ? !!(e.snapshot && p || !e.diffs) : t;
10110
+ let n = (t = h == null ? void 0 : h(e)) == null ? !!(e.snapshot && p || !e.diffs) : t, r = e.snapshot ? `Snapshot: ${e.snapshot}` : mh(e, l), i = (e.operation === "Restored" || e.operation === "Cloned") && g;
10110
10111
  return {
10111
10112
  cells: [
10112
10113
  {
10113
- value: e.snapshot ? `Snapshot: ${e.snapshot}` : mh(e, l),
10114
+ value: r,
10114
10115
  type: "Link",
10115
10116
  disabled: n,
10116
- onClick: n ? void 0 : () => w(e),
10117
+ onClick: n ? void 0 : i ? () => g(e.operationMetaData) : () => T(e),
10117
10118
  breakWord: !0
10118
10119
  },
10119
10120
  {
@@ -10160,9 +10161,9 @@ var Jm = (e = {}) => qm({
10160
10161
  theme: Mi.WHITE,
10161
10162
  children: /* @__PURE__ */ S(Sa, { dark: !0 })
10162
10163
  }) : /* @__PURE__ */ S(eu, { table: {
10163
- headers: T,
10164
+ headers: E,
10164
10165
  testId: "auditlog-table",
10165
- rows: E,
10166
+ rows: D,
10166
10167
  fixedWidth: "100%",
10167
10168
  bordered: !1,
10168
10169
  actionsRight: !0,
@@ -10180,12 +10181,12 @@ var Jm = (e = {}) => qm({
10180
10181
  small: !0
10181
10182
  } }
10182
10183
  } })
10183
- }), g && y && y.diffs && /* @__PURE__ */ S(fh, {
10184
+ }), _ && b && b.diffs && /* @__PURE__ */ S(fh, {
10184
10185
  sectionNames: o,
10185
- isOpen: g,
10186
- onClose: () => _(!1),
10186
+ isOpen: _,
10187
+ onClose: () => y(!1),
10187
10188
  auditLogs: e,
10188
- auditLog: y,
10189
+ auditLog: b,
10189
10190
  defaultSectionName: s,
10190
10191
  data: t,
10191
10192
  transformDiffsConfig: l
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "10.1.0",
3
+ "version": "10.1.1-beta-1",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {