@shefing/quickfilter 1.0.10 → 1.0.12

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 (44) hide show
  1. package/README.md +873 -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 +11 -29
  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 +1 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/labels.d.ts +326 -0
  41. package/dist/labels.d.ts.map +1 -0
  42. package/dist/labels.js +192 -0
  43. package/dist/labels.js.map +1 -0
  44. package/package.json +1 -1
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":"AAAA,gDAAgD;AAEhD,qFAAqF;AACrF,OAAO,MAAMA,oBAAoB;IAAC;IAAM;IAAM;IAAM;IAAM;IAAM;CAAK,CAAC;AAEtE,OAAO,MAAMC,gBAAgB;IAC3BC,IAAI;QACFC,cAAc;QACdC,cAAc;QACdC,sBAAsB;QACtBC,oBAAoB;QACpBC,QAAQ;QACRC,KAAK;QACLC,KAAK;QACLC,IAAI;QACJC,cAAc;QACdC,MAAM;QACNC,IAAI;QACJC,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,aAAa;QACbC,OAAO;QACPC,QAAQ;QACRC,WAAW;QACXC,UAAU;QACVC,WAAW;QACXC,SAAS;QACTC,OAAO;QACPC,UAAU;QACVC,WAAW;QACXC,WAAW;IACb;IACAC,IAAI;QACFzB,cAAc;QACdC,cAAc;QACdC,sBAAsB;QACtBC,oBAAoB;QACpBC,QAAQ;QACRC,KAAK;QACLC,KAAK;QACLC,IAAI;QACJC,cAAc;QACdC,MAAM;QACNC,IAAI;QACJC,YAAY;QACZC,MAAM;QACNC,QAAQ;QACRC,aAAa;QACbC,OAAO;QACPC,QAAQ;QACRC,WAAW;QACXC,UAAU;QACVC,WAAW;QACXC,SAAS;QACTC,OAAO;QACPC,UAAU;QACVC,WAAW;QACXC,WAAW;IACb;IACAE,IAAI;QACF1B,cAAc;QACdC,cAAc;QACdC,sBAAsB;QACtBC,oBAAoB;QACpBC,QAAQ;QACRC,KAAK;QACLC,KAAK;QACLC,IAAI;QACJC,cAAc;QACdC,M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,CAACC,SAA0B,IAAI;IACtD,OAAOjC,aAAa,CAACiC,OAAO,IAAIjC,cAAcC,EAAE;AAClD,EAAE;AAEF,0CAA0C;AAC1C,OAAO,MAAMiC,WAAW,CAACC,KAAeF,SAA0B,IAAI;IACpE,MAAMG,SAASJ,UAAUC;IACzB,MAAMI,QAAQD,MAAM,CAACD,IAA2B;IAEhD,IAAI,OAAOE,UAAU,UAAU;QAC7B,OAAOA;IACT;IAEA,mCAAmC;IACnC,MAAMC,iBAAiBN,UAAU;IACjC,MAAMO,gBAAgBD,cAAc,CAACH,IAAI;IAEzC,OAAO,OAAOI,kBAAkB,WAAWA,gBAAgBC,OAAOL;AACpE,EAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shefing/quickfilter",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "private": false,
5
5
  "bugs": "https://github.com/shefing/payload-tools/issues",
6
6
  "repository": "https://github.com/shefing/payload-tools",