@shefing/quickfilter 1.0.12 → 1.0.13
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/README.md +0 -14
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -815,20 +815,6 @@ import 'tailwindcss/tailwind.css';
|
|
|
815
815
|
<details>
|
|
816
816
|
<summary>🔍 <strong>Enable detailed logging</strong></summary>
|
|
817
817
|
|
|
818
|
-
```typescript
|
|
819
|
-
// In your browser console
|
|
820
|
-
localStorage.setItem('quickfilter-debug', 'true');
|
|
821
|
-
|
|
822
|
-
// Then refresh the page and check console for:
|
|
823
|
-
// ✅ Filter configuration loading
|
|
824
|
-
// ✅ Query generation details
|
|
825
|
-
// ✅ State management logs
|
|
826
|
-
// ✅ Error details
|
|
827
|
-
|
|
828
|
-
// To disable debug mode:
|
|
829
|
-
localStorage.removeItem('quickfilter-debug');
|
|
830
|
-
```
|
|
831
|
-
|
|
832
818
|
**🎯 What to look for in console:**
|
|
833
819
|
|
|
834
820
|
- `[QuickFilter] Loading filters for collection: users`
|
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: '/
|
|
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';\n\nexport type CollectionFilterPluginConfig = {\n /**\n * List of collections to add filters to\n */\n disabled?: boolean;\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 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: '/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload';\n\nexport type CollectionFilterPluginConfig = {\n /**\n * List of collections to add filters to\n */\n disabled?: boolean;\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 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":"AASA,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,KA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