1import{aX as k,r as l,u as e}from"./vendor-DzWMmZj2.js";import{b as A,d as R,l as T,a6 as u,S as g,a as n,F as h}from"./index-B-ZZKIlh.js";import{u as E,D as c,b as r}from"./useForm-DkZRU2IA.js";import{u as L}from"./vendor-i18n-C7hD56hb.js";import"./vendor-tanstack-D-s8FawA.js";import"./vendor-socket-CdJ84v18.js";import"./vendor-phone-CDRp5aFf.js";import"./date-picker-Ci6ABAHb.js";const{settingsCountries:z}=R(),V=k(()=>{const{data:m,mutateAsync:f}=A({mutationKey:["countries"],mutationFn:()=>z({}),successFn:a=>{var o;return((o=a==null?void 0:a.result)==null?void 0:o.map(({id:x,code:y,name:P})=>({value:x,label:P,code:y})))||[]}});l.useEffect(()=>{f()},[]);const{t:M}=L("catalog"),[p,b]=l.useState(void 0),[d,j]=l.useState(new Date),[D,v]=l.useState(void 0),[N,F]=l.useState(void 0),[t,w]=l.useState({from:new Date(2025,0,10),to:new Date(2025,0,20)}),[U,Y]=l.useState(void 0),[S,C]=l.useState(void 0),s=new Date,I=[{label:"ТекÑÑий меÑÑÑ",range:{from:new Date(s.getFullYear(),s.getMonth(),1),to:s}},{label:"ÐÑоÑлÑй меÑÑÑ",range:{from:new Date(s.getFullYear(),s.getMonth()-1,1),to:new Date(s.getFullYear(),s.getMonth(),0)}},{label:"ÐоÑледние 3 меÑÑÑа",range:{from:new Date(s.getFullYear(),s.getMonth()-3,1),to:s}},{label:"ТекÑÑий год",range:{from:new Date(s.getFullYear(),0,1),to:s}}],i=E({defaultValues:{birthday:void 0,period:void 0},onSubmit:({value:a})=>T.debug("form submit",a)});return e.jsxs("div",{className:"relative p-20 flex flex-col gap-10",children:[e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Headless-компоненÑÑ (конÑÑÑÑкÑоÑ)"}),e.jsx("div",{className:"flex flex-wrap gap-3",children:[{href:"/constructor",label:"ÐонÑигÑÑаÑоÑ",desc:"/constructor â UI конÑÑÑÑкÑоÑа"},{href:"/test/card",label:"ProductCard headless",desc:"mock ModelItem + DEFAULT_CONFIG"},{href:"/test/catalog/zhenshchinam",label:"CatalogTable headless",desc:"ÑеалÑнÑй API + DEFAULT_CONFIG"},{href:"/test/cart",label:"CartTable headless",desc:"mock CartItem[] + DEFAULT_CONFIG"},{href:"/test/product/39023",label:"СÑÑаниÑа модели ÐÐ¾Ð´ÐµÐ»Ñ 26",desc:"/test/product/ID + DEFAULT_CONFIG"}].map(({href:a,label:o,desc:x})=>e.jsxs("a",{href:a,className:"flex flex-col gap-0.5 px-4 py-3 rounded-xl border border-border bg-card hover:border-primary hover:shadow-md transition-all",children:[e.jsx("span",{className:"text-conte-button-m text-primary",children:o}),e.jsx("span",{className:"text-conte-caption text-secondary-foreground",children:x})]},a))})]}),e.jsxs("section",{className:"flex flex-col gap-4",children:[e.jsxs("section",{className:"flex flex-col gap-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Calendar â standalone"}),e.jsx(u,{}),e.jsx(u,{mode:"range"})]}),e.jsx("h2",{className:"text-lg font-semibold",children:"DatePicker â ваÑианÑÑ"}),e.jsxs("div",{className:"flex flex-col gap-6 max-w-xs",children:[e.jsx(c,{label:"ÐаÑа поÑÑавки",value:p,onChange:b,size:"md"}),e.jsx(c,{label:"ÐаÑа ÑождениÑ",value:d,onChange:j,description:d?"ÐÑбÑано: ".concat(d.toLocaleDateString("ru")):void 0}),e.jsx(c,{label:"СÑок договоÑа",value:D,onChange:v,error:!0,errors:[{message:"Ðоле обÑзаÑелÑно Ð´Ð»Ñ Ð·Ð°Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ"}]}),e.jsx(c,{label:"ÐаÑа ÑозданиÑ",value:new Date(2024,0,15),disabled:!0})]})]}),e.jsxs("section",{className:"flex flex-col gap-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"DateRangePicker â ваÑианÑÑ"}),e.jsxs("div",{className:"flex flex-col gap-6 max-w-sm",children:[e.jsx(r,{label:"ÐеÑиод поÑÑавки",value:N,onChange:F}),e.jsx(r,{label:"ÐеÑиод договоÑа",value:t,onChange:w,description:t!=null&&t.from&&(t!=null&&t.to)?"".concat(t.from.toLocaleDateString("ru")," â ").concat(t.to.toLocaleDateString("ru")):void 0}),e.jsx(r,{label:"ÐеÑиод (оÑибка)",error:!0,errors:[{message:"ÐÑбеÑиÑе коÑÑекÑнÑй диапазон"}]}),e.jsx(r,{label:"ÐеÑиод (disabled)",value:{from:new Date(2025,2,1),to:new Date(2025,2,31)},disabled:!0}),e.jsx(r,{label:"ÐеÑиод Ñ Ð¿ÑеÑеÑами",value:S,onChange:C,presets:I})]})]}),e.jsxs("section",{className:"flex flex-col gap-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"DatePicker â TanStack Form"}),e.jsxs("form",{className:"max-w-xs flex flex-col gap-4",onSubmit:a=>{a.preventDefault(),i.handleSubmit()},children:[e.jsx(i.AppField,{name:"birthday",children:a=>e.jsx(a.FormDatePicker,{label:"ÐаÑа ÑождениÑ",required:!0})}),e.jsx(i.AppField,{name:"period",children:a=>e.jsx(a.FormDateRangePicker,{label:"ÐеÑиод"})})]})]}),e.jsxs("section",{className:"flex flex-col gap-4",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Select"}),e.jsx(g,{size:"md",classNames:{wrapper:n("duration-700 linear grow-0 w-120 animate transition-all")},items:m,multiple:!0,ItemSlot:({item:a})=>e.jsxs("div",{className:n("flex gap-1 items-center"),children:[e.jsx(h,{code:a==null?void 0:a.code,size:12}),a==null?void 0:a.label]})}),e.jsx(g,{size:"md",classNames:{wrapper:n("duration-700 linear grow-0 w-120 animate transition-all")},items:m,multiline:!0,multiple:!0,searchable:!0,ItemSlot:({item:a})=>e.jsxs("div",{className:n("flex gap-1 items-center"),children:[e.jsx(h,{code:a==null?void 0:a.code,size:12}),a==null?void 0:a.label]})})]})]})});export{V as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.