@object-ui/plugin-list 7.0.0 → 7.1.0

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.
@@ -1,3 +1,3 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("lucide-react"),require("react/jsx-runtime"),require("@object-ui/i18n"),require("@object-ui/react"),require("@object-ui/mobile"),require("@object-ui/permissions"),require("@object-ui/fields")):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/i18n`,`@object-ui/react`,`@object-ui/mobile`,`@object-ui/permissions`,`@object-ui/fields`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIi18n,e.ObjectUIReact,e.ObjectUIMobile,e._object_ui_permissions,e.ObjectUIFields))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=Object.create,f=Object.defineProperty,p=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,h=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=m(t),a=0,o=i.length,s;a<o;a++)s=i[a],!g.call(e,s)&&s!==n&&f(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=p(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:d(h(e)),_(t||!e||!e.__esModule?f(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var v={grid:(0,a.jsx)(i.Grid,{className:`h-4 w-4`}),kanban:(0,a.jsx)(i.LayoutGrid,{className:`h-4 w-4`}),gallery:(0,a.jsx)(i.Images,{className:`h-4 w-4`}),calendar:(0,a.jsx)(i.Calendar,{className:`h-4 w-4`}),timeline:(0,a.jsx)(i.Activity,{className:`h-4 w-4`}),gantt:(0,a.jsx)(i.GanttChartSquare,{className:`h-4 w-4`}),map:(0,a.jsx)(i.Map,{className:`h-4 w-4`}),chart:(0,a.jsx)(i.BarChart3,{className:`h-4 w-4`}),tree:(0,a.jsx)(i.ListTree,{className:`h-4 w-4`})},y={grid:`Grid`,kanban:`Kanban`,gallery:`Gallery`,calendar:`Calendar`,timeline:`Timeline`,gantt:`Gantt`,map:`Map`,chart:`Chart`,tree:`Tree`},b=({currentView:e,availableViews:t=[`grid`,`kanban`],onViewChange:o,className:s,animated:c=!0})=>{let[l,u]=n.useState(!1),d=n.useCallback(t=>{u(!1),t!==e&&(c&&typeof document<`u`&&`startViewTransition`in document?document.startViewTransition(()=>o(t)):o(t))},[c,e,o]);return t.length>=2&&t.length<=4?(0,a.jsx)(`div`,{role:`tablist`,"data-testid":`view-switcher-segmented`,className:(0,r.cn)(`inline-flex items-center gap-0.5 rounded-lg bg-muted p-0.5 oui-view-switcher`,s),children:t.map(t=>{let n=t===e;return(0,a.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n,"aria-label":y[t],title:y[t],"data-state":n?`on`:`off`,onClick:()=>d(t),className:(0,r.cn)(`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-[7px] text-xs font-medium transition-all duration-150`,n?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[v[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block`,children:y[t]})]},t)})}):(0,a.jsxs)(r.Popover,{open:l,onOpenChange:u,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{type:`button`,"data-testid":`view-switcher-dropdown`,"aria-label":y[e],className:(0,r.cn)(`inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs font-medium transition-colors oui-view-switcher`,l?`text-foreground bg-muted`:`text-muted-foreground hover:text-foreground`,s),children:[v[e],(0,a.jsx)(`span`,{className:`hidden sm:inline-block`,children:y[e]}),(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`end`,className:`w-44 p-1`,children:t.map(t=>(0,a.jsxs)(`button`,{type:`button`,onClick:()=>d(t),"data-state":t===e?`on`:`off`,className:(0,r.cn)(`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs transition-colors hover:bg-muted`,t===e?`text-foreground font-medium`:`text-muted-foreground`),children:[v[t],(0,a.jsx)(`span`,{className:`flex-1 text-left`,children:y[t]}),t===e&&(0,a.jsx)(i.Check,{className:`h-3.5 w-3.5`})]},t))})]})},x=({currentView:e,availableViews:t=[`grid`,`kanban`],onViewChange:i,className:o,animated:s=!0})=>{let c=n.useCallback(t=>{if(!s||t===e){i(t);return}typeof document<`u`&&`startViewTransition`in document?document.startViewTransition(()=>i(t)):i(t)},[s,e,i]);return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 bg-transparent oui-view-switcher`,o),children:t.map(t=>{let n=e===t;return(0,a.jsxs)(`button`,{type:`button`,onClick:()=>c(t),"aria-label":y[t],title:y[t],"aria-pressed":n,"data-state":n?`on`:`off`,className:(0,r.cn)(`inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,`hover:bg-muted hover:text-muted-foreground`,`gap-2 px-3 py-2`,`data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50`),children:[v[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block text-xs font-medium`,children:y[t]})]},t)})})};function S({title:e,badge:t,onClear:o,clearLabel:s,defaultOpen:c=!0,children:l}){let[u,d]=n.useState(c);return(0,a.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,a.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`flex items-center gap-1.5 text-xs font-medium text-foreground/80 hover:text-foreground`,children:[(0,a.jsx)(i.ChevronDown,{className:(0,r.cn)(`h-3.5 w-3.5 transition-transform`,!u&&`-rotate-90`)}),e,typeof t==`number`&&t>0&&(0,a.jsx)(`span`,{className:`ml-1 inline-flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] text-primary tabular-nums`,children:t})]}),o&&(0,a.jsx)(`button`,{type:`button`,onClick:o,className:`text-[11px] text-muted-foreground hover:text-foreground`,children:s})]}),u&&(0,a.jsx)(`div`,{className:`px-3 pb-3`,children:l})]})}function C(e){let{t,allFields:o,showGroup:s,groupingConfig:c,setGroupingConfig:l,showColor:u,rowColorConfig:d,setRowColorConfig:f,showDensity:p,density:m,showHideFields:h,hiddenFields:g,updateHiddenFields:_}=e,[v,y]=n.useState(!1),b=[!!c?.fields?.length,!!d?.field,m&&m.mode!==`compact`,(g?.size??0)>0].filter(Boolean).length,x=m?.mode===`compact`?i.Rows4:m?.mode===`comfortable`?i.Rows3:i.Rows2,C=t(`list.viewSettings`,{defaultValue:`View settings`});return(0,a.jsxs)(r.Popover,{open:v,onOpenChange:y,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":C,title:C,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,b>0&&`text-foreground font-medium`),"data-testid":`view-settings-trigger`,children:[(0,a.jsx)(i.Settings2,{className:`h-3.5 w-3.5 sm:mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:C}),b>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:b})]})}),(0,a.jsxs)(r.PopoverContent,{align:`end`,className:`w-80 p-0`,"data-testid":`view-settings-content`,children:[(0,a.jsxs)(`div`,{className:`px-3 py-2 border-b`,children:[(0,a.jsx)(`div`,{className:`text-sm font-semibold`,children:C}),(0,a.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:t(`list.viewSettingsHint`,{defaultValue:`Grouping, color, density, and visible fields.`})})]}),s&&l&&(0,a.jsx)(S,{title:t(`list.group`,{defaultValue:`Group`}),badge:c?.fields?.length||0,onClear:c?()=>l(void 0):void 0,clearLabel:t(`list.clear`,{defaultValue:`Clear`}),children:(0,a.jsx)(r.GroupingEditor,{value:c,fieldOptions:o.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:t(`list.addGroup`,`Add group field`),collapseTitle:t(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:t(`list.removeGroup`,`Remove`)},onChange:e=>l(e)})}),u&&f&&(0,a.jsxs)(S,{title:t(`list.color`,{defaultValue:`Row color`}),onClear:d?()=>f(void 0):void 0,clearLabel:t(`list.clear`,{defaultValue:`Clear`}),defaultOpen:!!d,children:[(0,a.jsx)(`label`,{className:`block text-[11px] text-muted-foreground mb-1`,children:t(`list.colorByField`,{defaultValue:`Color by field`})}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:d?.field||``,onChange:e=>{let t=e.target.value;f(t?{field:t,colors:d?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:t(`list.none`,{defaultValue:`None`})}),o.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label||e.name},e.name))]})]}),p&&m&&(0,a.jsx)(S,{title:t(`grid.toolbar.densityMode`,{defaultValue:`Density`}),defaultOpen:m.mode!==`compact`,children:(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsxs)(r.Button,{variant:`outline`,size:`sm`,className:`h-7 gap-1.5`,onClick:m.cycle,"data-testid":`view-settings-density-cycle`,children:[(0,a.jsx)(x,{className:`h-3.5 w-3.5`}),(0,a.jsx)(`span`,{className:`text-xs`,children:m.mode===`compact`?t(`grid.toolbar.densityCompact`,{defaultValue:`Compact`}):m.mode===`comfortable`?t(`grid.toolbar.densityComfortable`,{defaultValue:`Comfortable`}):t(`grid.toolbar.densitySpacious`,{defaultValue:`Spacious`})})]}),(0,a.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`grid.toolbar.densityCycleShortHint`,{defaultValue:`Click to cycle`})})]})}),h&&g&&_&&(0,a.jsx)(S,{title:t(`list.hideFieldsTitle`,{defaultValue:`Hide fields`}),badge:g.size,onClear:g.size>0?()=>_(new Set):void 0,clearLabel:t(`list.showAll`,{defaultValue:`Show all`}),defaultOpen:g.size>0,children:(0,a.jsx)(`div`,{className:`max-h-48 overflow-y-auto space-y-0.5`,children:o.map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-xs py-1 px-1 rounded hover:bg-muted cursor-pointer`,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:!g.has(e.name),onChange:()=>{let t=new Set(g);t.has(e.name)?t.delete(e.name):t.add(e.name),_(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label||e.name})]},e.name))})})]})]})}function ee(){try{let{t:e}=(0,o.useObjectTranslation)(),t=e(`common.more`);return!t||t===`common.more`?`More`:t}catch{return`More`}}var te=new Set([`lookup`,`master_detail`,`user`,`owner`]);function w(e){switch(e){case void 0:case`equals`:case`eq`:return`=`;case`not_equals`:case`ne`:case`neq`:return`!=`;case`gte`:return`>=`;case`lte`:return`<=`;case`gt`:return`>`;case`lt`:return`<`;case`not_in`:case`nin`:return`not in`;default:return e}}function T(e){return(e||[]).filter(e=>e&&(e.id||e.name)).map(e=>({id:e.id??e.name,label:typeof e.label==`string`?e.label:e.label?.toString?.()??e.id??e.name,filters:Array.isArray(e.filters)?e.filters:Array.isArray(e.filter)?e.filter.filter(e=>e&&typeof e.field==`string`).map(e=>[e.field,w(e.operator),e.value]):[],default:e.default??e.isDefault}))}function E({config:e,objectDef:t,data:n=[],onFilterChange:r,maxVisible:i,className:o,initialSelections:s,onSelectionsChange:c}){switch(e.element){case`dropdown`:return(0,a.jsx)(O,{fields:e.fields||[],objectDef:t,data:n,onFilterChange:r,maxVisible:i,className:o,initialSelections:s,onSelectionsChange:c});case`tabs`:return(0,a.jsx)(k,{tabs:T(e.tabs||[]),showAllRecords:e.showAllRecords!==!1,allowAddTab:e.allowAddTab,onFilterChange:r,className:o,initialTab:typeof s?._tab?.[0]==`string`?s._tab[0]:void 0,onSelectionsChange:c});default:return null}}function D(e,t,n,r){return e.map(e=>{let i=e.options?[...e.options]:[],a=e.type,o,s,c;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(a||=n.type,o=n.reference_to??n.reference,s=n.display_field??n.reference_field,c=n.id_field,i.length===0&&n.options&&(i=Array.isArray(n.options)?n.options.map(e=>({label:e.label??String(e.value??e),value:e.value??e,color:e.color})):Object.entries(n.options).map(([e,t])=>({label:t?.label||e,value:e,color:t?.color}))))}i.length===0&&a===`boolean`&&(i=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(i=i.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length})));let l=e.label;return r?.objectName&&(i=r.translateOptions(r.objectName,e.field,i),l=r.fieldLabel(r.objectName,e.field,e.label||e.field)),{...e,label:l,type:a,options:i,referenceTo:o,displayField:s,idField:c}})}function O({fields:e,objectDef:t,data:s,onFilterChange:c,maxVisible:l,className:u,initialSelections:d,onSelectionsChange:f}){let{fieldLabel:p,translateOptions:m}=(0,o.useSafeFieldLabel)(),h=ee(),g=t?.name,[_,v]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues);let n=d?.[e.field];n&&n.length>0&&(t[e.field]=n)}),t}),y=n.useRef({}),b=n.useMemo(()=>D(e,t,s,{objectName:g,fieldLabel:p,translateOptions:m}).map(e=>{if(!e.showCount)return e;if((_[e.field]||[]).length===0)return y.current[e.field]=new Map(e.options.map(e=>[String(e.value),e.count??0])),e;let t=y.current[e.field];return t?{...e,options:e.options.map(e=>({...e,count:t.get(String(e.value))??e.count}))}:e}),[e,t,s,g,p,m,_]),x=n.useCallback(e=>{c(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[c]),S=(e,t)=>{let n={..._,[e]:t};v(n),x(n),f?.(n)};n.useEffect(()=>{let e=_,t={},n=!1;for(let[r,i]of Object.entries(e)){let e=b.find(e=>e.field===r),a=i.map(t=>{if(!e||typeof t!=`string`)return t;let n=e.options.find(e=>String(e.value)===t);return n&&n.value!==t?n.value:e.type===`boolean`&&(t===`true`||t===`false`)?t===`true`:t});t[r]=a,a.some((e,t)=>e!==i[t])&&(n=!0)}n&&(v(t),e=t),Object.values(e).some(e=>e.length>0)&&x(e)},[]);let C=l!==void 0&&l<b.length?b.slice(0,l):b,w=l!==void 0&&l<b.length?b.slice(l):[],T=e=>{let t=_[e.field]||[],n=t.length>0,o=te.has(e.type||``)&&e.options.length===0&&(e.referenceTo||e.type===`user`||e.type===`owner`),s=o?`w-72`:`w-56`;return(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`filter-badge-${e.field}`,className:(0,r.cn)(`inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md`,n?`text-foreground font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60 hover:opacity-100`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),S(e.field,[])}}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:(0,r.cn)(s,`p-2`),children:o?(0,a.jsx)(`div`,{"data-testid":`filter-lookup-${e.field}`,children:(0,a.jsx)(r.LookupValuePicker,{field:{value:e.field,label:e.label||e.field,type:e.type,referenceTo:e.referenceTo,displayField:e.displayField,idField:e.idField},value:t,multiple:!0,onChange:t=>{let n=Array.isArray(t)?t:t==null||t===``?[]:[t];S(e.field,n)}})}):(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-0.5`,"data-testid":`filter-options-${e.field}`,children:e.options.length===0?(0,a.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:`No options`}):e.options.map(n=>(0,a.jsxs)(`label`,{className:(0,r.cn)(`flex items-center gap-2 text-sm py-1.5 px-2 rounded cursor-pointer`,t.includes(n.value)?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t.includes(n.value),onChange:()=>{let r=t.includes(n.value)?t.filter(e=>e!==n.value):[...t,n.value];S(e.field,r)},className:`rounded border-input`}),n.color&&(0,a.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full shrink-0`,style:{backgroundColor:n.color}}),(0,a.jsx)(`span`,{className:`truncate flex-1`,children:n.label}),n.count!==void 0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.count})]},String(n.value)))})})]},e.field)};return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,u),"data-testid":`user-filters-dropdown`,children:b.length===0?(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`user-filters-empty`,children:`No filter fields`}):(0,a.jsxs)(a.Fragment,{children:[C.map(T),w.length>0&&(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`user-filters-more`,className:`inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md`,children:[(0,a.jsx)(`span`,{children:h}),(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:w.length}),(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-2`,"data-testid":`user-filters-more-content`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:w.map(T)})})]})]})})}function k({tabs:e,showAllRecords:t,allowAddTab:o,onFilterChange:s,className:c,initialTab:l,onSelectionsChange:u}){let[d,f]=n.useState(()=>l&&(l===`__all__`||e.some(e=>e.id===l))?l:e.find(e=>e.default)?.id||(t?`__all__`:e[0]?.id||``)),p=n.useCallback(t=>{f(t),s(t===`__all__`?[]:e.find(e=>e.id===t)?.filters||[]),u?.({_tab:[t]})},[e,s,u]),m=n.useMemo(()=>{let n=[...e];return t&&n.push({id:`__all__`,label:`All records`,filters:[]}),n},[e,t]);return n.useEffect(()=>{if(d&&d!==`__all__`){let t=e.find(e=>e.id===d);t&&s(t.filters||[])}},[]),(0,a.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,c),"data-testid":`user-filters-tabs`,children:[m.map(e=>{let t=e.id??e.name??``;return(0,a.jsx)(`button`,{"data-testid":`filter-tab-${t}`,onClick:()=>p(t),className:(0,r.cn)(`inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0`,d===t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:e.label},t)}),o&&(0,a.jsx)(`button`,{className:`inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0`,"data-testid":`filter-tab-add`,title:`Add filter tab`,children:(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5`})})]})}function A(e){switch(e){case`equals`:case`eq`:return`=`;case`notEquals`:case`not_equals`:case`ne`:case`neq`:return`!=`;case`contains`:return`contains`;case`notContains`:case`notcontains`:return`notcontains`;case`greaterThan`:case`gt`:return`>`;case`greaterOrEqual`:case`gte`:return`>=`;case`lessThan`:case`lt`:return`<`;case`lessOrEqual`:case`lte`:return`<=`;case`in`:return`in`;case`notIn`:case`not_in`:case`nin`:return`not in`;case`before`:return`<`;case`after`:return`>`;default:return e}}function j(e){if(!Array.isArray(e)||e.length<3)return e;let[t,n,r]=e;return typeof t==`string`&&(t===`and`||t===`or`)?[t,...e.slice(1).map(e=>Array.isArray(e)?j(e):e)]:n===`in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`=`,r[0]]:[`or`,...r.map(e=>[t,`=`,e])]:n===`not in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`!=`,r[0]]:[`and`,...r.map(e=>[t,`!=`,e])]:e}function M(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function ne(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?j(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function re(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=ne(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,A(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function N(e,n){if(!n||n.length===0)return{};for(let r of n){let n=!1,i=(`condition`in r?r.condition:void 0)||(`expression`in r?r.expression:void 0)||void 0;if(i)n=(0,t.evaluatePlainCondition)(i,e);else if(`field`in r&&`operator`in r&&r.field&&r.operator){let t=e[r.field];switch(r.operator){case`equals`:n=t===r.value;break;case`not_equals`:n=t!==r.value;break;case`contains`:n=typeof t==`string`&&typeof r.value==`string`&&t.includes(r.value);break;case`greater_than`:n=typeof t==`number`&&typeof r.value==`number`&&t>r.value;break;case`less_than`:n=typeof t==`number`&&typeof r.value==`number`&&t<r.value;break;case`in`:n=Array.isArray(r.value)&&r.value.includes(t);break}}if(n){let e={};return`style`in r&&r.style&&Object.assign(e,r.style),`backgroundColor`in r&&r.backgroundColor&&(e.backgroundColor=r.backgroundColor),`textColor`in r&&r.textColor&&(e.color=r.textColor),`borderColor`in r&&r.borderColor&&(e.borderColor=r.borderColor),e}}return{}}var P={"list.recordCount":`{{count}} records`,"list.recordCountOne":`{{count}} record`,"list.noItems":`No items found`,"list.noItemsMessage":`There are no records to display. Try adjusting your filters or adding new data.`,"list.firstRunTitle":`Nothing here yet`,"list.firstRunMessage":`Create your first record to get started.`,"list.noMatches":`No matching records`,"list.noMatchesMessage":`No records match your current filters or search. Try adjusting or clearing them.`,"list.loading":`Loading records…`,"list.loadErrorTitle":`Couldn’t load records`,"list.loadErrorMessage":`Something went wrong while loading this data. Check your connection and try again.`,"list.retry":`Retry`,"list.search":`Search`,"list.filter":`Filter`,"list.filterRecords":`Filter Records`,"list.sort":`Sort`,"list.sortRecords":`Sort Records`,"list.group":`Group`,"list.groupBy":`Group By`,"list.export":`Export`,"list.exportAs":`Export as {{format}}`,"list.color":`Color`,"list.rowColor":`Row Color`,"list.colorByField":`Color by field`,"list.clear":`Clear`,"list.none":`None`,"list.hideFields":`Hide fields`,"list.showAll":`Show all`,"list.pullToRefresh":`Pull to refresh`,"list.refreshing":`Refreshing…`,"list.dataLimitReached":`Showing first {{limit}} records. More data may be available.`,"list.addRecord":`Add record`,"list.tabs":`Tabs`,"list.allRecords":`All Records`,"list.share":`Share`,"list.print":`Print`,"list.hideFieldsTitle":`Hide Fields`,"table.rowsPerPage":`Rows per page`,"grid.toolbar.densityMode":`Density`,"grid.toolbar.densityCompact":`Compact`,"grid.toolbar.densityComfortable":`Comfortable`,"grid.toolbar.densitySpacious":`Spacious`,"grid.toolbar.densityCycleHint":`{{label}} (click to cycle)`,"grid.toolbar.densityCycleShortHint":`Click to cycle`,"list.viewSettings":`View settings`,"list.viewSettingsHint":`Grouping, color, density, and visible fields.`},ie=(e,t,n)=>n,F=(e,t)=>{let n=P[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n};function ae(){try{let e=(0,o.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:F}:{t:e.t}}catch{return{t:F}}}function oe(){try{let{fieldLabel:e,actionLabel:t}=(0,o.useObjectLabel)();return{fieldLabel:e,actionLabel:t}}catch{return{fieldLabel:ie,actionLabel:void 0}}}var I=n.forwardRef(({schema:e,className:u,onViewChange:d,onFilterChange:f,onSortChange:p,onSearchChange:m,onHiddenFieldsChange:h,onColumnStateChange:g,onRowClick:_,showViewSwitcher:v,userFilterSelections:y,onUserFilterSelectionsChange:x,...S},ee)=>{let te=v??e?.showViewSwitcher??!1,{t:w}=ae(),{fieldLabel:T,actionLabel:D}=oe(),{translateOptions:O}=(0,o.useSafeFieldLabel)(),k=n.useMemo(()=>e.viewType&&e.viewType!==`list`?e:{...e,viewType:`grid`},[e]),A=n.useCallback((e,t)=>k.objectName?T(k.objectName,e,t):t,[k.objectName,T]),j=n.useCallback(e=>{let t=M(e);return k.objectName&&typeof D==`function`?D(k.objectName,e,t):t},[k.objectName,D]),N=n.useMemo(()=>{let e=k.userActions,t=k.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?k.showSearch!==!1:e.search,showSort:e?.sort===void 0?k.showSort!==!1:e.sort,showFilters:e?.filter===void 0?k.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?k.showDensity!==!1:e.rowHeight,showHideFields:k.showHideFields===!0,showGroup:k.showGroup!==!1,showColor:k.showColor===!0,compactToolbar:k.compactToolbar===!0,showAddRecord:t,addRecordPosition:k.addRecord?.position===`bottom`?`bottom`:`top`}},[k.userActions,k.showSearch,k.showSort,k.showFilters,k.showDensity,k.showHideFields,k.showGroup,k.showColor,k.compactToolbar,k.addRecord,k.userActions?.addRecordForm]),[P,ie]=n.useState(k.viewType),[F,I]=n.useState(``),[se,ce]=n.useState(!1),[le,ue]=n.useState(!1),[L,de]=n.useState(()=>k.sort&&k.sort.length>0?k.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}}):[]),fe=n.useMemo(()=>JSON.stringify(k.sort||[]),[k.sort]);n.useEffect(()=>{k.sort&&k.sort.length>0?de(k.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}})):de([])},[fe]);let[pe,me]=n.useState(!1),[R,he]=n.useState({id:`root`,logic:`and`,conditions:[]}),z=S.dataSource,[B,ge]=n.useState([]),[_e,ve]=n.useState(null),[V,H]=n.useState(()=>!(Array.isArray(k.data)||k.data&&typeof k.data==`object`&&k.data.provider===`value`&&Array.isArray(k.data.items))),[U,ye]=n.useState(null),[be,xe]=n.useState(!1),[Se,Ce]=n.useState(0),[we,Te]=n.useState(!1);n.useImperativeHandle(ee,()=>({refresh:()=>Ce(e=>e+1)}),[]),n.useEffect(()=>{if(!(!z?.onMutation||!k.objectName||k.refreshTrigger))return z.onMutation(e=>{e.resource===k.objectName&&Ce(e=>e+1)})},[z,k.objectName,k.refreshTrigger]);let[Ee,De]=n.useState(void 0),W=Ee??k.pagination?.pageSize??100,G=n.useMemo(()=>{if(k.grouping?.fields?.length)return k.grouping;let e=typeof k.groupBy==`string`?k.groupBy.trim():``,t=typeof k.groupBy2==`string`?k.groupBy2.trim():``,n=[];return e&&n.push({field:e,order:`asc`,collapsed:!1}),t&&t!==e&&n.push({field:t,order:`asc`,collapsed:!1}),n.length>0?{fields:n}:void 0},[k.grouping,k.groupBy,k.groupBy2]),[K,Oe]=n.useState(G),[ke,Ae]=n.useState(!1),je=n.useRef(G);n.useEffect(()=>{je.current!==G&&(je.current=G,Oe(G))},[G]);let[q,Me]=n.useState(k.rowColor),[Ne,Pe]=n.useState(!1),[Fe,Ie]=n.useState([]),Le=n.useRef(0),[Re,ze]=n.useState([]),Be=n.useMemo(()=>{let e=k.userFilters;if(!e)return;if(e.element===`tabs`||e.fields&&e.fields.length>0||!U?.fields)return e;let t=new Set([`select`,`multi-select`,`boolean`]),n=[],r=Array.isArray(U.fields)?U.fields.map(e=>[e.name,e]):Object.entries(U.fields);for(let[e,i]of r)(t.has(i.type)||i.options&&!i.type)&&n.push({field:e,label:A(e,i.label||e),type:i.type===`boolean`?`boolean`:i.type===`multi-select`?`multi-select`:`select`});return n.length===0?e:{...e,fields:n}},[k.userFilters,U,A]),[J,Ve]=n.useState(()=>new Set(k.hiddenFields||[])),He=n.useMemo(()=>JSON.stringify(k.hiddenFields||[]),[k.hiddenFields]);n.useEffect(()=>{Ve(new Set(k.hiddenFields||[]))},[He]);let Ue=n.useCallback(e=>{Ve(e),h?.(Array.from(e))},[h]),[We,Ge]=n.useState(!1),[Ke,qe]=n.useState(!1),Y=n.useMemo(()=>{if(k.exportOptions)return Array.isArray(k.exportOptions)?{formats:k.exportOptions}:k.exportOptions},[k.exportOptions]),X=(0,s.useDensityMode)(n.useMemo(()=>k.densityMode?k.densityMode:k.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[k.rowHeight]||`comfortable`:`compact`,[k.densityMode,k.rowHeight]),{onChange:k.onDensityChange}),Je=n.useMemo(()=>`objectui:gallery:density:${k.objectName??`default`}`,[k.objectName]),[Z,Ye]=n.useState(()=>{if(typeof window>`u`)return k.gallery?.cardSize??`medium`;try{let e=window.localStorage.getItem(Je);if(e===`small`||e===`medium`||e===`large`)return e}catch{}return k.gallery?.cardSize??`medium`}),Xe=n.useCallback(()=>{Ye(e=>{let t=e===`large`?`medium`:e===`medium`?`small`:`large`;try{window.localStorage.setItem(Je,t)}catch{}return t})},[Je]),{ref:Ze,isRefreshing:Qe,pullDistance:$e}=(0,c.usePullToRefresh)({onRefresh:n.useCallback(async()=>{Ce(e=>e+1)},[]),enabled:!!z&&!!k.objectName}),et=n.useMemo(()=>k.id?`listview-${k.objectName}-${k.id}-view`:`listview-${k.objectName}-view`,[k.objectName,k.id]);n.useEffect(()=>{let e=!0;return xe(!1),ye(null),(async()=>{if(!z||!k.objectName){xe(!0);return}if(typeof z.getObjectSchema!=`function`){xe(!0);return}try{let t=await z.getObjectSchema(k.objectName);e&&ye(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&xe(!0)}})(),()=>{e=!1}},[k.objectName,z]);let tt=n.useMemo(()=>{let e=Array.isArray(k.fields)?k.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],n=new Set(e),r=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)typeof e==`string`&&e&&n.add(e)};r(k.kanban),r(k.options?.kanban),r(k.calendar),r(k.options?.calendar),r(k.gallery),r(k.options?.gallery),r(k.timeline),r(k.options?.timeline),r(k.gantt),r(k.options?.gantt);let i=n.size>0?Array.from(n):void 0;return(0,t.buildExpandFields)(U?.fields,i)},[U?.fields,k.fields,k.kanban,k.calendar,k.gallery,k.timeline,k.gantt,k.options]),Q=(0,l.usePermissions)();n.useEffect(()=>{let e=!0,t=++Le.current;if(k.data&&typeof k.data==`object`&&!Array.isArray(k.data)){let e=k.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(F){let e=F.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}ge(t),H(!1),Te(!1);return}}if(Array.isArray(k.data)){let e=k.data;if(F){let t=F.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}ge(e),H(!1),Te(!1);return}return be?((async()=>{if(!z||!k.objectName){H(!1);return}H(!0),ve(null);try{let n=[],r=k.filters||[],i=re(R),a=ne(Re),o=[...r.length>0?[r]:[],...i.length>0?[i]:[],...a].filter(e=>Array.isArray(e)&&e.length>0);o.length>1?n=[`and`,...o]:o.length===1&&(n=o[0]);let s=L.length>0?L.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,c=(()=>{let e=Array.isArray(k.fields)?k.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],t=Q?.isLoaded&&k.objectName?e.filter(e=>Q.checkField(k.objectName,e,`read`)):e;if(t.length===0)return;let n=new Set([`id`]);for(let e of t)n.add(e);for(let e of tt)n.add(e);let r=(()=>{let e=U?.fields;if(!e)return null;let t=Array.isArray(e)?e.map(e=>e?.name).filter(e=>typeof e==`string`):Object.keys(e),n=new Set(t);return n.add(`id`),n.add(`created_at`),n.add(`updated_at`),n})(),i=e=>{typeof e!=`string`||!e||(!r||r.has(e))&&n.add(e)},a=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)i(e)};a(k.kanban),a(k.options?.kanban),a(k.calendar),a(k.options?.calendar),a(k.gallery),a(k.options?.gallery),a(k.timeline),a(k.options?.timeline);{let e=k.timeline??k.options?.timeline;e&&!Array.isArray(e.metaFields)&&(i(`status`),i(`priority`))}return a(k.gantt),a(k.options?.gantt),Array.from(n)})(),l=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,u=await z.find(k.objectName,{...l?{$filter:n}:{},$orderby:s,$top:W,...c?{$select:c}:{},...tt.length>0?{$expand:tt}:{},...F?{$search:F,...k.searchableFields&&k.searchableFields.length>0?{$searchFields:k.searchableFields}:{}}:{}});if(!e||t!==Le.current)return;let d=[];Array.isArray(u)?d=u:u&&typeof u==`object`&&(Array.isArray(u.data)?d=u.data:Array.isArray(u.records)?d=u.records:Array.isArray(u.value)&&(d=u.value)),ge(d),Te(d.length>=W)}catch(e){t===Le.current&&(console.error(`ListView data fetch error:`,e),ge([]),ve(e?.message?String(e.message):String(e??`Unknown error`)))}finally{e&&t===Le.current&&H(!1)}})(),()=>{e=!1}):void 0},[k.objectName,k.data,z,k.filters,W,L,R,Re,Se,F,k.searchableFields,tt,be,k.refreshTrigger,Q]);let nt=n.useMemo(()=>{let e=[`grid`];(k.kanban?.groupByField||k.kanban?.groupField||k.options?.kanban?.groupField)&&e.push(`kanban`),(k.gallery?.coverField||k.gallery?.imageField||k.options?.gallery?.imageField)&&e.push(`gallery`),(k.calendar?.startDateField||k.options?.calendar?.startDateField)&&e.push(`calendar`),(k.timeline?.startDateField||k.options?.timeline?.startDateField||k.options?.timeline?.dateField||k.options?.calendar?.startDateField)&&e.push(`timeline`),(k.gantt?.startDateField||k.options?.gantt?.startDateField)&&e.push(`gantt`),(k.options?.map?.locationField||k.options?.map?.latitudeField&&k.options?.map?.longitudeField)&&e.push(`map`),(k.tree?.parentField||k.options?.tree?.parentField||k.viewType===`tree`)&&e.push(`tree`),k.viewType&&!e.includes(k.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`,`chart`,`tree`].includes(k.viewType)&&e.push(k.viewType);let t=k.appearance?.allowedVisualizations;if(Array.isArray(t)&&t.length>0){let n=t.filter(t=>e.includes(t));return n.length>0?n:[`grid`]}return e},[k.options,k.viewType,k.kanban,k.calendar,k.gantt,k.gallery,k.timeline,k.tree,k.appearance?.allowedVisualizations]);n.useEffect(()=>{k.viewType&&ie(k.viewType)},[k.viewType]);let rt=n.useCallback(e=>{ie(e);try{localStorage.setItem(et,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}d?.(e)},[et,d]),it=n.useCallback(e=>{I(e),m?.(e)},[m]),at=(0,s.useNavigationOverlay)({navigation:k.navigation,objectName:k.objectName,onNavigate:k.onNavigate,onRowClick:_}),$=n.useMemo(()=>{let e=k.fields||[];if(Array.isArray(e)||(e=[]),Q?.isLoaded&&k.objectName&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t?Q.checkField(k.objectName,t,`read`):!0})),J.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!J.has(t)})),k.fieldOrder&&k.fieldOrder.length>0){let t=new Map(k.fieldOrder.map((e,t)=>[e,t]));e=[...e].sort((e,n)=>{let r=typeof e==`string`?e:e?.name||e?.fieldName||e?.field,i=typeof n==`string`?n:n?.name||n?.fieldName||n?.field;return(t.get(r)??1/0)-(t.get(i)??1/0)})}return e},[k.fields,k.objectName,J,k.fieldOrder,Q]),ot=n.useMemo(()=>{let e=X.mode===`compact`?`compact`:X.mode===`spacious`?`tall`:`medium`,t={objectName:k.objectName,fields:$,filters:k.filters,sort:L,className:`h-full w-full`,showSearch:!1,onRowClick:at.handleClick,rowHeight:e,hideRowHeightToggle:!0,...k.striped==null?{}:{striped:k.striped},...k.bordered==null?{}:{bordered:k.bordered},...g?{onColumnStateChange:g}:{},...k.columnState?{columnState:k.columnState}:{}};switch(P){default:case`grid`:return{type:`object-grid`,...t,columns:$,...k.conditionalFormatting?{conditionalFormatting:k.conditionalFormatting}:{},...k.inlineEdit==null?{}:{editable:k.inlineEdit},...k.wrapHeaders==null?{}:{wrapHeaders:k.wrapHeaders},...k.virtualScroll==null?{}:{virtualScroll:k.virtualScroll},...k.resizable==null?{}:{resizable:k.resizable},...k.selection?{selection:k.selection}:{},...k.pagination?{pagination:k.pagination}:{},...K?{grouping:K}:{},...q?{rowColor:q}:{},...k.rowActions?{rowActions:k.rowActions}:{},...k.rowActionDefs?{rowActionDefs:k.rowActionDefs}:{},...k.bulkActions?{batchActions:k.bulkActions}:{},...k.bulkActionDefs?{bulkActionDefs:k.bulkActionDefs}:{},...k.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...t,groupBy:k.kanban?.groupField||k.options?.kanban?.groupField||`status`,groupField:k.kanban?.groupField||k.options?.kanban?.groupField||`status`,...k.kanban?.titleField||k.options?.kanban?.titleField?{titleField:k.kanban?.titleField||k.options?.kanban?.titleField}:{},cardFields:k.kanban?.cardFields||$||[],...K?{grouping:K}:{},...k.options?.kanban||{},...k.kanban||{}};case`calendar`:return{type:`object-calendar`,...t,startDateField:k.calendar?.startDateField||k.options?.calendar?.startDateField||`start_date`,endDateField:k.calendar?.endDateField||k.options?.calendar?.endDateField||`end_date`,...k.calendar?.titleField||k.options?.calendar?.titleField?{titleField:k.calendar?.titleField||k.options?.calendar?.titleField}:{},...k.calendar?.defaultView?{defaultView:k.calendar.defaultView}:{},...k.options?.calendar||{},...k.calendar||{}};case`gallery`:{let e={...k.options?.gallery||{},...k.gallery||{},cardSize:Z};return{type:`object-gallery`,...t,gallery:Object.keys(e).length>0?e:void 0,imageField:k.gallery?.coverField||k.gallery?.imageField||k.options?.gallery?.imageField,titleField:k.gallery?.titleField||k.options?.gallery?.titleField||`name`,subtitleField:k.gallery?.subtitleField||k.options?.gallery?.subtitleField,...K?{grouping:K}:{}}}case`timeline`:{let e={...k.options?.timeline||{},...k.timeline||{}};return{type:`object-timeline`,...t,timeline:Object.keys(e).length>0?e:void 0,startDateField:k.timeline?.startDateField||k.options?.timeline?.startDateField||k.options?.timeline?.dateField||`created_at`,titleField:k.timeline?.titleField||k.options?.timeline?.titleField||`name`,...k.timeline?.endDateField?{endDateField:k.timeline.endDateField}:{},...k.timeline?.groupByField?{groupByField:k.timeline.groupByField}:{},...k.timeline?.colorField?{colorField:k.timeline.colorField}:{},...k.timeline?.scale?{scale:k.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...t,startDateField:k.gantt?.startDateField||k.options?.gantt?.startDateField||`start_date`,endDateField:k.gantt?.endDateField||k.options?.gantt?.endDateField||`end_date`,progressField:k.gantt?.progressField||k.options?.gantt?.progressField||`progress`,dependenciesField:k.gantt?.dependenciesField||k.options?.gantt?.dependenciesField||`dependencies`,...k.gantt?.titleField?{titleField:k.gantt.titleField}:{},...k.options?.gantt||{},...k.gantt||{}};case`map`:return{type:`object-map`,...t,locationField:k.options?.map?.locationField||`location`,...k.options?.map||{}};case`tree`:{let e=k.tree||k.options?.tree||{};return{type:`object-tree`,...t,parentField:e.parentField,labelField:e.labelField||e.titleField||`name`,fields:e.fields||$,defaultExpandedDepth:e.defaultExpandedDepth,...e}}case`chart`:{let e=k.chart||k.options?.chart||{};if(e.dataset){let t=Array.isArray(e.dimensions)?e.dimensions:[],n=Array.isArray(e.values)?e.values:[];return{type:`object-chart`,dataset:e.dataset,dimensions:t,values:n,chartType:e.chartType||`bar`,xAxisKey:t[0],series:n.map(e=>({dataKey:e,label:e})),className:`h-[400px] w-full`}}let t=Array.isArray(e.yAxisFields)&&e.yAxisFields[0]||e.valueField||`value`,n=e.xAxisField||e.categoryField||`name`;return{type:`object-chart`,objectName:k.objectName,chartType:e.chartType||`bar`,filters:k.filters,aggregate:{field:t,function:e.aggregation||`count`,groupBy:n},xAxisKey:n,series:[{dataKey:t,label:t}],className:`h-[400px] w-full`}}}},[P,k,L,$,K,q,at.handleClick,X.mode,Z]),st=R.conditions&&R.conditions.length>0,ct=n.useMemo(()=>{let e,t=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t.map(e=>({value:e?.value??e,label:e?.label??String(e?.value??e),...e&&typeof e==`object`?e:{}})):Object.entries(t).map(([e,t])=>({value:e,label:t?.label||e,...t}));return k.objectName?O(k.objectName,e,n):n};if(e=U?.fields?Object.entries(U.fields).map(([e,n])=>({value:e,label:A(e,n.label||e),type:n.type||`text`,options:t(e,n.options),referenceTo:n.reference_to||n.reference,displayField:n.display_field||n.reference_field,idField:n.id_field})):(k.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let n=e.name||e.fieldName;return{value:n,label:A(n,e.label||e.name),type:e.type||`text`,options:t(n,e.options),referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),k.filterableFields&&k.filterableFields.length>0){let t=new Set(k.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[U,k.fields,k.filterableFields,k.objectName,A,O]),lt=n.useCallback(e=>{let t=Y,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||k.objectName||`export`,a=n>0?B.slice(0,n):B;if(e===`csv`){let e=$.map(e=>typeof e==`string`?e:e.name||e.fieldName||e.field),t=[];r&&t.push(e.join(`,`)),a.forEach(n=>{t.push(e.map(e=>{let t=n[e],r;return r=t==null?``:Array.isArray(t)?t.map(e=>typeof e==`object`&&e?JSON.stringify(e):String(e??``)).join(`; `):typeof t==`object`?JSON.stringify(t):String(t),r.includes(`,`)||r.includes(`"`)||r.includes(`
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@object-ui/core"),require("react"),require("@object-ui/components"),require("lucide-react"),require("react/jsx-runtime"),require("@object-ui/i18n"),require("@object-ui/react"),require("@object-ui/mobile"),require("@object-ui/permissions"),require("@object-ui/fields")):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/i18n`,`@object-ui/react`,`@object-ui/mobile`,`@object-ui/permissions`,`@object-ui/fields`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIi18n,e.ObjectUIReact,e.ObjectUIMobile,e._object_ui_permissions,e.ObjectUIFields))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=Object.create,f=Object.defineProperty,p=Object.getOwnPropertyDescriptor,m=Object.getOwnPropertyNames,h=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,_=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=m(t),a=0,o=i.length,s;a<o;a++)s=i[a],!g.call(e,s)&&s!==n&&f(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=p(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:d(h(e)),_(t||!e||!e.__esModule?f(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var v={grid:(0,a.jsx)(i.Grid,{className:`h-4 w-4`}),kanban:(0,a.jsx)(i.LayoutGrid,{className:`h-4 w-4`}),gallery:(0,a.jsx)(i.Images,{className:`h-4 w-4`}),calendar:(0,a.jsx)(i.Calendar,{className:`h-4 w-4`}),timeline:(0,a.jsx)(i.Activity,{className:`h-4 w-4`}),gantt:(0,a.jsx)(i.GanttChartSquare,{className:`h-4 w-4`}),map:(0,a.jsx)(i.Map,{className:`h-4 w-4`}),chart:(0,a.jsx)(i.BarChart3,{className:`h-4 w-4`}),tree:(0,a.jsx)(i.ListTree,{className:`h-4 w-4`})},y={grid:`Grid`,kanban:`Kanban`,gallery:`Gallery`,calendar:`Calendar`,timeline:`Timeline`,gantt:`Gantt`,map:`Map`,chart:`Chart`,tree:`Tree`},b=({currentView:e,availableViews:t=[`grid`,`kanban`],onViewChange:o,className:s,animated:c=!0})=>{let[l,u]=n.useState(!1),d=n.useCallback(t=>{u(!1),t!==e&&(c&&typeof document<`u`&&`startViewTransition`in document?document.startViewTransition(()=>o(t)):o(t))},[c,e,o]);return t.length>=2&&t.length<=4?(0,a.jsx)(`div`,{role:`tablist`,"data-testid":`view-switcher-segmented`,className:(0,r.cn)(`inline-flex items-center gap-0.5 rounded-lg bg-muted p-0.5 oui-view-switcher`,s),children:t.map(t=>{let n=t===e;return(0,a.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":n,"aria-label":y[t],title:y[t],"data-state":n?`on`:`off`,onClick:()=>d(t),className:(0,r.cn)(`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-[7px] text-xs font-medium transition-all duration-150`,n?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:[v[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block`,children:y[t]})]},t)})}):(0,a.jsxs)(r.Popover,{open:l,onOpenChange:u,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{type:`button`,"data-testid":`view-switcher-dropdown`,"aria-label":y[e],className:(0,r.cn)(`inline-flex items-center gap-1.5 h-7 px-2 rounded-md text-xs font-medium transition-colors oui-view-switcher`,l?`text-foreground bg-muted`:`text-muted-foreground hover:text-foreground`,s),children:[v[e],(0,a.jsx)(`span`,{className:`hidden sm:inline-block`,children:y[e]}),(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`end`,className:`w-44 p-1`,children:t.map(t=>(0,a.jsxs)(`button`,{type:`button`,onClick:()=>d(t),"data-state":t===e?`on`:`off`,className:(0,r.cn)(`flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-xs transition-colors hover:bg-muted`,t===e?`text-foreground font-medium`:`text-muted-foreground`),children:[v[t],(0,a.jsx)(`span`,{className:`flex-1 text-left`,children:y[t]}),t===e&&(0,a.jsx)(i.Check,{className:`h-3.5 w-3.5`})]},t))})]})},x=({currentView:e,availableViews:t=[`grid`,`kanban`],onViewChange:i,className:o,animated:s=!0})=>{let c=n.useCallback(t=>{if(!s||t===e){i(t);return}typeof document<`u`&&`startViewTransition`in document?document.startViewTransition(()=>i(t)):i(t)},[s,e,i]);return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 bg-transparent oui-view-switcher`,o),children:t.map(t=>{let n=e===t;return(0,a.jsxs)(`button`,{type:`button`,onClick:()=>c(t),"aria-label":y[t],title:y[t],"aria-pressed":n,"data-state":n?`on`:`off`,className:(0,r.cn)(`inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50`,`hover:bg-muted hover:text-muted-foreground`,`gap-2 px-3 py-2`,`data-[state=on]:bg-background data-[state=on]:text-foreground data-[state=on]:shadow-sm border-transparent border data-[state=on]:border-border/50`),children:[v[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block text-xs font-medium`,children:y[t]})]},t)})})};function S({title:e,badge:t,onClear:o,clearLabel:s,defaultOpen:c=!0,children:l}){let[u,d]=n.useState(c);return(0,a.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,a.jsxs)(`button`,{type:`button`,onClick:()=>d(e=>!e),className:`flex items-center gap-1.5 text-xs font-medium text-foreground/80 hover:text-foreground`,children:[(0,a.jsx)(i.ChevronDown,{className:(0,r.cn)(`h-3.5 w-3.5 transition-transform`,!u&&`-rotate-90`)}),e,typeof t==`number`&&t>0&&(0,a.jsx)(`span`,{className:`ml-1 inline-flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 px-1 text-[10px] text-primary tabular-nums`,children:t})]}),o&&(0,a.jsx)(`button`,{type:`button`,onClick:o,className:`text-[11px] text-muted-foreground hover:text-foreground`,children:s})]}),u&&(0,a.jsx)(`div`,{className:`px-3 pb-3`,children:l})]})}function C(e){let{t,allFields:o,showGroup:s,groupingConfig:c,setGroupingConfig:l,showColor:u,rowColorConfig:d,setRowColorConfig:f,showDensity:p,density:m,showHideFields:h,hiddenFields:g,updateHiddenFields:_}=e,[v,y]=n.useState(!1),b=[!!c?.fields?.length,!!d?.field,m&&m.mode!==`compact`,(g?.size??0)>0].filter(Boolean).length,x=m?.mode===`compact`?i.Rows4:m?.mode===`comfortable`?i.Rows3:i.Rows2,C=t(`list.viewSettings`,{defaultValue:`View settings`});return(0,a.jsxs)(r.Popover,{open:v,onOpenChange:y,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":C,title:C,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,b>0&&`text-foreground font-medium`),"data-testid":`view-settings-trigger`,children:[(0,a.jsx)(i.Settings2,{className:`h-3.5 w-3.5 sm:mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:C}),b>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:b})]})}),(0,a.jsxs)(r.PopoverContent,{align:`end`,className:`w-80 p-0`,"data-testid":`view-settings-content`,children:[(0,a.jsxs)(`div`,{className:`px-3 py-2 border-b`,children:[(0,a.jsx)(`div`,{className:`text-sm font-semibold`,children:C}),(0,a.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:t(`list.viewSettingsHint`,{defaultValue:`Grouping, color, density, and visible fields.`})})]}),s&&l&&(0,a.jsx)(S,{title:t(`list.group`,{defaultValue:`Group`}),badge:c?.fields?.length||0,onClear:c?()=>l(void 0):void 0,clearLabel:t(`list.clear`,{defaultValue:`Clear`}),children:(0,a.jsx)(r.GroupingEditor,{value:c,fieldOptions:o.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:t(`list.addGroup`,`Add group field`),collapseTitle:t(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:t(`list.removeGroup`,`Remove`)},onChange:e=>l(e)})}),u&&f&&(0,a.jsxs)(S,{title:t(`list.color`,{defaultValue:`Row color`}),onClear:d?()=>f(void 0):void 0,clearLabel:t(`list.clear`,{defaultValue:`Clear`}),defaultOpen:!!d,children:[(0,a.jsx)(`label`,{className:`block text-[11px] text-muted-foreground mb-1`,children:t(`list.colorByField`,{defaultValue:`Color by field`})}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:d?.field||``,onChange:e=>{let t=e.target.value;f(t?{field:t,colors:d?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:t(`list.none`,{defaultValue:`None`})}),o.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label||e.name},e.name))]})]}),p&&m&&(0,a.jsx)(S,{title:t(`grid.toolbar.densityMode`,{defaultValue:`Density`}),defaultOpen:m.mode!==`compact`,children:(0,a.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,a.jsxs)(r.Button,{variant:`outline`,size:`sm`,className:`h-7 gap-1.5`,onClick:m.cycle,"data-testid":`view-settings-density-cycle`,children:[(0,a.jsx)(x,{className:`h-3.5 w-3.5`}),(0,a.jsx)(`span`,{className:`text-xs`,children:m.mode===`compact`?t(`grid.toolbar.densityCompact`,{defaultValue:`Compact`}):m.mode===`comfortable`?t(`grid.toolbar.densityComfortable`,{defaultValue:`Comfortable`}):t(`grid.toolbar.densitySpacious`,{defaultValue:`Spacious`})})]}),(0,a.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`grid.toolbar.densityCycleShortHint`,{defaultValue:`Click to cycle`})})]})}),h&&g&&_&&(0,a.jsx)(S,{title:t(`list.hideFieldsTitle`,{defaultValue:`Hide fields`}),badge:g.size,onClear:g.size>0?()=>_(new Set):void 0,clearLabel:t(`list.showAll`,{defaultValue:`Show all`}),defaultOpen:g.size>0,children:(0,a.jsx)(`div`,{className:`max-h-48 overflow-y-auto space-y-0.5`,children:o.map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-xs py-1 px-1 rounded hover:bg-muted cursor-pointer`,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:!g.has(e.name),onChange:()=>{let t=new Set(g);t.has(e.name)?t.delete(e.name):t.add(e.name),_(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label||e.name})]},e.name))})})]})]})}function w(){try{let{t:e}=(0,o.useObjectTranslation)(),t=e(`common.more`);return!t||t===`common.more`?`More`:t}catch{return`More`}}var ee=new Set([`lookup`,`master_detail`,`user`,`owner`]);function T(e){switch(e){case void 0:case`equals`:case`eq`:return`=`;case`not_equals`:case`ne`:case`neq`:return`!=`;case`gte`:return`>=`;case`lte`:return`<=`;case`gt`:return`>`;case`lt`:return`<`;case`not_in`:case`nin`:return`not in`;default:return e}}function E(e){return(e||[]).filter(e=>e&&(e.id||e.name)).map(e=>({id:e.id??e.name,label:typeof e.label==`string`?e.label:e.label?.toString?.()??e.id??e.name,filters:Array.isArray(e.filters)?e.filters:Array.isArray(e.filter)?e.filter.filter(e=>e&&typeof e.field==`string`).map(e=>[e.field,T(e.operator),e.value]):[],default:e.default??e.isDefault}))}function D({config:e,objectDef:t,data:n=[],onFilterChange:r,maxVisible:i,className:o,initialSelections:s,onSelectionsChange:c}){switch(e.element){case`dropdown`:return(0,a.jsx)(k,{fields:e.fields||[],objectDef:t,data:n,onFilterChange:r,maxVisible:i,className:o,initialSelections:s,onSelectionsChange:c});case`tabs`:return(0,a.jsx)(A,{tabs:E(e.tabs||[]),showAllRecords:e.showAllRecords!==!1,allowAddTab:e.allowAddTab,onFilterChange:r,className:o,initialTab:typeof s?._tab?.[0]==`string`?s._tab[0]:void 0,onSelectionsChange:c});default:return null}}function O(e,t,n,r){return e.map(e=>{let i=e.options?[...e.options]:[],a=e.type,o,s,c;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(a||=n.type,o=n.reference_to??n.reference,s=n.display_field??n.reference_field,c=n.id_field,i.length===0&&n.options&&(i=Array.isArray(n.options)?n.options.map(e=>({label:e.label??String(e.value??e),value:e.value??e,color:e.color})):Object.entries(n.options).map(([e,t])=>({label:t?.label||e,value:e,color:t?.color}))))}i.length===0&&a===`boolean`&&(i=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(i=i.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length})));let l=e.label;return r?.objectName&&(i=r.translateOptions(r.objectName,e.field,i),l=r.fieldLabel(r.objectName,e.field,e.label||e.field)),{...e,label:l,type:a,options:i,referenceTo:o,displayField:s,idField:c}})}function k({fields:e,objectDef:t,data:s,onFilterChange:c,maxVisible:l,className:u,initialSelections:d,onSelectionsChange:f}){let{fieldLabel:p,translateOptions:m}=(0,o.useSafeFieldLabel)(),h=w(),g=t?.name,[_,v]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues);let n=d?.[e.field];n&&n.length>0&&(t[e.field]=n)}),t}),y=n.useRef({}),b=n.useMemo(()=>O(e,t,s,{objectName:g,fieldLabel:p,translateOptions:m}).map(e=>{if(!e.showCount)return e;if((_[e.field]||[]).length===0)return y.current[e.field]=new Map(e.options.map(e=>[String(e.value),e.count??0])),e;let t=y.current[e.field];return t?{...e,options:e.options.map(e=>({...e,count:t.get(String(e.value))??e.count}))}:e}),[e,t,s,g,p,m,_]),x=n.useCallback(e=>{c(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[c]),S=(e,t)=>{let n={..._,[e]:t};v(n),x(n),f?.(n)};n.useEffect(()=>{let e=_,t={},n=!1;for(let[r,i]of Object.entries(e)){let e=b.find(e=>e.field===r),a=i.map(t=>{if(!e||typeof t!=`string`)return t;let n=e.options.find(e=>String(e.value)===t);return n&&n.value!==t?n.value:e.type===`boolean`&&(t===`true`||t===`false`)?t===`true`:t});t[r]=a,a.some((e,t)=>e!==i[t])&&(n=!0)}n&&(v(t),e=t),Object.values(e).some(e=>e.length>0)&&x(e)},[]);let C=l!==void 0&&l<b.length?b.slice(0,l):b,T=l!==void 0&&l<b.length?b.slice(l):[],E=e=>{let t=_[e.field]||[],n=t.length>0,o=ee.has(e.type||``)&&e.options.length===0&&(e.referenceTo||e.type===`user`||e.type===`owner`),s=o?`w-72`:`w-56`;return(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`filter-badge-${e.field}`,className:(0,r.cn)(`inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md`,n?`text-foreground font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60 hover:opacity-100`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),S(e.field,[])}}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:(0,r.cn)(s,`p-2`),children:o?(0,a.jsx)(`div`,{"data-testid":`filter-lookup-${e.field}`,children:(0,a.jsx)(r.LookupValuePicker,{field:{value:e.field,label:e.label||e.field,type:e.type,referenceTo:e.referenceTo,displayField:e.displayField,idField:e.idField},value:t,multiple:!0,onChange:t=>{let n=Array.isArray(t)?t:t==null||t===``?[]:[t];S(e.field,n)}})}):(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-0.5`,"data-testid":`filter-options-${e.field}`,children:e.options.length===0?(0,a.jsx)(`div`,{className:`px-2 py-3 text-center text-xs text-muted-foreground`,children:`No options`}):e.options.map(n=>(0,a.jsxs)(`label`,{className:(0,r.cn)(`flex items-center gap-2 text-sm py-1.5 px-2 rounded cursor-pointer`,t.includes(n.value)?`bg-primary/5 text-primary`:`hover:bg-muted`),children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:t.includes(n.value),onChange:()=>{let r=t.includes(n.value)?t.filter(e=>e!==n.value):[...t,n.value];S(e.field,r)},className:`rounded border-input`}),n.color&&(0,a.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full shrink-0`,style:{backgroundColor:n.color}}),(0,a.jsx)(`span`,{className:`truncate flex-1`,children:n.label}),n.count!==void 0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.count})]},String(n.value)))})})]},e.field)};return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,u),"data-testid":`user-filters-dropdown`,children:b.length===0?(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`user-filters-empty`,children:`No filter fields`}):(0,a.jsxs)(a.Fragment,{children:[C.map(E),T.length>0&&(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`user-filters-more`,className:`inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md`,children:[(0,a.jsx)(`span`,{children:h}),(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:T.length}),(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-2`,"data-testid":`user-filters-more-content`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:T.map(E)})})]})]})})}function A({tabs:e,showAllRecords:t,allowAddTab:o,onFilterChange:s,className:c,initialTab:l,onSelectionsChange:u}){let[d,f]=n.useState(()=>l&&(l===`__all__`||e.some(e=>e.id===l))?l:e.find(e=>e.default)?.id||(t?`__all__`:e[0]?.id||``)),p=n.useCallback(t=>{f(t),s(t===`__all__`?[]:e.find(e=>e.id===t)?.filters||[]),u?.({_tab:[t]})},[e,s,u]),m=n.useMemo(()=>{let n=[...e];return t&&n.push({id:`__all__`,label:`All records`,filters:[]}),n},[e,t]);return n.useEffect(()=>{if(d&&d!==`__all__`){let t=e.find(e=>e.id===d);t&&s(t.filters||[])}},[]),(0,a.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,c),"data-testid":`user-filters-tabs`,children:[m.map(e=>{let t=e.id??e.name??``;return(0,a.jsx)(`button`,{"data-testid":`filter-tab-${t}`,onClick:()=>p(t),className:(0,r.cn)(`inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0`,d===t?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:e.label},t)}),o&&(0,a.jsx)(`button`,{className:`inline-flex items-center justify-center h-7 w-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted shrink-0`,"data-testid":`filter-tab-add`,title:`Add filter tab`,children:(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5`})})]})}function j(e){switch(e){case`equals`:case`eq`:return`=`;case`notEquals`:case`not_equals`:case`ne`:case`neq`:return`!=`;case`contains`:return`contains`;case`notContains`:case`notcontains`:return`notcontains`;case`greaterThan`:case`gt`:return`>`;case`greaterOrEqual`:case`gte`:return`>=`;case`lessThan`:case`lt`:return`<`;case`lessOrEqual`:case`lte`:return`<=`;case`in`:return`in`;case`notIn`:case`not_in`:case`nin`:return`not in`;case`before`:return`<`;case`after`:return`>`;default:return e}}function M(e){if(!Array.isArray(e)||e.length<3)return e;let[t,n,r]=e;return typeof t==`string`&&(t===`and`||t===`or`)?[t,...e.slice(1).map(e=>Array.isArray(e)?M(e):e)]:n===`in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`=`,r[0]]:[`or`,...r.map(e=>[t,`=`,e])]:n===`not in`&&Array.isArray(r)?r.length===0?[]:r.length===1?[t,`!=`,r[0]]:[`and`,...r.map(e=>[t,`!=`,e])]:e}function N(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function te(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?M(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function ne(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=te(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,j(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function P(e,n){if(!n||n.length===0)return{};for(let r of n){let n=!1,i=(`condition`in r?r.condition:void 0)||(`expression`in r?r.expression:void 0)||void 0;if(i)n=(0,t.evaluatePlainCondition)(i,e);else if(`field`in r&&`operator`in r&&r.field&&r.operator){let t=e[r.field];switch(r.operator){case`equals`:n=t===r.value;break;case`not_equals`:n=t!==r.value;break;case`contains`:n=typeof t==`string`&&typeof r.value==`string`&&t.includes(r.value);break;case`greater_than`:n=typeof t==`number`&&typeof r.value==`number`&&t>r.value;break;case`less_than`:n=typeof t==`number`&&typeof r.value==`number`&&t<r.value;break;case`in`:n=Array.isArray(r.value)&&r.value.includes(t);break}}if(n){let e={};return`style`in r&&r.style&&Object.assign(e,r.style),`backgroundColor`in r&&r.backgroundColor&&(e.backgroundColor=r.backgroundColor),`textColor`in r&&r.textColor&&(e.color=r.textColor),`borderColor`in r&&r.borderColor&&(e.borderColor=r.borderColor),e}}return{}}var F={"list.recordCount":`{{count}} records`,"list.recordCountOne":`{{count}} record`,"list.noItems":`No items found`,"list.noItemsMessage":`There are no records to display. Try adjusting your filters or adding new data.`,"list.firstRunTitle":`Nothing here yet`,"list.firstRunMessage":`Create your first record to get started.`,"list.noMatches":`No matching records`,"list.noMatchesMessage":`No records match your current filters or search. Try adjusting or clearing them.`,"list.loading":`Loading records…`,"list.loadErrorTitle":`Couldn’t load records`,"list.loadErrorMessage":`Something went wrong while loading this data. Check your connection and try again.`,"list.retry":`Retry`,"list.search":`Search`,"list.filter":`Filter`,"list.filterRecords":`Filter Records`,"list.sort":`Sort`,"list.sortRecords":`Sort Records`,"list.group":`Group`,"list.groupBy":`Group By`,"list.export":`Export`,"list.exportAs":`Export as {{format}}`,"list.color":`Color`,"list.rowColor":`Row Color`,"list.colorByField":`Color by field`,"list.clear":`Clear`,"list.none":`None`,"list.hideFields":`Hide fields`,"list.showAll":`Show all`,"list.pullToRefresh":`Pull to refresh`,"list.refreshing":`Refreshing…`,"list.dataLimitReached":`Showing first {{limit}} records. More data may be available.`,"list.addRecord":`Add record`,"list.tabs":`Tabs`,"list.allRecords":`All Records`,"list.share":`Share`,"list.print":`Print`,"list.hideFieldsTitle":`Hide Fields`,"table.rowsPerPage":`Rows per page`,"grid.toolbar.densityMode":`Density`,"grid.toolbar.densityCompact":`Compact`,"grid.toolbar.densityComfortable":`Comfortable`,"grid.toolbar.densitySpacious":`Spacious`,"grid.toolbar.densityCycleHint":`{{label}} (click to cycle)`,"grid.toolbar.densityCycleShortHint":`Click to cycle`,"list.viewSettings":`View settings`,"list.viewSettingsHint":`Grouping, color, density, and visible fields.`},I=(e,t,n)=>n,L=(e,t)=>{let n=F[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n};function re(){try{let e=(0,o.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:L}:{t:e.t}}catch{return{t:L}}}function ie(){try{let{fieldLabel:e,actionLabel:t}=(0,o.useObjectLabel)();return{fieldLabel:e,actionLabel:t}}catch{return{fieldLabel:I,actionLabel:void 0}}}var ae=n.forwardRef(({schema:e,className:u,onViewChange:d,onFilterChange:f,onSortChange:p,onSearchChange:m,onHiddenFieldsChange:h,onColumnStateChange:g,onRowClick:_,showViewSwitcher:v,userFilterSelections:y,onUserFilterSelectionsChange:x,...S},w)=>{let ee=v??e?.showViewSwitcher??!1,{t:T}=re(),{fieldLabel:E,actionLabel:O}=ie(),{translateOptions:k}=(0,o.useSafeFieldLabel)(),A=n.useMemo(()=>e.viewType&&e.viewType!==`list`?e:{...e,viewType:`grid`},[e]),j=n.useCallback((e,t)=>A.objectName?E(A.objectName,e,t):t,[A.objectName,E]),M=n.useCallback(e=>{let t=N(e);return A.objectName&&typeof O==`function`?O(A.objectName,e,t):t},[A.objectName,O]),P=n.useMemo(()=>{let e=A.userActions,t=A.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?A.showSearch!==!1:e.search,showSort:e?.sort===void 0?A.showSort!==!1:e.sort,showFilters:e?.filter===void 0?A.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?A.showDensity!==!1:e.rowHeight,showHideFields:A.showHideFields===!0,showGroup:A.showGroup!==!1,showColor:A.showColor===!0,compactToolbar:A.compactToolbar===!0,showAddRecord:t,addRecordPosition:A.addRecord?.position===`bottom`?`bottom`:`top`}},[A.userActions,A.showSearch,A.showSort,A.showFilters,A.showDensity,A.showHideFields,A.showGroup,A.showColor,A.compactToolbar,A.addRecord,A.userActions?.addRecordForm]),[F,I]=n.useState(A.viewType),[L,ae]=n.useState(``),[oe,se]=n.useState(!1),[ce,le]=n.useState(!1),[R,ue]=n.useState(()=>A.sort&&A.sort.length>0?A.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}}):[]),de=n.useMemo(()=>JSON.stringify(A.sort||[]),[A.sort]);n.useEffect(()=>{A.sort&&A.sort.length>0?ue(A.sort.map(e=>{if(typeof e==`string`){let t=e.trim().split(/\s+/);return{id:crypto.randomUUID(),field:t[0],order:t[1]?.toLowerCase()===`desc`?`desc`:`asc`}}return{id:crypto.randomUUID(),field:e.field,order:e.order||`asc`}})):ue([])},[de]);let[fe,pe]=n.useState(!1),[z,me]=n.useState({id:`root`,logic:`and`,conditions:[]}),B=S.dataSource,[V,he]=n.useState([]),[ge,_e]=n.useState(null),[H,ve]=n.useState(()=>!(Array.isArray(A.data)||A.data&&typeof A.data==`object`&&A.data.provider===`value`&&Array.isArray(A.data.items))),[U,ye]=n.useState(null),[be,xe]=n.useState(!1),[Se,Ce]=n.useState(0),[we,Te]=n.useState(!1);n.useImperativeHandle(w,()=>({refresh:()=>Ce(e=>e+1)}),[]),n.useEffect(()=>{if(!(!B?.onMutation||!A.objectName||A.refreshTrigger))return B.onMutation(e=>{e.resource===A.objectName&&Ce(e=>e+1)})},[B,A.objectName,A.refreshTrigger]);let[Ee,De]=n.useState(void 0),W=Ee??A.pagination?.pageSize??100,[Oe,ke]=n.useState(1),[Ae,je]=n.useState(null),G=n.useMemo(()=>{if(A.grouping?.fields?.length)return A.grouping;let e=typeof A.groupBy==`string`?A.groupBy.trim():``,t=typeof A.groupBy2==`string`?A.groupBy2.trim():``,n=[];return e&&n.push({field:e,order:`asc`,collapsed:!1}),t&&t!==e&&n.push({field:t,order:`asc`,collapsed:!1}),n.length>0?{fields:n}:void 0},[A.grouping,A.groupBy,A.groupBy2]),[K,Me]=n.useState(G),[Ne,Pe]=n.useState(!1),Fe=n.useRef(G);n.useEffect(()=>{Fe.current!==G&&(Fe.current=G,Me(G))},[G]);let[q,Ie]=n.useState(A.rowColor),[Le,Re]=n.useState(!1),[ze,Be]=n.useState([]),Ve=n.useRef(0),[He,Ue]=n.useState([]),We=n.useMemo(()=>{let e=A.userFilters;if(!e)return;if(e.element===`tabs`||e.fields&&e.fields.length>0||!U?.fields)return e;let t=new Set([`select`,`multi-select`,`boolean`]),n=[],r=Array.isArray(U.fields)?U.fields.map(e=>[e.name,e]):Object.entries(U.fields);for(let[e,i]of r)(t.has(i.type)||i.options&&!i.type)&&n.push({field:e,label:j(e,i.label||e),type:i.type===`boolean`?`boolean`:i.type===`multi-select`?`multi-select`:`select`});return n.length===0?e:{...e,fields:n}},[A.userFilters,U,j]),[J,Ge]=n.useState(()=>new Set(A.hiddenFields||[])),Ke=n.useMemo(()=>JSON.stringify(A.hiddenFields||[]),[A.hiddenFields]);n.useEffect(()=>{Ge(new Set(A.hiddenFields||[]))},[Ke]);let qe=n.useCallback(e=>{Ge(e),h?.(Array.from(e))},[h]),[Je,Ye]=n.useState(!1),[Xe,Ze]=n.useState(!1),Y=n.useMemo(()=>{if(A.exportOptions)return Array.isArray(A.exportOptions)?{formats:A.exportOptions}:A.exportOptions},[A.exportOptions]),X=(0,s.useDensityMode)(n.useMemo(()=>A.densityMode?A.densityMode:A.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[A.rowHeight]||`comfortable`:`compact`,[A.densityMode,A.rowHeight]),{onChange:A.onDensityChange}),Qe=n.useMemo(()=>`objectui:gallery:density:${A.objectName??`default`}`,[A.objectName]),[Z,$e]=n.useState(()=>{if(typeof window>`u`)return A.gallery?.cardSize??`medium`;try{let e=window.localStorage.getItem(Qe);if(e===`small`||e===`medium`||e===`large`)return e}catch{}return A.gallery?.cardSize??`medium`}),et=n.useCallback(()=>{$e(e=>{let t=e===`large`?`medium`:e===`medium`?`small`:`large`;try{window.localStorage.setItem(Qe,t)}catch{}return t})},[Qe]),{ref:tt,isRefreshing:nt,pullDistance:rt}=(0,c.usePullToRefresh)({onRefresh:n.useCallback(async()=>{Ce(e=>e+1)},[]),enabled:!!B&&!!A.objectName}),it=n.useMemo(()=>A.id?`listview-${A.objectName}-${A.id}-view`:`listview-${A.objectName}-view`,[A.objectName,A.id]);n.useEffect(()=>{let e=!0;return xe(!1),ye(null),(async()=>{if(!B||!A.objectName){xe(!0);return}if(typeof B.getObjectSchema!=`function`){xe(!0);return}try{let t=await B.getObjectSchema(A.objectName);e&&ye(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&xe(!0)}})(),()=>{e=!1}},[A.objectName,B]);let at=n.useMemo(()=>{let e=Array.isArray(A.fields)?A.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],n=new Set(e),r=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)typeof e==`string`&&e&&n.add(e)};r(A.kanban),r(A.options?.kanban),r(A.calendar),r(A.options?.calendar),r(A.gallery),r(A.options?.gallery),r(A.timeline),r(A.options?.timeline),r(A.gantt),r(A.options?.gantt);let i=n.size>0?Array.from(n):void 0;return(0,t.buildExpandFields)(U?.fields,i)},[U?.fields,A.fields,A.kanban,A.calendar,A.gallery,A.timeline,A.gantt,A.options]),Q=(0,l.usePermissions)();n.useEffect(()=>{let e=!0,t=++Ve.current;if(A.data&&typeof A.data==`object`&&!Array.isArray(A.data)){let e=A.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(L){let e=L.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}he(t),ve(!1),Te(!1);return}}if(Array.isArray(A.data)){let e=A.data;if(L){let t=L.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}he(e),ve(!1),Te(!1);return}return be?((async()=>{if(!B||!A.objectName){ve(!1);return}ve(!0),_e(null);try{let n=[],r=A.filters||[],i=ne(z),a=te(He),o=[...r.length>0?[r]:[],...i.length>0?[i]:[],...a].filter(e=>Array.isArray(e)&&e.length>0);o.length>1?n=[`and`,...o]:o.length===1&&(n=o[0]);let s=R.length>0?R.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,c=(()=>{let e=Array.isArray(A.fields)?A.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],t=Q?.isLoaded&&A.objectName?e.filter(e=>Q.checkField(A.objectName,e,`read`)):e;if(t.length===0)return;let n=new Set([`id`]);for(let e of t)n.add(e);for(let e of at)n.add(e);let r=(()=>{let e=U?.fields;if(!e)return null;let t=Array.isArray(e)?e.map(e=>e?.name).filter(e=>typeof e==`string`):Object.keys(e),n=new Set(t);return n.add(`id`),n.add(`created_at`),n.add(`updated_at`),n})(),i=e=>{typeof e!=`string`||!e||(!r||r.has(e))&&n.add(e)},a=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)i(e)};a(A.kanban),a(A.options?.kanban),a(A.calendar),a(A.options?.calendar),a(A.gallery),a(A.options?.gallery),a(A.timeline),a(A.options?.timeline);{let e=A.timeline??A.options?.timeline;e&&!Array.isArray(e.metaFields)&&(i(`status`),i(`priority`))}return a(A.gantt),a(A.options?.gantt),Array.from(n)})(),l=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,u=F===`grid`&&!K?.fields?.length,d=u?(Oe-1)*W:0,f=await B.find(A.objectName,{...l?{$filter:n}:{},$orderby:s,$top:W,...d>0?{$skip:d}:{},...c?{$select:c}:{},...at.length>0?{$expand:at}:{},...L?{$search:L,...A.searchableFields&&A.searchableFields.length>0?{$searchFields:A.searchableFields}:{}}:{}});if(!e||t!==Ve.current)return;let p=[];Array.isArray(f)?p=f:f&&typeof f==`object`&&(Array.isArray(f.data)?p=f.data:Array.isArray(f.records)?p=f.records:Array.isArray(f.value)&&(p=f.value)),he(p);let m=f&&typeof f==`object`?f.total??f.count:void 0,h=typeof m==`number`?m:null;je(u?h:null),Te(!(u&&h!=null)&&p.length>=W)}catch(e){t===Ve.current&&(console.error(`ListView data fetch error:`,e),he([]),_e(e?.message?String(e.message):String(e??`Unknown error`)))}finally{e&&t===Ve.current&&ve(!1)}})(),()=>{e=!1}):void 0},[A.objectName,A.data,B,A.filters,W,R,z,He,Se,L,A.searchableFields,at,be,A.refreshTrigger,Q,Oe,F,K]);let ot=JSON.stringify([A.objectName,A.filters,W,R,z,He,L,F,K]),st=n.useRef(ot);n.useEffect(()=>{st.current!==ot&&(st.current=ot,ke(1))},[ot]);let ct=n.useMemo(()=>{let e=[`grid`];(A.kanban?.groupByField||A.kanban?.groupField||A.options?.kanban?.groupField)&&e.push(`kanban`),(A.gallery?.coverField||A.gallery?.imageField||A.options?.gallery?.imageField)&&e.push(`gallery`),(A.calendar?.startDateField||A.options?.calendar?.startDateField)&&e.push(`calendar`),(A.timeline?.startDateField||A.options?.timeline?.startDateField||A.options?.timeline?.dateField||A.options?.calendar?.startDateField)&&e.push(`timeline`),(A.gantt?.startDateField||A.options?.gantt?.startDateField)&&e.push(`gantt`),(A.options?.map?.locationField||A.options?.map?.latitudeField&&A.options?.map?.longitudeField)&&e.push(`map`),(A.tree?.parentField||A.options?.tree?.parentField||A.viewType===`tree`)&&e.push(`tree`),A.viewType&&!e.includes(A.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`,`chart`,`tree`].includes(A.viewType)&&e.push(A.viewType);let t=A.appearance?.allowedVisualizations;if(Array.isArray(t)&&t.length>0){let n=t.filter(t=>e.includes(t));return n.length>0?n:[`grid`]}return e},[A.options,A.viewType,A.kanban,A.calendar,A.gantt,A.gallery,A.timeline,A.tree,A.appearance?.allowedVisualizations]);n.useEffect(()=>{A.viewType&&I(A.viewType)},[A.viewType]);let lt=n.useCallback(e=>{I(e);try{localStorage.setItem(it,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}d?.(e)},[it,d]),ut=n.useCallback(e=>{ae(e),m?.(e)},[m]),dt=(0,s.useNavigationOverlay)({navigation:A.navigation,objectName:A.objectName,onNavigate:A.onNavigate,onRowClick:_}),$=n.useMemo(()=>{let e=A.fields||[];if(Array.isArray(e)||(e=[]),Q?.isLoaded&&A.objectName&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t?Q.checkField(A.objectName,t,`read`):!0})),J.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!J.has(t)})),A.fieldOrder&&A.fieldOrder.length>0){let t=new Map(A.fieldOrder.map((e,t)=>[e,t]));e=[...e].sort((e,n)=>{let r=typeof e==`string`?e:e?.name||e?.fieldName||e?.field,i=typeof n==`string`?n:n?.name||n?.fieldName||n?.field;return(t.get(r)??1/0)-(t.get(i)??1/0)})}return e},[A.fields,A.objectName,J,A.fieldOrder,Q]),ft=n.useMemo(()=>{let e=X.mode===`compact`?`compact`:X.mode===`spacious`?`tall`:`medium`,t={objectName:A.objectName,fields:$,filters:A.filters,sort:R,className:`h-full w-full`,showSearch:!1,onRowClick:dt.handleClick,rowHeight:e,hideRowHeightToggle:!0,...A.striped==null?{}:{striped:A.striped},...A.bordered==null?{}:{bordered:A.bordered},...g?{onColumnStateChange:g}:{},...A.columnState?{columnState:A.columnState}:{}};switch(F){default:case`grid`:return{type:`object-grid`,...t,columns:$,...A.conditionalFormatting?{conditionalFormatting:A.conditionalFormatting}:{},...A.inlineEdit==null?{}:{editable:A.inlineEdit},...A.wrapHeaders==null?{}:{wrapHeaders:A.wrapHeaders},...A.virtualScroll==null?{}:{virtualScroll:A.virtualScroll},...A.resizable==null?{}:{resizable:A.resizable},...A.selection?{selection:A.selection}:{},...A.pagination?{pagination:A.pagination}:{},...K?{grouping:K}:{},...q?{rowColor:q}:{},...A.rowActions?{rowActions:A.rowActions}:{},...A.rowActionDefs?{rowActionDefs:A.rowActionDefs}:{},...A.bulkActions?{batchActions:A.bulkActions}:{},...A.bulkActionDefs?{bulkActionDefs:A.bulkActionDefs}:{},...A.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...t,groupBy:A.kanban?.groupField||A.options?.kanban?.groupField||`status`,groupField:A.kanban?.groupField||A.options?.kanban?.groupField||`status`,...A.kanban?.titleField||A.options?.kanban?.titleField?{titleField:A.kanban?.titleField||A.options?.kanban?.titleField}:{},cardFields:A.kanban?.cardFields||$||[],...K?{grouping:K}:{},...A.options?.kanban||{},...A.kanban||{}};case`calendar`:return{type:`object-calendar`,...t,startDateField:A.calendar?.startDateField||A.options?.calendar?.startDateField||`start_date`,endDateField:A.calendar?.endDateField||A.options?.calendar?.endDateField||`end_date`,...A.calendar?.titleField||A.options?.calendar?.titleField?{titleField:A.calendar?.titleField||A.options?.calendar?.titleField}:{},...A.calendar?.defaultView?{defaultView:A.calendar.defaultView}:{},...A.options?.calendar||{},...A.calendar||{}};case`gallery`:{let e={...A.options?.gallery||{},...A.gallery||{},cardSize:Z};return{type:`object-gallery`,...t,gallery:Object.keys(e).length>0?e:void 0,imageField:A.gallery?.coverField||A.gallery?.imageField||A.options?.gallery?.imageField,titleField:A.gallery?.titleField||A.options?.gallery?.titleField||`name`,subtitleField:A.gallery?.subtitleField||A.options?.gallery?.subtitleField,...K?{grouping:K}:{}}}case`timeline`:{let e={...A.options?.timeline||{},...A.timeline||{}};return{type:`object-timeline`,...t,timeline:Object.keys(e).length>0?e:void 0,startDateField:A.timeline?.startDateField||A.options?.timeline?.startDateField||A.options?.timeline?.dateField||`created_at`,titleField:A.timeline?.titleField||A.options?.timeline?.titleField||`name`,...A.timeline?.endDateField?{endDateField:A.timeline.endDateField}:{},...A.timeline?.groupByField?{groupByField:A.timeline.groupByField}:{},...A.timeline?.colorField?{colorField:A.timeline.colorField}:{},...A.timeline?.scale?{scale:A.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...t,startDateField:A.gantt?.startDateField||A.options?.gantt?.startDateField||`start_date`,endDateField:A.gantt?.endDateField||A.options?.gantt?.endDateField||`end_date`,progressField:A.gantt?.progressField||A.options?.gantt?.progressField||`progress`,dependenciesField:A.gantt?.dependenciesField||A.options?.gantt?.dependenciesField||`dependencies`,...A.gantt?.titleField?{titleField:A.gantt.titleField}:{},...A.options?.gantt||{},...A.gantt||{}};case`map`:return{type:`object-map`,...t,locationField:A.options?.map?.locationField||`location`,...A.options?.map||{}};case`tree`:{let e=A.tree||A.options?.tree||{};return{type:`object-tree`,...t,parentField:e.parentField,labelField:e.labelField||e.titleField||`name`,fields:e.fields||$,defaultExpandedDepth:e.defaultExpandedDepth,...e}}case`chart`:{let e=A.chart||A.options?.chart||{};if(e.dataset){let t=Array.isArray(e.dimensions)?e.dimensions:[],n=Array.isArray(e.values)?e.values:[];return{type:`object-chart`,dataset:e.dataset,dimensions:t,values:n,chartType:e.chartType||`bar`,xAxisKey:t[0],series:n.map(e=>({dataKey:e,label:e})),className:`h-[400px] w-full`}}let t=Array.isArray(e.yAxisFields)&&e.yAxisFields[0]||e.valueField||`value`,n=e.xAxisField||e.categoryField||`name`;return{type:`object-chart`,objectName:A.objectName,chartType:e.chartType||`bar`,filters:A.filters,aggregate:{field:t,function:e.aggregation||`count`,groupBy:n},xAxisKey:n,series:[{dataKey:t,label:t}],className:`h-[400px] w-full`}}}},[F,A,R,$,K,q,dt.handleClick,X.mode,Z]),pt=z.conditions&&z.conditions.length>0,mt=n.useMemo(()=>{let e,t=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t.map(e=>({value:e?.value??e,label:e?.label??String(e?.value??e),...e&&typeof e==`object`?e:{}})):Object.entries(t).map(([e,t])=>({value:e,label:t?.label||e,...t}));return A.objectName?k(A.objectName,e,n):n};if(e=U?.fields?Object.entries(U.fields).map(([e,n])=>({value:e,label:j(e,n.label||e),type:n.type||`text`,options:t(e,n.options),referenceTo:n.reference_to||n.reference,displayField:n.display_field||n.reference_field,idField:n.id_field})):(A.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let n=e.name||e.fieldName;return{value:n,label:j(n,e.label||e.name),type:e.type||`text`,options:t(n,e.options),referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),A.filterableFields&&A.filterableFields.length>0){let t=new Set(A.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[U,A.fields,A.filterableFields,A.objectName,j,k]),ht=n.useCallback(e=>{let t=Y,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||A.objectName||`export`,a=n>0?V.slice(0,n):V;if(e===`csv`){let e=$.map(e=>typeof e==`string`?e:e.name||e.fieldName||e.field),t=[];r&&t.push(e.join(`,`)),a.forEach(n=>{t.push(e.map(e=>{let t=n[e],r;return r=t==null?``:Array.isArray(t)?t.map(e=>typeof e==`object`&&e?JSON.stringify(e):String(e??``)).join(`; `):typeof t==`object`?JSON.stringify(t):String(t),r.includes(`,`)||r.includes(`"`)||r.includes(`
2
2
  `)||r.includes(`\r`)?`"${r.replace(/"/g,`""`)}"`:r}).join(`,`))});let n=new Blob([t.join(`
3
- `)],{type:`text/csv;charset=utf-8;`}),o=URL.createObjectURL(n),s=document.createElement(`a`);s.href=o,s.download=`${i}.csv`,s.click(),URL.revokeObjectURL(o)}else if(e===`json`){let e=new Blob([JSON.stringify(a,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i}.json`,n.click(),URL.revokeObjectURL(t)}qe(!1)},[B,$,Y,k.objectName]),ut=n.useMemo(()=>(k.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:A(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:A(t,e.label||e.name||e.field)}}),[k.fields,A]);return(0,a.jsxs)(`div`,{ref:Ze,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,u),...k.aria?.label?{"aria-label":k.aria.label}:{},...k.aria?.describedBy?{"aria-describedby":k.aria.describedBy}:{},...k.aria?.live?{"aria-live":k.aria.live}:{},role:`region`,"aria-busy":V||void 0,"data-state":V?`loading`:`idle`,children:[$e>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:$e},children:w(Qe?`list.refreshing`:`list.pullToRefresh`)}),k.description&&k.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`px-4 pt-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof k.description==`string`?k.description:``}),(0,a.jsxs)(`div`,{className:`border-b px-2 sm:px-4 py-1.5 flex items-center justify-between gap-1 sm:gap-2 bg-background`,children:[(0,a.jsx)(`div`,{className:`flex items-center gap-2 overflow-x-auto min-w-0`,children:Be&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0 overflow-x-auto`,"data-testid":`user-filters`,children:(0,a.jsx)(E,{config:Be,objectDef:U,data:B,onFilterChange:ze,maxVisible:3,initialSelections:y,onSelectionsChange:x})})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0 shrink-0 rounded-lg border border-border bg-muted/40 p-0.5 shadow-sm`,children:[te&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{currentView:P,availableViews:nt,onViewChange:rt}),(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5`})]}),N.showHideFields&&!N.compactToolbar&&(0,a.jsxs)(r.Popover,{open:We,onOpenChange:Ge,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,J.size>0&&`text-primary`),children:[(0,a.jsx)(i.EyeOff,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.hideFields`)}),J.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:J.size})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:w(`list.hideFieldsTitle`)}),J.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Ue(new Set),children:w(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:ut.map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer`,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:!J.has(e.name),onChange:()=>{let t=new Set(J);t.has(e.name)?t.delete(e.name):t.add(e.name),Ue(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),N.showHideFields&&!N.compactToolbar&&(N.showFilters||N.showSort||N.showGroup)&&(0,a.jsx)(`div`,{className:`hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0`}),N.showFilters&&(0,a.jsxs)(r.Popover,{open:pe,onOpenChange:me,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,st&&`text-foreground font-medium`),children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.filter`)}),st&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:R.conditions?.length||0})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:w(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:ct,value:R,onChange:e=>{he(e),f&&f(e)}})]})})]}),N.showGroup&&!N.compactToolbar&&(0,a.jsxs)(r.Popover,{open:ke,onOpenChange:Ae,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,K&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Group,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.group`)}),K&&K.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:K.fields.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-72 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:w(`list.groupBy`)}),K&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Oe(void 0),"data-testid":`clear-grouping`,children:w(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:K,fieldOptions:ut.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:w(`list.addGroup`,{defaultValue:`Add group field`}),collapseTitle:w(`list.collapsedByDefault`,{defaultValue:`Collapsed by default`}),removeTitle:w(`list.removeGroup`,{defaultValue:`Remove`})},onChange:e=>Oe(e)})})]})})]}),N.showSort&&(0,a.jsxs)(r.Popover,{open:le,onOpenChange:ue,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,L.length>0&&`text-foreground font-medium`),children:[(0,a.jsx)(i.ArrowUpDown,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.sort`)}),L.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:L.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:w(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:ct,value:L,onChange:e=>{de(e),p&&p(e)}})]})})]}),!N.compactToolbar&&(N.showFilters||N.showSort||N.showGroup)&&(N.showColor||N.showDensity)&&(0,a.jsx)(`div`,{className:`hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0`}),N.showColor&&!N.compactToolbar&&(0,a.jsxs)(r.Popover,{open:Ne,onOpenChange:Pe,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,q&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Paintbrush,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.color`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:w(`list.rowColor`)}),q&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Me(void 0),"data-testid":`clear-row-color`,children:w(`list.clear`)})]}),(0,a.jsxs)(`div`,{className:`space-y-2`,"data-testid":`color-field-list`,children:[(0,a.jsx)(`label`,{className:`text-xs text-muted-foreground`,children:w(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:q?.field||``,onChange:e=>{let t=e.target.value;Me(t?{field:t,colors:q?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:w(`list.none`)}),ut.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),N.showDensity&&!N.compactToolbar&&P!==`gallery`&&(()=>{let e=X.mode===`compact`?i.Rows4:X.mode===`comfortable`?i.Rows3:i.Rows2,t=X.mode===`compact`?w(`grid.toolbar.densityCompact`,{defaultValue:`Compact`}):X.mode===`comfortable`?w(`grid.toolbar.densityComfortable`,{defaultValue:`Comfortable`}):w(`grid.toolbar.densitySpacious`,{defaultValue:`Spacious`}),n=`${w(`grid.toolbar.densityMode`,{defaultValue:`Density`})}: ${t}`,o=w(`grid.toolbar.densityCycleHint`,{defaultValue:`{{label}} (click to cycle)`,label:n});return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":n,className:(0,r.cn)(`hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,X.mode!==`compact`&&`text-foreground font-medium`),onClick:X.cycle,title:o,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),N.showDensity&&!N.compactToolbar&&P===`gallery`&&(()=>{let e=Z===`small`?i.Rows4:Z===`medium`?i.Rows3:i.Rows2,t=Z===`small`?w(`grid.toolbar.densityCompact`,{defaultValue:`Compact`}):Z===`medium`?w(`grid.toolbar.densityComfortable`,{defaultValue:`Comfortable`}):w(`grid.toolbar.densitySpacious`,{defaultValue:`Spacious`}),n=`${w(`grid.toolbar.densityMode`,{defaultValue:`Density`})}: ${t}`,o=w(`grid.toolbar.densityCycleHint`,{defaultValue:`{{label}} (click to cycle)`,label:n});return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":n,className:(0,r.cn)(`hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,Z!==`small`&&`text-foreground font-medium`),onClick:Xe,title:o,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),N.compactToolbar&&(N.showGroup||N.showColor||N.showDensity||N.showHideFields)&&(0,a.jsx)(C,{t:w,allFields:ut,showGroup:N.showGroup,groupingConfig:K,setGroupingConfig:Oe,showColor:N.showColor,rowColorConfig:q,setRowColorConfig:Me,showDensity:N.showDensity,density:X,showHideFields:N.showHideFields,hiddenFields:J,updateHiddenFields:Ue}),(N.showColor||N.showDensity||N.compactToolbar)&&Y&&k.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-5 w-px bg-border/50 mx-1 shrink-0`}),Y&&k.allowExport!==!1&&(0,a.jsxs)(r.Popover,{open:Ke,onOpenChange:qe,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.export`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-48 p-2`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:(Y.formats||[`csv`,`json`]).map(e=>(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`w-full justify-start h-8 text-xs`,onClick:()=>lt(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),w(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(k.sharing?.enabled||k.sharing?.type)&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,title:`Sharing: ${k.sharing?.visibility||k.sharing?.type||`private`}`,"data-testid":`share-button`,children:[(0,a.jsx)(i.Share2,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.share`)})]}),k.allowPrinting&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,onClick:()=>window.print(),"data-testid":`print-button`,children:[(0,a.jsx)(i.Printer,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.print`)})]}),(()=>{let e=k.allowPrinting||k.sharing?.enabled||k.sharing?.type||Y&&k.allowExport!==!1;return N.showSearch&&e?(0,a.jsx)(`div`,{className:`h-5 w-px bg-border/50 mx-1 shrink-0`}):null})(),N.showSearch&&(0,a.jsxs)(r.Popover,{open:se,onOpenChange:ce,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,F&&`text-foreground font-medium`),"data-testid":`search-icon-button`,title:w(`list.search`),children:(0,a.jsx)(i.Search,{className:`h-3.5 w-3.5`})})}),(0,a.jsx)(r.PopoverContent,{align:`end`,className:`w-[calc(100vw-2rem)] sm:w-64 p-2`,"data-testid":`search-popover`,children:(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(i.Search,{className:`absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,a.jsx)(r.Input,{placeholder:w(`list.search`)+`...`,value:F,onChange:e=>it(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),F&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20`,onClick:()=>it(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),N.showAddRecord&&N.addRecordPosition===`top`&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>S.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.addRecord`)})]})]})]}),(0,a.jsxs)(`div`,{className:`flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200`,children:[(0,a.jsx)(r.RefreshIndicator,{active:V&&B.length>0}),_e&&B.length===0?(0,a.jsx)(r.DataEmptyState,{"data-testid":`list-error-state`,className:`h-full min-h-[200px] p-8 gap-1 [&>h3]:text-lg [&>h3]:font-medium [&>h3]:text-foreground [&>p]:max-w-md`,icon:(0,a.jsx)(i.AlertTriangle,{className:`h-12 w-12 text-destructive/60`}),iconWrapperClassName:`mb-3`,title:w(`list.loadErrorTitle`),description:w(`list.loadErrorMessage`),action:(0,a.jsxs)(r.Button,{variant:`outline`,size:`sm`,"data-testid":`list-error-retry`,onClick:()=>Ce(e=>e+1),children:[(0,a.jsx)(i.RotateCw,{className:`h-4 w-4 mr-1.5`}),w(`list.retry`)]})}):V&&B.length===0?(0,a.jsxs)(`div`,{className:`flex flex-col h-full min-h-[200px] p-4 gap-2`,"data-testid":`list-loading`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,a.jsx)(`span`,{className:`sr-only`,children:w(`list.loading`)}),[0,1,2,3,4,5].map(e=>(0,a.jsx)(`div`,{className:`h-9 rounded bg-muted/60 animate-pulse`,style:{opacity:Math.max(.25,1-e*.12)}},e))]}):!V&&B.length===0&&P===`grid`?(()=>{let e=k.emptyState?.icon,t=e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??i.Inbox:i.Inbox,n=!!(F&&F.trim())||Array.isArray(Re)&&Re.length>0||Array.isArray(R?.conditions)&&R.conditions.length>0,o=(typeof k.emptyState?.title==`string`?k.emptyState.title:void 0)??w(n?`list.noMatches`:`list.firstRunTitle`),s=(typeof k.emptyState?.message==`string`?k.emptyState.message:void 0)??w(n?`list.noMatchesMessage`:`list.firstRunMessage`);return(0,a.jsx)(r.DataEmptyState,{"data-testid":`empty-state`,className:`h-full min-h-[200px] p-8 gap-1 [&>h3]:text-lg [&>h3]:font-medium [&>h3]:text-foreground [&>p]:max-w-md`,icon:(0,a.jsx)(t,{className:`h-12 w-12 text-muted-foreground/50`}),iconWrapperClassName:`mb-3`,title:o,description:s,action:N.showAddRecord?(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,"data-testid":`empty-state-add-record`,onClick:()=>S.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),w(`list.addRecord`)]}):void 0})})():(0,a.jsx)(s.SchemaRenderer,{schema:ot,...S,data:B,loading:V,onRowSelect:Ie})]},P),N.showAddRecord&&N.addRecordPosition===`bottom`&&(0,a.jsx)(`div`,{className:`border-t px-2 sm:px-4 py-1 bg-background shrink-0`,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>S.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:w(`list.addRecord`)})]})}),k.bulkActions&&k.bulkActions.length>0&&Fe.length>0&&P!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t border-primary/30 px-4 py-2 flex items-center gap-2 text-xs bg-primary/10 text-foreground shrink-0 shadow-sm`,role:`region`,"aria-label":`Bulk actions`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsx)(i.CheckSquare,{className:`h-3.5 w-3.5 text-primary shrink-0`}),(0,a.jsxs)(`span`,{className:`font-medium`,children:[Fe.length,` `,Fe.length===1?`item`:`items`,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1.5 ml-3`,children:k.bulkActions.map(e=>{let t=String(e).toLowerCase(),n=t.includes(`delete`)||t.includes(`remove`)||t.includes(`destroy`),o=n?i.Trash2:null;return(0,a.jsxs)(r.Button,{variant:n?`destructive`:`outline`,size:`sm`,className:`h-7 px-2.5 text-xs gap-1.5`,onClick:()=>S.onBulkAction?.(e,Fe),"data-testid":`bulk-action-${e}`,children:[o&&(0,a.jsx)(o,{className:`h-3 w-3`}),j(e)]},e)})}),(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs ml-auto gap-1`,onClick:()=>Ie([]),children:[(0,a.jsx)(i.X,{className:`h-3 w-3`}),`Clear`]})]}),!V&&B.length>0&&k.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{className:`font-medium text-foreground/80`,children:B.length===1?w(`list.recordCountOne`,{count:B.length}):w(`list.recordCount`,{count:B.length})}),we&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:w(`list.dataLimitReached`,{limit:W})}),k.pagination?.pageSizeOptions&&k.pagination.pageSizeOptions.length>0&&(0,a.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,a.jsx)(`span`,{children:w(`table.rowsPerPage`,{defaultValue:`Rows per page`})}),(0,a.jsx)(`select`,{"data-testid":`page-size-selector`,className:`h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background`,value:String(W),onChange:e=>{let t=Number(e.target.value);De(t),S.onPageSizeChange&&S.onPageSizeChange(t)},children:k.pagination.pageSizeOptions.map(e=>(0,a.jsx)(`option`,{value:String(e),children:e},e))})]})]}),at.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...at,title:k.label?`${k.label} Detail`:k.objectName?`${k.objectName.charAt(0).toUpperCase()+k.objectName.slice(1)} Detail`:`Record Detail`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})});I.displayName=`ListView`;var se={small:`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6`,medium:`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4`,large:`grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3`},ce={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},le=new Set([`number`,`currency`,`percent`,`integer`,`decimal`]),ue=[{bg:`from-indigo-500/15 via-indigo-500/5 to-purple-500/10`,ring:`ring-indigo-500/15`,text:`text-indigo-600/70 dark:text-indigo-300/70`},{bg:`from-sky-500/15 via-sky-500/5 to-cyan-500/10`,ring:`ring-sky-500/15`,text:`text-sky-600/70 dark:text-sky-300/70`},{bg:`from-emerald-500/15 via-emerald-500/5 to-teal-500/10`,ring:`ring-emerald-500/15`,text:`text-emerald-600/70 dark:text-emerald-300/70`},{bg:`from-amber-500/15 via-amber-500/5 to-orange-500/10`,ring:`ring-amber-500/15`,text:`text-amber-600/70 dark:text-amber-300/70`},{bg:`from-rose-500/15 via-rose-500/5 to-pink-500/10`,ring:`ring-rose-500/15`,text:`text-rose-600/70 dark:text-rose-300/70`},{bg:`from-violet-500/15 via-violet-500/5 to-fuchsia-500/10`,ring:`ring-violet-500/15`,text:`text-violet-600/70 dark:text-violet-300/70`}];function L(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return ue[Math.abs(t)%ue.length]}var de=({imageUrl:e,title:t,coverFit:i,aspectClass:o,placeholder:s,hidden:c})=>{let[l,u]=(0,n.useState)(!1),d=!!e&&!l;return(0,a.jsx)(`div`,{className:(0,r.cn)(`w-full overflow-hidden relative`,o),hidden:c,children:d?i===`contain`?(0,a.jsx)(`div`,{className:(0,r.cn)(`flex h-full w-full items-center justify-center bg-gradient-to-br`,s.bg),children:(0,a.jsx)(`img`,{src:e,alt:t,loading:`lazy`,onError:()=>u(!0),className:`h-1/2 w-1/2 max-h-24 max-w-24 object-contain transition-transform duration-300 ease-out group-hover:scale-[1.08]`})}):(0,a.jsx)(`img`,{src:e,alt:t,loading:`lazy`,onError:()=>u(!0),className:`h-full w-full object-cover transition-transform duration-300 ease-out group-hover:scale-[1.04]`}):(0,a.jsx)(`div`,{className:(0,r.cn)(`flex h-full w-full items-center justify-center bg-gradient-to-br ring-1 ring-inset`,s.bg,s.ring),children:(0,a.jsx)(`span`,{className:(0,r.cn)(`text-5xl font-semibold tracking-tight opacity-90`,s.text),children:t[0]?.toUpperCase()})})})},fe=({imageUrl:e,title:t,placeholder:i})=>{let[o,s]=(0,n.useState)(!1),c=!!e&&!o;return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br ring-1 ring-inset`,i.bg,i.ring),children:c?(0,a.jsx)(`img`,{src:e,alt:t,loading:`lazy`,onError:()=>s(!0),className:`h-6 w-6 object-contain transition-transform duration-300 ease-out group-hover:scale-110`}):(0,a.jsx)(`span`,{className:(0,r.cn)(`text-base font-semibold`,i.text),children:t[0]?.toUpperCase()})})},pe=e=>{let{schema:o}=e,c=(0,n.useContext)(s.SchemaRendererContext),l=e.dataSource||c?.dataSource,d=(0,s.useDataScope)(o.bind),[f,p]=(0,n.useState)([]),[m,h]=(0,n.useState)(!1),[g,_]=(0,n.useState)(null),v=(0,s.useNavigationOverlay)({navigation:o.navigation,objectName:o.objectName,onRowClick:e.onRowClick??e.onCardClick}),y=o.gallery,b=y?.coverField??o.imageField??`image`,x=y?.coverFit??`cover`,S=y?.cardSize??`medium`,C=y?.titleField??o.titleField??`name`,ee=y?.visibleFields,{fieldLabel:te,fieldOptionLabel:w}=(0,s.useSafeFieldLabel)(),T=(0,n.useCallback)(e=>{let t=g?.fields?.[e],n={name:e};if(t){t.type&&(n.type=t.type),t.label&&(n.label=t.label),t.options&&(n.options=t.options),t.currency&&(n.currency=t.currency),t.precision!==void 0&&(n.precision=t.precision),t.format&&(n.format=t.format);let e=t.reference_to||t.reference;e&&(n.reference_to=e),t.reference_field&&(n.reference_field=t.reference_field)}if(o.objectName){let t=String(n.label??e);n.label=te(o.objectName,e,t)}return o.objectName&&Array.isArray(n.options)&&(n.options=n.options.map(t=>{let n=String(t?.value??t),r=String(t?.label??n);return{...t,value:n,label:w(o.objectName,e,n,r)}})),n},[g,o.objectName,te,w]);(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!o.objectName))try{let t=await l.getObjectSchema(o.objectName);e&&_(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[o.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){p(e.data);return}return o.objectName&&!d&&!o.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!o.objectName)){n&&h(!0);try{let e=(0,t.buildExpandFields)(g?.fields),r=await l.find(o.objectName,{$filter:o.filter,...e.length>0?{$expand:e}:{}}),i=[];if(Array.isArray(r))i=r;else if(r&&typeof r==`object`){let e=r;Array.isArray(e.records)?i=e.records:Array.isArray(e.data)&&(i=e.data)}n&&p(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&h(!1)}}})(),()=>{n=!1}},[o.objectName,l,d,o.data,o.filter,e.data,g]);let E=e.data||d||o.data||f||[],D=(0,n.useMemo)(()=>E.some(e=>typeof e[b]==`string`&&!!e[b]),[E,b]),O=o.grouping?.fields,k=!!(O&&O.length>0),[A,j]=(0,n.useState)({}),M=(0,n.useMemo)(()=>O?O.some(e=>e.collapsed):!1,[O]),ne=(0,n.useCallback)(e=>{j(t=>({...t,[e]:t[e]===void 0?!M:!t[e]}))},[M]),re=(0,n.useMemo)(()=>{if(!k||!O)return[];let e=new Map,t=[];for(let n of E){let r=O.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=O.map(e=>{let t=n[e.field];return t!=null&&t!==``?String(t):`(empty)`}).join(` / `);e.set(r,{label:i,items:[]}),t.push(r)}e.get(r).items.push(n)}let n=O[0]?.order??`asc`;return t.sort((e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`});return n===`desc`?-r:r}),t.map(t=>{let n=e.get(t),r=t in A?A[t]:M;return{key:t,label:n.label,items:n.items,collapsed:r}})},[E,O,k,A,M]);if(m&&!E.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!E.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No items to display`});let N=e=>!ee||ee.length===0?null:(0,a.jsx)(`div`,{className:`mt-1.5 space-y-1`,children:ee.map(t=>{let n=e[t];if(n==null||n===``)return null;let i=T(t),o=(0,u.resolveCellRendererType)(i)||i.type||`text`,s=(0,u.getCellRenderer)(o),c=i?.label&&String(i.label).trim()?String(i.label):void 0,l=c!=null&&le.has(o);return(0,a.jsxs)(`div`,{className:(0,r.cn)(`text-xs text-muted-foreground truncate [&_*]:!text-xs`,l&&`flex items-baseline gap-1.5`),onClick:e=>{e.target.closest(`a,button`)&&e.stopPropagation()},children:[l&&(0,a.jsx)(`span`,{className:`shrink-0 text-muted-foreground/70 tabular-nums`,children:c}),(0,a.jsx)(s,{value:n,field:i})]},t)})}),P=(t,n)=>{let i=t.id??t._id??n,s=String(t[C]??`Untitled`),c=t[b],l=L(String(i)+`|`+s),u=(0,r.cn)(`group relative overflow-hidden border-border/60 bg-card`,`transition-all duration-200 ease-out`,`hover:shadow-lg hover:border-border hover:-translate-y-0.5`,(e.onCardClick||e.onRowClick||o.navigation)&&`cursor-pointer`);return D&&x===`contain`?(0,a.jsxs)(r.Card,{role:`listitem`,className:u,onClick:e=>v.handleClick(t,e),children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:(0,r.cn)(`absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r`,l.bg)}),(0,a.jsx)(r.CardContent,{className:`p-4`,children:(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(fe,{imageUrl:c,title:s,placeholder:l}),(0,a.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,a.jsx)(`h3`,{className:`font-semibold tracking-tight truncate text-sm leading-tight text-foreground`,title:s,children:s}),N(t)]})]})})]},i):(0,a.jsxs)(r.Card,{role:`listitem`,className:u,onClick:e=>v.handleClick(t,e),children:[!D&&(0,a.jsx)(`div`,{"aria-hidden":!0,className:(0,r.cn)(`absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r`,l.bg)}),(0,a.jsx)(de,{imageUrl:c,title:s,coverFit:x,aspectClass:ce[S],placeholder:l,hidden:!D}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,D&&`border-t border-border/60`),children:[(0,a.jsx)(`h3`,{className:`font-semibold tracking-tight truncate text-sm leading-tight text-foreground`,title:s,children:s}),N(t)]})]},i)},ie=e=>(0,a.jsx)(`div`,{className:(0,r.cn)(`grid gap-4 p-4 auto-rows-min content-start`,se[S],o.className),role:`list`,children:e.map((e,t)=>P(e,t))});return(0,a.jsxs)(a.Fragment,{children:[k?(0,a.jsx)(`div`,{className:`space-y-2`,children:re.map(e=>(0,a.jsxs)(`div`,{className:`border rounded-md`,children:[(0,a.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-3 py-2 text-sm font-medium text-left bg-muted/50 hover:bg-muted transition-colors`,onClick:()=>ne(e.key),children:[e.collapsed?(0,a.jsx)(i.ChevronRight,{className:`h-4 w-4 shrink-0`}):(0,a.jsx)(i.ChevronDown,{className:`h-4 w-4 shrink-0`}),(0,a.jsx)(`span`,{children:e.label}),(0,a.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.items.length})]}),!e.collapsed&&ie(e.items)]},e.key))}):ie(E),v.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...v,title:`Gallery Item`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})};t.ComponentRegistry.register(`object-gallery`,pe,{namespace:`plugin-list`,label:`Gallery View`,category:`view`});function me(e){return e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null}function R(e){return e.filter(e=>e.pinned||e.visible!==`false`&&e.visible!==!1).sort((e,t)=>(e.order??0)-(t.order??0))}t.ComponentRegistry.register(`list-view`,I,{namespace:`plugin-list`,label:`List View`,category:`Views`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}],defaultProps:{objectName:``,viewType:`grid`,fields:[],filters:[],sort:[],options:{}}}),t.ComponentRegistry.register(`list`,I,{namespace:`view`,skipFallback:!0,category:`view`,label:`List`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}]}),e.ListView=I,e.ObjectGallery=pe,e.TabBar=({tabs:e,activeTab:t,onTabChange:i,className:o})=>{let s=n.useMemo(()=>R(e),[e]),c=n.useMemo(()=>s.find(e=>e.isDefault)?.name??s[0]?.name,[s]),[l,u]=n.useState(c),d=t??l,f=n.useCallback(e=>{u(e.name),i?.(e)},[i]);return s.length===0?null:(0,a.jsx)(`div`,{className:(0,r.cn)(`px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background`,o),"data-testid":`view-tabs`,role:`tablist`,children:s.map(e=>{let t=me(e.icon),n=d===e.name;return(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150`,n?`font-medium text-foreground bg-muted`:`text-muted-foreground hover:text-foreground hover:bg-transparent`),"data-testid":`view-tab-${e.name}`,role:`tab`,"aria-selected":n,onClick:()=>f(e),children:[t&&(0,a.jsx)(t,{className:`h-3 w-3 mr-1.5`}),e.label]},e.name)})})},e.TabBarSelect=({tabs:e,activeTab:t,onTabChange:o,className:s})=>{let c=n.useMemo(()=>R(e),[e]),l=n.useMemo(()=>c.find(e=>e.isDefault)?.name??c[0]?.name,[c]),[u,d]=n.useState(l),f=t??u,p=n.useMemo(()=>c.find(e=>e.name===f)??c[0],[c,f]),m=n.useCallback(e=>{d(e.name),o?.(e)},[o]);if(c.length===0)return null;let h=me(p?.icon);return(0,a.jsx)(`div`,{className:(0,r.cn)(`px-2 py-1`,s),"data-testid":`view-tabs-select`,children:(0,a.jsxs)(r.DropdownMenu,{children:[(0,a.jsx)(r.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs font-medium text-foreground gap-1.5 max-w-[60vw] truncate`,"aria-label":`Switch view`,children:[h&&(0,a.jsx)(h,{className:`h-3.5 w-3.5 shrink-0`}),(0,a.jsx)(`span`,{className:`truncate`,children:p?.label??``}),(0,a.jsx)(i.ChevronDown,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]})}),(0,a.jsx)(r.DropdownMenuContent,{align:`start`,className:`w-56 max-h-72 overflow-y-auto`,children:c.map(e=>{let t=me(e.icon);return(0,a.jsxs)(r.DropdownMenuItem,{onClick:()=>m(e),className:(0,r.cn)(`text-sm`,f===e.name&&`font-medium bg-muted`),"data-testid":`view-tab-select-${e.name}`,children:[t&&(0,a.jsx)(t,{className:`h-3.5 w-3.5 mr-2 shrink-0`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name)})})]})})},e.UserFilters=E,e.ViewSwitcher=x,e.ViewSwitcherDropdown=b,e.evaluateConditionalFormatting=N,e.normalizeFilterCondition=j,e.normalizeFilters=ne});
3
+ `)],{type:`text/csv;charset=utf-8;`}),o=URL.createObjectURL(n),s=document.createElement(`a`);s.href=o,s.download=`${i}.csv`,s.click(),URL.revokeObjectURL(o)}else if(e===`json`){let e=new Blob([JSON.stringify(a,null,2)],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${i}.json`,n.click(),URL.revokeObjectURL(t)}Ze(!1)},[V,$,Y,A.objectName]),gt=n.useMemo(()=>(A.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:j(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:j(t,e.label||e.name||e.field)}}),[A.fields,j]);return(0,a.jsxs)(`div`,{ref:tt,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,u),...A.aria?.label?{"aria-label":A.aria.label}:{},...A.aria?.describedBy?{"aria-describedby":A.aria.describedBy}:{},...A.aria?.live?{"aria-live":A.aria.live}:{},role:`region`,"aria-busy":H||void 0,"data-state":H?`loading`:`idle`,children:[rt>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:rt},children:T(nt?`list.refreshing`:`list.pullToRefresh`)}),A.description&&A.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`px-4 pt-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof A.description==`string`?A.description:``}),(0,a.jsxs)(`div`,{className:`border-b px-2 sm:px-4 py-1.5 flex items-center justify-between gap-1 sm:gap-2 bg-background`,children:[(0,a.jsx)(`div`,{className:`flex items-center gap-2 overflow-x-auto min-w-0`,children:We&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0 overflow-x-auto`,"data-testid":`user-filters`,children:(0,a.jsx)(D,{config:We,objectDef:U,data:V,onFilterChange:Ue,maxVisible:3,initialSelections:y,onSelectionsChange:x})})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0 shrink-0 rounded-lg border border-border bg-muted/40 p-0.5 shadow-sm`,children:[ee&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b,{currentView:F,availableViews:ct,onViewChange:lt}),(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5`})]}),P.showHideFields&&!P.compactToolbar&&(0,a.jsxs)(r.Popover,{open:Je,onOpenChange:Ye,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,J.size>0&&`text-primary`),children:[(0,a.jsx)(i.EyeOff,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.hideFields`)}),J.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:J.size})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:T(`list.hideFieldsTitle`)}),J.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>qe(new Set),children:T(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:gt.map(e=>(0,a.jsxs)(`label`,{className:`flex items-center gap-2 text-sm py-1 px-1 rounded hover:bg-muted cursor-pointer`,children:[(0,a.jsx)(`input`,{type:`checkbox`,checked:!J.has(e.name),onChange:()=>{let t=new Set(J);t.has(e.name)?t.delete(e.name):t.add(e.name),qe(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),P.showHideFields&&!P.compactToolbar&&(P.showFilters||P.showSort||P.showGroup)&&(0,a.jsx)(`div`,{className:`hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0`}),P.showFilters&&(0,a.jsxs)(r.Popover,{open:fe,onOpenChange:pe,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,pt&&`text-foreground font-medium`),children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.filter`)}),pt&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:z.conditions?.length||0})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:T(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:mt,value:z,onChange:e=>{me(e),f&&f(e)}})]})})]}),P.showGroup&&!P.compactToolbar&&(0,a.jsxs)(r.Popover,{open:Ne,onOpenChange:Pe,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,K&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Group,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.group`)}),K&&K.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:K.fields.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-72 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:T(`list.groupBy`)}),K&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Me(void 0),"data-testid":`clear-grouping`,children:T(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:K,fieldOptions:gt.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:T(`list.addGroup`,{defaultValue:`Add group field`}),collapseTitle:T(`list.collapsedByDefault`,{defaultValue:`Collapsed by default`}),removeTitle:T(`list.removeGroup`,{defaultValue:`Remove`})},onChange:e=>Me(e)})})]})})]}),P.showSort&&(0,a.jsxs)(r.Popover,{open:ce,onOpenChange:le,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,R.length>0&&`text-foreground font-medium`),children:[(0,a.jsx)(i.ArrowUpDown,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.sort`)}),R.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:R.length})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-[calc(100vw-2rem)] sm:w-[600px] max-w-[600px] p-3 sm:p-4`,children:(0,a.jsxs)(`div`,{className:`space-y-4`,children:[(0,a.jsx)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:T(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:mt,value:R,onChange:e=>{ue(e),p&&p(e)}})]})})]}),!P.compactToolbar&&(P.showFilters||P.showSort||P.showGroup)&&(P.showColor||P.showDensity)&&(0,a.jsx)(`div`,{className:`hidden sm:block h-5 w-px bg-border/50 mx-1 shrink-0`}),P.showColor&&!P.compactToolbar&&(0,a.jsxs)(r.Popover,{open:Le,onOpenChange:Re,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,q&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Paintbrush,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.color`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-64 p-3`,children:(0,a.jsxs)(`div`,{className:`space-y-2`,children:[(0,a.jsxs)(`div`,{className:`flex items-center justify-between border-b pb-2`,children:[(0,a.jsx)(`h4`,{className:`font-medium text-sm`,children:T(`list.rowColor`)}),q&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Ie(void 0),"data-testid":`clear-row-color`,children:T(`list.clear`)})]}),(0,a.jsxs)(`div`,{className:`space-y-2`,"data-testid":`color-field-list`,children:[(0,a.jsx)(`label`,{className:`text-xs text-muted-foreground`,children:T(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:q?.field||``,onChange:e=>{let t=e.target.value;Ie(t?{field:t,colors:q?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:T(`list.none`)}),gt.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),P.showDensity&&!P.compactToolbar&&F!==`gallery`&&(()=>{let e=X.mode===`compact`?i.Rows4:X.mode===`comfortable`?i.Rows3:i.Rows2,t=X.mode===`compact`?T(`grid.toolbar.densityCompact`,{defaultValue:`Compact`}):X.mode===`comfortable`?T(`grid.toolbar.densityComfortable`,{defaultValue:`Comfortable`}):T(`grid.toolbar.densitySpacious`,{defaultValue:`Spacious`}),n=`${T(`grid.toolbar.densityMode`,{defaultValue:`Density`})}: ${t}`,o=T(`grid.toolbar.densityCycleHint`,{defaultValue:`{{label}} (click to cycle)`,label:n});return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":n,className:(0,r.cn)(`hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,X.mode!==`compact`&&`text-foreground font-medium`),onClick:X.cycle,title:o,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),P.showDensity&&!P.compactToolbar&&F===`gallery`&&(()=>{let e=Z===`small`?i.Rows4:Z===`medium`?i.Rows3:i.Rows2,t=Z===`small`?T(`grid.toolbar.densityCompact`,{defaultValue:`Compact`}):Z===`medium`?T(`grid.toolbar.densityComfortable`,{defaultValue:`Comfortable`}):T(`grid.toolbar.densitySpacious`,{defaultValue:`Spacious`}),n=`${T(`grid.toolbar.densityMode`,{defaultValue:`Density`})}: ${t}`,o=T(`grid.toolbar.densityCycleHint`,{defaultValue:`{{label}} (click to cycle)`,label:n});return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":n,className:(0,r.cn)(`hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,Z!==`small`&&`text-foreground font-medium`),onClick:et,title:o,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),P.compactToolbar&&(P.showGroup||P.showColor||P.showDensity||P.showHideFields)&&(0,a.jsx)(C,{t:T,allFields:gt,showGroup:P.showGroup,groupingConfig:K,setGroupingConfig:Me,showColor:P.showColor,rowColorConfig:q,setRowColorConfig:Ie,showDensity:P.showDensity,density:X,showHideFields:P.showHideFields,hiddenFields:J,updateHiddenFields:qe}),(P.showColor||P.showDensity||P.compactToolbar)&&Y&&A.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-5 w-px bg-border/50 mx-1 shrink-0`}),Y&&A.allowExport!==!1&&(0,a.jsxs)(r.Popover,{open:Xe,onOpenChange:Ze,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.export`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-48 p-2`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:(Y.formats||[`csv`,`json`]).map(e=>(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`w-full justify-start h-8 text-xs`,onClick:()=>ht(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),T(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(A.sharing?.enabled||A.sharing?.type)&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,title:`Sharing: ${A.sharing?.visibility||A.sharing?.type||`private`}`,"data-testid":`share-button`,children:[(0,a.jsx)(i.Share2,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.share`)})]}),A.allowPrinting&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,onClick:()=>window.print(),"data-testid":`print-button`,children:[(0,a.jsx)(i.Printer,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.print`)})]}),(()=>{let e=A.allowPrinting||A.sharing?.enabled||A.sharing?.type||Y&&A.allowExport!==!1;return P.showSearch&&e?(0,a.jsx)(`div`,{className:`h-5 w-px bg-border/50 mx-1 shrink-0`}):null})(),P.showSearch&&(0,a.jsxs)(r.Popover,{open:oe,onOpenChange:se,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`hidden sm:inline-flex h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,L&&`text-foreground font-medium`),"data-testid":`search-icon-button`,title:T(`list.search`),children:(0,a.jsx)(i.Search,{className:`h-3.5 w-3.5`})})}),(0,a.jsx)(r.PopoverContent,{align:`end`,className:`w-[calc(100vw-2rem)] sm:w-64 p-2`,"data-testid":`search-popover`,children:(0,a.jsxs)(`div`,{className:`relative`,children:[(0,a.jsx)(i.Search,{className:`absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground`}),(0,a.jsx)(r.Input,{placeholder:T(`list.search`)+`...`,value:L,onChange:e=>ut(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),L&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`absolute right-0.5 top-1/2 -translate-y-1/2 h-5 w-5 p-0 hover:bg-muted-foreground/20`,onClick:()=>ut(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),P.showAddRecord&&P.addRecordPosition===`top`&&(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>S.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.addRecord`)})]})]})]}),(0,a.jsxs)(`div`,{className:`flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200`,children:[(0,a.jsx)(r.RefreshIndicator,{active:H&&V.length>0}),ge&&V.length===0?(0,a.jsx)(r.DataEmptyState,{"data-testid":`list-error-state`,className:`h-full min-h-[200px] p-8 gap-1 [&>h3]:text-lg [&>h3]:font-medium [&>h3]:text-foreground [&>p]:max-w-md`,icon:(0,a.jsx)(i.AlertTriangle,{className:`h-12 w-12 text-destructive/60`}),iconWrapperClassName:`mb-3`,title:T(`list.loadErrorTitle`),description:T(`list.loadErrorMessage`),action:(0,a.jsxs)(r.Button,{variant:`outline`,size:`sm`,"data-testid":`list-error-retry`,onClick:()=>Ce(e=>e+1),children:[(0,a.jsx)(i.RotateCw,{className:`h-4 w-4 mr-1.5`}),T(`list.retry`)]})}):H&&V.length===0?(0,a.jsxs)(`div`,{className:`flex flex-col h-full min-h-[200px] p-4 gap-2`,"data-testid":`list-loading`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,children:[(0,a.jsx)(`span`,{className:`sr-only`,children:T(`list.loading`)}),[0,1,2,3,4,5].map(e=>(0,a.jsx)(`div`,{className:`h-9 rounded bg-muted/60 animate-pulse`,style:{opacity:Math.max(.25,1-e*.12)}},e))]}):!H&&V.length===0&&F===`grid`?(()=>{let e=A.emptyState?.icon,t=e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??i.Inbox:i.Inbox,n=!!(L&&L.trim())||Array.isArray(He)&&He.length>0||Array.isArray(z?.conditions)&&z.conditions.length>0,o=(typeof A.emptyState?.title==`string`?A.emptyState.title:void 0)??T(n?`list.noMatches`:`list.firstRunTitle`),s=(typeof A.emptyState?.message==`string`?A.emptyState.message:void 0)??T(n?`list.noMatchesMessage`:`list.firstRunMessage`);return(0,a.jsx)(r.DataEmptyState,{"data-testid":`empty-state`,className:`h-full min-h-[200px] p-8 gap-1 [&>h3]:text-lg [&>h3]:font-medium [&>h3]:text-foreground [&>p]:max-w-md`,icon:(0,a.jsx)(t,{className:`h-12 w-12 text-muted-foreground/50`}),iconWrapperClassName:`mb-3`,title:o,description:s,action:P.showAddRecord?(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,"data-testid":`empty-state-add-record`,onClick:()=>S.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),T(`list.addRecord`)]}):void 0})})():(0,a.jsx)(s.SchemaRenderer,{schema:ft,...S,data:V,loading:H,onRowSelect:Be,...F===`grid`&&!K?.fields?.length&&Ae!=null?{manualPagination:!0,rowCount:Ae,page:Oe,pageSize:W,onPageChange:e=>ke(e),onPageSizeChange:e=>{De(e),ke(1)}}:{}})]},F),P.showAddRecord&&P.addRecordPosition===`bottom`&&(0,a.jsx)(`div`,{className:`border-t px-2 sm:px-4 py-1 bg-background shrink-0`,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,"data-testid":`add-record-button`,onClick:()=>S.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:T(`list.addRecord`)})]})}),A.bulkActions&&A.bulkActions.length>0&&ze.length>0&&F!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t border-primary/30 px-4 py-2 flex items-center gap-2 text-xs bg-primary/10 text-foreground shrink-0 shadow-sm`,role:`region`,"aria-label":`Bulk actions`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsx)(i.CheckSquare,{className:`h-3.5 w-3.5 text-primary shrink-0`}),(0,a.jsxs)(`span`,{className:`font-medium`,children:[ze.length,` `,ze.length===1?`item`:`items`,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1.5 ml-3`,children:A.bulkActions.map(e=>{let t=String(e).toLowerCase(),n=t.includes(`delete`)||t.includes(`remove`)||t.includes(`destroy`),o=n?i.Trash2:null;return(0,a.jsxs)(r.Button,{variant:n?`destructive`:`outline`,size:`sm`,className:`h-7 px-2.5 text-xs gap-1.5`,onClick:()=>S.onBulkAction?.(e,ze),"data-testid":`bulk-action-${e}`,children:[o&&(0,a.jsx)(o,{className:`h-3 w-3`}),M(e)]},e)})}),(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs ml-auto gap-1`,onClick:()=>Be([]),children:[(0,a.jsx)(i.X,{className:`h-3 w-3`}),`Clear`]})]}),!H&&V.length>0&&A.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{className:`font-medium text-foreground/80`,children:V.length===1?T(`list.recordCountOne`,{count:V.length}):T(`list.recordCount`,{count:V.length})}),we&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:T(`list.dataLimitReached`,{limit:W})}),F!==`grid`&&A.pagination?.pageSizeOptions&&A.pagination.pageSizeOptions.length>0&&(0,a.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,a.jsx)(`span`,{children:T(`table.rowsPerPage`,{defaultValue:`Rows per page`})}),(0,a.jsx)(`select`,{"data-testid":`page-size-selector`,className:`h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background`,value:String(W),onChange:e=>{let t=Number(e.target.value);De(t),S.onPageSizeChange&&S.onPageSizeChange(t)},children:A.pagination.pageSizeOptions.map(e=>(0,a.jsx)(`option`,{value:String(e),children:e},e))})]})]}),dt.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...dt,title:A.label?`${A.label} Detail`:A.objectName?`${A.objectName.charAt(0).toUpperCase()+A.objectName.slice(1)} Detail`:`Record Detail`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})});ae.displayName=`ListView`;var oe={small:`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6`,medium:`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4`,large:`grid-cols-1 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3`},se={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},ce=new Set([`number`,`currency`,`percent`,`integer`,`decimal`]),le=[{bg:`from-indigo-500/15 via-indigo-500/5 to-purple-500/10`,ring:`ring-indigo-500/15`,text:`text-indigo-600/70 dark:text-indigo-300/70`},{bg:`from-sky-500/15 via-sky-500/5 to-cyan-500/10`,ring:`ring-sky-500/15`,text:`text-sky-600/70 dark:text-sky-300/70`},{bg:`from-emerald-500/15 via-emerald-500/5 to-teal-500/10`,ring:`ring-emerald-500/15`,text:`text-emerald-600/70 dark:text-emerald-300/70`},{bg:`from-amber-500/15 via-amber-500/5 to-orange-500/10`,ring:`ring-amber-500/15`,text:`text-amber-600/70 dark:text-amber-300/70`},{bg:`from-rose-500/15 via-rose-500/5 to-pink-500/10`,ring:`ring-rose-500/15`,text:`text-rose-600/70 dark:text-rose-300/70`},{bg:`from-violet-500/15 via-violet-500/5 to-fuchsia-500/10`,ring:`ring-violet-500/15`,text:`text-violet-600/70 dark:text-violet-300/70`}];function R(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return le[Math.abs(t)%le.length]}var ue=({imageUrl:e,title:t,coverFit:i,aspectClass:o,placeholder:s,hidden:c})=>{let[l,u]=(0,n.useState)(!1),d=!!e&&!l;return(0,a.jsx)(`div`,{className:(0,r.cn)(`w-full overflow-hidden relative`,o),hidden:c,children:d?i===`contain`?(0,a.jsx)(`div`,{className:(0,r.cn)(`flex h-full w-full items-center justify-center bg-gradient-to-br`,s.bg),children:(0,a.jsx)(`img`,{src:e,alt:t,loading:`lazy`,onError:()=>u(!0),className:`h-1/2 w-1/2 max-h-24 max-w-24 object-contain transition-transform duration-300 ease-out group-hover:scale-[1.08]`})}):(0,a.jsx)(`img`,{src:e,alt:t,loading:`lazy`,onError:()=>u(!0),className:`h-full w-full object-cover transition-transform duration-300 ease-out group-hover:scale-[1.04]`}):(0,a.jsx)(`div`,{className:(0,r.cn)(`flex h-full w-full items-center justify-center bg-gradient-to-br ring-1 ring-inset`,s.bg,s.ring),children:(0,a.jsx)(`span`,{className:(0,r.cn)(`text-5xl font-semibold tracking-tight opacity-90`,s.text),children:t[0]?.toUpperCase()})})})},de=({imageUrl:e,title:t,placeholder:i})=>{let[o,s]=(0,n.useState)(!1),c=!!e&&!o;return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br ring-1 ring-inset`,i.bg,i.ring),children:c?(0,a.jsx)(`img`,{src:e,alt:t,loading:`lazy`,onError:()=>s(!0),className:`h-6 w-6 object-contain transition-transform duration-300 ease-out group-hover:scale-110`}):(0,a.jsx)(`span`,{className:(0,r.cn)(`text-base font-semibold`,i.text),children:t[0]?.toUpperCase()})})},fe=e=>{let{schema:o}=e,c=(0,n.useContext)(s.SchemaRendererContext),l=e.dataSource||c?.dataSource,d=(0,s.useDataScope)(o.bind),[f,p]=(0,n.useState)([]),[m,h]=(0,n.useState)(!1),[g,_]=(0,n.useState)(null),v=(0,s.useNavigationOverlay)({navigation:o.navigation,objectName:o.objectName,onRowClick:e.onRowClick??e.onCardClick}),y=o.gallery,b=y?.coverField??o.imageField??`image`,x=y?.coverFit??`cover`,S=y?.cardSize??`medium`,C=y?.titleField??o.titleField??`name`,w=y?.visibleFields,{fieldLabel:ee,fieldOptionLabel:T}=(0,s.useSafeFieldLabel)(),E=(0,n.useCallback)(e=>{let t=g?.fields?.[e],n={name:e};if(t){t.type&&(n.type=t.type),t.label&&(n.label=t.label),t.options&&(n.options=t.options),t.currency&&(n.currency=t.currency),t.precision!==void 0&&(n.precision=t.precision),t.format&&(n.format=t.format);let e=t.reference_to||t.reference;e&&(n.reference_to=e),t.reference_field&&(n.reference_field=t.reference_field)}if(o.objectName){let t=String(n.label??e);n.label=ee(o.objectName,e,t)}return o.objectName&&Array.isArray(n.options)&&(n.options=n.options.map(t=>{let n=String(t?.value??t),r=String(t?.label??n);return{...t,value:n,label:T(o.objectName,e,n,r)}})),n},[g,o.objectName,ee,T]);(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!o.objectName))try{let t=await l.getObjectSchema(o.objectName);e&&_(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[o.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){p(e.data);return}return o.objectName&&!d&&!o.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!o.objectName)){n&&h(!0);try{let e=(0,t.buildExpandFields)(g?.fields),r=await l.find(o.objectName,{$filter:o.filter,...e.length>0?{$expand:e}:{}}),i=[];if(Array.isArray(r))i=r;else if(r&&typeof r==`object`){let e=r;Array.isArray(e.records)?i=e.records:Array.isArray(e.data)&&(i=e.data)}n&&p(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&h(!1)}}})(),()=>{n=!1}},[o.objectName,l,d,o.data,o.filter,e.data,g]);let D=e.data||d||o.data||f||[],O=(0,n.useMemo)(()=>D.some(e=>typeof e[b]==`string`&&!!e[b]),[D,b]),k=o.grouping?.fields,A=!!(k&&k.length>0),[j,M]=(0,n.useState)({}),N=(0,n.useMemo)(()=>k?k.some(e=>e.collapsed):!1,[k]),te=(0,n.useCallback)(e=>{M(t=>({...t,[e]:t[e]===void 0?!N:!t[e]}))},[N]),ne=(0,n.useMemo)(()=>{if(!A||!k)return[];let e=new Map,t=[];for(let n of D){let r=k.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=k.map(e=>{let t=n[e.field];return t!=null&&t!==``?String(t):`(empty)`}).join(` / `);e.set(r,{label:i,items:[]}),t.push(r)}e.get(r).items.push(n)}let n=k[0]?.order??`asc`;return t.sort((e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`});return n===`desc`?-r:r}),t.map(t=>{let n=e.get(t),r=t in j?j[t]:N;return{key:t,label:n.label,items:n.items,collapsed:r}})},[D,k,A,j,N]);if(m&&!D.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!D.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No items to display`});let P=e=>!w||w.length===0?null:(0,a.jsx)(`div`,{className:`mt-1.5 space-y-1`,children:w.map(t=>{let n=e[t];if(n==null||n===``)return null;let i=E(t),o=(0,u.resolveCellRendererType)(i)||i.type||`text`,s=(0,u.getCellRenderer)(o),c=i?.label&&String(i.label).trim()?String(i.label):void 0,l=c!=null&&ce.has(o);return(0,a.jsxs)(`div`,{className:(0,r.cn)(`text-xs text-muted-foreground truncate [&_*]:!text-xs`,l&&`flex items-baseline gap-1.5`),onClick:e=>{e.target.closest(`a,button`)&&e.stopPropagation()},children:[l&&(0,a.jsx)(`span`,{className:`shrink-0 text-muted-foreground/70 tabular-nums`,children:c}),(0,a.jsx)(s,{value:n,field:i})]},t)})}),F=(t,n)=>{let i=t.id??t._id??n,s=String(t[C]??`Untitled`),c=t[b],l=R(String(i)+`|`+s),u=(0,r.cn)(`group relative overflow-hidden border-border/60 bg-card`,`transition-all duration-200 ease-out`,`hover:shadow-lg hover:border-border hover:-translate-y-0.5`,(e.onCardClick||e.onRowClick||o.navigation)&&`cursor-pointer`);return O&&x===`contain`?(0,a.jsxs)(r.Card,{role:`listitem`,className:u,onClick:e=>v.handleClick(t,e),children:[(0,a.jsx)(`div`,{"aria-hidden":!0,className:(0,r.cn)(`absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r`,l.bg)}),(0,a.jsx)(r.CardContent,{className:`p-4`,children:(0,a.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,a.jsx)(de,{imageUrl:c,title:s,placeholder:l}),(0,a.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,a.jsx)(`h3`,{className:`font-semibold tracking-tight truncate text-sm leading-tight text-foreground`,title:s,children:s}),P(t)]})]})})]},i):(0,a.jsxs)(r.Card,{role:`listitem`,className:u,onClick:e=>v.handleClick(t,e),children:[!O&&(0,a.jsx)(`div`,{"aria-hidden":!0,className:(0,r.cn)(`absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r`,l.bg)}),(0,a.jsx)(ue,{imageUrl:c,title:s,coverFit:x,aspectClass:se[S],placeholder:l,hidden:!O}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,O&&`border-t border-border/60`),children:[(0,a.jsx)(`h3`,{className:`font-semibold tracking-tight truncate text-sm leading-tight text-foreground`,title:s,children:s}),P(t)]})]},i)},I=e=>(0,a.jsx)(`div`,{className:(0,r.cn)(`grid gap-4 p-4 auto-rows-min content-start`,oe[S],o.className),role:`list`,children:e.map((e,t)=>F(e,t))});return(0,a.jsxs)(a.Fragment,{children:[A?(0,a.jsx)(`div`,{className:`space-y-2`,children:ne.map(e=>(0,a.jsxs)(`div`,{className:`border rounded-md`,children:[(0,a.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 px-3 py-2 text-sm font-medium text-left bg-muted/50 hover:bg-muted transition-colors`,onClick:()=>te(e.key),children:[e.collapsed?(0,a.jsx)(i.ChevronRight,{className:`h-4 w-4 shrink-0`}):(0,a.jsx)(i.ChevronDown,{className:`h-4 w-4 shrink-0`}),(0,a.jsx)(`span`,{children:e.label}),(0,a.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:e.items.length})]}),!e.collapsed&&I(e.items)]},e.key))}):I(D),v.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...v,title:`Gallery Item`,children:e=>(0,a.jsx)(`div`,{className:`space-y-3`,children:Object.entries(e).map(([e,t])=>(0,a.jsxs)(`div`,{className:`flex flex-col`,children:[(0,a.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground uppercase tracking-wide`,children:e.replace(/_/g,` `)}),(0,a.jsx)(`span`,{className:`text-sm`,children:String(t??`—`)})]},e))})})]})};t.ComponentRegistry.register(`object-gallery`,fe,{namespace:`plugin-list`,label:`Gallery View`,category:`view`});function pe(e){return e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null}function z(e){return e.filter(e=>e.pinned||e.visible!==`false`&&e.visible!==!1).sort((e,t)=>(e.order??0)-(t.order??0))}t.ComponentRegistry.register(`list-view`,ae,{namespace:`plugin-list`,label:`List View`,category:`Views`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}],defaultProps:{objectName:``,viewType:`grid`,fields:[],filters:[],sort:[],options:{}}}),t.ComponentRegistry.register(`list`,ae,{namespace:`view`,skipFallback:!0,category:`view`,label:`List`,icon:`LayoutList`,inputs:[{name:`objectName`,type:`string`,label:`Object Name`,required:!0},{name:`viewType`,type:`enum`,label:`Default View`,enum:[{label:`Grid`,value:`grid`},{label:`Kanban`,value:`kanban`},{label:`Gallery`,value:`gallery`},{label:`Calendar`,value:`calendar`},{label:`Timeline`,value:`timeline`},{label:`Gantt`,value:`gantt`},{label:`Map`,value:`map`}],defaultValue:`grid`},{name:`fields`,type:`array`,label:`Fields`},{name:`filters`,type:`array`,label:`Filters`},{name:`sort`,type:`array`,label:`Sort`},{name:`options`,type:`object`,label:`View Options`}]}),e.ListView=ae,e.ObjectGallery=fe,e.TabBar=({tabs:e,activeTab:t,onTabChange:i,className:o})=>{let s=n.useMemo(()=>z(e),[e]),c=n.useMemo(()=>s.find(e=>e.isDefault)?.name??s[0]?.name,[s]),[l,u]=n.useState(c),d=t??l,f=n.useCallback(e=>{u(e.name),i?.(e)},[i]);return s.length===0?null:(0,a.jsx)(`div`,{className:(0,r.cn)(`px-2 sm:px-4 py-1 flex items-center gap-0.5 bg-background`,o),"data-testid":`view-tabs`,role:`tablist`,children:s.map(e=>{let t=pe(e.icon),n=d===e.name;return(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2.5 py-1 text-xs rounded-md transition-colors duration-150`,n?`font-medium text-foreground bg-muted`:`text-muted-foreground hover:text-foreground hover:bg-transparent`),"data-testid":`view-tab-${e.name}`,role:`tab`,"aria-selected":n,onClick:()=>f(e),children:[t&&(0,a.jsx)(t,{className:`h-3 w-3 mr-1.5`}),e.label]},e.name)})})},e.TabBarSelect=({tabs:e,activeTab:t,onTabChange:o,className:s})=>{let c=n.useMemo(()=>z(e),[e]),l=n.useMemo(()=>c.find(e=>e.isDefault)?.name??c[0]?.name,[c]),[u,d]=n.useState(l),f=t??u,p=n.useMemo(()=>c.find(e=>e.name===f)??c[0],[c,f]),m=n.useCallback(e=>{d(e.name),o?.(e)},[o]);if(c.length===0)return null;let h=pe(p?.icon);return(0,a.jsx)(`div`,{className:(0,r.cn)(`px-2 py-1`,s),"data-testid":`view-tabs-select`,children:(0,a.jsxs)(r.DropdownMenu,{children:[(0,a.jsx)(r.DropdownMenuTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs font-medium text-foreground gap-1.5 max-w-[60vw] truncate`,"aria-label":`Switch view`,children:[h&&(0,a.jsx)(h,{className:`h-3.5 w-3.5 shrink-0`}),(0,a.jsx)(`span`,{className:`truncate`,children:p?.label??``}),(0,a.jsx)(i.ChevronDown,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]})}),(0,a.jsx)(r.DropdownMenuContent,{align:`start`,className:`w-56 max-h-72 overflow-y-auto`,children:c.map(e=>{let t=pe(e.icon);return(0,a.jsxs)(r.DropdownMenuItem,{onClick:()=>m(e),className:(0,r.cn)(`text-sm`,f===e.name&&`font-medium bg-muted`),"data-testid":`view-tab-select-${e.name}`,children:[t&&(0,a.jsx)(t,{className:`h-3.5 w-3.5 mr-2 shrink-0`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name)})})]})})},e.UserFilters=D,e.ViewSwitcher=x,e.ViewSwitcherDropdown=b,e.evaluateConditionalFormatting=P,e.normalizeFilterCondition=M,e.normalizeFilters=te});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-list",
3
- "version": "7.0.0",
3
+ "version": "7.1.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "ListView plugin for Object UI - unified view component with view type switching",
@@ -29,14 +29,14 @@
29
29
  "peerDependencies": {
30
30
  "react": "^18.0.0 || ^19.0.0",
31
31
  "react-dom": "^18.0.0 || ^19.0.0",
32
- "@object-ui/components": "^7.0.0",
33
- "@object-ui/core": "^7.0.0",
34
- "@object-ui/fields": "^7.0.0",
35
- "@object-ui/i18n": "^7.0.0",
36
- "@object-ui/mobile": "^7.0.0",
37
- "@object-ui/permissions": "^7.0.0",
38
- "@object-ui/react": "^7.0.0",
39
- "@object-ui/types": "^7.0.0"
32
+ "@object-ui/components": "^7.1.0",
33
+ "@object-ui/core": "^7.1.0",
34
+ "@object-ui/fields": "^7.1.0",
35
+ "@object-ui/i18n": "^7.1.0",
36
+ "@object-ui/mobile": "^7.1.0",
37
+ "@object-ui/permissions": "^7.1.0",
38
+ "@object-ui/react": "^7.1.0",
39
+ "@object-ui/types": "^7.1.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/react": "19.2.17",
@@ -46,13 +46,13 @@
46
46
  "vite": "^8.0.16",
47
47
  "vite-plugin-dts": "^5.0.2",
48
48
  "vitest": "^4.1.9",
49
- "@object-ui/components": "7.0.0",
50
- "@object-ui/core": "7.0.0",
51
- "@object-ui/fields": "7.0.0",
52
- "@object-ui/i18n": "7.0.0",
53
- "@object-ui/mobile": "7.0.0",
54
- "@object-ui/react": "7.0.0",
55
- "@object-ui/types": "7.0.0"
49
+ "@object-ui/components": "7.1.0",
50
+ "@object-ui/core": "7.1.0",
51
+ "@object-ui/fields": "7.1.0",
52
+ "@object-ui/i18n": "7.1.0",
53
+ "@object-ui/mobile": "7.1.0",
54
+ "@object-ui/react": "7.1.0",
55
+ "@object-ui/types": "7.1.0"
56
56
  },
57
57
  "keywords": [
58
58
  "objectui",