Files
aiops/backend/static/assets/checkbox-zTZ6SyDQ.js
T
attacker b553c7956d refactor(q1): src/api 全量清零 any + types/monitor 扩展输入 DTO
ROADMAP Q1 推进(前端类型安全治理 in_progress):

- src/api/ 整个目录 any 清零(含 monitor/ deploy/ 子目录 12+ 文件)
  create/update 入参 any -> Record<string, unknown> / object
  mock 桩 trace/grafana 对接 types/ 标准类型(Trace/GrafanaDashboard)
  典型接口 LdapFormData/ProbeForm 等强类型表单用 object 接收
- types/monitor.ts 扩展 ~150 行接口:
  ZabbixDatasource / AlertSilence / 7 个输入 DTO
  Trace / TraceSpan / TraceServiceMetrics / GrafanaDashboard / DashboardPanel
  HealthProbeInput

验证:
- 整个 src/api/ 目录 any=0
- ESLint no-explicit-any: 995 -> 937 (本项目此轮贡献 -58)
- tsc -b 零错误, npm run build ✓ (17.06s)
- API 回归 8/8 核心端点通过, Docker 部署 healthy
2026-06-26 03:37:56 +08:00

2 lines
4.1 KiB
JavaScript

import{r as i,j as o,a7 as F,a8 as L,a9 as _,aa as H,ab as N,ac as j,ad as G,Z as K,O as U}from"./index-o4rKtKfJ.js";import{u as X}from"./index-BeCACrpC.js";var y="Checkbox",[Z]=F(y),[$,I]=Z(y);function J(t){const{__scopeCheckbox:n,checked:c,children:l,defaultChecked:a,disabled:e,form:h,name:b,onCheckedChange:d,required:k,value:x="on",internal_do_not_use_render:u}=t,[p,v]=H({prop:c,defaultProp:a??!1,onChange:d,caller:y}),[m,C]=i.useState(null),[g,r]=i.useState(null),s=i.useRef(!1),E=m?!!h||!!m.closest("form"):!0,R={checked:p,disabled:e,setChecked:v,control:m,setControl:C,name:b,form:h,value:x,hasConsumerStoppedPropagationRef:s,required:k,defaultChecked:f(a)?!1:a,isFormControl:E,bubbleInput:g,setBubbleInput:r};return o.jsx($,{scope:n,...R,children:Q(u)?u(R):l})}var w="CheckboxTrigger",S=i.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:c,...l},a)=>{const{control:e,value:h,disabled:b,checked:d,required:k,setControl:x,setChecked:u,hasConsumerStoppedPropagationRef:p,isFormControl:v,bubbleInput:m}=I(w,t),C=N(a,x),g=i.useRef(d);return i.useEffect(()=>{const r=e?.form;if(r){const s=()=>u(g.current);return r.addEventListener("reset",s),()=>r.removeEventListener("reset",s)}},[e,u]),o.jsx(_.button,{type:"button",role:"checkbox","aria-checked":f(d)?"mixed":d,"aria-required":k,"data-state":O(d),"data-disabled":b?"":void 0,disabled:b,value:h,...l,ref:C,onKeyDown:j(n,r=>{r.key==="Enter"&&r.preventDefault()}),onClick:j(c,r=>{u(s=>f(s)?!0:!s),m&&v&&(p.current=r.isPropagationStopped(),p.current||r.stopPropagation())})})});S.displayName=w;var B=i.forwardRef((t,n)=>{const{__scopeCheckbox:c,name:l,checked:a,defaultChecked:e,required:h,disabled:b,value:d,onCheckedChange:k,form:x,...u}=t;return o.jsx(J,{__scopeCheckbox:c,checked:a,defaultChecked:e,disabled:b,required:h,onCheckedChange:k,name:l,form:x,value:d,internal_do_not_use_render:({isFormControl:p})=>o.jsxs(o.Fragment,{children:[o.jsx(S,{...u,ref:n,__scopeCheckbox:c}),p&&o.jsx(A,{__scopeCheckbox:c})]})})});B.displayName=y;var M="CheckboxIndicator",T=i.forwardRef((t,n)=>{const{__scopeCheckbox:c,forceMount:l,...a}=t,e=I(M,c);return o.jsx(L,{present:l||f(e.checked)||e.checked===!0,children:o.jsx(_.span,{"data-state":O(e.checked),"data-disabled":e.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...t.style}})})});T.displayName=M;var q="CheckboxBubbleInput",A=i.forwardRef(({__scopeCheckbox:t,...n},c)=>{const{control:l,hasConsumerStoppedPropagationRef:a,checked:e,defaultChecked:h,required:b,disabled:d,name:k,value:x,form:u,bubbleInput:p,setBubbleInput:v}=I(q,t),m=N(c,v),C=X(e),g=G(l);i.useEffect(()=>{const s=p;if(!s)return;const E=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(E,"checked").set,z=!a.current;if(C!==e&&P){const D=new Event("click",{bubbles:z});s.indeterminate=f(e),P.call(s,f(e)?!1:e),s.dispatchEvent(D)}},[p,C,e,a]);const r=i.useRef(f(e)?!1:e);return o.jsx(_.input,{type:"checkbox","aria-hidden":!0,defaultChecked:h??r.current,required:b,disabled:d,name:k,value:x,form:u,...n,tabIndex:-1,ref:m,style:{...n.style,...g,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});A.displayName=q;function Q(t){return typeof t=="function"}function f(t){return t==="indeterminate"}function O(t){return f(t)?"indeterminate":t?"checked":"unchecked"}function Y({className:t,...n}){return o.jsx(B,{"code-path":"src/components/ui/checkbox.tsx:14:5","data-slot":"checkbox",className:K("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:o.jsx(T,{"code-path":"src/components/ui/checkbox.tsx:22:7","data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:o.jsx(U,{"code-path":"src/components/ui/checkbox.tsx:26:9",className:"size-3.5"})})})}export{Y as C};