@navette-js/tables 1.0.0-beta.1 → 1.0.0-beta.3
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 +2 -2
- package/lib/index.d.ts +149 -148
- package/lib/index.js +167 -166
- package/lib/query-builder.d.ts +53 -53
- package/lib/query-builder.js +89 -95
- package/package.json +7 -8
- package/views/column-manager.ejs +2 -2
- package/views/index.ejs +14 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@navette-js/tables",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
4
|
-
"description": "Interactive tables for Navette
|
|
3
|
+
"version": "1.0.0-beta.3",
|
|
4
|
+
"description": "Interactive tables for Navette admin panels.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"navette",
|
|
34
|
-
"filament",
|
|
35
34
|
"admin",
|
|
36
35
|
"panel",
|
|
37
36
|
"livewire",
|
|
@@ -39,11 +38,11 @@
|
|
|
39
38
|
"node"
|
|
40
39
|
],
|
|
41
40
|
"dependencies": {
|
|
42
|
-
"@navette-js/support": "1.0.0-beta.
|
|
43
|
-
"@navette-js/database": "1.0.0-beta.
|
|
44
|
-
"@navette-js/actions": "1.0.0-beta.
|
|
45
|
-
"@navette-js/forms": "1.0.0-beta.
|
|
46
|
-
"@navette-js/schemas": "1.0.0-beta.
|
|
41
|
+
"@navette-js/support": "1.0.0-beta.3",
|
|
42
|
+
"@navette-js/database": "1.0.0-beta.3",
|
|
43
|
+
"@navette-js/actions": "1.0.0-beta.3",
|
|
44
|
+
"@navette-js/forms": "1.0.0-beta.3",
|
|
45
|
+
"@navette-js/schemas": "1.0.0-beta.3"
|
|
47
46
|
},
|
|
48
47
|
"publishConfig": {
|
|
49
48
|
"access": "public",
|
package/views/column-manager.ejs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<%#
|
|
2
|
-
|
|
1
|
+
<%# Column manager dropdown; only the id, labels and color classes are filled in here.
|
|
2
|
+
The list itself is rendered by Alpine (filamentTableColumnManager) from the `tableColumns` state. %>
|
|
3
3
|
<div
|
|
4
4
|
x-data="filamentDropdown({ isMenu: false })"
|
|
5
5
|
class="fi-dropdown fi-ta-col-manager-dropdown" wire:key="<%= id %>.table.column-manager"
|
package/views/index.ejs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<%# Table
|
|
2
|
-
Pas encore portés : actions groupées, filtres, gestionnaire de colonnes, recherche par colonne, groupes, résumés, réordonnancement, état vide. %>
|
|
1
|
+
<%# Table: header, toolbar, filters, content (rows or layout cards), summaries and pagination. %>
|
|
3
2
|
<% const selectPageBinding = `
|
|
4
3
|
const recordsOnPage = getRecordsOnPage()
|
|
5
4
|
|
|
@@ -30,7 +29,7 @@
|
|
|
30
29
|
|
|
31
30
|
<div class="fi-ta-ctn<%- contentLayout ? ' fi-ta-ctn-with-content-layout' : '' %> fi-ta-ctn-with-footer fi-ta-ctn-with-header">
|
|
32
31
|
<div class="fi-ta-main">
|
|
33
|
-
<%#
|
|
32
|
+
<%# The toolbar is always visible only when it has content (search, filters, columns); otherwise only while records are selected. %>
|
|
34
33
|
<% const filtersAbove = filtersForm !== null && filtersLayout === 'above-content-collapsible'; %>
|
|
35
34
|
<% const toolbarVisible = reorder !== null || groups.length > 0 || isSearchable || filtersForm !== null || hasColumnManager; %>
|
|
36
35
|
<div x-show="<%- heading !== null || headerActions.length || toolbarVisible ? 'true' : 'false' %> || false || (getSelectedRecordsCount() && <%- bulkActions.length ? 1 : 0 %>)" wire:key="<%= id %>.table.header.visible" class="fi-ta-header-ctn">
|
|
@@ -53,7 +52,7 @@
|
|
|
53
52
|
<% } %>
|
|
54
53
|
<%- hook('tables::header.after') %>
|
|
55
54
|
<% if (filtersAbove) { %>
|
|
56
|
-
<%#
|
|
55
|
+
<%# Collapsible filters above the content. %>
|
|
57
56
|
<div x-bind:class="{ 'fi-open': areFiltersOpen }" class="fi-ta-filters-above-content-ctn">
|
|
58
57
|
<div class="fi-ta-filters" x-cloak="x-cloak" x-show="areFiltersOpen">
|
|
59
58
|
<div class="fi-ta-filters-header">
|
|
@@ -274,7 +273,7 @@
|
|
|
274
273
|
</div>
|
|
275
274
|
<% } %>
|
|
276
275
|
|
|
277
|
-
<%#
|
|
276
|
+
<%# These two hook slots only exist when there is a filters trigger or a column manager. %>
|
|
278
277
|
<% if ((filtersForm !== null && !filtersAbove) || hasColumnManager) { %><%- hook('tables::toolbar.toggle-column-trigger.before') %><% } %>
|
|
279
278
|
<% if (hasColumnManager) { %>
|
|
280
279
|
<%- view('filament-tables::column-manager', { id, dangerLinkClasses, primaryButtonClasses }) %>
|
|
@@ -324,10 +323,10 @@
|
|
|
324
323
|
</div>
|
|
325
324
|
<% } %>
|
|
326
325
|
|
|
327
|
-
<%#
|
|
326
|
+
<%# A `tables::filter.indicators` hook that renders something replaces the default indicators. %>
|
|
328
327
|
<% const filterIndicatorsView = filterIndicators.length ? hook('tables::filter.indicators', { filterIndicators }) : ''; %>
|
|
329
328
|
<% if (filterIndicatorsView.trim() !== '') { %><%- filterIndicatorsView %><% } else if (filterIndicators.length) { %>
|
|
330
|
-
<%#
|
|
329
|
+
<%# Active filter indicators. %>
|
|
331
330
|
<div class="fi-ta-filter-indicators">
|
|
332
331
|
<div>
|
|
333
332
|
<span class="fi-ta-filter-indicators-label">
|
|
@@ -378,7 +377,7 @@
|
|
|
378
377
|
</div>
|
|
379
378
|
|
|
380
379
|
<% if (contentLayout) { %>
|
|
381
|
-
<%#
|
|
380
|
+
<%# Column layout (Split / Stack): one card per record, sorting through a select. %>
|
|
382
381
|
<% if (rows.length) { %>
|
|
383
382
|
<% if (selectable || columns.some((c) => c.sortable)) { %>
|
|
384
383
|
<div class="fi-ta-content-header">
|
|
@@ -498,7 +497,7 @@
|
|
|
498
497
|
<% if (table.isStackedOnMobile()) { %>
|
|
499
498
|
<tr class="fi-ta-table-stacked-header-row">
|
|
500
499
|
<td colspan="100%" class="fi-ta-table-stacked-header-cell">
|
|
501
|
-
<%#
|
|
500
|
+
<%# Stacked sort controls: only when some columns are sortable. %>
|
|
502
501
|
<% if (columns.some((c) => c.sortable)) { %>
|
|
503
502
|
<div x-data="{
|
|
504
503
|
sort: $wire.$entangle('tableSort', true),
|
|
@@ -600,7 +599,7 @@
|
|
|
600
599
|
</th>
|
|
601
600
|
<% } %>
|
|
602
601
|
|
|
603
|
-
<%#
|
|
602
|
+
<%# A `tables::header.cell` hook that renders something replaces the column's header cell. %>
|
|
604
603
|
<% const hasHeaderCellHook = hasHook('tables::header.cell'); %>
|
|
605
604
|
<% for (const [columnIndex, column] of columns.entries()) { %>
|
|
606
605
|
<% const headerCellView = hasHeaderCellHook ? hook('tables::header.cell', { column: visibleColumns[columnIndex], isReordering }) : ''; %>
|
|
@@ -711,7 +710,7 @@
|
|
|
711
710
|
<td class="fi-ta-cell fi-ta-selection-cell">
|
|
712
711
|
<input aria-label="<%= t('filament-tables::table.fields.bulk_select_record.label', { key: row.key }) %>" type="checkbox" value="<%= row.key %>" x-on:click="toggleSelectedRecord(<%= js(row.key) %>)" x-bind:checked="isRecordSelected(<%= js(row.key) %>) ? 'checked' : null" data-group="<%= row.groupKey ?? '' %>" wire:loading.attr="disabled" wire:target="<%- targets %>" class="fi-ta-record-checkbox fi-checkbox-input" />
|
|
713
712
|
</td>
|
|
714
|
-
<% } %><%#
|
|
713
|
+
<% } %><%# end selection cell %>
|
|
715
714
|
|
|
716
715
|
<% for (const cell of row.cells) { %>
|
|
717
716
|
<td wire:key="<%= id %>.table.record.<%= row.key %>.column.<%= cell.name %>" class="<%- cls(['fi-ta-cell', 'fi-ta-cell-' + cell.cssName, cell.alignment && cell.alignment !== 'start' ? 'fi-align-' + cell.alignment : null]) %>">
|
|
@@ -728,7 +727,7 @@
|
|
|
728
727
|
</button>
|
|
729
728
|
<% if (table.isStackedOnMobile()) { %></div><% } %>
|
|
730
729
|
<% } else { %>
|
|
731
|
-
<%#
|
|
730
|
+
<%# The content wrapper only exists in stacked mode. %>
|
|
732
731
|
<% if (table.isStackedOnMobile()) { %><div class="fi-ta-cell-label"><%= cell.label %></div><div class="fi-ta-cell-content"><% } %>
|
|
733
732
|
<% if (row.url && !cell.plain) { %>
|
|
734
733
|
<a href="<%= row.url %>" x-on:click="if (! ($event.altKey || $event.ctrlKey || $event.metaKey || $event.shiftKey)) { $event.preventDefault(); Alpine.navigate($el.getAttribute('href')) }" class="fi-ta-col">
|
|
@@ -756,16 +755,16 @@
|
|
|
756
755
|
<% } %>
|
|
757
756
|
</div>
|
|
758
757
|
</td>
|
|
759
|
-
<% } %><%#
|
|
758
|
+
<% } %><%# end actions cell %>
|
|
760
759
|
</tr>
|
|
761
760
|
<% } %>
|
|
762
|
-
<%#
|
|
761
|
+
<%# Summaries (already rendered and escaped rows): the last group's, then the table's. %>
|
|
763
762
|
<%- trailingGroupSummary %>
|
|
764
763
|
<%- summaryHtml %>
|
|
765
764
|
</tbody>
|
|
766
765
|
<% } %>
|
|
767
766
|
</table>
|
|
768
|
-
<% } %><%#
|
|
767
|
+
<% } %><%# end table / cards %>
|
|
769
768
|
</div>
|
|
770
769
|
|
|
771
770
|
<%- hook('tables::content.after', { table, records: page.records }) %>
|