@shefing/quickfilter 1.0.34 → 1.0.36
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 +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/command.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -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;
|
|
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
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionSlug, Config } from 'payload';\n\
|
|
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,C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ACxCH,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"}
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -2,7 +2,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?: "
|
|
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;
|
package/dist/ui/command.d.ts
CHANGED
|
@@ -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>>, "
|
|
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" | "
|
|
69
|
+
}, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "value" | "disabled" | "onSelect"> & {
|
|
70
70
|
disabled?: boolean;
|
|
71
71
|
onSelect?: (value: string) => void;
|
|
72
72
|
value?: string;
|