@vtex/faststore-plugin-buyer-portal 1.1.95 → 1.1.97
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/package.json +1 -1
- package/src/features/addresses/components/AddressLocationsList/AddressLocationsList.tsx +28 -39
- package/src/features/addresses/components/AddressRecipientsList/AddressRecipientsList.tsx +42 -42
- package/src/features/addresses/layouts/AddressDetailsLayout/address-details-layout.scss +285 -286
- package/src/features/addresses/layouts/AddressesLayout/AddressesLayout.tsx +26 -29
- package/src/features/addresses/layouts/AddressesLayout/addresses-layout.scss +144 -151
- package/src/features/budgets/components/BudgetAllocationsSelection/BudgetAllocationsSelection.tsx +61 -57
- package/src/features/budgets/components/BudgetAllocationsSelection/budget-allocations-selection.scss +131 -232
- package/src/features/budgets/components/BudgetAllocationsTable/BudgetAllocationsTable.tsx +104 -91
- package/src/features/budgets/components/BudgetAllocationsTable/budget-allocations-table.scss +80 -182
- package/src/features/budgets/components/BudgetsTable/BudgetsTable.tsx +90 -107
- package/src/features/budgets/components/BudgetsTable/budgets-table.scss +128 -126
- package/src/features/budgets/layouts/BudgetsLayout/BudgetsLayout.tsx +0 -15
- package/src/features/buying-policies/components/AddBuyingPolicyDrawer/AddBuyingPolicyDrawer.tsx +4 -0
- package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/BasicBuyingPolicyDrawer.tsx +35 -4
- package/src/features/buying-policies/components/BasicBuyingPolicyDrawer/basic-buying-policy-drawer.scss +2 -1
- package/src/features/buying-policies/components/BudgetCriteriaSelector/BudgetCriteriaSelector.tsx +113 -0
- package/src/features/buying-policies/components/BudgetCriteriaSelector/budget-criteria-selector.scss +139 -0
- package/src/features/buying-policies/components/BudgetCriteriaSelector/index.ts +4 -0
- package/src/features/buying-policies/components/BuyingPolicyDropdownMenu/BuyingPolicyDropdownMenu.tsx +5 -0
- package/src/features/buying-policies/components/UpdateBuyingPolicyDrawer/UpdateBuyingPolicyDrawer.tsx +5 -0
- package/src/features/buying-policies/layouts/BuyingPoliciesLayout/BuyingPoliciesLayout.tsx +66 -46
- package/src/features/buying-policies/layouts/BuyingPoliciesLayout/buying-policies-layout.scss +64 -70
- package/src/features/buying-policies/utils/index.ts +4 -1
- package/src/features/buying-policies/utils/orderFieldsCriteriaOptions.ts +12 -9
- package/src/features/collections/components/CollectionsTable/CollectionsTable.tsx +12 -18
- package/src/features/collections/components/CollectionsTable/collections-table.scss +138 -118
- package/src/features/collections/components/table/AddCollectionsDrawerTable.tsx +48 -54
- package/src/features/collections/components/table/add-collections-drawer-table.scss +57 -56
- package/src/features/credit-cards/layouts/CreditCardsLayout/CreditCardLayout.tsx +55 -61
- package/src/features/credit-cards/layouts/CreditCardsLayout/credit-card-layout.scss +63 -153
- package/src/features/payment-methods/components/AddPaymentMethodsDrawer/AddPaymentMethodsDrawer.tsx +58 -49
- package/src/features/payment-methods/components/AddPaymentMethodsDrawer/add-payment-methods-drawer.scss +58 -63
- package/src/features/payment-methods/layouts/PaymentMethodsLayout/PaymentMethodsLayout.tsx +15 -12
- package/src/features/roles/layout/RoleDetailsLayout/RoleDetailsLayout.tsx +57 -26
- package/src/features/roles/layout/RoleDetailsLayout/role-details-layout.scss +77 -0
- package/src/features/roles/layout/RolesLayout/RolesLayout.tsx +4 -12
- package/src/features/roles/layout/RolesLayout/roles-layout.scss +8 -22
- package/src/features/shared/components/CustomField/table/CustomFieldTable.tsx +67 -110
- package/src/features/shared/components/CustomField/table/custom-field-table.scss +39 -144
- package/src/features/shared/components/IconBookmarked/IconBookmarked.tsx +9 -0
- package/src/features/shared/components/IconBookmarked/icon-bookmarked.scss +9 -0
- package/src/features/shared/components/Table/Table.tsx +7 -2
- package/src/features/shared/components/Table/TableCell/TableCell.tsx +15 -3
- package/src/features/shared/components/Table/TableCell/table-cell.scss +34 -0
- package/src/features/shared/components/Table/TableHead/TableHead.tsx +34 -6
- package/src/features/shared/components/Table/TableHead/table-head.scss +53 -49
- package/src/features/shared/components/Table/TableLoading/TableLoading.tsx +16 -6
- package/src/features/shared/components/Table/TableLoading/table-loading.scss +13 -8
- package/src/features/shared/components/Table/TableRow/TableRow.tsx +65 -42
- package/src/features/shared/components/Table/TableRow/table-row.scss +104 -68
- package/src/features/shared/components/Table/table.scss +11 -6
- package/src/features/shared/components/Table/utils/tableColumns.ts +30 -33
- package/src/features/shared/components/index.ts +1 -0
- package/src/features/users/layouts/UsersLayout/UsersLayout.tsx +20 -27
- package/src/pages/budgets.tsx +1 -1
- package/src/pages/buying-policies.tsx +14 -1
- package/src/themes/layouts.scss +1 -0
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
2
|
|
|
3
|
+
export type TableColumnSize =
|
|
4
|
+
| "small"
|
|
5
|
+
| "medium"
|
|
6
|
+
| "large"
|
|
7
|
+
| `${number}px`
|
|
8
|
+
| `${number}rem`
|
|
9
|
+
| `${number}%`;
|
|
10
|
+
|
|
3
11
|
export type TableColumn<T extends string = string> = {
|
|
4
12
|
key: T;
|
|
5
13
|
label: React.ReactNode;
|
|
6
14
|
align?: "left" | "center" | "right";
|
|
7
|
-
size?:
|
|
15
|
+
size?: TableColumnSize;
|
|
8
16
|
colspan?: number;
|
|
17
|
+
hideOnScreenSize?: "phonemid" | "tablet";
|
|
18
|
+
fullWidthOnScreenSize?: "phonemid" | "tablet";
|
|
9
19
|
};
|
|
10
20
|
|
|
11
21
|
export interface TableHeadProps {
|
|
@@ -14,6 +24,22 @@ export interface TableHeadProps {
|
|
|
14
24
|
}
|
|
15
25
|
|
|
16
26
|
export const TableHead = ({ columns, rowProps }: TableHeadProps) => {
|
|
27
|
+
const thSize = (size?: TableColumnSize): React.CSSProperties => {
|
|
28
|
+
if (!size) {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const sizes: { [key in TableColumnSize]: string } = {
|
|
33
|
+
small: "15%",
|
|
34
|
+
medium: "25%",
|
|
35
|
+
large: "40%",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
width: sizes[size] ?? size,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
17
43
|
return (
|
|
18
44
|
<thead data-fs-bp-table-head>
|
|
19
45
|
<tr {...rowProps} data-fs-bp-table-head-row>
|
|
@@ -21,17 +47,19 @@ export const TableHead = ({ columns, rowProps }: TableHeadProps) => {
|
|
|
21
47
|
<th
|
|
22
48
|
key={col.key}
|
|
23
49
|
data-fs-bp-table-head-column
|
|
24
|
-
data-fs-bp-table-head-column-size={col.size}
|
|
25
50
|
data-fs-bp-table-head-align={col.align || undefined}
|
|
51
|
+
data-fs-bp-table-head-hide-on-screen-size={
|
|
52
|
+
col.hideOnScreenSize || undefined
|
|
53
|
+
}
|
|
54
|
+
data-fs-bp-table-head-full-width-on-screen-size={
|
|
55
|
+
col.fullWidthOnScreenSize || undefined
|
|
56
|
+
}
|
|
26
57
|
colSpan={col.colspan}
|
|
58
|
+
style={thSize(col.size)}
|
|
27
59
|
>
|
|
28
60
|
{col.label}
|
|
29
61
|
</th>
|
|
30
62
|
))}
|
|
31
|
-
<th
|
|
32
|
-
data-fs-bp-table-head-column
|
|
33
|
-
data-fs-bp-table-head-column-action
|
|
34
|
-
></th>
|
|
35
63
|
</tr>
|
|
36
64
|
</thead>
|
|
37
65
|
);
|
|
@@ -1,51 +1,55 @@
|
|
|
1
1
|
[data-fs-bp-table-head] {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
border-bottom: var(--fs-border-width) solid #e0e0e0;
|
|
3
|
+
|
|
4
|
+
&[data-fs-bp-table-cell-align="left"] {
|
|
5
|
+
justify-content: flex-start;
|
|
6
|
+
}
|
|
7
|
+
&[data-fs-bp-table-cell-align="right"] {
|
|
8
|
+
justify-content: flex-end;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
[data-fs-bp-table-head-hide-on-screen-size="phonemid"] {
|
|
12
|
+
@include media("<=phonemid") {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
[data-fs-bp-table-head-hide-on-screen-size="tablet"] {
|
|
18
|
+
@include media("<=tablet") {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
[data-fs-bp-table-head-full-width-on-screen-size="phonemid"] {
|
|
24
|
+
@include media("<=phonemid") {
|
|
25
|
+
width: 100% !important; // important to override inline CSS
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-fs-bp-table-head-full-width-on-screen-size="tablet"] {
|
|
30
|
+
@include media("<=tablet") {
|
|
31
|
+
width: 100% !important; // important to override inline CSS
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[data-fs-bp-table-head-column] {
|
|
36
|
+
color: #5c5c5c;
|
|
37
|
+
font-size: var(--fs-text-size-1);
|
|
38
|
+
font-weight: var(--fs-text-weight-regular);
|
|
39
|
+
padding-top: var(--fs-spacing-2);
|
|
40
|
+
padding-bottom: var(--fs-spacing-2);
|
|
41
|
+
padding-left: 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-fs-bp-table-head-align="left"] {
|
|
45
|
+
text-align: left;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
[data-fs-bp-table-head-align="right"] {
|
|
49
|
+
text-align: right;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[data-fs-bp-table-head-align="center"] {
|
|
53
|
+
text-align: center;
|
|
54
|
+
}
|
|
51
55
|
}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { Skeleton } from "@faststore/ui";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type TableLoadingProps = {
|
|
4
|
+
columns?: number;
|
|
5
|
+
rows?: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const TableLoading = ({ columns = 1, rows = 5 }: TableLoadingProps) => {
|
|
4
9
|
return (
|
|
5
10
|
<>
|
|
6
|
-
{Array.from({ length:
|
|
7
|
-
<tr data-fs-bp-table-row-loading
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
+
{Array.from({ length: rows }).map((_, rowIndex) => (
|
|
12
|
+
<tr key={`row_${rowIndex}`} data-fs-bp-table-row-loading>
|
|
13
|
+
{Array.from({ length: columns }).map((_, colIndex) => (
|
|
14
|
+
<td>
|
|
15
|
+
<Skeleton
|
|
16
|
+
key={`cell_${rowIndex}_${colIndex}`}
|
|
17
|
+
size={{ height: "2.5rem", width: "100%" }}
|
|
18
|
+
/>
|
|
19
|
+
</td>
|
|
20
|
+
))}
|
|
11
21
|
</tr>
|
|
12
22
|
))}
|
|
13
23
|
</>
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
[data-fs-bp-table-row-loading] {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
padding: var(--fs-spacing-2) 0;
|
|
2
|
+
@import "@faststore/ui/src/components/atoms/Skeleton/styles.scss";
|
|
3
|
+
border-bottom: var(--fs-border-width) solid #e0e0e0;
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
td {
|
|
6
|
+
padding: var(--fs-spacing-1) var(--fs-spacing-0);
|
|
7
|
+
|
|
8
|
+
&:first-child {
|
|
9
|
+
padding-left: 0;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:last-child {
|
|
13
|
+
padding-right: 0;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
11
16
|
}
|
|
@@ -5,19 +5,21 @@ import { Dropdown } from "@faststore/components";
|
|
|
5
5
|
import { BasicDropdownMenu } from "../../BasicDropdownMenu/BasicDropdownMenu";
|
|
6
6
|
import { Icon } from "../../Icon";
|
|
7
7
|
import { SearchHighlight } from "../../SearchHighlight/SearchHighlight";
|
|
8
|
+
import { Table } from "../Table";
|
|
8
9
|
|
|
9
10
|
export type TableRowProps = {
|
|
10
11
|
children?: ReactNode;
|
|
11
|
-
title: string;
|
|
12
|
+
title: string | ReactNode;
|
|
12
13
|
iconName?: string;
|
|
13
14
|
iconSize?: number;
|
|
14
15
|
dropdownMenu?: ReactNode;
|
|
15
16
|
href?: string;
|
|
16
17
|
searchTerm?: string;
|
|
17
|
-
actionIcons?: ReactNode;
|
|
18
|
-
defaultItemIcon?: ReactNode;
|
|
18
|
+
actionIcons?: ReactNode | ReactNode[];
|
|
19
19
|
onClick?: () => void;
|
|
20
20
|
enabled?: boolean;
|
|
21
|
+
prependColumns?: ReactNode;
|
|
22
|
+
selected?: boolean;
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export const TableRow = ({
|
|
@@ -29,57 +31,78 @@ export const TableRow = ({
|
|
|
29
31
|
href,
|
|
30
32
|
searchTerm = "",
|
|
31
33
|
actionIcons,
|
|
32
|
-
defaultItemIcon,
|
|
33
34
|
onClick,
|
|
34
35
|
enabled = true,
|
|
36
|
+
selected = false,
|
|
37
|
+
prependColumns,
|
|
35
38
|
...otherProps
|
|
36
39
|
}: TableRowProps) => {
|
|
37
|
-
const
|
|
40
|
+
const classNames = () => {
|
|
41
|
+
const classes: string[] = [];
|
|
42
|
+
|
|
43
|
+
if (href) {
|
|
44
|
+
classes.push("is-link");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (selected) {
|
|
48
|
+
classes.push("selected");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (!enabled) {
|
|
52
|
+
classes.push("disabled");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return classes.join(" ");
|
|
56
|
+
};
|
|
38
57
|
|
|
39
58
|
return (
|
|
40
59
|
<tr
|
|
41
60
|
data-fs-bp-table-row
|
|
61
|
+
data-fs-bp-table-is-link={!!href}
|
|
62
|
+
data-fs-bp-table-row-selected={selected}
|
|
63
|
+
className={classNames()}
|
|
42
64
|
{...otherProps}
|
|
43
|
-
className={!enabled ? "disabled" : ""}
|
|
44
65
|
>
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
{prependColumns}
|
|
67
|
+
<Table.Cell data-fs-bp-table-row-title-cell>
|
|
68
|
+
<div data-fs-bp-table-row-title-content>
|
|
69
|
+
{iconName && (
|
|
70
|
+
<span data-fs-bp-table-row-icon-cell>
|
|
71
|
+
<Icon
|
|
72
|
+
data-fs-bp-table-row-icon
|
|
73
|
+
name={iconName}
|
|
74
|
+
width={iconSize}
|
|
75
|
+
height={iconSize}
|
|
76
|
+
/>
|
|
77
|
+
</span>
|
|
78
|
+
)}
|
|
79
|
+
{typeof title === "string" ? (
|
|
80
|
+
<p data-fs-bp-table-row-title-text>
|
|
81
|
+
<SearchHighlight text={title} highlight={searchTerm} />
|
|
82
|
+
</p>
|
|
83
|
+
) : (
|
|
84
|
+
title
|
|
85
|
+
)}
|
|
86
|
+
</div>
|
|
87
|
+
</Table.Cell>
|
|
61
88
|
{children}
|
|
62
89
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
/>
|
|
80
|
-
)}
|
|
81
|
-
{actionIcons ? actionIcons : null}
|
|
82
|
-
</td>
|
|
90
|
+
<Table.Cell data-fs-bp-table-row-actions>
|
|
91
|
+
<div data-fs-bp-table-row-actions-content>
|
|
92
|
+
{actionIcons ? actionIcons : null}
|
|
93
|
+
{dropdownMenu && (
|
|
94
|
+
<Dropdown>
|
|
95
|
+
<BasicDropdownMenu.Trigger />
|
|
96
|
+
{dropdownMenu}
|
|
97
|
+
</Dropdown>
|
|
98
|
+
)}
|
|
99
|
+
</div>
|
|
100
|
+
</Table.Cell>
|
|
101
|
+
{href && (
|
|
102
|
+
<Table.Cell data-fs-bp-table-row-link>
|
|
103
|
+
<a href={href} onClick={onClick} />
|
|
104
|
+
</Table.Cell>
|
|
105
|
+
)}
|
|
83
106
|
</tr>
|
|
84
107
|
);
|
|
85
108
|
};
|
|
@@ -1,72 +1,108 @@
|
|
|
1
1
|
@import "../../BasicDropdownMenu/basic-dropdown-menu.scss";
|
|
2
|
+
@import "@faststore/ui/src/components/atoms/Checkbox/styles.scss";
|
|
2
3
|
|
|
3
4
|
[data-fs-bp-table-row] {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
5
|
+
&.is-link {
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
|
|
8
|
+
&:hover {
|
|
9
|
+
background-color: #f5f5f5;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:has([data-fs-bp-table-row-actions]:hover) {
|
|
13
|
+
cursor: default;
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&.selected {
|
|
19
|
+
background-color: #f1f8fd;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.disabled {
|
|
23
|
+
cursor: not-allowed;
|
|
24
|
+
background-color: #f5f5f5;
|
|
25
|
+
border-bottom: var(--fs-border-width) solid #e0e0e0;
|
|
26
|
+
|
|
27
|
+
&:hover,
|
|
28
|
+
&:has([data-fs-bp-table-row-actions]:hover) {
|
|
29
|
+
background-color: #f5f5f5;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
& > td {
|
|
33
|
+
color: #858585;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&:not(.disabled) {
|
|
38
|
+
[data-fs-bp-table-row-title-text] {
|
|
39
|
+
color: #1f1f1f;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@import "../../SearchHighlight/search-highlight.scss";
|
|
44
|
+
border-bottom: var(--fs-border-width) solid #e0e0e0;
|
|
45
|
+
position: relative;
|
|
46
|
+
|
|
47
|
+
[data-fs-bp-table-row-link] {
|
|
48
|
+
position: absolute;
|
|
49
|
+
left: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
top: 0;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
padding: 0;
|
|
54
|
+
z-index: 0;
|
|
55
|
+
|
|
56
|
+
a {
|
|
57
|
+
display: block;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[data-fs-bp-table-row-title-cell] {
|
|
64
|
+
[data-fs-bp-table-row-title-content] {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
width: 100%;
|
|
68
|
+
gap: var(--fs-spacing-0);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[data-fs-bp-table-row-title-text] {
|
|
72
|
+
font-size: var(--fs-text-size-1);
|
|
73
|
+
font-weight: var(--fs-text-weight-medium);
|
|
74
|
+
line-height: var(--fs-text-size-3);
|
|
75
|
+
flex: 1;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
text-overflow: ellipsis;
|
|
79
|
+
padding-right: var(--fs-spacing-1);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
[data-fs-bp-table-row-icon-cell] {
|
|
83
|
+
flex: none;
|
|
84
|
+
display: inline-flex;
|
|
85
|
+
width: var(--fs-spacing-6);
|
|
86
|
+
height: var(--fs-spacing-6);
|
|
87
|
+
align-items: center;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
color: #0366dd;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
[data-fs-bp-table-row-actions] {
|
|
94
|
+
z-index: 1;
|
|
95
|
+
|
|
96
|
+
[data-fs-bp-table-row-actions-content] {
|
|
97
|
+
display: flex;
|
|
98
|
+
align-items: center;
|
|
99
|
+
gap: var(--fs-spacing-1);
|
|
100
|
+
justify-content: flex-end;
|
|
101
|
+
|
|
102
|
+
&:empty {
|
|
103
|
+
padding: 0;
|
|
104
|
+
display: none;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
72
108
|
}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
@import "./TableCell/table-cell.scss";
|
|
1
2
|
@import "./TableRow/table-row.scss";
|
|
2
3
|
@import "./TableHead/table-head.scss";
|
|
3
4
|
@import "./TableLoading/table-loading.scss";
|
|
4
5
|
|
|
5
6
|
[data-fs-bp-table] {
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
width: 100%;
|
|
8
|
+
border-collapse: collapse;
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
[data-fs-bp-icon] {
|
|
11
|
+
width: auto;
|
|
12
|
+
height: auto;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&[data-fs-bp-table-layout-fixed="true"] {
|
|
16
|
+
table-layout: fixed;
|
|
17
|
+
}
|
|
13
18
|
}
|
|
@@ -1,43 +1,40 @@
|
|
|
1
|
-
import { TableColumn } from "../TableHead/TableHead";
|
|
1
|
+
import type { TableColumn, TableColumnSize } from "../TableHead/TableHead";
|
|
2
2
|
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
type GetTableColumns = {
|
|
4
|
+
nameColumnLabel?: string;
|
|
5
|
+
nameColumnKey?: string;
|
|
6
|
+
nameColumnSize?: TableColumnSize;
|
|
7
|
+
nameFullWidthOnMobile?: boolean;
|
|
8
|
+
actionsLength?: number;
|
|
9
|
+
extraColumns?: TableColumn[];
|
|
6
10
|
};
|
|
7
11
|
|
|
8
|
-
export const getTableColumns =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
export const getTableColumns = ({
|
|
13
|
+
nameColumnLabel = "Name",
|
|
14
|
+
nameColumnSize = "100%",
|
|
15
|
+
nameColumnKey = "name",
|
|
16
|
+
nameFullWidthOnMobile = true,
|
|
17
|
+
actionsLength = 0,
|
|
18
|
+
extraColumns = [],
|
|
19
|
+
}: GetTableColumns): TableColumn[] => {
|
|
20
|
+
const columns: TableColumn[] = [
|
|
12
21
|
{
|
|
13
|
-
key:
|
|
14
|
-
|
|
22
|
+
key: nameColumnKey,
|
|
23
|
+
size: nameColumnSize,
|
|
24
|
+
label: nameColumnLabel,
|
|
25
|
+
fullWidthOnScreenSize: nameFullWidthOnMobile ? "phonemid" : undefined,
|
|
15
26
|
align: "left",
|
|
16
|
-
colspan: 2,
|
|
17
27
|
},
|
|
28
|
+
...extraColumns,
|
|
18
29
|
];
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
]
|
|
29
|
-
: [];
|
|
31
|
+
if (actionsLength > 0) {
|
|
32
|
+
columns.push({
|
|
33
|
+
key: "actions",
|
|
34
|
+
label: "",
|
|
35
|
+
size: `${actionsLength * 3}rem`,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
30
38
|
|
|
31
|
-
|
|
32
|
-
? [
|
|
33
|
-
{
|
|
34
|
-
key: "actions" as T,
|
|
35
|
-
label: "",
|
|
36
|
-
align: "right",
|
|
37
|
-
size: "medium",
|
|
38
|
-
},
|
|
39
|
-
]
|
|
40
|
-
: [];
|
|
41
|
-
|
|
42
|
-
return [...base, ...typeColumn, ...actions];
|
|
39
|
+
return columns;
|
|
43
40
|
};
|
|
@@ -75,3 +75,4 @@ export { EmptyState, type EmptyStateProps } from "./EmptyState/EmptyState";
|
|
|
75
75
|
export { ErrorBoundary } from "./ErrorBoundary/ErrorBoundary";
|
|
76
76
|
export { withErrorBoundary } from "./withErrorBoundary/withErrorBoundary";
|
|
77
77
|
export { default as Error } from "./Error/Error";
|
|
78
|
+
export { IconBookmarked } from "./IconBookmarked/IconBookmarked";
|