@shefing/quickfilter 1.0.11 → 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.
Files changed (43) hide show
  1. package/README.md +859 -0
  2. package/dist/FilterField.d.ts.map +1 -1
  3. package/dist/FilterField.js +18 -9
  4. package/dist/FilterField.js.map +1 -1
  5. package/dist/QuickFilter.d.ts.map +1 -1
  6. package/dist/QuickFilter.js +227 -55
  7. package/dist/QuickFilter.js.map +1 -1
  8. package/dist/filters/components/checkbox-filter.d.ts +2 -1
  9. package/dist/filters/components/checkbox-filter.d.ts.map +1 -1
  10. package/dist/filters/components/checkbox-filter.js +9 -7
  11. package/dist/filters/components/checkbox-filter.js.map +1 -1
  12. package/dist/filters/components/date-filter.d.ts +2 -1
  13. package/dist/filters/components/date-filter.d.ts.map +1 -1
  14. package/dist/filters/components/date-filter.js +26 -24
  15. package/dist/filters/components/date-filter.js.map +1 -1
  16. package/dist/filters/components/select-filter.d.ts +2 -1
  17. package/dist/filters/components/select-filter.d.ts.map +1 -1
  18. package/dist/filters/components/select-filter.js +20 -18
  19. package/dist/filters/components/select-filter.js.map +1 -1
  20. package/dist/filters/components/small-select-filter.d.ts +2 -1
  21. package/dist/filters/components/small-select-filter.d.ts.map +1 -1
  22. package/dist/filters/components/small-select-filter.js +4 -3
  23. package/dist/filters/components/small-select-filter.js.map +1 -1
  24. package/dist/filters/constants/date-filter-options.d.ts +7 -4
  25. package/dist/filters/constants/date-filter-options.d.ts.map +1 -1
  26. package/dist/filters/constants/date-filter-options.js +25 -70
  27. package/dist/filters/constants/date-filter-options.js.map +1 -1
  28. package/dist/filters/types/filters-type.d.ts.map +1 -1
  29. package/dist/filters/types/filters-type.js.map +1 -1
  30. package/dist/filters/utils/date-helpers.d.ts +4 -3
  31. package/dist/filters/utils/date-helpers.d.ts.map +1 -1
  32. package/dist/filters/utils/date-helpers.js +14 -11
  33. package/dist/filters/utils/date-helpers.js.map +1 -1
  34. package/dist/filters/utils/layout-helpers.d.ts.map +1 -1
  35. package/dist/filters/utils/layout-helpers.js.map +1 -1
  36. package/dist/index.d.ts +6 -1
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/labels.d.ts +326 -0
  40. package/dist/labels.d.ts.map +1 -0
  41. package/dist/labels.js +192 -0
  42. package/dist/labels.js.map +1 -0
  43. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/filters/utils/layout-helpers.ts"],"sourcesContent":["import { FilterDetaild, FilterRow } from '../types/filters-type'\n\nexport function groupFiltersByRow(filters: FilterDetaild[]): FilterRow[] {\n // Group filters by row number\n const groupedFilters = filters.reduce(\n (acc, filter) => {\n const rowNumber = filter.row ?? 0\n if (!acc[rowNumber]) {\n acc[rowNumber] = []\n }\n acc[rowNumber].push(filter)\n return acc\n },\n {} as Record<number, FilterDetaild[]>,\n )\n\n // Convert to array and sort filters within each row by order\n const rows: FilterRow[] = Object.entries(groupedFilters)\n .map(([rowNumber, filters]) => ({\n rowNumber: Number.parseInt(rowNumber),\n filters: filters,\n }))\n .sort((a, b) => a.rowNumber - b.rowNumber)\n\n return rows\n}\n\nexport function getFilterWidthClass(width?: string): string {\n switch (width) {\n case 'sm':\n return 'w-full max-w-xs'\n case 'md':\n return 'w-full max-w-sm'\n case 'lg':\n return 'w-full max-w-md'\n case 'xl':\n return 'w-full max-w-lg'\n case 'full':\n return 'w-full'\n case 'auto':\n default:\n return 'w-auto min-w-fit'\n }\n}\n\nexport function getGridColumnsClass(filtersCount: number): string {\n switch (filtersCount) {\n case 1:\n return 'grid-cols-1'\n case 2:\n return 'grid-cols-1 md:grid-cols-2'\n case 3:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3'\n case 4:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4'\n case 5:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5'\n case 6:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6'\n default:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4'\n }\n}\n\nexport const parseColumns = (raw: unknown): string[] => {\n if (Array.isArray(raw)) {\n return raw\n }\n\n if (typeof raw === 'string') {\n try {\n const cleaned = raw\n .trim()\n .replace(/^\"+/, '')\n .replace(/\"+$/, '')\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\+\"/g, '\"')\n .replace(/\\\\\\\\/g, '\\\\')\n\n const parsed = JSON.parse(cleaned)\n\n if (Array.isArray(parsed)) {\n console.log('Parsed columns:', parsed)\n console.log('row:', raw)\n return parsed\n }\n } catch (err) {\n console.warn('Failed to parse columns string:', raw, err)\n }\n }\n\n return []\n}\n"],"names":["groupFiltersByRow","filters","groupedFilters","reduce","acc","filter","rowNumber","row","push","rows","Object","entries","map","Number","parseInt","sort","a","b","getFilterWidthClass","width","getGridColumnsClass","filtersCount","parseColumns","raw","Array","isArray","cleaned","trim","replace","parsed","JSON","parse","console","log","err","warn"],"mappings":"AAEA,OAAO,SAASA,kBAAkBC,OAAwB;IACxD,8BAA8B;IAC9B,MAAMC,iBAAiBD,QAAQE,MAAM,CACnC,CAACC,KAAKC;QACJ,MAAMC,YAAYD,OAAOE,GAAG,IAAI;QAChC,IAAI,CAACH,GAAG,CAACE,UAAU,EAAE;YACnBF,GAAG,CAACE,UAAU,GAAG,EAAE;QACrB;QACAF,GAAG,CAACE,UAAU,CAACE,IAAI,CAACH;QACpB,OAAOD;IACT,GACA,CAAC;IAGH,6DAA6D;IAC7D,MAAMK,OAAoBC,OAAOC,OAAO,CAACT,gBACtCU,GAAG,CAAC,CAAC,CAACN,WAAWL,QAAQ,GAAM,CAAA;YAC9BK,WAAWO,OAAOC,QAAQ,CAACR;YAC3BL,SAASA;QACX,CAAA,GACCc,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEV,SAAS,GAAGW,EAAEX,SAAS;IAE3C,OAAOG;AACT;AAEA,OAAO,SAASS,oBAAoBC,KAAc;IAChD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL;YACE,OAAO;IACX;AACF;AAEA,OAAO,SAASC,oBAAoBC,YAAoB;IACtD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,OAAO,MAAMC,eAAe,CAACC;IAC3B,IAAIC,MAAMC,OAAO,CAACF,MAAM;QACtB,OAAOA;IACT;IAEA,IAAI,OAAOA,QAAQ,UAAU;QAC3B,IAAI;YACF,MAAMG,UAAUH,IACbI,IAAI,GACJC,OAAO,CAAC,OAAO,IACfA,OAAO,CAAC,OAAO,IACfA,OAAO,CAAC,QAAQ,KAChBA,OAAO,CAAC,SAAS,KACjBA,OAAO,CAAC,SAAS;YAEpB,MAAMC,SAASC,KAAKC,KAAK,CAACL;YAE1B,IAAIF,MAAMC,OAAO,CAACI,SAAS;gBACzBG,QAAQC,GAAG,CAAC,mBAAmBJ;gBAC/BG,QAAQC,GAAG,CAAC,QAAQV;gBACpB,OAAOM;YACT;QACF,EAAE,OAAOK,KAAK;YACZF,QAAQG,IAAI,CAAC,mCAAmCZ,KAAKW;QACvD;IACF;IAEA,OAAO,EAAE;AACX,EAAC"}
1
+ {"version":3,"sources":["../../../src/filters/utils/layout-helpers.ts"],"sourcesContent":["import { FilterDetaild, FilterRow } from '../types/filters-type';\n\nexport function groupFiltersByRow(filters: FilterDetaild[]): FilterRow[] {\n // Group filters by row number\n const groupedFilters = filters.reduce(\n (acc, filter) => {\n const rowNumber = filter.row ?? 0;\n if (!acc[rowNumber]) {\n acc[rowNumber] = [];\n }\n acc[rowNumber].push(filter);\n return acc;\n },\n {} as Record<number, FilterDetaild[]>,\n );\n\n // Convert to array and sort filters within each row by order\n const rows: FilterRow[] = Object.entries(groupedFilters)\n .map(([rowNumber, filters]) => ({\n rowNumber: Number.parseInt(rowNumber),\n filters: filters,\n }))\n .sort((a, b) => a.rowNumber - b.rowNumber);\n\n return rows;\n}\n\nexport function getFilterWidthClass(width?: string): string {\n switch (width) {\n case 'sm':\n return 'w-full max-w-xs';\n case 'md':\n return 'w-full max-w-sm';\n case 'lg':\n return 'w-full max-w-md';\n case 'xl':\n return 'w-full max-w-lg';\n case 'full':\n return 'w-full';\n case 'auto':\n default:\n return 'w-auto min-w-fit';\n }\n}\n\nexport function getGridColumnsClass(filtersCount: number): string {\n switch (filtersCount) {\n case 1:\n return 'grid-cols-1';\n case 2:\n return 'grid-cols-1 md:grid-cols-2';\n case 3:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3';\n case 4:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-4';\n case 5:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5';\n case 6:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6';\n default:\n return 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4';\n }\n}\n\nexport const parseColumns = (raw: unknown): string[] => {\n if (Array.isArray(raw)) {\n return raw;\n }\n\n if (typeof raw === 'string') {\n try {\n const cleaned = raw\n .trim()\n .replace(/^\"+/, '')\n .replace(/\"+$/, '')\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\+\"/g, '\"')\n .replace(/\\\\\\\\/g, '\\\\');\n\n const parsed = JSON.parse(cleaned);\n\n if (Array.isArray(parsed)) {\n console.log('Parsed columns:', parsed);\n console.log('row:', raw);\n return parsed;\n }\n } catch (err) {\n console.warn('Failed to parse columns string:', raw, err);\n }\n }\n\n return [];\n};\n"],"names":["groupFiltersByRow","filters","groupedFilters","reduce","acc","filter","rowNumber","row","push","rows","Object","entries","map","Number","parseInt","sort","a","b","getFilterWidthClass","width","getGridColumnsClass","filtersCount","parseColumns","raw","Array","isArray","cleaned","trim","replace","parsed","JSON","parse","console","log","err","warn"],"mappings":"AAEA,OAAO,SAASA,kBAAkBC,OAAwB;IACxD,8BAA8B;IAC9B,MAAMC,iBAAiBD,QAAQE,MAAM,CACnC,CAACC,KAAKC;QACJ,MAAMC,YAAYD,OAAOE,GAAG,IAAI;QAChC,IAAI,CAACH,GAAG,CAACE,UAAU,EAAE;YACnBF,GAAG,CAACE,UAAU,GAAG,EAAE;QACrB;QACAF,GAAG,CAACE,UAAU,CAACE,IAAI,CAACH;QACpB,OAAOD;IACT,GACA,CAAC;IAGH,6DAA6D;IAC7D,MAAMK,OAAoBC,OAAOC,OAAO,CAACT,gBACtCU,GAAG,CAAC,CAAC,CAACN,WAAWL,QAAQ,GAAM,CAAA;YAC9BK,WAAWO,OAAOC,QAAQ,CAACR;YAC3BL,SAASA;QACX,CAAA,GACCc,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEV,SAAS,GAAGW,EAAEX,SAAS;IAE3C,OAAOG;AACT;AAEA,OAAO,SAASS,oBAAoBC,KAAc;IAChD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;QACL;YACE,OAAO;IACX;AACF;AAEA,OAAO,SAASC,oBAAoBC,YAAoB;IACtD,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,OAAO,MAAMC,eAAe,CAACC;IAC3B,IAAIC,MAAMC,OAAO,CAACF,MAAM;QACtB,OAAOA;IACT;IAEA,IAAI,OAAOA,QAAQ,UAAU;QAC3B,IAAI;YACF,MAAMG,UAAUH,IACbI,IAAI,GACJC,OAAO,CAAC,OAAO,IACfA,OAAO,CAAC,OAAO,IACfA,OAAO,CAAC,QAAQ,KAChBA,OAAO,CAAC,SAAS,KACjBA,OAAO,CAAC,SAAS;YAEpB,MAAMC,SAASC,KAAKC,KAAK,CAACL;YAE1B,IAAIF,MAAMC,OAAO,CAACI,SAAS;gBACzBG,QAAQC,GAAG,CAAC,mBAAmBJ;gBAC/BG,QAAQC,GAAG,CAAC,QAAQV;gBACpB,OAAOM;YACT;QACF,EAAE,OAAOK,KAAK;YACZF,QAAQG,IAAI,CAAC,mCAAmCZ,KAAKW;QACvD;IACF;IAEA,OAAO,EAAE;AACX,EAAE"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import type { Config } from 'payload';
2
- import { CollectionFilterPluginConfig } from './types';
2
+ export type CollectionFilterPluginConfig = {
3
+ /**
4
+ * List of collections to add filters to
5
+ */
6
+ disabled?: boolean;
7
+ };
3
8
  export declare const CollectionQuickFilterPlugin: (pluginOptions?: CollectionFilterPluginConfig) => (config: Config) => Config;
4
9
  export default CollectionQuickFilterPlugin;
5
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,2BAA2B,mBACtB,4BAA4B,cACnC,MAAM,KAAG,MAuDjB,CAAC;AAEJ,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,2BAA2B,mBACtB,4BAA4B,cACnC,MAAM,KAAG,MAuDjB,CAAC;AAEJ,eAAe,2BAA2B,CAAC"}
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: '@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"}
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,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"}
@@ -0,0 +1,326 @@
1
+ export declare const acceptedLanguages: string[];
2
+ export declare const PLUGIN_LABELS: {
3
+ readonly en: {
4
+ readonly quickFilters: "Quick Filters";
5
+ readonly clearFilters: "Clear Filters";
6
+ readonly activeFilterSingular: "Active filter on column";
7
+ readonly activeFilterPlural: "Active filters on columns";
8
+ readonly custom: "Custom";
9
+ readonly all: "All";
10
+ readonly yes: "Yes";
11
+ readonly no: "No";
12
+ readonly selectOption: "Select Option";
13
+ readonly from: "From";
14
+ readonly to: "To";
15
+ readonly selectDate: "Select Date";
16
+ readonly past: "Past";
17
+ readonly future: "Future";
18
+ readonly customRange: "Custom Range";
19
+ readonly apply: "Apply";
20
+ readonly cancel: "Cancel";
21
+ readonly yesterday: "Yesterday";
22
+ readonly lastWeek: "Last Week";
23
+ readonly lastMonth: "Last Month";
24
+ readonly allPast: "All Past";
25
+ readonly today: "Today";
26
+ readonly nextWeek: "Next Week";
27
+ readonly nextMonth: "Next Month";
28
+ readonly allFuture: "All Future";
29
+ };
30
+ readonly ar: {
31
+ readonly quickFilters: "فلاتر سريعة";
32
+ readonly clearFilters: "مسح الفلاتر";
33
+ readonly activeFilterSingular: "فلتر نشط على العمود";
34
+ readonly activeFilterPlural: "فلاتر نشطة على الأعمدة";
35
+ readonly custom: "مخصص";
36
+ readonly all: "الكل";
37
+ readonly yes: "نعم";
38
+ readonly no: "لا";
39
+ readonly selectOption: "اختر خيارًا";
40
+ readonly from: "من";
41
+ readonly to: "إلى";
42
+ readonly selectDate: "اختر التاريخ";
43
+ readonly past: "الماضي";
44
+ readonly future: "المستقبل";
45
+ readonly customRange: "نطاق مخصص";
46
+ readonly apply: "تطبيق";
47
+ readonly cancel: "إلغاء";
48
+ readonly yesterday: "أمس";
49
+ readonly lastWeek: "الأسبوع الماضي";
50
+ readonly lastMonth: "الشهر الماضي";
51
+ readonly allPast: "كل الماضي";
52
+ readonly today: "اليوم";
53
+ readonly nextWeek: "الأسبوع القادم";
54
+ readonly nextMonth: "الشهر القادم";
55
+ readonly allFuture: "كل المستقبل";
56
+ };
57
+ readonly fr: {
58
+ readonly quickFilters: "Filtres rapides";
59
+ readonly clearFilters: "Effacer les filtres";
60
+ readonly activeFilterSingular: "Filtre actif sur la colonne";
61
+ readonly activeFilterPlural: "Filtres actifs sur les colonnes";
62
+ readonly custom: "Personnalisé";
63
+ readonly all: "Tous";
64
+ readonly yes: "Oui";
65
+ readonly no: "Non";
66
+ readonly selectOption: "Sélectionner une option";
67
+ readonly from: "De";
68
+ readonly to: "À";
69
+ readonly selectDate: "Sélectionner une date";
70
+ readonly past: "Passé";
71
+ readonly future: "Futur";
72
+ readonly customRange: "Plage personnalisée";
73
+ readonly apply: "Appliquer";
74
+ readonly cancel: "Annuler";
75
+ readonly yesterday: "Hier";
76
+ readonly lastWeek: "Semaine dernière";
77
+ readonly lastMonth: "Mois dernier";
78
+ readonly allPast: "Tout le passé";
79
+ readonly today: "Aujourd’hui";
80
+ readonly nextWeek: "Semaine prochaine";
81
+ readonly nextMonth: "Mois prochain";
82
+ readonly allFuture: "Tout le futur";
83
+ };
84
+ readonly es: {
85
+ readonly quickFilters: "Filtros rápidos";
86
+ readonly clearFilters: "Borrar filtros";
87
+ readonly activeFilterSingular: "Filtro activo en la columna";
88
+ readonly activeFilterPlural: "Filtros activos en las columnas";
89
+ readonly custom: "Personalizado";
90
+ readonly all: "Todos";
91
+ readonly yes: "Sí";
92
+ readonly no: "No";
93
+ readonly selectOption: "Seleccionar opción";
94
+ readonly from: "Desde";
95
+ readonly to: "Hasta";
96
+ readonly selectDate: "Seleccionar fecha";
97
+ readonly past: "Pasado";
98
+ readonly future: "Futuro";
99
+ readonly customRange: "Rango personalizado";
100
+ readonly apply: "Aplicar";
101
+ readonly cancel: "Cancelar";
102
+ readonly yesterday: "Ayer";
103
+ readonly lastWeek: "Semana pasada";
104
+ readonly lastMonth: "Mes pasado";
105
+ readonly allPast: "Todo el pasado";
106
+ readonly today: "Hoy";
107
+ readonly nextWeek: "Próxima semana";
108
+ readonly nextMonth: "Próximo mes";
109
+ readonly allFuture: "Todo el futuro";
110
+ };
111
+ readonly zh: {
112
+ readonly quickFilters: "快速筛选";
113
+ readonly clearFilters: "清除筛选";
114
+ readonly activeFilterSingular: "列上激活的筛选";
115
+ readonly activeFilterPlural: "多列上激活的筛选";
116
+ readonly custom: "自定义";
117
+ readonly all: "全部";
118
+ readonly yes: "是";
119
+ readonly no: "否";
120
+ readonly selectOption: "选择选项";
121
+ readonly from: "从";
122
+ readonly to: "到";
123
+ readonly selectDate: "选择日期";
124
+ readonly past: "过去";
125
+ readonly future: "未来";
126
+ readonly customRange: "自定义范围";
127
+ readonly apply: "应用";
128
+ readonly cancel: "取消";
129
+ readonly yesterday: "昨天";
130
+ readonly lastWeek: "上周";
131
+ readonly lastMonth: "上个月";
132
+ readonly allPast: "所有过去";
133
+ readonly today: "今天";
134
+ readonly nextWeek: "下周";
135
+ readonly nextMonth: "下个月";
136
+ readonly allFuture: "所有未来";
137
+ };
138
+ readonly he: {
139
+ readonly quickFilters: "סינון מהיר";
140
+ readonly clearFilters: "נקה סינון";
141
+ readonly activeFilterSingular: "סינון פעיל בעמודה";
142
+ readonly activeFilterPlural: "סינון פעיל בעמודות";
143
+ readonly custom: "מותאם אישית";
144
+ readonly all: "הכל";
145
+ readonly yes: "כן";
146
+ readonly no: "לא";
147
+ readonly selectOption: "בחר אפשרות";
148
+ readonly from: "מתאריך";
149
+ readonly to: "עד תאריך";
150
+ readonly selectDate: "בחר תאריך";
151
+ readonly past: "עבר";
152
+ readonly future: "עתיד";
153
+ readonly customRange: "טווח מותאם אישית";
154
+ readonly apply: "החל";
155
+ readonly cancel: "ביטול";
156
+ readonly yesterday: "אתמול";
157
+ readonly lastWeek: "שבוע שעבר";
158
+ readonly lastMonth: "חודש שעבר";
159
+ readonly allPast: "בעבר";
160
+ readonly today: "היום";
161
+ readonly nextWeek: "השבוע הבא";
162
+ readonly nextMonth: "החודש הבא";
163
+ readonly allFuture: "בעתיד";
164
+ };
165
+ };
166
+ export type SupportedLocale = keyof typeof PLUGIN_LABELS;
167
+ export type LabelKey = keyof typeof PLUGIN_LABELS.en;
168
+ export declare const getLabels: (locale?: SupportedLocale) => {
169
+ readonly quickFilters: "Quick Filters";
170
+ readonly clearFilters: "Clear Filters";
171
+ readonly activeFilterSingular: "Active filter on column";
172
+ readonly activeFilterPlural: "Active filters on columns";
173
+ readonly custom: "Custom";
174
+ readonly all: "All";
175
+ readonly yes: "Yes";
176
+ readonly no: "No";
177
+ readonly selectOption: "Select Option";
178
+ readonly from: "From";
179
+ readonly to: "To";
180
+ readonly selectDate: "Select Date";
181
+ readonly past: "Past";
182
+ readonly future: "Future";
183
+ readonly customRange: "Custom Range";
184
+ readonly apply: "Apply";
185
+ readonly cancel: "Cancel";
186
+ readonly yesterday: "Yesterday";
187
+ readonly lastWeek: "Last Week";
188
+ readonly lastMonth: "Last Month";
189
+ readonly allPast: "All Past";
190
+ readonly today: "Today";
191
+ readonly nextWeek: "Next Week";
192
+ readonly nextMonth: "Next Month";
193
+ readonly allFuture: "All Future";
194
+ } | {
195
+ readonly quickFilters: "فلاتر سريعة";
196
+ readonly clearFilters: "مسح الفلاتر";
197
+ readonly activeFilterSingular: "فلتر نشط على العمود";
198
+ readonly activeFilterPlural: "فلاتر نشطة على الأعمدة";
199
+ readonly custom: "مخصص";
200
+ readonly all: "الكل";
201
+ readonly yes: "نعم";
202
+ readonly no: "لا";
203
+ readonly selectOption: "اختر خيارًا";
204
+ readonly from: "من";
205
+ readonly to: "إلى";
206
+ readonly selectDate: "اختر التاريخ";
207
+ readonly past: "الماضي";
208
+ readonly future: "المستقبل";
209
+ readonly customRange: "نطاق مخصص";
210
+ readonly apply: "تطبيق";
211
+ readonly cancel: "إلغاء";
212
+ readonly yesterday: "أمس";
213
+ readonly lastWeek: "الأسبوع الماضي";
214
+ readonly lastMonth: "الشهر الماضي";
215
+ readonly allPast: "كل الماضي";
216
+ readonly today: "اليوم";
217
+ readonly nextWeek: "الأسبوع القادم";
218
+ readonly nextMonth: "الشهر القادم";
219
+ readonly allFuture: "كل المستقبل";
220
+ } | {
221
+ readonly quickFilters: "Filtres rapides";
222
+ readonly clearFilters: "Effacer les filtres";
223
+ readonly activeFilterSingular: "Filtre actif sur la colonne";
224
+ readonly activeFilterPlural: "Filtres actifs sur les colonnes";
225
+ readonly custom: "Personnalisé";
226
+ readonly all: "Tous";
227
+ readonly yes: "Oui";
228
+ readonly no: "Non";
229
+ readonly selectOption: "Sélectionner une option";
230
+ readonly from: "De";
231
+ readonly to: "À";
232
+ readonly selectDate: "Sélectionner une date";
233
+ readonly past: "Passé";
234
+ readonly future: "Futur";
235
+ readonly customRange: "Plage personnalisée";
236
+ readonly apply: "Appliquer";
237
+ readonly cancel: "Annuler";
238
+ readonly yesterday: "Hier";
239
+ readonly lastWeek: "Semaine dernière";
240
+ readonly lastMonth: "Mois dernier";
241
+ readonly allPast: "Tout le passé";
242
+ readonly today: "Aujourd’hui";
243
+ readonly nextWeek: "Semaine prochaine";
244
+ readonly nextMonth: "Mois prochain";
245
+ readonly allFuture: "Tout le futur";
246
+ } | {
247
+ readonly quickFilters: "Filtros rápidos";
248
+ readonly clearFilters: "Borrar filtros";
249
+ readonly activeFilterSingular: "Filtro activo en la columna";
250
+ readonly activeFilterPlural: "Filtros activos en las columnas";
251
+ readonly custom: "Personalizado";
252
+ readonly all: "Todos";
253
+ readonly yes: "Sí";
254
+ readonly no: "No";
255
+ readonly selectOption: "Seleccionar opción";
256
+ readonly from: "Desde";
257
+ readonly to: "Hasta";
258
+ readonly selectDate: "Seleccionar fecha";
259
+ readonly past: "Pasado";
260
+ readonly future: "Futuro";
261
+ readonly customRange: "Rango personalizado";
262
+ readonly apply: "Aplicar";
263
+ readonly cancel: "Cancelar";
264
+ readonly yesterday: "Ayer";
265
+ readonly lastWeek: "Semana pasada";
266
+ readonly lastMonth: "Mes pasado";
267
+ readonly allPast: "Todo el pasado";
268
+ readonly today: "Hoy";
269
+ readonly nextWeek: "Próxima semana";
270
+ readonly nextMonth: "Próximo mes";
271
+ readonly allFuture: "Todo el futuro";
272
+ } | {
273
+ readonly quickFilters: "快速筛选";
274
+ readonly clearFilters: "清除筛选";
275
+ readonly activeFilterSingular: "列上激活的筛选";
276
+ readonly activeFilterPlural: "多列上激活的筛选";
277
+ readonly custom: "自定义";
278
+ readonly all: "全部";
279
+ readonly yes: "是";
280
+ readonly no: "否";
281
+ readonly selectOption: "选择选项";
282
+ readonly from: "从";
283
+ readonly to: "到";
284
+ readonly selectDate: "选择日期";
285
+ readonly past: "过去";
286
+ readonly future: "未来";
287
+ readonly customRange: "自定义范围";
288
+ readonly apply: "应用";
289
+ readonly cancel: "取消";
290
+ readonly yesterday: "昨天";
291
+ readonly lastWeek: "上周";
292
+ readonly lastMonth: "上个月";
293
+ readonly allPast: "所有过去";
294
+ readonly today: "今天";
295
+ readonly nextWeek: "下周";
296
+ readonly nextMonth: "下个月";
297
+ readonly allFuture: "所有未来";
298
+ } | {
299
+ readonly quickFilters: "סינון מהיר";
300
+ readonly clearFilters: "נקה סינון";
301
+ readonly activeFilterSingular: "סינון פעיל בעמודה";
302
+ readonly activeFilterPlural: "סינון פעיל בעמודות";
303
+ readonly custom: "מותאם אישית";
304
+ readonly all: "הכל";
305
+ readonly yes: "כן";
306
+ readonly no: "לא";
307
+ readonly selectOption: "בחר אפשרות";
308
+ readonly from: "מתאריך";
309
+ readonly to: "עד תאריך";
310
+ readonly selectDate: "בחר תאריך";
311
+ readonly past: "עבר";
312
+ readonly future: "עתיד";
313
+ readonly customRange: "טווח מותאם אישית";
314
+ readonly apply: "החל";
315
+ readonly cancel: "ביטול";
316
+ readonly yesterday: "אתמול";
317
+ readonly lastWeek: "שבוע שעבר";
318
+ readonly lastMonth: "חודש שעבר";
319
+ readonly allPast: "בעבר";
320
+ readonly today: "היום";
321
+ readonly nextWeek: "השבוע הבא";
322
+ readonly nextMonth: "החודש הבא";
323
+ readonly allFuture: "בעתיד";
324
+ };
325
+ export declare const getLabel: (key: LabelKey, locale?: SupportedLocale) => string;
326
+ //# sourceMappingURL=labels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"labels.d.ts","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,UAAuC,CAAC;AAEtE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqKhB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,aAAa,CAAC;AACzD,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,aAAa,CAAC,EAAE,CAAC;AAGrD,eAAO,MAAM,SAAS,YAAY,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEhD,CAAC;AAGF,eAAO,MAAM,QAAQ,QAAS,QAAQ,WAAU,eAAe,KAAU,MAaxE,CAAC"}
package/dist/labels.js ADDED
@@ -0,0 +1,192 @@
1
+ // Centralized labels for the quickfilter plugin
2
+ // List of all accepted languages in the system - only those defined in PLUGIN_LABELS
3
+ export const acceptedLanguages = [
4
+ 'ar',
5
+ 'en',
6
+ 'es',
7
+ 'fr',
8
+ 'he',
9
+ 'zh'
10
+ ];
11
+ export const PLUGIN_LABELS = {
12
+ en: {
13
+ quickFilters: 'Quick Filters',
14
+ clearFilters: 'Clear Filters',
15
+ activeFilterSingular: 'Active filter on column',
16
+ activeFilterPlural: 'Active filters on columns',
17
+ custom: 'Custom',
18
+ all: 'All',
19
+ yes: 'Yes',
20
+ no: 'No',
21
+ selectOption: 'Select Option',
22
+ from: 'From',
23
+ to: 'To',
24
+ selectDate: 'Select Date',
25
+ past: 'Past',
26
+ future: 'Future',
27
+ customRange: 'Custom Range',
28
+ apply: 'Apply',
29
+ cancel: 'Cancel',
30
+ yesterday: 'Yesterday',
31
+ lastWeek: 'Last Week',
32
+ lastMonth: 'Last Month',
33
+ allPast: 'All Past',
34
+ today: 'Today',
35
+ nextWeek: 'Next Week',
36
+ nextMonth: 'Next Month',
37
+ allFuture: 'All Future'
38
+ },
39
+ ar: {
40
+ quickFilters: 'فلاتر سريعة',
41
+ clearFilters: 'مسح الفلاتر',
42
+ activeFilterSingular: 'فلتر نشط على العمود',
43
+ activeFilterPlural: 'فلاتر نشطة على الأعمدة',
44
+ custom: 'مخصص',
45
+ all: 'الكل',
46
+ yes: 'نعم',
47
+ no: 'لا',
48
+ selectOption: 'اختر خيارًا',
49
+ from: 'من',
50
+ to: 'إلى',
51
+ selectDate: 'اختر التاريخ',
52
+ past: 'الماضي',
53
+ future: 'المستقبل',
54
+ customRange: 'نطاق مخصص',
55
+ apply: 'تطبيق',
56
+ cancel: 'إلغاء',
57
+ yesterday: 'أمس',
58
+ lastWeek: 'الأسبوع الماضي',
59
+ lastMonth: 'الشهر الماضي',
60
+ allPast: 'كل الماضي',
61
+ today: 'اليوم',
62
+ nextWeek: 'الأسبوع القادم',
63
+ nextMonth: 'الشهر القادم',
64
+ allFuture: 'كل المستقبل'
65
+ },
66
+ fr: {
67
+ quickFilters: 'Filtres rapides',
68
+ clearFilters: 'Effacer les filtres',
69
+ activeFilterSingular: 'Filtre actif sur la colonne',
70
+ activeFilterPlural: 'Filtres actifs sur les colonnes',
71
+ custom: 'Personnalisé',
72
+ all: 'Tous',
73
+ yes: 'Oui',
74
+ no: 'Non',
75
+ selectOption: 'Sélectionner une option',
76
+ from: 'De',
77
+ to: 'À',
78
+ selectDate: 'Sélectionner une date',
79
+ past: 'Passé',
80
+ future: 'Futur',
81
+ customRange: 'Plage personnalisée',
82
+ apply: 'Appliquer',
83
+ cancel: 'Annuler',
84
+ yesterday: 'Hier',
85
+ lastWeek: 'Semaine dernière',
86
+ lastMonth: 'Mois dernier',
87
+ allPast: 'Tout le passé',
88
+ today: 'Aujourd’hui',
89
+ nextWeek: 'Semaine prochaine',
90
+ nextMonth: 'Mois prochain',
91
+ allFuture: 'Tout le futur'
92
+ },
93
+ es: {
94
+ quickFilters: 'Filtros rápidos',
95
+ clearFilters: 'Borrar filtros',
96
+ activeFilterSingular: 'Filtro activo en la columna',
97
+ activeFilterPlural: 'Filtros activos en las columnas',
98
+ custom: 'Personalizado',
99
+ all: 'Todos',
100
+ yes: 'Sí',
101
+ no: 'No',
102
+ selectOption: 'Seleccionar opción',
103
+ from: 'Desde',
104
+ to: 'Hasta',
105
+ selectDate: 'Seleccionar fecha',
106
+ past: 'Pasado',
107
+ future: 'Futuro',
108
+ customRange: 'Rango personalizado',
109
+ apply: 'Aplicar',
110
+ cancel: 'Cancelar',
111
+ yesterday: 'Ayer',
112
+ lastWeek: 'Semana pasada',
113
+ lastMonth: 'Mes pasado',
114
+ allPast: 'Todo el pasado',
115
+ today: 'Hoy',
116
+ nextWeek: 'Próxima semana',
117
+ nextMonth: 'Próximo mes',
118
+ allFuture: 'Todo el futuro'
119
+ },
120
+ zh: {
121
+ quickFilters: '快速筛选',
122
+ clearFilters: '清除筛选',
123
+ activeFilterSingular: '列上激活的筛选',
124
+ activeFilterPlural: '多列上激活的筛选',
125
+ custom: '自定义',
126
+ all: '全部',
127
+ yes: '是',
128
+ no: '否',
129
+ selectOption: '选择选项',
130
+ from: '从',
131
+ to: '到',
132
+ selectDate: '选择日期',
133
+ past: '过去',
134
+ future: '未来',
135
+ customRange: '自定义范围',
136
+ apply: '应用',
137
+ cancel: '取消',
138
+ yesterday: '昨天',
139
+ lastWeek: '上周',
140
+ lastMonth: '上个月',
141
+ allPast: '所有过去',
142
+ today: '今天',
143
+ nextWeek: '下周',
144
+ nextMonth: '下个月',
145
+ allFuture: '所有未来'
146
+ },
147
+ he: {
148
+ quickFilters: 'סינון מהיר',
149
+ clearFilters: 'נקה סינון',
150
+ activeFilterSingular: 'סינון פעיל בעמודה',
151
+ activeFilterPlural: 'סינון פעיל בעמודות',
152
+ custom: 'מותאם אישית',
153
+ all: 'הכל',
154
+ yes: 'כן',
155
+ no: 'לא',
156
+ selectOption: 'בחר אפשרות',
157
+ from: 'מתאריך',
158
+ to: 'עד תאריך',
159
+ selectDate: 'בחר תאריך',
160
+ past: 'עבר',
161
+ future: 'עתיד',
162
+ customRange: 'טווח מותאם אישית',
163
+ apply: 'החל',
164
+ cancel: 'ביטול',
165
+ yesterday: 'אתמול',
166
+ lastWeek: 'שבוע שעבר',
167
+ lastMonth: 'חודש שעבר',
168
+ allPast: 'בעבר',
169
+ today: 'היום',
170
+ nextWeek: 'השבוע הבא',
171
+ nextMonth: 'החודש הבא',
172
+ allFuture: 'בעתיד'
173
+ }
174
+ };
175
+ // Helper function to get labels for a specific locale
176
+ export const getLabels = (locale = 'en')=>{
177
+ return PLUGIN_LABELS[locale] || PLUGIN_LABELS.en;
178
+ };
179
+ // Helper function to get a specific label
180
+ export const getLabel = (key, locale = 'en')=>{
181
+ const labels = getLabels(locale);
182
+ const value = labels[key];
183
+ if (typeof value === 'string') {
184
+ return value;
185
+ }
186
+ // Fallback to English if not found
187
+ const fallbackLabels = getLabels('en');
188
+ const fallbackValue = fallbackLabels[key];
189
+ return typeof fallbackValue === 'string' ? fallbackValue : String(key);
190
+ };
191
+
192
+ //# sourceMappingURL=labels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/labels.ts"],"sourcesContent":["// Centralized labels for the quickfilter plugin\n\n// List of all accepted languages in the system - only those defined in PLUGIN_LABELS\nexport const acceptedLanguages = ['ar', 'en', 'es', 'fr', 'he', 'zh'];\n\nexport const PLUGIN_LABELS = {\n en: {\n quickFilters: 'Quick Filters',\n clearFilters: 'Clear Filters',\n activeFilterSingular: 'Active filter on column',\n activeFilterPlural: 'Active filters on columns',\n custom: 'Custom',\n all: 'All',\n yes: 'Yes',\n no: 'No',\n selectOption: 'Select Option',\n from: 'From',\n to: 'To',\n selectDate: 'Select Date',\n past: 'Past',\n future: 'Future',\n customRange: 'Custom Range',\n apply: 'Apply',\n cancel: 'Cancel',\n yesterday: 'Yesterday',\n lastWeek: 'Last Week',\n lastMonth: 'Last Month',\n allPast: 'All Past',\n today: 'Today',\n nextWeek: 'Next Week', // Corrected from 'This Week'\n nextMonth: 'Next Month', // Corrected from 'This Month'\n allFuture: 'All Future',\n },\n ar: {\n quickFilters: 'فلاتر سريعة',\n clearFilters: 'مسح الفلاتر',\n activeFilterSingular: 'فلتر نشط على العمود',\n activeFilterPlural: 'فلاتر نشطة على الأعمدة',\n custom: 'مخصص',\n all: 'الكل',\n yes: 'نعم',\n no: 'لا',\n selectOption: 'اختر خيارًا',\n from: 'من',\n to: 'إلى',\n selectDate: 'اختر التاريخ',\n past: 'الماضي',\n future: 'المستقبل',\n customRange: 'نطاق مخصص',\n apply: 'تطبيق',\n cancel: 'إلغاء',\n yesterday: 'أمس',\n lastWeek: 'الأسبوع الماضي',\n lastMonth: 'الشهر الماضي',\n allPast: 'كل الماضي',\n today: 'اليوم',\n nextWeek: 'الأسبوع القادم',\n nextMonth: 'الشهر القادم',\n allFuture: 'كل المستقبل',\n },\n fr: {\n quickFilters: 'Filtres rapides',\n clearFilters: 'Effacer les filtres',\n activeFilterSingular: 'Filtre actif sur la colonne',\n activeFilterPlural: 'Filtres actifs sur les colonnes',\n custom: 'Personnalisé',\n all: 'Tous',\n yes: 'Oui',\n no: 'Non',\n selectOption: 'Sélectionner une option',\n from: 'De',\n to: 'À',\n selectDate: 'Sélectionner une date',\n past: 'Passé',\n future: 'Futur',\n customRange: 'Plage personnalisée',\n apply: 'Appliquer',\n cancel: 'Annuler',\n yesterday: 'Hier',\n lastWeek: 'Semaine dernière',\n lastMonth: 'Mois dernier',\n allPast: 'Tout le passé',\n today: 'Aujourd’hui',\n nextWeek: 'Semaine prochaine',\n nextMonth: 'Mois prochain',\n allFuture: 'Tout le futur',\n },\n es: {\n quickFilters: 'Filtros rápidos',\n clearFilters: 'Borrar filtros',\n activeFilterSingular: 'Filtro activo en la columna',\n activeFilterPlural: 'Filtros activos en las columnas',\n custom: 'Personalizado',\n all: 'Todos',\n yes: 'Sí',\n no: 'No',\n selectOption: 'Seleccionar opción',\n from: 'Desde',\n to: 'Hasta',\n selectDate: 'Seleccionar fecha',\n past: 'Pasado',\n future: 'Futuro',\n customRange: 'Rango personalizado',\n apply: 'Aplicar',\n cancel: 'Cancelar',\n yesterday: 'Ayer',\n lastWeek: 'Semana pasada',\n lastMonth: 'Mes pasado',\n allPast: 'Todo el pasado',\n today: 'Hoy',\n nextWeek: 'Próxima semana',\n nextMonth: 'Próximo mes',\n allFuture: 'Todo el futuro',\n },\n zh: {\n quickFilters: '快速筛选',\n clearFilters: '清除筛选',\n activeFilterSingular: '列上激活的筛选',\n activeFilterPlural: '多列上激活的筛选',\n custom: '自定义',\n all: '全部',\n yes: '是',\n no: '否',\n selectOption: '选择选项',\n from: '从',\n to: '到',\n selectDate: '选择日期',\n past: '过去',\n future: '未来',\n customRange: '自定义范围',\n apply: '应用',\n cancel: '取消',\n yesterday: '昨天',\n lastWeek: '上周',\n lastMonth: '上个月',\n allPast: '所有过去',\n today: '今天',\n nextWeek: '下周',\n nextMonth: '下个月',\n allFuture: '所有未来',\n },\n he: {\n quickFilters: 'סינון מהיר',\n clearFilters: 'נקה סינון',\n activeFilterSingular: 'סינון פעיל בעמודה',\n activeFilterPlural: 'סינון פעיל בעמודות',\n custom: 'מותאם אישית',\n all: 'הכל',\n yes: 'כן',\n no: 'לא',\n selectOption: 'בחר אפשרות',\n from: 'מתאריך',\n to: 'עד תאריך',\n selectDate: 'בחר תאריך',\n past: 'עבר',\n future: 'עתיד',\n customRange: 'טווח מותאם אישית',\n apply: 'החל',\n cancel: 'ביטול',\n yesterday: 'אתמול',\n lastWeek: 'שבוע שעבר',\n lastMonth: 'חודש שעבר',\n allPast: 'בעבר',\n today: 'היום',\n nextWeek: 'השבוע הבא', // Corrected from 'השבוע'\n nextMonth: 'החודש הבא', // Corrected from 'החודש'\n allFuture: 'בעתיד',\n },\n // Placeholder for other languages (az, bg, bn-BD, etc.)\n // These can be structured similarly with proper translations\n} as const;\nexport type SupportedLocale = keyof typeof PLUGIN_LABELS;\nexport type LabelKey = keyof typeof PLUGIN_LABELS.en;\n\n// Helper function to get labels for a specific locale\nexport const getLabels = (locale: SupportedLocale = 'en') => {\n return PLUGIN_LABELS[locale] || PLUGIN_LABELS.en;\n};\n\n// Helper function to get a specific label\nexport const getLabel = (key: LabelKey, locale: SupportedLocale = 'en'): string => {\n const labels = getLabels(locale);\n const value = labels[key as keyof typeof labels];\n\n if (typeof value === 'string') {\n return value;\n }\n\n // Fallback to English if not found\n const fallbackLabels = getLabels('en');\n const fallbackValue = fallbackLabels[key];\n\n return typeof fallbackValue === 'string' ? fallbackValue : String(key);\n};\n"],"names":["acceptedLanguages","PLUGIN_LABELS","en","quickFilters","clearFilters","activeFilterSingular","activeFilterPlural","custom","all","yes","no","selectOption","from","to","selectDate","past","future","customRange","apply","cancel","yesterday","lastWeek","lastMonth","allPast","today","nextWeek","nextMonth","allFuture","ar","fr","es","zh","he","getLabels","locale","getLabel","key","labels","value","fallbackLabels","fallbackValue","String"],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shefing/quickfilter",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "private": false,
5
5
  "bugs": "https://github.com/shefing/payload-tools/issues",
6
6
  "repository": "https://github.com/shefing/payload-tools",