PageSourceSearch

https://olfawelfare.com/assets/TagInput-DWX291FL.js

js olfawelfare.com collected 2026-10-04 05:29:05 UTC 2,390 bytes, 1 lines download raw bytes

1import{r as k,j as r}from"./index-C9w33Aes.js";import{t as l}from"./translator-C2Zqcery.js";import{u as q,r as T}from"./required-ByvjfgtG.js";import{n as V}from"./PhoneInput-DAN8ad6P.js";import{z as o}from"./index-DdjzzRgi.js";import{t as u}from"./utils-COVZBEwX.js";import{D as I}from"./icons-cQjuprQW.js";function A({id:c,label:m,className:N,tagClassName:j,inputClassName:R,placeholder:y,inputType:d,length:x,min:f,max:p,...s}){const{value:t,changeValue:n,error:i}=q({...s,defaultValue:s.defaultValue||[],rules:[T,V]}),[g,h]=k.useState(""),b=e=>{!e||e.length===0||(d==="number"?Number(e)<f?o.error(l("validation.min",{min:f})):Number(e)>p?o.error(l("validation.max",{max:p})):n([...t,Number(e)]):n([...t,e]),h(""))},v=e=>{if(!(d==="number"&&isNaN(Number(e.target.value)))){if(x&&t.length>=x)return o.error(l("maxTags"));h(e.target.value)}},w=e=>{const a=e.target.value.trim();(e.code==="Space"||e.target.value[-1]===" "||e.keyCode===32)&&b(a)};return r.jsxs("div",{className:u("flex w-full flex-col gap-5",N),children:[m&&r.jsxs("div",{className:"flex items-end gap-1",children:[r.jsx("label",{htmlFor:c,className:"text-base font-medium md:text-xl",children:m}),s.required&&r.jsx("span",{className:"text-bean-red",children:"*"}),r.jsx("span",{className:"text-[11px]",children:`${l("childrenAgesHelper")}`})]}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{type:"text",id:c,placeholder:y,value:g,onKeyUp:w,onChange:v,required:s.required&&t.length===0,className:u("w-full rounded-full border border-gray-200 px-6 py-3 outline-none focus-visible:ring-0",`${i?"border border-red-500":""}`)}),r.jsx("button",{type:"button",onClick:()=>b(g),className:"absolute top-1 rounded-full px-3 py-1 text-2xl text-primary transition-colors duration-300 hover:bg-primary hover:text-white ltr:right-6 rtl:left-6",children:"+"})]}),i&&r.jsx("span",{role:"alert",className:"text-sm text-red-500",children:i}),r.jsx("ul",{className:"flex h-fit flex-wrap items-center gap-5",children:t.map((e,a)=>r.jsxs("li",{className:u("flex items-center gap-2 rounded-full bg-[#fcec9c] px-2 py-1 text-black",j),children:[r.jsx("span",{className:"text-lg",children:e}),r.jsx("span",{children:r.jsx("button",{type:"button",className:"flex items-center justify-center rounded-full bg-red-500 px-2 py-1 text-sm text-white",onClick:()=>n(t.filter((z,C)=>C!==a)),children:r.jsx(I,{})})})]},a))})]})}export{A as T};

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.