@getlupa/vue 0.11.5 → 0.11.7
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/lupaSearch.js
CHANGED
|
@@ -3227,7 +3227,11 @@ const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
|
3227
3227
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
3228
3228
|
const _hoisted_4$s = ["value"];
|
|
3229
3229
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
3230
|
-
const _hoisted_6$9 = {
|
|
3230
|
+
const _hoisted_6$9 = /* @__PURE__ */ vue.createElementVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
3231
|
+
const _hoisted_7$7 = [
|
|
3232
|
+
_hoisted_6$9
|
|
3233
|
+
];
|
|
3234
|
+
const _hoisted_8$3 = {
|
|
3231
3235
|
key: 0,
|
|
3232
3236
|
class: "lupa-close-label"
|
|
3233
3237
|
};
|
|
@@ -3239,7 +3243,7 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3239
3243
|
emitInputOnFocus: { type: Boolean },
|
|
3240
3244
|
suggestedValue: {}
|
|
3241
3245
|
},
|
|
3242
|
-
emits: ["input", "focus"],
|
|
3246
|
+
emits: ["input", "focus", "search"],
|
|
3243
3247
|
setup(__props, { expose: __expose, emit }) {
|
|
3244
3248
|
const props = __props;
|
|
3245
3249
|
const paramStore = useParamsStore();
|
|
@@ -3300,6 +3304,9 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3300
3304
|
handleInput();
|
|
3301
3305
|
}
|
|
3302
3306
|
};
|
|
3307
|
+
const handleSubmit = () => {
|
|
3308
|
+
emit("search", { query: inputValue.value });
|
|
3309
|
+
};
|
|
3303
3310
|
const clear = () => {
|
|
3304
3311
|
emit("input", "");
|
|
3305
3312
|
};
|
|
@@ -3341,14 +3348,18 @@ const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
|
|
|
3341
3348
|
onFocus: handleFocus
|
|
3342
3349
|
}), null, 16, _hoisted_5$h), [
|
|
3343
3350
|
[vue.vModelText, inputValue.value]
|
|
3344
|
-
])
|
|
3351
|
+
]),
|
|
3352
|
+
_ctx.options.showSubmitButton ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
3353
|
+
key: 0,
|
|
3354
|
+
onClick: handleSubmit
|
|
3355
|
+
}, _hoisted_7$7)) : vue.createCommentVNode("", true)
|
|
3345
3356
|
]),
|
|
3346
3357
|
_ctx.canClose ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
3347
3358
|
key: 0,
|
|
3348
3359
|
class: "lupa-close-search-container",
|
|
3349
3360
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
3350
3361
|
}, [
|
|
3351
|
-
labels.value.close ? (vue.openBlock(), vue.createElementBlock("span",
|
|
3362
|
+
labels.value.close ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_8$3, vue.toDisplayString(labels.value.close), 1)) : vue.createCommentVNode("", true)
|
|
3352
3363
|
])) : vue.createCommentVNode("", true)
|
|
3353
3364
|
]);
|
|
3354
3365
|
};
|
|
@@ -5429,7 +5440,13 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
|
5429
5440
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
5430
5441
|
});
|
|
5431
5442
|
const inputOptions = vue.computed(
|
|
5432
|
-
() => pick(props.options, [
|
|
5443
|
+
() => pick(props.options, [
|
|
5444
|
+
"minInputLength",
|
|
5445
|
+
"labels",
|
|
5446
|
+
"links",
|
|
5447
|
+
"inputAttributes",
|
|
5448
|
+
"showSubmitButton"
|
|
5449
|
+
])
|
|
5433
5450
|
);
|
|
5434
5451
|
const panelOptions = vue.computed(
|
|
5435
5452
|
() => pick(props.options, [
|
|
@@ -5656,6 +5673,7 @@ const _sfc_main$V = /* @__PURE__ */ vue.defineComponent({
|
|
|
5656
5673
|
ref: searchBoxInput,
|
|
5657
5674
|
onInput: handleInput,
|
|
5658
5675
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
5676
|
+
onSearch: handleSearch,
|
|
5659
5677
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
5660
5678
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
5661
5679
|
opened.value || _ctx.isSearchContainer ? (vue.openBlock(), vue.createBlock(_sfc_main$W, {
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -37,7 +37,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
37
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
import { toRaw, isRef, isReactive, toRef, effectScope, ref, markRaw, hasInjectionContext, inject, getCurrentInstance, watch, reactive, nextTick, computed, unref, getCurrentScope, onScopeDispose, toRefs, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, mergeProps, vModelText,
|
|
40
|
+
import { toRaw, isRef, isReactive, toRef, effectScope, ref, markRaw, hasInjectionContext, inject, getCurrentInstance, watch, reactive, nextTick, computed, unref, getCurrentScope, onScopeDispose, toRefs, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, withDirectives, mergeProps, vModelText, createCommentVNode, toDisplayString, onMounted, onBeforeMount, Fragment, renderList, createBlock, onBeforeUnmount, createVNode, Transition, withCtx, toHandlers, withModifiers, resolveDynamicComponent, renderSlot, normalizeStyle, createSlots, normalizeProps, guardReactiveProps, createTextVNode, onUnmounted, resolveComponent, vModelSelect, h as h$1, provide, cloneVNode } from "vue";
|
|
41
41
|
var isVue2 = false;
|
|
42
42
|
function set(target, key, val) {
|
|
43
43
|
if (Array.isArray(target)) {
|
|
@@ -3225,7 +3225,11 @@ const _hoisted_2$Q = { class: "lupa-input-clear" };
|
|
|
3225
3225
|
const _hoisted_3$A = { id: "lupa-search-box-input" };
|
|
3226
3226
|
const _hoisted_4$s = ["value"];
|
|
3227
3227
|
const _hoisted_5$h = ["aria-label", "placeholder"];
|
|
3228
|
-
const _hoisted_6$9 = {
|
|
3228
|
+
const _hoisted_6$9 = /* @__PURE__ */ createElementVNode("span", { class: "lupa-search-submit-icon" }, null, -1);
|
|
3229
|
+
const _hoisted_7$7 = [
|
|
3230
|
+
_hoisted_6$9
|
|
3231
|
+
];
|
|
3232
|
+
const _hoisted_8$3 = {
|
|
3229
3233
|
key: 0,
|
|
3230
3234
|
class: "lupa-close-label"
|
|
3231
3235
|
};
|
|
@@ -3237,7 +3241,7 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3237
3241
|
emitInputOnFocus: { type: Boolean },
|
|
3238
3242
|
suggestedValue: {}
|
|
3239
3243
|
},
|
|
3240
|
-
emits: ["input", "focus"],
|
|
3244
|
+
emits: ["input", "focus", "search"],
|
|
3241
3245
|
setup(__props, { expose: __expose, emit }) {
|
|
3242
3246
|
const props = __props;
|
|
3243
3247
|
const paramStore = useParamsStore();
|
|
@@ -3298,6 +3302,9 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3298
3302
|
handleInput();
|
|
3299
3303
|
}
|
|
3300
3304
|
};
|
|
3305
|
+
const handleSubmit = () => {
|
|
3306
|
+
emit("search", { query: inputValue.value });
|
|
3307
|
+
};
|
|
3301
3308
|
const clear = () => {
|
|
3302
3309
|
emit("input", "");
|
|
3303
3310
|
};
|
|
@@ -3339,14 +3346,18 @@ const _sfc_main$1m = /* @__PURE__ */ defineComponent({
|
|
|
3339
3346
|
onFocus: handleFocus
|
|
3340
3347
|
}), null, 16, _hoisted_5$h), [
|
|
3341
3348
|
[vModelText, inputValue.value]
|
|
3342
|
-
])
|
|
3349
|
+
]),
|
|
3350
|
+
_ctx.options.showSubmitButton ? (openBlock(), createElementBlock("button", {
|
|
3351
|
+
key: 0,
|
|
3352
|
+
onClick: handleSubmit
|
|
3353
|
+
}, _hoisted_7$7)) : createCommentVNode("", true)
|
|
3343
3354
|
]),
|
|
3344
3355
|
_ctx.canClose ? (openBlock(), createElementBlock("div", {
|
|
3345
3356
|
key: 0,
|
|
3346
3357
|
class: "lupa-close-search-container",
|
|
3347
3358
|
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
3348
3359
|
}, [
|
|
3349
|
-
labels.value.close ? (openBlock(), createElementBlock("span",
|
|
3360
|
+
labels.value.close ? (openBlock(), createElementBlock("span", _hoisted_8$3, toDisplayString(labels.value.close), 1)) : createCommentVNode("", true)
|
|
3350
3361
|
])) : createCommentVNode("", true)
|
|
3351
3362
|
]);
|
|
3352
3363
|
};
|
|
@@ -5427,7 +5438,13 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
5427
5438
|
return suggestedValue.value.override ? suggestedValue.value.item.suggestion : inputValue.value;
|
|
5428
5439
|
});
|
|
5429
5440
|
const inputOptions = computed(
|
|
5430
|
-
() => pick(props.options, [
|
|
5441
|
+
() => pick(props.options, [
|
|
5442
|
+
"minInputLength",
|
|
5443
|
+
"labels",
|
|
5444
|
+
"links",
|
|
5445
|
+
"inputAttributes",
|
|
5446
|
+
"showSubmitButton"
|
|
5447
|
+
])
|
|
5431
5448
|
);
|
|
5432
5449
|
const panelOptions = computed(
|
|
5433
5450
|
() => pick(props.options, [
|
|
@@ -5654,6 +5671,7 @@ const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
|
5654
5671
|
ref: searchBoxInput,
|
|
5655
5672
|
onInput: handleInput,
|
|
5656
5673
|
onFocus: _cache[0] || (_cache[0] = ($event) => opened.value = true),
|
|
5674
|
+
onSearch: handleSearch,
|
|
5657
5675
|
onClose: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("close"))
|
|
5658
5676
|
}, null, 8, ["options", "suggestedValue", "can-close", "emit-input-on-focus"]),
|
|
5659
5677
|
opened.value || _ctx.isSearchContainer ? (openBlock(), createBlock(_sfc_main$W, {
|
|
@@ -18,7 +18,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
18
18
|
type: __PropType<InputSuggestion>;
|
|
19
19
|
required: true;
|
|
20
20
|
};
|
|
21
|
-
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "focus")[], "input" | "focus", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("input" | "search" | "focus")[], "input" | "search" | "focus", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
22
|
options: {
|
|
23
23
|
type: __PropType<SearchBoxInputOptions>;
|
|
24
24
|
required: true;
|
|
@@ -37,6 +37,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
37
37
|
};
|
|
38
38
|
}>> & {
|
|
39
39
|
onInput?: (...args: any[]) => any;
|
|
40
|
+
onSearch?: (...args: any[]) => any;
|
|
40
41
|
onFocus?: (...args: any[]) => any;
|
|
41
42
|
}, {}, {}>;
|
|
42
43
|
export default _sfc_main;
|
|
@@ -35,6 +35,7 @@ export type SearchBoxInputOptions = {
|
|
|
35
35
|
labels: SearchBoxOptionLabels;
|
|
36
36
|
links: SearchBoxOptionLinks;
|
|
37
37
|
inputAttributes?: Record<string, string>;
|
|
38
|
+
showSubmitButton?: boolean;
|
|
38
39
|
};
|
|
39
40
|
export type SearchBoxResultCallbackContext = {
|
|
40
41
|
hasAnyResults?: boolean;
|