@odigos/ui-kit 0.0.11 → 0.0.12
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/CHANGELOG.md +7 -0
- package/lib/components/interactive-table/index.d.ts +8 -7
- package/lib/components/interactive-table/{row.d.ts → table-row.d.ts} +5 -5
- package/lib/components.js +2 -2
- package/lib/containers.js +38 -32
- package/lib/{index-B_fzHjxk.js → index-B5wdZoej.js} +19 -19
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.12](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.11...ui-kit-v0.0.12) (2025-03-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* table row click ([#34](https://github.com/odigos-io/ui-kit/issues/34)) ([5e78a3f](https://github.com/odigos-io/ui-kit/commit/5e78a3f516f294dae83729ebd52bf37bbfa3dd61))
|
|
9
|
+
|
|
3
10
|
## [0.0.11](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.10...ui-kit-v0.0.11) (2025-03-20)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -13,14 +13,15 @@ interface RowCell {
|
|
|
13
13
|
textColor?: CSSProperties['color'];
|
|
14
14
|
withTooltip?: boolean;
|
|
15
15
|
}
|
|
16
|
+
interface Row {
|
|
17
|
+
status?: StatusType;
|
|
18
|
+
faded?: boolean;
|
|
19
|
+
onClick?: () => void;
|
|
20
|
+
cells: RowCell[];
|
|
21
|
+
}
|
|
16
22
|
interface InteractiveTableProps {
|
|
17
23
|
columns: ColumnCell[];
|
|
18
|
-
rows:
|
|
19
|
-
status?: StatusType;
|
|
20
|
-
faded?: boolean;
|
|
21
|
-
cells: RowCell[];
|
|
22
|
-
}[];
|
|
23
|
-
onRowClick?: (index: number) => void;
|
|
24
|
+
rows: Row[];
|
|
24
25
|
}
|
|
25
26
|
declare const InteractiveTable: FC<InteractiveTableProps>;
|
|
26
|
-
export { InteractiveTable, type InteractiveTableProps, type ColumnCell, type RowCell };
|
|
27
|
+
export { InteractiveTable, type InteractiveTableProps, type ColumnCell, type RowCell, type Row };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ColumnCell, RowCell } from '.';
|
|
1
|
+
import { type FC } from 'react';
|
|
3
2
|
import { StatusType } from '@/types';
|
|
4
|
-
|
|
3
|
+
import { ColumnCell, RowCell } from '.';
|
|
4
|
+
interface TableRowProps {
|
|
5
5
|
index: number;
|
|
6
6
|
columns: ColumnCell[];
|
|
7
7
|
cells: RowCell[];
|
|
@@ -9,5 +9,5 @@ interface RowProps {
|
|
|
9
9
|
status?: StatusType;
|
|
10
10
|
faded?: boolean;
|
|
11
11
|
}
|
|
12
|
-
declare const
|
|
13
|
-
export {
|
|
12
|
+
declare const TableRow: FC<TableRowProps>;
|
|
13
|
+
export { TableRow, type TableRowProps };
|
package/lib/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as Button } from './index-
|
|
2
|
-
export { A as AutocompleteInput, a as Badge, C as CancelWarning, a0 as CenterThis, b as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as DeleteWarning, i as Divider, j as DocsButton, k as Drawer, m as DrawerFooter, l as DrawerHeader, n as Dropdown, E as ExtendArrow, F as FadeLoader, o as FieldError, p as FieldLabel, $ as FlexColumn, _ as FlexRow, H as Header, I as IconButton, q as IconGroup, r as IconTitleBadge, s as IconWrapped, t as IconsNav, u as ImageControlled, v as Input, w as InputList, x as InputTable, y as InteractiveTable, K as KeyValueInputsList, M as Modal, a2 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a1 as Overlay, S as SectionTitle, O as Segment, P as SkeletonLoader, Q as Status, R as Stepper, a3 as TableContainer, a4 as TableTitleWrap, a5 as TableWrap, U as Text, V as TextArea, W as Toggle, T as ToggleCodeComponent, X as Tooltip, Y as TraceLoader, Z as WarningModal } from './index-
|
|
1
|
+
import { B as Button } from './index-B5wdZoej.js';
|
|
2
|
+
export { A as AutocompleteInput, a as Badge, C as CancelWarning, a0 as CenterThis, b as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as DeleteWarning, i as Divider, j as DocsButton, k as Drawer, m as DrawerFooter, l as DrawerHeader, n as Dropdown, E as ExtendArrow, F as FadeLoader, o as FieldError, p as FieldLabel, $ as FlexColumn, _ as FlexRow, H as Header, I as IconButton, q as IconGroup, r as IconTitleBadge, s as IconWrapped, t as IconsNav, u as ImageControlled, v as Input, w as InputList, x as InputTable, y as InteractiveTable, K as KeyValueInputsList, M as Modal, a2 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a1 as Overlay, S as SectionTitle, O as Segment, P as SkeletonLoader, Q as Status, R as Stepper, a3 as TableContainer, a4 as TableTitleWrap, a5 as TableWrap, U as Text, V as TextArea, W as Toggle, T as ToggleCodeComponent, X as Tooltip, Y as TraceLoader, Z as WarningModal } from './index-B5wdZoej.js';
|
|
3
3
|
import React, { Component, createElement, createContext } from 'react';
|
|
4
4
|
import Theme from './theme.js';
|
|
5
5
|
import './types.js';
|
package/lib/containers.js
CHANGED
|
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components';
|
|
|
3
3
|
import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-CJKFedQi.js';
|
|
4
4
|
import { D as DISPLAY_TITLES, F as FORM_ALERTS } from './index-C_0J5P9M.js';
|
|
5
5
|
import { ActionType, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, FieldTypes, SignalType, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType } from './types.js';
|
|
6
|
-
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, U as Text, O as Segment, S as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, V as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a2 as ModalBody, A as AutocompleteInput, i as Divider, Q as Status, _ as FlexRow, X as Tooltip, s as IconWrapped, G as MonitorsIcons, a3 as TableContainer, a4 as TableTitleWrap, r as IconTitleBadge, a5 as TableWrap, y as InteractiveTable, a0 as CenterThis, J as NoDataFound, $ as FlexColumn, Y as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a6 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, P as SkeletonLoader, W as Toggle, L as NotificationNote, R as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-
|
|
6
|
+
import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, U as Text, O as Segment, S as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, V as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a2 as ModalBody, A as AutocompleteInput, i as Divider, Q as Status, _ as FlexRow, X as Tooltip, s as IconWrapped, G as MonitorsIcons, a3 as TableContainer, a4 as TableTitleWrap, r as IconTitleBadge, a5 as TableWrap, y as InteractiveTable, a0 as CenterThis, J as NoDataFound, $ as FlexColumn, Y as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a6 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, P as SkeletonLoader, W as Toggle, L as NotificationNote, R as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-B5wdZoej.js';
|
|
7
7
|
import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore, k as getEntityId, i as useSetupStore, u as useDarkMode } from './index-DYEcdkUF.js';
|
|
8
8
|
import Theme from './theme.js';
|
|
9
9
|
import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
|
|
@@ -683,6 +683,10 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
|
|
|
683
683
|
return {
|
|
684
684
|
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
685
685
|
faded: hasDisableds,
|
|
686
|
+
onClick: () => {
|
|
687
|
+
setDrawerType(EntityTypes.Action);
|
|
688
|
+
setDrawerEntityId(act.id);
|
|
689
|
+
},
|
|
686
690
|
cells: [
|
|
687
691
|
{
|
|
688
692
|
columnKey: 'icon',
|
|
@@ -731,10 +735,7 @@ const ActionTable = ({ maxHeight, maxWidth }) => {
|
|
|
731
735
|
React.createElement(TableTitleWrap, null,
|
|
732
736
|
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Action), title: DISPLAY_TITLES.Actions, badge: badge, badgeTooltip: badgeTooltip, loading: actionsLoading })),
|
|
733
737
|
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
734
|
-
React.createElement(InteractiveTable, { columns: columns$3, rows: rows
|
|
735
|
-
setDrawerType(EntityTypes.Action);
|
|
736
|
-
setDrawerEntityId(filtered[idx].id);
|
|
737
|
-
} })),
|
|
738
|
+
React.createElement(InteractiveTable, { columns: columns$3, rows: rows })),
|
|
738
739
|
!filtered.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
739
740
|
React.createElement(NoDataFound, null)))));
|
|
740
741
|
};
|
|
@@ -916,9 +917,23 @@ const ComputePlatformSelect = ({ connections, selected, onSelect, onViewAll }) =
|
|
|
916
917
|
|
|
917
918
|
const ComputePlatforms = ({ connections, onSelect }) => {
|
|
918
919
|
const { searchText, platformTypes, statuses } = useFilterStore();
|
|
919
|
-
const filtered = connections.filter(({ id, type, status }) => (!searchText || id.toLowerCase().includes(searchText)) &&
|
|
920
|
+
const filtered = useMemo(() => connections.filter(({ id, type, status }) => (!searchText || id.toLowerCase().includes(searchText)) &&
|
|
920
921
|
(!platformTypes?.length || platformTypes.find((opt) => opt.id === type)) &&
|
|
921
|
-
(!statuses?.length || statuses.find((opt) => opt.id === status)));
|
|
922
|
+
(!statuses?.length || statuses.find((opt) => opt.id === status))), [connections, searchText, platformTypes, statuses]);
|
|
923
|
+
const rows = useMemo(() => filtered.map((item) => ({
|
|
924
|
+
onClick: () => onSelect(item),
|
|
925
|
+
cells: [
|
|
926
|
+
{ columnKey: 'id', value: item.id },
|
|
927
|
+
{ columnKey: 'type', value: item.type },
|
|
928
|
+
{ columnKey: 'name', value: item.name || getPlatformLabel(item.type) },
|
|
929
|
+
{ columnKey: 'icon', icon: getPlatformIcon(item.type) },
|
|
930
|
+
{
|
|
931
|
+
columnKey: 'status',
|
|
932
|
+
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
933
|
+
React.createElement(Status, { title: status === StatusType.Success ? 'connection alive' : 'connection lost', status: item.status, withIcon: true, withBorder: true }))),
|
|
934
|
+
},
|
|
935
|
+
],
|
|
936
|
+
})), [filtered]);
|
|
922
937
|
return (React.createElement(React.Fragment, null,
|
|
923
938
|
React.createElement(InteractiveTable, { columns: [
|
|
924
939
|
{ key: 'icon', title: '' },
|
|
@@ -926,19 +941,7 @@ const ComputePlatforms = ({ connections, onSelect }) => {
|
|
|
926
941
|
{ key: 'type', title: 'Type' },
|
|
927
942
|
{ key: 'status', title: 'Status' },
|
|
928
943
|
{ key: 'id', title: 'Unique ID' },
|
|
929
|
-
], rows:
|
|
930
|
-
cells: [
|
|
931
|
-
{ columnKey: 'id', value: id },
|
|
932
|
-
{ columnKey: 'type', value: type },
|
|
933
|
-
{ columnKey: 'name', value: !!name ? name : getPlatformLabel(type) },
|
|
934
|
-
{ columnKey: 'icon', icon: getPlatformIcon(type) },
|
|
935
|
-
{
|
|
936
|
-
columnKey: 'status',
|
|
937
|
-
component: () => (React.createElement("div", { style: { lineHeight: 1 } },
|
|
938
|
-
React.createElement(Status, { title: status === StatusType.Success ? 'connection alive' : 'connection lost', status: status, withIcon: true, withBorder: true }))),
|
|
939
|
-
},
|
|
940
|
-
],
|
|
941
|
-
})), onRowClick: (idx) => onSelect(filtered[idx]) }),
|
|
944
|
+
], rows: rows }),
|
|
942
945
|
!filtered.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
943
946
|
React.createElement(NoDataFound, null)))));
|
|
944
947
|
};
|
|
@@ -14336,6 +14339,10 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14336
14339
|
return {
|
|
14337
14340
|
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
14338
14341
|
faded: hasDisableds,
|
|
14342
|
+
onClick: () => {
|
|
14343
|
+
setDrawerType(EntityTypes.Destination);
|
|
14344
|
+
setDrawerEntityId(dest.id);
|
|
14345
|
+
},
|
|
14339
14346
|
cells: [
|
|
14340
14347
|
{
|
|
14341
14348
|
columnKey: 'icon',
|
|
@@ -14372,10 +14379,7 @@ const DestinationTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
14372
14379
|
React.createElement(TableTitleWrap, null,
|
|
14373
14380
|
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Destination), title: DISPLAY_TITLES.Destinations, badge: badge, badgeTooltip: badgeTooltip, loading: destinationsLoading })),
|
|
14374
14381
|
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
14375
|
-
React.createElement(InteractiveTable, { columns: columns$2, rows: rows
|
|
14376
|
-
setDrawerType(EntityTypes.Destination);
|
|
14377
|
-
setDrawerEntityId(filtered[idx].id);
|
|
14378
|
-
} })),
|
|
14382
|
+
React.createElement(InteractiveTable, { columns: columns$2, rows: rows })),
|
|
14379
14383
|
!filtered.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
14380
14384
|
React.createElement(NoDataFound, null)))));
|
|
14381
14385
|
};
|
|
@@ -14763,6 +14767,10 @@ const InstrumentationRuleTable = ({ maxHeight, maxWidth }) => {
|
|
|
14763
14767
|
// note: rules do not have filters yet
|
|
14764
14768
|
instrumentationRules.map((rule) => {
|
|
14765
14769
|
return {
|
|
14770
|
+
onClick: () => {
|
|
14771
|
+
setDrawerType(EntityTypes.InstrumentationRule);
|
|
14772
|
+
setDrawerEntityId(rule.ruleId);
|
|
14773
|
+
},
|
|
14766
14774
|
cells: [
|
|
14767
14775
|
{
|
|
14768
14776
|
columnKey: 'icon',
|
|
@@ -14811,10 +14819,7 @@ const InstrumentationRuleTable = ({ maxHeight, maxWidth }) => {
|
|
|
14811
14819
|
React.createElement(TableTitleWrap, null,
|
|
14812
14820
|
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Action), title: DISPLAY_TITLES.InstrumentationRules, badge: instrumentationRules.length, loading: instrumentationRulesLoading })),
|
|
14813
14821
|
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
14814
|
-
React.createElement(InteractiveTable, { columns: columns$1, rows: rows
|
|
14815
|
-
setDrawerType(EntityTypes.InstrumentationRule);
|
|
14816
|
-
setDrawerEntityId(instrumentationRules[idx].ruleId);
|
|
14817
|
-
} })),
|
|
14822
|
+
React.createElement(InteractiveTable, { columns: columns$1, rows: rows })),
|
|
14818
14823
|
!instrumentationRules.length && (React.createElement(CenterThis, { style: { marginTop: '2rem' } },
|
|
14819
14824
|
React.createElement(NoDataFound, null)))));
|
|
14820
14825
|
};
|
|
@@ -15644,6 +15649,10 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15644
15649
|
return {
|
|
15645
15650
|
status: hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : undefined,
|
|
15646
15651
|
faded: hasDisableds,
|
|
15652
|
+
onClick: () => {
|
|
15653
|
+
setDrawerType(EntityTypes.Source);
|
|
15654
|
+
setDrawerEntityId(id);
|
|
15655
|
+
},
|
|
15647
15656
|
cells: [
|
|
15648
15657
|
{
|
|
15649
15658
|
columnKey: 'checkbox-and-icon',
|
|
@@ -15689,10 +15698,7 @@ const SourceTable = ({ metrics, maxHeight, maxWidth }) => {
|
|
|
15689
15698
|
React.createElement(Checkbox, { partiallyChecked: hasSelected && filtered?.length !== totalSelectedSources, value: hasSelected && filtered?.length === totalSelectedSources, onChange: onSelectAll, disabled: !filtered?.length }),
|
|
15690
15699
|
React.createElement(IconTitleBadge, { icon: getEntityIcon(EntityTypes.Source), title: DISPLAY_TITLES.Sources, badge: badge, badgeTooltip: badgeTooltip, loading: sourcesLoading && !isAwaitingInstrumentation })),
|
|
15691
15700
|
React.createElement(TableWrap, { "$maxHeight": maxHeight },
|
|
15692
|
-
React.createElement(InteractiveTable, { columns: columns, rows: isAwaitingInstrumentation ? [] : rows
|
|
15693
|
-
setDrawerType(EntityTypes.Source);
|
|
15694
|
-
setDrawerEntityId({ namespace: filtered[idx].namespace, name: filtered[idx].name, kind: filtered[idx].kind });
|
|
15695
|
-
} })),
|
|
15701
|
+
React.createElement(InteractiveTable, { columns: columns, rows: isAwaitingInstrumentation ? [] : rows })),
|
|
15696
15702
|
isAwaitingInstrumentation ? (React.createElement(CenterThis, { style: { marginTop: '2rem', gap: '24px' } },
|
|
15697
15703
|
React.createElement(TraceLoader, { width: 420 }),
|
|
15698
15704
|
React.createElement(FlexRow, { "$gap": 16 },
|
|
@@ -3671,7 +3671,7 @@ const TableRow$1 = styled.tr `
|
|
|
3671
3671
|
padding-right: 0 !important;
|
|
3672
3672
|
}
|
|
3673
3673
|
`;
|
|
3674
|
-
const TableData
|
|
3674
|
+
const TableData = styled.td `
|
|
3675
3675
|
vertical-align: top;
|
|
3676
3676
|
padding: 4px 6px;
|
|
3677
3677
|
`;
|
|
@@ -3751,8 +3751,8 @@ const PrettyJsonCode = ({ darkMode, str }) => {
|
|
|
3751
3751
|
const theme = Theme.useTheme();
|
|
3752
3752
|
const renderEmptyRows = (count = 2) => {
|
|
3753
3753
|
const rows = new Array(count).fill((props) => (React.createElement(TableRow$1, { ...props },
|
|
3754
|
-
React.createElement(TableData
|
|
3755
|
-
React.createElement(TableData
|
|
3754
|
+
React.createElement(TableData, null),
|
|
3755
|
+
React.createElement(TableData, null))));
|
|
3756
3756
|
return (React.createElement(Fragment, null, rows.map((R, i) => (React.createElement(R, { key: useId(), style: i === 0 ? { borderBottom: `1px solid ${theme.colors.border}` } : {} })))));
|
|
3757
3757
|
};
|
|
3758
3758
|
return (React.createElement(Highlight2, { theme: darkMode ? themes_exports.palenight : themes_exports.vsLight, language: 'json', code: str }, ({ getLineProps, getTokenProps, tokens }) => (React.createElement(Table$1, null,
|
|
@@ -3763,15 +3763,15 @@ const PrettyJsonCode = ({ darkMode, str }) => {
|
|
|
3763
3763
|
return (React.createElement(Fragment, { key: `line-${i}` },
|
|
3764
3764
|
renderEmptyRows(),
|
|
3765
3765
|
React.createElement(TableRow$1, { ...lineProps },
|
|
3766
|
-
React.createElement(TableData
|
|
3766
|
+
React.createElement(TableData, null,
|
|
3767
3767
|
React.createElement(Title$c, null, formattedLine[0].content)),
|
|
3768
|
-
React.createElement(TableData
|
|
3768
|
+
React.createElement(TableData, null))));
|
|
3769
3769
|
}
|
|
3770
3770
|
else if (formattedLine.length === 2) {
|
|
3771
3771
|
return (React.createElement(TableRow$1, { key: `line-${i}`, ...lineProps }, formattedLine.map((token, ii) => {
|
|
3772
3772
|
const { text, components } = getComponentsFromPropertyString(token.content, theme);
|
|
3773
3773
|
const isRowTitle = ii === 0;
|
|
3774
|
-
return (React.createElement(TableData
|
|
3774
|
+
return (React.createElement(TableData, { key: `line-${i}-token-${ii}` },
|
|
3775
3775
|
React.createElement(FlexRow, null,
|
|
3776
3776
|
React.createElement(FlexRow, null, components),
|
|
3777
3777
|
React.createElement(CodeLineToken, { "$noWrap": isRowTitle }, text))));
|
|
@@ -3992,7 +3992,7 @@ const Body = styled.div `
|
|
|
3992
3992
|
gap: 8px;
|
|
3993
3993
|
padding: 6px 18px 12px 18px;
|
|
3994
3994
|
`;
|
|
3995
|
-
const Row
|
|
3995
|
+
const Row = styled.div `
|
|
3996
3996
|
display: flex;
|
|
3997
3997
|
align-items: center;
|
|
3998
3998
|
gap: 12px;
|
|
@@ -4039,7 +4039,7 @@ const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed'
|
|
|
4039
4039
|
: status === StatusType.Warning
|
|
4040
4040
|
? theme.text.warning_secondary
|
|
4041
4041
|
: theme.text.info_secondary;
|
|
4042
|
-
return (React.createElement(Row
|
|
4042
|
+
return (React.createElement(Row, { key: `condition-${idx}` },
|
|
4043
4043
|
React.createElement(Icon, null),
|
|
4044
4044
|
React.createElement(FlexRow, { "$gap": 12, style: { width: '100%', justifyContent: 'space-between' } },
|
|
4045
4045
|
React.createElement(Text, { color: color, size: 12 },
|
|
@@ -4370,11 +4370,11 @@ const DescribeRow = ({ title, subTitle, tooltip, value }) => {
|
|
|
4370
4370
|
React.createElement(ValueWrapper, null, !!value?.status ? (React.createElement(Status, { status: value.status === 'transitioning' ? OtherStatus.Loading : value.status, title: value.text || value.status, withBorder: true, withIcon: true })) : (React.createElement(ValueText, null, value?.text || '-')))));
|
|
4371
4371
|
};
|
|
4372
4372
|
|
|
4373
|
-
const
|
|
4373
|
+
const Tr = styled.tr `
|
|
4374
4374
|
cursor: ${({ $withHover }) => ($withHover ? 'pointer' : 'default')};
|
|
4375
4375
|
opacity: ${({ $faded }) => ($faded ? 0.5 : 1)};
|
|
4376
4376
|
`;
|
|
4377
|
-
const
|
|
4377
|
+
const Td = styled.td `
|
|
4378
4378
|
position: relative;
|
|
4379
4379
|
width: fit-content;
|
|
4380
4380
|
padding: 16px 8px 16px ${({ $isFirst }) => ($isFirst ? '16px' : '8px')};
|
|
@@ -4410,10 +4410,10 @@ const RowBackground = styled.div `
|
|
|
4410
4410
|
? theme.text[$status] + Theme.opacity.hex['010']
|
|
4411
4411
|
: theme.colors.secondary + Theme.opacity.hex['005']};
|
|
4412
4412
|
`;
|
|
4413
|
-
const
|
|
4413
|
+
const TableRow = ({ index, columns, cells, onClick, status, faded }) => {
|
|
4414
4414
|
const { containerRef, containerHeight, containerWidth } = useContainerSize();
|
|
4415
4415
|
const [isHovered, setIsHovered] = useState(false);
|
|
4416
|
-
return (React.createElement(
|
|
4416
|
+
return (React.createElement(Tr
|
|
4417
4417
|
// @ts-ignore
|
|
4418
4418
|
, {
|
|
4419
4419
|
// @ts-ignore
|
|
@@ -4422,7 +4422,7 @@ const Row = ({ index, columns, cells, onClick, status, faded }) => {
|
|
|
4422
4422
|
if (!rowCell)
|
|
4423
4423
|
return null;
|
|
4424
4424
|
const { value, textColor, withTooltip, icon, component: Component } = rowCell;
|
|
4425
|
-
return (React.createElement(
|
|
4425
|
+
return (React.createElement(Td, { key: useId(), "$isFirst": i === 0 },
|
|
4426
4426
|
!!icon ? (React.createElement(IconWrapped, { icon: icon })) : !!Component ? (React.createElement(Component, null)) : (React.createElement(Tooltip, { text: withTooltip && !!value ? String(value) : '' },
|
|
4427
4427
|
React.createElement(RowText, { "$color": textColor }, !isEmpty(value) ? value : '-'))),
|
|
4428
4428
|
i === 0 && React.createElement(RowBackground, { "$height": containerHeight, "$width": containerWidth, "$top": containerHeight * index, "$hovered": isHovered, "$status": status })));
|
|
@@ -4468,7 +4468,7 @@ const Title$9 = styled(Text) `
|
|
|
4468
4468
|
text-wrap: nowrap;
|
|
4469
4469
|
`;
|
|
4470
4470
|
const TableBody = styled.tbody ``;
|
|
4471
|
-
const InteractiveTable = ({ columns, rows
|
|
4471
|
+
const InteractiveTable = ({ columns, rows }) => {
|
|
4472
4472
|
const [sortDirection, setSortDirection] = useState(SortDirection.Ascending);
|
|
4473
4473
|
const [sortBy, setSortBy] = useState('name');
|
|
4474
4474
|
const onSort = useCallback((key) => {
|
|
@@ -4480,7 +4480,7 @@ const InteractiveTable = ({ columns, rows, onRowClick }) => {
|
|
|
4480
4480
|
setSortDirection(SortDirection.Ascending);
|
|
4481
4481
|
}
|
|
4482
4482
|
}, [sortBy]);
|
|
4483
|
-
const
|
|
4483
|
+
const sortedRows = useMemo(() => {
|
|
4484
4484
|
const getCellValue = (row, key) => {
|
|
4485
4485
|
return row.cells.find(({ columnKey }) => columnKey === key)?.value ?? null;
|
|
4486
4486
|
};
|
|
@@ -4494,22 +4494,22 @@ const InteractiveTable = ({ columns, rows, onRowClick }) => {
|
|
|
4494
4494
|
// Fallback (handles null, undefined, mixed types)
|
|
4495
4495
|
return String(a).localeCompare(String(b));
|
|
4496
4496
|
};
|
|
4497
|
-
return
|
|
4497
|
+
return (sortBy
|
|
4498
4498
|
? [...rows].sort((a, b) => {
|
|
4499
4499
|
const valueA = getCellValue(a, sortBy);
|
|
4500
4500
|
const valueB = getCellValue(b, sortBy);
|
|
4501
4501
|
const direction = sortDirection === SortDirection.Ascending ? 1 : -1;
|
|
4502
4502
|
return direction * compareValues(valueA, valueB);
|
|
4503
4503
|
})
|
|
4504
|
-
: rows;
|
|
4505
|
-
}, [rows, sortBy, sortDirection]);
|
|
4504
|
+
: rows).map(({ status, faded, cells, onClick }, i) => React.createElement(TableRow, { key: `row-${i}`, index: i, columns: columns, cells: cells, onClick: onClick, status: status, faded: faded }));
|
|
4505
|
+
}, [columns, rows, sortBy, sortDirection]);
|
|
4506
4506
|
return (React.createElement(Container$k, null,
|
|
4507
4507
|
React.createElement(Table, null,
|
|
4508
4508
|
React.createElement(TableHead, null,
|
|
4509
4509
|
React.createElement("tr", null, columns.map(({ key, title, sortable }) => (React.createElement(TableTitle, { key: `column-${key}` }, sortable ? (React.createElement(SortClickable, { onClick: () => onSort(key) },
|
|
4510
4510
|
React.createElement(SortArrowsIcon, null),
|
|
4511
4511
|
React.createElement(Title$9, null, title))) : (React.createElement(Title$9, null, title))))))),
|
|
4512
|
-
React.createElement(TableBody, null,
|
|
4512
|
+
React.createElement(TableBody, null, sortedRows))));
|
|
4513
4513
|
};
|
|
4514
4514
|
|
|
4515
4515
|
var DataCardFieldTypes;
|