@youcan/celeste 0.6.23 → 0.6.25
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/celeste.css +138 -118
- package/dist/cjs/combobox-list.js +2 -3
- package/dist/cjs/combobox-root.js +39 -2
- package/dist/cjs/combobox-trigger.js +1 -1
- package/dist/cjs/combobox.js +25 -15
- package/dist/cjs/dropdown.js +1 -1
- package/dist/cjs/index.js +3 -3
- package/dist/components/combobox/combobox.d.ts +1 -0
- package/dist/es/chunks/index.js +2 -2
- package/dist/es/combobox-list.js +3 -4
- package/dist/es/combobox-root.js +39 -2
- package/dist/es/combobox-trigger.js +1 -1
- package/dist/es/combobox.js +27 -17
- package/dist/es/command-root.js +1 -1
- package/dist/es/dropdown.js +2 -2
- package/dist/es/index.js +45 -45
- package/package.json +3 -3
- package/src/components/combobox/combobox-list.vue +35 -15
- package/src/components/combobox/combobox-root.vue +7 -1
- package/src/components/combobox/combobox-trigger.vue +1 -1
- package/src/components/combobox/combobox.vue +22 -3
- package/src/components/dropdown/dropdown.vue +1 -1
- package/dist/cjs/chunks/combobox-root.js +0 -38
- package/dist/es/chunks/combobox-root.js +0 -39
|
@@ -1,3 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const Mo = require("vue");
|
|
3
|
+
const index = require("./chunks/index.js");
|
|
4
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
6
|
+
__name: "combobox-root",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {},
|
|
9
|
+
defaultValue: {},
|
|
10
|
+
open: { type: Boolean },
|
|
11
|
+
defaultOpen: { type: Boolean },
|
|
12
|
+
searchTerm: {},
|
|
13
|
+
selectedValue: {},
|
|
14
|
+
multiple: { type: Boolean },
|
|
15
|
+
disabled: { type: Boolean },
|
|
16
|
+
name: {},
|
|
17
|
+
dir: {},
|
|
18
|
+
filterFunction: { type: Function },
|
|
19
|
+
displayValue: { type: Function },
|
|
20
|
+
resetSearchTermOnBlur: { type: Boolean },
|
|
21
|
+
asChild: { type: Boolean },
|
|
22
|
+
as: {}
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue", "update:open", "update:searchTerm", "update:selectedValue"],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const props = __props;
|
|
27
|
+
const emits = __emit;
|
|
28
|
+
const forwarded = index.xe(props, emits);
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return Mo.openBlock(), Mo.createBlock(Mo.unref(index.Hv), Mo.mergeProps({ class: "celeste-combobox-root" }, Mo.unref(forwarded)), {
|
|
31
|
+
default: Mo.withCtx(() => [
|
|
32
|
+
Mo.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
33
|
+
]),
|
|
34
|
+
_: 3
|
|
35
|
+
}, 16);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const ComboboxRoot = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-29e14e56"]]);
|
|
40
|
+
module.exports = ComboboxRoot;
|
|
@@ -43,5 +43,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
const ComboboxTrigger = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
46
|
+
const ComboboxTrigger = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-bddcd2de"]]);
|
|
47
47
|
module.exports = ComboboxTrigger;
|
package/dist/cjs/combobox.js
CHANGED
|
@@ -8,7 +8,7 @@ const comboboxGroup = require("./combobox-group.js");
|
|
|
8
8
|
const comboboxInput = require("./combobox-input.js");
|
|
9
9
|
const comboboxItem = require("./combobox-item.js");
|
|
10
10
|
const comboboxList = require("./combobox-list.js");
|
|
11
|
-
const
|
|
11
|
+
const comboboxRoot = require("./combobox-root.js");
|
|
12
12
|
const comboboxSeparator = require("./combobox-separator.js");
|
|
13
13
|
const comboboxTrigger = require("./combobox-trigger.js");
|
|
14
14
|
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
@@ -27,13 +27,11 @@ const _hoisted_6 = {
|
|
|
27
27
|
key: 2,
|
|
28
28
|
class: "celeste-dropdown-input"
|
|
29
29
|
};
|
|
30
|
-
const _hoisted_7 = {
|
|
31
|
-
|
|
32
|
-
const _hoisted_9 = {
|
|
33
|
-
key: 2,
|
|
30
|
+
const _hoisted_7 = {
|
|
31
|
+
key: 0,
|
|
34
32
|
class: "celeste-input-badge"
|
|
35
33
|
};
|
|
36
|
-
const
|
|
34
|
+
const _hoisted_8 = ["src"];
|
|
37
35
|
const __default__ = {
|
|
38
36
|
inheritAttrs: false
|
|
39
37
|
};
|
|
@@ -43,6 +41,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
43
41
|
props: {
|
|
44
42
|
options: {},
|
|
45
43
|
valueBy: {},
|
|
44
|
+
labelBy: {},
|
|
46
45
|
placeholder: { default: "Select" },
|
|
47
46
|
type: {},
|
|
48
47
|
size: { default: "md" },
|
|
@@ -76,6 +75,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
76
75
|
filterFunction: filterFunction2,
|
|
77
76
|
options,
|
|
78
77
|
valueBy,
|
|
78
|
+
labelBy,
|
|
79
79
|
placeholder,
|
|
80
80
|
type,
|
|
81
81
|
size,
|
|
@@ -89,6 +89,16 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
89
89
|
});
|
|
90
90
|
const forwarded = index.xe(delegatedProps, emits);
|
|
91
91
|
const model = Mo.computed(() => props.modelValue);
|
|
92
|
+
const label = Mo.computed(() => {
|
|
93
|
+
if (!model.value)
|
|
94
|
+
return props.placeholder;
|
|
95
|
+
if (Array.isArray(model.value)) {
|
|
96
|
+
if (model.value.length === 0)
|
|
97
|
+
return props.placeholder;
|
|
98
|
+
return model.value.map((item) => props.labelBy ? item[props.labelBy] : item.label).join(", ");
|
|
99
|
+
}
|
|
100
|
+
return props.labelBy ? model.value[props.labelBy] : model.value.label;
|
|
101
|
+
});
|
|
92
102
|
function isSelected(value) {
|
|
93
103
|
if (!Array.isArray(props.modelValue) || !props.multiple)
|
|
94
104
|
return;
|
|
@@ -104,13 +114,13 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
104
114
|
}
|
|
105
115
|
function filterFunction(list, searchTerm) {
|
|
106
116
|
return list.filter((option) => {
|
|
107
|
-
const { value, label } = option;
|
|
108
|
-
if (!value || !
|
|
117
|
+
const { value, label: label2 } = option;
|
|
118
|
+
if (!value || !label2)
|
|
109
119
|
return false;
|
|
110
120
|
if (props.valueBy && typeof value === "object" && props.valueBy in value) {
|
|
111
|
-
return String(value[props.valueBy]).toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
121
|
+
return String(value[props.valueBy]).toLowerCase().includes(searchTerm.toLowerCase()) || label2.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
112
122
|
}
|
|
113
|
-
return value.toString().toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
123
|
+
return value.toString().toLowerCase().includes(searchTerm.toLowerCase()) || label2.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
114
124
|
});
|
|
115
125
|
}
|
|
116
126
|
const mergedBadgeProps = Mo.computed(() => ({
|
|
@@ -118,7 +128,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
118
128
|
disabled: props.disabled
|
|
119
129
|
}));
|
|
120
130
|
return (_ctx, _cache) => {
|
|
121
|
-
return Mo.openBlock(), Mo.createBlock(
|
|
131
|
+
return Mo.openBlock(), Mo.createBlock(comboboxRoot, Mo.mergeProps(Mo.unref(forwarded), { "filter-function": filterFunction }), {
|
|
122
132
|
default: Mo.withCtx(() => [
|
|
123
133
|
Mo.createVNode(comboboxAnchor_vue_vue_type_script_setup_true_lang._sfc_main, { "as-child": "" }, {
|
|
124
134
|
default: Mo.withCtx(() => [
|
|
@@ -149,8 +159,8 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
149
159
|
Mo.renderSlot(_ctx.$slots, "prefix", { class: "celeste-dropdown-anchor-trigger-prefix-default" }, void 0, true)
|
|
150
160
|
])) : Mo.createCommentVNode("", true),
|
|
151
161
|
_ctx.type !== "inline" ? (Mo.openBlock(), Mo.createElementBlock("div", _hoisted_6, [
|
|
152
|
-
|
|
153
|
-
mergedBadgeProps.value && _ctx.badgeProps ? (Mo.openBlock(), Mo.createElementBlock("span",
|
|
162
|
+
Mo.createElementVNode("span", null, Mo.toDisplayString(label.value), 1),
|
|
163
|
+
mergedBadgeProps.value && _ctx.badgeProps ? (Mo.openBlock(), Mo.createElementBlock("span", _hoisted_7, [
|
|
154
164
|
Mo.createVNode(badge, Mo.normalizeProps(Mo.guardReactiveProps(mergedBadgeProps.value)), null, 16)
|
|
155
165
|
])) : Mo.createCommentVNode("", true)
|
|
156
166
|
])) : Mo.createCommentVNode("", true),
|
|
@@ -202,7 +212,7 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
202
212
|
src: option.image,
|
|
203
213
|
alt: "option",
|
|
204
214
|
class: "celeste-dropdown-item-image"
|
|
205
|
-
}, null, 8,
|
|
215
|
+
}, null, 8, _hoisted_8)) : Mo.createCommentVNode("", true)
|
|
206
216
|
]),
|
|
207
217
|
_: 2
|
|
208
218
|
}, 1032, ["label", "sublabel", "description", "checkbox", "value", "selected"]);
|
|
@@ -219,5 +229,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
219
229
|
};
|
|
220
230
|
}
|
|
221
231
|
});
|
|
222
|
-
const combobox = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
232
|
+
const combobox = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-e3715243"]]);
|
|
223
233
|
module.exports = combobox;
|
package/dist/cjs/dropdown.js
CHANGED
|
@@ -287,5 +287,5 @@ const _sfc_main = /* @__PURE__ */ Mo.defineComponent({
|
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
289
|
});
|
|
290
|
-
const dropdown = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
290
|
+
const dropdown = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-8ef0e6e7"]]);
|
|
291
291
|
module.exports = dropdown;
|
package/dist/cjs/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const comboboxGroup = require("./combobox-group.js");
|
|
|
15
15
|
const comboboxInput = require("./combobox-input.js");
|
|
16
16
|
const comboboxItem = require("./combobox-item.js");
|
|
17
17
|
const comboboxList = require("./combobox-list.js");
|
|
18
|
-
const
|
|
18
|
+
const comboboxRoot = require("./combobox-root.js");
|
|
19
19
|
const comboboxSeparator = require("./combobox-separator.js");
|
|
20
20
|
const comboboxTrigger = require("./combobox-trigger.js");
|
|
21
21
|
const combobox = require("./combobox.js");
|
|
@@ -81,7 +81,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
81
81
|
ComboboxInput: comboboxInput,
|
|
82
82
|
ComboboxItem: comboboxItem,
|
|
83
83
|
ComboboxList: comboboxList,
|
|
84
|
-
ComboboxRoot:
|
|
84
|
+
ComboboxRoot: comboboxRoot,
|
|
85
85
|
ComboboxSeparator: comboboxSeparator,
|
|
86
86
|
ComboboxTrigger: comboboxTrigger,
|
|
87
87
|
CompactButton: compactButton,
|
|
@@ -161,7 +161,7 @@ exports.ComboboxGroup = comboboxGroup;
|
|
|
161
161
|
exports.ComboboxInput = comboboxInput;
|
|
162
162
|
exports.ComboboxItem = comboboxItem;
|
|
163
163
|
exports.ComboboxList = comboboxList;
|
|
164
|
-
exports.ComboboxRoot =
|
|
164
|
+
exports.ComboboxRoot = comboboxRoot;
|
|
165
165
|
exports.ComboboxSeparator = comboboxSeparator;
|
|
166
166
|
exports.ComboboxTrigger = comboboxTrigger;
|
|
167
167
|
exports.Combobox = combobox;
|
|
@@ -4,6 +4,7 @@ import { ComboboxItemPropsType } from './combobox-item';
|
|
|
4
4
|
export interface ComboboxPropsType extends ComboboxRootProps {
|
|
5
5
|
options: ComboboxItemPropsType[];
|
|
6
6
|
valueBy?: string;
|
|
7
|
+
labelBy?: string;
|
|
7
8
|
placeholder?: string;
|
|
8
9
|
type?: 'normal' | 'compact' | 'inline' | 'compact-input';
|
|
9
10
|
size?: 'xs' | 'sm' | 'md';
|
package/dist/es/chunks/index.js
CHANGED
package/dist/es/combobox-list.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createVNode, mergeProps, renderSlot } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import { x as xe,
|
|
3
|
+
import { x as xe, H as nm, X as Xv, J as Jv } from "./chunks/index.js";
|
|
4
4
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "combobox-list",
|
|
@@ -11,7 +11,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
11
11
|
dismissable: { type: Boolean },
|
|
12
12
|
side: {},
|
|
13
13
|
sideOffset: { default: 4 },
|
|
14
|
-
align: { default: "
|
|
14
|
+
align: { default: "start" },
|
|
15
15
|
alignOffset: {},
|
|
16
16
|
avoidCollisions: { type: Boolean },
|
|
17
17
|
collisionBoundary: {},
|
|
@@ -39,7 +39,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
39
39
|
return openBlock(), createBlock(unref(nm), null, {
|
|
40
40
|
default: withCtx(() => [
|
|
41
41
|
createVNode(unref(Xv), mergeProps(unref(forwarded), {
|
|
42
|
-
"force-mount": "",
|
|
43
42
|
class: unref(clsx)("celeste-dropdown-content", props.class)
|
|
44
43
|
}), {
|
|
45
44
|
default: withCtx(() => [
|
|
@@ -58,7 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
58
57
|
};
|
|
59
58
|
}
|
|
60
59
|
});
|
|
61
|
-
const ComboboxList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
60
|
+
const ComboboxList = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc6bae8b"]]);
|
|
62
61
|
export {
|
|
63
62
|
ComboboxList as default
|
|
64
63
|
};
|
package/dist/es/combobox-root.js
CHANGED
|
@@ -1,4 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
+
import { x as xe, I as Hv } from "./chunks/index.js";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "combobox-root",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {},
|
|
8
|
+
defaultValue: {},
|
|
9
|
+
open: { type: Boolean },
|
|
10
|
+
defaultOpen: { type: Boolean },
|
|
11
|
+
searchTerm: {},
|
|
12
|
+
selectedValue: {},
|
|
13
|
+
multiple: { type: Boolean },
|
|
14
|
+
disabled: { type: Boolean },
|
|
15
|
+
name: {},
|
|
16
|
+
dir: {},
|
|
17
|
+
filterFunction: { type: Function },
|
|
18
|
+
displayValue: { type: Function },
|
|
19
|
+
resetSearchTermOnBlur: { type: Boolean },
|
|
20
|
+
asChild: { type: Boolean },
|
|
21
|
+
as: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:modelValue", "update:open", "update:searchTerm", "update:selectedValue"],
|
|
24
|
+
setup(__props, { emit: __emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const emits = __emit;
|
|
27
|
+
const forwarded = xe(props, emits);
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createBlock(unref(Hv), mergeProps({ class: "celeste-combobox-root" }, unref(forwarded)), {
|
|
30
|
+
default: withCtx(() => [
|
|
31
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
32
|
+
]),
|
|
33
|
+
_: 3
|
|
34
|
+
}, 16);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const ComboboxRoot = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-29e14e56"]]);
|
|
2
39
|
export {
|
|
3
|
-
|
|
40
|
+
ComboboxRoot as default
|
|
4
41
|
};
|
|
@@ -42,7 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
const ComboboxTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
45
|
+
const ComboboxTrigger = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bddcd2de"]]);
|
|
46
46
|
export {
|
|
47
47
|
ComboboxTrigger as default
|
|
48
48
|
};
|
package/dist/es/combobox.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, mergeProps, unref, withCtx, createVNode, normalizeClass, createElementBlock, createElementVNode, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps, toDisplayString, createSlots, createTextVNode, Fragment, renderList } from "vue";
|
|
2
2
|
import { x as xe } from "./chunks/index.js";
|
|
3
3
|
import Badge from "./badge.js";
|
|
4
|
-
import { _ as _sfc_main$
|
|
4
|
+
import { _ as _sfc_main$1 } from "./chunks/combobox-anchor.js";
|
|
5
5
|
import ComboboxEmpty from "./combobox-empty.js";
|
|
6
6
|
import ComboboxGroup from "./combobox-group.js";
|
|
7
7
|
import ComboboxInput from "./combobox-input.js";
|
|
8
8
|
import ComboboxItem from "./combobox-item.js";
|
|
9
9
|
import ComboboxList from "./combobox-list.js";
|
|
10
|
-
import
|
|
10
|
+
import ComboboxRoot from "./combobox-root.js";
|
|
11
11
|
import ComboboxSeparator from "./combobox-separator.js";
|
|
12
12
|
import ComboboxTrigger from "./combobox-trigger.js";
|
|
13
13
|
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
@@ -26,13 +26,11 @@ const _hoisted_6 = {
|
|
|
26
26
|
key: 2,
|
|
27
27
|
class: "celeste-dropdown-input"
|
|
28
28
|
};
|
|
29
|
-
const _hoisted_7 = {
|
|
30
|
-
|
|
31
|
-
const _hoisted_9 = {
|
|
32
|
-
key: 2,
|
|
29
|
+
const _hoisted_7 = {
|
|
30
|
+
key: 0,
|
|
33
31
|
class: "celeste-input-badge"
|
|
34
32
|
};
|
|
35
|
-
const
|
|
33
|
+
const _hoisted_8 = ["src"];
|
|
36
34
|
const __default__ = {
|
|
37
35
|
inheritAttrs: false
|
|
38
36
|
};
|
|
@@ -42,6 +40,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
42
40
|
props: {
|
|
43
41
|
options: {},
|
|
44
42
|
valueBy: {},
|
|
43
|
+
labelBy: {},
|
|
45
44
|
placeholder: { default: "Select" },
|
|
46
45
|
type: {},
|
|
47
46
|
size: { default: "md" },
|
|
@@ -75,6 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
75
74
|
filterFunction: filterFunction2,
|
|
76
75
|
options,
|
|
77
76
|
valueBy,
|
|
77
|
+
labelBy,
|
|
78
78
|
placeholder,
|
|
79
79
|
type,
|
|
80
80
|
size,
|
|
@@ -88,6 +88,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
88
88
|
});
|
|
89
89
|
const forwarded = xe(delegatedProps, emits);
|
|
90
90
|
const model = computed(() => props.modelValue);
|
|
91
|
+
const label = computed(() => {
|
|
92
|
+
if (!model.value)
|
|
93
|
+
return props.placeholder;
|
|
94
|
+
if (Array.isArray(model.value)) {
|
|
95
|
+
if (model.value.length === 0)
|
|
96
|
+
return props.placeholder;
|
|
97
|
+
return model.value.map((item) => props.labelBy ? item[props.labelBy] : item.label).join(", ");
|
|
98
|
+
}
|
|
99
|
+
return props.labelBy ? model.value[props.labelBy] : model.value.label;
|
|
100
|
+
});
|
|
91
101
|
function isSelected(value) {
|
|
92
102
|
if (!Array.isArray(props.modelValue) || !props.multiple)
|
|
93
103
|
return;
|
|
@@ -103,13 +113,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
103
113
|
}
|
|
104
114
|
function filterFunction(list, searchTerm) {
|
|
105
115
|
return list.filter((option) => {
|
|
106
|
-
const { value, label } = option;
|
|
107
|
-
if (!value || !
|
|
116
|
+
const { value, label: label2 } = option;
|
|
117
|
+
if (!value || !label2)
|
|
108
118
|
return false;
|
|
109
119
|
if (props.valueBy && typeof value === "object" && props.valueBy in value) {
|
|
110
|
-
return String(value[props.valueBy]).toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
120
|
+
return String(value[props.valueBy]).toLowerCase().includes(searchTerm.toLowerCase()) || label2.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
111
121
|
}
|
|
112
|
-
return value.toString().toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
122
|
+
return value.toString().toLowerCase().includes(searchTerm.toLowerCase()) || label2.toString().toLowerCase().includes(searchTerm.toLowerCase());
|
|
113
123
|
});
|
|
114
124
|
}
|
|
115
125
|
const mergedBadgeProps = computed(() => ({
|
|
@@ -117,9 +127,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
117
127
|
disabled: props.disabled
|
|
118
128
|
}));
|
|
119
129
|
return (_ctx, _cache) => {
|
|
120
|
-
return openBlock(), createBlock(
|
|
130
|
+
return openBlock(), createBlock(ComboboxRoot, mergeProps(unref(forwarded), { "filter-function": filterFunction }), {
|
|
121
131
|
default: withCtx(() => [
|
|
122
|
-
createVNode(_sfc_main$
|
|
132
|
+
createVNode(_sfc_main$1, { "as-child": "" }, {
|
|
123
133
|
default: withCtx(() => [
|
|
124
134
|
createVNode(ComboboxTrigger, {
|
|
125
135
|
type: _ctx.type,
|
|
@@ -148,8 +158,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
158
|
renderSlot(_ctx.$slots, "prefix", { class: "celeste-dropdown-anchor-trigger-prefix-default" }, void 0, true)
|
|
149
159
|
])) : createCommentVNode("", true),
|
|
150
160
|
_ctx.type !== "inline" ? (openBlock(), createElementBlock("div", _hoisted_6, [
|
|
151
|
-
|
|
152
|
-
mergedBadgeProps.value && _ctx.badgeProps ? (openBlock(), createElementBlock("span",
|
|
161
|
+
createElementVNode("span", null, toDisplayString(label.value), 1),
|
|
162
|
+
mergedBadgeProps.value && _ctx.badgeProps ? (openBlock(), createElementBlock("span", _hoisted_7, [
|
|
153
163
|
createVNode(Badge, normalizeProps(guardReactiveProps(mergedBadgeProps.value)), null, 16)
|
|
154
164
|
])) : createCommentVNode("", true)
|
|
155
165
|
])) : createCommentVNode("", true),
|
|
@@ -201,7 +211,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
201
211
|
src: option.image,
|
|
202
212
|
alt: "option",
|
|
203
213
|
class: "celeste-dropdown-item-image"
|
|
204
|
-
}, null, 8,
|
|
214
|
+
}, null, 8, _hoisted_8)) : createCommentVNode("", true)
|
|
205
215
|
]),
|
|
206
216
|
_: 2
|
|
207
217
|
}, 1032, ["label", "sublabel", "description", "checkbox", "value", "selected"]);
|
|
@@ -218,7 +228,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
218
228
|
};
|
|
219
229
|
}
|
|
220
230
|
});
|
|
221
|
-
const combobox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
231
|
+
const combobox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e3715243"]]);
|
|
222
232
|
export {
|
|
223
233
|
combobox as default
|
|
224
234
|
};
|
package/dist/es/command-root.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot } from "vue";
|
|
2
|
-
import { x as xe,
|
|
2
|
+
import { x as xe, I as Hv } from "./chunks/index.js";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
__name: "command-root",
|
|
5
5
|
props: {
|
package/dist/es/dropdown.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent, mergeModels, useModel, ref, computed, watch, openBlock, createElementBlock, withKeys, createVNode, unref, withCtx, normalizeClass, createElementVNode, createCommentVNode, renderSlot, normalizeProps, guardReactiveProps, toDisplayString, createBlock, createSlots, Fragment, renderList } from "vue";
|
|
2
2
|
import { c as clsx } from "./chunks/clsx.js";
|
|
3
|
-
import {
|
|
3
|
+
import { I as Hv, j as jv, U as Uv, X as Xv, J as Jv, L as tm, Z as Zv, B as qv, E as Qv } from "./chunks/index.js";
|
|
4
4
|
import Badge from "./badge.js";
|
|
5
5
|
import TextInput from "./text-input.js";
|
|
6
6
|
import DropdownItem from "./dropdown-item.js";
|
|
@@ -286,7 +286,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
286
286
|
};
|
|
287
287
|
}
|
|
288
288
|
});
|
|
289
|
-
const dropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
289
|
+
const dropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8ef0e6e7"]]);
|
|
290
290
|
export {
|
|
291
291
|
dropdown as default
|
|
292
292
|
};
|