sprintify-ui 0.7.9 → 0.7.10

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.
@@ -76,6 +76,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
76
76
  default: boolean;
77
77
  type: BooleanConstructor;
78
78
  };
79
+ /**
80
+ * Filters position
81
+ */
82
+ filtersPosition: {
83
+ default: string;
84
+ type: PropType<"section" | "top">;
85
+ };
79
86
  }, {
80
87
  fetch: () => void;
81
88
  fetchWithLoading: () => void;
@@ -171,6 +178,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
171
178
  default: boolean;
172
179
  type: BooleanConstructor;
173
180
  };
181
+ /**
182
+ * Filters position
183
+ */
184
+ filtersPosition: {
185
+ default: string;
186
+ type: PropType<"section" | "top">;
187
+ };
174
188
  }>> & {
175
189
  onClick?: ((...args: any[]) => any) | undefined;
176
190
  onDelete?: ((...args: any[]) => any) | undefined;
@@ -190,6 +204,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
190
204
  layout: "default" | "compact";
191
205
  sections: DataIteratorSection[];
192
206
  scrollTopOnFetch: boolean;
207
+ filtersPosition: "section" | "top";
193
208
  }, {}>, Partial<Record<string, (_: {
194
209
  query: {
195
210
  [x: string]: any;
@@ -210,6 +225,16 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
210
225
  };
211
226
  updateQuery: (newQuery: DataTableQuery) => void;
212
227
  updateQueryValue: (key: string, value: any) => void;
228
+ }) => any>> & Partial<Record<string, (_: {
229
+ query: {
230
+ [x: string]: any;
231
+ page?: number | undefined;
232
+ sort?: string | undefined;
233
+ search?: string | undefined;
234
+ filter?: Record<string, any> | undefined;
235
+ };
236
+ updateQuery: (newQuery: DataTableQuery) => void;
237
+ updateQueryValue: (key: string, value: any) => void;
213
238
  }) => any>> & {
214
239
  default?(_: {
215
240
  items: Collection;
@@ -186,6 +186,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
186
186
  default: boolean;
187
187
  type: BooleanConstructor;
188
188
  };
189
+ filtersPosition: {
190
+ default: string;
191
+ type: PropType<"section" | "top">;
192
+ };
189
193
  }, {
190
194
  fetch: typeof fetch;
191
195
  fetchWithoutLoading: typeof fetchWithoutLoading;
@@ -377,6 +381,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
377
381
  default: boolean;
378
382
  type: BooleanConstructor;
379
383
  };
384
+ filtersPosition: {
385
+ default: string;
386
+ type: PropType<"section" | "top">;
387
+ };
380
388
  }>> & {
381
389
  onDelete?: ((...args: any[]) => any) | undefined;
382
390
  "onUpdate:checked-rows"?: ((...args: any[]) => any) | undefined;
@@ -392,6 +400,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
392
400
  layout: "default" | "compact";
393
401
  sections: DataIteratorSection[];
394
402
  scrollTopOnFetch: boolean;
403
+ filtersPosition: "section" | "top";
395
404
  showUrl: ((row: CollectionItem) => RouteLocationRaw) | undefined;
396
405
  editButton: boolean;
397
406
  editUrl: ((row: CollectionItem) => RouteLocationRaw) | undefined;
@@ -7,7 +7,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
7
7
  };
8
8
  placement: {
9
9
  default: string;
10
- type: PropType<"bottom-end" | "bottom-start" | "bottom" | "top" | "top-start" | "top-end">;
10
+ type: PropType<"top" | "bottom-end" | "bottom-start" | "bottom" | "top-start" | "top-end">;
11
11
  };
12
12
  size: {
13
13
  default: string;
@@ -32,7 +32,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
32
32
  };
33
33
  placement: {
34
34
  default: string;
35
- type: PropType<"bottom-end" | "bottom-start" | "bottom" | "top" | "top-start" | "top-end">;
35
+ type: PropType<"top" | "bottom-end" | "bottom-start" | "bottom" | "top-start" | "top-end">;
36
36
  };
