sprintify-ui 0.7.9 → 0.7.11
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/sprintify-ui.es.js +5409 -5366
- package/dist/types/components/BaseAppDialogs.vue.d.ts +1 -0
- package/dist/types/components/BaseDataIterator.vue.d.ts +25 -0
- package/dist/types/components/BaseDataTable.vue.d.ts +9 -0
- package/dist/types/components/BaseDialog.vue.d.ts +9 -0
- package/dist/types/components/BaseMenu.vue.d.ts +3 -3
- package/dist/types/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/BaseAppDialogs.vue +1 -0
- package/src/components/BaseDataIterator.stories.js +5 -1
- package/src/components/BaseDataIterator.vue +38 -8
- package/src/components/BaseDataTable.stories.js +5 -1
- package/src/components/BaseDataTable.vue +6 -0
- package/src/components/BaseDialog.stories.js +7 -0
- package/src/components/BaseDialog.vue +13 -1
- package/src/stores/dialogs.ts +1 -0
- package/src/types/index.ts +2 -0
|
@@ -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;
|
|
@@ -12,6 +12,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
12
12
|
default: string;
|
|
13
13
|
type: StringConstructor;
|
|
14
14
|
};
|
|
15
|
+
html: {
|
|
16
|
+
default: boolean;
|
|
17
|
+
type: BooleanConstructor;
|
|
18
|
+
};
|
|
15
19
|
confirmText: {
|
|
16
20
|
default(): string;
|
|
17
21
|
type: StringConstructor;
|
|
@@ -36,6 +40,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
36
40
|
default: string;
|
|
37
41
|
type: StringConstructor;
|
|
38
42
|
};
|
|
43
|
+
html: {
|
|
44
|
+
default: boolean;
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
};
|
|
39
47
|
confirmText: {
|
|
40
48
|
default(): string;
|
|
41
49
|
type: StringConstructor;
|
|
@@ -50,6 +58,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
50
58
|
}, {
|
|
51
59
|
title: string;
|
|
52
60
|
message: string;
|
|
61
|
+
html: boolean;
|
|
53
62
|
confirmText: string;
|
|
54
63
|
cancelText: string;
|
|
55
64
|
}, {}>, {
|
|
@@ -7,7 +7,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
7
7
|
};
|
|
8
8
|
placement: {
|
|
9
9
|
default: string;
|
|
10
|
-
type: PropType<"
|
|
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<"
|
|
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: "
|
|
57
|
+
placement: "top" | "bottom-end" | "bottom-start" | "bottom" | "top-start" | "top-end";
|
|
58
58
|
width: number;
|
|
59
59
|
twMenu: string | string[];
|
|
60
60
|
}, {}>, {
|
|
@@ -116,6 +116,7 @@ export interface DialogOptions {
|
|
|
116
116
|
color?: 'info' | 'success' | 'danger' | 'warning';
|
|
117
117
|
title: string;
|
|
118
118
|
message: string;
|
|
119
|
+
html?: boolean;
|
|
119
120
|
confirmText?: string;
|
|
120
121
|
cancelText?: string;
|
|
121
122
|
closeOnOutsideClick?: boolean;
|
|
@@ -127,6 +128,7 @@ export interface Dialog {
|
|
|
127
128
|
color: 'info' | 'success' | 'danger' | 'warning';
|
|
128
129
|
title: string;
|
|
129
130
|
message: string;
|
|
131
|
+
html: boolean;
|
|
130
132
|
confirmText: string;
|
|
131
133
|
cancelText: string;
|
|
132
134
|
closeOnOutsideClick: boolean;
|
package/package.json
CHANGED
|
@@ -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);
|
|
@@ -34,6 +34,13 @@ Demo.args = {
|
|
|
34
34
|
title: 'Be careful',
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
export const Html = Template.bind({});
|
|
38
|
+
Html.args = {
|
|
39
|
+
title: 'Be careful',
|
|
40
|
+
message: '<strong>HTML</strong> is allowed. <a href="#">Link</a><p>Eiusmod id Lorem est ullamco et ex exercitation cupidatat do velit nisi Lorem officia et.</p>',
|
|
41
|
+
html: true,
|
|
42
|
+
};
|
|
43
|
+
|
|
37
44
|
const ColorsTemplate = (args) => ({
|
|
38
45
|
components: { BaseDialog },
|
|
39
46
|
setup() {
|
|
@@ -42,7 +42,15 @@
|
|
|
42
42
|
{{ title }}
|
|
43
43
|
</h3>
|
|
44
44
|
<div class="mt-2">
|
|
45
|
-
<
|
|
45
|
+
<div
|
|
46
|
+
v-if="html"
|
|
47
|
+
class="text-slate-500 prose-sm prose-p:leading-snug prose-a:text-blue-600 prose-a:underline"
|
|
48
|
+
v-html="message"
|
|
49
|
+
/>
|
|
50
|
+
<p
|
|
51
|
+
v-else
|
|
52
|
+
class="text-sm text-slate-500"
|
|
53
|
+
>
|
|
46
54
|
{{ message }}
|
|
47
55
|
</p>
|
|
48
56
|
</div>
|
|
@@ -91,6 +99,10 @@ defineProps({
|
|
|
91
99
|
default: '',
|
|
92
100
|
type: String,
|
|
93
101
|
},
|
|
102
|
+
html: {
|
|
103
|
+
default: false,
|
|
104
|
+
type: Boolean,
|
|
105
|
+
},
|
|
94
106
|
confirmText: {
|
|
95
107
|
default() {
|
|
96
108
|
return t('sui.confirm');
|
package/src/stores/dialogs.ts
CHANGED
|
@@ -17,6 +17,7 @@ export const useDialogsStore = defineStore('dialogs', {
|
|
|
17
17
|
color: options.color ?? 'info',
|
|
18
18
|
title: options.title,
|
|
19
19
|
message: options.message,
|
|
20
|
+
html: options.html ?? false,
|
|
20
21
|
confirmText: options.confirmText ?? t('sui.confirm'),
|
|
21
22
|
cancelText: options.cancelText ?? t('sui.cancel'),
|
|
22
23
|
closeOnOutsideClick: options.closeOnOutsideClick ?? true,
|
package/src/types/index.ts
CHANGED
|
@@ -150,6 +150,7 @@ export interface DialogOptions {
|
|
|
150
150
|
color?: 'info' | 'success' | 'danger' | 'warning';
|
|
151
151
|
title: string;
|
|
152
152
|
message: string;
|
|
153
|
+
html?: boolean;
|
|
153
154
|
confirmText?: string;
|
|
154
155
|
cancelText?: string;
|
|
155
156
|
closeOnOutsideClick?: boolean;
|
|
@@ -162,6 +163,7 @@ export interface Dialog {
|
|
|
162
163
|
color: 'info' | 'success' | 'danger' | 'warning';
|
|
163
164
|
title: string;
|
|
164
165
|
message: string;
|
|
166
|
+
html: boolean;
|
|
165
167
|
confirmText: string;
|
|
166
168
|
cancelText: string;
|
|
167
169
|
closeOnOutsideClick: boolean;
|