mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
37 lines
59 KiB
JavaScript
37 lines
59 KiB
JavaScript
|
import{f as _e,q as L,as as Fe,at as $e}from"./index-DWMGWNy8.js";/**
|
|||
|
* match-sorter-utils
|
|||
|
*
|
|||
|
* Copyright (c) TanStack
|
|||
|
*
|
|||
|
* This source code is licensed under the MIT license found in the
|
|||
|
* LICENSE.md file in the root directory of this source tree.
|
|||
|
*
|
|||
|
* @license MIT
|
|||
|
*/const ge={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c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ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},Ve=Object.keys(ge).join("|"),Ie=new RegExp(Ve,"g");function Me(e){return e.replace(Ie,o=>ge[o])}/**
|
|||
|
* @name match-sorter
|
|||
|
* @license MIT license.
|
|||
|
* @copyright (c) 2099 Kent C. Dodds
|
|||
|
* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
|
|||
|
*/const I={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function _t(e,o,t){var n;if(t=t||{},t.threshold=(n=t.threshold)!=null?n:I.MATCHES,!t.accessors){const l=ie(e,o,t);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:t.threshold,passed:l>=t.threshold}}const r=Ae(e,t.accessors),i={rankedValue:e,rank:I.NO_MATCH,accessorIndex:-1,accessorThreshold:t.threshold,passed:!1};for(let l=0;l<r.length;l++){const u=r[l];let s=ie(u.itemValue,o,t);const{minRanking:g,maxRanking:c,threshold:p=t.threshold}=u.attributes;s<g&&s>=I.MATCHES?s=g:s>c&&(s=c),s=Math.min(s,c),s>=p&&s>i.rank&&(i.rank=s,i.passed=!0,i.accessorIndex=l,i.accessorThreshold=p,i.rankedValue=u.itemValue)}return i}function ie(e,o,t){return e=le(e,t),o=le(o,t),o.length>e.length?I.NO_MATCH:e===o?I.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),o=o.toLowerCase(),e===o?I.EQUAL:e.startsWith(o)?I.STARTS_WITH:e.includes(` ${o}`)?I.WORD_STARTS_WITH:e.includes(o)?I.CONTAINS:o.length===1?I.NO_MATCH:xe(e).includes(o)?I.ACRONYM:Pe(e,o))}function xe(e){let o="";return e.split(" ").forEach(n=>{n.split("-").forEach(i=>{o+=i.substr(0,1)})}),o}function Pe(e,o){let t=0,n=0;function r(s,g,c){for(let p=c,d=g.length;p<d;p++)if(g[p]===s)return t+=1,p+1;return-1}function i(s){const g=1/s,c=t/o.length;return I.MATCHES+c*g}const l=r(o[0],e,0);if(l<0)return I.NO_MATCH;n=l;for(let s=1,g=o.length;s<g;s++){const c=o[s];if(n=r(c,e,n),!(n>-1))return I.NO_MATCH}const u=n-l;return i(u)}function le(e,o){let{keepDiacritics:t}=o;return e=`${e}`,t||(e=Me(e)),e}function Ee(e,o){let t=o;typeof o=="object"&&(t=o.accessor);const n=t(e);return n==null?[]:Array.isArray(n)?n:[String(n)]}function Ae(e,o){const t=[];for(let n=0,r=o.length;n<r;n++){const i=o[n],l=ye(i),u=Ee(e,i);for(let s=0,g=u.length;s<g;s++)t.push({itemValue:u[s],attributes:l})}return t}const se={maxRanking:1/0,minRanking:-1/0};function ye(e){return typeof e=="function"?se:{...se,...e}}/**
|
|||
|
* table-core
|
|||
|
*
|
|||
|
* Copyright (c) TanStack
|
|||
|
*
|
|||
|
* This source code is licensed under the MIT license found in the
|
|||
|
* LICENSE.md file in the root directory of this source tree.
|
|||
|
*
|
|||
|
* @license MIT
|
|||
|
*/function E(e,o){return typeof e=="function"?e(o):e}function M(e,o){return t=>{o.setState(n=>({...n,[e]:E(t,n[e])}))}}function U(e){return e instanceof Function}function De(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function de(e,o){const t=[],n=r=>{r.forEach(i=>{t.push(i);const l=o(i);l!=null&&l.length&&n(l)})};return n(e),t}function m(e,o,t){let n=[],r;return i=>{let l;t.key&&t.debug&&(l=Date.now());const u=e(i);if(!(u.length!==n.length||u.some((c,p)=>n[p]!==c)))return r;n=u;let g;if(t.key&&t.debug&&(g=Date.now()),r=o(...u),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const c=Math.round((Date.now()-l)*100)/100,p=Math.round((Date.now()-g)*100)/100,d=p/16,a=(f,S)=>{for(f=String(f);f.length<S;)f=" "+f;return f};console.info(`%c⏱ ${a(p,5)} /${a(c,5)} ms`,`
|
|||
|
font-size: .6rem;
|
|||
|
font-weight: bold;
|
|||
|
color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function C(e,o,t,n){return{debug:()=>{var r;return(r=e==null?void 0:e.debugAll)!=null?r:e[o]},key:!1,onChange:n}}function He(e,o,t,n){const r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:r,getContext:m(()=>[e,t,o,i],(l,u,s,g)=>({table:l,column:u,row:s,cell:g,getValue:g.getValue,renderValue:g.renderValue}),C(e.options,"debugCells"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,t,o,e)},{}),i}function Ge(e,o,t,n){var r,i;const u={...e._getDefaultColumnDef(),...o},s=u.accessorKey;let g=(r=(i=u.id)!=null?i:s?typeof String.prototype.replaceAll=="function"?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)!=null?r:typeof u.header=="string"?u.header:void 0,c;if(u.accessorFn?c=u.accessorFn:s&&(s.includes(".")?c=d=>{let a=d;for(const S of s.split(".")){var f;a=(f=a)==null?void 0:f[S]}return a}:c=d=>d[u.accessorKey]),!g)throw new Error;let p={id:`${String(g)}`,accessorFn:c,parent:n,depth:t,columnDef:u,columns:[],getFlatColumns:m(()=>[!0],()=>{var d;return[p,...(d=p.columns)==null?void 0:d.flatMap(a=>a.getFlatColumns())]},C(e.options,"debugColumns")),getLeafColumns:m(()=>[e._getOrderColumnsFn()],d=>{var a;if((a=p.columns)!=null&&a.length){let f=p.columns.flatMap(S=>S.getLeafColumns());return d(f)}return[p]},C(e.options,"debugColumns"))};for(const d of e._features)d.createColumn==null||d.createColumn(p,e);return p}const $="debugHeaders";function ue(e,o,t){var n;let i={id:(n=t.id)!=null?n:o.id,column:o,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],u=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(u),l.push(s)};return u(i),l},getContext:()=>({table:e,header:i,column:o})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}const Oe={createTable:e=>{e.getHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,r)=>{var i,l;const u=(i=n==null?void 0:n.map(p=>t.find(d=>d.id===p)).filter(Boolean))!=null?i:[],s=(l=r==null?void 0:r.map(p=>t.find(d=>d.id===p)).filter(Boolean))!=null?l:[],g=t.filter(p=>!(n!=null&&n.includes(p.id))&&!(r!=null&&r.includes(p.id)));return z(o,[...u,...g,...s],e)},C(e.options,$)),e.getCenterHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,r)=>(t=t.filter(i=>!(n!=null&&n.includes(i.id))&&!(r!=null&&r.includes(i.id))),z(o,t,e,"center")),C(e.options,$)),e.getLeftHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var r;const i=(r=n==null?void 0:n.map(l=>t.find(u=>u.id===l)).filter(Boolean))!=null?r:[];return z(o,i,e,"left")},C(e.options,$)),e.getRightHeaderGroups=m(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var r;const i=(r=n==null?void 0:n.map(l=>t.find(u=>u.id===l)).filter(Boolean))!=null?r:[];return z(o,i,e,"right")},C(e.options,$)),e.getFooterGroups=m(()=>[e.getHeaderGroups()],o=>[...o].reverse(),C(e.options,$)),e.getLeftFooterGroups=m(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),C(e.options,$)),e.getCenterFooterGroups=m(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),C(e.options,$)),e.getRightFooterGroups=m(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),C(e.options,$)),e.getFlatHeaders=m(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,$)),e.getLeftFlatHeaders=m(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,$)),e.getCenterFlatHeaders=m(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,$)),e.getRightFlatHeaders=m(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),C(e.options,$)),e.getCenterLeafHeaders=m(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t
|
|||
|
* solid-table
|
|||
|
*
|
|||
|
* Copyright (c) TanStack
|
|||
|
*
|
|||
|
* This source code is licensed under the MIT license found in the
|
|||
|
* LICENSE.md file in the root directory of this source tree.
|
|||
|
*
|
|||
|
* @license MIT
|
|||
|
*/function xt(e,o){return e?typeof e=="function"?_e(e,o):e:null}function Pt(e){const o=L({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,l)=>L(i,l)},e),t=St(o),[n,r]=Fe(t.initialState);return $e(()=>{t.setOptions(i=>L(i,e,{state:L(n,e.state||{}),onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}}))}),t}export{Mt as a,$t as b,Pt as c,It as d,Ft as e,xt as f,Vt as g,_t as r};
|