37
37
  size: {
38
38
  default: string;
@@ -54,7 +54,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
54
54
  size: "xs" | "sm" | "md";
55
55
  twButton: string | unknown[] | Record<string, any>;
56
56
  items: ActionItem[];
57
- placement: "bottom-end" | "bottom-start" | "bottom" | "top" | "top-start" | "top-end";
57
+ placement: "top" | "bottom-end" | "bottom-start" | "bottom" | "top-start" | "top-end";
58
58
  width: number;
59
59
  twMenu: string | string[];
60
60
  }, {}>, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.7.9",
3
+ "version": "0.7.10",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -12,7 +12,11 @@ export default {
12
12
  size: {
13
13
  control: { type: 'select' },
14
14
  options: sizes,
15
- }
15
+ },
16
+ filtersPosition: {
17
+ control: { type: 'select' },
18
+ options: ['top', 'section'],
19
+ },
16
20
  },
17
21
  args: {
18
22
  url: 'https://effettandem.com/api/content/articles',
@@ -68,6 +68,24 @@
68
68
  </BaseMenu>
69
69
  </div>
70
70
 
71
+ <div
72
+ v-if="filtersPosition == 'top' && hasFilters"
73
+ :class="{
74
+ 'mb-2.5': sizeInternal.size.value == 'sm',
75
+ 'mb-4': sizeInternal.size.value == 'md',
76
+ }"
77
+ >
78
+ <BaseDataIteratorSectionBox :section="sectionFilter">
79
+ <slot
80
+ :name="sectionFilter.name"
81
+ :query="query"
82
+ :update-query="updateFilterQuery"
83
+ :update-query-value="updateFilterQueryValue"
84
+ />
85
+ </BaseDataIteratorSectionBox>
86
+ </div>
87
+
88
+
71
89
  <slot
72
90
  :items="items"
73
91
  :loading="loading"
@@ -286,6 +304,14 @@ const props = defineProps({
286
304
  default: true,
287
305
  type: Boolean,
288
306
  },
307
+
308
+ /**
309
+ * Filters position
310
+ */
311
+ filtersPosition: {
312
+ default: 'section',
313
+ type: String as PropType<'section' | 'top'>,
314
+ }
289
315
  });
290
316
 
291
317
  const http = config.http;
@@ -745,18 +771,22 @@ onMounted(() => {
745
771
 
746
772
  const sectionModalActive = ref<null | number>(null);
747
773
 
774
+ const sectionFilter = computed(() => {
775
+ return {
776
+ name: 'filters',
777
+ title: t('sui.filters'),
778
+ closeText: t('sui.apply_filters'),
779
+ icon: 'heroicons:funnel',
780
+ opened: true,
781
+ };
782
+ });
783
+
748
784
  const sectionsInternal = computed<DataIteratorSection[]>(() => {
749
785
  const sections = props.sections ?? [];
750
786
 
751
- if (hasFilters.value) {
787
+ if (hasFilters.value && props.filtersPosition == 'section') {
752
788
  return [
753
- {
754
- name: 'filters',
755
- title: t('sui.filters'),
756
- closeText: t('sui.apply_filters'),
757
- icon: 'heroicons:funnel',
758
- opened: true,
759
- },
789
+ sectionFilter.value,
760
790
  ...sections,
761
791
  ];
762
792
  }
@@ -20,7 +20,11 @@ export default {
20
20
  size: {
21
21
  control: { type: 'select' },
22
22
  options: ['sm', 'md'],
23
- }
23
+ },
24
+ filtersPosition: {
25
+ control: { type: 'select' },
26
+ options: ['top', 'section'],
27
+ },
24
28
  },
25
29
  args: {
26
30
  url: 'https://effettandem.com/api/content/articles',
@@ -11,6 +11,7 @@
11
11
  :size="sizeInternal.size.value"
12
12
  :sections="sectionsInternal"
13
13
  :scroll-top-on-fetch="maxHeight ? false : scrollTopOnFetch"
14
+ :filters-position="filtersPosition"
14
15
  @fetch="onFetch"
15
16
  @will-scroll-top="onWillScrollTop"
16
17
  >
@@ -487,6 +488,11 @@ const props = defineProps({
487
488
  default: true,
488
489
  type: Boolean,
489
490
  },
491
+
492
+ filtersPosition: {
493
+ default: 'section',
494
+ type: String as PropType<'top' | 'section'>,
495
+ },
490
496
  });
491
497
 
492
498
  const sizeInternal = useInputSize(props.size);