@solexllc/usx-react 0.8.0 → 0.9.0
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/README.md +15 -0
- package/dist/index.cjs +3173 -3238
- package/dist/index.js +3174 -3239
- package/package.json +4 -4
- package/src/components/checkbox/Checkbox.tsx +9 -4
- package/src/components/checkbox/checkbox.django.html +2 -2
- package/src/components/checkbox/config.json +9 -0
- package/src/components/data-table/DataTable.tsx +177 -0
- package/src/components/data-table/README.md +42 -0
- package/src/components/data-table/TableBody.tsx +123 -0
- package/src/components/{table → data-table}/TableCell.tsx +6 -3
- package/src/components/data-table/TableContext.tsx +49 -0
- package/src/components/{table → data-table}/TableFoot.tsx +8 -7
- package/src/components/data-table/TableGroup.tsx +62 -0
- package/src/components/data-table/TableHead.tsx +126 -0
- package/src/components/data-table/TableRow.tsx +24 -0
- package/src/components/data-table/cells.ts +49 -0
- package/src/components/data-table/columns.ts +15 -0
- package/src/components/data-table/config.json +375 -0
- package/src/components/data-table/data-table.django-snapshot.html +13560 -0
- package/src/components/data-table/data-table.django.html +13 -0
- package/src/components/data-table/data-table.html +34 -0
- package/src/components/data-table/data-table.react-snapshot.html +12033 -0
- package/src/components/{table → data-table}/table-body.django.html +12 -12
- package/src/components/{table → data-table}/table-foot.django.html +6 -6
- package/src/components/data-table/table-group.django.html +24 -0
- package/src/components/data-table/table-head.django.html +21 -0
- package/src/components/data-table/table-row.django.html +57 -0
- package/src/components/{table → data-table}/types.ts +48 -5
- package/src/components/pagination/Pagination.tsx +7 -1
- package/src/components/pagination/config.json +8 -0
- package/src/components/pagination/navigation/PaginationNavigation.tsx +10 -0
- package/src/components/pagination/step-options/PaginationStepOptions.tsx +3 -0
- package/src/components/radio-buttons/RadioButtons.tsx +37 -27
- package/src/components/radio-buttons/config.json +19 -1
- package/src/components/radio-buttons/radio-buttons.django-snapshot.html +28 -60
- package/src/components/radio-buttons/radio-buttons.django.html +16 -28
- package/src/components/table/Table.tsx +64 -334
- package/src/components/table/config.json +21 -339
- package/src/components/table/table.django-snapshot.html +712 -1482
- package/src/components/table/table.django.html +14 -59
- package/src/components/table/table.html +7 -2364
- package/src/components/table/table.react-snapshot.html +711 -2085
- package/src/index.js +1 -0
- package/src/components/table/TableBody.tsx +0 -256
- package/src/components/table/TableContext.tsx +0 -87
- package/src/components/table/TableGroup.tsx +0 -69
- package/src/components/table/TableHead.tsx +0 -139
- package/src/components/table/TableRow.tsx +0 -56
- package/src/components/table/hooks/useRowDetails.ts +0 -34
- package/src/components/table/hooks/useTableGroups.ts +0 -61
- package/src/components/table/hooks/useTableSelect.ts +0 -82
- package/src/components/table/hooks/useTableSort.ts +0 -60
- package/src/components/table/table-group.django.html +0 -40
- package/src/components/table/table-head.django.html +0 -85
- package/src/components/table/table-row.django.html +0 -98
- package/src/components/table/table_helper.py +0 -298
- /package/src/components/{table → data-table}/table-detail-row.django.html +0 -0
|
@@ -1,60 +1,15 @@
|
|
|
1
|
-
{% load
|
|
2
|
-
{
|
|
3
|
-
{
|
|
4
|
-
{
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
{
|
|
9
|
-
{
|
|
10
|
-
{
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
{# total_cols — output of total_col_count(...) #}
|
|
14
|
-
{# total_depth — len(header_rows) #}
|
|
15
|
-
{# sort — {'key': ..., 'direction': 'asc'|'desc'|None} #}
|
|
16
|
-
{# groups — output of group_data() when groupBy is set #}
|
|
17
|
-
{# footerValues — output of compute_footer() when showFooter is True #}
|
|
18
|
-
{# expandedRows — list of primary-key values with detail open #}
|
|
19
|
-
{# rowDetailTemplate — path to a partial template for detail content #}
|
|
20
|
-
{# rowDetailField — row dict key whose value is used as detail content #}
|
|
21
|
-
{# rowUrlField — row dict key whose value is the navigation URL #}
|
|
22
|
-
{# paginateUrlPrefix — URL prefix for pagination links (default '?page=') #}
|
|
23
|
-
{# pagination — {'current_page', 'total_pages', 'total', 'page_size'} #}
|
|
24
|
-
{# ─────────────────────────────────────────────────────────────────────────── #}
|
|
25
|
-
|
|
26
|
-
{# ── Scrollable wrapper ──────────────────────────────────────────────────── #}
|
|
27
|
-
{% if scrollable|default:False or height %}
|
|
28
|
-
<div class="usa-table-container--scrollable usx-table-container--scrollable"
|
|
29
|
-
tabindex="0"
|
|
30
|
-
{% if height %}style="max-height: {{ height }}; overflow: auto;"{% endif %}>
|
|
31
|
-
{% endif %}
|
|
32
|
-
|
|
33
|
-
<table id="{{ id }}" class="usa-table usx-table{% if striped|default:False %} usa-table--striped{% endif %}{% if borderless|default:False %} usa-table--borderless{% endif %}{% if compact|default:False %} usa-table--compact{% endif %}{% if stickyHeader|default:False %} usa-table--sticky-header{% endif %}{% if responsive == 'stack' %} usa-table--stacked{% endif %}{% if responsive == 'stack-header' %} usa-table--stacked-header{% endif %}{% if stickyFirstColumn|default:False %} usx-table--sticky-first-col{% endif %}{% if className %} {{ className }}{% endif %}"
|
|
34
|
-
>
|
|
35
|
-
{% if caption %}
|
|
36
|
-
<caption class="usx-table__caption">{{ caption }}</caption>
|
|
37
|
-
{% endif %}
|
|
38
|
-
|
|
39
|
-
{% table_head tableId=id header_rows=header_rows total_depth=total_depth sort=sort onSort=onSort selectionMode=selectionMode|default:None selectionPosition=selectionPosition|default:"left" rowDetails=rowDetails stickyFirstColumn=stickyFirstColumn|default:False %}{% endtable_head %}
|
|
40
|
-
|
|
41
|
-
{% table_body tableId=id data=data groups=groups leaf_columns=leaf_columns total_cols=total_cols primaryKey=primaryKey|default:"id" select=select|default:"" disabled=disabled|default:"" selectionMode=selectionMode|default:None selectionPosition=selectionPosition|default:"left" onClickRow=onClickRow rowUrlField=rowUrlField rowDetails=rowDetails rowDetailTemplate=rowDetailTemplate rowDetailField=rowDetailField expandedRows=expandedRows responsive=responsive|default:False placeholder=placeholder loading=loading defaultExpanded=defaultExpanded %}{% endtable_body %}
|
|
42
|
-
|
|
43
|
-
{% if showFooter %}
|
|
44
|
-
{% table_foot tableId=id leaf_columns=leaf_columns footerValues=footerValues selectionMode=selectionMode|default:None rowDetails=rowDetails %}{% endtable_foot %}
|
|
45
|
-
{% endif %}
|
|
46
|
-
|
|
1
|
+
{% load components %}
|
|
2
|
+
{% if scrollable %}<div class="usa-table-container--scrollable" tabindex="0"{% if scrollHeight %} style="height: {{ scrollHeight }}; overflow: auto"{% endif %}>{% endif %}
|
|
3
|
+
<table{% if id %} id="{{ id }}"{% endif %} class="usa-table usx-table{% if striped %} usa-table--striped{% endif %}{% if borderless %} usa-table--borderless{% endif %}{% if compact %} usa-table--compact{% endif %}{% if stickyHeader %} usa-table--sticky-header{% endif %}{% if responsive == 'stack' %} usa-table--stacked{% elif responsive == 'stack-header' %} usa-table--stacked-header{% endif %}{% if className %} {{ className }}{% endif %}">
|
|
4
|
+
<caption class="usx-table__caption">{{ caption|default:'Data table' }}</caption>
|
|
5
|
+
<thead><tr>{% for column in columns %}<th scope="col"{% if column.sortable %} data-sortable{% endif %}>{{ column.header }}</th>{% endfor %}</tr></thead>
|
|
6
|
+
<tbody>
|
|
7
|
+
{% for row in data %}<tr>
|
|
8
|
+
{% for column in columns %}{% with value=row|get_item:column.key %}
|
|
9
|
+
{% if column.primary %}<th scope="row"{% if responsive %} data-label="{{ column.header }}"{% endif %}>{{ value }}</th>{% else %}<td{% if responsive %} data-label="{{ column.header }}"{% endif %}>{{ value }}</td>{% endif %}
|
|
10
|
+
{% endwith %}{% endfor %}
|
|
11
|
+
</tr>{% endfor %}
|
|
12
|
+
</tbody>
|
|
47
13
|
</table>
|
|
48
|
-
|
|
49
|
-
{
|
|
50
|
-
<div class="usa-sr-only usa-table__announcement-region" aria-live="polite"></div>
|
|
51
|
-
|
|
52
|
-
{% if scrollable|default:False or height %}</div>{% endif %}
|
|
53
|
-
|
|
54
|
-
{# ── Pagination ─────────────────────────────────────────────────────────── #}
|
|
55
|
-
{% if paginate and pagination %}
|
|
56
|
-
<div class="usx-table__pagination">
|
|
57
|
-
{% pagination currentPage=pagination.current_page totalPages=pagination.total_pages pages=pagination.pages pageUrlPrefix=paginateUrlPrefix|default:"?page=" %}{% endpagination %}
|
|
58
|
-
</div>
|
|
59
|
-
{% endif %}
|
|
60
|
-
|
|
14
|
+
{% if columns|has_sortable %}<div class="usa-sr-only usa-table__announcement-region" aria-live="polite"></div>{% endif %}
|
|
15
|
+
{% if scrollable %}</div>{% endif %}
|