@zimyo/ui 1.10.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{Calender-353bd05e.esm.js → Calender-0bb649b1.esm.js} +1 -1
- package/dist/chunks/{Heading-e2a972b9.esm.js → Heading-b91e2c5f.esm.js} +1 -1
- package/dist/chunks/{Muted-3ce0abb2.esm.js → Muted-bfc4985b.esm.js} +1 -1
- package/dist/chunks/{Text-cc8d79c4.esm.js → Text-f18219bd.esm.js} +1 -1
- package/dist/chunks/index-5b35e7d9.esm.js +1 -0
- package/dist/components/Accordion/index.esm.js +1 -1
- package/dist/components/AppList/index.esm.js +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.esm.js +1 -1
- package/dist/components/BulkActionsBar/index.esm.js +1 -1
- package/dist/components/Button/index.esm.js +1 -1
- package/dist/components/Card/index.esm.js +1 -1
- package/dist/components/Checkbox/index.esm.js +1 -1
- package/dist/components/CheckboxGroup/index.esm.js +1 -1
- package/dist/components/DatePicker/index.esm.js +1 -1
- package/dist/components/DateRangePicker/index.esm.js +1 -1
- package/dist/components/Form/index.esm.js +1 -1
- package/dist/components/GlobalMenuSearch/index.esm.js +1 -1
- package/dist/components/Input/index.esm.js +1 -1
- package/dist/components/Modal/index.esm.js +1 -1
- package/dist/components/Notice/index.esm.js +1 -1
- package/dist/components/Popover/index.esm.js +1 -1
- package/dist/components/PopupConfirm/index.esm.js +1 -1
- package/dist/components/Radio/index.esm.js +1 -1
- package/dist/components/RadioGroup/index.esm.js +1 -1
- package/dist/components/Select/index.esm.js +1 -1
- package/dist/components/Switch/index.esm.js +1 -1
- package/dist/components/Table/index.esm.js +1 -1
- package/dist/components/TimePicker/index.esm.js +1 -1
- package/dist/components/Typography/index.esm.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/theme/index.esm.js +1 -1
- package/package.json +1 -1
- package/dist/index.esm.css +0 -1
- /package/dist/chunks/{assertThisInitialized-006bfab4.esm.js → assertThisInitialized-406be690.esm.js} +0 -0
- /package/dist/chunks/{index-a1978735.esm.js → index-c6541658.esm.js} +0 -0
- /package/dist/chunks/{lucide-232cb488.esm.js → lucide-2a18f5d4.esm.js} +0 -0
- /package/dist/chunks/{tslib.es6-b7083bd5.esm.js → tslib.es6-49e5b83c.esm.js} +0 -0
- /package/dist/chunks/{typeof-23ef5bec.esm.js → typeof-cc63ab7d.esm.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as o}from"../../chunks/tslib.es6-
|
|
1
|
+
import{a as o}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as r,Fragment as i,jsx as n}from"react/jsx-runtime";import{useState as t,useMemo as e}from"react";import a from"@mui/material/IconButton";import{Popover as m}from"../Popover/index.esm.js";import d from"@mui/material/List";import l from"@mui/material/ListItemText";import p from"@mui/material/ListItemIcon";import{ListItemButton as c}from"@mui/material";import{G as s}from"../../chunks/lucide-2a18f5d4.esm.js";var u=function(u){var v=u.apps,f=void 0===v?[]:v,h=u.icon,g=void 0===h?s:h,b=u.urlKey,y=void 0===b?"url":b,k=u.nameKey,x=void 0===k?"name":k,I=u.appIconKey,P=void 0===I?"appIcon":I,C=u.iconProps,w=void 0===C?{}:C,j=u.popoverProps,T=void 0===j?{}:j,B=u.listProps,K=void 0===B?{}:B,L=u.listItemProps,z=void 0===L?{}:L,O=u.listItemTextProps,W=void 0===O?{}:O,E=u.width,G=void 0===E?240:E,_=u.padding,q=void 0===_?0:_,A=u.border,D=void 0===A||A,F=u.target,H=void 0===F?"_blank":F,J=t(null),M=J[0],N=J[1],Q=Boolean(M)?"simple-popover":void 0,R=e(function(){return null==f?void 0:f.filter(function(o){return o.display})},[f]);return r(i,{children:[n(a,o({"aria-describedby":Q,onClick:function(o){N(o.currentTarget)}},w,{children:n(g,{})})),n(m,o({open:Boolean(M),onClose:function(){N(null)},anchorEl:M,width:G,padding:q,border:D,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},T,{children:n(d,o({disablePadding:!0},K,{children:R.map(function(i,t){return r(c,o({component:"div",sx:{":hover":{backgroundColor:i.backgroundColor}},onClick:function(){return window.open(i[y],H)}},z,{children:[i[P]?n(p,{sx:{minWidth:30,backgroundColor:i.backgroundColor},children:n("img",{width:22,height:22,src:i[P],alt:i.name})}):null,n(l,o({sx:{ml:1},primaryTypographyProps:{variant:"body2",fontWeight:500},primary:i[x]},W))]}),t)})}))}))]})};export{u as AppList,u as default};
|
|
@@ -21,7 +21,7 @@ interface BadgeProps extends VariantProps<typeof badgeVariants> {
|
|
|
21
21
|
declare const badgeVariants: (props?: ({
|
|
22
22
|
variant?: "text" | "outlined" | "contained" | null | undefined;
|
|
23
23
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
24
|
-
type?: "default" | "
|
|
24
|
+
type?: "default" | "success" | "error" | "info" | "warning" | null | undefined;
|
|
25
25
|
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
26
26
|
declare const Badge: ({ label, icon, iconPosition, dot, dotPosition, variant, size, type, color, className, }: BadgeProps) => react_jsx_runtime.JSX.Element;
|
|
27
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{a as t,c as r}from"../../chunks/index-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{a as t,c as r}from"../../chunks/index-c6541658.esm.js";import{T as i}from"../../chunks/Text-f18219bd.esm.js";import"react";import"../../chunks/tslib.es6-49e5b83c.esm.js";import"@mui/material";const n=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,o=t;var u,l,d=(u="zui:inline-flex zui:items-center zui:rounded-full zui:font-medium zui:gap-2",l={variants:{variant:{contained:"",outlined:"zui:border zui:bg-transparent",text:"zui:bg-transparent zui:border-transparent"},size:{sm:"zui:text-xs zui:px-2 zui:py-0.5",md:"zui:text-sm zui:px-3 zui:py-1",lg:"zui:text-base zui:px-4 zui:py-1.5"},type:{success:"",warning:"",error:"",info:"",default:""}},defaultVariants:{variant:"contained",size:"md",type:"default"}},e=>{var t;if(null==(null==l?void 0:l.variants))return o(u,null==e?void 0:e.class,null==e?void 0:e.className);const{variants:r,defaultVariants:i}=l,d=Object.keys(r).map(t=>{const o=null==e?void 0:e[t],u=null==i?void 0:i[t];if(null===o)return null;const l=n(o)||n(u);return r[t][l]}),a=e&&Object.entries(e).reduce((e,t)=>{let[r,i]=t;return void 0===i||(e[r]=i),e},{}),s=null==l||null===(t=l.compoundVariants)||void 0===t?void 0:t.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...i,...a}[t]):{...i,...a}[t]===r})?[...e,r,n]:e},[]);return o(u,d,s,null==e?void 0:e.class,null==e?void 0:e.className)}),a={success:{bg:"zui:bg-green-100",text:"zui:text-green-700",border:"zui:border-green-700"},warning:{bg:"zui:bg-yellow-100",text:"zui:text-yellow-600",border:"zui:border-yellow-600"},error:{bg:"zui:bg-red-100",text:"zui:text-red-700",border:"zui:border-red-700"},info:{bg:"zui:bg-blue-100",text:"zui:text-blue-700",border:"zui:border-blue-700"},default:{bg:"zui:bg-gray-100",text:"zui:text-gray-800",border:"zui:border-gray-800"}},s=function(t){var n,o,u,l=t.label,s=t.icon,b=t.iconPosition,c=void 0===b?"start":b,z=t.dot,v=void 0!==z&&z,g=t.dotPosition,p=void 0===g?"start":g,m=t.variant,x=void 0===m?"contained":m,f=t.size,y=void 0===f?"md":f,h=t.type,j=void 0===h?"default":h,k=t.color,w=t.className,N=a[j],O={bg:null!==(n=null==k?void 0:k.bg)&&void 0!==n?n:N.bg,text:null!==(o=null==k?void 0:k.text)&&void 0!==o?o:N.text,border:null!==(u=null==k?void 0:k.border)&&void 0!==u?u:N.border},V=r(d({variant:x,size:y,type:j}),"string"==typeof(null==k?void 0:k.bg)?"":"contained"===x?O.bg:"","string"==typeof(null==k?void 0:k.text)?"":O.text,"string"==typeof(null==k?void 0:k.border)?"":"outlined"===x?O.border:"",w),A={backgroundColor:"contained"===x?null==k?void 0:k.bg:void 0,color:null==k?void 0:k.text,borderColor:"outlined"===x?null==k?void 0:k.border:void 0},C=v&&e("span",{className:"zui:w-2 zui:h-2 zui:rounded-full zui:bg-current zui:inline-block"}),P=[];return v&&"start"===p&&P.push(C),s&&"start"===c&&P.push(s),P.push(e("span",{children:l},"label")),s&&"end"===c&&P.push(s),v&&"end"===p&&P.push(C),e(i,{fontWeight:600,className:V,style:A,children:P})};export{s as Badge,s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e,Fragment as r}from"react/jsx-runtime";import{useState as t}from"react";import{Button as o}from"../Button/index.esm.js";import"../../chunks/tslib.es6-
|
|
1
|
+
import{jsxs as i,jsx as e,Fragment as r}from"react/jsx-runtime";import{useState as t}from"react";import{Button as o}from"../Button/index.esm.js";import"../../chunks/tslib.es6-49e5b83c.esm.js";import{ListItemButton as a,IconButton as l}from"@mui/material";import{T as n}from"../../chunks/Text-f18219bd.esm.js";import s from"@mui/material/List";import u from"@mui/material/ListItemText";import{Popover as m}from"../Popover/index.esm.js";import{c,X as d}from"../../chunks/lucide-2a18f5d4.esm.js";var z=function(z){var p=z.selectedRows,h=z.totalRows,b=z.bulkActions,f=z.clearSelection,x=z.maxVisibleActions,g=void 0===x?3:x,v=t(null),k=v[0],w=v[1],y=b.slice(0,g),j=b.slice(g),C=function(){w(null)},N=Boolean(k);return 0===p.length?null:i("div",{className:"zui:bg-blue-100 zui:border zui:border-blue-200 zui:shadow-sm zui:py-1 zui:px-2 zui:rounded-md zui:flex zui:justify-between zui:items-center zui:gap-2 zui:flex-wrap",children:[i(n,{size:"sm",fontWeight:500,className:"zui:text-blue-700 zui:mr-4",children:[p.length," of ",h," selected"]}),i("div",{className:"zui:flex zui:flex-row zui:gap-1.5",children:[y.map(function(i){return e(o,{className:"zui:h-8 zui:bg-white zui:text-blue-700 zui:text-xs zui:border-1 zui:border-gray-100",startIcon:i.icon,size:"small",variant:"text",disabled:i.disabled,onClick:function(){return i.onClick(p)},title:i.label,children:i.label},i.id)}),j.length>0&&i(r,{children:[i(o,{size:"small",variant:"text",className:"zui:h-8 zui:bg-white zui:text-blue-500 zui:text-xs zui:border-1 zui:border-gray-100","aria-controls":N?"more-actions-popover":void 0,"aria-haspopup":"true","aria-expanded":N?"true":void 0,onClick:function(i){w(i.currentTarget)},children:["More ",e(c,{className:"zui:w-4 zui:h-4 zui:ml-1"})]}),e(m,{padding:0,minWidth:200,id:"more-actions-popover",open:N,anchorEl:k,onClose:C,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:e(s,{disablePadding:!0,children:j.map(function(r){return i(a,{disabled:r.disabled,onClick:function(){r.onClick(p),C()},className:"danger"===r.variant?"zui:text-red-600":"",divider:!0,children:[r.icon,e(u,{primaryTypographyProps:{variant:"body2",ml:1},primary:r.label})]},r.id)})})})]}),i(l,{size:"small",onClick:f,children:[" ",e(d,{size:18})]})]})]})};export{z as BulkActionsBar,z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,a as o}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as i,a as o}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as r}from"react/jsx-runtime";import e from"react";import{Button as t,CircularProgress as a}from"@mui/material";var n=e.forwardRef(function(e,n){var d=e.children,s=e.loading,l=void 0!==s&&s,c=e.loadingText,m=e.loaderSize,v=void 0===m?18:m,f=e.loaderPosition,u=void 0===f?"start":f,p=e.variant,z=void 0===p?"contained":p,h=e.color,x=void 0===h?"primary":h,I=e.size,b=void 0===I?"medium":I,g=e.sx,j=void 0===g?{}:g,y=e.disabled,B=e.startIcon,P=e.endIcon,S=i(e,["children","loading","loadingText","loaderSize","loaderPosition","variant","color","size","sx","disabled","startIcon","endIcon"]),T=l&&"end"===u,k=l&&"center"===u;return r(t,o({ref:n,variant:z,color:x,disabled:y||l,size:b,startIcon:l&&"start"===u?r(a,{size:v,color:"inherit"}):B,endIcon:T?r(a,{size:v,color:"inherit"}):P,sx:o({position:"relative"},j)},S,{children:k?r(a,{size:v,color:"inherit"}):l&&c?c:d}))});n.displayName="Button";export{n as Button,n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as r,b as t}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as e,a as r,b as t}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as i,jsxs as a}from"react/jsx-runtime";import{useTheme as n,Card as o,CardHeader as d,Typography as l,CardActions as s,Box as c,Skeleton as u}from"@mui/material";import v from"@mui/material/CardContent";import m from"@mui/material/CardMedia";var h=function(t){var a,d=t.children,l=t.sx,s=void 0===l?{}:l,c=t.elevation,u=void 0===c?1:c,v=t.variant,m=void 0===v?"elevated":v,h=e(t,["children","sx","elevation","variant"]),f=n();return i(o,r({elevation:"elevated"===m?u:0,variant:"outlined"===m?"outlined":"elevation",sx:r({borderRadius:(null===(a=f.radius)||void 0===a?void 0:a.sm)||8,border:"bordered"===m?"1px solid ".concat(f.palette.divider):"none",overflow:"hidden",backgroundColor:f.palette.background.paper},s)},h,{children:d}))},f=function(e){var r=e.title,t=e.subtitle,a=e.action;return i(d,{title:"string"==typeof r?i(l,{variant:"h6",fontWeight:600,children:r}):r,subheader:"string"==typeof t?i(l,{variant:"body2",color:"text.secondary",children:t}):t,action:a})},p=function(e){var r=e.children,t=e.sx;return i(v,{sx:t,children:r})},g=function(e){var r=e.children,t=e.sx;return i(s,{sx:t,children:r})},x=function(e){var r=e.src,t=e.height,a=void 0===t?160:t,n=e.alt;return i(m,{component:"img",height:a,image:r,alt:void 0===n?"card image":n})},b=function(e){var r=e.lines,n=void 0===r?3:r;return a(c,{p:2,children:[i(u,{variant:"rectangular",height:140}),t([],Array(n),!0).map(function(e,r){return i(u,{variant:"text",height:20,sx:{mt:1}},r)})]})},C=Object.assign(h,{Header:f,Content:p,Body:p,Actions:g,Image:x,Skeleton:b});export{g as CardActions,p as CardContent,f as CardHeader,x as CardImage,h as CardRoot,b as CardSkeleton,C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as i}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as e,a as i}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as r,jsx as t}from"react/jsx-runtime";import*as u from"react";import{c as s}from"../../chunks/index-c6541658.esm.js";import{M as n,d as a}from"../../chunks/lucide-2a18f5d4.esm.js";var l={sm:"zui:h-4 zui:w-4",md:"zui:h-5 zui:w-5",lg:"zui:h-6 zui:w-6"},c=u.forwardRef(function(c,z){var o=c.className,d=c.label,m=c.description,f=c.size,h=void 0===f?"md":f,p=c.disabled,b=c.indeterminate,x=c.error,k=e(c,["className","label","description","size","disabled","indeterminate","error"]),w=u.useRef(null);return u.useEffect(function(){w.current&&(w.current.indeterminate=!!b)},[b]),r("label",{className:s("zui:inline-flex zui:items-start zui:gap-2 zui:cursor-pointer",p&&"zui:opacity-60 zui:cursor-not-allowed",o),children:[r("span",{className:s("zui:relative zui:inline-flex zui:items-center zui:justify-center zui:rounded zui:border zui:border-slate-300 zui:bg-white zui:transition-colors zui:shrink-0",l[h],{"zui:border-red-500":x,"zui:bg-slate-200":p,"zui:border-blue-600":(k.checked||b)&&!x,"zui:bg-blue-600":(k.checked||b)&&!x,"zui:ring-1 zui:ring-offset-1 zui:ring-blue-600":(k.checked||b)&&!p}),children:[t("input",i({type:"checkbox",className:"zui:sr-only",ref:function(e){w.current=e,"function"==typeof z?z(e):z&&(z.current=e)},disabled:p,"aria-invalid":x},k)),b?t(n,{className:"zui:w-3 zui:h-3 zui:text-white zui:pointer-events-none",strokeWidth:3}):k.checked?t(a,{className:"zui:w-4 zui:h-4 zui:text-white zui:pointer-events-none"}):null]}),(d||m)&&r("div",{className:"zui:flex zui:flex-col",children:[d&&t("span",{className:"zui:text-sm zui:text-slate-800 zui:font-medium",children:d}),m&&t("span",{className:s("zui:text-xs zui:text-slate-500",x&&"zui:text-red-500"),children:m})]})]})});export{c as Checkbox,c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"../../chunks/tslib.es6-
|
|
1
|
+
import{b as e}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as i,jsx as r}from"react/jsx-runtime";import*as a from"react";import{c as l}from"../../chunks/index-c6541658.esm.js";import{Checkbox as u}from"../Checkbox/index.esm.js";import"../../chunks/lucide-2a18f5d4.esm.js";var t=function(t){var s,o=t.name,d=t.label,n=t.description,c=t.error,z=t.options,m=t.value,v=t.defaultValue,b=t.onChange,p=t.direction,h=void 0===p?"vertical":p,x=t.layout,f=void 0===x?"box":x,g=t.disabled,N=void 0!==g&&g,k=t.size,y=void 0===k?"md":k,j=t.className,C=t.columns,w=void 0===C?3:C,S=a.useState(v||[]),V=S[0],q=S[1],A=void 0!==m,B=A?m:V,D=function(i,r){var a=r?e(e([],B,!0),[i],!1):B.filter(function(e){return e!==i});A||q(a),null==b||b(a)};return i("fieldset",{className:l("zui:space-y-2",j),"aria-invalid":c||void 0,children:[(d||n)&&i("div",{className:"zui:mb-2",children:[d&&r("legend",{className:"zui:text-sm zui:font-medium zui:text-slate-800",children:d}),n&&r("p",{className:l("zui:text-xs zui:text-slate-500",c&&"zui:text-red-500"),children:n})]}),r("div",{className:l((s={"zui:space-y-2":"list"===f&&"vertical"===h,"zui:flex zui:flex-wrap zui:gap-4":"list"===f&&"horizontal"===h,"zui:grid zui:gap-4":"box"===f},s["zui:grid-cols-".concat(w)]="box"===f&&"horizontal"===h,s["zui:grid-cols-1"]="box"===f&&"vertical"===h,s),j),children:z.map(function(e){var a=B.includes(e.value),t=r(u,{name:o,size:y,label:"list"===f?e.label:void 0,description:"list"===f?e.description:void 0,value:e.value,checked:a,onChange:function(i){return D(e.value,i.target.checked)},disabled:N||e.disabled,error:c});return"box"===f?i("label",{className:l("group zui:relative zui:flex zui:cursor-pointer zui:rounded-md zui:border zui:border-gray-200 zui:bg-neutral-100 zui:p-2.5 zui:transition-all",{"zui:border-blue-600 zui:ring-1 zui:ring-blue-500 zui:bg-blue-50":a,"zui:hover:border-gray-400":!N,"zui:opacity-50 zui:cursor-not-allowed":N||e.disabled,"zui:border-red-500":c}),children:[r(u,{name:o,size:y,value:e.value,checked:a,onChange:function(i){return D(e.value,i.target.checked)},disabled:N||e.disabled,error:c,className:"zui:absolute zui:top-3 zui:right-3"}),i("div",{children:[r("p",{className:"zui:text-sm zui:font-medium zui:text-slate-800",children:e.label}),e.description&&r("p",{className:"zui:text-xs zui:text-slate-500",children:e.description})]})]},e.value):r("div",{children:t},e.value)})})]})};export{t as CheckboxGroup,t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e}from"react/jsx-runtime";import*as t from"react";import{i as u,f as r,C as n}from"../../chunks/Calender-
|
|
1
|
+
import{jsxs as i,jsx as e}from"react/jsx-runtime";import*as t from"react";import{i as u,f as r,C as n}from"../../chunks/Calender-0bb649b1.esm.js";import{u as o,c as a}from"../../chunks/index-c6541658.esm.js";import{Popover as s}from"../Popover/index.esm.js";import{X as l,h as c}from"../../chunks/lucide-2a18f5d4.esm.js";import"../../chunks/typeof-cc63ab7d.esm.js";import"../../chunks/tslib.es6-49e5b83c.esm.js";import"../Button/index.esm.js";import"@mui/material";var d={xs:"zui:h-8 zui:px-3 zui:text-xs",sm:"zui:h-9 zui:px-3 zui:text-sm",md:"zui:h-10 zui:px-3 zui:text-sm",lg:"zui:h-11 zui:px-3 zui:text-base"},z=function(i){if("boolean"==typeof i)return i;if(i instanceof Date)return!!u(i)&&i;if(Array.isArray(i))return i.filter(function(i){return i instanceof Date&&u(i)});if("object"==typeof i&&null!==i){var e={};return"from"in i&&u(i.from)&&(e.from=i.from),"to"in i&&u(i.to)&&(e.to=i.to),"before"in i&&u(i.before)&&(e.before=i.before),"after"in i&&u(i.after)&&(e.after=i.after),"dayOfWeek"in i&&(e.dayOfWeek=i.dayOfWeek),Object.keys(e).length>0&&e}return!1},m=function(m){var f=m.label,p=m.value,h=m.onChange,b=m.placeholder,x=void 0===b?"Pick a date":b,v=m.required,g=m.description,k=m.error,y=m.disabled,N=m.variant,j=void 0===N?"outlined":N,w=m.size,C=void 0===w?"md":w,O=m.className,P=m.disableRange,W=void 0!==P&&P,A=m.floatingLabel,B=void 0!==A&&A,D=m.isClerable,F=void 0===D||D,M=o("date"),S=t.useState(null),q=S[0],E=S[1],L=t.useMemo(function(){return!(!p||!u(p))&&r(p,"PPP")},[p]),R=function(){E(null)};return i("div",{className:a("zui:w-full zui:space-y-1",O),children:[!B&&f&&i("label",{htmlFor:M,className:"zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",children:[f,v&&e("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i("div",{className:a("zui:relative zui:flex zui:items-center zui:justify-between zui:rounded-md zui:border zui:text-sm zui:ring-offset-background zui:transition-colors","focus-within:zui:ring-1 focus-within:zui:ring-ring focus-within:zui:ring-offset-1","outlined"===j&&"zui:bg-background zui:border-input","contained"===j&&"zui:bg-muted zui:border-transparent",(k||!L&&p)&&"zui:border-destructive focus-within:zui:ring-destructive",d[C],O),onClick:function(i){return!y&&void E(i.currentTarget)},children:[e("div",{className:"zui:truncate",children:L||x}),i("div",{className:"zui:flex zui:flex-row zui:gap-0.5",children:[F&&L&&!y?e(l,{onClick:function(i){i.stopPropagation(),null==h||h(void 0),R()},className:"zui:ml-2 zui:h-4 zui:w-4 zui:opacity-50 zui:cursor-pointer zui:rounded-full zui:hover:bg-gray-100"}):null,e(c,{className:"zui:ml-2 zui:h-4 zui:w-4 zui:opacity-50"})]}),B&&f&&i("label",{htmlFor:M,className:a("zui:pointer-events-none zui:absolute zui:left-3 zui:-top-[9px] zui:z-10 zui:bg-background zui:px-1 zui:text-xs zui:text-muted-foreground zui:transition-all"),children:[f,v&&e("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]})]}),e(s,{open:Boolean(q),onClose:R,anchorEl:q,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:e(n,{id:M,mode:"single",selected:p,defaultMonth:p,onSelect:function(i){null==h||h(null!=i?i:void 0),R()},disabled:z(W)})}),g&&!k&&e("p",{className:"zui:text-xs zui:text-muted-foreground",children:g}),k&&e("p",{className:"zui:text-xs zui:text-destructive",children:k})]})};export{m as DatePicker,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as i,jsx as e,Fragment as t}from"react/jsx-runtime";import*as o from"react";import{f as u,C as r,i as n}from"../../chunks/Calender-
|
|
1
|
+
import{jsxs as i,jsx as e,Fragment as t}from"react/jsx-runtime";import*as o from"react";import{f as u,C as r,i as n}from"../../chunks/Calender-0bb649b1.esm.js";import{u as l,c as s}from"../../chunks/index-c6541658.esm.js";import{Popover as a}from"../Popover/index.esm.js";import{h as d}from"../../chunks/lucide-2a18f5d4.esm.js";import"../../chunks/typeof-cc63ab7d.esm.js";import"../../chunks/tslib.es6-49e5b83c.esm.js";import"../Button/index.esm.js";import"@mui/material";var m={xs:"zui:h-9 zui:px-3 zui:text-xs",sm:"zui:h-9 zui:px-3 zui:text-sm",md:"zui:h-10 zui:px-3 zui:text-sm",lg:"zui:h-11 zui:px-3 zui:text-base"},c=function(i){return!!i&&n(i)},z=function(z){var f=z.label,h=z.value,v=z.onChange,p=z.placeholder,x=void 0===p?"Pick a date":p,b=z.required,g=z.description,k=z.error,N=z.disabled,L=z.variant,j=void 0===L?"outlined":L,w=z.size,y=void 0===w?"md":w,C=z.className,F=z.floatingLabel,O=void 0!==F&&F,S=l("date-range"),B=o.useState({from:c(null==h?void 0:h.from)?null==h?void 0:h.from:void 0,to:c(null==h?void 0:h.to)?null==h?void 0:h.to:void 0}),M=B[0],P=B[1],q=o.useState(null),E=q[0],T=q[1];return i("div",{className:s("zui:w-full zui:space-y-1",C),children:[!O&&f&&i("label",{htmlFor:S,className:"zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",children:[f,b&&e("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),i("div",{className:s("zui:relative zui:flex zui:items-center zui:justify-between zui:rounded-md zui:border zui:text-sm zui:ring-offset-background zui:transition-colors","focus-within:zui:ring-1 focus-within:zui:ring-ring focus-within:zui:ring-offset-1","outlined"===j&&"zui:bg-background zui:border-input","contained"===j&&"zui:bg-muted zui:border-transparent",k&&"zui:border-destructive focus-within:zui:ring-destructive",m[y],C),onClick:function(i){return!N&&void T(i.currentTarget)},children:[e("div",{className:"zui:truncate",children:c(null==M?void 0:M.from)?c(null==M?void 0:M.to)?i(t,{children:[u(M.from,"LLL dd, y")," -"," ",u(M.to,"LLL dd, y")]}):u(M.from,"LLL dd, y"):x}),e(d,{className:"zui:ml-2 zui:h-4 zui:w-4 zui:opacity-50"}),O&&f&&i("label",{htmlFor:S,className:s("zui:pointer-events-none zui:absolute zui:left-3 zui:-top-[9px] zui:z-10 zui:bg-background zui:px-1 zui:text-xs zui:text-muted-foreground zui:transition-all"),children:[f,b&&e("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]})]}),e(a,{open:Boolean(E),onClose:function(){T(null)},anchorEl:E,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:e(r,{id:S,autoFocus:!0,mode:"range",defaultMonth:null==M?void 0:M.from,selected:M,onSelect:function(i){var e;(null==i?void 0:i.from)&&n(i.from)?(P(i),i.to&&n(i.to)?null==v||v({from:i.from,to:i.to}):null==v||v({from:i.from,to:null!==(e=i.to)&&void 0!==e?e:i.from})):(P(void 0),null==v||v(void 0))},numberOfMonths:2})}),g&&!k&&e("p",{className:"zui:text-xs zui:text-muted-foreground",children:g}),k&&e("p",{className:"zui:text-xs zui:text-destructive",children:k})]})};export{z as DateRangePicker,z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"../../chunks/tslib.es6-
|
|
1
|
+
import{a as e}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as r,jsx as t}from"react/jsx-runtime";import*as n from"react";import a from"react";import{c as i}from"../../chunks/index-c6541658.esm.js";import{Input as s}from"../Input/index.esm.js";import{Select as o}from"../Select/index.esm.js";import{DatePicker as l}from"../DatePicker/index.esm.js";import{DateRangePicker as u}from"../DateRangePicker/index.esm.js";import c from"../Switch/index.esm.js";import{RadioGroup as d}from"../RadioGroup/index.esm.js";import{Button as m}from"../Button/index.esm.js";import{TimePicker as f}from"../TimePicker/index.esm.js";import"../../chunks/lucide-2a18f5d4.esm.js";import"../../chunks/typeof-cc63ab7d.esm.js";import"../../chunks/assertThisInitialized-406be690.esm.js";import"@emotion/react";import"react-dom";import"../../chunks/Calender-0bb649b1.esm.js";import"../Popover/index.esm.js";import"@mui/material";import"@mui/material/Popover";var p=e=>null==e;var v=e=>!p(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e),b=e=>v(e)&&e.target?"checkbox"===e.target.type?e.target.checked:e.target.value:e,h="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function y(e){let r;const t=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)r=new Date(e);else{if(h&&(e instanceof Blob||n)||!t&&!v(e))return e;if(r=t?[]:{},t||(e=>{const r=e.constructor&&e.constructor.prototype;return v(r)&&r.hasOwnProperty("isPrototypeOf")})(e))for(const t in e)e.hasOwnProperty(t)&&(r[t]=y(e[t]));else r=e}return r}var g=e=>/^\w*$/.test(e),_=e=>void 0===e,x=e=>{return r=e.replace(/["|']|\]/g,"").split(/\.|\[/),Array.isArray(r)?r.filter(Boolean):[];var r},z=(e,r,t)=>{if(!r||!v(e))return t;const n=(g(r)?[r]:x(r)).reduce((e,r)=>p(e)?e:e[r],e);return _(n)||n===e?_(e[r])?t:e[r]:n},V=e=>"boolean"==typeof e,j=(e,r,t)=>{let n=-1;const a=g(r)?[r]:x(r),i=a.length,s=i-1;for(;++n<i;){const r=a[n];let i=t;if(n!==s){const t=e[r];i=v(t)||Array.isArray(t)?t:isNaN(+a[n+1])?{}:[]}if("__proto__"===r||"constructor"===r||"prototype"===r)return;e[r]=i,e=e[r]}};const S="blur",k="change",w="all",N=a.createContext(null);N.displayName="HookFormContext";const F=()=>a.useContext(N);const P="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;function A(e){const r=F(),{control:t=r.control,disabled:n,name:i,exact:s}=e||{},[o,l]=a.useState(t._formState),u=a.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return P(()=>t._subscribe({name:i,formState:u.current,exact:s,callback:e=>{!n&&l({...t._formState,...e})}}),[i,n,s]),a.useEffect(()=>{u.current.isValid&&t._setValid(!0)},[t]),a.useMemo(()=>((e,r,t,n=!0)=>{const a={defaultValues:r._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const a=i;return r._proxyFormState[a]!==w&&(r._proxyFormState[a]=!n||w),t&&(t[a]=!0),e[a]}});return a})(o,t,u.current,!1),[o,t])}function C(e){const r=F(),{control:t=r.control,name:n,defaultValue:i,disabled:s,exact:o}=e||{},l=a.useRef(i),[u,c]=a.useState(t._getWatch(n,l.current));return P(()=>t._subscribe({name:n,formState:{values:!0},exact:o,callback:e=>!s&&c(((e,r,t,n,a)=>"string"==typeof e?(n&&r.watch.add(e),z(t,e,a)):Array.isArray(e)?e.map(e=>(n&&r.watch.add(e),z(t,e))):(n&&(r.watchAll=!0),t))(n,t._names,e.values||t._formValues,!1,l.current))}),[n,t,s,o]),a.useEffect(()=>t._removeUnmounted()),u}const D=e=>e.render(function(e){const r=F(),{name:t,disabled:n,control:i=r.control,shouldUnregister:s}=e,o=((e,r)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(r)))(i._names.array,t),l=C({control:i,name:t,defaultValue:z(i._formValues,t,z(i._defaultValues,t,e.defaultValue)),exact:!0}),u=A({control:i,name:t,exact:!0}),c=a.useRef(e),d=a.useRef(i.register(t,{...e.rules,value:l,...V(e.disabled)?{disabled:e.disabled}:{}})),m=a.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!z(u.errors,t)},isDirty:{enumerable:!0,get:()=>!!z(u.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!z(u.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!z(u.validatingFields,t)},error:{enumerable:!0,get:()=>z(u.errors,t)}}),[u,t]),f=a.useCallback(e=>d.current.onChange({target:{value:b(e),name:t},type:k}),[t]),p=a.useCallback(()=>d.current.onBlur({target:{value:z(i._formValues,t),name:t},type:S}),[t,i._formValues]),v=a.useCallback(e=>{const r=z(i._fields,t);r&&e&&(r._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:r=>e.setCustomValidity(r),reportValidity:()=>e.reportValidity()})},[i._fields,t]),h=a.useMemo(()=>({name:t,value:l,...V(n)||u.disabled?{disabled:u.disabled||n}:{},onChange:f,onBlur:p,ref:v}),[t,n,u.disabled,f,p,v,l]);return a.useEffect(()=>{const e=i._options.shouldUnregister||s;i.register(t,{...c.current.rules,...V(c.current.disabled)?{disabled:c.current.disabled}:{}});const r=(e,r)=>{const t=z(i._fields,e);t&&t._f&&(t._f.mount=r)};if(r(t,!0),e){const e=y(z(i._options.defaultValues,t));j(i._defaultValues,t,e),_(z(i._formValues,t))&&j(i._formValues,t,e)}return!o&&i.register(t),()=>{(o?e&&!i._state.action:e)?i.unregister(t):r(t,!1)}},[t,i,o,s]),a.useEffect(()=>{i._setDisabledField({disabled:n,name:t})},[n,t,i]),a.useMemo(()=>({field:h,formState:u,fieldState:m}),[h,u,m])}(e));var E=function(n){var a=n.schema,p=n.form,v=n.layout,b=void 0===v?"vertical":v,h=n.columns,y=void 0===h?2:h,g=n.className,_=n.showSubmitButton,x=void 0!==_&&_,z=n.onSubmit,V=p.control,j=p.handleSubmit,S=p.watch,k=p.formState.errors,w=S(),N="grid"===b?"zui:grid zui:grid-cols-12 zui:gap-3 zui:items-baseline":"zui:flex zui:flex-col zui:gap-3";return r("form",{onSubmit:z?j(z):void 0,className:i(N,g),children:[a.map(function(n){var a,m=n.name,p=n.label,v=n.type,h=n.placeholder,g=n.required,_=n.options,x=n.component,z=n.colSpan,j=n.inputProps,S=n.controllerProps;if(!(!n.visibleIf||n.visibleIf(w)))return null;var N=null!=z?z:Math.floor(12/y),F="grid"===b?{1:"zui:col-span-1",2:"zui:col-span-2",3:"zui:col-span-3",4:"zui:col-span-4",5:"zui:col-span-5",6:"zui:col-span-6",7:"zui:col-span-7",8:"zui:col-span-8",9:"zui:col-span-9",10:"zui:col-span-10",11:"zui:col-span-11",12:"zui:col-span-12"}[N]:void 0,P={label:p,placeholder:h,required:g,options:_},A=e({required:null!=g?g:null===(a=n.validation)||void 0===a?void 0:a.required},n.validation),C=null!=j?j:{},E=null!=S?S:{},M=function(){var e;return(null==k?void 0:k[m])?t("p",{className:"zui:text-red-600 zui:text-xs",children:null===(e=k[m])||void 0===e?void 0:e.message}):null};switch(v){case"text":case"number":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(s,e({},n,{type:"number"===v?"number":"text"},P,C))}})),M()]},m);case"textarea":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(s,e({},n,P,C,{type:"textarea"}))}})),M()]},m);case"select":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(o,e({},n,P,C))}})),M()]},m);case"multiselect":case"multi-select":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(o,e({},n,P,C,{isMulti:!0}))}})),M()]},m);case"radio":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(d,e({},n,P,C))}})),M()]},m);case"switch":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(c,e({},n,P,C))}})),M()]},m);case"timepicker":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(f,e({},n,P,C))}})),M()]},m);case"date":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(l,e({},n,P,C))}})),M()]},m);case"daterange":return r("div",{className:i(F),children:[t(D,e({name:m,control:V,rules:A},E,{render:function(r){var n=r.field;return t(u,e({},n,P,C))}})),M()]},m);case"custom":return t("div",{className:i(F),children:x||null},m);default:return null}}),x&&t("div",{className:"zui:col-span-12",children:t(m,{type:"submit",children:"Submit"})})]})};export{E as Form,E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,a as t,_ as e}from"../../chunks/tslib.es6-b7083bd5.esm.js";import{jsx as n,jsxs as o,Fragment as i}from"react/jsx-runtime";import*as a from"react";import u,{Fragment as c,useState as l,useMemo as s,useRef as f,useEffect as h,createContext as d,useContext as p}from"react";import{Box as v,List as y,ListItemButton as m,ListItemIcon as g,ListItemText as b,CircularProgress as w,Slide as x,Dialog as E,DialogTitle as k,Divider as z,DialogContent as j,DialogActions as P}from"@mui/material";import{b as A,S as O}from"../../chunks/lucide-232cb488.esm.js";import{T as _}from"../../chunks/Text-cc8d79c4.esm.js";import{Input as C}from"../Input/index.esm.js";import"../../chunks/index-a1978735.esm.js";var T="open",N="exit",S=function(r){var t=tr(),e=r.list,i=void 0===e?[]:e,a=r.history,u=null==t?void 0:t.handleClose;return n(v,{p:1,children:n(y,{disablePadding:!0,component:"nav","aria-label":"menu list box",children:i.map(function(r){return o(m,{onClick:function(){return t=r.url,null==a||a.push(t),void("function"==typeof u&&u());var t},sx:{fontFamily:"sans-serif",fontSize:14,background:"rgba(246, 247, 248, 0.4)",mt:1,minHeight:48,border:"1px solid rgba(232, 234, 238, 0.5)",borderRadius:1,":hover":{background:"#ebf5ff",borderColor:"#66b2ff",color:"#66b2ff"}},children:[n(g,{sx:{minWidth:"auto",color:"inherit"},children:n(A,{size:24})}),n(b,{primaryTypographyProps:{sx:{textTransform:"capitalize"},component:"div",variant:"body1",fontSize:14,fontWeight:500,lineHeight:.85},secondaryTypographyProps:{component:"div",variant:"body1",fontSize:12},sx:{ml:1},primary:r.name||"-",secondary:r.custom_path})]})})})})},F=function(r){return"function"==typeof r.children?u.createElement(c,null,r.children()):u.createElement(c,null,r.children||null)},I=function(r){return F(r)},G=function(r){return F(r)};function R(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function D(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(r){R(i,n,o,a,u,"next",r)}function u(r){R(i,n,o,a,u,"throw",r)}a(void 0)})}}function L(){return L=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},L.apply(null,arguments)}function W(){W=function(){return t};var r,t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(r,t,e,n){return Object.defineProperty(r,t,{value:e,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(r){c=function(r,t,e){return r[t]=e}}function l(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype);return c(a,"_invoke",function(t,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=s(t,e,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(t,n,new z(o||[])),!0),a}function s(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var v={};c(v,i,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(j([])));m&&m!==e&&n.call(m,i)&&(v=m);var g=p.prototype=h.prototype=Object.create(v);function b(r){["next","throw","return"].forEach(function(t){c(r,t,function(r){return this._invoke(t,r)})})}function w(r,t){function e(o,i,a,u){var c=s(r[o],r,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(r){e("next",r,a,u)},function(r){e("throw",r,a,u)}):t.resolve(f).then(function(r){l.value=r,a(l)},function(r){return e("throw",r,a,u)})}u(c.arg)}var o;c(this,"_invoke",function(r,n){function i(){return new t(function(t,o){e(r,n,t,o)})}return o=o?o.then(i,i):i()},!0)}function x(t,e){var n=e.method,o=t.i[n];if(o===r)return e.delegate=null,"throw"===n&&t.i.return&&(e.method="return",e.arg=r,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=s(o,t.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.r]=a.value,e.next=t.n,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(r){this.tryEntries.push(r)}function k(t){var e=t[4]||{};e.type="normal",e.arg=r,t[4]=e}function z(r){this.tryEntries=[[-1]],r.forEach(E,this),this.reset(!0)}function j(t){if(null!=t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return d.prototype=p,c(g,"constructor",p),c(p,"constructor",d),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,p):(r.__proto__=p,c(r,u,"GeneratorFunction")),r.prototype=Object.create(g),r},t.awrap=function(r){return{__await:r}},b(w.prototype),c(w.prototype,a,function(){return this}),t.AsyncIterator=w,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new w(l(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(r){return r.done?r.value:a.next()})},b(g),c(g,u,"Generator"),c(g,i,function(){return this}),c(g,"toString",function(){return"[object Generator]"}),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.unshift(n);return function r(){for(;e.length;)if((n=e.pop())in t)return r.value=n,r.done=!1,r;return r.done=!0,r}},t.values=j,z.prototype={constructor:z,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0][4];if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r){a.type="throw",a.arg=t,e.next=r}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=r,n(c),!0;if(u<l)return n(l),!1}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===r||"continue"===r)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=r,i.arg=t,o?(this.method="next",this.next=o[2],f):this.complete(i)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),f},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[2]===r)return this.complete(e[4],e[3]),k(e),f}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[0]===r){var n=e[4];if("throw"===n.type){var o=n.arg;k(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={i:j(t),r:e,n:n},"next"===this.method&&(this.arg=r),f}},t}var H=function(r){return F(r)};function K(r){return"function"==typeof r}function q(r){return"object"==typeof r&&null!==r&&(r instanceof Promise||r!==Promise.prototype&&function(r){return Reflect.has(r,"then")&&K(r.then)}(r)&&function(r){return Reflect.has(r,"catch")&&K(r.catch)}(r))}var B=function(r,t){void 0===t&&(t=[]);var e=f(!1),n=f([]);if("function"!=typeof r)throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '"+typeof r+"'.");if(!Array.isArray(t))throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '"+typeof t+"'.");if(Array.isArray(t)&&t.length>0){if(!function(r,t){if(!Array.isArray(r)||!Array.isArray(t))throw new Error("shallowArraysEqual only accepts arrays as parameters");if(r.length!==t.length)return!1;for(var e=0;e<r.length;++e)if(r[e]!==t[e])return!1;return!0}(n.current,t))n.current=t;else if(e.current)return}else if(e.current)return;r(),e.current=!0};function M(r){var t=r.promise,e=r.keepAlive,n=void 0!==e&&e,o=r.children,i=l(null),u=i[0],d=i[1],p=l(null),v=p[0],y=p[1],m=s(function(){return function(r){if(!q(r))throw new Error("Argument of createCancellablePromise should be a Promise");var t={value:!1},e=new Promise(function(){var e=D(W().mark(function e(n,o){var i;return W().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r;case 3:i=e.sent,t.value||n(i),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t.value||o(e.t0);case 10:case"end":return e.stop()}},e,null,[[0,7]])}));return function(r,t){return e.apply(this,arguments)}}());return Object.keys(r).forEach(function(t){e[t]=r[t]}),{promise:e,cancel:function(){t.value=!0}}}(t)},[t]),g=f([]);if(h(function(){return function(){n||m.cancel()}},[m,m.promise,n]),B(D(W().mark(function r(){var t;return W().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return d(null),y(null),r.prev=2,r.next=5,m.promise;case 5:t=r.sent,y(t),d(!0),g.current.push(m),r.next=16;break;case 11:r.prev=11,r.t0=r.catch(2),y(r.t0),d(!1),g.current.push(m);case 16:case"end":return r.stop()}},r,null,[[2,11]])})),[m.promise]),!o||!q(t))return null;if(null===u){var b=a.Children.toArray(o).find(function(r){return r.type===G});return a.createElement(c,null,b||null)}if(!u){var w=a.Children.toArray(o).find(function(r){return r.type===I});if(!w)return a.createElement(c,null,null);var x=w,E=w.props;return"function"==typeof E.children&&(x=L({},w,{props:L({},E,{children:function(){return E.children(v,g.current,m.promise)}})})),a.createElement(c,null,x)}var k=a.Children.toArray(o).find(function(r){return r.type===H});if(!k)return a.createElement(c,null,null);var z=k,j=k.props;return"function"==typeof j.children&&(z=L({},k,{props:L({},j,{children:function(){return j.children(v,g.current,m.promise)}})})),a.createElement(c,null,z)}var V=function(r){var t=r.condition,e=r.keepAlive,n=void 0!==e&&e,o=r.children;if(!o)return null;if(function(r,t){if("production"!==process.env.NODE_ENV&&r){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}(!Array.isArray(o)&&!(o.type===I||o.type===H)||!u.Children.toArray(o).every(function(r){return r.type===I||r.type===H||r.type===G}),"The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children"),q(t))return u.createElement(M,{promise:t,keepAlive:n},o);var i=function(r){return Boolean("function"==typeof r?r():r)}(t);return u.createElement(c,null,u.Children.toArray(o).find(function(r){return r.type!==I!=!i})||null)};function Y(e,n){return void 0===n&&(n=[]),e.flatMap(function(e){var o=r(r([],n,!0),[e.name],!1);if(e.children&&e.children.length>0)return Y(e.children,o);var i=t(t({},e),{custom_path:o.join(" / ")});return delete i.children,[i]})}var J=function(r){return(null==r?void 0:r.trim().toLowerCase())||""},Q=function(r){var e=r.sx;return o(v,{sx:t({display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center",background:"#f4f4f4",color:"gray"},e),children:[n(O,{size:40}),n(_,{size:"sm",children:"No results found based on search"})]})};function U(r){var e=r.children,o=r.loading,a=r.list,u={display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center"};return o?n(v,{sx:u,children:n(w,{thickness:2})}):0===(null==a?void 0:a.length)?n(Q,{sx:t(t({},u),{background:"#f4f4f4",color:"gray"})}):n(i,{children:e})}var X=function(r){var t=r.list,e=void 0===t?[]:t,i=r.delay,a=void 0===i?1e3:i,c=r.popInputPlaceholder,f=void 0===c?"Search...":c,d=r.history,p=l(""),v=p[0],y=p[1],m=l([]),g=m[0],b=m[1],w=l(!1),x=w[0],E=w[1],A=function(r){var t=[],n=J(r);t=n?e.filter(function(r){return J(r.name).includes(n)}):e,b(t),E(!1)},O=s(function(){return function(r,t){var e;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];clearTimeout(e),e=setTimeout(function(){r.apply(void 0,n)},t)}}(A,a)},[]);h(function(){E(!0),O(v)},[v,O]);return o(u.Fragment,{children:[n(k,{classes:{root:"zui:!p-1"},component:"div",color:"primary",className:"font-semibold flex items-center",children:n(Z,{kbdType:"exit",variant:"outlined",inputProps:{className:"zui:!mb-0 zui:!text-sm",placeholder:f,value:v,onChange:function(r){var t=r.target.value;y(t)}}})}),n(z,{}),n(j,{classes:{root:"zui:!p-0"},children:n(U,{loading:x,list:g,children:n(S,{list:g,history:d})})}),n(z,{}),n(P,{children:o("div",{className:"zui:flex zui:flex-row zui:gap-0.5 zui:items-center",children:[n(_,{size:"sm",children:"Search by :"}),n("img",{loading:"lazy",className:"org_logo",src:"https://files.zimyo.work/staticlogo/global/zimyo.svg",width:85})]})})]})},Z=function(r){var e=r.variant,i=void 0===e?"contained":e,a=r.inputProps,u=r.kbdType,c=void 0===u?T:u;return n(C,t({leftIcon:n(O,{size:16}),rightIcon:o(V,{condition:c===N,children:[n(H,{children:n("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:"Esc"})}),n(I,{children:o("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:[n("span",{children:"⌘"}),n("span",{children:"+"}),n("span",{children:"K"})]})})]})},a,{focusOutline:!1,autoFocus:c===N,variant:i}))},$=u.forwardRef(function(r,e){return n(x,t({direction:"up",ref:e},r))}),rr=d(null),tr=function(){return p(rr)},er=function(r){var i=r.list,a=void 0===i?[]:i,c=e(r,["list"]),f=s(function(){return Y(a)},[a]),d=l(!1),p=d[0],v=d[1];h(function(){var r=function(r){r.ctrlKey&&"k"===r.key.toLowerCase()&&(r.preventDefault(),v(!0))};return window.addEventListener("keydown",r),function(){return window.removeEventListener("keydown",r)}},[]);var y=function(){v(!1)};return n(u.Fragment,{children:o(rr.Provider,{value:{handleClose:y},children:[n("div",{className:"global-search-container",onClick:function(){return v(!0)},children:n(Z,{kbdType:"open",inputProps:{placeholder:c.placeholder||"Search...",readOnly:!0,className:"zui:rounded-full"},variant:"contained"})}),n(E,{open:p,TransitionComponent:$,onClose:y,maxWidth:"md",slotProps:{backdrop:{style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}},PaperProps:{sx:{width:620,height:550,borderRadius:2}},"aria-describedby":"alert-dialog-slide-description",children:n(X,t({list:f},c))})]})})};export{er as GlobalMenuSearch,er as default};
|
|
1
|
+
import{b as r,a as t,_ as e}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as n,jsxs as o,Fragment as i}from"react/jsx-runtime";import*as a from"react";import u,{Fragment as c,useState as l,useMemo as s,useRef as f,useEffect as h,createContext as d,useContext as p}from"react";import{Box as v,List as y,ListItemButton as m,ListItemIcon as g,ListItemText as b,CircularProgress as w,Slide as x,Dialog as E,DialogTitle as k,Divider as z,DialogContent as j,DialogActions as P}from"@mui/material";import{b as A,S as O}from"../../chunks/lucide-2a18f5d4.esm.js";import{T as _}from"../../chunks/Text-f18219bd.esm.js";import{Input as C}from"../Input/index.esm.js";import"../../chunks/index-c6541658.esm.js";var T="open",N="exit",S=function(r){var t=tr(),e=r.list,i=void 0===e?[]:e,a=r.history,u=null==t?void 0:t.handleClose;return n(v,{p:1,children:n(y,{disablePadding:!0,component:"nav","aria-label":"menu list box",children:i.map(function(r){return o(m,{onClick:function(){return t=r.url,null==a||a.push(t),void("function"==typeof u&&u());var t},sx:{fontFamily:"sans-serif",fontSize:14,background:"rgba(246, 247, 248, 0.4)",mt:1,minHeight:48,border:"1px solid rgba(232, 234, 238, 0.5)",borderRadius:1,":hover":{background:"#ebf5ff",borderColor:"#66b2ff",color:"#66b2ff"}},children:[n(g,{sx:{minWidth:"auto",color:"inherit"},children:n(A,{size:24})}),n(b,{primaryTypographyProps:{sx:{textTransform:"capitalize"},component:"div",variant:"body1",fontSize:14,fontWeight:500,lineHeight:.85},secondaryTypographyProps:{component:"div",variant:"body1",fontSize:12},sx:{ml:1},primary:r.name||"-",secondary:r.custom_path})]})})})})},F=function(r){return"function"==typeof r.children?u.createElement(c,null,r.children()):u.createElement(c,null,r.children||null)},I=function(r){return F(r)},G=function(r){return F(r)};function R(r,t,e,n,o,i,a){try{var u=r[i](a),c=u.value}catch(r){return void e(r)}u.done?t(c):Promise.resolve(c).then(n,o)}function D(r){return function(){var t=this,e=arguments;return new Promise(function(n,o){var i=r.apply(t,e);function a(r){R(i,n,o,a,u,"next",r)}function u(r){R(i,n,o,a,u,"throw",r)}a(void 0)})}}function L(){return L=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)({}).hasOwnProperty.call(e,n)&&(r[n]=e[n])}return r},L.apply(null,arguments)}function W(){W=function(){return t};var r,t={},e=Object.prototype,n=e.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(r,t,e,n){return Object.defineProperty(r,t,{value:e,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(r){c=function(r,t,e){return r[t]=e}}function l(t,e,n,o){var i=e&&e.prototype instanceof h?e:h,a=Object.create(i.prototype);return c(a,"_invoke",function(t,e,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:r,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var c=x(u,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=s(t,e,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(t,n,new z(o||[])),!0),a}function s(r,t,e){try{return{type:"normal",arg:r.call(t,e)}}catch(r){return{type:"throw",arg:r}}}t.wrap=l;var f={};function h(){}function d(){}function p(){}var v={};c(v,i,function(){return this});var y=Object.getPrototypeOf,m=y&&y(y(j([])));m&&m!==e&&n.call(m,i)&&(v=m);var g=p.prototype=h.prototype=Object.create(v);function b(r){["next","throw","return"].forEach(function(t){c(r,t,function(r){return this._invoke(t,r)})})}function w(r,t){function e(o,i,a,u){var c=s(r[o],r,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&n.call(f,"__await")?t.resolve(f.__await).then(function(r){e("next",r,a,u)},function(r){e("throw",r,a,u)}):t.resolve(f).then(function(r){l.value=r,a(l)},function(r){return e("throw",r,a,u)})}u(c.arg)}var o;c(this,"_invoke",function(r,n){function i(){return new t(function(t,o){e(r,n,t,o)})}return o=o?o.then(i,i):i()},!0)}function x(t,e){var n=e.method,o=t.i[n];if(o===r)return e.delegate=null,"throw"===n&&t.i.return&&(e.method="return",e.arg=r,x(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=s(o,t.i,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.r]=a.value,e.next=t.n,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function E(r){this.tryEntries.push(r)}function k(t){var e=t[4]||{};e.type="normal",e.arg=r,t[4]=e}function z(r){this.tryEntries=[[-1]],r.forEach(E,this),this.reset(!0)}function j(t){if(null!=t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function e(){for(;++o<t.length;)if(n.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return a.next=a}}throw new TypeError(typeof t+" is not iterable")}return d.prototype=p,c(g,"constructor",p),c(p,"constructor",d),d.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(r){var t="function"==typeof r&&r.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,p):(r.__proto__=p,c(r,u,"GeneratorFunction")),r.prototype=Object.create(g),r},t.awrap=function(r){return{__await:r}},b(w.prototype),c(w.prototype,a,function(){return this}),t.AsyncIterator=w,t.async=function(r,e,n,o,i){void 0===i&&(i=Promise);var a=new w(l(r,e,n,o),i);return t.isGeneratorFunction(e)?a:a.next().then(function(r){return r.done?r.value:a.next()})},b(g),c(g,u,"Generator"),c(g,i,function(){return this}),c(g,"toString",function(){return"[object Generator]"}),t.keys=function(r){var t=Object(r),e=[];for(var n in t)e.unshift(n);return function r(){for(;e.length;)if((n=e.pop())in t)return r.value=n,r.done=!1,r;return r.done=!0,r}},t.values=j,z.prototype={constructor:z,reset:function(t){if(this.prev=this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var r=this.tryEntries[0][4];if("throw"===r.type)throw r.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r){a.type="throw",a.arg=t,e.next=r}for(var o=e.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],u=this.prev,c=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!c&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=u){if(u<c)return this.method="next",this.arg=r,n(c),!0;if(u<l)return n(l),!1}}},abrupt:function(r,t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===r||"continue"===r)&&o[0]<=t&&t<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=r,i.arg=t,o?(this.method="next",this.next=o[2],f):this.complete(i)},complete:function(r,t){if("throw"===r.type)throw r.arg;return"break"===r.type||"continue"===r.type?this.next=r.arg:"return"===r.type?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):"normal"===r.type&&t&&(this.next=t),f},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[2]===r)return this.complete(e[4],e[3]),k(e),f}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var e=this.tryEntries[t];if(e[0]===r){var n=e[4];if("throw"===n.type){var o=n.arg;k(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={i:j(t),r:e,n:n},"next"===this.method&&(this.arg=r),f}},t}var H=function(r){return F(r)};function K(r){return"function"==typeof r}function q(r){return"object"==typeof r&&null!==r&&(r instanceof Promise||r!==Promise.prototype&&function(r){return Reflect.has(r,"then")&&K(r.then)}(r)&&function(r){return Reflect.has(r,"catch")&&K(r.catch)}(r))}var B=function(r,t){void 0===t&&(t=[]);var e=f(!1),n=f([]);if("function"!=typeof r)throw new Error("Incorrect callback parameter for useSingleton hook; expected a function, but got: '"+typeof r+"'.");if(!Array.isArray(t))throw new Error("Incorrect dependencies parameter for useSingleton; expected an array, but got: '"+typeof t+"'.");if(Array.isArray(t)&&t.length>0){if(!function(r,t){if(!Array.isArray(r)||!Array.isArray(t))throw new Error("shallowArraysEqual only accepts arrays as parameters");if(r.length!==t.length)return!1;for(var e=0;e<r.length;++e)if(r[e]!==t[e])return!1;return!0}(n.current,t))n.current=t;else if(e.current)return}else if(e.current)return;r(),e.current=!0};function M(r){var t=r.promise,e=r.keepAlive,n=void 0!==e&&e,o=r.children,i=l(null),u=i[0],d=i[1],p=l(null),v=p[0],y=p[1],m=s(function(){return function(r){if(!q(r))throw new Error("Argument of createCancellablePromise should be a Promise");var t={value:!1},e=new Promise(function(){var e=D(W().mark(function e(n,o){var i;return W().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r;case 3:i=e.sent,t.value||n(i),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t.value||o(e.t0);case 10:case"end":return e.stop()}},e,null,[[0,7]])}));return function(r,t){return e.apply(this,arguments)}}());return Object.keys(r).forEach(function(t){e[t]=r[t]}),{promise:e,cancel:function(){t.value=!0}}}(t)},[t]),g=f([]);if(h(function(){return function(){n||m.cancel()}},[m,m.promise,n]),B(D(W().mark(function r(){var t;return W().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return d(null),y(null),r.prev=2,r.next=5,m.promise;case 5:t=r.sent,y(t),d(!0),g.current.push(m),r.next=16;break;case 11:r.prev=11,r.t0=r.catch(2),y(r.t0),d(!1),g.current.push(m);case 16:case"end":return r.stop()}},r,null,[[2,11]])})),[m.promise]),!o||!q(t))return null;if(null===u){var b=a.Children.toArray(o).find(function(r){return r.type===G});return a.createElement(c,null,b||null)}if(!u){var w=a.Children.toArray(o).find(function(r){return r.type===I});if(!w)return a.createElement(c,null,null);var x=w,E=w.props;return"function"==typeof E.children&&(x=L({},w,{props:L({},E,{children:function(){return E.children(v,g.current,m.promise)}})})),a.createElement(c,null,x)}var k=a.Children.toArray(o).find(function(r){return r.type===H});if(!k)return a.createElement(c,null,null);var z=k,j=k.props;return"function"==typeof j.children&&(z=L({},k,{props:L({},j,{children:function(){return j.children(v,g.current,m.promise)}})})),a.createElement(c,null,z)}var V=function(r){var t=r.condition,e=r.keepAlive,n=void 0!==e&&e,o=r.children;if(!o)return null;if(function(r,t){if("production"!==process.env.NODE_ENV&&r){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(r){}}}(!Array.isArray(o)&&!(o.type===I||o.type===H)||!u.Children.toArray(o).every(function(r){return r.type===I||r.type===H||r.type===G}),"The <If> component should contain <Then /> <Else /> or <Fallback /> components as its children"),q(t))return u.createElement(M,{promise:t,keepAlive:n},o);var i=function(r){return Boolean("function"==typeof r?r():r)}(t);return u.createElement(c,null,u.Children.toArray(o).find(function(r){return r.type!==I!=!i})||null)};function Y(e,n){return void 0===n&&(n=[]),e.flatMap(function(e){var o=r(r([],n,!0),[e.name],!1);if(e.children&&e.children.length>0)return Y(e.children,o);var i=t(t({},e),{custom_path:o.join(" / ")});return delete i.children,[i]})}var J=function(r){return(null==r?void 0:r.trim().toLowerCase())||""},Q=function(r){var e=r.sx;return o(v,{sx:t({display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center",background:"#f4f4f4",color:"gray"},e),children:[n(O,{size:40}),n(_,{size:"sm",children:"No results found based on search"})]})};function U(r){var e=r.children,o=r.loading,a=r.list,u={display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center"};return o?n(v,{sx:u,children:n(w,{thickness:2})}):0===(null==a?void 0:a.length)?n(Q,{sx:t(t({},u),{background:"#f4f4f4",color:"gray"})}):n(i,{children:e})}var X=function(r){var t=r.list,e=void 0===t?[]:t,i=r.delay,a=void 0===i?1e3:i,c=r.popInputPlaceholder,f=void 0===c?"Search...":c,d=r.history,p=l(""),v=p[0],y=p[1],m=l([]),g=m[0],b=m[1],w=l(!1),x=w[0],E=w[1],A=function(r){var t=[],n=J(r);t=n?e.filter(function(r){return J(r.name).includes(n)}):e,b(t),E(!1)},O=s(function(){return function(r,t){var e;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];clearTimeout(e),e=setTimeout(function(){r.apply(void 0,n)},t)}}(A,a)},[]);h(function(){E(!0),O(v)},[v,O]);return o(u.Fragment,{children:[n(k,{classes:{root:"zui:!p-1"},component:"div",color:"primary",className:"font-semibold flex items-center",children:n(Z,{kbdType:"exit",variant:"outlined",inputProps:{className:"zui:!mb-0 zui:!text-sm",placeholder:f,value:v,onChange:function(r){var t=r.target.value;y(t)}}})}),n(z,{}),n(j,{classes:{root:"zui:!p-0"},children:n(U,{loading:x,list:g,children:n(S,{list:g,history:d})})}),n(z,{}),n(P,{children:o("div",{className:"zui:flex zui:flex-row zui:gap-0.5 zui:items-center",children:[n(_,{size:"sm",children:"Search by :"}),n("img",{loading:"lazy",className:"org_logo",src:"https://files.zimyo.work/staticlogo/global/zimyo.svg",width:85})]})})]})},Z=function(r){var e=r.variant,i=void 0===e?"contained":e,a=r.inputProps,u=r.kbdType,c=void 0===u?T:u;return n(C,t({leftIcon:n(O,{size:16}),rightIcon:o(V,{condition:c===N,children:[n(H,{children:n("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:"Esc"})}),n(I,{children:o("kbd",{className:"zui:px-2 zui:py-1 zui:border zui:border-gray-200 zui:rounded zui:bg-gray-200",children:[n("span",{children:"⌘"}),n("span",{children:"+"}),n("span",{children:"K"})]})})]})},a,{focusOutline:!1,autoFocus:c===N,variant:i}))},$=u.forwardRef(function(r,e){return n(x,t({direction:"up",ref:e},r))}),rr=d(null),tr=function(){return p(rr)},er=function(r){var i=r.list,a=void 0===i?[]:i,c=e(r,["list"]),f=s(function(){return Y(a)},[a]),d=l(!1),p=d[0],v=d[1];h(function(){var r=function(r){r.ctrlKey&&"k"===r.key.toLowerCase()&&(r.preventDefault(),v(!0))};return window.addEventListener("keydown",r),function(){return window.removeEventListener("keydown",r)}},[]);var y=function(){v(!1)};return n(u.Fragment,{children:o(rr.Provider,{value:{handleClose:y},children:[n("div",{className:"global-search-container",onClick:function(){return v(!0)},children:n(Z,{kbdType:"open",inputProps:{placeholder:c.placeholder||"Search...",readOnly:!0,className:"zui:rounded-full"},variant:"contained"})}),n(E,{open:p,TransitionComponent:$,onClose:y,maxWidth:"md",slotProps:{backdrop:{style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(4px)"}}},PaperProps:{sx:{width:620,height:550,borderRadius:2}},"aria-describedby":"alert-dialog-slide-description",children:n(X,t({list:f},c))})]})})};export{er as GlobalMenuSearch,er as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as i}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as e,a as i}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as u,jsx as t}from"react/jsx-runtime";import*as n from"react";import{u as r,c as o}from"../../chunks/index-c6541658.esm.js";import{E as l,e as a}from"../../chunks/lucide-2a18f5d4.esm.js";var s={xs:"zui:h-8 zui:text-xs",sm:"zui:h-9 zui:text-sm",md:"zui:h-10 zui:text-sm",lg:"zui:h-11 zui:text-base"},c={xs:"zui:py-1.5",sm:"zui:py-2",md:"zui:py-2",lg:"zui:py-2.5"},d={xs:"zui:px-2",sm:"zui:px-2.5",md:"zui:px-3",lg:"zui:px-3.5"},z={xs:"zui:pl-8",sm:"zui:pl-9",md:"zui:pl-10",lg:"zui:pl-11"},f={xs:"zui:pr-8",sm:"zui:pr-9",md:"zui:pr-10",lg:"zui:pr-11"},m=n.forwardRef(function(m,p){var x,b=m.label,h=m.floatingLabel,g=void 0!==h&&h,v=m.description,w=m.error,y=m.leftIcon,N=m.rightIcon,I=m.size,k=void 0===I?"md":I,C=m.variant,j=void 0===C?"outlined":C,B=m.className,L=m.allowedPattern,D=m.onBeforeInput,R=m.onChange,S=m.onDebouncedChange,E=m.debounceDelay,T=m.type,O=void 0===T?"text":T,P=m.onLeftIconClick,$=m.onRightIconClick,q=m.wordLimit,A=m.focusOutline,F=void 0===A||A,H=e(m,["label","floatingLabel","description","error","leftIcon","rightIcon","size","variant","className","allowedPattern","onBeforeInput","onChange","onDebouncedChange","debounceDelay","type","onLeftIconClick","onRightIconClick","wordLimit","focusOutline"]),Z=r("input"),_=n.useState(!1),G=_[0],J=_[1],K=n.useState(null!==(x=H.value)&&void 0!==x?x:""),M=K[0],Q=K[1],U=n.useRef(null),V="textarea"===O,W="password"===O,X=W&&G?"text":O,Y=V?String(M||"").trim().split(/\s+/).filter(Boolean).length:0;n.useEffect(function(){void 0!==H.value&&Q(H.value)},[H.value]),n.useEffect(function(){if(void 0!==E&&S)return U.current&&clearTimeout(U.current),U.current=setTimeout(function(){S(String(M))},E),function(){U.current&&clearTimeout(U.current)}},[M,E,S]);var ee=function(e){var i="number"===L?/^[0-9]*$/:"alpha"===L?/^[a-zA-Z]*$/:L instanceof RegExp?L:null;if(i){var u=e.data,t=e.currentTarget.value+u;i.test(t)||e.preventDefault(),null==D||D(e)}},ie=function(e){var i=e.target.value;if(q&&V&&i.trim().split(/\s+/).filter(Boolean).length>q)return;Q(i),null==R||R(e)},ue=y?z[k]:"",te=N||W?f[k]:"";return u("div",{className:"zui:w-full",children:[!g&&b&&u("label",{htmlFor:Z,className:"zui:block zui:mb-2 zui:text-sm zui:font-medium zui:leading-none",children:[b,H.required&&t("span",{className:"zui:text-destructive zui:font-medium",children:" *"})]}),u("div",{className:o("zui:relative zui:w-full zui:rounded-md zui:border zui:bg-background zui:text-sm zui:transition-colors",F&&"zui:focus-within:ring-1 zui:focus-within:ring-ring zui:focus-within:ring-offset-1","outlined"===j&&"zui:border-input","contained"===j&&"zui:bg-muted zui:border-transparent",w&&"zui:border-destructive",w&&F&&"zui:focus-within:ring-destructive",B),children:[y&&t("span",{className:o("zui:absolute zui:inset-y-0 zui:left-0 zui:flex zui:items-center zui:text-muted-foreground",d[k]),children:P?t("button",{type:"button",onClick:P,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:y}):y}),V?t("textarea",i({id:Z,ref:p,onBeforeInput:ee,onChange:ie,value:M,placeholder:H.placeholder,disabled:H.disabled,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50 zui:resize-none",c[k],ue,te)},H)):t("input",i({id:Z,ref:p,type:X,onBeforeInput:ee,onChange:ie,value:M,placeholder:H.placeholder,disabled:H.disabled,className:o("zui:peer zui:block zui:w-full zui:bg-transparent zui:outline-none zui:px-3 zui:disabled:cursor-not-allowed zui:disabled:opacity-50",s[k],c[k],ue,te)},H)),(N||W)&&t("span",{className:o("zui:absolute zui:inset-y-0 zui:right-0 zui:flex zui:items-center zui:text-muted-foreground",d[k]),children:W?t("button",{type:"button",onClick:function(){return J(function(e){return!e})},className:"zui:focus:outline-none",tabIndex:-1,"aria-label":G?"Hide password":"Show password",children:t(G?l:a,{size:16})}):$?t("button",{type:"button",onClick:$,className:"zui:cursor-pointer zui:focus:outline-none",tabIndex:-1,children:N}):N})]}),u("div",{className:"zui:flex zui:flex-row zui:justify-between",children:[v&&!w&&t("p",{className:"zui:text-xs zui:text-muted-foreground",children:v}),w&&t("p",{className:"zui:text-xs zui:text-destructive",children:w}),V&&void 0!==q&&u("div",{className:"zui:mt-1 zui:text-xs zui:text-muted-foreground zui:text-right zui:flex zui:justify-end zui:flex-1",children:[Y,"/",q," words"]})]})]})});export{m as Input,m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"../../chunks/tslib.es6-
|
|
1
|
+
import{a as i}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as o from"react";import{Slide as u,useMediaQuery as s,Dialog as t,IconButton as d,DialogContent as a,DialogActions as l}from"@mui/material";import{c as n}from"../../chunks/index-c6541658.esm.js";import{M as m}from"../../chunks/Muted-bfc4985b.esm.js";import{X as c}from"../../chunks/lucide-2a18f5d4.esm.js";var z=o.forwardRef(function(r,o){return e(u,i({direction:"up",ref:o},r))}),f=function(i){var o=i.open,u=i.onClose,f=i.title,p=i.description,h=i.children,b=i.actions,x=i.showCloseIcon,v=void 0===x||x,N=i.maxWidth,w=void 0===N?"sm":N,j=i.fullWidth,k=void 0===j||j,y=i.fullScreen,g=void 0!==y&&y,C=i.allowActionBorder,W=void 0===C||C,M=i.className,P=s("(max-width:600px)");return r(t,{open:o,onClose:u,TransitionComponent:z,maxWidth:w,fullWidth:k,fullScreen:P||g,scroll:"body",PaperProps:{className:n("zui:bg-background zui:rounded-md zui:shadow-lg zui:border zui:border-border",M)},children:[(f||v)&&r("div",{className:"zui:flex zui:items-center zui:justify-between zui:px-4 zui:py-3 zui:border-b zui:border-border",children:[f&&r("div",{className:"zui:p-0 zui:m-0 zui:!text-base zui:font-bold",children:[f,p&&e(m,{component:"div",className:"zui:mt-1.5",children:p})]}),v&&e(d,{onClick:u,size:"small",className:"zui:ml-auto zui:flex zui:text-muted-foreground hover:zui:text-foreground",children:e(c,{className:"zui:w-5 zui:h-5"})})]}),e(a,{className:n("zui:px-5 zui:py-4 zui:overflow-y-auto zui:max-h-[70vh]"),children:h}),b&&e(l,{className:n("zui:px-5 zui:py-3 zui:border-border",W&&"zui:border-t"),children:b})]})};export{f as Modal,f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{c as u}from"../../chunks/index-
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{c as u}from"../../chunks/index-c6541658.esm.js";import{f as r,g as t,T as z,I as s,X as a}from"../../chunks/lucide-2a18f5d4.esm.js";import"react";var o={contained:{success:"zui:bg-green-50 zui:text-green-900 zui:border-green-100",error:"zui:bg-red-50 zui:text-red-900 zui:border-red-100",warning:"zui:bg-yellow-50 zui:text-yellow-900 zui:border-yellow-100",info:"zui:bg-blue-50 zui:text-blue-900 zui:border-blue-100"},outlined:{success:"zui:bg-transparent zui:text-green-700 zui:border zui:border-green-700",error:"zui:bg-transparent zui:text-red-700 zui:border zui:border-red-700",warning:"zui:bg-transparent zui:text-yellow-700 zui:border zui:border-yellow-700",info:"zui:bg-transparent zui:text-blue-700 zui:border zui:border-blue-700"}},l={sm:"zui:text-sm zui:px-3 zui:py-2",md:"zui:text-sm zui:px-4 zui:py-3",lg:"zui:text-base zui:px-5 zui:py-4"},n={success:e(r,{className:"zui:h-5 zui:w-5 zui:text-green-600"}),error:e(t,{className:"zui:h-5 zui:w-5 zui:text-red-600"}),warning:e(z,{className:"zui:h-5 zui:w-5 zui:text-yellow-600"}),info:e(s,{className:"zui:h-5 zui:w-5 zui:text-blue-600"})},d=function(r){var t=r.title,z=r.message,s=r.variant,d=void 0===s?"info":s,c=r.size,m=void 0===c?"md":c,b=r.styleType,x=void 0===b?"contained":b,g=r.onClose,p=r.showCloseIcon,f=void 0===p||p,w=r.className;return i("div",{role:"alert",className:u("zui:relative zui:w-full zui:rounded-md zui:flex zui:items-center zui:gap-3",t&&"zui:items-start",o[x][d],l[m],w),children:[e("div",{className:"zui:pt-0.5",children:n[d]}),i("div",{className:"zui:flex-1",children:[t&&e("p",{className:"zui:font-semibold",children:t}),e("p",{className:"zui:text-sm zui:leading-snug",children:z})]}),f&&e("button",{onClick:g,className:"zui:ml-auto zui:mt-0.5 zui:text-muted-foreground hover:zui:text-foreground",children:e(a,{className:"zui:w-4 zui:h-4"})})]})};export{d as Notice,d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as r,a as i}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as r,a as i}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsx as o}from"react/jsx-runtime";import{Popover as n,Fade as a}from"@mui/material";var t=function(t){var e=t.open,d=t.onClose,s=t.anchorEl,m=t.children,p=t.width,c=t.maxWidth,h=void 0===c?"100%":c,l=t.minWidth,b=t.padding,f=void 0===b?2:b,x=t.border,g=void 0===x||x,u=t.anchorOrigin,v=void 0===u?{vertical:"bottom",horizontal:"left"}:u,O=t.transformOrigin,W=void 0===O?{vertical:"top",horizontal:"left"}:O,w=r(t,["open","onClose","anchorEl","children","width","maxWidth","minWidth","padding","border","anchorOrigin","transformOrigin"]);return o(n,i({open:e,onClose:d,anchorEl:s,anchorOrigin:v,transformOrigin:W,TransitionComponent:a,transitionDuration:180,slotProps:{paper:{sx:{boxShadow:"0px 4px 32px rgba(0,0,0,0.08), 0px 1.5px 6px rgba(0,0,0,0.06)",border:g?"1px solid #e5e7eb":"none",borderRadius:1,background:"#fff",width:p,minWidth:l,maxWidth:h,p:f,transition:"opacity 180ms cubic-bezier(0.4,0,0.2,1), transform 180ms cubic-bezier(0.4,0,0.2,1)",opacity:e?1:0,transform:e?"scale(1)":"scale(0.95)"}}}},w,{children:m}))};export{t as Popover,t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as i}from"../../chunks/tslib.es6-
|
|
1
|
+
import{c as e,d as i}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as r,jsx as o}from"react/jsx-runtime";import{useCallback as n}from"react";import{Modal as t}from"../Modal/index.esm.js";import{Button as u}from"../Button/index.esm.js";import{c}from"../../chunks/index-c6541658.esm.js";import{H as l}from"../../chunks/Heading-b91e2c5f.esm.js";import{T as a}from"../../chunks/Text-f18219bd.esm.js";import"@mui/material";import"../../chunks/Muted-bfc4985b.esm.js";import"../../chunks/lucide-2a18f5d4.esm.js";var s={default:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},delete:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-100 hover:zui:bg-red-200",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-red-700",cancelText:"zui:text-gray-700"},save:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},warning:{iconBg:"zui:bg-amber-50",iconColor:"zui:text-amber-600",confirmBg:"zui:bg-amber-500 hover:zui:bg-amber-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},info:{iconBg:"zui:bg-blue-50",iconColor:"zui:text-blue-600",confirmBg:"zui:bg-blue-500 hover:zui:bg-blue-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},success:{iconBg:"zui:bg-green-50",iconColor:"zui:text-green-600",confirmBg:"zui:bg-green-500 hover:zui:bg-green-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"},error:{iconBg:"zui:bg-red-50",iconColor:"zui:text-red-600",confirmBg:"zui:bg-red-500 hover:zui:bg-red-600",cancelBg:"zui:bg-gray-100 hover:zui:bg-gray-200",confirmText:"zui:text-white",cancelText:"zui:text-gray-700"}},z=function(z){var d=z.open,g=z.onClose,m=z.title,h=void 0===m?"Are you sure?":m,v=z.message,x=z.description,f=z.confirmText,b=void 0===f?"Yes, Delete":f,p=z.cancelText,C=void 0===p?"No, Cancel":p,k=z.confirmVariant,y=z.loading,B=void 0!==y&&y,w=z.icon,N=z.maxWidth,j=void 0===N?"sm":N,T=z.fullWidth,L=void 0!==T&&T,M=z.showCloseIcon,W=void 0===M||M,A=z.onConfirm,H=z.onCancel,V=z.children,I=z.className,R=z.actionsClassName,D=z.messageClassName,Y=z.reverseActions,q=void 0!==Y&&Y,E=z.singleAction,F=void 0!==E&&E,G=z.variant,J=void 0===G?"delete":G,K=n(function(){return e(void 0,void 0,void 0,function(){var e;return i(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,A()];case 1:return i.sent(),[3,3];case 2:return e=i.sent(),console.error("Confirm action failed:",e),[3,3];case 3:return[2]}})})},[A]),O=n(function(){null==H||H(),null==g||g()},[H,g]),P=n(function(){B||g()},[B,g]),Q=s[J],S=r("div",{className:c("zui:flex zui:gap-4 zui:justify-center zui:w-full zui:mt-8 zui:px-6",q&&"zui:flex-row-reverse",R),children:[!F&&o(u,{size:"small",onClick:O,disabled:B,className:c(Q.cancelBg,Q.cancelText),children:C}),o(u,{onClick:K,disabled:B,loading:B,className:c("outlined"===k?"zui:border-2 zui:border-current zui:bg-transparent":Q.confirmBg,"text"===k?"zui:bg-transparent":"",Q.confirmText),children:b})]});return r(t,{open:d,onClose:P,maxWidth:j,fullWidth:L,showCloseIcon:!1,className:c("zui:p-0 zui:m-0 zui:relative",I),children:[W&&o("button",{onClick:P,disabled:B,className:"zui:absolute zui:top-2 zui:right-2 zui:w-8 zui:h-8 zui:bg-gray-100 zui:rounded-full zui:flex zui:items-center zui:justify-center zui:text-gray-500 hover:zui:text-gray-700 hover:zui:bg-gray-200 zui:transition-all zui:duration-200 zui:border-0 zui:cursor-pointer zui:z-10",children:o("svg",{className:"zui:w-4 zui:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})}),r("div",{className:"zui:text-center zui:p-1",children:[o("div",w?{className:"zui:flex zui:justify-center zui:mb-6",children:w}:{className:"zui:flex zui:justify-center zui:mb-6",children:r("div",{className:c("zui:w-12 zui:h-12 zui:rounded-full zui:flex zui:items-center zui:justify-center",Q.iconBg),children:["delete"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"currentColor",viewBox:"0 0 24 24",children:o("path",{fillRule:"evenodd",d:"M16.5 4.478v.227a48.816 48.816 0 013.878.512.75.75 0 11-.256 1.478l-.209-.035-1.005 13.07a3 3 0 01-2.991 2.77H8.084a3 3 0 01-2.991-2.77L4.087 6.66l-.209.035a.75.75 0 01-.256-1.478A48.567 48.567 0 017.5 4.705v-.227c0-1.564 1.213-2.9 2.816-2.951a52.662 52.662 0 013.369 0c1.603.051 2.815 1.387 2.815 2.951zm-6.136-1.452a51.196 51.196 0 013.273 0C14.39 3.05 15 3.684 15 4.478v.113a49.488 49.488 0 00-6 0v-.113c0-.794.609-1.428 1.364-1.452zm-.355 5.945a.75.75 0 10-1.5.058l.347 9a.75.75 0 101.499-.058l-.346-9zm5.48.058a.75.75 0 00-1.498-.058l-.347 9a.75.75 0 001.5.058l.345-9z",clipRule:"evenodd"})}),"save"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"})}),"warning"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),("info"===J||"default"===J)&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"success"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"error"===J&&o("svg",{className:c("zui:w-8 zui:h-8",Q.iconColor),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})]})}),o(l,{level:5,children:h}),o(a,{size:"sm",className:D,children:v}),x&&o(a,{className:"zui:text-sm zui:text-gray-500 zui:mt-1",children:x}),V&&o("div",{className:"zui:mt-6",children:V}),S]})]})};export{z as PopupConfirm,z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as r}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as e,a as r}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as t,jsx as i}from"react/jsx-runtime";import l from"react";import{useTheme as o,FormControl as a,FormLabel as d,Typography as n,FormControlLabel as s,Radio as m,Box as c,FormHelperText as p}from"@mui/material";var x=l.forwardRef(function(l,x){var h=l.label,f=l.description,u=l.name,b=l.checked,v=void 0!==b&&b,g=l.defaultChecked,y=void 0!==g&&g,k=l.onChange,C=l.disabled,S=void 0!==C&&C,z=l.required,q=void 0!==z&&z,M=l.error,R=void 0!==M&&M,j=l.helperText,B=l.size,H=void 0===B?"medium":B,T=l.color,W=void 0===T?"primary":T,w=l.sx,D=void 0===w?{}:w,F=l.radioSx,I=void 0===F?{}:F,L=l.labelSx,_=void 0===L?{}:L,A=e(l,["label","description","name","checked","defaultChecked","onChange","disabled","required","error","helperText","size","color","sx","radioSx","labelSx"]),E=o();return t(a,r({ref:x,component:"fieldset",error:R,required:q,disabled:S,sx:r({borderRadius:"8px"},D)},A,{children:[h&&t(d,{sx:r({fontWeight:500,fontSize:"small"===H?"0.875rem":"1rem",color:S?E.palette.text.disabled:R?E.palette.error.main:E.palette.text.primary,mb:1},_),children:[h,q&&i(n,{component:"span",sx:{color:E.palette.error.main,ml:.5,fontSize:"inherit"},children:"*"})]}),i(s,{control:i(m,{name:u,checked:v,defaultChecked:y,onChange:k,size:H,color:W,sx:r({"&.Mui-checked":{color:R?E.palette.error.main:E.palette[W].main},mt:f?.25:0},I)}),label:t(c,{sx:{display:"flex",flexDirection:"column"},children:[i(n,{variant:"small"===H?"body2":"body1",sx:{fontWeight:400,color:S?E.palette.text.disabled:E.palette.text.primary,lineHeight:1.5},children:h}),f&&i(n,{variant:"caption",sx:{color:S?E.palette.text.disabled:E.palette.text.secondary,mt:.25,lineHeight:1.4},children:f})]}),sx:{alignItems:f?"flex-start":"center",margin:0,display:"flex","& .MuiFormControlLabel-label":{ml:1,flex:1},"& .MuiButtonBase-root":{p:"small"===H?.5:1}}}),j&&i(p,{sx:{mt:1,fontSize:"small"===H?"0.75rem":"0.875rem",color:R?E.palette.error.main:E.palette.text.secondary},children:j})]}))});export{x as Radio,x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as r}from"../../chunks/tslib.es6-
|
|
1
|
+
import{_ as e,a as r}from"../../chunks/tslib.es6-49e5b83c.esm.js";import{jsxs as t,jsx as a}from"react/jsx-runtime";import o from"react";import{useTheme as i,FormControl as l,FormLabel as n,Typography as d,RadioGroup as s,Box as m,FormControlLabel as c,Radio as p,FormHelperText as u}from"@mui/material";var x=o.forwardRef(function(x,f){var v=x.label,b=x.options,h=void 0===b?[]:b,g=x.value,y=x.defaultValue,S=x.onChange,z=x.name,C=x.disabled,M=void 0!==C&&C,w=x.required,R=void 0!==w&&w,q=x.error,L=void 0!==q&&q,j=x.helperText,k=x.row,B=void 0!==k&&k,F=x.size,H=void 0===F?"medium":F,T=x.color,V=void 0===T?"primary":T,W=x.sx,D=void 0===W?{}:W,E=x.radioSx,G=void 0===E?{}:E,I=x.labelSx,_=void 0===I?{}:I,A=e(x,["label","options","value","defaultValue","onChange","name","disabled","required","error","helperText","row","size","color","sx","radioSx","labelSx"]),J=i(),K=o.useState(g||y||""),N=K[0],O=K[1];o.useEffect(function(){void 0!==g&&O(g)},[g]);var P=void 0!==g?g:N;return t(l,r({ref:f,component:"fieldset",variant:"standard",disabled:M,required:R,error:L,sx:r({borderRadius:"8px"},D)},A,{children:[v&&t(n,{component:"legend",sx:r({fontWeight:500,fontSize:"small"===H?"0.875rem":"1rem",color:M?J.palette.text.disabled:L?J.palette.error.main:J.palette.text.primary,"&.Mui-focused":{color:L?J.palette.error.main:"".concat(J.palette[V].main)},mb:1},_),children:[v,R&&a(d,{component:"span",sx:{color:J.palette.error.main,ml:.5,fontSize:"inherit"},children:"*"})]}),a(s,{name:z,value:P,onChange:function(e){var r=e.target.value;void 0===g&&O(r),null==S||S(r)},row:B,sx:{gap:"small"===H?1:1.5,"& .MuiFormControlLabel-root":{marginLeft:0,marginRight:B?2:0}},children:h.map(function(e){return a(m,{children:a(c,{value:e.value,disabled:M||e.disabled,control:a(p,{size:H,color:V,sx:r({"&.Mui-checked":{color:L?J.palette.error.main:"".concat(J.palette[V].main)},alignSelf:e.description?"flex-start":"center",mt:e.description?.25:0},G)}),label:t(m,{sx:{display:"flex",flexDirection:"column"},children:[a(d,{variant:"small"===H?"body2":"body1",sx:{fontWeight:400,color:M||e.disabled?J.palette.text.disabled:J.palette.text.primary,lineHeight:1.5},children:e.label}),e.description&&a(d,{variant:"caption",sx:{color:M||e.disabled?J.palette.text.disabled:J.palette.text.secondary,mt:.25,lineHeight:1.4},children:e.description})]}),sx:{alignItems:e.description?"flex-start":"center",margin:0,display:"flex","& .MuiFormControlLabel-label":{ml:1,flex:1},"& .MuiButtonBase-root":{p:"small"===H?.5:1}}})},e.value)})}),j&&a(u,{sx:{mt:1,fontSize:"small"===H?"0.75rem":"0.875rem",color:L?J.palette.error.main:J.palette.text.secondary},children:j})]}))});export{x as RadioGroup,x as default};
|