@shefing/quickfilter 1.0.0 → 1.0.2

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.js CHANGED
@@ -28,7 +28,7 @@ export const CollectionQuickFilterPlugin = (pluginOptions = {})=>(config)=>{
28
28
  }
29
29
  // Add the QuickFilter component
30
30
  newCollection.admin.components.beforeListTable.push({
31
- path: '/plugins/quickfilter/QuickFilter',
31
+ path: '@shefing/quickfilter/QuickFilter',
32
32
  clientProps: {
33
33
  filterList: collection.custom.filterList,
34
34
  slug: collection.slug
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload';\nimport { CollectionFilterPluginConfig } from './types';\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 the collection has a filterList configuration\n // or if it's specified in the plugin options\n if (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: '/plugins/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","custom","filterList","Array","isArray","newCollection","admin","components","beforeListTable","push","path","clientProps","slug","disabled"],"mappings":"AAGA,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,yDAAyD;YACzD,6CAA6C;YAC7C,IAAIA,WAAWC,MAAM,EAAEC,cAAcC,MAAMC,OAAO,CAACJ,WAAWC,MAAM,CAACC,UAAU,GAAG;gBAChF,sDAAsD;gBACtD,MAAMG,gBAAgB;oBAAE,GAAGL,UAAU;gBAAC;gBAEtC,sCAAsC;gBACtC,IAAI,CAACK,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,YAAYF,WAAWC,MAAM,CAACC,UAAU;wBACxCU,MAAMZ,WAAWY,IAAI;oBACvB;gBACF;gBAEA,OAAOP;YACT;YAEA,OAAOL;QACT;QAEA;;;KAGC,GACD,IAAIJ,cAAciB,QAAQ,EAAE;YAC1B,OAAOhB;QACT;QAEA,OAAOA;IACT,EAAE;AAEJ,eAAeF,4BAA4B"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload';\nimport { CollectionFilterPluginConfig } from './types';\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 the collection has a filterList configuration\n // or if it's specified in the plugin options\n if (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","custom","filterList","Array","isArray","newCollection","admin","components","beforeListTable","push","path","clientProps","slug","disabled"],"mappings":"AAGA,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,yDAAyD;YACzD,6CAA6C;YAC7C,IAAIA,WAAWC,MAAM,EAAEC,cAAcC,MAAMC,OAAO,CAACJ,WAAWC,MAAM,CAACC,UAAU,GAAG;gBAChF,sDAAsD;gBACtD,MAAMG,gBAAgB;oBAAE,GAAGL,UAAU;gBAAC;gBAEtC,sCAAsC;gBACtC,IAAI,CAACK,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,YAAYF,WAAWC,MAAM,CAACC,UAAU;wBACxCU,MAAMZ,WAAWY,IAAI;oBACvB;gBACF;gBAEA,OAAOP;YACT;YAEA,OAAOL;QACT;QAEA;;;KAGC,GACD,IAAIJ,cAAciB,QAAQ,EAAE;YAC1B,OAAOhB;QACT;QAEA,OAAOA;IACT,EAAE;AAEJ,eAAeF,4BAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shefing/quickfilter",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "private": false,
5
5
  "bugs": "https://github.com/shefing/payload-tools/issues",
6
6
  "repository": "https://github.com/shefing/payload-tools",
@@ -17,6 +17,10 @@
17
17
  ".": {
18
18
  "import": "./dist/index.js",
19
19
  "require": "./dist/index.js"
20
+ },
21
+ "./QuickFilter": {
22
+ "import": "./dist/QuickFilter.js",
23
+ "require": "./dist/QuickFilter.js"
20
24
  }
21
25
  },
22
26
  "scripts": {