Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
1 line
1.3 KiB
Plaintext
1 line
1.3 KiB
Plaintext
{"version":3,"file":"isRowCollapsed.js","names":["isRowCollapsed","collapsedPrefs","field","previousRow","row","collapsed","undefined","includes","id","admin","initCollapsed"],"sources":["../../../src/forms/fieldSchemasToFormState/isRowCollapsed.ts"],"sourcesContent":["import type { ArrayField, BlocksField, CollapsedPreferences, Row } from 'payload'\n\nexport function isRowCollapsed({\n collapsedPrefs,\n field,\n previousRow,\n row,\n}: {\n collapsedPrefs: CollapsedPreferences\n field: ArrayField | BlocksField\n previousRow: Row | undefined\n row: Row\n}): boolean {\n if (previousRow && 'collapsed' in previousRow) {\n return previousRow.collapsed ?? false\n }\n\n // If previousFormState is `undefined`, check preferences\n if (collapsedPrefs !== undefined) {\n return collapsedPrefs.includes(row.id) // Check if collapsed in preferences\n }\n\n // If neither exists, fallback to `field.admin.initCollapsed`\n return field.admin.initCollapsed\n}\n"],"mappings":"AAEA,OAAO,SAASA,eAAe;EAC7BC,cAAc;EACdC,KAAK;EACLC,WAAW;EACXC;AAAG,CAMJ;EACC,IAAID,WAAA,IAAe,eAAeA,WAAA,EAAa;IAC7C,OAAOA,WAAA,CAAYE,SAAS,IAAI;EAClC;EAEA;EACA,IAAIJ,cAAA,KAAmBK,SAAA,EAAW;IAChC,OAAOL,cAAA,CAAeM,QAAQ,CAACH,GAAA,CAAII,EAAE,EAAE;AAAA;EACzC;EAEA;EACA,OAAON,KAAA,CAAMO,KAAK,CAACC,aAAa;AAClC","ignoreList":[]} |