@mekari/pixel3-autocomplete 0.0.0

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.
@@ -0,0 +1,639 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/autocomplete.tsx
22
+ var autocomplete_exports = {};
23
+ __export(autocomplete_exports, {
24
+ MpAutocomplete: () => MpAutocomplete
25
+ });
26
+ module.exports = __toCommonJS(autocomplete_exports);
27
+ var import_vue2 = require("vue");
28
+ var import_vue3 = require("vue");
29
+ var import_pixel3_popover = require("@mekari/pixel3-popover");
30
+ var import_pixel3_input = require("@mekari/pixel3-input");
31
+ var import_pixel3_spinner = require("@mekari/pixel3-spinner");
32
+ var import_pixel3_icon = require("@mekari/pixel3-icon");
33
+ var import_pixel3_text = require("@mekari/pixel3-text");
34
+
35
+ // src/modules/autocomplete.props.ts
36
+ var autocompleteProps = {
37
+ id: {
38
+ type: String,
39
+ default: ""
40
+ },
41
+ data: {
42
+ type: [Array],
43
+ default: () => []
44
+ },
45
+ modelValue: {
46
+ type: [Number, String, Object, Array]
47
+ },
48
+ defaultValue: [Number, String, Object],
49
+ placeholder: {
50
+ type: String
51
+ },
52
+ labelProp: {
53
+ type: String,
54
+ default: "value"
55
+ },
56
+ valueProp: {
57
+ type: String,
58
+ default: "value"
59
+ },
60
+ isReadOnly: {
61
+ type: [Boolean],
62
+ default: false
63
+ },
64
+ isDisabled: {
65
+ type: [Boolean],
66
+ default: false
67
+ },
68
+ isInvalid: {
69
+ type: [Boolean],
70
+ default: false
71
+ },
72
+ isRequired: {
73
+ type: [Boolean],
74
+ default: false
75
+ },
76
+ isFullWidth: {
77
+ type: [Boolean],
78
+ default: true
79
+ },
80
+ isLoading: {
81
+ type: [Boolean],
82
+ default: false
83
+ },
84
+ isContentLoading: {
85
+ type: [Boolean],
86
+ default: false
87
+ },
88
+ isClearable: {
89
+ type: [Boolean],
90
+ default: false
91
+ },
92
+ isSearchable: {
93
+ type: [Boolean],
94
+ default: false
95
+ },
96
+ contentAttrs: {
97
+ type: Object
98
+ },
99
+ emptyText: {
100
+ type: [String],
101
+ default: "No result found"
102
+ },
103
+ contentLoadingText: {
104
+ type: [String],
105
+ default: "Loading"
106
+ },
107
+ isInfinityScroll: {
108
+ type: [Boolean],
109
+ default: false
110
+ },
111
+ isManualFilter: {
112
+ type: [Boolean],
113
+ default: false
114
+ },
115
+ usePortal: {
116
+ type: Boolean,
117
+ default: false
118
+ },
119
+ isShowButtonAction: {
120
+ type: Boolean,
121
+ default: false
122
+ },
123
+ buttonActionText: {
124
+ type: String,
125
+ default: "Button"
126
+ },
127
+ isGroupSuggestions: {
128
+ type: Boolean,
129
+ default: false
130
+ },
131
+ groupKey: {
132
+ type: String,
133
+ default: "group"
134
+ },
135
+ keyCode: {
136
+ type: Array,
137
+ default: () => ["Enter"]
138
+ },
139
+ isRawValue: {
140
+ type: [Boolean],
141
+ default: false
142
+ },
143
+ isListItemActiveFunction: {
144
+ type: Function
145
+ },
146
+ isKeepAlive: {
147
+ type: Boolean,
148
+ default: true
149
+ },
150
+ isAdaptiveWidth: {
151
+ type: Boolean,
152
+ default: true
153
+ }
154
+ };
155
+
156
+ // src/modules/autocomplete.hooks.ts
157
+ var import_vue = require("vue");
158
+ var import_pixel3_utils = require("@mekari/pixel3-utils");
159
+ var import_css = require("@mekari/pixel3-styled-system/css");
160
+ function useAutocomplete(props, emit) {
161
+ const {
162
+ data,
163
+ usePortal,
164
+ isKeepAlive,
165
+ isClearable,
166
+ isSearchable,
167
+ isReadOnly,
168
+ isFullWidth,
169
+ labelProp,
170
+ valueProp,
171
+ isInfinityScroll,
172
+ placeholder,
173
+ isAdaptiveWidth
174
+ } = (0, import_vue.toRefs)(props);
175
+ const scrollEndNode = (0, import_vue.ref)();
176
+ const currentValue = (0, import_vue.ref)();
177
+ const currentLabel = (0, import_vue.ref)("");
178
+ const currentCursor = (0, import_vue.ref)("");
179
+ const currentSearch = (0, import_vue.ref)("");
180
+ const isOutside = (0, import_vue.ref)(true);
181
+ const isPopoverOpen = (0, import_vue.ref)(false);
182
+ const {
183
+ resume: enableIntersectionObserver,
184
+ pause: disableIntersectionObserver
185
+ } = (0, import_pixel3_utils.useIntersectionObserver)(scrollEndNode, ([{
186
+ isIntersecting
187
+ }]) => {
188
+ if (isIntersecting) {
189
+ emit("scrollEnd");
190
+ }
191
+ });
192
+ const getId = props.id || (0, import_pixel3_utils.getUniqueId)("", "autocomplete").value;
193
+ const getSuggestionDatas = (0, import_vue.computed)(() => {
194
+ const datas = data.value || [];
195
+ if (props.isManualFilter)
196
+ return datas;
197
+ if (!currentSearch.value)
198
+ return datas;
199
+ if (currentSearch.value === currentLabel.value)
200
+ return datas;
201
+ return datas.filter((item) => {
202
+ const label = getLabel(item).toLocaleLowerCase();
203
+ const search = currentSearch.value.toLocaleLowerCase();
204
+ return label.includes(search);
205
+ });
206
+ });
207
+ const getGroupSuggestions = (0, import_vue.computed)(() => {
208
+ const mapped = getSuggestionDatas.value.map((item, index) => {
209
+ const groupKey = item[props.groupKey];
210
+ const isUncategorized = /* @__PURE__ */ __name((value) => {
211
+ if ((0, import_pixel3_utils.isUndef)(value) || value === "")
212
+ return true;
213
+ return false;
214
+ }, "isUncategorized");
215
+ return {
216
+ ...item,
217
+ index,
218
+ [props.groupKey]: isUncategorized(groupKey) ? "UNCATEGORIZED" : groupKey
219
+ };
220
+ });
221
+ const grouped = (0, import_pixel3_utils.groupBy)(mapped, props.groupKey);
222
+ const keys = Object.keys(grouped);
223
+ const results = keys.map((item) => {
224
+ return {
225
+ key: item,
226
+ values: grouped[item]
227
+ };
228
+ });
229
+ return results;
230
+ });
231
+ const getValueOfSuggestions = (0, import_vue.computed)(() => {
232
+ if (props.isRawValue)
233
+ return getSuggestionDatas.value;
234
+ const isArrayOfObject = getSuggestionDatas.value.some((item) => (0, import_pixel3_utils.isObject)(item));
235
+ if (isArrayOfObject) {
236
+ return getSuggestionDatas.value.map((item) => item[valueProp.value]);
237
+ }
238
+ return getSuggestionDatas.value;
239
+ });
240
+ const getCursorPosition = (0, import_vue.computed)(() => getValueOfSuggestions.value.findIndex((item) => (0, import_pixel3_utils.isEqual)(getValue(item), currentCursor.value)));
241
+ function onOpenPopover(e) {
242
+ isPopoverOpen.value = true;
243
+ if (isSearchable.value) {
244
+ const target = e.target;
245
+ target.setSelectionRange(0, target.value.length || 0);
246
+ }
247
+ if (props.modelValue) {
248
+ currentCursor.value = getValue(props.modelValue);
249
+ (0, import_vue.nextTick)(() => {
250
+ handleAdjustScrollPosition();
251
+ });
252
+ } else {
253
+ handleSetFirstSuggestion();
254
+ }
255
+ if (isInfinityScroll.value) {
256
+ enableIntersectionObserver();
257
+ }
258
+ }
259
+ __name(onOpenPopover, "onOpenPopover");
260
+ function onBlur() {
261
+ isPopoverOpen.value = false;
262
+ const inputEl = document.getElementById(`${getId}-control`);
263
+ inputEl == null ? void 0 : inputEl.blur();
264
+ if (isInfinityScroll.value) {
265
+ disableIntersectionObserver();
266
+ }
267
+ }
268
+ __name(onBlur, "onBlur");
269
+ function onInputChange(e) {
270
+ const target = e.target;
271
+ currentSearch.value = target.value;
272
+ onSearchChange();
273
+ emit("input", e);
274
+ }
275
+ __name(onInputChange, "onInputChange");
276
+ function onSelectListItem(value) {
277
+ const innerValue = getValue(value);
278
+ emit("update:modelValue", innerValue);
279
+ emit("change", innerValue);
280
+ onBlur();
281
+ }
282
+ __name(onSelectListItem, "onSelectListItem");
283
+ function onSearchChange() {
284
+ (0, import_vue.nextTick)(() => {
285
+ const hasSearchAndResult = currentSearch.value && getValueOfSuggestions.value.length;
286
+ const isEqualSearchAndLabel = currentSearch.value === currentLabel.value;
287
+ const emptySearchButHaveLabel = !currentSearch.value && currentLabel.value;
288
+ if (hasSearchAndResult) {
289
+ if (isEqualSearchAndLabel) {
290
+ currentCursor.value = currentValue.value;
291
+ handleAdjustScrollPosition();
292
+ } else {
293
+ handleSetFirstSuggestion();
294
+ }
295
+ }
296
+ if (emptySearchButHaveLabel) {
297
+ currentCursor.value = currentValue.value;
298
+ handleAdjustScrollPosition();
299
+ }
300
+ });
301
+ }
302
+ __name(onSearchChange, "onSearchChange");
303
+ function onModelValueChange() {
304
+ const data2 = props.data.find((item) => {
305
+ return (0, import_pixel3_utils.isEqual)(getValue(item), props.modelValue);
306
+ });
307
+ if (data2) {
308
+ currentValue.value = props.modelValue;
309
+ currentLabel.value = getLabel(data2);
310
+ currentSearch.value = getLabel(data2);
311
+ }
312
+ }
313
+ __name(onModelValueChange, "onModelValueChange");
314
+ function handleForceFocusToInput() {
315
+ const inputEl = document.getElementById(`${getId}-control`);
316
+ inputEl == null ? void 0 : inputEl.focus();
317
+ }
318
+ __name(handleForceFocusToInput, "handleForceFocusToInput");
319
+ function onKeydown(e) {
320
+ if (e.code === "Enter") {
321
+ if (getSuggestionDatas.value.length) {
322
+ onSelectListItem(currentCursor.value);
323
+ emit("enter", getSuggestionDatas.value, currentSearch.value);
324
+ } else {
325
+ emit("enter", getSuggestionDatas.value, currentSearch.value);
326
+ onBlur();
327
+ }
328
+ }
329
+ if (e.code === "ArrowDown") {
330
+ e.preventDefault();
331
+ e.stopPropagation();
332
+ const totalData = getSuggestionDatas.value.length - 1;
333
+ const position = getCursorPosition.value;
334
+ const isLastPosition = totalData === position;
335
+ if (!isLastPosition) {
336
+ const nextPosition = position + 1;
337
+ currentCursor.value = getValueOfSuggestions.value[nextPosition];
338
+ handleAdjustScrollPosition();
339
+ }
340
+ }
341
+ if (e.code === "ArrowUp") {
342
+ e.preventDefault();
343
+ e.stopPropagation();
344
+ const position = getCursorPosition.value;
345
+ const isFirstPosition = position === 0;
346
+ if (!isFirstPosition) {
347
+ const nextPosition = position - 1;
348
+ currentCursor.value = getValueOfSuggestions.value[nextPosition];
349
+ handleAdjustScrollPosition();
350
+ }
351
+ }
352
+ }
353
+ __name(onKeydown, "onKeydown");
354
+ async function handleAdjustScrollPosition() {
355
+ const position = getValueOfSuggestions.value.indexOf(currentCursor.value);
356
+ const containerElement = document.getElementById(`popover-content-${getId}`);
357
+ const targetElement = containerElement == null ? void 0 : containerElement.querySelector(`[data-index="${position}"]`);
358
+ if ((0, import_pixel3_utils.isDef)(targetElement)) {
359
+ const isVisible = await (0, import_pixel3_utils.isElementVisible)(targetElement);
360
+ const getPosition = /* @__PURE__ */ __name(() => {
361
+ if (getCursorPosition.value === 0)
362
+ return "top";
363
+ if (props.data.length === getCursorPosition.value + 1)
364
+ return "bottom";
365
+ return void 0;
366
+ }, "getPosition");
367
+ if (!isVisible) {
368
+ (0, import_vue.nextTick)(() => {
369
+ (0, import_pixel3_utils.scrollToTargetElement)(targetElement, containerElement, getPosition());
370
+ });
371
+ }
372
+ }
373
+ }
374
+ __name(handleAdjustScrollPosition, "handleAdjustScrollPosition");
375
+ function handleSetFirstSuggestion() {
376
+ currentCursor.value = getValueOfSuggestions.value[0] || "";
377
+ handleAdjustScrollPosition();
378
+ }
379
+ __name(handleSetFirstSuggestion, "handleSetFirstSuggestion");
380
+ function getValue(value) {
381
+ if (props.isRawValue)
382
+ return value;
383
+ return (0, import_pixel3_utils.isObject)(value) ? value[valueProp.value] : value;
384
+ }
385
+ __name(getValue, "getValue");
386
+ function getLabel(value) {
387
+ return (0, import_pixel3_utils.isObject)(value) ? value[labelProp.value] : value;
388
+ }
389
+ __name(getLabel, "getLabel");
390
+ function isListItemActive(item) {
391
+ if (props.isListItemActiveFunction)
392
+ return props.isListItemActiveFunction(props.modelValue, item);
393
+ return (0, import_pixel3_utils.isEqual)(props.modelValue, getValue(item));
394
+ }
395
+ __name(isListItemActive, "isListItemActive");
396
+ const rootAtrrs = (0, import_vue.computed)(() => {
397
+ return {
398
+ style: {
399
+ width: "100%",
400
+ position: "relative"
401
+ },
402
+ onMouseenter: () => {
403
+ isOutside.value = false;
404
+ },
405
+ onMouseleave: () => {
406
+ isOutside.value = true;
407
+ }
408
+ };
409
+ });
410
+ const popoverAtrrs = (0, import_vue.computed)(() => {
411
+ return {
412
+ id: getId,
413
+ isManual: true,
414
+ isOpen: isPopoverOpen.value,
415
+ usePortal: usePortal.value,
416
+ isKeepAlive: isKeepAlive.value,
417
+ isAdaptiveWidth: isAdaptiveWidth.value
418
+ };
419
+ });
420
+ const popoverContentAtrrs = (0, import_vue.computed)(() => {
421
+ return {
422
+ class: (0, import_css.css)({
423
+ maxHeight: "300px",
424
+ overflowY: "auto",
425
+ position: "relative"
426
+ }),
427
+ onClick: handleForceFocusToInput,
428
+ ...props.contentAttrs
429
+ };
430
+ });
431
+ const inputAtrrs = (0, import_vue.computed)(() => {
432
+ return {
433
+ // key: currentLabel.value,
434
+ id: getId,
435
+ modelValue: currentLabel.value,
436
+ isClearable: isClearable.value,
437
+ autocomplete: "off",
438
+ isReadOnly: !isSearchable.value || isReadOnly.value,
439
+ isFullWidth: isFullWidth.value,
440
+ placeholder: placeholder == null ? void 0 : placeholder.value,
441
+ onInput: onInputChange,
442
+ onKeydown,
443
+ onFocus: onOpenPopover,
444
+ onBlur: () => {
445
+ if (isOutside.value) {
446
+ onBlur();
447
+ }
448
+ }
449
+ };
450
+ });
451
+ const buttonActionAttrs = (0, import_vue.computed)(() => {
452
+ return {
453
+ class: (0, import_css.css)({
454
+ cursor: "pointer",
455
+ width: "full",
456
+ textAlign: "center",
457
+ roundedTop: "0",
458
+ borderTopWidth: "1px",
459
+ borderColor: "blue.50",
460
+ color: "blue.400",
461
+ position: "sticky",
462
+ bottom: "0px",
463
+ bg: "white",
464
+ fontSize: "md",
465
+ zIndex: "999",
466
+ py: 2,
467
+ height: "9.5",
468
+ _hover: {
469
+ color: "blue.500"
470
+ }
471
+ }),
472
+ onClick: (e) => {
473
+ e.stopPropagation();
474
+ emit("buttonAction", getSuggestionDatas.value, currentSearch.value);
475
+ isOutside.value = true;
476
+ onBlur();
477
+ }
478
+ };
479
+ });
480
+ const emptyTextAttrs = {
481
+ color: "gray.400",
482
+ class: (0, import_css.css)({
483
+ px: 3,
484
+ py: 2
485
+ })
486
+ };
487
+ const contentLoadingAttrs = {
488
+ class: (0, import_css.css)({
489
+ px: 3,
490
+ py: 2,
491
+ display: "flex",
492
+ alignItems: "center",
493
+ gap: 3
494
+ })
495
+ };
496
+ const popoverListItemAttrs = /* @__PURE__ */ __name((item, index) => {
497
+ const innerValue = getValue(item);
498
+ return {
499
+ onClick: (e) => {
500
+ e.stopPropagation();
501
+ onSelectListItem(item);
502
+ },
503
+ onMouseenter: () => currentCursor.value = innerValue,
504
+ isActive: isListItemActive(item),
505
+ "data-highlight": (0, import_pixel3_utils.isEqual)(innerValue, currentCursor.value) ? true : void 0,
506
+ "data-index": index,
507
+ "aria-selected": isListItemActive(item) ? true : void 0
508
+ };
509
+ }, "popoverListItemAttrs");
510
+ (0, import_vue.watch)(() => props.modelValue, (newValue) => {
511
+ if (newValue)
512
+ onModelValueChange();
513
+ });
514
+ (0, import_vue.watch)(() => props.data, () => {
515
+ if (props.isManualFilter && isPopoverOpen.value) {
516
+ (0, import_vue.nextTick)(() => {
517
+ handleSetFirstSuggestion();
518
+ });
519
+ }
520
+ });
521
+ (0, import_vue.onMounted)(() => {
522
+ if (props.modelValue)
523
+ onModelValueChange();
524
+ });
525
+ return {
526
+ currentSearch,
527
+ scrollEndNode,
528
+ getSuggestionDatas,
529
+ getGroupSuggestions,
530
+ rootAtrrs,
531
+ popoverAtrrs,
532
+ popoverContentAtrrs,
533
+ inputAtrrs,
534
+ buttonActionAttrs,
535
+ emptyTextAttrs,
536
+ contentLoadingAttrs,
537
+ popoverListItemAttrs,
538
+ getLabel
539
+ };
540
+ }
541
+ __name(useAutocomplete, "useAutocomplete");
542
+
543
+ // src/autocomplete.tsx
544
+ var import_patterns = require("@mekari/pixel3-styled-system/patterns");
545
+ var import_css2 = require("@mekari/pixel3-styled-system/css");
546
+ var MpAutocomplete = (0, import_vue3.defineComponent)({
547
+ name: "MpAutocomplete",
548
+ props: autocompleteProps,
549
+ emits: ["update:modelValue", "input", "change", "enter", "scrollEnd", "buttonAction"],
550
+ setup(props, {
551
+ emit,
552
+ slots
553
+ }) {
554
+ const {
555
+ getSuggestionDatas,
556
+ getGroupSuggestions,
557
+ currentSearch,
558
+ scrollEndNode,
559
+ rootAtrrs,
560
+ popoverAtrrs,
561
+ popoverContentAtrrs,
562
+ inputAtrrs,
563
+ buttonActionAttrs,
564
+ emptyTextAttrs,
565
+ contentLoadingAttrs,
566
+ popoverListItemAttrs,
567
+ getLabel
568
+ } = useAutocomplete(props, emit);
569
+ return () => {
570
+ const suggestionsNode = !props.isGroupSuggestions ? getSuggestionDatas.value.map((item, index) => {
571
+ return (0, import_vue2.createVNode)(import_pixel3_popover.MpPopoverListItem, popoverListItemAttrs(item, index), {
572
+ default: () => [slots.default ? slots.default({
573
+ item
574
+ }) : getLabel(item)]
575
+ });
576
+ }) : getGroupSuggestions.value.map((group, groupIndex) => {
577
+ return (0, import_vue2.createVNode)("div", {
578
+ "key": groupIndex,
579
+ "data-category": group.key,
580
+ "class": (0, import_patterns.flex)({
581
+ direction: "column",
582
+ alignItems: "start",
583
+ width: "full"
584
+ })
585
+ }, [slots.group ? slots.group({
586
+ group
587
+ }) : (0, import_vue2.createVNode)(import_pixel3_text.MpText, {
588
+ "size": "body-small",
589
+ "color": "gray.600",
590
+ "class": (0, import_css2.css)({
591
+ px: 3,
592
+ py: 2
593
+ })
594
+ }, {
595
+ default: () => [group.key]
596
+ }), group.values.map((item) => {
597
+ return (0, import_vue2.createVNode)(import_pixel3_popover.MpPopoverListItem, popoverListItemAttrs(item, item.index), {
598
+ default: () => [slots.default ? slots.default({
599
+ item
600
+ }) : getLabel(item)]
601
+ });
602
+ })]);
603
+ });
604
+ const buttonActionNode = props.isShowButtonAction && (0, import_vue2.createVNode)("button", buttonActionAttrs.value, [(0, import_vue2.createTextVNode)(" "), slots.buttonAction ? slots.buttonAction(getSuggestionDatas.value, currentSearch.value) : props.buttonActionText, (0, import_vue2.createTextVNode)(" ")]);
605
+ const emptyTextNode = (0, import_vue2.createVNode)(import_pixel3_text.MpText, emptyTextAttrs, {
606
+ default: () => [(0, import_vue2.createTextVNode)(" "), props.emptyText, (0, import_vue2.createTextVNode)(" ")]
607
+ });
608
+ const contentLoadingNode = props.isContentLoading && (0, import_vue2.createVNode)("div", contentLoadingAttrs, [(0, import_vue2.createVNode)(import_pixel3_spinner.MpSpinner, {
609
+ "size": "md"
610
+ }, null), (0, import_vue2.createVNode)(import_pixel3_text.MpText, null, {
611
+ default: () => [(0, import_vue2.createTextVNode)(" "), props.contentLoadingText, (0, import_vue2.createTextVNode)(" ")]
612
+ })]);
613
+ return (0, import_vue2.createVNode)("div", rootAtrrs.value, [(0, import_vue2.createVNode)(import_pixel3_popover.MpPopover, popoverAtrrs.value, {
614
+ default: () => [(0, import_vue2.createVNode)(import_pixel3_popover.MpPopoverTrigger, null, {
615
+ default: () => [(0, import_vue2.createVNode)(import_pixel3_input.MpInputGroup, null, {
616
+ default: () => [slots.leftAddon && (0, import_vue2.createVNode)(import_pixel3_input.MpInputLeftAddon, null, {
617
+ default: () => [(0, import_vue2.createTextVNode)(" "), slots.leftAddon(), (0, import_vue2.createTextVNode)(" ")]
618
+ }), (0, import_vue2.createVNode)(import_pixel3_input.MpInput, inputAtrrs.value, null), (0, import_vue2.createVNode)(import_pixel3_input.MpInputRightAddon, null, {
619
+ default: () => [props.isLoading ? (0, import_vue2.createVNode)(import_pixel3_spinner.MpSpinner, null, null) : (0, import_vue2.createVNode)(import_pixel3_icon.MpIcon, {
620
+ "name": "chevrons-down",
621
+ "size": "sm"
622
+ }, null)]
623
+ })]
624
+ })]
625
+ }), (0, import_vue2.createVNode)(import_pixel3_popover.MpPopoverContent, popoverContentAtrrs.value, {
626
+ default: () => [(0, import_vue2.createVNode)(import_pixel3_popover.MpPopoverList, null, {
627
+ default: () => [getSuggestionDatas.value.length === 0 ? emptyTextNode : suggestionsNode, contentLoadingNode]
628
+ }), props.isInfinityScroll && (0, import_vue2.createVNode)("div", {
629
+ "ref": scrollEndNode
630
+ }, null), buttonActionNode]
631
+ })]
632
+ })]);
633
+ };
634
+ }
635
+ });
636
+ // Annotate the CommonJS export names for ESM import in node:
637
+ 0 && (module.exports = {
638
+ MpAutocomplete
639
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ MpAutocomplete
3
+ } from "./chunk-XA465WRM.mjs";
4
+ import "./chunk-YGOZYS5H.mjs";
5
+ import "./chunk-OX7ZBBEQ.mjs";
6
+ import "./chunk-QZ7VFGWC.mjs";
7
+ export {
8
+ MpAutocomplete
9
+ };