@object-ui/plugin-list 4.0.12 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +1 -0
- package/dist/index.umd.cjs +1 -1
- package/dist/packages/plugin-list/src/ListView.d.ts.map +1 -1
- package/package.json +13 -13
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -972,6 +972,7 @@ var H = a.forwardRef(({ schema: e, className: n, onViewChange: o, onFilterChange
|
|
|
972
972
|
...q ? { grouping: q } : {},
|
|
973
973
|
...J ? { rowColor: J } : {},
|
|
974
974
|
...D.rowActions ? { rowActions: D.rowActions } : {},
|
|
975
|
+
...D.rowActionDefs ? { rowActionDefs: D.rowActionDefs } : {},
|
|
975
976
|
...D.bulkActions ? { batchActions: D.bulkActions } : {},
|
|
976
977
|
...D.options?.grid || {}
|
|
977
978
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@object-ui/core`),require(`react`),require(`@object-ui/components`),require(`lucide-react`),require(`react/jsx-runtime`),require(`@object-ui/i18n`),require(`@object-ui/react`),require(`@object-ui/mobile`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/i18n`,`@object-ui/react`,`@object-ui/mobile`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIi18n,e.ObjectUIReact,e.ObjectUIMobile))})(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)(`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-2.5 py-1 text-xs rounded-md transition-colors duration-150`,n?`font-medium text-foreground bg-muted`:`text-muted-foreground hover:text-foreground hover:bg-transparent`),"data-testid":`view-tab-${e.name}`,role:`tab`,"aria-selected":n,onClick:()=>f(e),children:[t&&(0,a.jsx)(t,{className:`h-3 w-3 mr-1.5`}),e.label]},e.name)})})};function S(){try{let{t:e}=(0,o.useObjectTranslation)(),t=e(`common.more`);return!t||t===`common.more`?`More`:t}catch{return`More`}}var C=new Set([`lookup`,`master_detail`,`user`,`owner`]);function w({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 ee(e,t,n,r){return e.map(e=>{let i=e.options?[...e.options]:[],a=e.type,o,s,c;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(a||=n.type,o=n.reference_to??n.reference,s=n.display_field??n.reference_field,c=n.id_field,i.length===0&&n.options&&(i=Array.isArray(n.options)?n.options.map(e=>({label:e.label??String(e.value??e),value:e.value??e,color:e.color})):Object.entries(n.options).map(([e,t])=>({label:t?.label||e,value:e,color:t?.color}))))}i.length===0&&a===`boolean`&&(i=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(i=i.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length})));let l=e.label;return r?.objectName&&(i=r.translateOptions(r.objectName,e.field,i),l=r.fieldLabel(r.objectName,e.field,e.label||e.field)),{...e,label:l,type:a,options:i,referenceTo:o,displayField:s,idField:c}})}function T({fields:e,objectDef:t,data:s,onFilterChange:c,maxVisible:l,className:u}){let{fieldLabel:d,translateOptions:f}=(0,o.useSafeFieldLabel)(),p=S(),m=t?.name,[h,g]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues)}),t}),_=n.useMemo(()=>ee(e,t,s,{objectName:m,fieldLabel:d,translateOptions:f}),[e,t,s,m,d,f]),v=n.useCallback(e=>{c(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[c]),y=(e,t)=>{let n={...h,[e]:t};g(n),v(n)};n.useEffect(()=>{Object.values(h).some(e=>e.length>0)&&v(h)},[]);let b=l!==void 0&&l<_.length?_.slice(0,l):_,x=l!==void 0&&l<_.length?_.slice(l):[],w=e=>{let t=h[e.field]||[],n=t.length>0,o=C.has(e.type||``)&&e.options.length===0&&(e.referenceTo||e.type===`user`||e.type===`owner`),s=o?`w-72`:`w-56`;return(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`filter-badge-${e.field}`,className:(0,r.cn)(`inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md`,n?`text-foreground font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60 hover:opacity-100`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),y(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];y(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];y(e.field,r)},className:`rounded border-input`}),n.color&&(0,a.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full shrink-0`,style:{backgroundColor:n.color}}),(0,a.jsx)(`span`,{className:`truncate flex-1`,children:n.label}),n.count!==void 0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.count})]},String(n.value)))})})]},e.field)};return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,u),"data-testid":`user-filters-dropdown`,children:_.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:[b.map(w),x.length>0&&(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`user-filters-more`,className:`inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md`,children:[(0,a.jsx)(`span`,{children:p}),(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:x.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:x.map(w)})})]})]})})}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 A(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function te(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?k(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function j(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=te(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,O(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function M(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 N={"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`,"table.rowsPerPage":`Rows per page`};function ne(){try{let e=(0,o.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:(e,t)=>{let n=N[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=N[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,o.useObjectLabel)();return{fieldLabel:e}}catch{return{fieldLabel:(e,t,n)=>n}}}var P=n.forwardRef(({schema:e,className:l,onViewChange:u,onFilterChange:d,onSortChange:f,onSearchChange:p,onHiddenFieldsChange:m,onColumnStateChange:h,onRowClick:g,showViewSwitcher:_=!1,...y},b)=>{let{t:S}=ne(),{fieldLabel:C}=re(),{translateOptions:ee}=(0,o.useSafeFieldLabel)(),T=n.useMemo(()=>({...e,viewType:e.viewType||`grid`}),[e]),E=n.useCallback((e,t)=>T.objectName?C(T.objectName,e,t):t,[T.objectName,C]),D=n.useMemo(()=>{let e=T.userActions,t=T.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?T.showSearch!==!1:e.search,showSort:e?.sort===void 0?T.showSort!==!1:e.sort,showFilters:e?.filter===void 0?T.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?T.showDensity!==!1:e.rowHeight,showHideFields:T.showHideFields===!0,showGroup:T.showGroup!==!1,showColor:T.showColor===!0,showAddRecord:t,addRecordPosition:T.addRecord?.position===`bottom`?`bottom`:`top`}},[T.userActions,T.showSearch,T.showSort,T.showFilters,T.showDensity,T.showHideFields,T.showGroup,T.showColor,T.addRecord,T.userActions?.addRecordForm]),[O,k]=n.useState(T.viewType),[M,N]=n.useState(``),[P,ie]=n.useState(!1),[ae,oe]=n.useState(!1),[F,se]=n.useState(()=>T.sort&&T.sort.length>0?T.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`}}):[]),ce=n.useMemo(()=>JSON.stringify(T.sort||[]),[T.sort]);n.useEffect(()=>{T.sort&&T.sort.length>0?se(T.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`}})):se([])},[ce]);let[le,ue]=n.useState(!1),[I,de]=n.useState({id:`root`,logic:`and`,conditions:[]}),[fe,pe]=n.useState(()=>{if(!(!T.tabs||T.tabs.length===0))return T.tabs.find(e=>e.isDefault)?.name??T.tabs[0]?.name}),me=n.useCallback(e=>{if(pe(e.name),e.filter){let t={id:`tab-filter-${e.name}`,logic:e.filter.logic||`and`,conditions:e.filter.conditions||[]};de(t),d?.(t)}else{let e={id:`root`,logic:`and`,conditions:[]};de(e),d?.(e)}},[d]),L=y.dataSource,[R,he]=n.useState([]),[ge,z]=n.useState(!1),[B,_e]=n.useState(null),[ve,V]=n.useState(!1),[ye,be]=n.useState(0),[xe,Se]=n.useState(!1);n.useImperativeHandle(b,()=>({refresh:()=>be(e=>e+1)}),[]),n.useEffect(()=>{if(!(!L?.onMutation||!T.objectName||T.refreshTrigger))return L.onMutation(e=>{e.resource===T.objectName&&be(e=>e+1)})},[L,T.objectName,T.refreshTrigger]);let[Ce,we]=n.useState(void 0),H=Ce??T.pagination?.pageSize??100,U=n.useMemo(()=>{if(T.grouping?.fields?.length)return T.grouping;let e=typeof T.groupBy==`string`?T.groupBy.trim():``,t=typeof T.groupBy2==`string`?T.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},[T.grouping,T.groupBy,T.groupBy2]),[W,Te]=n.useState(U),[Ee,De]=n.useState(!1),Oe=n.useRef(U);n.useEffect(()=>{Oe.current!==U&&(Oe.current=U,Te(U))},[U]);let[G,ke]=n.useState(T.rowColor),[Ae,je]=n.useState(!1),[K,Me]=n.useState([]),q=n.useRef(0),[J,Ne]=n.useState(()=>{let e=new Set;return T.quickFilters?.forEach(n=>{let r=(0,t.normalizeQuickFilter)(n);r.defaultActive&&e.add(r.id)}),e}),[Pe,Fe]=n.useState([]),Ie=n.useMemo(()=>{if(T.userFilters)return T.userFilters;if(!B?.fields)return;let e=new Set([`select`,`multi-select`,`boolean`]),t=[],n=Array.isArray(B.fields)?B.fields.map(e=>[e.name,e]):Object.entries(B.fields);for(let[r,i]of n)(e.has(i.type)||i.options&&!i.type)&&t.push({field:r,label:E(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}},[T.userFilters,B]),[Y,Le]=n.useState(()=>new Set(T.hiddenFields||[])),Re=n.useMemo(()=>JSON.stringify(T.hiddenFields||[]),[T.hiddenFields]);n.useEffect(()=>{Le(new Set(T.hiddenFields||[]))},[Re]);let ze=n.useCallback(e=>{Le(e),m?.(Array.from(e))},[m]),[Be,Ve]=n.useState(!1),[He,Ue]=n.useState(!1),X=n.useMemo(()=>(0,t.normalizeQuickFilters)(T.quickFilters),[T.quickFilters]),Z=n.useMemo(()=>{if(T.exportOptions)return Array.isArray(T.exportOptions)?{formats:T.exportOptions}:T.exportOptions},[T.exportOptions]),Q=(0,s.useDensityMode)(n.useMemo(()=>T.densityMode?T.densityMode:T.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[T.rowHeight]||`comfortable`:`compact`,[T.densityMode,T.rowHeight]),{onChange:T.onDensityChange}),{ref:We,isRefreshing:Ge,pullDistance:Ke}=(0,c.usePullToRefresh)({onRefresh:n.useCallback(async()=>{be(e=>e+1)},[]),enabled:!!L&&!!T.objectName}),qe=n.useMemo(()=>T.id?`listview-${T.objectName}-${T.id}-view`:`listview-${T.objectName}-view`,[T.objectName,T.id]);n.useEffect(()=>{let e=!0;return V(!1),_e(null),(async()=>{if(!L||!T.objectName){V(!0);return}if(typeof L.getObjectSchema!=`function`){V(!0);return}try{let t=await L.getObjectSchema(T.objectName);e&&_e(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&V(!0)}})(),()=>{e=!1}},[T.objectName,L]);let Je=n.useMemo(()=>{let e=Array.isArray(T.fields)?T.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],n=new Set(e),r=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)typeof e==`string`&&e&&n.add(e)};r(T.kanban),r(T.options?.kanban),r(T.calendar),r(T.options?.calendar),r(T.gallery),r(T.options?.gallery),r(T.timeline),r(T.options?.timeline),r(T.gantt),r(T.options?.gantt);let i=n.size>0?Array.from(n):void 0;return(0,t.buildExpandFields)(B?.fields,i)},[B?.fields,T.fields,T.kanban,T.calendar,T.gallery,T.timeline,T.gantt,T.options]);n.useEffect(()=>{let e=!0,t=++q.current;if(T.data&&typeof T.data==`object`&&!Array.isArray(T.data)){let e=T.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(M){let e=M.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}he(t),z(!1),Se(!1);return}}if(Array.isArray(T.data)){let e=T.data;if(M){let t=M.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}he(e),z(!1),Se(!1);return}return ve?((async()=>{if(!(!L||!T.objectName)){z(!0);try{let n=[],r=T.filters||[],i=j(I),a=[];X&&J.size>0&&X.forEach(e=>{J.has(e.id)&&e.filters&&e.filters.length>0&&a.push(e.filters)});let o=te(Pe),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=F.length>0?F.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,l=(()=>{let e=Array.isArray(T.fields)?T.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 Je)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:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of n)typeof e==`string`&&e&&t.add(e)};n(T.kanban),n(T.options?.kanban),n(T.calendar),n(T.options?.calendar),n(T.gallery),n(T.options?.gallery),n(T.timeline),n(T.options?.timeline);{let e=T.timeline??T.options?.timeline;e&&!Array.isArray(e.metaFields)&&(t.add(`status`),t.add(`priority`))}return n(T.gantt),n(T.options?.gantt),Array.from(t)})(),u=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,d=await L.find(T.objectName,{...u?{$filter:n}:{},$orderby:c,$top:H,...l?{$select:l}:{},...Je.length>0?{$expand:Je}:{},...M?{$search:M,...T.searchableFields&&T.searchableFields.length>0?{$searchFields:T.searchableFields}:{}}:{}});if(!e||t!==q.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)),he(f),Se(f.length>=H)}catch(e){t===q.current&&console.error(`ListView data fetch error:`,e)}finally{e&&t===q.current&&z(!1)}}})(),()=>{e=!1}):void 0},[T.objectName,T.data,L,T.filters,H,F,I,J,X,Pe,ye,M,T.searchableFields,Je,ve,T.refreshTrigger]);let Ye=n.useMemo(()=>{if(T.appearance?.allowedVisualizations&&T.appearance.allowedVisualizations.length>0)return T.appearance.allowedVisualizations.filter(e=>[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`].includes(e));let e=[`grid`];return(T.kanban?.groupField||T.options?.kanban?.groupField)&&e.push(`kanban`),(T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField)&&e.push(`gallery`),(T.calendar?.startDateField||T.options?.calendar?.startDateField)&&e.push(`calendar`),(T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||T.options?.calendar?.startDateField)&&e.push(`timeline`),(T.gantt?.startDateField||T.options?.gantt?.startDateField)&&e.push(`gantt`),(T.options?.map?.locationField||T.options?.map?.latitudeField&&T.options?.map?.longitudeField)&&e.push(`map`),T.viewType&&!e.includes(T.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`].includes(T.viewType)&&e.push(T.viewType),e},[T.options,T.viewType,T.kanban,T.calendar,T.gantt,T.gallery,T.timeline,T.appearance?.allowedVisualizations]);n.useEffect(()=>{T.viewType&&k(T.viewType)},[T.viewType]);let Xe=n.useCallback(e=>{k(e);try{localStorage.setItem(qe,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}u?.(e)},[qe,u]),Ze=n.useCallback(e=>{N(e),p?.(e)},[p]),Qe=(0,s.useNavigationOverlay)({navigation:T.navigation,objectName:T.objectName,onNavigate:T.onNavigate,onRowClick:g}),$=n.useMemo(()=>{let e=T.fields||[];if(Array.isArray(e)||(e=[]),Y.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!Y.has(t)})),T.fieldOrder&&T.fieldOrder.length>0){let t=new Map(T.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},[T.fields,Y,T.fieldOrder]),$e=n.useMemo(()=>{let e=Q.mode===`compact`?`compact`:Q.mode===`spacious`?`tall`:`medium`,t={objectName:T.objectName,fields:$,filters:T.filters,sort:F,className:`h-full w-full`,showSearch:!1,onRowClick:Qe.handleClick,rowHeight:e,hideRowHeightToggle:!0,...T.striped==null?{}:{striped:T.striped},...T.bordered==null?{}:{bordered:T.bordered},...h?{onColumnStateChange:h}:{},...T.columnState?{columnState:T.columnState}:{}};switch(O){case`grid`:return{type:`object-grid`,...t,columns:$,...T.conditionalFormatting?{conditionalFormatting:T.conditionalFormatting}:{},...T.inlineEdit==null?{}:{editable:T.inlineEdit},...T.wrapHeaders==null?{}:{wrapHeaders:T.wrapHeaders},...T.virtualScroll==null?{}:{virtualScroll:T.virtualScroll},...T.resizable==null?{}:{resizable:T.resizable},...T.selection?{selection:T.selection}:{},...T.pagination?{pagination:T.pagination}:{},...W?{grouping:W}:{},...G?{rowColor:G}:{},...T.rowActions?{rowActions:T.rowActions}:{},...T.bulkActions?{batchActions:T.bulkActions}:{},...T.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...t,groupBy:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,groupField:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,...T.kanban?.titleField||T.options?.kanban?.titleField?{titleField:T.kanban?.titleField||T.options?.kanban?.titleField}:{},cardFields:T.kanban?.cardFields||$||[],...W?{grouping:W}:{},...T.options?.kanban||{},...T.kanban||{}};case`calendar`:return{type:`object-calendar`,...t,startDateField:T.calendar?.startDateField||T.options?.calendar?.startDateField||`start_date`,endDateField:T.calendar?.endDateField||T.options?.calendar?.endDateField||`end_date`,...T.calendar?.titleField||T.options?.calendar?.titleField?{titleField:T.calendar?.titleField||T.options?.calendar?.titleField}:{},...T.calendar?.defaultView?{defaultView:T.calendar.defaultView}:{},...T.options?.calendar||{},...T.calendar||{}};case`gallery`:{let e={...T.options?.gallery||{},...T.gallery||{}};return{type:`object-gallery`,...t,gallery:Object.keys(e).length>0?e:void 0,imageField:T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField,titleField:T.gallery?.titleField||T.options?.gallery?.titleField||`name`,subtitleField:T.gallery?.subtitleField||T.options?.gallery?.subtitleField,...W?{grouping:W}:{}}}case`timeline`:{let e={...T.options?.timeline||{},...T.timeline||{}};return{type:`object-timeline`,...t,timeline:Object.keys(e).length>0?e:void 0,startDateField:T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||`created_at`,titleField:T.timeline?.titleField||T.options?.timeline?.titleField||`name`,...T.timeline?.endDateField?{endDateField:T.timeline.endDateField}:{},...T.timeline?.groupByField?{groupByField:T.timeline.groupByField}:{},...T.timeline?.colorField?{colorField:T.timeline.colorField}:{},...T.timeline?.scale?{scale:T.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...t,startDateField:T.gantt?.startDateField||T.options?.gantt?.startDateField||`start_date`,endDateField:T.gantt?.endDateField||T.options?.gantt?.endDateField||`end_date`,progressField:T.gantt?.progressField||T.options?.gantt?.progressField||`progress`,dependenciesField:T.gantt?.dependenciesField||T.options?.gantt?.dependenciesField||`dependencies`,...T.gantt?.titleField?{titleField:T.gantt.titleField}:{},...T.options?.gantt||{},...T.gantt||{}};case`map`:return{type:`object-map`,...t,locationField:T.options?.map?.locationField||`location`,...T.options?.map||{}};default:return t}},[O,T,F,$,W,G,Qe.handleClick,Q.mode]),et=I.conditions&&I.conditions.length>0,tt=n.useMemo(()=>{let e,t=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t.map(e=>({value:e?.value??e,label:e?.label??String(e?.value??e),...e&&typeof e==`object`?e:{}})):Object.entries(t).map(([e,t])=>({value:e,label:t?.label||e,...t}));return T.objectName?ee(T.objectName,e,n):n};if(e=B?.fields?Object.entries(B.fields).map(([e,n])=>({value:e,label:E(e,n.label||e),type:n.type||`text`,options:t(e,n.options),referenceTo:n.reference_to||n.reference,displayField:n.display_field||n.reference_field,idField:n.id_field})):(T.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let n=e.name||e.fieldName;return{value:n,label:E(n,e.label||e.name),type:e.type||`text`,options:t(n,e.options),referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),T.filterableFields&&T.filterableFields.length>0){let t=new Set(T.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[B,T.fields,T.filterableFields,T.objectName,E,ee]),nt=n.useCallback(e=>{Ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),rt=n.useCallback(e=>{let t=Z,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||T.objectName||`export`,a=n>0?R.slice(0,n):R;if(e===`csv`){let e=$.map(e=>typeof e==`string`?e:e.name||e.fieldName||e.field),t=[];r&&t.push(e.join(`,`)),a.forEach(n=>{t.push(e.map(e=>{let t=n[e],r;return r=t==null?``:Array.isArray(t)?t.map(e=>typeof e==`object`&&e?JSON.stringify(e):String(e??``)).join(`; `):typeof t==`object`?JSON.stringify(t):String(t),r.includes(`,`)||r.includes(`"`)||r.includes(`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@object-ui/core`),require(`react`),require(`@object-ui/components`),require(`lucide-react`),require(`react/jsx-runtime`),require(`@object-ui/i18n`),require(`@object-ui/react`),require(`@object-ui/mobile`)):typeof define==`function`&&define.amd?define([`exports`,`@object-ui/core`,`react`,`@object-ui/components`,`lucide-react`,`react/jsx-runtime`,`@object-ui/i18n`,`@object-ui/react`,`@object-ui/mobile`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.ObjectUIPluginList={},e.ObjectUICore,e.React,e.ObjectUIComponents,e.LucideReact,e.jsxRuntime,e.ObjectUIi18n,e.ObjectUIReact,e.ObjectUIMobile))})(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)(`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-2.5 py-1 text-xs rounded-md transition-colors duration-150`,n?`font-medium text-foreground bg-muted`:`text-muted-foreground hover:text-foreground hover:bg-transparent`),"data-testid":`view-tab-${e.name}`,role:`tab`,"aria-selected":n,onClick:()=>f(e),children:[t&&(0,a.jsx)(t,{className:`h-3 w-3 mr-1.5`}),e.label]},e.name)})})};function S(){try{let{t:e}=(0,o.useObjectTranslation)(),t=e(`common.more`);return!t||t===`common.more`?`More`:t}catch{return`More`}}var C=new Set([`lookup`,`master_detail`,`user`,`owner`]);function w({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 ee(e,t,n,r){return e.map(e=>{let i=e.options?[...e.options]:[],a=e.type,o,s,c;if(t?.fields){let n=Array.isArray(t.fields)?t.fields.find(t=>t.name===e.field):t.fields[e.field];n&&(a||=n.type,o=n.reference_to??n.reference,s=n.display_field??n.reference_field,c=n.id_field,i.length===0&&n.options&&(i=Array.isArray(n.options)?n.options.map(e=>({label:e.label??String(e.value??e),value:e.value??e,color:e.color})):Object.entries(n.options).map(([e,t])=>({label:t?.label||e,value:e,color:t?.color}))))}i.length===0&&a===`boolean`&&(i=[{label:`True`,value:!0},{label:`False`,value:!1}]),e.showCount&&n.length>0&&(i=i.map(t=>({...t,count:n.filter(n=>n[e.field]===t.value).length})));let l=e.label;return r?.objectName&&(i=r.translateOptions(r.objectName,e.field,i),l=r.fieldLabel(r.objectName,e.field,e.label||e.field)),{...e,label:l,type:a,options:i,referenceTo:o,displayField:s,idField:c}})}function T({fields:e,objectDef:t,data:s,onFilterChange:c,maxVisible:l,className:u}){let{fieldLabel:d,translateOptions:f}=(0,o.useSafeFieldLabel)(),p=S(),m=t?.name,[h,g]=n.useState(()=>{let t={};return e.forEach(e=>{e.defaultValues&&e.defaultValues.length>0&&(t[e.field]=e.defaultValues)}),t}),_=n.useMemo(()=>ee(e,t,s,{objectName:m,fieldLabel:d,translateOptions:f}),[e,t,s,m,d,f]),v=n.useCallback(e=>{c(Object.entries(e).filter(([,e])=>e.length>0).map(([e,t])=>[e,`in`,t]))},[c]),y=(e,t)=>{let n={...h,[e]:t};g(n),v(n)};n.useEffect(()=>{Object.values(h).some(e=>e.length>0)&&v(h)},[]);let b=l!==void 0&&l<_.length?_.slice(0,l):_,x=l!==void 0&&l<_.length?_.slice(l):[],w=e=>{let t=h[e.field]||[],n=t.length>0,o=C.has(e.type||``)&&e.options.length===0&&(e.referenceTo||e.type===`user`||e.type===`owner`),s=o?`w-72`:`w-56`;return(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`filter-badge-${e.field}`,className:(0,r.cn)(`inline-flex items-center gap-1 h-7 px-2 text-xs transition-colors shrink-0 rounded-md`,n?`text-foreground font-medium`:`text-muted-foreground hover:text-foreground`),children:[(0,a.jsx)(`span`,{className:`truncate max-w-[100px]`,children:e.label||e.field}),n&&(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:t.length}),n?(0,a.jsx)(i.X,{className:`h-3 w-3 opacity-60 hover:opacity-100`,"data-testid":`filter-clear-${e.field}`,onClick:t=>{t.stopPropagation(),y(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];y(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];y(e.field,r)},className:`rounded border-input`}),n.color&&(0,a.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full shrink-0`,style:{backgroundColor:n.color}}),(0,a.jsx)(`span`,{className:`truncate flex-1`,children:n.label}),n.count!==void 0&&(0,a.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.count})]},String(n.value)))})})]},e.field)};return(0,a.jsx)(`div`,{className:(0,r.cn)(`flex items-center gap-0.5 overflow-x-auto`,u),"data-testid":`user-filters-dropdown`,children:_.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:[b.map(w),x.length>0&&(0,a.jsxs)(r.Popover,{children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(`button`,{"data-testid":`user-filters-more`,className:`inline-flex items-center gap-1 h-7 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0 rounded-md`,children:[(0,a.jsx)(`span`,{children:p}),(0,a.jsx)(`span`,{className:`text-[10px] text-muted-foreground/80 tabular-nums`,children:x.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:x.map(w)})})]})]})})}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 A(e){return e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function te(e){return!Array.isArray(e)||e.length===0?[]:e.map(e=>Array.isArray(e)?k(e):e).filter(e=>Array.isArray(e)&&e.length>0)}function j(e){if(!e||!e.conditions||e.conditions.length===0)return[];let t=te(e.conditions.map(e=>e.operator===`isEmpty`?[e.field,`=`,null]:e.operator===`isNotEmpty`?[e.field,`!=`,null]:[e.field,O(e.operator),e.value]));return t.length===0?[]:t.length===1?t[0]:[e.logic,...t]}function M(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 N={"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`,"table.rowsPerPage":`Rows per page`};function ne(){try{let e=(0,o.useObjectTranslation)();return e.t(`list.recordCount`)===`list.recordCount`?{t:(e,t)=>{let n=N[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=N[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,o.useObjectLabel)();return{fieldLabel:e}}catch{return{fieldLabel:(e,t,n)=>n}}}var P=n.forwardRef(({schema:e,className:l,onViewChange:u,onFilterChange:d,onSortChange:f,onSearchChange:p,onHiddenFieldsChange:m,onColumnStateChange:h,onRowClick:g,showViewSwitcher:_=!1,...y},b)=>{let{t:S}=ne(),{fieldLabel:C}=re(),{translateOptions:ee}=(0,o.useSafeFieldLabel)(),T=n.useMemo(()=>({...e,viewType:e.viewType||`grid`}),[e]),E=n.useCallback((e,t)=>T.objectName?C(T.objectName,e,t):t,[T.objectName,C]),D=n.useMemo(()=>{let e=T.userActions,t=T.addRecord?.enabled===!0&&e?.addRecordForm!==!1;return{showSearch:e?.search===void 0?T.showSearch!==!1:e.search,showSort:e?.sort===void 0?T.showSort!==!1:e.sort,showFilters:e?.filter===void 0?T.showFilters!==!1:e.filter,showDensity:e?.rowHeight===void 0?T.showDensity!==!1:e.rowHeight,showHideFields:T.showHideFields===!0,showGroup:T.showGroup!==!1,showColor:T.showColor===!0,showAddRecord:t,addRecordPosition:T.addRecord?.position===`bottom`?`bottom`:`top`}},[T.userActions,T.showSearch,T.showSort,T.showFilters,T.showDensity,T.showHideFields,T.showGroup,T.showColor,T.addRecord,T.userActions?.addRecordForm]),[O,k]=n.useState(T.viewType),[M,N]=n.useState(``),[P,ie]=n.useState(!1),[ae,oe]=n.useState(!1),[F,se]=n.useState(()=>T.sort&&T.sort.length>0?T.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`}}):[]),ce=n.useMemo(()=>JSON.stringify(T.sort||[]),[T.sort]);n.useEffect(()=>{T.sort&&T.sort.length>0?se(T.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`}})):se([])},[ce]);let[le,ue]=n.useState(!1),[I,de]=n.useState({id:`root`,logic:`and`,conditions:[]}),[fe,pe]=n.useState(()=>{if(!(!T.tabs||T.tabs.length===0))return T.tabs.find(e=>e.isDefault)?.name??T.tabs[0]?.name}),me=n.useCallback(e=>{if(pe(e.name),e.filter){let t={id:`tab-filter-${e.name}`,logic:e.filter.logic||`and`,conditions:e.filter.conditions||[]};de(t),d?.(t)}else{let e={id:`root`,logic:`and`,conditions:[]};de(e),d?.(e)}},[d]),L=y.dataSource,[R,he]=n.useState([]),[ge,z]=n.useState(!1),[B,_e]=n.useState(null),[ve,V]=n.useState(!1),[ye,be]=n.useState(0),[xe,Se]=n.useState(!1);n.useImperativeHandle(b,()=>({refresh:()=>be(e=>e+1)}),[]),n.useEffect(()=>{if(!(!L?.onMutation||!T.objectName||T.refreshTrigger))return L.onMutation(e=>{e.resource===T.objectName&&be(e=>e+1)})},[L,T.objectName,T.refreshTrigger]);let[Ce,we]=n.useState(void 0),H=Ce??T.pagination?.pageSize??100,U=n.useMemo(()=>{if(T.grouping?.fields?.length)return T.grouping;let e=typeof T.groupBy==`string`?T.groupBy.trim():``,t=typeof T.groupBy2==`string`?T.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},[T.grouping,T.groupBy,T.groupBy2]),[W,Te]=n.useState(U),[Ee,De]=n.useState(!1),Oe=n.useRef(U);n.useEffect(()=>{Oe.current!==U&&(Oe.current=U,Te(U))},[U]);let[G,ke]=n.useState(T.rowColor),[Ae,je]=n.useState(!1),[K,Me]=n.useState([]),q=n.useRef(0),[J,Ne]=n.useState(()=>{let e=new Set;return T.quickFilters?.forEach(n=>{let r=(0,t.normalizeQuickFilter)(n);r.defaultActive&&e.add(r.id)}),e}),[Pe,Fe]=n.useState([]),Ie=n.useMemo(()=>{if(T.userFilters)return T.userFilters;if(!B?.fields)return;let e=new Set([`select`,`multi-select`,`boolean`]),t=[],n=Array.isArray(B.fields)?B.fields.map(e=>[e.name,e]):Object.entries(B.fields);for(let[r,i]of n)(e.has(i.type)||i.options&&!i.type)&&t.push({field:r,label:E(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}},[T.userFilters,B]),[Y,Le]=n.useState(()=>new Set(T.hiddenFields||[])),Re=n.useMemo(()=>JSON.stringify(T.hiddenFields||[]),[T.hiddenFields]);n.useEffect(()=>{Le(new Set(T.hiddenFields||[]))},[Re]);let ze=n.useCallback(e=>{Le(e),m?.(Array.from(e))},[m]),[Be,Ve]=n.useState(!1),[He,Ue]=n.useState(!1),X=n.useMemo(()=>(0,t.normalizeQuickFilters)(T.quickFilters),[T.quickFilters]),Z=n.useMemo(()=>{if(T.exportOptions)return Array.isArray(T.exportOptions)?{formats:T.exportOptions}:T.exportOptions},[T.exportOptions]),Q=(0,s.useDensityMode)(n.useMemo(()=>T.densityMode?T.densityMode:T.rowHeight?{compact:`compact`,short:`compact`,medium:`comfortable`,tall:`spacious`,extra_tall:`spacious`}[T.rowHeight]||`comfortable`:`compact`,[T.densityMode,T.rowHeight]),{onChange:T.onDensityChange}),{ref:We,isRefreshing:Ge,pullDistance:Ke}=(0,c.usePullToRefresh)({onRefresh:n.useCallback(async()=>{be(e=>e+1)},[]),enabled:!!L&&!!T.objectName}),qe=n.useMemo(()=>T.id?`listview-${T.objectName}-${T.id}-view`:`listview-${T.objectName}-view`,[T.objectName,T.id]);n.useEffect(()=>{let e=!0;return V(!1),_e(null),(async()=>{if(!L||!T.objectName){V(!0);return}if(typeof L.getObjectSchema!=`function`){V(!0);return}try{let t=await L.getObjectSchema(T.objectName);e&&_e(t)}catch(e){console.warn(`Failed to fetch object schema for ListView:`,e)}finally{e&&V(!0)}})(),()=>{e=!1}},[T.objectName,L]);let Je=n.useMemo(()=>{let e=Array.isArray(T.fields)?T.fields.map(e=>typeof e==`string`?e:e?.field).filter(e=>typeof e==`string`&&e.length>0):[],n=new Set(e),r=e=>{if(!e)return;let t=[e.groupField,e.groupBy,e.titleField,e.cardTitle,e.startDateField,e.endDateField,e.dateField,e.endField,e.colorField,e.allDayField,e.coverField,e.imageField,e.subtitleField,e.swimlaneField,e.valueField,...Array.isArray(e.cardFields)?e.cardFields:[],...Array.isArray(e.visibleFields)?e.visibleFields:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of t)typeof e==`string`&&e&&n.add(e)};r(T.kanban),r(T.options?.kanban),r(T.calendar),r(T.options?.calendar),r(T.gallery),r(T.options?.gallery),r(T.timeline),r(T.options?.timeline),r(T.gantt),r(T.options?.gantt);let i=n.size>0?Array.from(n):void 0;return(0,t.buildExpandFields)(B?.fields,i)},[B?.fields,T.fields,T.kanban,T.calendar,T.gallery,T.timeline,T.gantt,T.options]);n.useEffect(()=>{let e=!0,t=++q.current;if(T.data&&typeof T.data==`object`&&!Array.isArray(T.data)){let e=T.data;if(e.provider===`value`&&Array.isArray(e.items)){let t=e.items;if(M){let e=M.toLowerCase();t=t.filter(t=>Object.values(t).some(t=>t!=null&&String(t).toLowerCase().includes(e)))}he(t),z(!1),Se(!1);return}}if(Array.isArray(T.data)){let e=T.data;if(M){let t=M.toLowerCase();e=e.filter(e=>Object.values(e).some(e=>e!=null&&String(e).toLowerCase().includes(t)))}he(e),z(!1),Se(!1);return}return ve?((async()=>{if(!(!L||!T.objectName)){z(!0);try{let n=[],r=T.filters||[],i=j(I),a=[];X&&J.size>0&&X.forEach(e=>{J.has(e.id)&&e.filters&&e.filters.length>0&&a.push(e.filters)});let o=te(Pe),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=F.length>0?F.filter(e=>e.field).map(e=>({field:e.field,order:e.order})):void 0,l=(()=>{let e=Array.isArray(T.fields)?T.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 Je)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:[],...Array.isArray(e.metaFields)?e.metaFields:[]];for(let e of n)typeof e==`string`&&e&&t.add(e)};n(T.kanban),n(T.options?.kanban),n(T.calendar),n(T.options?.calendar),n(T.gallery),n(T.options?.gallery),n(T.timeline),n(T.options?.timeline);{let e=T.timeline??T.options?.timeline;e&&!Array.isArray(e.metaFields)&&(t.add(`status`),t.add(`priority`))}return n(T.gantt),n(T.options?.gantt),Array.from(t)})(),u=Array.isArray(n)?n.length>0:!!n&&Object.keys(n).length>0,d=await L.find(T.objectName,{...u?{$filter:n}:{},$orderby:c,$top:H,...l?{$select:l}:{},...Je.length>0?{$expand:Je}:{},...M?{$search:M,...T.searchableFields&&T.searchableFields.length>0?{$searchFields:T.searchableFields}:{}}:{}});if(!e||t!==q.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)),he(f),Se(f.length>=H)}catch(e){t===q.current&&console.error(`ListView data fetch error:`,e)}finally{e&&t===q.current&&z(!1)}}})(),()=>{e=!1}):void 0},[T.objectName,T.data,L,T.filters,H,F,I,J,X,Pe,ye,M,T.searchableFields,Je,ve,T.refreshTrigger]);let Ye=n.useMemo(()=>{if(T.appearance?.allowedVisualizations&&T.appearance.allowedVisualizations.length>0)return T.appearance.allowedVisualizations.filter(e=>[`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`].includes(e));let e=[`grid`];return(T.kanban?.groupField||T.options?.kanban?.groupField)&&e.push(`kanban`),(T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField)&&e.push(`gallery`),(T.calendar?.startDateField||T.options?.calendar?.startDateField)&&e.push(`calendar`),(T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||T.options?.calendar?.startDateField)&&e.push(`timeline`),(T.gantt?.startDateField||T.options?.gantt?.startDateField)&&e.push(`gantt`),(T.options?.map?.locationField||T.options?.map?.latitudeField&&T.options?.map?.longitudeField)&&e.push(`map`),T.viewType&&!e.includes(T.viewType)&&[`grid`,`kanban`,`calendar`,`timeline`,`gantt`,`map`,`gallery`].includes(T.viewType)&&e.push(T.viewType),e},[T.options,T.viewType,T.kanban,T.calendar,T.gantt,T.gallery,T.timeline,T.appearance?.allowedVisualizations]);n.useEffect(()=>{T.viewType&&k(T.viewType)},[T.viewType]);let Xe=n.useCallback(e=>{k(e);try{localStorage.setItem(qe,e)}catch(e){console.warn(`Failed to save view preference to localStorage:`,e)}u?.(e)},[qe,u]),Ze=n.useCallback(e=>{N(e),p?.(e)},[p]),Qe=(0,s.useNavigationOverlay)({navigation:T.navigation,objectName:T.objectName,onNavigate:T.onNavigate,onRowClick:g}),$=n.useMemo(()=>{let e=T.fields||[];if(Array.isArray(e)||(e=[]),Y.size>0&&(e=e.filter(e=>{let t=typeof e==`string`?e:e?.name||e?.fieldName||e?.field;return t!=null&&!Y.has(t)})),T.fieldOrder&&T.fieldOrder.length>0){let t=new Map(T.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},[T.fields,Y,T.fieldOrder]),$e=n.useMemo(()=>{let e=Q.mode===`compact`?`compact`:Q.mode===`spacious`?`tall`:`medium`,t={objectName:T.objectName,fields:$,filters:T.filters,sort:F,className:`h-full w-full`,showSearch:!1,onRowClick:Qe.handleClick,rowHeight:e,hideRowHeightToggle:!0,...T.striped==null?{}:{striped:T.striped},...T.bordered==null?{}:{bordered:T.bordered},...h?{onColumnStateChange:h}:{},...T.columnState?{columnState:T.columnState}:{}};switch(O){case`grid`:return{type:`object-grid`,...t,columns:$,...T.conditionalFormatting?{conditionalFormatting:T.conditionalFormatting}:{},...T.inlineEdit==null?{}:{editable:T.inlineEdit},...T.wrapHeaders==null?{}:{wrapHeaders:T.wrapHeaders},...T.virtualScroll==null?{}:{virtualScroll:T.virtualScroll},...T.resizable==null?{}:{resizable:T.resizable},...T.selection?{selection:T.selection}:{},...T.pagination?{pagination:T.pagination}:{},...W?{grouping:W}:{},...G?{rowColor:G}:{},...T.rowActions?{rowActions:T.rowActions}:{},...T.rowActionDefs?{rowActionDefs:T.rowActionDefs}:{},...T.bulkActions?{batchActions:T.bulkActions}:{},...T.options?.grid||{}};case`kanban`:return{type:`object-kanban`,...t,groupBy:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,groupField:T.kanban?.groupField||T.options?.kanban?.groupField||`status`,...T.kanban?.titleField||T.options?.kanban?.titleField?{titleField:T.kanban?.titleField||T.options?.kanban?.titleField}:{},cardFields:T.kanban?.cardFields||$||[],...W?{grouping:W}:{},...T.options?.kanban||{},...T.kanban||{}};case`calendar`:return{type:`object-calendar`,...t,startDateField:T.calendar?.startDateField||T.options?.calendar?.startDateField||`start_date`,endDateField:T.calendar?.endDateField||T.options?.calendar?.endDateField||`end_date`,...T.calendar?.titleField||T.options?.calendar?.titleField?{titleField:T.calendar?.titleField||T.options?.calendar?.titleField}:{},...T.calendar?.defaultView?{defaultView:T.calendar.defaultView}:{},...T.options?.calendar||{},...T.calendar||{}};case`gallery`:{let e={...T.options?.gallery||{},...T.gallery||{}};return{type:`object-gallery`,...t,gallery:Object.keys(e).length>0?e:void 0,imageField:T.gallery?.coverField||T.gallery?.imageField||T.options?.gallery?.imageField,titleField:T.gallery?.titleField||T.options?.gallery?.titleField||`name`,subtitleField:T.gallery?.subtitleField||T.options?.gallery?.subtitleField,...W?{grouping:W}:{}}}case`timeline`:{let e={...T.options?.timeline||{},...T.timeline||{}};return{type:`object-timeline`,...t,timeline:Object.keys(e).length>0?e:void 0,startDateField:T.timeline?.startDateField||T.options?.timeline?.startDateField||T.options?.timeline?.dateField||`created_at`,titleField:T.timeline?.titleField||T.options?.timeline?.titleField||`name`,...T.timeline?.endDateField?{endDateField:T.timeline.endDateField}:{},...T.timeline?.groupByField?{groupByField:T.timeline.groupByField}:{},...T.timeline?.colorField?{colorField:T.timeline.colorField}:{},...T.timeline?.scale?{scale:T.timeline.scale}:{}}}case`gantt`:return{type:`object-gantt`,...t,startDateField:T.gantt?.startDateField||T.options?.gantt?.startDateField||`start_date`,endDateField:T.gantt?.endDateField||T.options?.gantt?.endDateField||`end_date`,progressField:T.gantt?.progressField||T.options?.gantt?.progressField||`progress`,dependenciesField:T.gantt?.dependenciesField||T.options?.gantt?.dependenciesField||`dependencies`,...T.gantt?.titleField?{titleField:T.gantt.titleField}:{},...T.options?.gantt||{},...T.gantt||{}};case`map`:return{type:`object-map`,...t,locationField:T.options?.map?.locationField||`location`,...T.options?.map||{}};default:return t}},[O,T,F,$,W,G,Qe.handleClick,Q.mode]),et=I.conditions&&I.conditions.length>0,tt=n.useMemo(()=>{let e,t=(e,t)=>{if(!t)return;let n=Array.isArray(t)?t.map(e=>({value:e?.value??e,label:e?.label??String(e?.value??e),...e&&typeof e==`object`?e:{}})):Object.entries(t).map(([e,t])=>({value:e,label:t?.label||e,...t}));return T.objectName?ee(T.objectName,e,n):n};if(e=B?.fields?Object.entries(B.fields).map(([e,n])=>({value:e,label:E(e,n.label||e),type:n.type||`text`,options:t(e,n.options),referenceTo:n.reference_to||n.reference,displayField:n.display_field||n.reference_field,idField:n.id_field})):(T.fields||[]).map(e=>{if(typeof e==`string`)return{value:e,label:e,type:`text`};let n=e.name||e.fieldName;return{value:n,label:E(n,e.label||e.name),type:e.type||`text`,options:t(n,e.options),referenceTo:e.reference_to||e.reference,displayField:e.display_field||e.reference_field,idField:e.id_field}}),T.filterableFields&&T.filterableFields.length>0){let t=new Set(T.filterableFields);e=e.filter(e=>t.has(e.value))}return e},[B,T.fields,T.filterableFields,T.objectName,E,ee]),nt=n.useCallback(e=>{Ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),rt=n.useCallback(e=>{let t=Z,n=t?.maxRecords||0,r=t?.includeHeaders!==!1,i=t?.fileNamePrefix||T.objectName||`export`,a=n>0?R.slice(0,n):R;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
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)}Ue(!1)},[R,$,Z,T.objectName]),it=n.useMemo(()=>(T.fields||[]).map(e=>{if(typeof e==`string`)return{name:e,label:E(e,e)};let t=e.name||e.fieldName||e.field;return{name:t,label:E(t,e.label||e.name||e.field)}}),[T.fields,E]);return(0,a.jsxs)(`div`,{ref:We,className:(0,r.cn)(`flex flex-col h-full bg-background relative min-w-0 overflow-hidden`,l),...T.aria?.label?{"aria-label":T.aria.label}:{},...T.aria?.describedBy?{"aria-describedby":T.aria.describedBy}:{},...T.aria?.live?{"aria-live":T.aria.live}:{},role:`region`,children:[Ke>0&&(0,a.jsx)(`div`,{className:`flex items-center justify-center text-xs text-muted-foreground`,style:{height:Ke},children:S(Ge?`list.refreshing`:`list.pullToRefresh`)}),_&&(0,a.jsx)(`div`,{className:`px-4 py-1 flex items-center bg-background`,children:(0,a.jsx)(v,{currentView:O,availableViews:Ye,onViewChange:Xe})}),T.description&&T.appearance?.showDescription!==!1&&(0,a.jsx)(`div`,{className:`px-4 pt-1.5 text-xs text-muted-foreground bg-background`,"data-testid":`view-description`,children:typeof T.description==`string`?T.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.jsxs)(`div`,{className:`flex items-center gap-2 overflow-x-auto min-w-0`,children:[T.tabs&&T.tabs.length>0&&(0,a.jsx)(x,{tabs:T.tabs,activeTab:fe,onTabChange:me,className:`!px-0 !py-0 shrink-0`}),T.tabs&&T.tabs.length>0&&Ie&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-1 shrink-0`}),Ie&&(0,a.jsx)(`div`,{className:`shrink-0 min-w-0`,"data-testid":`user-filters`,children:(0,a.jsx)(w,{config:Ie,objectDef:B,data:R,onFilterChange:Fe,maxVisible:3})})]}),(0,a.jsxs)(`div`,{className:`flex items-center gap-0 shrink-0`,children:[D.showHideFields&&(0,a.jsxs)(r.Popover,{open:Be,onOpenChange:Ve,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`,Y.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:S(`list.hideFields`)}),Y.size>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:Y.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:S(`list.hideFieldsTitle`)}),Y.size>0&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>ze(new Set),children:S(`list.showAll`)})]}),(0,a.jsx)(`div`,{className:`max-h-60 overflow-y-auto space-y-1`,children:it.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:!Y.has(e.name),onChange:()=>{let t=new Set(Y);t.has(e.name)?t.delete(e.name):t.add(e.name),ze(t)},className:`rounded border-input`}),(0,a.jsx)(`span`,{className:`truncate`,children:e.label})]},e.name))})]})})]}),D.showHideFields&&(D.showFilters||D.showSort||D.showGroup)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),D.showFilters&&(0,a.jsxs)(r.Popover,{open:le,onOpenChange:ue,children:[(0,a.jsx)(r.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:(0,r.cn)(`h-7 px-2 text-muted-foreground hover:text-primary text-xs transition-colors duration-150`,et&&`text-foreground font-medium`),children:[(0,a.jsx)(i.SlidersHorizontal,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.filter`)}),et&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:I.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:S(`list.filterRecords`)})}),(0,a.jsx)(r.FilterBuilder,{fields:tt,value:I,onChange:e=>{de(e),d&&d(e)}})]})})]}),D.showGroup&&(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&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Group,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.group`)}),W&&W.fields?.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:W.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:S(`list.groupBy`)}),W&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>Te(void 0),"data-testid":`clear-grouping`,children:S(`list.clear`)})]}),(0,a.jsx)(`div`,{"data-testid":`group-field-list`,children:(0,a.jsx)(r.GroupingEditor,{value:W,fieldOptions:it.map(e=>({value:e.name,label:e.label||e.name})),maxLevels:3,labels:{addGroup:S(`list.addGroup`,`Add group field`),collapseTitle:S(`list.collapsedByDefault`,`Collapsed by default`),removeTitle:S(`list.removeGroup`,`Remove`)},onChange:e=>Te(e)})})]})})]}),D.showSort&&(0,a.jsxs)(r.Popover,{open:ae,onOpenChange:oe,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`,F.length>0&&`text-foreground font-medium`),children:[(0,a.jsx)(i.ArrowUpDown,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`list.sort`)}),F.length>0&&(0,a.jsx)(`span`,{className:`ml-1 flex h-4 min-w-[16px] items-center justify-center text-[10px] font-medium text-muted-foreground tabular-nums`,children:F.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:S(`list.sortRecords`)})}),(0,a.jsx)(r.SortBuilder,{fields:tt,value:F,onChange:e=>{se(e),f&&f(e)}})]})})]}),(D.showFilters||D.showSort||D.showGroup)&&(D.showColor||D.showDensity)&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),D.showColor&&(0,a.jsxs)(r.Popover,{open:Ae,onOpenChange:je,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`,G&&`text-foreground font-medium`),children:[(0,a.jsx)(i.Paintbrush,{className:`h-3.5 w-3.5 mr-1.5`}),(0,a.jsx)(`span`,{className:`hidden sm:inline`,children:S(`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:S(`list.rowColor`)}),G&&(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:()=>ke(void 0),"data-testid":`clear-row-color`,children:S(`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:S(`list.colorByField`)}),(0,a.jsxs)(`select`,{className:`w-full h-8 rounded border border-input bg-background px-2 text-xs`,value:G?.field||``,onChange:e=>{let t=e.target.value;ke(t?{field:t,colors:G?.colors||{}}:void 0)},"data-testid":`color-field-select`,children:[(0,a.jsx)(`option`,{value:``,children:S(`list.none`)}),it.map(e=>(0,a.jsx)(`option`,{value:e.name,children:e.label},e.name))]})]})]})})]}),D.showDensity&&(()=>{let e=Q.mode===`compact`?i.Rows4:Q.mode===`comfortable`?i.Rows3:i.Rows2;return(0,a.jsx)(r.Button,{variant:`ghost`,size:`sm`,"aria-label":`Density: ${Q.mode}`,className:(0,r.cn)(`h-7 w-7 p-0 text-muted-foreground hover:text-primary transition-colors duration-150`,Q.mode!==`compact`&&`text-foreground font-medium`),onClick:Q.cycle,title:`Density: ${Q.mode} (click to cycle)`,children:(0,a.jsx)(e,{className:`h-3.5 w-3.5`})})})(),(D.showColor||D.showDensity)&&Z&&T.allowExport!==!1&&(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}),Z&&T.allowExport!==!1&&(0,a.jsxs)(r.Popover,{open:He,onOpenChange:Ue,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:S(`list.export`)})]})}),(0,a.jsx)(r.PopoverContent,{align:`start`,className:`w-48 p-2`,children:(0,a.jsx)(`div`,{className:`space-y-1`,children:(Z.formats||[`csv`,`json`]).map(e=>(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`w-full justify-start h-8 text-xs`,onClick:()=>rt(e),children:[(0,a.jsx)(i.Download,{className:`h-3.5 w-3.5 mr-2`}),S(`list.exportAs`,{format:e.toUpperCase()})]},e))})})]}),(T.sharing?.enabled||T.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: ${T.sharing?.visibility||T.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:S(`list.share`)})]}),T.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:S(`list.print`)})]}),(()=>{let e=T.allowPrinting||T.sharing?.enabled||T.sharing?.type||Z&&T.allowExport!==!1;return D.showSearch&&e?(0,a.jsx)(`div`,{className:`h-4 w-px bg-border/60 mx-0.5 shrink-0`}):null})(),D.showSearch&&(0,a.jsxs)(r.Popover,{open:P,onOpenChange:ie,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`,M&&`text-foreground font-medium`),"data-testid":`search-icon-button`,title:S(`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:S(`list.search`)+`...`,value:M,onChange:e=>Ze(e.target.value),className:`pl-7 h-8 text-xs`,autoFocus:!0}),M&&(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:()=>Ze(``),children:(0,a.jsx)(i.X,{className:`h-3 w-3`})})]})})]}),D.showAddRecord&&D.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:()=>y.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:S(`list.addRecord`)})]})]})]}),X&&X.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:X.map(e=>{let t=J.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:()=>nt(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:!ge&&R.length===0&&(O===`grid`||O===`list`)?(()=>{let e=T.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 T.emptyState?.title==`string`?T.emptyState.title:void 0)??S(`list.noItems`)}),(0,a.jsx)(`p`,{className:`text-sm text-muted-foreground max-w-md`,children:(typeof T.emptyState?.message==`string`?T.emptyState.message:void 0)??S(`list.noItemsMessage`)}),D.showAddRecord&&(0,a.jsxs)(r.Button,{variant:`default`,size:`sm`,className:`mt-4`,"data-testid":`empty-state-add-record`,onClick:()=>y.onAddRecord?.(),children:[(0,a.jsx)(i.Plus,{className:`h-4 w-4 mr-1.5`}),S(`list.addRecord`)]})]})})():(0,a.jsx)(s.SchemaRenderer,{schema:$e,...y,data:R,loading:ge,onRowSelect:Me})},O),D.showAddRecord&&D.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:()=>y.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:S(`list.addRecord`)})]})}),T.bulkActions&&T.bulkActions.length>0&&K.length>0&&O!==`grid`&&(0,a.jsxs)(`div`,{className:`border-t border-primary/30 px-4 py-2 flex items-center gap-2 text-xs bg-primary/10 text-foreground shrink-0 shadow-sm`,role:`region`,"aria-label":`Bulk actions`,"data-testid":`bulk-actions-bar`,children:[(0,a.jsx)(i.CheckSquare,{className:`h-3.5 w-3.5 text-primary shrink-0`}),(0,a.jsxs)(`span`,{className:`font-medium`,children:[K.length,` `,K.length===1?`item`:`items`,` selected`]}),(0,a.jsx)(`div`,{className:`flex items-center gap-1.5 ml-3`,children:T.bulkActions.map(e=>{let t=String(e).toLowerCase(),n=t.includes(`delete`)||t.includes(`remove`)||t.includes(`destroy`),o=n?i.Trash2:null;return(0,a.jsxs)(r.Button,{variant:n?`destructive`:`outline`,size:`sm`,className:`h-7 px-2.5 text-xs gap-1.5`,onClick:()=>y.onBulkAction?.(e,K),"data-testid":`bulk-action-${e}`,children:[o&&(0,a.jsx)(o,{className:`h-3 w-3`}),A(e)]},e)})}),(0,a.jsxs)(r.Button,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs ml-auto gap-1`,onClick:()=>Me([]),children:[(0,a.jsx)(i.X,{className:`h-3 w-3`}),`Clear`]})]}),!ge&&R.length>0&&T.showRecordCount!==!1&&(0,a.jsxs)(`div`,{className:`border-t px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground bg-background shrink-0`,"data-testid":`record-count-bar`,children:[(0,a.jsx)(`span`,{className:`font-medium text-foreground/80`,children:R.length===1?S(`list.recordCountOne`,{count:R.length}):S(`list.recordCount`,{count:R.length})}),xe&&(0,a.jsx)(`span`,{className:`text-amber-600`,"data-testid":`data-limit-warning`,children:S(`list.dataLimitReached`,{limit:H})}),T.pagination?.pageSizeOptions&&T.pagination.pageSizeOptions.length>0&&(0,a.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,a.jsx)(`span`,{children:S(`table.rowsPerPage`,{defaultValue:`Rows per page`})}),(0,a.jsx)(`select`,{"data-testid":`page-size-selector`,className:`h-7 w-[72px] px-2 py-1 text-xs rounded-md border border-input bg-background`,value:String(H),onChange:e=>{let t=Number(e.target.value);we(t),y.onPageSizeChange&&y.onPageSizeChange(t)},children:T.pagination.pageSizeOptions.map(e=>(0,a.jsx)(`option`,{value:String(e),children:e},e))})]})]}),Qe.isOverlay&&(0,a.jsx)(r.NavigationOverlay,{...Qe,title:T.label?`${T.label} Detail`:T.objectName?`${T.objectName.charAt(0).toUpperCase()+T.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))})})]})});P.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`},ae={small:`aspect-square`,medium:`aspect-[4/3]`,large:`aspect-[16/10]`},oe=e=>{let{schema:o}=e,c=(0,n.useContext)(s.SchemaRendererContext),l=e.dataSource||c?.dataSource,u=(0,s.useDataScope)(o.bind),[d,f]=(0,n.useState)([]),[p,m]=(0,n.useState)(!1),[h,g]=(0,n.useState)(null),_=(0,s.useNavigationOverlay)({navigation:o.navigation,objectName:o.objectName,onRowClick:e.onRowClick??e.onCardClick}),v=o.gallery,y=v?.coverField??o.imageField??`image`,b=v?.coverFit??`cover`,x=v?.cardSize??`medium`,S=v?.titleField??o.titleField??`name`,C=v?.visibleFields,{fieldOptionLabel:w}=(0,s.useSafeFieldLabel)(),ee=(0,n.useCallback)((e,t)=>{if(t==null||t===``)return``;if(typeof t==`object`)return t.label??t.name??t.id??JSON.stringify(t);let n=h?.fields?.[e],r=n?.type;if((r===`select`||r===`status`||r===`multiselect`)&&o.objectName){let r=String(t);if(Array.isArray(n.options)){let e=n.options.find(e=>String(e?.value??e)===String(t));e&&(r=e.label??r)}else if(n.options&&typeof n.options==`object`){let e=n.options[String(t)];e&&(r=e.label??r)}return w(o.objectName,e,String(t),r)}let i=typeof t==`number`?t:Number(t);if(Number.isFinite(i)){if(r===`currency`){let e=n?.currency||n?.options?.currency||`USD`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:e,maximumFractionDigits:0}).format(i)}catch{return new Intl.NumberFormat().format(i)}}if(r===`percent`)return new Intl.NumberFormat(void 0,{style:`percent`,maximumFractionDigits:2}).format(i>1?i/100:i);if(r===`number`)return new Intl.NumberFormat().format(i)}return String(t)},[h,o.objectName,w]);(0,n.useEffect)(()=>{let e=!0;return(async()=>{if(!(!l||typeof l.getObjectSchema!=`function`||!o.objectName))try{let t=await l.getObjectSchema(o.objectName);e&&g(t)}catch(e){console.warn(`Failed to fetch object def for ObjectGallery`,e)}})(),()=>{e=!1}},[o.objectName,l]),(0,n.useEffect)(()=>{let n=!0;if(e.data&&Array.isArray(e.data)){f(e.data);return}return o.objectName&&!u&&!o.data&&!e.data&&(async()=>{if(!(!l||typeof l.find!=`function`||!o.objectName)){n&&m(!0);try{let e=(0,t.buildExpandFields)(h?.fields),r=await l.find(o.objectName,{$filter:o.filter,...e.length>0?{$expand:e}:{}}),i=[];if(Array.isArray(r))i=r;else if(r&&typeof r==`object`){let e=r;Array.isArray(e.records)?i=e.records:Array.isArray(e.data)&&(i=e.data)}n&&f(i)}catch(e){console.error(`[ObjectGallery] Fetch error:`,e)}finally{n&&m(!1)}}})(),()=>{n=!1}},[o.objectName,l,u,o.data,o.filter,e.data,h]);let T=e.data||u||o.data||d||[],E=(0,n.useMemo)(()=>T.some(e=>typeof e[y]==`string`&&!!e[y]),[T,y]),D=!!v?.coverField||E,O=o.grouping?.fields,k=!!(O&&O.length>0),[A,te]=(0,n.useState)({}),j=(0,n.useMemo)(()=>O?O.some(e=>e.collapsed):!1,[O]),M=(0,n.useCallback)(e=>{te(t=>({...t,[e]:t[e]===void 0?!j:!t[e]}))},[j]),N=(0,n.useMemo)(()=>{if(!k||!O)return[];let e=new Map,t=[];for(let n of T){let r=O.map(e=>String(n[e.field]??``)).join(` / `);if(!e.has(r)){let i=O.map(e=>{let t=n[e.field];return t!=null&&t!==``?String(t):`(empty)`}).join(` / `);e.set(r,{label:i,items:[]}),t.push(r)}e.get(r).items.push(n)}let n=O[0]?.order??`asc`;return t.sort((e,t)=>{let r=e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`});return n===`desc`?-r:r}),t.map(t=>{let n=e.get(t),r=t in A?A[t]:j;return{key:t,label:n.label,items:n.items,collapsed:r}})},[T,O,k,A,j]);if(p&&!T.length)return(0,a.jsx)(`div`,{className:`p-4 text-sm text-muted-foreground`,children:`Loading Gallery...`});if(!T.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,s=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||o.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:!D,children:c?(0,a.jsx)(`img`,{src:c,alt:s,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:s[0]?.toUpperCase()})})}),(0,a.jsxs)(r.CardContent,{className:(0,r.cn)(`p-3`,D&&`border-t`),children:[(0,a.jsx)(`h3`,{className:`font-medium truncate text-sm`,title:s,children:s}),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:ee(e,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],o.className),role:`list`,children:e.map((e,t)=>ne(e,t))});return(0,a.jsxs)(a.Fragment,{children:[k?(0,a.jsx)(`div`,{className:`space-y-2`,children:N.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:()=>M(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(T),_.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`,P,{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`,P,{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=P,e.ObjectGallery=oe,e.TabBar=x,e.UserFilters=w,e.ViewSwitcher=v,e.evaluateConditionalFormatting=M,e.normalizeFilterCondition=k,e.normalizeFilters=te});
|
|
@@ -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,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClD,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7F,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;AAwFD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,
|
|
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,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAClD,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7F,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;AAwFD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,mGA+rDnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@object-ui/plugin-list",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "ListView plugin for Object UI - unified view component with view type switching",
|
|
@@ -29,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
|
|
33
|
-
"@object-ui/core": "^4.0
|
|
34
|
-
"@object-ui/i18n": "^4.0
|
|
35
|
-
"@object-ui/mobile": "^4.0
|
|
36
|
-
"@object-ui/react": "^4.0
|
|
37
|
-
"@object-ui/types": "^4.0
|
|
32
|
+
"@object-ui/components": "^4.3.0",
|
|
33
|
+
"@object-ui/core": "^4.3.0",
|
|
34
|
+
"@object-ui/i18n": "^4.3.0",
|
|
35
|
+
"@object-ui/mobile": "^4.3.0",
|
|
36
|
+
"@object-ui/react": "^4.3.0",
|
|
37
|
+
"@object-ui/types": "^4.3.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "19.2.14",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"vite": "^8.0.13",
|
|
45
45
|
"vite-plugin-dts": "^5.0.0",
|
|
46
46
|
"vitest": "^4.1.6",
|
|
47
|
-
"@object-ui/components": "4.0
|
|
48
|
-
"@object-ui/core": "4.0
|
|
49
|
-
"@object-ui/i18n": "4.0
|
|
50
|
-
"@object-ui/mobile": "4.0
|
|
51
|
-
"@object-ui/react": "4.0
|
|
52
|
-
"@object-ui/types": "4.0
|
|
47
|
+
"@object-ui/components": "4.3.0",
|
|
48
|
+
"@object-ui/core": "4.3.0",
|
|
49
|
+
"@object-ui/i18n": "4.3.0",
|
|
50
|
+
"@object-ui/mobile": "4.3.0",
|
|
51
|
+
"@object-ui/react": "4.3.0",
|
|
52
|
+
"@object-ui/types": "4.3.0"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"objectui",
|