样式修改

This commit is contained in:
liu
2026-08-31 20:48:11 +08:00
parent d0ce897a0f
commit f8cc40a609
179 changed files with 228 additions and 1199 deletions
-1
View File
@@ -1 +0,0 @@
import{i as e}from"./rolldown-runtime-BgaNhQyE.js";import{Ct as t,Dr as n,sr as r,x as i}from"./jsx-runtime-CRBytmvs.js";var a=e(n()),o=e=>typeof e==`object`&&!!e&&e.nodeType===1,s=(e,t)=>(!t||e!==`hidden`)&&e!==`visible`&&e!==`clip`,c=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return s(n.overflowY,t)||s(n.overflowX,t)||(e=>{let t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}})(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)})(e)}return!1},l=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,u=e=>e.parentElement??(e.getRootNode().host||null),d=(e,t)=>{if(typeof document>`u`)return[];let{scrollMode:n,block:r,inline:i,boundary:a,skipOverflowHiddenElements:s}=t,d=typeof a==`function`?a:e=>e!==a;if(!o(e))throw TypeError(`Invalid target`);let f=document.scrollingElement||document.documentElement,p=[],m=e;for(;o(m)&&d(m);){if(m=u(m),m===f){p.push(m);break}m!=null&&m===document.body&&c(m)&&!c(document.documentElement)||m!=null&&c(m,s)&&p.push(m)}let h=window.visualViewport?.width??innerWidth,g=window.visualViewport?.height??innerHeight,{scrollX:_,scrollY:v}=window,{height:y,width:b,top:x,right:S,bottom:C,left:w}=e.getBoundingClientRect(),{top:T,right:E,bottom:D,left:O}=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e),k=r===`start`||r===`nearest`?x-T:r===`end`?C+D:x+y/2-T+D,A=i===`center`?w+b/2-O+E:i===`end`?S+E:w-O,j=[];for(let e=0;e<p.length;e++){let t=p[e],{height:a,width:o,top:s,right:u,bottom:d,left:m}=t.getBoundingClientRect();if(n===`if-needed`&&x>=0&&w>=0&&C<=g&&S<=h&&(t===f&&!c(t)||x>=s&&C<=d&&w>=m&&S<=u))return j;let T=getComputedStyle(t),E=parseInt(T.borderLeftWidth,10),D=parseInt(T.borderTopWidth,10),O=parseInt(T.borderRightWidth,10),M=parseInt(T.borderBottomWidth,10),N=0,P=0,F=`offsetWidth`in t?t.offsetWidth-t.clientWidth-E-O:0,I=`offsetHeight`in t?t.offsetHeight-t.clientHeight-D-M:0,L=`offsetWidth`in t?t.offsetWidth===0?0:o/t.offsetWidth:0,R=`offsetHeight`in t?t.offsetHeight===0?0:a/t.offsetHeight:0;if(f===t)N=r===`start`?k:r===`end`?k-g:r===`nearest`?l(v,v+g,g,D,M,v+k,v+k+y,y):k-g/2,P=i===`start`?A:i===`center`?A-h/2:i===`end`?A-h:l(_,_+h,h,E,O,_+A,_+A+b,b),N=Math.max(0,N+v),P=Math.max(0,P+_);else{N=r===`start`?k-s-D:r===`end`?k-d+M+I:r===`nearest`?l(s,d,a,D,M+I,k,k+y,y):k-(s+a/2)+I/2,P=i===`start`?A-m-E:i===`center`?A-(m+o/2)+F/2:i===`end`?A-u+O+F:l(m,u,o,E,O+F,A,A+b,b);let{scrollLeft:e,scrollTop:n}=t;N=R===0?0:Math.max(0,Math.min(n+N/R,t.scrollHeight-a/R+I)),P=L===0?0:Math.max(0,Math.min(e+P/L,t.scrollWidth-o/L+F)),k+=n-N,A+=e-P}j.push({el:t,top:N,left:P})}return j},f=e=>!1===e?{block:`end`,inline:`nearest`}:(e=>e===Object(e)&&Object.keys(e).length!==0)(e)?e:{block:`start`,inline:`nearest`};function p(e,t){if(!e.isConnected||!(e=>{let t=e;for(;t&&t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}return!1})(e))return;let n=(e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);if((e=>typeof e==`object`&&typeof e.behavior==`function`)(t))return t.behavior(d(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of d(e,f(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var m=[`parentNode`],h=`form_item`;function g(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function _(e,t){if(!e.length)return;let n=e.join(`_`);return t?`${t}_${n}`:m.includes(n)?`${h}_${n}`:n}function v(e,t,n,r,i,a){let o=r;return a===void 0?n.validating?o=`validating`:e.length?o=`error`:t.length?o=`warning`:(n.touched||i&&n.validated)&&(o=`success`):o=a,o}function y(e){return g(e).join(`_`)}function b(e,t){let n=r(t.getFieldInstance(e));if(n)return n;let i=_(g(e),t.__INTERNAL__.name);if(i)return document.getElementById(i)}function x(e){let[n]=i(),r=a.useRef({}),o=a.useMemo(()=>e??{...n,__INTERNAL__:{itemRef:e=>t=>{let n=y(e);t?r.current[n]=t:delete r.current[n]}},scrollToField:(e,t={})=>{let{focus:n,...r}=t,i=b(e,o);i&&(p(i,{scrollMode:`if-needed`,block:`nearest`,...r}),n&&o.focusField(e))},focusField:e=>{let n=o.getFieldInstance(e);t(n?.focus)?n.focus():b(e,o)?.focus?.()},getFieldInstance:e=>{let t=y(e);return r.current[t]}},[e,n]);return[o]}export{g as a,v as i,x as n,_ as r,y as t};