django-unfold 0.21.0__py3-none-any.whl → 0.22.0__py3-none-any.whl

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.
@@ -36,7 +36,61 @@ from ..widgets import UnfoldBooleanWidget
36
36
 
37
37
  register = Library()
38
38
 
39
- LINK_CLASSES = ["text-gray-700 dark:text-gray-200"]
39
+ LINK_CLASSES = [
40
+ "text-gray-700",
41
+ "truncate",
42
+ "dark:text-gray-200",
43
+ ]
44
+
45
+ ROW_CLASSES = [
46
+ "align-middle",
47
+ "flex",
48
+ "border-t",
49
+ "border-gray-200",
50
+ "font-normal",
51
+ "gap-4",
52
+ "min-w-0",
53
+ "overflow-hidden",
54
+ "px-3",
55
+ "py-2",
56
+ "text-left",
57
+ "text-sm",
58
+ "before:flex",
59
+ "before:capitalize",
60
+ "before:content-[attr(data-label)]",
61
+ "before:items-center",
62
+ "before:mr-auto",
63
+ "before:text-gray-500",
64
+ "first:border-t-0",
65
+ "dark:before:text-gray-400",
66
+ "lg:before:hidden",
67
+ "lg:first:border-t",
68
+ "lg:py-3",
69
+ "lg:table-cell",
70
+ "dark:border-gray-800",
71
+ ]
72
+
73
+ CHECKBOX_CLASSES = [
74
+ "action-checkbox",
75
+ "align-middle",
76
+ "flex",
77
+ "items-center",
78
+ "px-3",
79
+ "py-2",
80
+ "text-left",
81
+ "text-sm",
82
+ "before:block",
83
+ "before:capitalize",
84
+ "before:content-[attr(data-label)]",
85
+ "before:mr-auto",
86
+ "before:text-gray-500",
87
+ "lg:before:hidden",
88
+ "lg:border-t",
89
+ "lg:border-gray-200",
90
+ "lg:table-cell",
91
+ "dark:before:text-gray-400",
92
+ "dark:lg:border-gray-800",
93
+ ]
40
94
 
41
95
 
42
96
  def result_headers(cl):
@@ -158,28 +212,7 @@ def items_for_result(cl: ChangeList, result: HttpRequest, form) -> SafeText:
158
212
  empty_value_display = cl.model_admin.get_empty_value_display()
159
213
  row_classes = [
160
214
  "field-%s" % _coerce_field_name(field_name, field_index),
161
- "align-middle",
162
- "flex",
163
- "border-t",
164
- "border-gray-200",
165
- "font-normal",
166
- "px-3",
167
- "py-2",
168
- "text-left",
169
- "text-sm",
170
- "before:flex",
171
- "before:capitalize",
172
- "before:content-[attr(data-label)]",
173
- "before:items-center",
174
- "before:mr-auto",
175
- "before:text-gray-500",
176
- "first:border-t-0",
177
- "dark:before:text-gray-400",
178
- "lg:before:hidden",
179
- "lg:first:border-t",
180
- "lg:py-3",
181
- "lg:table-cell",
182
- "dark:border-gray-800",
215
+ *ROW_CLASSES,
183
216
  ]
184
217
 
185
218
  try:
@@ -192,27 +225,7 @@ def items_for_result(cl: ChangeList, result: HttpRequest, form) -> SafeText:
192
225
  )
193
226
  if f is None or f.auto_created:
194
227
  if field_name == "action_checkbox":
195
- row_classes = [
196
- "action-checkbox",
197
- "align-middle",
198
- "flex",
199
- "items-center",
200
- "px-3",
201
- "py-2",
202
- "text-left",
203
- "text-sm",
204
- "before:block",
205
- "before:capitalize",
206
- "before:content-[attr(data-label)]",
207
- "before:mr-auto",
208
- "before:text-gray-500",
209
- "lg:before:hidden",
210
- "lg:border-t",
211
- "lg:border-gray-200",
212
- "lg:table-cell",
213
- "dark:before:text-gray-400",
214
- "dark:lg:border-gray-800",
215
- ]
228
+ row_classes = CHECKBOX_CLASSES
216
229
  boolean = getattr(attr, "boolean", False)
217
230
  label = getattr(attr, "label", False)
218
231
  header = getattr(attr, "header", False)