osm-commerces/assets/js/table-sortable.js

12 lines
19 KiB
JavaScript
Raw Normal View History

/*
* table-sortable
* version: 2.0.3
* release date: 4/2/2021
* (c) Ravi Dhiman <ravi.dhiman@ravid.dev> https://ravid.dev
* For the full copyright and license information, please view the LICENSE
*/
2025-06-25 00:32:46 +02:00
// Forcer la présence de jQuery globalement
if (typeof window.jQuery === 'undefined' && typeof window.$ !== 'undefined') {
window.jQuery = window.$;
}
!function(t){var e={};function n(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(a,i,function(e){return t[e]}.bind(null,i));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){t.exports=jQuery},function(t,e,n){t.exports=n(3)},function(t,e,n){},function(t,e,n){"use strict";n.r(e);var a={};function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){for(var n=0;n<e.length;n++){var a=e[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),t}n.r(a),n.d(a,"_isArray",(function(){return c})),n.d(a,"_isNumber",(function(){return h})),n.d(a,"_isObject",(function(){return d})),n.d(a,"_isFunction",(function(){return f})),n.d(a,"_isString",(function(){return p})),n.d(a,"_isDate",(function(){return g})),n.d(a,"_sort",(function(){return _})),n.d(a,"_keys",(function(){return m})),n.d(a,"_forEach",(function(){return b})),n.d(a,"_filter",(function(){return v})),n.d(a,"_invariant",(function(){return y})),n.d(a,"_nativeCompare",(function(){return P})),n.d(a,"debounce",(function(){return k})),n.d(a,"_lower",(function(){return C})),n.d(a,"lookInObject",(function(){return E})),n.d(a,"_inRange",(function(){return w}));var s,l=n(0),u=n.n(l),c=function(t){return Array.isArray(t)},h=function(t){return"number"===typeof t&&!isNaN(t)},d=function(t){return"object"===typeof t},f=function(t){return"function"===typeof t},p=function(t){return"string"===typeof t},g=function(t){if("[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t))return!0;if(p(t)){var e=new Date(t);if(h(e.getDate()))return!0}return!1},_=function(t,e){return t.sort((function(t,n){return"asc"===e?parseInt(t,10)-parseInt(n,10):parseInt(n,10)-parseInt(t,10)}))},m=function(t){return"keys"in Object?Object.keys(t):Object.getOwnPropertyNames(t)},b=function(t,e){if(y(c(t),"ForEach requires array input"),!t.length)return[];f(e)||(e=function(){});for(var n=0,a=t.length;n<a;)e.apply(null,[t[n],n]),n+=1;return t},v=function(t,e){if(y(c(t),"_filter requires array input"),!t.length)return[];if(!f(e))return t;for(var n=0,a=t.length,i=[];n<a;)e.apply(null,[t[n],n])&&i.push(t[n]),n+=1;return i},y=function(t,e){var n;if(!t){for(var a=arguments.length,i=new Array(a>2?a-2:0),r=2;r<a;r++)i[r-2]=arguments[r];var o=[].concat(i),s=0;throw(n=new Error(e.replace(/%s/g,(function(){return o[s++]})))).name="TableSortable Violation",n.framesToPop=1,n}},P=function(t,e){if(t!==e){if(h(t))return parseFloat(t)>parseFloat(e)?1:-1;if(g(t)){var n=new Date(t),a=new Date(e);return n.getTime()>a.getTime()?1:-1}return p(t)?t>e?1:-1:1}return 0},k=function(t,e){var n;return function(){var a=this,i=arguments;clearTimeout(n),n=window.setTimeout((function(){return t.apply(a,i)}),e)}},C=function(t){return p(t)?t.toLowerCase():String(t)},E=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e&&!h(e))return!1;var a=m(t);c(n)||(n=a);for(var i=0,r=a.length,o=!1,s=C(e);i<r;){var l=a[i],u=C(t[l]);if(n.length&&n.indexOf(l)>-1&&u.indexOf(s)>-1){o=!0;break}if(!n.length&&u.indexOf(s)>-1){o=!0;break}i+=1}return o},w=function(t,e){return c(e)&&e[0]<=t&&e[1]>t},D=function(){function t(){i(this,t),this._name="dataset",this.dataset=null,this._cachedData=null,this._datasetLen=0,this._outLen=10,this.sortDirectio