@seekora-ai/ui-sdk-vue 0.2.11 → 0.2.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.
- package/dist/index.esm.js +286 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +285 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,291 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, h, ref, computed, openBlock, createElementBlock, normalizeStyle, normalizeClass, createCommentVNode, Fragment, renderList, createBlock, unref, createElementVNode, toDisplayString, provide, renderSlot, inject, onMounted, onUnmounted, watch, createTextVNode, resolveDynamicComponent, withCtx, createVNode, useSlots } from 'vue';
|
|
2
2
|
import { createTheme as createTheme$1, SearchStateManager, log, extractField, formatPrice, getHighlightedValue, parseHighlightedParts, parseQueryHighlightParts } from '@seekora-ai/ui-sdk-core';
|
|
3
3
|
export { mergeThemes } from '@seekora-ai/ui-sdk-core';
|
|
4
4
|
|
|
5
|
+
const _hoisted_1$c = {
|
|
6
|
+
key: 0,
|
|
7
|
+
style: { display: 'inline-flex', alignItems: 'center', gap: '2px' }
|
|
8
|
+
};
|
|
9
|
+
const _hoisted_2$a = { style: { display: 'inline-flex', alignItems: 'center', gap: '2px' } };
|
|
10
|
+
const _hoisted_3$7 = {
|
|
11
|
+
class: "seekora-rating-numeric",
|
|
12
|
+
style: { fontWeight: 600, color: 'var(--seekora-text-primary, #111827)' }
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_4$4 = { style: { display: 'inline-flex', alignItems: 'center', gap: '2px' } };
|
|
15
|
+
const _hoisted_5$2 = { style: { display: 'flex', alignItems: 'center', gap: '6px' } };
|
|
16
|
+
const _hoisted_6$1 = { style: { display: 'inline-flex', alignItems: 'center', gap: '2px' } };
|
|
17
|
+
const _hoisted_7$1 = {
|
|
18
|
+
class: "seekora-rating-numeric",
|
|
19
|
+
style: { fontWeight: 600, color: 'var(--seekora-text-primary, #111827)' }
|
|
20
|
+
};
|
|
21
|
+
// StarIcon component
|
|
22
|
+
const StarIcon = defineComponent({
|
|
23
|
+
name: 'StarIcon',
|
|
24
|
+
props: {
|
|
25
|
+
filled: Boolean,
|
|
26
|
+
half: Boolean,
|
|
27
|
+
size: { type: Number, required: true },
|
|
28
|
+
color: { type: String, required: true },
|
|
29
|
+
emptyColor: { type: String, required: true },
|
|
30
|
+
interactive: Boolean,
|
|
31
|
+
},
|
|
32
|
+
emits: ['hover', 'click'],
|
|
33
|
+
setup(props, { emit }) {
|
|
34
|
+
const handleMouseEnter = () => emit('hover');
|
|
35
|
+
const handleClick = () => emit('click');
|
|
36
|
+
return () => h('span', {
|
|
37
|
+
class: [
|
|
38
|
+
'seekora-rating-star',
|
|
39
|
+
props.filled ? 'seekora-rating-star--filled' : 'seekora-rating-star--empty',
|
|
40
|
+
props.half && 'seekora-rating-star--half',
|
|
41
|
+
props.interactive && 'seekora-rating-star--interactive',
|
|
42
|
+
],
|
|
43
|
+
style: {
|
|
44
|
+
display: 'inline-block',
|
|
45
|
+
width: `${props.size}px`,
|
|
46
|
+
height: `${props.size}px`,
|
|
47
|
+
cursor: props.interactive ? 'pointer' : 'default',
|
|
48
|
+
},
|
|
49
|
+
onMouseenter: handleMouseEnter,
|
|
50
|
+
onClick: handleClick,
|
|
51
|
+
}, [
|
|
52
|
+
h('svg', {
|
|
53
|
+
width: props.size,
|
|
54
|
+
height: props.size,
|
|
55
|
+
viewBox: '0 0 24 24',
|
|
56
|
+
fill: props.filled ? props.color : 'none',
|
|
57
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
58
|
+
innerHTML: props.half
|
|
59
|
+
? `
|
|
60
|
+
<defs>
|
|
61
|
+
<linearGradient id="half-fill-${Math.random()}">
|
|
62
|
+
<stop offset="50%" stop-color="${props.color}" />
|
|
63
|
+
<stop offset="50%" stop-color="${props.emptyColor}" />
|
|
64
|
+
</linearGradient>
|
|
65
|
+
</defs>
|
|
66
|
+
<path
|
|
67
|
+
d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"
|
|
68
|
+
fill="url(#half-fill-${Math.random()})"
|
|
69
|
+
stroke="${props.color}"
|
|
70
|
+
stroke-width="1"
|
|
71
|
+
/>
|
|
72
|
+
`
|
|
73
|
+
: `
|
|
74
|
+
<path
|
|
75
|
+
d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"
|
|
76
|
+
stroke="${props.filled ? props.color : props.emptyColor}"
|
|
77
|
+
stroke-width="1.5"
|
|
78
|
+
stroke-linecap="round"
|
|
79
|
+
stroke-linejoin="round"
|
|
80
|
+
/>
|
|
81
|
+
`,
|
|
82
|
+
}),
|
|
83
|
+
]);
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
var script$i = /*@__PURE__*/ defineComponent({
|
|
87
|
+
__name: 'RatingDisplay',
|
|
88
|
+
props: {
|
|
89
|
+
rating: { type: Number, required: true },
|
|
90
|
+
reviewCount: { type: Number, required: false },
|
|
91
|
+
variant: { type: String, required: false, default: 'compact' },
|
|
92
|
+
size: { type: String, required: false, default: 'medium' },
|
|
93
|
+
maxRating: { type: Number, required: false, default: 5 },
|
|
94
|
+
showNumeric: { type: Boolean, required: false, default: false },
|
|
95
|
+
showHalfStars: { type: Boolean, required: false, default: true },
|
|
96
|
+
interactive: { type: Boolean, required: false, default: false },
|
|
97
|
+
starColor: { type: String, required: false, default: '#f59e0b' },
|
|
98
|
+
emptyStarColor: { type: String, required: false, default: '#d1d5db' },
|
|
99
|
+
textColor: { type: String, required: false, default: 'var(--seekora-text-secondary, #6b7280)' },
|
|
100
|
+
showReviewCount: { type: Boolean, required: false, default: true },
|
|
101
|
+
reviewCountFormat: { type: Function, required: false },
|
|
102
|
+
className: { type: String, required: false, default: '' },
|
|
103
|
+
style: { type: null, required: false }
|
|
104
|
+
},
|
|
105
|
+
emits: ["rating-change"],
|
|
106
|
+
setup(__props, { emit: __emit }) {
|
|
107
|
+
const props = __props;
|
|
108
|
+
const emit = __emit;
|
|
109
|
+
const hoverRating = ref(null);
|
|
110
|
+
const sizeMap = {
|
|
111
|
+
small: 14,
|
|
112
|
+
medium: 18,
|
|
113
|
+
large: 24,
|
|
114
|
+
};
|
|
115
|
+
const fontSizeMap = {
|
|
116
|
+
small: '0.75rem',
|
|
117
|
+
medium: '0.875rem',
|
|
118
|
+
large: '1rem',
|
|
119
|
+
};
|
|
120
|
+
const starSize = computed(() => sizeMap[props.size]);
|
|
121
|
+
const fontSize = computed(() => fontSizeMap[props.size]);
|
|
122
|
+
const clampedRating = computed(() => Math.max(0, Math.min(props.maxRating, props.rating)));
|
|
123
|
+
const displayRating = computed(() => props.interactive && hoverRating.value !== null ? hoverRating.value : clampedRating.value);
|
|
124
|
+
const containerStyle = computed(() => {
|
|
125
|
+
const baseStyle = {
|
|
126
|
+
fontSize: fontSize.value,
|
|
127
|
+
...props.style,
|
|
128
|
+
};
|
|
129
|
+
if (props.variant === 'stars-only') {
|
|
130
|
+
return { ...baseStyle, display: 'inline-flex', alignItems: 'center', gap: '2px' };
|
|
131
|
+
}
|
|
132
|
+
else if (props.variant === 'compact' || props.variant === 'inline') {
|
|
133
|
+
return { ...baseStyle, display: 'inline-flex', alignItems: 'center', gap: props.variant === 'inline' ? '6px' : '4px' };
|
|
134
|
+
}
|
|
135
|
+
else if (props.variant === 'full') {
|
|
136
|
+
return { ...baseStyle, display: 'flex', flexDirection: 'column', gap: '4px' };
|
|
137
|
+
}
|
|
138
|
+
return baseStyle;
|
|
139
|
+
});
|
|
140
|
+
const formatReviewCount = (count) => {
|
|
141
|
+
if (props.reviewCountFormat)
|
|
142
|
+
return props.reviewCountFormat(count);
|
|
143
|
+
if (count >= 1000000)
|
|
144
|
+
return `${(count / 1000000).toFixed(1)}M`;
|
|
145
|
+
if (count >= 1000)
|
|
146
|
+
return `${(count / 1000).toFixed(1)}K`;
|
|
147
|
+
return count.toString();
|
|
148
|
+
};
|
|
149
|
+
const handleStarHover = (rating) => {
|
|
150
|
+
if (props.interactive) {
|
|
151
|
+
hoverRating.value = rating;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const handleStarClick = (rating) => {
|
|
155
|
+
if (props.interactive) {
|
|
156
|
+
hoverRating.value = null;
|
|
157
|
+
emit('rating-change', rating);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
const handleMouseLeave = () => {
|
|
161
|
+
if (props.interactive) {
|
|
162
|
+
hoverRating.value = null;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
return (_ctx, _cache) => {
|
|
166
|
+
return (openBlock(), createElementBlock("div", {
|
|
167
|
+
class: normalizeClass(['seekora-rating-display', `seekora-rating-display--${__props.variant}`, __props.className]),
|
|
168
|
+
style: normalizeStyle(containerStyle.value),
|
|
169
|
+
onMouseleave: handleMouseLeave
|
|
170
|
+
}, [
|
|
171
|
+
createCommentVNode(" Stars Only "),
|
|
172
|
+
(__props.variant === 'stars-only')
|
|
173
|
+
? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
174
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.maxRating, (i) => {
|
|
175
|
+
return (openBlock(), createBlock(unref(StarIcon), {
|
|
176
|
+
key: i,
|
|
177
|
+
filled: i <= Math.floor(displayRating.value),
|
|
178
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
179
|
+
size: starSize.value,
|
|
180
|
+
color: __props.starColor,
|
|
181
|
+
emptyColor: __props.emptyStarColor,
|
|
182
|
+
interactive: __props.interactive,
|
|
183
|
+
onHover: () => handleStarHover(i),
|
|
184
|
+
onClick: () => handleStarClick(i)
|
|
185
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
186
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
187
|
+
]))
|
|
188
|
+
: (__props.variant === 'compact')
|
|
189
|
+
? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
190
|
+
createCommentVNode(" Compact "),
|
|
191
|
+
createElementVNode("div", _hoisted_2$a, [
|
|
192
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.maxRating, (i) => {
|
|
193
|
+
return (openBlock(), createBlock(unref(StarIcon), {
|
|
194
|
+
key: i,
|
|
195
|
+
filled: i <= Math.floor(displayRating.value),
|
|
196
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
197
|
+
size: starSize.value,
|
|
198
|
+
color: __props.starColor,
|
|
199
|
+
emptyColor: __props.emptyStarColor,
|
|
200
|
+
interactive: __props.interactive,
|
|
201
|
+
onHover: () => handleStarHover(i),
|
|
202
|
+
onClick: () => handleStarClick(i)
|
|
203
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
204
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
205
|
+
]),
|
|
206
|
+
(__props.showNumeric)
|
|
207
|
+
? (openBlock(), createElementBlock("span", {
|
|
208
|
+
key: 0,
|
|
209
|
+
class: "seekora-rating-numeric",
|
|
210
|
+
style: normalizeStyle({ fontWeight: 600, color: __props.textColor })
|
|
211
|
+
}, toDisplayString(clampedRating.value.toFixed(1)), 5 /* TEXT, STYLE */))
|
|
212
|
+
: createCommentVNode("v-if", true),
|
|
213
|
+
(__props.showReviewCount && __props.reviewCount != null && __props.reviewCount > 0)
|
|
214
|
+
? (openBlock(), createElementBlock("span", {
|
|
215
|
+
key: 1,
|
|
216
|
+
class: "seekora-rating-review-count",
|
|
217
|
+
style: normalizeStyle({ color: __props.textColor })
|
|
218
|
+
}, " (" + toDisplayString(formatReviewCount(__props.reviewCount)) + ") ", 5 /* TEXT, STYLE */))
|
|
219
|
+
: createCommentVNode("v-if", true)
|
|
220
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
221
|
+
: (__props.variant === 'inline')
|
|
222
|
+
? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
223
|
+
createCommentVNode(" Inline "),
|
|
224
|
+
createElementVNode("span", _hoisted_3$7, toDisplayString(clampedRating.value.toFixed(1)), 1 /* TEXT */),
|
|
225
|
+
createElementVNode("div", _hoisted_4$4, [
|
|
226
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.maxRating, (i) => {
|
|
227
|
+
return (openBlock(), createBlock(unref(StarIcon), {
|
|
228
|
+
key: i,
|
|
229
|
+
filled: i <= Math.floor(displayRating.value),
|
|
230
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
231
|
+
size: starSize.value,
|
|
232
|
+
color: __props.starColor,
|
|
233
|
+
emptyColor: __props.emptyStarColor,
|
|
234
|
+
interactive: __props.interactive,
|
|
235
|
+
onHover: () => handleStarHover(i),
|
|
236
|
+
onClick: () => handleStarClick(i)
|
|
237
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
238
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
239
|
+
]),
|
|
240
|
+
(__props.showReviewCount && __props.reviewCount != null && __props.reviewCount > 0)
|
|
241
|
+
? (openBlock(), createElementBlock("span", {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: "seekora-rating-review-count",
|
|
244
|
+
style: normalizeStyle({ color: __props.textColor })
|
|
245
|
+
}, " (" + toDisplayString(formatReviewCount(__props.reviewCount)) + ") ", 5 /* TEXT, STYLE */))
|
|
246
|
+
: createCommentVNode("v-if", true)
|
|
247
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
248
|
+
: (__props.variant === 'full')
|
|
249
|
+
? (openBlock(), createElementBlock(Fragment, { key: 3 }, [
|
|
250
|
+
createCommentVNode(" Full "),
|
|
251
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
252
|
+
createElementVNode("div", _hoisted_6$1, [
|
|
253
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.maxRating, (i) => {
|
|
254
|
+
return (openBlock(), createBlock(unref(StarIcon), {
|
|
255
|
+
key: i,
|
|
256
|
+
filled: i <= Math.floor(displayRating.value),
|
|
257
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
258
|
+
size: starSize.value,
|
|
259
|
+
color: __props.starColor,
|
|
260
|
+
emptyColor: __props.emptyStarColor,
|
|
261
|
+
interactive: __props.interactive,
|
|
262
|
+
onHover: () => handleStarHover(i),
|
|
263
|
+
onClick: () => handleStarClick(i)
|
|
264
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
265
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
266
|
+
]),
|
|
267
|
+
createElementVNode("span", _hoisted_7$1, toDisplayString(clampedRating.value.toFixed(1)), 1 /* TEXT */),
|
|
268
|
+
createElementVNode("span", {
|
|
269
|
+
class: "seekora-rating-max",
|
|
270
|
+
style: normalizeStyle({ color: __props.textColor })
|
|
271
|
+
}, "/ " + toDisplayString(__props.maxRating), 5 /* TEXT, STYLE */)
|
|
272
|
+
]),
|
|
273
|
+
(__props.showReviewCount && __props.reviewCount != null && __props.reviewCount > 0)
|
|
274
|
+
? (openBlock(), createElementBlock("span", {
|
|
275
|
+
key: 0,
|
|
276
|
+
class: "seekora-rating-review-text",
|
|
277
|
+
style: normalizeStyle({ fontSize: '0.875em', color: __props.textColor })
|
|
278
|
+
}, " Based on " + toDisplayString(formatReviewCount(__props.reviewCount)) + " " + toDisplayString(__props.reviewCount === 1 ? 'review' : 'reviews'), 5 /* TEXT, STYLE */))
|
|
279
|
+
: createCommentVNode("v-if", true)
|
|
280
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
281
|
+
: createCommentVNode("v-if", true)
|
|
282
|
+
], 38 /* CLASS, STYLE, NEED_HYDRATION */));
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
script$i.__file = "src/components/RatingDisplay.vue";
|
|
288
|
+
|
|
5
289
|
/**
|
|
6
290
|
* Default Theme
|
|
7
291
|
*/
|
|
@@ -3680,5 +3964,5 @@ const minimalTheme = {
|
|
|
3680
3964
|
},
|
|
3681
3965
|
};
|
|
3682
3966
|
|
|
3683
|
-
export { script$8 as ClearRefinements, script$9 as CurrentRefinements, script$a as Facets, script$2 as HierarchicalMenu, script$4 as Highlight, script$6 as HitsPerPage, script$5 as InfiniteHits, script$c as Pagination, script$e as QuerySuggestions, script$7 as RangeInput, script$g as SearchBar, script$1 as SearchBarWithSuggestions, script as SearchLayout, script$h as SearchProvider, script$f as SearchResults, script$3 as Snippet, script$b as SortBy, script$d as Stats, createTheme, darkTheme, defaultTheme, minimalTheme, useQuerySuggestions, useSearchContext, useSearchState, useSeekoraSearch };
|
|
3967
|
+
export { script$8 as ClearRefinements, script$9 as CurrentRefinements, script$a as Facets, script$2 as HierarchicalMenu, script$4 as Highlight, script$6 as HitsPerPage, script$5 as InfiniteHits, script$c as Pagination, script$e as QuerySuggestions, script$7 as RangeInput, script$i as RatingDisplay, script$g as SearchBar, script$1 as SearchBarWithSuggestions, script as SearchLayout, script$h as SearchProvider, script$f as SearchResults, script$3 as Snippet, script$b as SortBy, script$d as Stats, createTheme, darkTheme, defaultTheme, minimalTheme, useQuerySuggestions, useSearchContext, useSearchState, useSeekoraSearch };
|
|
3684
3968
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file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k-core');
|
|
5
5
|
|
|
6
|
+
const _hoisted_1$c = {
|
|
7
|
+
key: 0,
|
|
8
|
+
style: { display: 'inline-flex', alignItems: 'center', gap: '2px' }
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2$a = { style: { display: 'inline-flex', alignItems: 'center', gap: '2px' } };
|
|
11
|
+
const _hoisted_3$7 = {
|
|
12
|
+
class: "seekora-rating-numeric",
|
|
13
|
+
style: { fontWeight: 600, color: 'var(--seekora-text-primary, #111827)' }
|
|
14
|
+
};
|
|
15
|
+
const _hoisted_4$4 = { style: { display: 'inline-flex', alignItems: 'center', gap: '2px' } };
|
|
16
|
+
const _hoisted_5$2 = { style: { display: 'flex', alignItems: 'center', gap: '6px' } };
|
|
17
|
+
const _hoisted_6$1 = { style: { display: 'inline-flex', alignItems: 'center', gap: '2px' } };
|
|
18
|
+
const _hoisted_7$1 = {
|
|
19
|
+
class: "seekora-rating-numeric",
|
|
20
|
+
style: { fontWeight: 600, color: 'var(--seekora-text-primary, #111827)' }
|
|
21
|
+
};
|
|
22
|
+
// StarIcon component
|
|
23
|
+
const StarIcon = vue.defineComponent({
|
|
24
|
+
name: 'StarIcon',
|
|
25
|
+
props: {
|
|
26
|
+
filled: Boolean,
|
|
27
|
+
half: Boolean,
|
|
28
|
+
size: { type: Number, required: true },
|
|
29
|
+
color: { type: String, required: true },
|
|
30
|
+
emptyColor: { type: String, required: true },
|
|
31
|
+
interactive: Boolean,
|
|
32
|
+
},
|
|
33
|
+
emits: ['hover', 'click'],
|
|
34
|
+
setup(props, { emit }) {
|
|
35
|
+
const handleMouseEnter = () => emit('hover');
|
|
36
|
+
const handleClick = () => emit('click');
|
|
37
|
+
return () => vue.h('span', {
|
|
38
|
+
class: [
|
|
39
|
+
'seekora-rating-star',
|
|
40
|
+
props.filled ? 'seekora-rating-star--filled' : 'seekora-rating-star--empty',
|
|
41
|
+
props.half && 'seekora-rating-star--half',
|
|
42
|
+
props.interactive && 'seekora-rating-star--interactive',
|
|
43
|
+
],
|
|
44
|
+
style: {
|
|
45
|
+
display: 'inline-block',
|
|
46
|
+
width: `${props.size}px`,
|
|
47
|
+
height: `${props.size}px`,
|
|
48
|
+
cursor: props.interactive ? 'pointer' : 'default',
|
|
49
|
+
},
|
|
50
|
+
onMouseenter: handleMouseEnter,
|
|
51
|
+
onClick: handleClick,
|
|
52
|
+
}, [
|
|
53
|
+
vue.h('svg', {
|
|
54
|
+
width: props.size,
|
|
55
|
+
height: props.size,
|
|
56
|
+
viewBox: '0 0 24 24',
|
|
57
|
+
fill: props.filled ? props.color : 'none',
|
|
58
|
+
xmlns: 'http://www.w3.org/2000/svg',
|
|
59
|
+
innerHTML: props.half
|
|
60
|
+
? `
|
|
61
|
+
<defs>
|
|
62
|
+
<linearGradient id="half-fill-${Math.random()}">
|
|
63
|
+
<stop offset="50%" stop-color="${props.color}" />
|
|
64
|
+
<stop offset="50%" stop-color="${props.emptyColor}" />
|
|
65
|
+
</linearGradient>
|
|
66
|
+
</defs>
|
|
67
|
+
<path
|
|
68
|
+
d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"
|
|
69
|
+
fill="url(#half-fill-${Math.random()})"
|
|
70
|
+
stroke="${props.color}"
|
|
71
|
+
stroke-width="1"
|
|
72
|
+
/>
|
|
73
|
+
`
|
|
74
|
+
: `
|
|
75
|
+
<path
|
|
76
|
+
d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z"
|
|
77
|
+
stroke="${props.filled ? props.color : props.emptyColor}"
|
|
78
|
+
stroke-width="1.5"
|
|
79
|
+
stroke-linecap="round"
|
|
80
|
+
stroke-linejoin="round"
|
|
81
|
+
/>
|
|
82
|
+
`,
|
|
83
|
+
}),
|
|
84
|
+
]);
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
var script$i = /*@__PURE__*/ vue.defineComponent({
|
|
88
|
+
__name: 'RatingDisplay',
|
|
89
|
+
props: {
|
|
90
|
+
rating: { type: Number, required: true },
|
|
91
|
+
reviewCount: { type: Number, required: false },
|
|
92
|
+
variant: { type: String, required: false, default: 'compact' },
|
|
93
|
+
size: { type: String, required: false, default: 'medium' },
|
|
94
|
+
maxRating: { type: Number, required: false, default: 5 },
|
|
95
|
+
showNumeric: { type: Boolean, required: false, default: false },
|
|
96
|
+
showHalfStars: { type: Boolean, required: false, default: true },
|
|
97
|
+
interactive: { type: Boolean, required: false, default: false },
|
|
98
|
+
starColor: { type: String, required: false, default: '#f59e0b' },
|
|
99
|
+
emptyStarColor: { type: String, required: false, default: '#d1d5db' },
|
|
100
|
+
textColor: { type: String, required: false, default: 'var(--seekora-text-secondary, #6b7280)' },
|
|
101
|
+
showReviewCount: { type: Boolean, required: false, default: true },
|
|
102
|
+
reviewCountFormat: { type: Function, required: false },
|
|
103
|
+
className: { type: String, required: false, default: '' },
|
|
104
|
+
style: { type: null, required: false }
|
|
105
|
+
},
|
|
106
|
+
emits: ["rating-change"],
|
|
107
|
+
setup(__props, { emit: __emit }) {
|
|
108
|
+
const props = __props;
|
|
109
|
+
const emit = __emit;
|
|
110
|
+
const hoverRating = vue.ref(null);
|
|
111
|
+
const sizeMap = {
|
|
112
|
+
small: 14,
|
|
113
|
+
medium: 18,
|
|
114
|
+
large: 24,
|
|
115
|
+
};
|
|
116
|
+
const fontSizeMap = {
|
|
117
|
+
small: '0.75rem',
|
|
118
|
+
medium: '0.875rem',
|
|
119
|
+
large: '1rem',
|
|
120
|
+
};
|
|
121
|
+
const starSize = vue.computed(() => sizeMap[props.size]);
|
|
122
|
+
const fontSize = vue.computed(() => fontSizeMap[props.size]);
|
|
123
|
+
const clampedRating = vue.computed(() => Math.max(0, Math.min(props.maxRating, props.rating)));
|
|
124
|
+
const displayRating = vue.computed(() => props.interactive && hoverRating.value !== null ? hoverRating.value : clampedRating.value);
|
|
125
|
+
const containerStyle = vue.computed(() => {
|
|
126
|
+
const baseStyle = {
|
|
127
|
+
fontSize: fontSize.value,
|
|
128
|
+
...props.style,
|
|
129
|
+
};
|
|
130
|
+
if (props.variant === 'stars-only') {
|
|
131
|
+
return { ...baseStyle, display: 'inline-flex', alignItems: 'center', gap: '2px' };
|
|
132
|
+
}
|
|
133
|
+
else if (props.variant === 'compact' || props.variant === 'inline') {
|
|
134
|
+
return { ...baseStyle, display: 'inline-flex', alignItems: 'center', gap: props.variant === 'inline' ? '6px' : '4px' };
|
|
135
|
+
}
|
|
136
|
+
else if (props.variant === 'full') {
|
|
137
|
+
return { ...baseStyle, display: 'flex', flexDirection: 'column', gap: '4px' };
|
|
138
|
+
}
|
|
139
|
+
return baseStyle;
|
|
140
|
+
});
|
|
141
|
+
const formatReviewCount = (count) => {
|
|
142
|
+
if (props.reviewCountFormat)
|
|
143
|
+
return props.reviewCountFormat(count);
|
|
144
|
+
if (count >= 1000000)
|
|
145
|
+
return `${(count / 1000000).toFixed(1)}M`;
|
|
146
|
+
if (count >= 1000)
|
|
147
|
+
return `${(count / 1000).toFixed(1)}K`;
|
|
148
|
+
return count.toString();
|
|
149
|
+
};
|
|
150
|
+
const handleStarHover = (rating) => {
|
|
151
|
+
if (props.interactive) {
|
|
152
|
+
hoverRating.value = rating;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
const handleStarClick = (rating) => {
|
|
156
|
+
if (props.interactive) {
|
|
157
|
+
hoverRating.value = null;
|
|
158
|
+
emit('rating-change', rating);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const handleMouseLeave = () => {
|
|
162
|
+
if (props.interactive) {
|
|
163
|
+
hoverRating.value = null;
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return (_ctx, _cache) => {
|
|
167
|
+
return (vue.openBlock(), vue.createElementBlock("div", {
|
|
168
|
+
class: vue.normalizeClass(['seekora-rating-display', `seekora-rating-display--${__props.variant}`, __props.className]),
|
|
169
|
+
style: vue.normalizeStyle(containerStyle.value),
|
|
170
|
+
onMouseleave: handleMouseLeave
|
|
171
|
+
}, [
|
|
172
|
+
vue.createCommentVNode(" Stars Only "),
|
|
173
|
+
(__props.variant === 'stars-only')
|
|
174
|
+
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
175
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.maxRating, (i) => {
|
|
176
|
+
return (vue.openBlock(), vue.createBlock(vue.unref(StarIcon), {
|
|
177
|
+
key: i,
|
|
178
|
+
filled: i <= Math.floor(displayRating.value),
|
|
179
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
180
|
+
size: starSize.value,
|
|
181
|
+
color: __props.starColor,
|
|
182
|
+
emptyColor: __props.emptyStarColor,
|
|
183
|
+
interactive: __props.interactive,
|
|
184
|
+
onHover: () => handleStarHover(i),
|
|
185
|
+
onClick: () => handleStarClick(i)
|
|
186
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
187
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
188
|
+
]))
|
|
189
|
+
: (__props.variant === 'compact')
|
|
190
|
+
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
191
|
+
vue.createCommentVNode(" Compact "),
|
|
192
|
+
vue.createElementVNode("div", _hoisted_2$a, [
|
|
193
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.maxRating, (i) => {
|
|
194
|
+
return (vue.openBlock(), vue.createBlock(vue.unref(StarIcon), {
|
|
195
|
+
key: i,
|
|
196
|
+
filled: i <= Math.floor(displayRating.value),
|
|
197
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
198
|
+
size: starSize.value,
|
|
199
|
+
color: __props.starColor,
|
|
200
|
+
emptyColor: __props.emptyStarColor,
|
|
201
|
+
interactive: __props.interactive,
|
|
202
|
+
onHover: () => handleStarHover(i),
|
|
203
|
+
onClick: () => handleStarClick(i)
|
|
204
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
205
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
206
|
+
]),
|
|
207
|
+
(__props.showNumeric)
|
|
208
|
+
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
209
|
+
key: 0,
|
|
210
|
+
class: "seekora-rating-numeric",
|
|
211
|
+
style: vue.normalizeStyle({ fontWeight: 600, color: __props.textColor })
|
|
212
|
+
}, vue.toDisplayString(clampedRating.value.toFixed(1)), 5 /* TEXT, STYLE */))
|
|
213
|
+
: vue.createCommentVNode("v-if", true),
|
|
214
|
+
(__props.showReviewCount && __props.reviewCount != null && __props.reviewCount > 0)
|
|
215
|
+
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
216
|
+
key: 1,
|
|
217
|
+
class: "seekora-rating-review-count",
|
|
218
|
+
style: vue.normalizeStyle({ color: __props.textColor })
|
|
219
|
+
}, " (" + vue.toDisplayString(formatReviewCount(__props.reviewCount)) + ") ", 5 /* TEXT, STYLE */))
|
|
220
|
+
: vue.createCommentVNode("v-if", true)
|
|
221
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
222
|
+
: (__props.variant === 'inline')
|
|
223
|
+
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
224
|
+
vue.createCommentVNode(" Inline "),
|
|
225
|
+
vue.createElementVNode("span", _hoisted_3$7, vue.toDisplayString(clampedRating.value.toFixed(1)), 1 /* TEXT */),
|
|
226
|
+
vue.createElementVNode("div", _hoisted_4$4, [
|
|
227
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.maxRating, (i) => {
|
|
228
|
+
return (vue.openBlock(), vue.createBlock(vue.unref(StarIcon), {
|
|
229
|
+
key: i,
|
|
230
|
+
filled: i <= Math.floor(displayRating.value),
|
|
231
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
232
|
+
size: starSize.value,
|
|
233
|
+
color: __props.starColor,
|
|
234
|
+
emptyColor: __props.emptyStarColor,
|
|
235
|
+
interactive: __props.interactive,
|
|
236
|
+
onHover: () => handleStarHover(i),
|
|
237
|
+
onClick: () => handleStarClick(i)
|
|
238
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
239
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
240
|
+
]),
|
|
241
|
+
(__props.showReviewCount && __props.reviewCount != null && __props.reviewCount > 0)
|
|
242
|
+
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "seekora-rating-review-count",
|
|
245
|
+
style: vue.normalizeStyle({ color: __props.textColor })
|
|
246
|
+
}, " (" + vue.toDisplayString(formatReviewCount(__props.reviewCount)) + ") ", 5 /* TEXT, STYLE */))
|
|
247
|
+
: vue.createCommentVNode("v-if", true)
|
|
248
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
249
|
+
: (__props.variant === 'full')
|
|
250
|
+
? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
|
|
251
|
+
vue.createCommentVNode(" Full "),
|
|
252
|
+
vue.createElementVNode("div", _hoisted_5$2, [
|
|
253
|
+
vue.createElementVNode("div", _hoisted_6$1, [
|
|
254
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.maxRating, (i) => {
|
|
255
|
+
return (vue.openBlock(), vue.createBlock(vue.unref(StarIcon), {
|
|
256
|
+
key: i,
|
|
257
|
+
filled: i <= Math.floor(displayRating.value),
|
|
258
|
+
half: __props.showHalfStars && i === Math.ceil(displayRating.value) && displayRating.value % 1 >= 0.25 && displayRating.value % 1 < 0.75,
|
|
259
|
+
size: starSize.value,
|
|
260
|
+
color: __props.starColor,
|
|
261
|
+
emptyColor: __props.emptyStarColor,
|
|
262
|
+
interactive: __props.interactive,
|
|
263
|
+
onHover: () => handleStarHover(i),
|
|
264
|
+
onClick: () => handleStarClick(i)
|
|
265
|
+
}, null, 8 /* PROPS */, ["filled", "half", "size", "color", "emptyColor", "interactive", "onHover", "onClick"]));
|
|
266
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
267
|
+
]),
|
|
268
|
+
vue.createElementVNode("span", _hoisted_7$1, vue.toDisplayString(clampedRating.value.toFixed(1)), 1 /* TEXT */),
|
|
269
|
+
vue.createElementVNode("span", {
|
|
270
|
+
class: "seekora-rating-max",
|
|
271
|
+
style: vue.normalizeStyle({ color: __props.textColor })
|
|
272
|
+
}, "/ " + vue.toDisplayString(__props.maxRating), 5 /* TEXT, STYLE */)
|
|
273
|
+
]),
|
|
274
|
+
(__props.showReviewCount && __props.reviewCount != null && __props.reviewCount > 0)
|
|
275
|
+
? (vue.openBlock(), vue.createElementBlock("span", {
|
|
276
|
+
key: 0,
|
|
277
|
+
class: "seekora-rating-review-text",
|
|
278
|
+
style: vue.normalizeStyle({ fontSize: '0.875em', color: __props.textColor })
|
|
279
|
+
}, " Based on " + vue.toDisplayString(formatReviewCount(__props.reviewCount)) + " " + vue.toDisplayString(__props.reviewCount === 1 ? 'review' : 'reviews'), 5 /* TEXT, STYLE */))
|
|
280
|
+
: vue.createCommentVNode("v-if", true)
|
|
281
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
282
|
+
: vue.createCommentVNode("v-if", true)
|
|
283
|
+
], 38 /* CLASS, STYLE, NEED_HYDRATION */));
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
script$i.__file = "src/components/RatingDisplay.vue";
|
|
289
|
+
|
|
6
290
|
/**
|
|
7
291
|
* Default Theme
|
|
8
292
|
*/
|
|
@@ -3695,6 +3979,7 @@ exports.InfiniteHits = script$5;
|
|
|
3695
3979
|
exports.Pagination = script$c;
|
|
3696
3980
|
exports.QuerySuggestions = script$e;
|
|
3697
3981
|
exports.RangeInput = script$7;
|
|
3982
|
+
exports.RatingDisplay = script$i;
|
|
3698
3983
|
exports.SearchBar = script$g;
|
|
3699
3984
|
exports.SearchBarWithSuggestions = script$1;
|
|
3700
3985
|
exports.SearchLayout = script;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seekora-ai/ui-sdk-vue",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Seekora UI Components SDK for Vue 3 - Interactive UI components for search and query suggestions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"vue": "^3.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@seekora-ai/ui-sdk-core": "^0.2.
|
|
47
|
-
"@seekora-ai/ui-sdk-types": "^0.2.
|
|
46
|
+
"@seekora-ai/ui-sdk-core": "^0.2.12",
|
|
47
|
+
"@seekora-ai/ui-sdk-types": "^0.2.12"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@seekora-ai/search-sdk": "^0.2.8",
|