sprintify-ui 0.6.34 → 0.6.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/sprintify-ui.es.js +15345 -15302
- package/dist/style.css +1 -1
- package/dist/tailwindcss/button.js +2 -2
- package/dist/tailwindcss/theme.js +14 -7
- package/dist/types/src/components/BaseButtonGroup.vue.d.ts +9 -0
- package/dist/types/src/components/BaseDataIterator.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDataIteratorSectionButton.vue.d.ts +2 -2
- package/dist/types/src/components/BaseDataIteratorSectionColumns.vue.d.ts +8 -8
- package/dist/types/src/components/BaseDataTable.vue.d.ts +3 -3
- package/dist/types/src/components/BaseDataTableRowAction.vue.d.ts +4 -3
- package/dist/types/src/components/BaseDatePicker.vue.d.ts +10 -0
- package/dist/types/src/components/BaseDateSelect.vue.d.ts +9 -0
- package/dist/types/src/components/BaseRichText.vue.d.ts +9 -0
- package/dist/types/src/components/BaseTable.vue.d.ts +3 -3
- package/dist/types/src/components/BaseTagAutocomplete.vue.d.ts +11 -2
- package/dist/types/src/components/BaseTextareaAutoresize.vue.d.ts +3 -2
- package/dist/types/src/components/BaseTimeline.vue.d.ts +1 -1
- package/dist/types/src/components/BaseTimelineItem.vue.d.ts +1 -1
- package/dist/types/src/stories/PageInputSizes.vue.d.ts +2 -0
- package/dist/types/src/types/TimelineItem.d.ts +0 -9
- package/dist/types/src/types/index.d.ts +9 -0
- package/dist/types/src/utils/slots.d.ts +1 -0
- package/package.json +1 -1
- package/src/assets/base-rich-text.css +148 -26
- package/src/components/BaseButton.vue +3 -2
- package/src/components/BaseButtonGroup.vue +37 -9
- package/src/components/BaseColor.vue +29 -31
- package/src/components/BaseDataIterator.stories.js +8 -1
- package/src/components/BaseDataIterator.vue +36 -76
- package/src/components/BaseDataIteratorSectionButton.vue +8 -19
- package/src/components/BaseDataTable.vue +23 -16
- package/src/components/BaseDataTableRowAction.vue +2 -1
- package/src/components/BaseDatePicker.stories.js +23 -0
- package/src/components/BaseDatePicker.vue +65 -8
- package/src/components/BaseDateSelect.stories.js +25 -1
- package/src/components/BaseDateSelect.vue +80 -101
- package/src/components/BaseDropdownAutocomplete.stories.js +30 -15
- package/src/components/BaseHasMany.stories.js +22 -1
- package/src/components/BaseInput.stories.js +1 -1
- package/src/components/BaseInput.vue +4 -3
- package/src/components/BaseMediaPicturesItem.vue +2 -2
- package/src/components/BaseRichText.stories.js +6 -0
- package/src/components/BaseRichText.vue +12 -2
- package/src/components/BaseSelect.vue +5 -0
- package/src/components/BaseTable.vue +2 -1
- package/src/components/BaseTagAutocomplete.stories.js +1 -1
- package/src/components/BaseTagAutocomplete.vue +143 -88
- package/src/components/BaseTagAutocompleteFetch.stories.js +22 -1
- package/src/components/BaseTextareaAutoresize.vue +7 -7
- package/src/components/BaseTimeline.vue +1 -1
- package/src/components/BaseTimelineItem.vue +1 -1
- package/src/composables/inputSize.ts +5 -1
- package/src/stories/InputSizes.stories.js +22 -0
- package/src/stories/PageInputSizes.vue +205 -0
- package/src/types/TimelineItem.ts +0 -9
- package/src/types/index.ts +11 -1
- package/src/utils/slots.ts +13 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Size } from '@/utils/sizes';
|
|
1
2
|
declare const _default: import("vue").DefineComponent<{
|
|
2
3
|
required: {
|
|
3
4
|
type: import("vue").PropType<boolean>;
|
|
@@ -7,6 +8,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
7
8
|
type: import("vue").PropType<string>;
|
|
8
9
|
default: undefined;
|
|
9
10
|
};
|
|
11
|
+
size: {
|
|
12
|
+
type: import("vue").PropType<"xs" | "sm" | "md">;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
10
15
|
mode: {
|
|
11
16
|
type: import("vue").PropType<"time" | "multiple" | "single" | "range">;
|
|
12
17
|
default: string;
|
|
@@ -62,6 +67,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
62
67
|
type: import("vue").PropType<string>;
|
|
63
68
|
default: undefined;
|
|
64
69
|
};
|
|
70
|
+
size: {
|
|
71
|
+
type: import("vue").PropType<"xs" | "sm" | "md">;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
65
74
|
mode: {
|
|
66
75
|
type: import("vue").PropType<"time" | "multiple" | "single" | "range">;
|
|
67
76
|
default: string;
|
|
@@ -111,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
120
|
}, {
|
|
112
121
|
required: boolean;
|
|
113
122
|
name: string;
|
|
123
|
+
size: Size;
|
|
114
124
|
mode: 'single' | 'multiple' | 'range' | 'time';
|
|
115
125
|
inline: boolean;
|
|
116
126
|
modelValue: string | null | string[];
|
|
@@ -8,6 +8,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
default: boolean;
|
|
9
9
|
type: BooleanConstructor;
|
|
10
10
|
};
|
|
11
|
+
size: {
|
|
12
|
+
default: undefined;
|
|
13
|
+
type: PropType<"xs" | "sm" | "md">;
|
|
14
|
+
};
|
|
11
15
|
disabled: {
|
|
12
16
|
default: boolean;
|
|
13
17
|
type: BooleanConstructor;
|
|
@@ -43,6 +47,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
43
47
|
default: boolean;
|
|
44
48
|
type: BooleanConstructor;
|
|
45
49
|
};
|
|
50
|
+
size: {
|
|
51
|
+
default: undefined;
|
|
52
|
+
type: PropType<"xs" | "sm" | "md">;
|
|
53
|
+
};
|
|
46
54
|
disabled: {
|
|
47
55
|
default: boolean;
|
|
48
56
|
type: BooleanConstructor;
|
|
@@ -72,6 +80,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
72
80
|
}, {
|
|
73
81
|
required: boolean;
|
|
74
82
|
name: string;
|
|
83
|
+
size: "xs" | "sm" | "md";
|
|
75
84
|
disabled: boolean;
|
|
76
85
|
hasError: boolean;
|
|
77
86
|
minYear: number;
|
|
@@ -9,6 +9,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
9
9
|
type: PropType<"" | "snow" | "bubble">;
|
|
10
10
|
default: string;
|
|
11
11
|
};
|
|
12
|
+
size: {
|
|
13
|
+
default: undefined;
|
|
14
|
+
type: PropType<"xs" | "sm" | "md">;
|
|
15
|
+
};
|
|
12
16
|
toolbar: {
|
|
13
17
|
type: PropType<string | Record<string, any> | unknown[] | undefined>;
|
|
14
18
|
default(): string[];
|
|
@@ -48,6 +52,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
52
|
type: PropType<"" | "snow" | "bubble">;
|
|
49
53
|
default: string;
|
|
50
54
|
};
|
|
55
|
+
size: {
|
|
56
|
+
default: undefined;
|
|
57
|
+
type: PropType<"xs" | "sm" | "md">;
|
|
58
|
+
};
|
|
51
59
|
toolbar: {
|
|
52
60
|
type: PropType<string | Record<string, any> | unknown[] | undefined>;
|
|
53
61
|
default(): string[];
|
|
@@ -81,6 +89,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
89
|
}, {
|
|
82
90
|
required: boolean;
|
|
83
91
|
name: string;
|
|
92
|
+
size: "xs" | "sm" | "md";
|
|
84
93
|
modelValue: string | Delta | null | undefined;
|
|
85
94
|
placeholder: string;
|
|
86
95
|
disabled: boolean;
|
|
@@ -75,7 +75,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
75
75
|
type: NumberConstructor;
|
|
76
76
|
};
|
|
77
77
|
size: {
|
|
78
|
-
type: PropType<"sm" | "md">;
|
|
78
|
+
type: PropType<"xs" | "sm" | "md">;
|
|
79
79
|
default: string;
|
|
80
80
|
};
|
|
81
81
|
}, {
|
|
@@ -185,7 +185,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
185
185
|
type: NumberConstructor;
|
|
186
186
|
};
|
|
187
187
|
size: {
|
|
188
|
-
type: PropType<"sm" | "md">;
|
|
188
|
+
type: PropType<"xs" | "sm" | "md">;
|
|
189
189
|
default: string;
|
|
190
190
|
};
|
|
191
191
|
}>> & {
|
|
@@ -199,7 +199,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
199
199
|
"onCell-click"?: ((...args: any[]) => any) | undefined;
|
|
200
200
|
}, {
|
|
201
201
|
data: Row[];
|
|
202
|
-
size: "sm" | "md";
|
|
202
|
+
size: "xs" | "sm" | "md";
|
|
203
203
|
loading: boolean;
|
|
204
204
|
sortField: string;
|
|
205
205
|
sortDirection: string;
|
|
@@ -63,7 +63,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
63
63
|
type: BooleanConstructor;
|
|
64
64
|
};
|
|
65
65
|
size: {
|
|
66
|
-
default:
|
|
66
|
+
default: undefined;
|
|
67
67
|
type: PropType<"xs" | "sm" | "md">;
|
|
68
68
|
};
|
|
69
69
|
dropdownShow: {
|
|
@@ -78,6 +78,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
78
78
|
default: string;
|
|
79
79
|
type: PropType<string | string[]>;
|
|
80
80
|
};
|
|
81
|
+
visibleFocus: {
|
|
82
|
+
default: boolean;
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
};
|
|
81
85
|
}, {
|
|
82
86
|
focus: typeof focus;
|
|
83
87
|
blur: typeof blur;
|
|
@@ -148,7 +152,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
148
152
|
type: BooleanConstructor;
|
|
149
153
|
};
|
|
150
154
|
size: {
|
|
151
|
-
default:
|
|
155
|
+
default: undefined;
|
|
152
156
|
type: PropType<"xs" | "sm" | "md">;
|
|
153
157
|
};
|
|
154
158
|
dropdownShow: {
|
|
@@ -163,6 +167,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
163
167
|
default: string;
|
|
164
168
|
type: PropType<string | string[]>;
|
|
165
169
|
};
|
|
170
|
+
visibleFocus: {
|
|
171
|
+
default: boolean;
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
};
|
|
166
174
|
}>> & {
|
|
167
175
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
168
176
|
onScrollBottom?: ((...args: any[]) => any) | undefined;
|
|
@@ -179,6 +187,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
179
187
|
disabled: boolean;
|
|
180
188
|
hasError: boolean;
|
|
181
189
|
max: number;
|
|
190
|
+
visibleFocus: boolean;
|
|
182
191
|
loading: boolean;
|
|
183
192
|
loadingBottom: boolean;
|
|
184
193
|
dropdownShow: "always" | "focus";
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
type: StringConstructor;
|
|
12
12
|
};
|
|
13
13
|
name: {
|
|
14
|
-
|
|
14
|
+
default: undefined;
|
|
15
15
|
type: StringConstructor;
|
|
16
16
|
};
|
|
17
17
|
required: {
|
|
@@ -68,7 +68,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
68
68
|
type: StringConstructor;
|
|
69
69
|
};
|
|
70
70
|
name: {
|
|
71
|
-
|
|
71
|
+
default: undefined;
|
|
72
72
|
type: StringConstructor;
|
|
73
73
|
};
|
|
74
74
|
required: {
|
|
@@ -114,6 +114,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
114
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
115
115
|
}, {
|
|
116
116
|
required: boolean;
|
|
117
|
+
name: string;
|
|
117
118
|
size: "xs" | "sm" | "md";
|
|
118
119
|
modelValue: string | null;
|
|
119
120
|
placeholder: string;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -209,3 +209,12 @@ export interface BaseCropperConfig {
|
|
|
209
209
|
presetOptions?: Record<string, any>;
|
|
210
210
|
saveOptions?: ResultOptions;
|
|
211
211
|
}
|
|
212
|
+
export interface TimelineItem {
|
|
213
|
+
title: string;
|
|
214
|
+
icon: string;
|
|
215
|
+
description?: null | string;
|
|
216
|
+
date?: string | null;
|
|
217
|
+
color?: string | null;
|
|
218
|
+
onEdit?: () => void | Promise<void>;
|
|
219
|
+
onDelete?: () => void | Promise<void>;
|
|
220
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isSlotEmpty(slot: any, props?: {}): boolean;
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
body {
|
|
2
|
+
.base-rich-text {
|
|
2
3
|
.ql-toolbar.ql-snow {
|
|
3
4
|
@apply rounded-t border-slate-300 font-sans;
|
|
4
5
|
}
|
|
@@ -28,71 +29,192 @@
|
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
.ql-editor.ql-blank::before {
|
|
31
|
-
@apply text-
|
|
32
|
+
@apply text-slate-400 font-light not-italic;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
/** Style Prose */
|
|
35
36
|
.ql-editor {
|
|
37
|
+
|
|
38
|
+
@apply p-3.5;
|
|
39
|
+
|
|
40
|
+
&.ql-blank::before {
|
|
41
|
+
@apply text-base left-3.5;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
h1, h2, h3, h4, h5, h6 {
|
|
45
|
+
@apply font-bold leading-snug tracking-normal;
|
|
46
|
+
margin-top: 0;
|
|
47
|
+
margin-bottom: 0.375em;
|
|
48
|
+
}
|
|
49
|
+
|
|
36
50
|
h1 {
|
|
37
|
-
@apply
|
|
51
|
+
@apply text-4xl;
|
|
38
52
|
}
|
|
39
53
|
|
|
40
54
|
h2 {
|
|
41
|
-
@apply
|
|
55
|
+
@apply text-3xl;
|
|
42
56
|
}
|
|
43
57
|
|
|
44
58
|
h3 {
|
|
45
|
-
@apply
|
|
59
|
+
@apply text-2xl;
|
|
46
60
|
}
|
|
47
61
|
|
|
48
62
|
h4 {
|
|
49
|
-
@apply
|
|
63
|
+
@apply text-xl;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
h5 {
|
|
67
|
+
@apply text-lg;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
h6 {
|
|
71
|
+
@apply text-base;
|
|
50
72
|
}
|
|
51
73
|
|
|
52
74
|
p {
|
|
53
|
-
@apply
|
|
75
|
+
@apply text-base leading-relaxed;
|
|
76
|
+
margin: 1em 0;
|
|
77
|
+
}
|
|
54
78
|
|
|
79
|
+
h1,
|
|
80
|
+
h2,
|
|
81
|
+
h3,
|
|
82
|
+
h4,
|
|
83
|
+
h5,
|
|
84
|
+
h6,
|
|
85
|
+
p {
|
|
55
86
|
&:first-child {
|
|
56
|
-
|
|
87
|
+
margin-top: 0;
|
|
57
88
|
}
|
|
58
89
|
}
|
|
59
90
|
|
|
60
91
|
ol,
|
|
61
92
|
ul {
|
|
62
|
-
|
|
93
|
+
@apply text-base leading-relaxed;
|
|
94
|
+
padding-left: 0.5em;
|
|
95
|
+
margin-bottom: 1.5em;
|
|
63
96
|
|
|
64
97
|
li {
|
|
65
|
-
|
|
66
|
-
padding-left: 0.5rem;
|
|
98
|
+
margin: 0.6em 0;
|
|
67
99
|
|
|
68
100
|
&::before {
|
|
69
101
|
@apply text-slate-500;
|
|
70
102
|
width: 2em;
|
|
103
|
+
left: 3em;
|
|
71
104
|
text-align: left;
|
|
72
105
|
position: absolute;
|
|
73
|
-
left: 3rem;
|
|
74
106
|
}
|
|
75
107
|
}
|
|
76
108
|
}
|
|
77
109
|
|
|
78
110
|
blockquote {
|
|
79
|
-
@apply
|
|
111
|
+
@apply text-base bg-slate-100;
|
|
112
|
+
margin: 1em 0;
|
|
113
|
+
padding: 1em;
|
|
80
114
|
}
|
|
81
115
|
|
|
82
|
-
pre {
|
|
83
|
-
@apply
|
|
116
|
+
pre, .ql-syntax {
|
|
117
|
+
@apply text-sm bg-slate-900;
|
|
118
|
+
margin: 1em 0;
|
|
119
|
+
padding: 1.5em;
|
|
84
120
|
}
|
|
85
121
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* Size: xs */
|
|
125
|
+
.base-rich-text-xs {
|
|
126
|
+
.ql-editor {
|
|
127
|
+
|
|
128
|
+
@apply p-2.5;
|
|
129
|
+
|
|
130
|
+
&.ql-blank::before {
|
|
131
|
+
@apply text-xs left-2.5;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
h1 {
|
|
135
|
+
@apply text-2xl;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
h2 {
|
|
139
|
+
@apply text-xl;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
h3 {
|
|
143
|
+
@apply text-lg;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
h4 {
|
|
147
|
+
@apply text-base;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
p {
|
|
151
|
+
@apply text-xs;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
ol,
|
|
155
|
+
ul {
|
|
156
|
+
li {
|
|
157
|
+
@apply text-xs;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
blockquote {
|
|
162
|
+
@apply text-xs;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
pre, .ql-syntax {
|
|
166
|
+
@apply text-xs;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Size: sm */
|
|
174
|
+
.base-rich-text-sm {
|
|
175
|
+
.ql-editor {
|
|
176
|
+
|
|
177
|
+
@apply p-3;
|
|
178
|
+
|
|
179
|
+
&.ql-blank::before {
|
|
180
|
+
@apply text-sm left-3;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
h1 {
|
|
185
|
+
@apply text-3xl;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
h2 {
|
|
189
|
+
@apply text-2xl;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
h3 {
|
|
193
|
+
@apply text-xl;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
h4 {
|
|
197
|
+
@apply text-lg;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
p {
|
|
201
|
+
@apply text-sm;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
ol,
|
|
205
|
+
ul {
|
|
206
|
+
li {
|
|
207
|
+
@apply text-sm;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
blockquote {
|
|
212
|
+
@apply text-sm;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
pre, .ql-syntax {
|
|
216
|
+
@apply text-sm;
|
|
96
217
|
}
|
|
97
218
|
}
|
|
98
|
-
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
@@ -48,6 +48,7 @@ import { ClassNameValue, twMerge } from 'tailwind-merge';
|
|
|
48
48
|
import { RouteLocationRaw } from 'vue-router';
|
|
49
49
|
import { BaseIcon } from '.';
|
|
50
50
|
import { getColorConfig } from '@/utils/colors';
|
|
51
|
+
import { isSlotEmpty } from '@/utils/slots';
|
|
51
52
|
|
|
52
53
|
defineOptions({
|
|
53
54
|
inheritAttrs: false,
|
|
@@ -111,7 +112,7 @@ const props = withDefaults(defineProps<{
|
|
|
111
112
|
defineEmits(['click']);
|
|
112
113
|
|
|
113
114
|
const iconOnly = computed(() => {
|
|
114
|
-
return props.icon &&
|
|
115
|
+
return props.icon && isSlotEmpty(slots.default);
|
|
115
116
|
});
|
|
116
117
|
|
|
117
118
|
const classes = computed(() => {
|
|
@@ -179,7 +180,7 @@ const containerClass = computed(() => {
|
|
|
179
180
|
});
|
|
180
181
|
|
|
181
182
|
const iconClass = computed(() => {
|
|
182
|
-
const classes = [''];
|
|
183
|
+
const classes = ['shrink-0'];
|
|
183
184
|
|
|
184
185
|
if (!iconOnly.value) {
|
|
185
186
|
if (props.iconPosition === 'start') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
3
|
+
class=""
|
|
4
4
|
:class="wrapperClasses"
|
|
5
5
|
>
|
|
6
6
|
<BaseButton
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
:type="buttonType"
|
|
10
10
|
:disabled="disabled"
|
|
11
11
|
:size="sizeInternal"
|
|
12
|
-
:class="
|
|
12
|
+
:class="buttonClasses"
|
|
13
13
|
:color="buttonColor(option, isSelected(option))"
|
|
14
14
|
@click="onSelect(option)"
|
|
15
15
|
>
|
|
@@ -33,6 +33,11 @@ import { useHasOptions } from '@/composables/hasOptions';
|
|
|
33
33
|
import { useField } from '@/composables/field';
|
|
34
34
|
import BaseButton from '@/components/BaseButton.vue';
|
|
35
35
|
import { Size } from '@/utils/sizes';
|
|
36
|
+
import { twMerge } from 'tailwind-merge';
|
|
37
|
+
|
|
38
|
+
defineOptions({
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
});
|
|
36
41
|
|
|
37
42
|
const props = defineProps({
|
|
38
43
|
modelValue: {
|
|
@@ -41,6 +46,10 @@ const props = defineProps({
|
|
|
41
46
|
Option[] | Option | null | undefined
|
|
42
47
|
>,
|
|
43
48
|
},
|
|
49
|
+
class: {
|
|
50
|
+
default: '',
|
|
51
|
+
type: [String, Array] as PropType<string | string[]>,
|
|
52
|
+
},
|
|
44
53
|
required: {
|
|
45
54
|
default: false,
|
|
46
55
|
type: Boolean,
|
|
@@ -150,14 +159,33 @@ function onSelect(option: NormalizedOption) {
|
|
|
150
159
|
|
|
151
160
|
const wrapperClasses = computed(() => {
|
|
152
161
|
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
const base = 'flex items-center';
|
|
163
|
+
|
|
164
|
+
let spacing = 'btn-group';
|
|
165
|
+
|
|
166
|
+
if (props.spacing != 'none') {
|
|
167
|
+
spacing = 'flex-wrap';
|
|
168
|
+
spacing += ' ';
|
|
169
|
+
spacing += {
|
|
170
|
+
"xs": "gap-0.5",
|
|
171
|
+
"sm": "gap-1",
|
|
172
|
+
"md": "gap-1.5",
|
|
173
|
+
}[sizeInternal.value]
|
|
155
174
|
}
|
|
156
175
|
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
176
|
+
return twMerge(
|
|
177
|
+
base,
|
|
178
|
+
spacing,
|
|
179
|
+
props.class,
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const buttonClasses = computed(() => {
|
|
184
|
+
const base = props.spacing ? 'whitespace-nowrap' : '';
|
|
185
|
+
|
|
186
|
+
return twMerge([
|
|
187
|
+
base,
|
|
188
|
+
props.twButton,
|
|
189
|
+
]);
|
|
162
190
|
});
|
|
163
191
|
</script>
|
|
@@ -1,35 +1,33 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</BaseButtonGroup>
|
|
32
|
-
</div>
|
|
2
|
+
<BaseButtonGroup
|
|
3
|
+
:model-value="normalizeModelValue"
|
|
4
|
+
:disabled="disabled"
|
|
5
|
+
value-key="value"
|
|
6
|
+
label-key="label"
|
|
7
|
+
:size="size"
|
|
8
|
+
:required="required"
|
|
9
|
+
:options="colorOptions"
|
|
10
|
+
:multiple="multiple"
|
|
11
|
+
:button-type="buttonType"
|
|
12
|
+
:button-color="buttonColor"
|
|
13
|
+
tw-button="p-0 aspect-1 justify-center items-center"
|
|
14
|
+
@update:model-value="(value) => transformModelValue(value)"
|
|
15
|
+
>
|
|
16
|
+
<template #option="option">
|
|
17
|
+
<div
|
|
18
|
+
v-if="option.selected.value"
|
|
19
|
+
class="overflow-hidden flex h-full"
|
|
20
|
+
>
|
|
21
|
+
<BaseIcon
|
|
22
|
+
icon="heroicons-solid:check-circle"
|
|
23
|
+
class="block leading-none"
|
|
24
|
+
width="18"
|
|
25
|
+
height="18"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
<div v-else />
|
|
29
|
+
</template>
|
|
30
|
+
</BaseButtonGroup>
|
|
33
31
|
</template>
|
|
34
32
|
|
|
35
33
|
<script lang="ts" setup>
|
|
@@ -4,10 +4,17 @@ import BaseCard from './BaseCard.vue';
|
|
|
4
4
|
import BaseCardRow from './BaseCardRow.vue';
|
|
5
5
|
import BaseLoadingCover from './BaseLoadingCover.vue';
|
|
6
6
|
|
|
7
|
+
const sizes = ['xs', 'sm', 'md'];
|
|
8
|
+
|
|
7
9
|
export default {
|
|
8
10
|
title: 'Data/BaseDataIterator',
|
|
9
11
|
component: BaseDataIterator,
|
|
10
|
-
argTypes: {
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: sizes,
|
|
16
|
+
}
|
|
17
|
+
},
|
|
11
18
|
args: {
|
|
12
19
|
url: 'https://effettandem.com/api/content/articles',
|
|
13
20
|
urlQuery: {
|