You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/sorting/natural.min.mjs

2 lines
1.3 KiB
JavaScript

/*! © SpryMedia Ltd - datatables.net/license */
import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;DataTable.type("natural",{order:{asc:function(a,t){return a.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})},desc:function(a,t){return-1*a.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})}},className:"natural-sort"}),DataTable.type("natural-nohtml",{order:{asc:function(a,t){return a=DataTable.util.stripHtml(a),t=DataTable.util.stripHtml(t),a.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})},desc:function(a,t){return a=DataTable.util.stripHtml(a),t=DataTable.util.stripHtml(t),-1*a.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})}},className:"natural-sort"}),DataTable.type("natural-ci",{order:{asc:function(a,t){return a=a.toString().toLowerCase(),t=t.toString().toLowerCase(),a.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})},desc:function(a,t){return a=a.toString().toLowerCase(),t=t.toString().toLowerCase(),-1*a.localeCompare(t,navigator.languages[0]||navigator.language,{numeric:!0,ignorePunctuation:!0})}},className:"natural-sort"});export default DataTable;