@shefing/quickfilter 1.0.34 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import type { CollectionSlug, Config } from 'payload';
2
- export * from './nav/index';
3
2
  export type CollectionFilterPluginConfig = {
4
3
  /**
5
4
  * List of collections to add filters to
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtD,cAAc,aAAa,CAAC;AAE5B,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC;IACvC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,2BAA2B,mBACtB,4BAA4B,cACnC,MAAM,KAAG,MA8DjB,CAAC;AAEJ,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtD,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC;IACvC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,2BAA2B,mBACtB,4BAA4B,cACnC,MAAM,KAAG,MA8DjB,CAAC;AAEJ,eAAe,2BAA2B,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- export * from './nav/index';
2
1
  export const CollectionQuickFilterPlugin = (pluginOptions = {})=>(config)=>{
3
2
  if (!config.collections) {
4
3
  config.collections = [];
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionSlug, Config } from 'payload';\n\nexport * from './nav/index';\n\nexport type CollectionFilterPluginConfig = {\n /**\n * List of collections to add filters to\n */\n disabled?: boolean;\n excludedCollections?: CollectionSlug[];\n includedCollections?: CollectionSlug[];\n};\n\nexport const CollectionQuickFilterPlugin =\n (pluginOptions: CollectionFilterPluginConfig = {}) =>\n (config: Config): Config => {\n if (!config.collections) {\n config.collections = [];\n }\n\n // Process each collection to add the QuickFilter component\n config.collections = config.collections.map((collection) => {\n // Check if this collection should be processed based on includedCollections/excludedCollections\n const shouldProcessCollection = pluginOptions.includedCollections \n ? pluginOptions.includedCollections.includes(collection.slug as CollectionSlug)\n : pluginOptions.excludedCollections \n ? !pluginOptions.excludedCollections.includes(collection.slug as CollectionSlug)\n : true;\n\n // Check if the collection has a filterList configuration\n // or if it's specified in the plugin options\n if (shouldProcessCollection && collection.custom?.filterList && Array.isArray(collection.custom.filterList)) {\n // Clone the collection to avoid mutating the original\n const newCollection = { ...collection };\n\n // Initialize components if not exists\n if (!newCollection.admin) {\n newCollection.admin = {};\n }\n\n if (!newCollection.admin.components) {\n newCollection.admin.components = {};\n }\n\n if (!newCollection.admin.components.beforeListTable) {\n newCollection.admin.components.beforeListTable = [];\n } else if (!Array.isArray(newCollection.admin.components.beforeListTable)) {\n // If it's not an array, convert it to an array\n newCollection.admin.components.beforeListTable = [\n newCollection.admin.components.beforeListTable,\n ];\n }\n\n // Add the QuickFilter component\n newCollection.admin.components.beforeListTable.push({\n path: '@shefing/quickfilter/QuickFilter',\n clientProps: {\n filterList: collection.custom.filterList,\n slug: collection.slug,\n },\n });\n\n return newCollection;\n }\n\n return collection;\n });\n\n /**\n * If the plugin is disabled, we still want to keep added collections/fields so the database schema is consistent which is important for migrations.\n * If your plugin heavily modifies the database schema, you may want to remove this property.\n */\n if (pluginOptions.disabled) {\n return config;\n }\n\n return config;\n };\n\nexport default CollectionQuickFilterPlugin;\n"],"names":["CollectionQuickFilterPlugin","pluginOptions","config","collections","map","collection","shouldProcessCollection","includedCollections","includes","slug","excludedCollections","custom","filterList","Array","isArray","newCollection","admin","components","beforeListTable","push","path","clientProps","disabled"],"mappings":"AAEA,cAAc,cAAc;AAW5B,OAAO,MAAMA,8BACX,CAACC,gBAA8C,CAAC,CAAC,GACjD,CAACC;QACC,IAAI,CAACA,OAAOC,WAAW,EAAE;YACvBD,OAAOC,WAAW,GAAG,EAAE;QACzB;QAEA,2DAA2D;QAC3DD,OAAOC,WAAW,GAAGD,OAAOC,WAAW,CAACC,GAAG,CAAC,CAACC;YAC3C,gGAAgG;YAChG,MAAMC,0BAA0BL,cAAcM,mBAAmB,GAC7DN,cAAcM,mBAAmB,CAACC,QAAQ,CAACH,WAAWI,IAAI,IAC1DR,cAAcS,mBAAmB,GAC/B,CAACT,cAAcS,mBAAmB,CAACF,QAAQ,CAACH,WAAWI,IAAI,IAC3D;YAEN,yDAAyD;YACzD,6CAA6C;YAC7C,IAAIH,2BAA2BD,WAAWM,MAAM,EAAEC,cAAcC,MAAMC,OAAO,CAACT,WAAWM,MAAM,CAACC,UAAU,GAAG;gBAC3G,sDAAsD;gBACtD,MAAMG,gBAAgB;oBAAE,GAAGV,UAAU;gBAAC;gBAEtC,sCAAsC;gBACtC,IAAI,CAACU,cAAcC,KAAK,EAAE;oBACxBD,cAAcC,KAAK,GAAG,CAAC;gBACzB;gBAEA,IAAI,CAACD,cAAcC,KAAK,CAACC,UAAU,EAAE;oBACnCF,cAAcC,KAAK,CAACC,UAAU,GAAG,CAAC;gBACpC;gBAEA,IAAI,CAACF,cAAcC,KAAK,CAACC,UAAU,CAACC,eAAe,EAAE;oBACnDH,cAAcC,KAAK,CAACC,UAAU,CAACC,eAAe,GAAG,EAAE;gBACrD,OAAO,IAAI,CAACL,MAAMC,OAAO,CAACC,cAAcC,KAAK,CAACC,UAAU,CAACC,eAAe,GAAG;oBACzE,+CAA+C;oBAC/CH,cAAcC,KAAK,CAACC,UAAU,CAACC,eAAe,GAAG;wBAC/CH,cAAcC,KAAK,CAACC,UAAU,CAACC,eAAe;qBAC/C;gBACH;gBAEA,gCAAgC;gBAChCH,cAAcC,KAAK,CAACC,UAAU,CAACC,eAAe,CAACC,IAAI,CAAC;oBAClDC,MAAM;oBACNC,aAAa;wBACXT,YAAYP,WAAWM,MAAM,CAACC,UAAU;wBACxCH,MAAMJ,WAAWI,IAAI;oBACvB;gBACF;gBAEA,OAAOM;YACT;YAEA,OAAOV;QACT;QAEA;;;KAGC,GACD,IAAIJ,cAAcqB,QAAQ,EAAE;YAC1B,OAAOpB;QACT;QAEA,OAAOA;IACT,EAAE;AAEJ,eAAeF,4BAA4B"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionSlug, Config } from 'payload';\n\n\nexport type CollectionFilterPluginConfig = {\n /**\n * List of collections to add filters to\n */\n disabled?: boolean;\n excludedCollections?: CollectionSlug[];\n includedCollections?: CollectionSlug[];\n};\n\nexport const CollectionQuickFilterPlugin =\n (pluginOptions: CollectionFilterPluginConfig = {}) =>\n (config: Config): Config => {\n if (!config.collections) {\n config.collections = [];\n }\n\n // Process each collection to add the QuickFilter component\n config.collections = config.collections.map((collection) => {\n // Check if this collection should be processed based on includedCollections/excludedCollections\n const shouldProcessCollection = pluginOptions.includedCollections \n ? pluginOptions.includedCollections.includes(collection.slug as CollectionSlug)\n : pluginOptions.excludedCollections \n ? !pluginOptions.excludedCollections.includes(collection.slug as CollectionSlug)\n : true;\n\n // Check if the collection has a filterList configuration\n // or if it's specified in the plugin options\n if (shouldProcessCollection && collection.custom?.filterList && Array.isArray(collection.custom.filterList)) {\n // Clone the collection to avoid mutating the original\n const newCollection = { ...collection };\n\n // Initialize components if not exists\n if (!newCollection.admin) {\n newCollection.admin = {};\n }\n\n if (!newCollection.admin.components) {\n newCollection.admin.components = {};\n }\n\n if (!newCollection.admin.components.beforeListTable) {\n newCollection.admin.components.beforeListTable = [];\n } else if (!Array.isArray(newCollection.admin.components.beforeListTable)) {\n // If it's not an array, convert it to an array\n newCollection.admin.components.beforeListTable = [\n newCollection.admin.components.beforeListTable,\n ];\n }\n\n // Add the QuickFilter component\n newCollection.admin.components.beforeListTable.push({\n path: '@shefing/quickfilter/QuickFilter',\n clientProps: {\n filterList: collection.custom.filterList,\n slug: collection.slug,\n },\n });\n\n return newCollection;\n }\n\n return collection;\n });\n\n /**\n * If the plugin is disabled, we still want to keep added collections/fields so the database schema is consistent which is important for migrations.\n * If your plugin heavily modifies the database schema, you may want to remove this property.\n */\n if (pluginOptions.disabled) {\n return config;\n }\n\n return config;\n };\n\nexport default CollectionQuickFilterPlugin;\n"],"names":["CollectionQuickFilterPlugin","pluginOptions","config","collections","map","collection","shouldProcessCollection","includedCollections","includes","slug","excludedCollections","custom","filterList","Array","isArray","newCollection","admin","components","beforeListTable","push","path","clientProps","disabled"],"mappings":"AAYA,OAAO,MAAMA,8BACX,CAACC,gBAA8C,CAAC,CAAC,GACjD,CAACC;QACC,IAAI,CAACA,OAAOC,WAAW,EAAE;YACvBD,OAAOC,WAAW,GAAG,EAAE;QACzB;QAEA,2DAA2D;QAC3DD,OAAOC,WAAW,GAAGD,OAAOC,WAAW,CAACC,GAAG,CAAC,CAACC;YAC3C,gGAAgG;YAChG,MAAMC,0BAA0BL,cAAcM,mBAAmB,GAC7DN,cAAcM,mBAAmB,CAACC,QAAQ,CAACH,WAAWI,IAAI,IAC1DR,cAAcS,mBAAmB,GAC/B,CAACT,cAAcS,mBAAmB,CAACF,QAAQ,CAACH,WAAWI,IAAI,IAC3D;YAEN,yDAAyD;YACzD,6CAA6C;YAC7C,IAAIH,2BAA2BD,WAAWM,MAAM,EAAEC,cAAcC,MAAMC,OAAO,CAACT,WAAWM,MAAM,CAACC,UAAU,GAAG;gBAC3G,sDAAsD;gBACtD,MAAMG,gBAAgB;oBAAE,GAAGV,UAAU;gBA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,CA2L/C,CAAA;AACD,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nav/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,cAAc,EAGd,WAAW,EAEZ,MAAM,SAAS,CAAA;AAKhB,OAAO,KAAK,MAAM,OAAO,CAAA;AAmEzB,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,CAAC,EAAE,cAAc,CAAA;CACrB,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,QAAQ,CAyL/C,CAAA;AACD,eAAe,gBAAgB,CAAC"}
package/dist/nav/index.js CHANGED
@@ -80,16 +80,14 @@ export const NavDefaultFilter = async (props)=>{
80
80
  path: `/collections/${entity.slug}`
81
81
  });
