tanstack-shadcn-table
Version:
A powerful, feature-rich React table component built on top of TanStack Table v8 with shadcn/ui styling. Optimized bundle size with 55% reduction through peer dependencies.
2 lines (1 loc) • 1.27 kB
JavaScript
;function e(e){return"string"!=typeof e?"":e.replace(/['";\\]/g,"").replace(/<[^>]*>/g,"").slice(0,1e3).trim()}Object.defineProperty(exports,"t",{value:!0}),exports.sanitizeFilterValue=function(t,r){if(null==t)return t;switch(r){case"text":case"custom":return"string"==typeof t?e(t):"";case"select":case"multi-select":return Array.isArray(t)?t.map(t=>"string"==typeof t?e(t):""):"string"==typeof t?e(t):"";case"range":if(Array.isArray(t))return t.map(e=>{const t=+e;return isNaN(t)?null:Math.max(-1e6,Math.min(1e6,t))});const r=+t;return isNaN(r)?null:Math.max(-1e6,Math.min(1e6,r));case"boolean":return"boolean"==typeof t?t:!!t;case"date":case"date-range":if(Array.isArray(t))return t.map(e=>{const t=new Date(e);return isNaN(t.getTime())?null:t.toISOString().split("T")[0]});const s=new Date(t);return isNaN(s.getTime())?null:s.toISOString().split("T")[0];default:return"string"==typeof t?e(t):t}},exports.sanitizeHtml=function(e){return"string"!=typeof e?"":e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/javascript:/gi,"").replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi,"").replace(/data:(?!image\/(png|jpe?g|gif|svg\+xml))[^;]*;/gi,"").replace(/style\s*=\s*["'][^"']*expression\s*\([^"']*["']/gi,"")},exports.sanitizeSearchInput=e;