@object-ui/plugin-list 4.0.5 → 4.0.7

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/react`),require(`@object-ui/mobile`),require(`@object-ui/i18n`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/react`,`@object-ui/mobile`,`@object-ui/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIReact,e.ObjectUIMobile,e.ObjectUIi18n))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:l(p(e)),h(t||!e||!e.__esModule?u(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var g={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`})},_={grid:`Grid`,kanban:`Kanban`,gallery:`Gallery`,calendar:`Calendar`,timeline:`Timeline`,gantt:`Gantt`,map:`Map`},v=({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":_[t],title:_[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:[g[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block text-xs font-medium`,children:_[t]})]},t)})})};function y(e){return e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null}function b(e){return e.filter(e=>e.pinned||e.visible!==`false`&&e.visible!==!1).sort((e,t)=>(e.order??0)-(t.order??0))}var x=({tabs:e,activeTab:t,onTabChange:i,className:o})=>{let s=n.useMemo(()=>b(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)(`border-b 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=y(e.icon),n=d===e.name;return(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-3 py-1.5 text-xs rounded-none transition-colors duration-150`,n?`border-b-2 border-primary font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),"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)})})};function ee({config:e,objectDef:t,data:n=[],onFilterChange:r,maxVisible:i,className:o}){switch(e.element){case`dropdown`:return(0,a.jsx)(C,{fields:e.fields||[],objectDef:t,data:n,onFilterChange:r,maxVisible:i,className:o});case`tabs`:return(0,a.jsx)(w,{tabs:e.tabs||[],showAllRecords:e.showAllRecords!==!1,allowAddTab:e.allowAddTab,onFilterChange:r,className:o});case`toggle`:return(0,a.jsx)(T,{fields:e.fields||[],onFilterChange:r,className:o});default:return null}}function S(e,t,n){return e.map(e=>{let r=e.options?[...e.options]:[];if(r.length===0&&t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n?.options&&(r=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})))}return e.showCount&&n.length>0&&(r=r.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length}))),{...e,options:r}})}function C({fields:e,objectDef:t,data:o,onFilterChange:s,maxVisible:c,className:l}){let[u,d]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues)}),t}),f=n.useMemo(()=>S(e,t,o),[e,t,o]),p=n.useCallback(e=>{s(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[s]),m=(e,t)=>{let n={...u,[e]:t};d(n),p(n)};n.useEffect(()=>{Object.values(u).some(e=>e.length>0)&&p(u)},[]);let h=c!==void 0&&c<f.length?f.slice(0,c):f,g=c!==void 0&&c<f.length?f.slice(c):[],_=e=>{let t=u[e.field]||[],n=t.length>0;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 rounded-full border h-7 px-2.5 text-xs font-medium transition-colors shrink-0`,n?`border-primary/30 bg-primary/5 text-primary`:`border-border bg-background hover:bg-accent text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px]`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),m(e.field,[])}}):(0,a.jsx)(i.ChevronDown,{className:`h-3 w-3 opacity-60`})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-56 p-2`,children:(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-0.5`,"data-testid":`filter-options-${e.field}`,children: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];m(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.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,l),"data-testid":`user-filters-dropdown`,children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),f.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:[h.map(_),g.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 rounded-full border border-border bg-background hover:bg-accent text-foreground h-7 px-2.5 text-xs font-medium transition-colors shrink-0`,children:[(0,a.jsx)(`span`,{children:`More`}),(0,a.jsx)(`span`,{className:`flex h-4 min-w-[16px] items-center justify-center rounded-full bg-muted text-[10px] font-medium`,children:g.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:g.map(_)})})]})]})]})}function w({tabs:e,showAllRecords:t,allowAddTab:o,onFilterChange:s,className:c}){let[l,u]=n.useState(()=>e.find(e=>e.default)?.id||(t?`__all__`:e[0]?.id||``)),d=n.useCallback(t=>{u(t),s(t===`__all__`?[]:e.find(e=>e.id===t)?.filters||[])},[e,s]),f=n.useMemo(()=>{let n=[...e];return t&&n.push({id:`__all__`,label:`All records`,filters:[]}),n},[e,t]);return n.useEffect(()=>{let t=e.find(e=>e.default);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:[f.map(e=>(0,a.jsx)(`button`,{"data-testid":`filter-tab-${e.id}`,onClick:()=>d(e.id),className:(0,r.cn)(`inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0`,l===e.id?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:e.label},e.id)),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 T({fields:e,onFilterChange:t,className:i}){let[o,s]=n.useState(()=>{let t=new Set;return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&t.add(e.field)}),t}),c=n.useCallback(n=>{t(Array.from(n).map(t=>{let n=e.find(e=>e.field===t);return n?.defaultValues?[t,`in`,n.defaultValues]:[t,`!=`,null]}))},[e,t]),l=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c(n),n})};return n.useEffect(()=>{o.size>0&&c(o)},[]),(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,i),"data-testid":`user-filters-toggle`,children:e.map(e=>(0,a.jsx)(r.Button,{variant:o.has(e.field)?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs shrink-0`,"data-testid":`filter-toggle-${e.field}`,onClick:()=>l(e.field),children:e.label||e.field},e.field))})}function E(e){switch(e){case`equals`:case`eq`:return`=`;case`notEquals`:case`ne`:case`neq`:return`!=`;case`contains`:return`contains`;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`:return`not in`;case`before`:return`<`;case`after`:return`>`;default:return e}}function D(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)?D(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 O(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function k(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?D(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function A(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=k(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,E(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function te(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 j={"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.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`};function ne(){try{let e=(0,c.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:(e,t)=>{let n=j[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}:{t:e.t}}catch{return{t:(e,t)=>{let n=j[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}}}function re(){try{let{fieldLabel:e}=(0,c.useObjectLabel)();return{fieldLabel:e}}catch{return{fieldLabel:(e,t,n)=>n}}}var M=n.forwardRef(({schema:e,className:c,onViewChange:l,onFilterChange:u,onSortChange:d,onSearchChange:f,onRowClick:p,showViewSwitcher:m=!1,...h},g)=>{let{t:_}=ne(),{fieldLabel:y}=re(),b=n.useMemo(()=>({...e,viewType:e.viewType||`grid`}),[e]),S=n.useCallback((e,t)=>b.objectName?y(b.objectName,e,t):t,[b.objectName,y]),C=n.useMemo(()=>{let e=b.userActions,t=b.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?b.showSearch!==!1:e.search,showSort:e?.sort===void 0?b.showSort!==!1:e.sort,showFilters:e?.filter===void 0?b.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?b.showDensity===!0:e.rowHeight,showHideFields:b.showHideFields===!0,showGroup:b.showGroup!==!1,showColor:b.showColor===!0,showAddRecord:t,addRecordPosition:b.addRecord?.position===`bottom`?`bottom`:`top`}},[b.userActions,b.showSearch,b.showSort,b.showFilters,b.showDensity,b.showHideFields,b.showGroup,b.showColor,b.addRecord,b.userActions?.addRecordForm]),[w,T]=n.useState(b.viewType),[E,D]=n.useState(``),[te,j]=n.useState(!1),[M,ie]=n.useState(!1),[N,ae]=n.useState(()=>b.sort&&b.sort.length>0?b.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`}}):[]),[oe,se]=n.useState(!1),[P,ce]=n.useState({id:`root`,logic:`and`,conditions:[]}),[le,ue]=n.useState(()=>{if(!(!b.tabs||b.tabs.length===0))return b.tabs.find(e=>e.isDefault)?.name??b.tabs[0]?.name}),de=n.useCallback(e=>{if(ue(e.name),e.filter){let t={id:`tab-filter-${e.name}`,logic:e.filter.logic||`and`,conditions:e.filter.conditions||[]};ce(t),u?.(t)}else{let e={id:`root`,logic:`and`,conditions:[]};ce(e),u?.(e)}},[u]),F=h.dataSource,[I,fe]=n.useState([]),[pe,L]=n.useState(!1),[R,me]=n.useState(null),[he,z]=n.useState(!1),[ge,_e]=n.useState(0),[ve,B]=n.useState(!1);n.useImperativeHandle(g,()=>({refresh:()=>_e(e=>e+1)}),[]),n.useEffect(()=>{if(!(!F?.onMutation||!b.objectName||b.refreshTrigger))return F.onMutation(e=>{e.resource===b.objectName&&_e(e=>e+1)})},[F,b.objectName,b.refreshTrigger]);let[ye,be]=n.useState(void 0),V=ye??b.pagination?.pageSize??100,H=n.useMemo(()=>{if(b.grouping?.fields?.length)return b.grouping;let e=typeof b.groupBy==`string`?b.groupBy.trim():``,t=typeof b.groupBy2==`string`?b.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},[b.grouping,b.groupBy,b.groupBy2]),[U,xe]=n.useState(H),[Se,Ce]=n.useState(!1),we=n.useRef(H);n.useEffect(()=>{we.current!==H&&(we.current=H,xe(H))},[H]);let[W,Te]=n.useState(b.rowColor),[Ee,De]=n.useState(!1),[Oe,ke]=n.useState([]),G=n.useRef(0),[K,Ae]=n.useState(()=>{let e=new Set;return b.quickFilters?.forEach(n=>{let r=(0,t.normalizeQuickFilter)(n);r.defaultActive&&e.add(r.id)}),e}),[je,Me]=n.useState([]),Ne=n.useMemo(()=>{if(b.userFilters)return b.userFilters;if(!R?.fields)return;let e=new Set([`select`,`multi-select`,`boolean`]),t=[],n=Array.isArray(R.fields)?R.fields.map(e=>[e.name,e]):Object.entries(R.fields);for(let[r,i]of n)(e.has(i.type)||i.options&&!i.type)&&t.push({field:r,label:S(r,i.label||r),type:i.type===`boolean`?`boolean`:i.type===`multi-select`?`multi-select`:`select`});if(t.length!==0)return{element:`dropdown`,fields:t}},[b.userFilters,R]),[q,Pe]=n.useState(()=>new Set(b.hiddenFields||[])),[Fe,Ie]=n.useState(!1),[Le,Re]=n.useState(!1),J=n.useMemo(()=>(0,t.normalizeQuickFilters)(b.quickFilters),[b.quickFilters]),Y=n.useMemo(()=>{if(b.exportOptions)return Array.isArray(b.exportOptions)?{formats:b.exportOptions}:b.exportOptions},[b.exportOptions]),X=(0,o.useDensityMode)(n.useMemo(()=>b.densityMode?b.densityMode:b.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[b.rowHeight]||`comfortable`:`compact`,[b.densityMode,b.rowHeight])),{ref:ze,isRefreshing:Be,pullDistance:Ve}=(0,s.usePullToRefresh)({onRefresh:n.useCallback(async()=>{_e(e=>e+1)},[]),enabled:!!F&&!!b.objectName}),He=n.useMemo(()=>b.id?`listview-${b.objectName}-${b.id}-view`:`listview-${b.objectName}-view`,[b.objectName,b.id]);n.useEffect(()=>{let e=!0;return z(!1),me(null),(async()=>{if(!F||!b.objectName){z(!0);return}if(typeof F.getObjectSchema!=`function`){z(!0);return}try{let t=await F.getObjectSchema(b.objectName);e&&me(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&z(!0)}})(),()=>{e=!1}},[b.objectName,F]);let Z=n.useMemo(()=>(0,t.buildExpandFields)(R?.fields,b.fields),[R?.fields,b.fields]);n.useEffect(()=>{let e=!0,t=++G.current;if(b.data&&typeof b.data==`object`&&!Array.isArray(b.data)){let e=b.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(E){let e=E.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}fe(t),L(!1),B(!1);return}}if(Array.isArray(b.data)){let e=b.data;if(E){let t=E.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}fe(e),L(!1),B(!1);return}return he?((async()=>{if(!(!F||!b.objectName)){L(!0);try{let n=[],r=b.filters||[],i=A(P),a=[];J&&K.size>0&&J.forEach(e=>{K.has(e.id)&&e.filters&&e.filters.length>0&&a.push(e.filters)});let o=k(je),s=[...r.length>0?[r]:[],...i.length>0?[i]:[],...a,...o].filter(e=>Array.isArray(e)&&e.length>0);s.length>1?n=[`and`,...s]:s.length===1&&(n=s[0]);let c=N.length>0?N.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,l=(()=>{let e=Array.isArray(b.fields)?b.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[];if(e.length===0)return;let t=new Set([`id`]);for(let n of e)t.add(n);for(let e of Z)t.add(e);let n=e=>{if(!e)return;let n=[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:[]];for(let e of n)typeof e==`string`&&e&&t.add(e)};return n(b.kanban),n(b.options?.kanban),n(b.calendar),n(b.options?.calendar),n(b.gallery),n(b.options?.gallery),n(b.timeline),n(b.options?.timeline),n(b.gantt),n(b.options?.gantt),Array.from(t)})(),u=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,d=await F.find(b.objectName,{...u?{$filter:n}:{},$orderby:c,$top:V,...l?{$select:l}:{},...Z.length>0?{$expand:Z}:{},...E?{$search:E,...b.searchableFields&&b.searchableFields.length>0?{$searchFields:b.searchableFields}:{}}:{}});if(!e||t!==G.current)return;let f=[];Array.isArray(d)?f=d:d&&typeof d==`object`&&(Array.isArray(d.data)?f=d.data:Array.isArray(d.records)?f=d.records:Array.isArray(d.value)&&(f=d.value)),fe(f),B(f.length>=V)}catch(e){t===G.current&&console.error(`ListView data fetch error:`,e)}finally{e&&t===G.current&&L(!1)}}})(),()=>{e=!1}):void 0},[b.objectName,b.data,F,b.filters,V,N,P,K,J,je,ge,E,b.searchableFields,Z,he,b.refreshTrigger]);let Ue=n.useMemo(()=>{if(b.appearance?.allowedVisualizations&&b.appearance.allowedVisualizations.length>0)return b.appearance.allowedVisualizations.filter(e=>[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`].includes(e));let e=[`grid`];return(b.kanban?.groupField||b.options?.kanban?.groupField)&&e.push(`kanban`),(b.gallery?.coverField||b.gallery?.imageField||b.options?.gallery?.imageField)&&e.push(`gallery`),(b.calendar?.startDateField||b.options?.calendar?.startDateField)&&e.push(`calendar`),(b.timeline?.startDateField||b.options?.timeline?.startDateField||b.options?.timeline?.dateField||b.options?.calendar?.startDateField)&&e.push(`timeline`),(b.gantt?.startDateField||b.options?.gantt?.startDateField)&&e.push(`gantt`),(b.options?.map?.locationField||b.options?.map?.latitudeField&&b.options?.map?.longitudeField)&&e.push(`map`),b.viewType&&!e.includes(b.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`].includes(b.viewType)&&e.push(b.viewType),e},[b.options,b.viewType,b.kanban,b.calendar,b.gantt,b.gallery,b.timeline,b.appearance?.allowedVisualizations]);n.useEffect(()=>{b.viewType&&T(b.viewType)},[b.viewType]);let We=n.useCallback(e=>{T(e);try{localStorage.setItem(He,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}l?.(e)},[He,l]),Ge=n.useCallback(e=>{D(e),f?.(e)},[f]),Q=(0,o.useNavigationOverlay)({navigation:b.navigation,objectName:b.objectName,onNavigate:b.onNavigate,onRowClick:p}),$=n.useMemo(()=>{let e=b.fields||[];if(Array.isArray(e)||(e=[]),q.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!q.has(t)})),b.fieldOrder&&b.fieldOrder.length>0){let t=new Map(b.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},[b.fields,q,b.fieldOrder]),Ke=n.useMemo(()=>{let e={objectName:b.objectName,fields:$,filters:b.filters,sort:N,className:`h-full w-full`,showSearch:!1,onRowClick:Q.handleClick,...b.striped==null?{}:{striped:b.striped},...b.bordered==null?{}:{bordered:b.bordered}};switch(w){case`grid`:return{type:`object-grid`,...e,columns:$,...b.conditionalFormatting?{conditionalFormatting:b.conditionalFormatting}:{},...b.inlineEdit==null?{}:{editable:b.inlineEdit},...b.wrapHeaders==null?{}:{wrapHeaders:b.wrapHeaders},...b.virtualScroll==null?{}:{virtualScroll:b.virtualScroll},...b.resizable==null?{}:{resizable:b.resizable},...b.selection?{selection:b.selection}:{},...b.pagination?{pagination:b.pagination}:{},...U?{grouping:U}:{},...W?{rowColor:W}:{},...b.rowActions?{rowActions:b.rowActions}:{},...b.bulkActions?{batchActions:b.bulkActions}:{},...b.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...e,groupBy:b.kanban?.groupField||b.options?.kanban?.groupField||`status`,groupField:b.kanban?.groupField||b.options?.kanban?.groupField||`status`,...b.kanban?.titleField||b.options?.kanban?.titleField?{titleField:b.kanban?.titleField||b.options?.kanban?.titleField}:{},cardFields:b.kanban?.cardFields||$||[],...U?{grouping:U}:{},...b.options?.kanban||{},...b.kanban||{}};case`calendar`:return{type:`object-calendar`,...e,startDateField:b.calendar?.startDateField||b.options?.calendar?.startDateField||`start_date`,endDateField:b.calendar?.endDateField||b.options?.calendar?.endDateField||`end_date`,...b.calendar?.titleField||b.options?.calendar?.titleField?{titleField:b.calendar?.titleField||b.options?.calendar?.titleField}:{},...b.calendar?.defaultView?{defaultView:b.calendar.defaultView}:{},...b.options?.calendar||{},...b.calendar||{}};case`gallery`:{let t={...b.options?.gallery||{},...b.gallery||{}};return{type:`object-gallery`,...e,gallery:Object.keys(t).length>0?t:void 0,imageField:b.gallery?.coverField||b.gallery?.imageField||b.options?.gallery?.imageField,titleField:b.gallery?.titleField||b.options?.gallery?.titleField||`name`,subtitleField:b.gallery?.subtitleField||b.options?.gallery?.subtitleField,...U?{grouping:U}:{}}}case`timeline`:{let t={...b.options?.timeline||{},...b.timeline||{}};return{type:`object-timeline`,...e,timeline:Object.keys(t).length>0?t:void 0,startDateField:b.timeline?.startDateField||b.options?.timeline?.startDateField||b.options?.timeline?.dateField||`created_at`,titleField:b.timeline?.titleField||b.options?.timeline?.titleField||`name`,...b.timeline?.endDateField?{endDateField:b.timeline.endDateField}:{},...b.timeline?.groupByField?{groupByField:b.timeline.groupByField}:{},...b.timeline?.colorField?{colorField:b.timeline.colorField}:{},...b.timeline?.scale?{scale:b.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...e,startDateField:b.gantt?.startDateField||b.options?.gantt?.startDateField||`start_date`,endDateField:b.gantt?.endDateField||b.options?.gantt?.endDateField||`end_date`,progressField:b.gantt?.progressField||b.options?.gantt?.progressField||`progress`,dependenciesField:b.gantt?.dependenciesField||b.options?.gantt?.dependenciesField||`dependencies`,...b.gantt?.titleField?{titleField:b.gantt.titleField}:{},...b.options?.gantt||{},...b.gantt||{}};case`map`:return{type:`object-map`,...e,locationField:b.options?.map?.locationField||`location`,...b.options?.map||{}};default:return e}},[w,b,N,$,U,W,Q.handleClick]),qe=P.conditions&&P.conditions.length>0,Je=n.useMemo(()=>{let e;if(e=R?.fields?Object.entries(R.fields).map(([e,t])=>({value:e,label:S(e,t.label||e),type:t.type||`text`,options:t.options})):(b.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let t=e.name||e.fieldName;return{value:t,label:S(t,e.label||e.name),type:e.type||`text`,options:e.options}}),b.filterableFields&&b.filterableFields.length>0){let t=new Set(b.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[R,b.fields,b.filterableFields]),Ye=n.useCallback(e=>{Ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Xe=n.useCallback(e=>{let t=Y,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||b.objectName||`export`,a=n>0?I.slice(0,n):I;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/react`),require(`@object-ui/mobile`),require(`@object-ui/i18n`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/react`,`@object-ui/mobile`,`@object-ui/i18n`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIReact,e.ObjectUIMobile,e.ObjectUIi18n))})(this,function(e,t,n,r,i,a,o,s,c){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var l=Object.create,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty,h=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!m.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e};n=((e,t,n)=>(n=e==null?{}:l(p(e)),h(t||!e||!e.__esModule?u(n,`default`,{value:e,enumerable:!0}):n,e)))(n,1);var g={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`})},_={grid:`Grid`,kanban:`Kanban`,gallery:`Gallery`,calendar:`Calendar`,timeline:`Timeline`,gantt:`Gantt`,map:`Map`},v=({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":_[t],title:_[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:[g[t],(0,a.jsx)(`span`,{className:`hidden sm:inline-block text-xs font-medium`,children:_[t]})]},t)})})};function y(e){return e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null}function b(e){return e.filter(e=>e.pinned||e.visible!==`false`&&e.visible!==!1).sort((e,t)=>(e.order??0)-(t.order??0))}var x=({tabs:e,activeTab:t,onTabChange:i,className:o})=>{let s=n.useMemo(()=>b(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)(`border-b 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=y(e.icon),n=d===e.name;return(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-3 py-1.5 text-xs rounded-none transition-colors duration-150`,n?`border-b-2 border-primary font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),"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)})})},S=new Set([`lookup`,`master_detail`,`user`,`owner`]);function C({config:e,objectDef:t,data:n=[],onFilterChange:r,maxVisible:i,className:o}){switch(e.element){case`dropdown`:return(0,a.jsx)(T,{fields:e.fields||[],objectDef:t,data:n,onFilterChange:r,maxVisible:i,className:o});case`tabs`:return(0,a.jsx)(E,{tabs:e.tabs||[],showAllRecords:e.showAllRecords!==!1,allowAddTab:e.allowAddTab,onFilterChange:r,className:o});case`toggle`:return(0,a.jsx)(D,{fields:e.fields||[],onFilterChange:r,className:o});default:return null}}function w(e,t,n){return e.map(e=>{let r=e.options?[...e.options]:[],i=e.type,a,o,s;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(i||=n.type,a=n.reference_to??n.reference,o=n.display_field??n.reference_field,s=n.id_field,r.length===0&&n.options&&(r=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}))))}return r.length===0&&i===`boolean`&&(r=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(r=r.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length}))),{...e,type:i,options:r,referenceTo:a,displayField:o,idField:s}})}function T({fields:e,objectDef:t,data:o,onFilterChange:s,maxVisible:c,className:l}){let[u,d]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues)}),t}),f=n.useMemo(()=>w(e,t,o),[e,t,o]),p=n.useCallback(e=>{s(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[s]),m=(e,t)=>{let n={...u,[e]:t};d(n),p(n)};n.useEffect(()=>{Object.values(u).some(e=>e.length>0)&&p(u)},[]);let h=c!==void 0&&c<f.length?f.slice(0,c):f,g=c!==void 0&&c<f.length?f.slice(c):[],_=e=>{let t=u[e.field]||[],n=t.length>0,o=S.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 rounded-full border h-7 px-2.5 text-xs font-medium transition-colors shrink-0`,n?`border-primary/30 bg-primary/5 text-primary`:`border-border bg-background hover:bg-accent text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px]`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),m(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];m(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];m(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.jsxs)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,l),"data-testid":`user-filters-dropdown`,children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),f.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:[h.map(_),g.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 rounded-full border border-border bg-background hover:bg-accent text-foreground h-7 px-2.5 text-xs font-medium transition-colors shrink-0`,children:[(0,a.jsx)(`span`,{children:`More`}),(0,a.jsx)(`span`,{className:`flex h-4 min-w-[16px] items-center justify-center rounded-full bg-muted text-[10px] font-medium`,children:g.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:g.map(_)})})]})]})]})}function E({tabs:e,showAllRecords:t,allowAddTab:o,onFilterChange:s,className:c}){let[l,u]=n.useState(()=>e.find(e=>e.default)?.id||(t?`__all__`:e[0]?.id||``)),d=n.useCallback(t=>{u(t),s(t===`__all__`?[]:e.find(e=>e.id===t)?.filters||[])},[e,s]),f=n.useMemo(()=>{let n=[...e];return t&&n.push({id:`__all__`,label:`All records`,filters:[]}),n},[e,t]);return n.useEffect(()=>{let t=e.find(e=>e.default);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:[f.map(e=>(0,a.jsx)(`button`,{"data-testid":`filter-tab-${e.id}`,onClick:()=>d(e.id),className:(0,r.cn)(`inline-flex items-center h-7 px-3 text-xs font-medium rounded-md transition-colors shrink-0`,l===e.id?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-muted`),children:e.label},e.id)),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 D({fields:e,onFilterChange:t,className:i}){let[o,s]=n.useState(()=>{let t=new Set;return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&t.add(e.field)}),t}),c=n.useCallback(n=>{t(Array.from(n).map(t=>{let n=e.find(e=>e.field===t);return n?.defaultValues?[t,`in`,n.defaultValues]:[t,`!=`,null]}))},[e,t]),l=e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),c(n),n})};return n.useEffect(()=>{o.size>0&&c(o)},[]),(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-1 overflow-x-auto`,i),"data-testid":`user-filters-toggle`,children:e.map(e=>(0,a.jsx)(r.Button,{variant:o.has(e.field)?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs shrink-0`,"data-testid":`filter-toggle-${e.field}`,onClick:()=>l(e.field),children:e.label||e.field},e.field))})}function O(e){switch(e){case`equals`:case`eq`:return`=`;case`notEquals`:case`ne`:case`neq`:return`!=`;case`contains`:return`contains`;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`:return`not in`;case`before`:return`<`;case`after`:return`>`;default:return e}}function k(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)?k(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 ee(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function A(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?k(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function te(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=A(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,O(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function ne(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 j={"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.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`};function re(){try{let e=(0,c.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:(e,t)=>{let n=j[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}:{t:e.t}}catch{return{t:(e,t)=>{let n=j[e]||e;if(t)for(let[e,r]of Object.entries(t))n=n.replace(`{{${e}}}`,String(r));return n}}}}function ie(){try{let{fieldLabel:e}=(0,c.useObjectLabel)();return{fieldLabel:e}}catch{return{fieldLabel:(e,t,n)=>n}}}var M=n.forwardRef(({schema:e,className:c,onViewChange:l,onFilterChange:u,onSortChange:d,onSearchChange:f,onRowClick:p,showViewSwitcher:m=!1,...h},g)=>{let{t:_}=re(),{fieldLabel:y}=ie(),b=n.useMemo(()=>({...e,viewType:e.viewType||`grid`}),[e]),S=n.useCallback((e,t)=>b.objectName?y(b.objectName,e,t):t,[b.objectName,y]),w=n.useMemo(()=>{let e=b.userActions,t=b.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?b.showSearch!==!1:e.search,showSort:e?.sort===void 0?b.showSort!==!1:e.sort,showFilters:e?.filter===void 0?b.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?b.showDensity===!0:e.rowHeight,showHideFields:b.showHideFields===!0,showGroup:b.showGroup!==!1,showColor:b.showColor===!0,showAddRecord:t,addRecordPosition:b.addRecord?.position===`bottom`?`bottom`:`top`}},[b.userActions,b.showSearch,b.showSort,b.showFilters,b.showDensity,b.showHideFields,b.showGroup,b.showColor,b.addRecord,b.userActions?.addRecordForm]),[T,E]=n.useState(b.viewType),[D,O]=n.useState(``),[k,ne]=n.useState(!1),[j,M]=n.useState(!1),[N,ae]=n.useState(()=>b.sort&&b.sort.length>0?b.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`}}):[]),[oe,se]=n.useState(!1),[P,ce]=n.useState({id:`root`,logic:`and`,conditions:[]}),[le,ue]=n.useState(()=>{if(!(!b.tabs||b.tabs.length===0))return b.tabs.find(e=>e.isDefault)?.name??b.tabs[0]?.name}),de=n.useCallback(e=>{if(ue(e.name),e.filter){let t={id:`tab-filter-${e.name}`,logic:e.filter.logic||`and`,conditions:e.filter.conditions||[]};ce(t),u?.(t)}else{let e={id:`root`,logic:`and`,conditions:[]};ce(e),u?.(e)}},[u]),F=h.dataSource,[I,fe]=n.useState([]),[pe,L]=n.useState(!1),[R,me]=n.useState(null),[he,z]=n.useState(!1),[ge,_e]=n.useState(0),[ve,B]=n.useState(!1);n.useImperativeHandle(g,()=>({refresh:()=>_e(e=>e+1)}),[]),n.useEffect(()=>{if(!(!F?.onMutation||!b.objectName||b.refreshTrigger))return F.onMutation(e=>{e.resource===b.objectName&&_e(e=>e+1)})},[F,b.objectName,b.refreshTrigger]);let[ye,be]=n.useState(void 0),V=ye??b.pagination?.pageSize??100,H=n.useMemo(()=>{if(b.grouping?.fields?.length)return b.grouping;let e=typeof b.groupBy==`string`?b.groupBy.trim():``,t=typeof b.groupBy2==`string`?b.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},[b.grouping,b.groupBy,b.groupBy2]),[U,xe]=n.useState(H),[Se,Ce]=n.useState(!1),we=n.useRef(H);n.useEffect(()=>{we.current!==H&&(we.current=H,xe(H))},[H]);let[W,Te]=n.useState(b.rowColor),[Ee,De]=n.useState(!1),[Oe,ke]=n.useState([]),G=n.useRef(0),[K,Ae]=n.useState(()=>{let e=new Set;return b.quickFilters?.forEach(n=>{let r=(0,t.normalizeQuickFilter)(n);r.defaultActive&&e.add(r.id)}),e}),[je,Me]=n.useState([]),Ne=n.useMemo(()=>{if(b.userFilters)return b.userFilters;if(!R?.fields)return;let e=new Set([`select`,`multi-select`,`boolean`]),t=[],n=Array.isArray(R.fields)?R.fields.map(e=>[e.name,e]):Object.entries(R.fields);for(let[r,i]of n)(e.has(i.type)||i.options&&!i.type)&&t.push({field:r,label:S(r,i.label||r),type:i.type===`boolean`?`boolean`:i.type===`multi-select`?`multi-select`:`select`});if(t.length!==0)return{element:`dropdown`,fields:t}},[b.userFilters,R]),[q,Pe]=n.useState(()=>new Set(b.hiddenFields||[])),[Fe,Ie]=n.useState(!1),[Le,Re]=n.useState(!1),J=n.useMemo(()=>(0,t.normalizeQuickFilters)(b.quickFilters),[b.quickFilters]),Y=n.useMemo(()=>{if(b.exportOptions)return Array.isArray(b.exportOptions)?{formats:b.exportOptions}:b.exportOptions},[b.exportOptions]),X=(0,o.useDensityMode)(n.useMemo(()=>b.densityMode?b.densityMode:b.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[b.rowHeight]||`comfortable`:`compact`,[b.densityMode,b.rowHeight])),{ref:ze,isRefreshing:Be,pullDistance:Ve}=(0,s.usePullToRefresh)({onRefresh:n.useCallback(async()=>{_e(e=>e+1)},[]),enabled:!!F&&!!b.objectName}),He=n.useMemo(()=>b.id?`listview-${b.objectName}-${b.id}-view`:`listview-${b.objectName}-view`,[b.objectName,b.id]);n.useEffect(()=>{let e=!0;return z(!1),me(null),(async()=>{if(!F||!b.objectName){z(!0);return}if(typeof F.getObjectSchema!=`function`){z(!0);return}try{let t=await F.getObjectSchema(b.objectName);e&&me(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&z(!0)}})(),()=>{e=!1}},[b.objectName,F]);let Z=n.useMemo(()=>(0,t.buildExpandFields)(R?.fields,b.fields),[R?.fields,b.fields]);n.useEffect(()=>{let e=!0,t=++G.current;if(b.data&&typeof b.data==`object`&&!Array.isArray(b.data)){let e=b.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(D){let e=D.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}fe(t),L(!1),B(!1);return}}if(Array.isArray(b.data)){let e=b.data;if(D){let t=D.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}fe(e),L(!1),B(!1);return}return he?((async()=>{if(!(!F||!b.objectName)){L(!0);try{let n=[],r=b.filters||[],i=te(P),a=[];J&&K.size>0&&J.forEach(e=>{K.has(e.id)&&e.filters&&e.filters.length>0&&a.push(e.filters)});let o=A(je),s=[...r.length>0?[r]:[],...i.length>0?[i]:[],...a,...o].filter(e=>Array.isArray(e)&&e.length>0);s.length>1?n=[`and`,...s]:s.length===1&&(n=s[0]);let c=N.length>0?N.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,l=(()=>{let e=Array.isArray(b.fields)?b.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[];if(e.length===0)return;let t=new Set([`id`]);for(let n of e)t.add(n);for(let e of Z)t.add(e);let n=e=>{if(!e)return;let n=[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:[]];for(let e of n)typeof e==`string`&&e&&t.add(e)};return n(b.kanban),n(b.options?.kanban),n(b.calendar),n(b.options?.calendar),n(b.gallery),n(b.options?.gallery),n(b.timeline),n(b.options?.timeline),n(b.gantt),n(b.options?.gantt),Array.from(t)})(),u=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,d=await F.find(b.objectName,{...u?{$filter:n}:{},$orderby:c,$top:V,...l?{$select:l}:{},...Z.length>0?{$expand:Z}:{},...D?{$search:D,...b.searchableFields&&b.searchableFields.length>0?{$searchFields:b.searchableFields}:{}}:{}});if(!e||t!==G.current)return;let f=[];Array.isArray(d)?f=d:d&&typeof d==`object`&&(Array.isArray(d.data)?f=d.data:Array.isArray(d.records)?f=d.records:Array.isArray(d.value)&&(f=d.value)),fe(f),B(f.length>=V)}catch(e){t===G.current&&console.error(`ListView data fetch error:`,e)}finally{e&&t===G.current&&L(!1)}}})(),()=>{e=!1}):void 0},[b.objectName,b.data,F,b.filters,V,N,P,K,J,je,ge,D,b.searchableFields,Z,he,b.refreshTrigger]);let Ue=n.useMemo(()=>{if(b.appearance?.allowedVisualizations&&b.appearance.allowedVisualizations.length>0)return b.appearance.allowedVisualizations.filter(e=>[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`].includes(e));let e=[`grid`];return(b.kanban?.groupField||b.options?.kanban?.groupField)&&e.push(`kanban`),(b.gallery?.coverField||b.gallery?.imageField||b.options?.gallery?.imageField)&&e.push(`gallery`),(b.calendar?.startDateField||b.options?.calendar?.startDateField)&&e.push(`calendar`),(b.timeline?.startDateField||b.options?.timeline?.startDateField||b.options?.timeline?.dateField||b.options?.calendar?.startDateField)&&e.push(`timeline`),(b.gantt?.startDateField||b.options?.gantt?.startDateField)&&e.push(`gantt`),(b.options?.map?.locationField||b.options?.map?.latitudeField&&b.options?.map?.longitudeField)&&e.push(`map`),b.viewType&&!e.includes(b.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`].includes(b.viewType)&&e.push(b.viewType),e},[b.options,b.viewType,b.kanban,b.calendar,b.gantt,b.gallery,b.timeline,b.appearance?.allowedVisualizations]);n.useEffect(()=>{b.viewType&&E(b.viewType)},[b.viewType]);let We=n.useCallback(e=>{E(e);try{localStorage.setItem(He,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}l?.(e)},[He,l]),Ge=n.useCallback(e=>{O(e),f?.(e)},[f]),Q=(0,o.useNavigationOverlay)({navigation:b.navigation,objectName:b.objectName,onNavigate:b.onNavigate,onRowClick:p}),$=n.useMemo(()=>{let e=b.fields||[];if(Array.isArray(e)||(e=[]),q.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!q.has(t)})),b.fieldOrder&&b.fieldOrder.length>0){let t=new Map(b.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},[b.fields,q,b.fieldOrder]),Ke=n.useMemo(()=>{let e={objectName:b.objectName,fields:$,filters:b.filters,sort:N,className:`h-full w-full`,showSearch:!1,onRowClick:Q.handleClick,...b.striped==null?{}:{striped:b.striped},...b.bordered==null?{}:{bordered:b.bordered}};switch(T){case`grid`:return{type:`object-grid`,...e,columns:$,...b.conditionalFormatting?{conditionalFormatting:b.conditionalFormatting}:{},...b.inlineEdit==null?{}:{editable:b.inlineEdit},...b.wrapHeaders==null?{}:{wrapHeaders:b.wrapHeaders},...b.virtualScroll==null?{}:{virtualScroll:b.virtualScroll},...b.resizable==null?{}:{resizable:b.resizable},...b.selection?{selection:b.selection}:{},...b.pagination?{pagination:b.pagination}:{},...U?{grouping:U}:{},...W?{rowColor:W}:{},...b.rowActions?{rowActions:b.rowActions}:{},...b.bulkActions?{batchActions:b.bulkActions}:{},...b.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...e,groupBy:b.kanban?.groupField||b.options?.kanban?.groupField||`status`,groupField:b.kanban?.groupField||b.options?.kanban?.groupField||`status`,...b.kanban?.titleField||b.options?.kanban?.titleField?{titleField:b.kanban?.titleField||b.options?.kanban?.titleField}:{},cardFields:b.kanban?.cardFields||$||[],...U?{grouping:U}:{},...b.options?.kanban||{},...b.kanban||{}};case`calendar`:return{type:`object-calendar`,...e,startDateField:b.calendar?.startDateField||b.options?.calendar?.startDateField||`start_date`,endDateField:b.calendar?.endDateField||b.options?.calendar?.endDateField||`end_date`,...b.calendar?.titleField||b.options?.calendar?.titleField?{titleField:b.calendar?.titleField||b.options?.calendar?.titleField}:{},...b.calendar?.defaultView?{defaultView:b.calendar.defaultView}:{},...b.options?.calendar||{},...b.calendar||{}};case`gallery`:{let t={...b.options?.gallery||{},...b.gallery||{}};return{type:`object-gallery`,...e,gallery:Object.keys(t).length>0?t:void 0,imageField:b.gallery?.coverField||b.gallery?.imageField||b.options?.gallery?.imageField,titleField:b.gallery?.titleField||b.options?.gallery?.titleField||`name`,subtitleField:b.gallery?.subtitleField||b.options?.gallery?.subtitleField,...U?{grouping:U}:{}}}case`timeline`:{let t={...b.options?.timeline||{},...b.timeline||{}};return{type:`object-timeline`,...e,timeline:Object.keys(t).length>0?t:void 0,startDateField:b.timeline?.startDateField||b.options?.timeline?.startDateField||b.options?.timeline?.dateField||`created_at`,titleField:b.timeline?.titleField||b.options?.timeline?.titleField||`name`,...b.timeline?.endDateField?{endDateField:b.timeline.endDateField}:{},...b.timeline?.groupByField?{groupByField:b.timeline.groupByField}:{},...b.timeline?.colorField?{colorField:b.timeline.colorField}:{},...b.timeline?.scale?{scale:b.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...e,startDateField:b.gantt?.startDateField||b.options?.gantt?.startDateField||`start_date`,endDateField:b.gantt?.endDateField||b.options?.gantt?.endDateField||`end_date`,progressField:b.gantt?.progressField||b.options?.gantt?.progressField||`progress`,dependenciesField:b.gantt?.dependenciesField||b.options?.gantt?.dependenciesField||`dependencies`,...b.gantt?.titleField?{titleField:b.gantt.titleField}:{},...b.options?.gantt||{},...b.gantt||{}};case`map`:return{type:`object-map`,...e,locationField:b.options?.map?.locationField||`location`,...b.options?.map||{}};default:return e}},[T,b,N,$,U,W,Q.handleClick]),qe=P.conditions&&P.conditions.length>0,Je=n.useMemo(()=>{let e;if(e=R?.fields?Object.entries(R.fields).map(([e,t])=>({value:e,label:S(e,t.label||e),type:t.type||`text`,options:t.options,referenceTo:t.reference_to||t.reference,displayField:t.display_field||t.reference_field,idField:t.id_field})):(b.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let t=e.name||e.fieldName;return{value:t,label:S(t,e.label||e.name),type:e.type||`text`,options:e.options,referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),b.filterableFields&&b.filterableFields.length>0){let t=new Set(b.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[R,b.fields,b.filterableFields]),Ye=n.useCallback(e=>{Ae(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Xe=n.useCallback(e=>{let t=Y,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||b.objectName||`export`,a=n>0?I.slice(0,n):I;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)}Re(!1)},[I,$,Y,b.objectName]),Ze=n.useMemo(()=>(b.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:S(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:S(t,e.label||e.name||e.field)}}),[b.fields,S]);return(0,a.jsxs)(`div`,{ref:ze,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,c),...b.aria?.label?{"aria-label":b.aria.label}:{},...b.aria?.describedBy?{"aria-describedby":b.aria.describedBy}:{},...b.aria?.live?{"aria-live":b.aria.live}:{},role:`region`,children:[Ve>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:Ve},children:_(Be?`list.refreshing`:`list.pullToRefresh`)}),m&&(0,a.jsx)(`div`,{className:`border-b px-4 py-1 flex items-center bg-background`,children:(0,a.jsx)(v,{currentView:w,availableViews:Ue,onViewChange:We})}),b.tabs&&b.tabs.length>0&&(0,a.jsx)(x,{tabs:b.tabs,activeTab:le,onTabChange:de}),b.description&&b.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`border-b px-4 py-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof b.description==`string`?b.description:``}),(0,a.jsxs)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background`,children:[(0,a.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto min-w-0`,children:Ne&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0`,"data-testid":`user-filters`,children:(0,a.jsx)(ee,{config:Ne,objectDef:R,data:I,onFilterChange:Me,maxVisible:3})})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[C.showHideFields&&(0,a.jsxs)(r.Popover,{open:Fe,onOpenChange:Ie,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`,q.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:_(`list.hideFields`)}),q.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:q.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:_(`list.hideFieldsTitle`)}),q.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Pe(new Set),children:_(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:Ze.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:!q.has(e.name),onChange:()=>{Pe(t=>{let n=new Set(t);return n.has(e.name)?n.delete(e.name):n.add(e.name),n})},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),C.showHideFields&&(C.showFilters||C.showSort||C.showGroup)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),C.showFilters&&(0,a.jsxs)(r.Popover,{open:oe,onOpenChange:se,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`,qe&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`list.filter`)}),qe&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:P.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:_(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:Je,value:P,onChange:e=>{ce(e),u&&u(e)}})]})})]}),C.showGroup&&(0,a.jsxs)(r.Popover,{open:Se,onOpenChange:Ce,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`,U&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`list.group`)}),U&&U.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:U.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:_(`list.groupBy`)}),U&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>xe(void 0),"data-testid":`clear-grouping`,children:_(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:U,fieldOptions:Ze.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:_(`list.addGroup`,`Add group field`),collapseTitle:_(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:_(`list.removeGroup`,`Remove`)},onChange:e=>xe(e)})})]})})]}),C.showSort&&(0,a.jsxs)(r.Popover,{open:M,onOpenChange:ie,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`,N.length>0&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`list.sort`)}),N.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:N.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:_(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:Je,value:N,onChange:e=>{ae(e),d&&d(e)}})]})})]}),(C.showFilters||C.showSort||C.showGroup)&&(C.showColor||C.showDensity)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),C.showColor&&(0,a.jsxs)(r.Popover,{open:Ee,onOpenChange:De,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`,W&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`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:_(`list.rowColor`)}),W&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Te(void 0),"data-testid":`clear-row-color`,children:_(`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:_(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:W?.field||``,onChange:e=>{let t=e.target.value;Te(t?{field:t,colors:W?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:_(`list.none`)}),Ze.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),C.showDensity&&(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 hidden lg:flex transition-colors duration-150`,X.mode!==`compact`&&`bg-primary/10 border border-primary/20 text-primary`),onClick:X.cycle,title:`Density: ${X.mode}`,children:[(0,a.jsx)(i.AlignJustify,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline capitalize`,children:X.mode})]}),(C.showColor||C.showDensity)&&Y&&b.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),Y&&b.allowExport!==!1&&(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:`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:_(`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:()=>Xe(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),_(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(b.sharing?.enabled||b.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: ${b.sharing?.visibility||b.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:_(`list.share`)})]}),b.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:_(`list.print`)})]}),(()=>{let e=b.allowPrinting||b.sharing?.enabled||b.sharing?.type||Y&&b.allowExport!==!1;return C.showSearch&&e?(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}):null})(),C.showSearch&&(0,a.jsxs)(r.Popover,{open:te,onOpenChange:j,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,E&&`bg-primary/10 border border-primary/20 text-primary`),"data-testid":`search-icon-button`,title:_(`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:_(`list.search`)+`...`,value:E,onChange:e=>Ge(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),E&&(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:()=>Ge(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),C.showAddRecord&&C.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:()=>h.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:_(`list.addRecord`)})]})]})]}),J&&J.length>0&&(0,a.jsx)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background`,"data-testid":`quick-filters`,children:J.map(e=>{let t=K.has(e.id),n=e.icon?i.icons[e.icon.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null;return(0,a.jsxs)(r.Button,{variant:t?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs`,onClick:()=>Ye(e.id),children:[n&&(0,a.jsx)(n,{className:`h-3 w-3 mr-1.5`}),e.label]},e.id)})}),(0,a.jsx)(`div`,{className:`flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200`,children:!pe&&I.length===0?(()=>{let e=b.emptyState?.icon;return(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8`,"data-testid":`empty-state`,children:[(0,a.jsx)(e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??i.Inbox:i.Inbox,{className:`h-12 w-12 text-muted-foreground/50 mb-4`}),(0,a.jsx)(`h3`,{className:`text-lg font-medium text-foreground mb-1`,children:(typeof b.emptyState?.title==`string`?b.emptyState.title:void 0)??`No items found`}),(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground max-w-md`,children:(typeof b.emptyState?.message==`string`?b.emptyState.message:void 0)??`There are no records to display. Try adjusting your filters or adding new data.`}),C.showAddRecord&&(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,className:`mt-4`,"data-testid":`empty-state-add-record`,onClick:()=>h.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),_(`list.addRecord`)]})]})})():(0,a.jsx)(o.SchemaRenderer,{schema:Ke,...h,data:I,loading:pe,onRowSelect:ke})},w),C.showAddRecord&&C.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:()=>h.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:_(`list.addRecord`)})]})}),b.bulkActions&&b.bulkActions.length>0&&Oe.length>0&&w!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-1.5 flex items-center gap-2 text-xs bg-primary/5 shrink-0`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsxs)(`span`,{className:`text-muted-foreground font-medium`,children:[Oe.length,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1 ml-2`,children:b.bulkActions.map(e=>(0,a.jsx)(r.Button,{variant:`outline`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>h.onBulkAction?.(e,Oe),"data-testid":`bulk-action-${e}`,children:O(e)},e))}),(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs ml-auto`,onClick:()=>ke([]),children:`Clear`})]}),!pe&&I.length>0&&b.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-1.5 flex items-center gap-2 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{children:I.length===1?_(`list.recordCountOne`,{count:I.length}):_(`list.recordCount`,{count:I.length})}),ve&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:_(`list.dataLimitReached`,{limit:V})}),b.pagination?.pageSizeOptions&&b.pagination.pageSizeOptions.length>0&&(0,a.jsx)(`select`,{className:`ml-auto h-6 rounded border border-input bg-background px-1 text-xs`,value:V,onChange:e=>{let t=Number(e.target.value);be(t),h.onPageSizeChange&&h.onPageSizeChange(t)},"data-testid":`page-size-selector`,children:b.pagination.pageSizeOptions.map(e=>(0,a.jsxs)(`option`,{value:e,children:[e,` / page`]},e))})]}),Q.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...Q,title:b.label?`${b.label} Detail`:b.objectName?`${b.objectName.charAt(0).toUpperCase()+b.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))})})]})});M.displayName=`ListView`;var ie={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`},N={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},ae=e=>{let{schema:s}=e,c=(0,n.useContext)(o.SchemaRendererContext),l=e.dataSource||c?.dataSource,u=(0,o.useDataScope)(s.bind),[d,f]=(0,n.useState)([]),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),_=(0,o.useNavigationOverlay)({navigation:s.navigation,objectName:s.objectName,onRowClick:e.onRowClick??e.onCardClick}),v=s.gallery,y=v?.coverField??s.imageField??`image`,b=v?.coverFit??`cover`,x=v?.cardSize??`medium`,ee=v?.titleField??s.titleField??`name`,S=v?.visibleFields;(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!s.objectName))try{let t=await l.getObjectSchema(s.objectName);e&&g(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[s.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){f(e.data);return}return s.objectName&&!u&&!s.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!s.objectName)){n&&m(!0);try{let e=(0,t.buildExpandFields)(h?.fields),r=await l.find(s.objectName,{$filter:s.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&&f(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&m(!1)}}})(),()=>{n=!1}},[s.objectName,l,u,s.data,s.filter,e.data,h]);let C=e.data||u||s.data||d||[],w=(0,n.useMemo)(()=>C.some(e=>typeof e[y]==`string`&&!!e[y]),[C,y]),T=!!v?.coverField||w,E=s.grouping?.fields,D=!!(E&&E.length>0),[O,k]=(0,n.useState)({}),A=(0,n.useMemo)(()=>E?E.some(e=>e.collapsed):!1,[E]),te=(0,n.useCallback)(e=>{k(t=>({...t,[e]:t[e]===void 0?!A:!t[e]}))},[A]),j=(0,n.useMemo)(()=>{if(!D||!E)return[];let e=new Map,t=[];for(let n of C){let r=E.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=E.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=E[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 O?O[t]:A;return{key:t,label:n.label,items:n.items,collapsed:r}})},[C,E,D,O,A]);if(p&&!C.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!C.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No items to display`});let ne=(t,n)=>{let i=t.id??t._id??n,o=String(t[ee]??`Untitled`),c=t[y];return(0,a.jsxs)(r.Card,{role:`listitem`,className:(0,r.cn)(`group overflow-hidden transition-all hover:shadow-md`,(e.onCardClick||e.onRowClick||s.navigation)&&`cursor-pointer`),onClick:()=>_.handleClick(t),children:[(0,a.jsx)(`div`,{className:(0,r.cn)(`w-full overflow-hidden bg-muted relative`,N[x]),hidden:!T,children:c?(0,a.jsx)(`img`,{src:c,alt:o,className:(0,r.cn)(`h-full w-full transition-transform group-hover:scale-105`,b===`cover`&&`object-cover`,b===`contain`&&`object-contain`)}):(0,a.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-secondary/50 text-muted-foreground`,children:(0,a.jsx)(`span`,{className:`text-4xl font-light opacity-20`,children:o[0]?.toUpperCase()})})}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,T&&`border-t`),children:[(0,a.jsx)(`h3`,{className:`font-medium truncate text-sm`,title:o,children:o}),S&&S.length>0&&(0,a.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:S.map(e=>{let n=t[e];return n==null||n===``?null:(0,a.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:typeof n==`object`?n.label??n.name??n.id??JSON.stringify(n):String(n)},e)})})]})]},i)},re=e=>(0,a.jsx)(`div`,{className:(0,r.cn)(`grid gap-4 p-4 auto-rows-min content-start`,ie[x],s.className),role:`list`,children:e.map((e,t)=>ne(e,t))});return(0,a.jsxs)(a.Fragment,{children:[D?(0,a.jsx)(`div`,{className:`space-y-2`,children:j.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&&re(e.items)]},e.key))}):re(C),_.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{..._,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`,ae,{namespace:`plugin-list`,label:`Gallery View`,category:`view`}),t.ComponentRegistry.register(`list-view`,M,{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`,M,{namespace:`view`,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=M,e.ObjectGallery=ae,e.TabBar=x,e.UserFilters=ee,e.ViewSwitcher=v,e.evaluateConditionalFormatting=te,e.normalizeFilterCondition=D,e.normalizeFilters=k});
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)}Re(!1)},[I,$,Y,b.objectName]),Ze=n.useMemo(()=>(b.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:S(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:S(t,e.label||e.name||e.field)}}),[b.fields,S]);return(0,a.jsxs)(`div`,{ref:ze,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,c),...b.aria?.label?{"aria-label":b.aria.label}:{},...b.aria?.describedBy?{"aria-describedby":b.aria.describedBy}:{},...b.aria?.live?{"aria-live":b.aria.live}:{},role:`region`,children:[Ve>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:Ve},children:_(Be?`list.refreshing`:`list.pullToRefresh`)}),m&&(0,a.jsx)(`div`,{className:`border-b px-4 py-1 flex items-center bg-background`,children:(0,a.jsx)(v,{currentView:T,availableViews:Ue,onViewChange:We})}),b.tabs&&b.tabs.length>0&&(0,a.jsx)(x,{tabs:b.tabs,activeTab:le,onTabChange:de}),b.description&&b.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`border-b px-4 py-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof b.description==`string`?b.description:``}),(0,a.jsxs)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center justify-between gap-1 sm:gap-2 bg-background`,children:[(0,a.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto min-w-0`,children:Ne&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0`,"data-testid":`user-filters`,children:(0,a.jsx)(C,{config:Ne,objectDef:R,data:I,onFilterChange:Me,maxVisible:3})})}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0.5 shrink-0`,children:[w.showHideFields&&(0,a.jsxs)(r.Popover,{open:Fe,onOpenChange:Ie,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`,q.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:_(`list.hideFields`)}),q.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:q.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:_(`list.hideFieldsTitle`)}),q.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Pe(new Set),children:_(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:Ze.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:!q.has(e.name),onChange:()=>{Pe(t=>{let n=new Set(t);return n.has(e.name)?n.delete(e.name):n.add(e.name),n})},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),w.showHideFields&&(w.showFilters||w.showSort||w.showGroup)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),w.showFilters&&(0,a.jsxs)(r.Popover,{open:oe,onOpenChange:se,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`,qe&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`list.filter`)}),qe&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:P.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:_(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:Je,value:P,onChange:e=>{ce(e),u&&u(e)}})]})})]}),w.showGroup&&(0,a.jsxs)(r.Popover,{open:Se,onOpenChange:Ce,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`,U&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`list.group`)}),U&&U.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:U.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:_(`list.groupBy`)}),U&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>xe(void 0),"data-testid":`clear-grouping`,children:_(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:U,fieldOptions:Ze.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:_(`list.addGroup`,`Add group field`),collapseTitle:_(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:_(`list.removeGroup`,`Remove`)},onChange:e=>xe(e)})})]})})]}),w.showSort&&(0,a.jsxs)(r.Popover,{open:j,onOpenChange:M,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`,N.length>0&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`list.sort`)}),N.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary/10 text-[10px] font-medium text-primary`,children:N.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:_(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:Je,value:N,onChange:e=>{ae(e),d&&d(e)}})]})})]}),(w.showFilters||w.showSort||w.showGroup)&&(w.showColor||w.showDensity)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),w.showColor&&(0,a.jsxs)(r.Popover,{open:Ee,onOpenChange:De,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`,W&&`bg-primary/10 border border-primary/20 text-primary`),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:_(`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:_(`list.rowColor`)}),W&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Te(void 0),"data-testid":`clear-row-color`,children:_(`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:_(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:W?.field||``,onChange:e=>{let t=e.target.value;Te(t?{field:t,colors:W?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:_(`list.none`)}),Ze.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),w.showDensity&&(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 hidden lg:flex transition-colors duration-150`,X.mode!==`compact`&&`bg-primary/10 border border-primary/20 text-primary`),onClick:X.cycle,title:`Density: ${X.mode}`,children:[(0,a.jsx)(i.AlignJustify,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline capitalize`,children:X.mode})]}),(w.showColor||w.showDensity)&&Y&&b.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),Y&&b.allowExport!==!1&&(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:`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:_(`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:()=>Xe(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),_(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(b.sharing?.enabled||b.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: ${b.sharing?.visibility||b.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:_(`list.share`)})]}),b.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:_(`list.print`)})]}),(()=>{let e=b.allowPrinting||b.sharing?.enabled||b.sharing?.type||Y&&b.allowExport!==!1;return w.showSearch&&e?(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}):null})(),w.showSearch&&(0,a.jsxs)(r.Popover,{open:k,onOpenChange:ne,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,D&&`bg-primary/10 border border-primary/20 text-primary`),"data-testid":`search-icon-button`,title:_(`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:_(`list.search`)+`...`,value:D,onChange:e=>Ge(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),D&&(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:()=>Ge(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),w.showAddRecord&&w.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:()=>h.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:_(`list.addRecord`)})]})]})]}),J&&J.length>0&&(0,a.jsx)(`div`,{className:`border-b px-2 sm:px-4 py-1 flex items-center gap-1 flex-wrap bg-background`,"data-testid":`quick-filters`,children:J.map(e=>{let t=K.has(e.id),n=e.icon?i.icons[e.icon.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??null:null;return(0,a.jsxs)(r.Button,{variant:t?`default`:`outline`,size:`sm`,className:`h-7 px-3 text-xs`,onClick:()=>Ye(e.id),children:[n&&(0,a.jsx)(n,{className:`h-3 w-3 mr-1.5`}),e.label]},e.id)})}),(0,a.jsx)(`div`,{className:`flex-1 min-h-0 bg-background relative overflow-hidden animate-in fade-in-0 duration-200`,children:!pe&&I.length===0?(()=>{let e=b.emptyState?.icon;return(0,a.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full min-h-[200px] text-center p-8`,"data-testid":`empty-state`,children:[(0,a.jsx)(e?i.icons[e.split(`-`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(``)]??i.Inbox:i.Inbox,{className:`h-12 w-12 text-muted-foreground/50 mb-4`}),(0,a.jsx)(`h3`,{className:`text-lg font-medium text-foreground mb-1`,children:(typeof b.emptyState?.title==`string`?b.emptyState.title:void 0)??`No items found`}),(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground max-w-md`,children:(typeof b.emptyState?.message==`string`?b.emptyState.message:void 0)??`There are no records to display. Try adjusting your filters or adding new data.`}),w.showAddRecord&&(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,className:`mt-4`,"data-testid":`empty-state-add-record`,onClick:()=>h.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),_(`list.addRecord`)]})]})})():(0,a.jsx)(o.SchemaRenderer,{schema:Ke,...h,data:I,loading:pe,onRowSelect:ke})},T),w.showAddRecord&&w.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:()=>h.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:_(`list.addRecord`)})]})}),b.bulkActions&&b.bulkActions.length>0&&Oe.length>0&&T!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-1.5 flex items-center gap-2 text-xs bg-primary/5 shrink-0`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsxs)(`span`,{className:`text-muted-foreground font-medium`,children:[Oe.length,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1 ml-2`,children:b.bulkActions.map(e=>(0,a.jsx)(r.Button,{variant:`outline`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>h.onBulkAction?.(e,Oe),"data-testid":`bulk-action-${e}`,children:ee(e)},e))}),(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs ml-auto`,onClick:()=>ke([]),children:`Clear`})]}),!pe&&I.length>0&&b.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-1.5 flex items-center gap-2 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{children:I.length===1?_(`list.recordCountOne`,{count:I.length}):_(`list.recordCount`,{count:I.length})}),ve&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:_(`list.dataLimitReached`,{limit:V})}),b.pagination?.pageSizeOptions&&b.pagination.pageSizeOptions.length>0&&(0,a.jsx)(`select`,{className:`ml-auto h-6 rounded border border-input bg-background px-1 text-xs`,value:V,onChange:e=>{let t=Number(e.target.value);be(t),h.onPageSizeChange&&h.onPageSizeChange(t)},"data-testid":`page-size-selector`,children:b.pagination.pageSizeOptions.map(e=>(0,a.jsxs)(`option`,{value:e,children:[e,` / page`]},e))})]}),Q.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...Q,title:b.label?`${b.label} Detail`:b.objectName?`${b.objectName.charAt(0).toUpperCase()+b.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))})})]})});M.displayName=`ListView`;var N={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`},ae={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},oe=e=>{let{schema:s}=e,c=(0,n.useContext)(o.SchemaRendererContext),l=e.dataSource||c?.dataSource,u=(0,o.useDataScope)(s.bind),[d,f]=(0,n.useState)([]),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),_=(0,o.useNavigationOverlay)({navigation:s.navigation,objectName:s.objectName,onRowClick:e.onRowClick??e.onCardClick}),v=s.gallery,y=v?.coverField??s.imageField??`image`,b=v?.coverFit??`cover`,x=v?.cardSize??`medium`,S=v?.titleField??s.titleField??`name`,C=v?.visibleFields;(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!s.objectName))try{let t=await l.getObjectSchema(s.objectName);e&&g(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[s.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){f(e.data);return}return s.objectName&&!u&&!s.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!s.objectName)){n&&m(!0);try{let e=(0,t.buildExpandFields)(h?.fields),r=await l.find(s.objectName,{$filter:s.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&&f(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&m(!1)}}})(),()=>{n=!1}},[s.objectName,l,u,s.data,s.filter,e.data,h]);let w=e.data||u||s.data||d||[],T=(0,n.useMemo)(()=>w.some(e=>typeof e[y]==`string`&&!!e[y]),[w,y]),E=!!v?.coverField||T,D=s.grouping?.fields,O=!!(D&&D.length>0),[k,ee]=(0,n.useState)({}),A=(0,n.useMemo)(()=>D?D.some(e=>e.collapsed):!1,[D]),te=(0,n.useCallback)(e=>{ee(t=>({...t,[e]:t[e]===void 0?!A:!t[e]}))},[A]),ne=(0,n.useMemo)(()=>{if(!O||!D)return[];let e=new Map,t=[];for(let n of w){let r=D.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=D.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=D[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 k?k[t]:A;return{key:t,label:n.label,items:n.items,collapsed:r}})},[w,D,O,k,A]);if(p&&!w.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!w.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`No items to display`});let j=(t,n)=>{let i=t.id??t._id??n,o=String(t[S]??`Untitled`),c=t[y];return(0,a.jsxs)(r.Card,{role:`listitem`,className:(0,r.cn)(`group overflow-hidden transition-all hover:shadow-md`,(e.onCardClick||e.onRowClick||s.navigation)&&`cursor-pointer`),onClick:()=>_.handleClick(t),children:[(0,a.jsx)(`div`,{className:(0,r.cn)(`w-full overflow-hidden bg-muted relative`,ae[x]),hidden:!E,children:c?(0,a.jsx)(`img`,{src:c,alt:o,className:(0,r.cn)(`h-full w-full transition-transform group-hover:scale-105`,b===`cover`&&`object-cover`,b===`contain`&&`object-contain`)}):(0,a.jsx)(`div`,{className:`flex h-full w-full items-center justify-center bg-secondary/50 text-muted-foreground`,children:(0,a.jsx)(`span`,{className:`text-4xl font-light opacity-20`,children:o[0]?.toUpperCase()})})}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,E&&`border-t`),children:[(0,a.jsx)(`h3`,{className:`font-medium truncate text-sm`,title:o,children:o}),C&&C.length>0&&(0,a.jsx)(`div`,{className:`mt-1 space-y-0.5`,children:C.map(e=>{let n=t[e];return n==null||n===``?null:(0,a.jsx)(`p`,{className:`text-xs text-muted-foreground truncate`,children:typeof n==`object`?n.label??n.name??n.id??JSON.stringify(n):String(n)},e)})})]})]},i)},re=e=>(0,a.jsx)(`div`,{className:(0,r.cn)(`grid gap-4 p-4 auto-rows-min content-start`,N[x],s.className),role:`list`,children:e.map((e,t)=>j(e,t))});return(0,a.jsxs)(a.Fragment,{children:[O?(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&&re(e.items)]},e.key))}):re(w),_.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{..._,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`,oe,{namespace:`plugin-list`,label:`Gallery View`,category:`view`}),t.ComponentRegistry.register(`list-view`,M,{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`,M,{namespace:`view`,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=M,e.ObjectGallery=oe,e.TabBar=x,e.UserFilters=C,e.ViewSwitcher=v,e.evaluateConditionalFormatting=ne,e.normalizeFilterCondition=k,e.normalizeFilters=A});
@@ -1 +1 @@
1
- {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACvD,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAqBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAyBhE;AAUD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAKtD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,GAC9C,KAAK,CAAC,aAAa,CAoDrB;AAuFD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,mGAkgDnB,CAAC"}
1
+ {"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../../../../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAMxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAKvD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,uEAAuE;IACvE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IACvD,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAqBD;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAyBhE;AAUD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAKtD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,GAC9C,KAAK,CAAC,aAAa,CAoDrB;AAuFD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,mGAwgDnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"UserFilters.d.ts","sourceRoot":"","sources":["../../../../src/UserFilters.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAoBvD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,wDAAwD;IACxD,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,wCAAwC;IACxC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,yCAAyC;IACzC,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACzC,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAS,EACT,IAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,GACV,EAAE,gBAAgB,kDAkClB"}
1
+ {"version":3,"file":"UserFilters.d.ts","sourceRoot":"","sources":["../../../../src/UserFilters.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA4BvD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,wDAAwD;IACxD,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,wCAAwC;IACxC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,yCAAyC;IACzC,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACzC,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAS,EACT,IAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,GACV,EAAE,gBAAgB,kDAkClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@object-ui/plugin-list",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "ListView plugin for Object UI - unified view component with view type switching",
@@ -29,12 +29,12 @@
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": "^4.0.5",
33
- "@object-ui/core": "^4.0.5",
34
- "@object-ui/i18n": "^4.0.5",
35
- "@object-ui/mobile": "^4.0.5",
36
- "@object-ui/react": "^4.0.5",
37
- "@object-ui/types": "^4.0.5"
32
+ "@object-ui/components": "^4.0.7",
33
+ "@object-ui/core": "^4.0.7",
34
+ "@object-ui/i18n": "^4.0.7",
35
+ "@object-ui/mobile": "^4.0.7",
36
+ "@object-ui/react": "^4.0.7",
37
+ "@object-ui/types": "^4.0.7"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/react": "19.2.14",
@@ -44,12 +44,12 @@
44
44
  "vite": "^8.0.10",
45
45
  "vite-plugin-dts": "^5.0.0",
46
46
  "vitest": "^4.1.5",
47
- "@object-ui/components": "4.0.5",
48
- "@object-ui/core": "4.0.5",
49
- "@object-ui/i18n": "4.0.5",
50
- "@object-ui/mobile": "4.0.5",
51
- "@object-ui/react": "4.0.5",
52
- "@object-ui/types": "4.0.5"
47
+ "@object-ui/components": "4.0.7",
48
+ "@object-ui/core": "4.0.7",
49
+ "@object-ui/i18n": "4.0.7",
50
+ "@object-ui/mobile": "4.0.7",
51
+ "@object-ui/react": "4.0.7",
52
+ "@object-ui/types": "4.0.7"
53
53
  },
54
54
  "keywords": [
55
55
  "objectui",