33function  table ( )  { 
44    Alpine . data ( 'laravellivewiretable' ,  ( wire )  =>  ( { 
55        tableId : '' , 
6-         showBulkActionsAlpine : false , 
6+         paginationTotalItemCount : wire . entangle ( 'paginationTotalItemCount' ) , 
7+         selectedItems : wire . entangle ( 'selected' ) , 
8+         hideBulkActionsWhenEmpty : wire . entangle ( 'hideBulkActionsWhenEmpty' ) , 
9+         indeterminateCheckbox : false ,  
710        primaryKeyName : '' , 
811        shouldBeDisplayed : wire . entangle ( 'shouldBeDisplayed' ) , 
912        tableName : wire . entangle ( 'tableName' ) , 
1013        dataTableFingerprint : wire . entangle ( 'dataTableFingerprint' ) , 
1114        listeners : [ ] , 
12-         paginationCurrentCount : wire . entangle ( 'paginationCurrentCount' ) , 
13-         paginationTotalItemCount : wire . entangle ( 'paginationTotalItemCount' ) , 
14-         paginationCurrentItems : wire . entangle ( 'paginationCurrentItems' ) , 
15-         selectedItems : wire . entangle ( 'selected' ) , 
16-         selectAllStatus : wire . entangle ( 'selectAll' ) , 
17-         delaySelectAll : wire . entangle ( 'delaySelectAll' ) , 
18-         hideBulkActionsWhenEmpty : wire . entangle ( 'hideBulkActionsWhenEmpty' ) , 
1915        reorderEnabled : false , 
2016        defaultReorderColumn : wire . entangle ( 'defaultReorderColumn' ) , 
2117        reorderStatus : wire . entangle ( 'reorderStatus' ) , 
2218        currentlyReorderingStatus : wire . entangle ( 'currentlyReorderingStatus' ) , 
2319        hideReorderColumnUnlessReorderingStatus : wire . entangle ( 'hideReorderColumnUnlessReorderingStatus' ) , 
2420        reorderDisplayColumn : wire . entangle ( 'reorderDisplayColumn' ) , 
25-         newSelectCount : 0 ,  
26-         indeterminateCheckbox : false ,  
27-         bulkActionHeaderChecked : false , 
2821        currentOrderOfItems : null ,  
29-         updateOrderOfItems ( items )  {  
30-             this . currentOrderOfItems  =  items ;  
31-         } ,  
32-         storeOrderedItems ( )  {  
33-             wire . storeReorder ( this . currentOrderOfItems )  
34-         } , 
3522        stripLivewireTags ( data )  {  
3623            let  localHtml  =  data . innerHTML ;  
3724            localHtml  =  localHtml . replace ( '<!--[if BLOCK]>' ,  '' ) 
@@ -71,73 +58,16 @@ function table() {
7158
7259            wire . disableReordering ( ) ; 
7360        } , 
74-         toggleSelectAll ( )  { 
75-             if  ( ! this . showBulkActionsAlpine )  { 
76-                 return ; 
77-             } 
78- 
79-             if  ( this . paginationTotalItemCount  ===  this . selectedItems . length )  { 
80-                 this . clearSelected ( ) ; 
81-                 this . selectAllStatus  =  false ; 
82-             }  else  { 
83-                 if  ( this . delaySelectAll ) 
84-                 {    
85-                     this . setAllItemsSelected ( ) ; 
86-                 } 
87-                 else 
88-                 { 
89-                     this . setAllSelected ( ) ; 
90-                 } 
91-             } 
92-         } , 
93-         setAllItemsSelected ( )  { 
94-             if  ( ! this . showBulkActionsAlpine )  { 
95-                 return ; 
96-             } 
97-             this . selectAllStatus  =  true ; 
98-             this . selectAllOnPage ( ) ; 
99-         } , 
100-         setAllSelected ( )  { 
101-             if  ( ! this . showBulkActionsAlpine )  { 
102-                 return ; 
103-             } 
104-             if  ( this . delaySelectAll ) 
105-             {    
106-                 this . selectAllStatus  =  true ; 
107-                 this . selectAllOnPage ( ) ; 
108-             } 
109-             else 
110-             { 
111-                 wire . setAllSelected ( ) ; 
112-             } 
113-         } , 
114-         clearSelected ( )  { 
115-             if  ( ! this . showBulkActionsAlpine )  { 
116-                 return ; 
117-             } 
118-             this . selectAllStatus  =  false ; 
119-             wire . clearSelected ( ) ; 
120-         } , 
121-         selectAllOnPage ( )  { 
122-             if  ( ! this . showBulkActionsAlpine )  { 
123-                 return ; 
124-             } 
125- 
126-             let  tempSelectedItems  =  this . selectedItems ; 
127-             const  iterator  =  this . paginationCurrentItems . values ( ) ; 
128-             for  ( const  value  of  iterator )  { 
129-                 tempSelectedItems . push ( value . toString ( ) ) ; 
130-             } 
131-             this . selectedItems  =  [ ...new  Set ( tempSelectedItems ) ] ; 
61+         updateOrderOfItems ( items )  {  
62+             this . currentOrderOfItems  =  items ;  
63+         } ,  
64+         storeOrderedItems ( )  {  
65+             wire . storeReorder ( this . currentOrderOfItems )  
13266        } , 
13367        setTableId ( tableId ) 
13468        { 
13569            this . tableId  =  tableId ; 
13670        } , 
137-         setAlpineBulkActions ( showBulkActionsAlpine ) 
138-         { 
139-             this . showBulkActionsAlpine  =  showBulkActionsAlpine ; 
140-         } , 
14171        setPrimaryKeyName ( primaryKeyName ) 
14272        { 
14373            this . primaryKeyName  =  primaryKeyName ; 
@@ -164,7 +94,7 @@ function table() {
16494            this . listeners . forEach ( ( listener )  =>  { 
16595                listener ( ) ; 
16696            } ) ; 
167-         } , 
97+         } 
16898    } ) ) ; 
16999} 
170100export  default  table ; 
0 commit comments