82
82
  // Get the fields from the collection for parsing the where clause
83
- const fields = collection.custom.filterList?.flat().map((field)=>{
84
- const fieldName = field.name;
83
+ const fields = Object.keys(collection.custom.defaultFilter)?.flat().map((fieldName)=>{
85
84
  const fieldConfig = findFieldByName(collection.fields, fieldName);
86
85
  return {
87
86
  name: fieldName,
88
87
  type: fieldConfig?.type,
89
88
  options: fieldConfig?.options,
90
89
  label: fieldConfig?.label || fieldName,
91
- row: 0,
92
- width: typeof field === 'object' && 'width' in field ? field.width : undefined
90
+ row: 0
93
91
  };
94
92
  }).filter(Boolean) || [];
95
93
  // If we have fields and a defaultFilter, calculate the URL with where clause
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/nav/index.tsx"],"sourcesContent":["import type { EntityToGroup } from '@payloadcms/ui/shared'\nimport type {\n Field,\n NavPreferences,\n PayloadRequest,\n SanitizedPermissions,\n SelectField,\n ServerProps,\n UIField,\n} from 'payload'\n\nimport { Logout } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { EntityType, groupNavItems } from '@payloadcms/ui/shared'\nimport React from 'react'\nimport { formatAdminURL } from 'payload/shared'\nimport { parseWhereClauseToFilterValues, buildQuickFilterConditions } from '../lib/utils'\nimport type { FilterDetaild } from '../filters/types/filters-type'\nimport type { SupportedLocale } from '../labels'\nimport { stringify } from 'qs-esm'\n\nimport { NavHamburger } from './NavHamburger'\nimport { NavWrapper } from './NavWrapper'\n// Import SCSS only in browser environment\n// This prevents Node.js from trying to import SCSS directly\n// which causes ERR_UNKNOWN_FILE_EXTENSION error\nif (typeof window !== 'undefined') {\n // @ts-ignore\n import('./index.scss').catch(err => {\n console.warn('Failed to load SCSS file:', err);\n });\n}\n\nconst baseClass = 'nav'\n\nimport { getNavPrefs } from './getNavPrefs'\nimport { DefaultNavClient } from './index.client'\nimport { FieldAffectingData } from 'payload'\n\n// Recursive function to find a field by name\nfunction findFieldByName(fields: Field[], fieldName: string): Field {\n // First check at the current level\n const directMatch = fields.find(\n (f) => (f as FieldAffectingData).name === fieldName,\n )\n if (directMatch) return directMatch\n\n // If not found, search recursively in nested structures\n for (const item of fields) {\n // Check in array, row, or collapsible fields\n if (\n (item.type === 'array' || item.type === 'row' || item.type === 'collapsible') &&\n 'fields' in item &&\n Array.isArray(item.fields)\n ) {\n const nestedMatch = findFieldByName(item.fields, fieldName)\n if (nestedMatch) return nestedMatch\n } \n // Check in tabs\n else if (item.type === 'tabs' && Array.isArray(item.tabs)) {\n for (const tab of item.tabs) {\n if ('fields' in tab && Array.isArray(tab.fields)) {\n const tabMatch = findFieldByName(tab.fields, fieldName)\n if (tabMatch) return tabMatch\n }\n }\n } \n // Check in blocks\n else if (item.type === 'blocks' && Array.isArray(item.blocks)) {\n for (const block of item.blocks) {\n if ('fields' in block && Array.isArray(block.fields)) {\n const blockMatch = findFieldByName(block.fields, fieldName)\n if (blockMatch) return blockMatch\n }\n }\n }\n }\n\n return null\n}\n\nexport type NavProps = {\n req?: PayloadRequest\n} & ServerProps\n\nexport const NavDefaultFilter: React.FC<NavProps> = async (props) => {\n const {\n documentSubViewType,\n i18n,\n locale,\n params,\n payload,\n permissions,\n req,\n searchParams,\n user,\n viewType,\n visibleEntities,\n } = props\n\n if (!payload?.config) {\n return null\n }\n\n const {\n admin: {\n components: { afterNavLinks, beforeNavLinks, logout },\n },\n collections,\n globals,\n } = payload.config\n\n const groups = groupNavItems(\n [\n ...collections\n .filter(({ slug }) => visibleEntities?.collections.includes(slug))\n .map(\n (collection) =>\n ({\n type: EntityType.collection,\n entity: collection,\n }) satisfies EntityToGroup,\n ),\n ...globals\n .filter(({ slug }) => visibleEntities?.globals.includes(slug))\n .map(\n (global) =>\n ({\n type: EntityType.global,\n entity: global,\n }) satisfies EntityToGroup,\n ),\n ],\n permissions as SanitizedPermissions,\n i18n,\n )\n\n const navPreferences = await getNavPrefs(req as PayloadRequest)\n\n // Process collections to calculate URLs with defaultFilter\n const processedGroups = groups.map(group => {\n const processedEntities = group.entities.map(entity => {\n if (entity.type === EntityType.collection) {\n const collection = collections.find(c => c.slug === entity.slug);\n debugger\n // Check if collection has defaultFilter in custom props\n if (collection?.custom?.defaultFilter) {\n // Base URL without query parameters\n const baseHref = formatAdminURL({ \n adminRoute: payload.config.routes.admin, \n path: `/collections/${entity.slug}` \n });\n\n // Get the fields from the collection for parsing the where clause\n const fields: FilterDetaild[] =\n collection.custom.filterList\n ?.flat()\n .map((field: { name: string; width: string | undefined }) => {\n const fieldName = field.name\n const fieldConfig = findFieldByName(collection.fields, fieldName)\n return {\n name: fieldName,\n type: fieldConfig?.type,\n options: (fieldConfig as SelectField )?.options,\n label: (fieldConfig as UIField)?.label || fieldName,\n row: 0,\n width: typeof field === 'object' && 'width' in field ? field.width : undefined,\n } as FilterDetaild\n })\n .filter(Boolean) || []\n\n // If we have fields and a defaultFilter, calculate the URL with where clause\n if (fields.length > 0) {\n // Parse the defaultFilter to get filter values\n const filterValues = parseWhereClauseToFilterValues(\n collection.custom.defaultFilter,\n fields,\n i18n.language as SupportedLocale\n );\n // If we have filter values, add them to the URL\n if (Object.keys(filterValues).length > 0) {\n const quickFilterConditions = buildQuickFilterConditions(filterValues, fields, i18n.language as SupportedLocale)\n\n\n const whereCondition = quickFilterConditions.length === 1 ? quickFilterConditions[0] : { and: quickFilterConditions };\n const query = {\n where: whereCondition,\n };\n const stringifiedQuery = stringify(query, { addQueryPrefix: true });\n return {\n ...entity,\n href: `${baseHref}${stringifiedQuery}`\n };\n }\n }\n }\n }\n return entity;\n });\n\n return {\n ...group,\n entities: processedEntities\n };\n });\n\n const LogoutComponent = RenderServerComponent({\n clientProps: {\n documentSubViewType,\n viewType,\n },\n Component: logout?.Button,\n Fallback: Logout,\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })\n\n return (\n <NavWrapper baseClass={baseClass}>\n <nav className={`${baseClass}__wrap`}>\n {RenderServerComponent({\n clientProps: {\n documentSubViewType,\n viewType,\n },\n Component: beforeNavLinks,\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })}\n <DefaultNavClient groups={processedGroups} navPreferences={navPreferences as NavPreferences} />\n {RenderServerComponent({\n clientProps: {\n documentSubViewType,\n viewType,\n },\n Component: afterNavLinks,\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })}\n <div className={`${baseClass}__controls`}>{LogoutComponent}</div>\n </nav>\n <div className={`${baseClass}__header`}>\n <div className={`${baseClass}__header-content`}>\n <NavHamburger baseClass={baseClass} />\n </div>\n </div>\n </NavWrapper>\n )\n}\nexport default NavDefaultFilter;\n"],"names":["Logout","RenderServerComponent","EntityType","groupNavItems","React","formatAdminURL","parseWhereClauseToFilterValues","buildQuickFilterConditions","stringify","NavHamburger","NavWrapper","window","catch","err","console","warn","baseClass","getNavPrefs","DefaultNavClient","findFieldByName","fields","fieldName","directMatch","find","f","name","item","type","Array","isArray","nestedMatch","tabs","tab","tabMatch","blocks","block","blockMatch","NavDefaultFilter","props","documentSubViewType","i18n","locale","params","payload","permissions","req","searchParams","user","viewType","visibleEntities","config","admin","components","afterNavLinks","beforeNavLinks","logout","collections","globals","groups","filter","slug","includes","map","collection","entity","global","navPreferences","processedGroups","group","processedEntities","entities","c","custom","defaultFilter","baseHref","adminRoute","routes","path","filterList","flat","field","fieldConfig","options","label","row","width","undefined","Boolean","length","filterValues","language","Object","keys","quickFilterConditions","whereCondition","and","query","where","stringifiedQuery","addQueryPrefix","href","LogoutComponent","clientProps","Component","Button","Fallback","importMap","serverProps","nav","className","div"],"mappings":";AAWA,SAASA,MAAM,QAAQ,iBAAgB;AACvC,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,UAAU,EAAEC,aAAa,QAAQ,wBAAuB;AACjE,OAAOC,WAAW,QAAO;AACzB,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,SAASC,8BAA8B,EAAEC,0BAA0B,QAAQ,eAAc;AAGzF,SAASC,SAAS,QAAQ,SAAQ;AAElC,SAASC,YAAY,QAAQ,iBAAgB;AAC7C,SAASC,UAAU,QAAQ,eAAc;AACzC,0CAA0C;AAC1C,4DAA4D;AAC5D,gDAAgD;AAChD,IAAI,OAAOC,WAAW,aAAa;IACjC,aAAa;IACb,MAAM,CAAC,gBAAgBC,KAAK,CAACC,CAAAA;QAC3BC,QAAQC,IAAI,CAAC,6BAA6BF;IAC5C;AACF;AAEA,MAAMG,YAAY;AAElB,SAASC,WAAW,QAAQ,gBAAe;AAC3C,SAASC,gBAAgB,QAAQ,iBAAgB;AAGjD,6CAA6C;AAC7C,SAASC,gBAAgBC,MAAe,EAAEC,SAAiB;IACzD,mCAAmC;IACnC,MAAMC,cAAcF,OAAOG,IAAI,CAC7B,CAACC,IAAM,AAACA,EAAyBC,IAAI,KAAKJ;IAE5C,IAAIC,aAAa,OAAOA;IAExB,wDAAwD;IACxD,KAAK,MAAMI,QAAQN,OAAQ;QACzB,6CAA6C;QAC7C,IACE,AAACM,CAAAA,KAAKC,IAAI,KAAK,WAAWD,KAAKC,I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BACAE;4BACAC;wBACF;oBACF;kCACA,KAAC7B;wBAAiBwC,QAAQS;wBAAiBD,gBAAgBA;;oBAC1DjE,sBAAsB;wBACrBqG,aAAa;4BACX/D;4BACAS;wBACF;wBACAuD,WAAWlD;wBACXqD,WAAW/D,QAAQ+D,SAAS;wBAC5BC,aAAa;4BACXnE;4BACAC;4BACAC;4BACAC;4BACAC;4BACAE;4BACAC;wBACF;oBACF;kCACA,KAAC+D;wBAAID,WAAW,GAAG7F,UAAU,UAAU,CAAC;kCAAGqF;;;;0BAE7C,KAACS;gBAAID,WAAW,GAAG7F,UAAU,QAAQ,CAAC;0BACpC,cAAA,KAAC8F;oBAAID,WAAW,GAAG7F,UAAU,gBAAgB,CAAC;8BAC5C,cAAA,KAACP;wBAAaO,WAAWA;;;;;;AAKnC,EAAC;AACD,eAAeqB,iBAAiB"}
1
+ {"version":3,"sources":["../../src/nav/index.tsx"],"sourcesContent":["import type { EntityToGroup } from '@payloadcms/ui/shared'\nimport type {\n Field,\n NavPreferences,\n PayloadRequest,\n SanitizedPermissions,\n SelectField,\n ServerProps,\n UIField,\n} from 'payload'\n\nimport { Logout } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\nimport { EntityType, groupNavItems } from '@payloadcms/ui/shared'\nimport React from 'react'\nimport { formatAdminURL } from 'payload/shared'\nimport { parseWhereClauseToFilterValues, buildQuickFilterConditions } from '../lib/utils'\nimport type { FilterDetaild } from '../filters/types/filters-type'\nimport type { SupportedLocale } from '../labels'\nimport { stringify } from 'qs-esm'\n\nimport { NavHamburger } from './NavHamburger'\nimport { NavWrapper } from './NavWrapper'\n// Import SCSS only in browser environment\n// This prevents Node.js from trying to import SCSS directly\n// which causes ERR_UNKNOWN_FILE_EXTENSION error\nif (typeof window !== 'undefined') {\n // @ts-ignore\n import('./index.scss').catch(err => {\n console.warn('Failed to load SCSS file:', err);\n });\n}\n\nconst baseClass = 'nav'\n\nimport { getNavPrefs } from './getNavPrefs'\nimport { DefaultNavClient } from './index.client'\nimport { FieldAffectingData } from 'payload'\n\n// Recursive function to find a field by name\nfunction findFieldByName(fields: Field[], fieldName: string): Field {\n // First check at the current level\n const directMatch = fields.find(\n (f) => (f as FieldAffectingData).name === fieldName,\n )\n if (directMatch) return directMatch\n\n // If not found, search recursively in nested structures\n for (const item of fields) {\n // Check in array, row, or collapsible fields\n if (\n (item.type === 'array' || item.type === 'row' || item.type === 'collapsible') &&\n 'fields' in item &&\n Array.isArray(item.fields)\n ) {\n const nestedMatch = findFieldByName(item.fields, fieldName)\n if (nestedMatch) return nestedMatch\n } \n // Check in tabs\n else if (item.type === 'tabs' && Array.isArray(item.tabs)) {\n for (const tab of item.tabs) {\n if ('fields' in tab && Array.isArray(tab.fields)) {\n const tabMatch = findFieldByName(tab.fields, fieldName)\n if (tabMatch) return tabMatch\n }\n }\n } \n // Check in blocks\n else if (item.type === 'blocks' && Array.isArray(item.blocks)) {\n for (const block of item.blocks) {\n if ('fields' in block && Array.isArray(block.fields)) {\n const blockMatch = findFieldByName(block.fields, fieldName)\n if (blockMatch) return blockMatch\n }\n }\n }\n }\n\n return null\n}\n\nexport type NavProps = {\n req?: PayloadRequest\n} & ServerProps\n\nexport const NavDefaultFilter: React.FC<NavProps> = async (props) => {\n const {\n documentSubViewType,\n i18n,\n locale,\n params,\n payload,\n permissions,\n req,\n searchParams,\n user,\n viewType,\n visibleEntities,\n } = props\n\n if (!payload?.config) {\n return null\n }\n\n const {\n admin: {\n components: { afterNavLinks, beforeNavLinks, logout },\n },\n collections,\n globals,\n } = payload.config\n\n const groups = groupNavItems(\n [\n ...collections\n .filter(({ slug }) => visibleEntities?.collections.includes(slug))\n .map(\n (collection) =>\n ({\n type: EntityType.collection,\n entity: collection,\n }) satisfies EntityToGroup,\n ),\n ...globals\n .filter(({ slug }) => visibleEntities?.globals.includes(slug))\n .map(\n (global) =>\n ({\n type: EntityType.global,\n entity: global,\n }) satisfies EntityToGroup,\n ),\n ],\n permissions as SanitizedPermissions,\n i18n,\n )\n\n const navPreferences = await getNavPrefs(req as PayloadRequest)\n\n // Process collections to calculate URLs with defaultFilter\n const processedGroups = groups.map(group => {\n const processedEntities = group.entities.map(entity => {\n if (entity.type === EntityType.collection) {\n const collection = collections.find(c => c.slug === entity.slug);\n debugger\n // Check if collection has defaultFilter in custom props\n if (collection?.custom?.defaultFilter) {\n // Base URL without query parameters\n const baseHref = formatAdminURL({ \n adminRoute: payload.config.routes.admin, \n path: `/collections/${entity.slug}` \n });\n\n // Get the fields from the collection for parsing the where clause\n const fields: FilterDetaild[] =\n Object.keys(collection.custom.defaultFilter)\n ?.flat()\n .map((fieldName: string) => {\n const fieldConfig = findFieldByName(collection.fields, fieldName)\n return {\n name: fieldName,\n type: fieldConfig?.type,\n options: (fieldConfig as SelectField )?.options,\n label: (fieldConfig as UIField)?.label || fieldName,\n row: 0,\n } as FilterDetaild\n })\n .filter(Boolean) || []\n\n // If we have fields and a defaultFilter, calculate the URL with where clause\n if (fields.length > 0) {\n // Parse the defaultFilter to get filter values\n const filterValues = parseWhereClauseToFilterValues(\n collection.custom.defaultFilter,\n fields,\n i18n.language as SupportedLocale\n );\n // If we have filter values, add them to the URL\n if (Object.keys(filterValues).length > 0) {\n const quickFilterConditions = buildQuickFilterConditions(filterValues, fields, i18n.language as SupportedLocale)\n\n\n const whereCondition = quickFilterConditions.length === 1 ? quickFilterConditions[0] : { and: quickFilterConditions };\n const query = {\n where: whereCondition,\n };\n const stringifiedQuery = stringify(query, { addQueryPrefix: true });\n return {\n ...entity,\n href: `${baseHref}${stringifiedQuery}`\n };\n }\n }\n }\n }\n return entity;\n });\n\n return {\n ...group,\n entities: processedEntities\n };\n });\n\n const LogoutComponent = RenderServerComponent({\n clientProps: {\n documentSubViewType,\n viewType,\n },\n Component: logout?.Button,\n Fallback: Logout,\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })\n\n return (\n <NavWrapper baseClass={baseClass}>\n <nav className={`${baseClass}__wrap`}>\n {RenderServerComponent({\n clientProps: {\n documentSubViewType,\n viewType,\n },\n Component: beforeNavLinks,\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })}\n <DefaultNavClient groups={processedGroups} navPreferences={navPreferences as NavPreferences} />\n {RenderServerComponent({\n clientProps: {\n documentSubViewType,\n viewType,\n },\n Component: afterNavLinks,\n importMap: payload.importMap,\n serverProps: {\n i18n,\n locale,\n params,\n payload,\n permissions,\n searchParams,\n user,\n },\n })}\n <div className={`${baseClass}__controls`}>{LogoutComponent}</div>\n </nav>\n <div className={`${baseClass}__header`}>\n <div className={`${baseClass}__header-content`}>\n <NavHamburger baseClass={baseClass} />\n </div>\n </div>\n </NavWrapper>\n )\n}\nexport default NavDefaultFilter;\n"],"names":["Logout","RenderServerComponent","EntityType","groupNavItems","React","formatAdminURL","parseWhereClauseToFilterValues","buildQuickFilterConditions","stringify","NavHamburger","NavWrapper","window","catch","err","console","warn","baseClass","getNavPrefs","DefaultNavClient","findFieldByName","fields","fieldName","directMatch","find","f","name","item","type","Array","isArray","nestedMatch","tabs","tab","tabMatch","blocks","block","blockMatch","NavDefaultFilter","props","documentSubViewType","i18n","locale","params","payload","permissions","req","searchParams","user","viewType","visibleEntities","config","admin","components","afterNavLinks","beforeNavLinks","logout","collections","globals","groups","filter","slug","includes","map","collection","entity","global","navPreferences","processedGroups","group","processedEntities","entities","c","custom","defaultFilter","baseHref","adminRoute","routes","path","Object","keys","flat","fieldConfig","options","label","row","Boolean","length","filterValues","language","quickFilterConditions","whereCondition","and","query","where","stringifiedQuery","addQueryPrefix","href","LogoutComponent","clientProps","Component","Button","Fallback","importMap","serverProps","nav","className","div"],"mappings":";AAWA,SAASA,MAAM,QAAQ,iBAAgB;AACvC,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,UAAU,EAAEC,aAAa,QAAQ,wBAAuB;AACjE,OAAOC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,7 @@ import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  declare const buttonVariants: (props?: {
4
4
  variant?: "link" | "default" | "defaultHover" | "destructive" | "outline" | "secondary" | "ghost" | "icon";
5
- size?: "default" | "sm" | "lg" | "icon";
5
+ size?: "sm" | "lg" | "default" | "icon";
6
6
  } & import("class-variance-authority/types").ClassProp) => string;
7
7
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
8
  asChild?: boolean;
@@ -22,7 +22,7 @@ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<
22
22
  ref?: React.Ref<HTMLInputElement>;
23
23
  } & {
24
24
  asChild?: boolean;
25
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "value" | "type" | "onChange"> & {
25
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type" | "value" | "onChange"> & {
26
26
  value?: string;
27
27
  onValueChange?: (search: string) => void;
28
28
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
@@ -66,7 +66,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
66
66
  ref?: React.Ref<HTMLDivElement>;
67
67
  } & {
68
68
  asChild?: boolean;
69
- }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "onSelect" | "disabled"> & {
69
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "disabled" | "onSelect"> & {
70
70
  disabled?: boolean;
71
71
  onSelect?: (value: string) => void;
72
72
  value?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shefing/quickfilter",
3
- "version": "1.0.34",
3
+ "version": "1.0.37",
4
4
  "private": false,
5
5
  "bugs": "https://github.com/shefing/payload-tools/issues",
6
6
  "repository": "https://github.com/shefing/payload-tools",