|
12 | 12 | [value]="data" |
13 | 13 | [columns]="store.columns()" |
14 | 14 | data-testid="relationship-field-table" |
15 | | - styleClass="dotTable p-datatable-relationship" |
16 | | - [paginator]="data.length > pagination.rowsPerPage" |
| 15 | + class="dot-relationship-field-table" |
| 16 | + [paginator]="false" |
17 | 17 | [first]="pagination.offset" |
18 | 18 | [rows]="pagination.rowsPerPage" |
19 | 19 | [scrollable]="true" |
20 | 20 | [reorderableColumns]="false" |
21 | 21 | (onRowReorder)="onRowReorder($event)"> |
22 | | - <ng-template pTemplate="header" styleClass="relative" let-columns> |
| 22 | + <ng-template pTemplate="header" let-columns> |
23 | 23 | <p-menu #menu [model]="$menuItems()" [popup]="true" appendTo="body" /> |
24 | 24 |
|
25 | | - <tr class="relationship-field__table_header"> |
26 | | - <!-- Drag handle column - fixed width --> |
27 | | - <th scope="col" class="drag-handle-column"></th> |
| 25 | + <tr class="font-bold bg-[var(--gray-100)]"> |
| 26 | + <th scope="col" class="w-12 min-w-12"></th> |
28 | 27 |
|
29 | 28 | @for (column of columns; track $index) { |
30 | 29 | @switch (column.type) { |
31 | 30 | @case ('title') { |
32 | | - <th scope="col" [class.title-column]="!isEmpty"> |
| 31 | + <th scope="col" [class.w-48]="!isEmpty" [class.min-w-48]="!isEmpty"> |
33 | 32 | {{ 'dot.file.relationship.field.table.title' | dm }} |
34 | 33 | </th> |
35 | 34 | } |
36 | 35 | @case ('language') { |
37 | | - <th scope="col" [class.dynamic-column]="!isEmpty"> |
| 36 | + <th scope="col" [class.min-w-32]="!isEmpty"> |
38 | 37 | {{ 'dot.file.relationship.field.table.language' | dm }} |
39 | 38 | </th> |
40 | 39 | } |
41 | 40 | @case ('status') { |
42 | | - <th scope="col" [class.dynamic-column]="!isEmpty"> |
| 41 | + <th scope="col" [class.min-w-32]="!isEmpty"> |
43 | 42 | {{ 'dot.file.relationship.field.table.status' | dm }} |
44 | 43 | </th> |
45 | 44 | } |
46 | 45 | @case ('image') { |
47 | | - <th scope="col" [class.image-column]="!isEmpty"> |
48 | | - <p class="truncate-text capitalize">{{ column.header }}</p> |
| 46 | + <th scope="col" [class.w-24]="!isEmpty" [class.min-w-24]="!isEmpty"> |
| 47 | + <p class="truncate capitalize">{{ column.header }}</p> |
49 | 48 | </th> |
50 | 49 | } |
51 | 50 | @default { |
52 | | - <th scope="col" [class.dynamic-column]="!isEmpty"> |
| 51 | + <th scope="col" [class.min-w-32]="!isEmpty"> |
53 | 52 | <span class="capitalize">{{ column.header }}</span> |
54 | 53 | </th> |
55 | 54 | } |
56 | 55 | } |
57 | 56 | } |
58 | 57 |
|
59 | | - <!-- Add button column - fixed width --> |
60 | | - <th |
61 | | - scope="col" |
62 | | - class="actions-column" |
63 | | - alignFrozen="right" |
64 | | - pFrozenColumn |
65 | | - [frozen]="true"> |
| 58 | + <th scope="col" class="w-16 min-w-16" alignFrozen="right" pFrozenColumn [frozen]="true"> |
66 | 59 | <p-button |
67 | 60 | (onClick)="menu.toggle($event)" |
68 | 61 | size="small" |
|
76 | 69 | <ng-template pTemplate="emptymessage"> |
77 | 70 | <tr> |
78 | 71 | <td [colSpan]="$totalColumns()"> |
79 | | - <div class="flex p-2 gap-2 justify-center"> |
| 72 | + <div class="flex p-2 gap-2 justify-center items-center"> |
80 | 73 | <i class="pi pi-folder-open"></i> |
81 | | - <p class="text-surface-500 dark:text-surface-300"> |
| 74 | + <p class="text-[var(--gray-600)]"> |
82 | 75 | {{ 'dot.file.relationship.field.empty.message' | dm }} |
83 | 76 | </p> |
84 | 77 | </div> |
|
91 | 84 | [pReorderableRow]="index" |
92 | 85 | [class.opacity-50]="isDisabled" |
93 | 86 | [class.cursor-not-allowed]="isDisabled"> |
94 | | - <!-- Drag handle column - fixed width --> |
95 | | - |
96 | | - <td class="drag-handle-column"> |
| 87 | + <td class="w-12 min-w-12"> |
97 | 88 | @if (!isDisabled) { |
98 | | - <span class="pi pi-bars text-gray-500" pReorderableRowHandle></span> |
| 89 | + <span class="pi pi-bars text-[var(--gray-600)]" pReorderableRowHandle></span> |
99 | 90 | } @else { |
100 | | - <span class="pi pi-bars text-gray-500 cursor-not-allowed"></span> |
| 91 | + <span class="pi pi-bars text-[var(--gray-600)] cursor-not-allowed"></span> |
101 | 92 | } |
102 | 93 | </td> |
103 | 94 |
|
104 | 95 | @for (column of columns; track $index) { |
105 | 96 | @switch (column.type) { |
106 | 97 | @case ('title') { |
107 | | - <td class="title-column" [class.cursor-not-allowed]="isDisabled"> |
108 | | - <p class="truncate-text">{{ item.title }}</p> |
| 98 | + <td class="w-48 min-w-48" [class.cursor-not-allowed]="isDisabled"> |
| 99 | + <p class="truncate">{{ item.title }}</p> |
109 | 100 | </td> |
110 | 101 | } |
111 | 102 | @case ('language') { |
112 | | - <td class="dynamic-column" [class.cursor-not-allowed]="isDisabled"> |
| 103 | + <td class="min-w-32" [class.cursor-not-allowed]="isDisabled"> |
113 | 104 | {{ item.language | language }} |
114 | 105 | </td> |
115 | 106 | } |
116 | 107 | @case ('status') { |
117 | | - <td class="dynamic-column" [class.cursor-not-allowed]="isDisabled"> |
| 108 | + <td class="min-w-32" [class.cursor-not-allowed]="isDisabled"> |
118 | 109 | @let status = item | contentletStatus; |
119 | 110 | <p-chip |
120 | | - [styleClass]="'p-chip-sm ' + status.classes" |
| 111 | + [class]="'p-chip-sm ' + status.classes" |
121 | 112 | [label]="status.label" /> |
122 | 113 | </td> |
123 | 114 | } |
124 | 115 | @case ('image') { |
125 | | - <td class="image-column" [class.cursor-not-allowed]="isDisabled"> |
126 | | - <div class="container-thumbnail"> |
| 116 | + <td class="w-24 min-w-24" [class.cursor-not-allowed]="isDisabled"> |
| 117 | + <div class="flex items-center justify-center"> |
127 | 118 | <dot-contentlet-thumbnail |
128 | 119 | [iconSize]="'30px'" |
129 | 120 | [contentlet]="item" |
|
133 | 124 | </td> |
134 | 125 | } |
135 | 126 | @default { |
136 | | - <td class="dynamic-column"> |
137 | | - <p class="truncate-text">{{ item[column.nameField] }}</p> |
| 127 | + <td class="min-w-32"> |
| 128 | + <p class="truncate">{{ item[column.nameField] }}</p> |
138 | 129 | </td> |
139 | 130 | } |
140 | 131 | } |
141 | 132 | } |
142 | 133 |
|
143 | | - <!-- Delete button column - fixed width --> |
144 | 134 | <td |
145 | | - class="actions-column" |
| 135 | + class="w-16 min-w-16" |
146 | 136 | pFrozenColumn |
147 | 137 | alignFrozen="right" |
148 | 138 | [frozen]="true" |
|
161 | 151 | <ng-template pTemplate="summary"> |
162 | 152 | @if (hintText || showPagination || hasError) { |
163 | 153 | <div |
164 | | - class="flex items-center" |
165 | | - [class.justify-content-between]="hintText || hasError" |
166 | | - [class.justify-content-center]="!hintText && !hasError"> |
| 154 | + class="flex items-center pt-2" |
| 155 | + [class.justify-between]="hintText || hasError" |
| 156 | + [class.justify-center]="!hintText && !hasError"> |
167 | 157 | @if (hasError) { |
168 | | - <div class="error-message"> |
| 158 | + <div class="text-[var(--color-palette-red)]"> |
169 | 159 | @if (isRequired) { |
170 | 160 | <small>{{ 'dot.edit.content.form.field.required' | dm }}</small> |
171 | 161 | } |
172 | 162 | </div> |
173 | 163 | } |
174 | 164 | @if (!hasError && hintText) { |
175 | | - <div class="hint-message"> |
| 165 | + <div class="text-[var(--gray-600)]"> |
176 | 166 | <small [attr.data-testId]="'hint-' + field.variable"> |
177 | 167 | {{ hintText }} |
178 | 168 | </small> |
|
0 commit comments