cisse-vue-ui 0.1.0 → 0.1.2
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/README.md +435 -6
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DQD2I1Wk.cjs +621 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DQD2I1Wk.cjs.map +1 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DVkcMcSN.js +622 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DVkcMcSN.js.map +1 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-D2MeLTRV.cjs +1133 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-D2MeLTRV.cjs.map +1 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-Ixih38V0.js +1134 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-Ixih38V0.js.map +1 -0
- package/dist/{NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js → EmptyState.vue_vue_type_script_setup_true_lang-CrVvFwXA.js} +163 -44
- package/dist/EmptyState.vue_vue_type_script_setup_true_lang-CrVvFwXA.js.map +1 -0
- package/dist/{NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs → EmptyState.vue_vue_type_script_setup_true_lang-mlqLBP5W.cjs} +163 -44
- package/dist/EmptyState.vue_vue_type_script_setup_true_lang-mlqLBP5W.cjs.map +1 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-BWz86k7c.cjs +86 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-BWz86k7c.cjs.map +1 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-emN2qlfR.js +87 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-emN2qlfR.js.map +1 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-DTlUENg3.js +265 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-DTlUENg3.js.map +1 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-IcouTz4C.cjs +264 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-IcouTz4C.cjs.map +1 -0
- package/dist/components/core/AutocompleteComponent.vue.d.ts +7 -1
- package/dist/components/core/Avatar.vue.d.ts +20 -0
- package/dist/components/core/Button.vue.d.ts +49 -0
- package/dist/components/core/CollapsibleCard.vue.d.ts +28 -0
- package/dist/components/core/Dropdown.vue.d.ts +52 -0
- package/dist/components/core/MenuItem.vue.d.ts +11 -1
- package/dist/components/core/Stepper.vue.d.ts +22 -0
- package/dist/components/core/TabPanel.vue.d.ts +21 -0
- package/dist/components/core/Tabs.vue.d.ts +39 -0
- package/dist/components/core/index.cjs +14 -6
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +12 -0
- package/dist/components/core/index.js +14 -6
- package/dist/components/core/index.js.map +1 -1
- package/dist/components/feedback/Alert.vue.d.ts +34 -0
- package/dist/components/feedback/EmptyState.vue.d.ts +29 -0
- package/dist/components/feedback/index.cjs +8 -6
- package/dist/components/feedback/index.cjs.map +1 -1
- package/dist/components/feedback/index.d.ts +3 -0
- package/dist/components/feedback/index.js +3 -1
- package/dist/components/form/Checkbox.vue.d.ts +20 -0
- package/dist/components/form/FormSelect.vue.d.ts +35 -6
- package/dist/components/form/Switch.vue.d.ts +21 -0
- package/dist/components/form/index.cjs +9 -7
- package/dist/components/form/index.cjs.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +4 -2
- package/dist/components/index.cjs +34 -19
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +26 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/BaseLayout.vue.d.ts +58 -0
- package/dist/components/layout/PageLayout.vue.d.ts +37 -0
- package/dist/components/layout/index.cjs +6 -0
- package/dist/components/layout/index.cjs.map +1 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/index-Bt9enqyq.cjs +47 -0
- package/dist/index-Bt9enqyq.cjs.map +1 -0
- package/dist/index-CxPY8Qb7.js +48 -0
- package/dist/index-CxPY8Qb7.js.map +1 -0
- package/dist/index.cjs +35 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -14
- package/dist/index.js.map +1 -1
- package/dist/style.css +2 -0
- package/dist/types/components.d.ts +7 -0
- package/package.json +12 -3
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js.map +0 -1
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs.map +0 -1
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs +0 -234
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs.map +0 -1
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js +0 -235
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js.map +0 -1
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js +0 -540
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js.map +0 -1
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs +0 -539
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs.map +0 -1
- package/dist/index-BoCtJCg0.cjs +0 -32
- package/dist/index-BoCtJCg0.cjs.map +0 -1
- package/dist/index-CGhDI10m.js +0 -33
- package/dist/index-CGhDI10m.js.map +0 -1
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, mergeModels, useModel, withDirectives, mergeProps, vModelDynamic, ref, computed, watch, onUnmounted, createElementVNode, createBlock, normalizeClass, createVNode, unref, Teleport, Transition, withCtx, createCommentVNode, normalizeStyle, vModelText, Fragment, renderList, nextTick } from "vue";
|
|
2
|
+
import { Icon } from "@iconify/vue";
|
|
3
|
+
const _hoisted_1$7 = ["data-error", "for"];
|
|
4
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "FormLabel",
|
|
6
|
+
props: {
|
|
7
|
+
error: { type: [String, Boolean] },
|
|
8
|
+
htmlFor: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
return (_ctx, _cache) => {
|
|
12
|
+
return openBlock(), createElementBlock("label", {
|
|
13
|
+
"data-error": !!__props.error,
|
|
14
|
+
for: __props.htmlFor ?? "",
|
|
15
|
+
class: "block text-sm font-medium text-gray-700 data-[error=true]:text-red-500 dark:text-gray-300"
|
|
16
|
+
}, [
|
|
17
|
+
renderSlot(_ctx.$slots, "default")
|
|
18
|
+
], 8, _hoisted_1$7);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _hoisted_1$6 = ["data-error"];
|
|
23
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
24
|
+
__name: "FormHelp",
|
|
25
|
+
props: {
|
|
26
|
+
error: { type: Boolean },
|
|
27
|
+
text: {}
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
return (_ctx, _cache) => {
|
|
31
|
+
return openBlock(), createElementBlock("p", {
|
|
32
|
+
"data-error": __props.error,
|
|
33
|
+
class: "mt-2 text-sm text-gray-400 peer-invalid:visible data-[error=true]:text-red-500 dark:text-gray-500"
|
|
34
|
+
}, [
|
|
35
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
36
|
+
createTextVNode(toDisplayString(__props.text ?? ""), 1)
|
|
37
|
+
])
|
|
38
|
+
], 8, _hoisted_1$6);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const _hoisted_1$5 = ["id", "disabled", "name", "placeholder", "type"];
|
|
43
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
44
|
+
__name: "FormInput",
|
|
45
|
+
props: /* @__PURE__ */ mergeModels({
|
|
46
|
+
type: { default: "text" },
|
|
47
|
+
value: {},
|
|
48
|
+
placeholder: {},
|
|
49
|
+
disabled: { type: Boolean },
|
|
50
|
+
invalid: { type: Boolean },
|
|
51
|
+
id: {},
|
|
52
|
+
name: {}
|
|
53
|
+
}, {
|
|
54
|
+
"modelValue": {},
|
|
55
|
+
"modelModifiers": {}
|
|
56
|
+
}),
|
|
57
|
+
emits: ["update:modelValue"],
|
|
58
|
+
setup(__props) {
|
|
59
|
+
const modelValue = useModel(__props, "modelValue");
|
|
60
|
+
return (_ctx, _cache) => {
|
|
61
|
+
return withDirectives((openBlock(), createElementBlock("input", mergeProps({
|
|
62
|
+
id: __props.id ?? __props.name ?? "",
|
|
63
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
64
|
+
disabled: __props.disabled,
|
|
65
|
+
name: __props.name ?? "",
|
|
66
|
+
placeholder: __props.placeholder,
|
|
67
|
+
type: __props.type,
|
|
68
|
+
class: "mt-1 block w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-gray-400 shadow-sm invalid:border-pink-500 invalid:text-pink-600 focus:border-primary focus:ring-1 focus:ring-primary focus:outline-none focus:invalid:border-pink-500 focus:invalid:ring-pink-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none dark:border-gray-700 dark:bg-gray-900 dark:text-gray-200 dark:placeholder-gray-500 dark:focus:border-primary dark:focus:ring-primary dark:disabled:border-gray-800 dark:disabled:bg-gray-950 dark:disabled:text-gray-500"
|
|
69
|
+
}, _ctx.$attrs), null, 16, _hoisted_1$5)), [
|
|
70
|
+
[vModelDynamic, modelValue.value]
|
|
71
|
+
]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const _hoisted_1$4 = { class: "relative" };
|
|
76
|
+
const _hoisted_2$3 = ["id", "disabled"];
|
|
77
|
+
const _hoisted_3$2 = { class: "flex-1 truncate" };
|
|
78
|
+
const _hoisted_4$2 = {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: "sticky top-0 border-b border-gray-200 bg-white p-2 dark:border-gray-700 dark:bg-gray-800"
|
|
81
|
+
};
|
|
82
|
+
const _hoisted_5 = { class: "flex items-center gap-2 rounded-md border border-gray-300 bg-gray-50 px-2 py-1.5 dark:border-gray-600 dark:bg-gray-900" };
|
|
83
|
+
const _hoisted_6 = {
|
|
84
|
+
key: 1,
|
|
85
|
+
class: "px-4 py-3 text-sm text-gray-500 dark:text-gray-400"
|
|
86
|
+
};
|
|
87
|
+
const _hoisted_7 = { class: "py-1" };
|
|
88
|
+
const _hoisted_8 = ["data-index", "onClick", "onMouseenter"];
|
|
89
|
+
const _hoisted_9 = {
|
|
90
|
+
key: 1,
|
|
91
|
+
class: "size-4 shrink-0"
|
|
92
|
+
};
|
|
93
|
+
const _hoisted_10 = { class: "flex-1" };
|
|
94
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
95
|
+
__name: "FormSelect",
|
|
96
|
+
props: /* @__PURE__ */ mergeModels({
|
|
97
|
+
options: {},
|
|
98
|
+
type: {},
|
|
99
|
+
value: {},
|
|
100
|
+
placeholder: {},
|
|
101
|
+
disabled: { type: Boolean },
|
|
102
|
+
invalid: { type: Boolean },
|
|
103
|
+
id: {},
|
|
104
|
+
name: {},
|
|
105
|
+
teleport: { type: Boolean, default: true },
|
|
106
|
+
searchable: { type: Boolean, default: false },
|
|
107
|
+
noResultsText: { default: "No results found" },
|
|
108
|
+
triggerClass: {}
|
|
109
|
+
}, {
|
|
110
|
+
"modelValue": { type: [String, Number, Boolean, null] },
|
|
111
|
+
"modelModifiers": {}
|
|
112
|
+
}),
|
|
113
|
+
emits: ["update:modelValue"],
|
|
114
|
+
setup(__props) {
|
|
115
|
+
const props = __props;
|
|
116
|
+
const modelValue = useModel(__props, "modelValue");
|
|
117
|
+
const isOpen = ref(false);
|
|
118
|
+
const searchQuery = ref("");
|
|
119
|
+
const highlightedIndex = ref(-1);
|
|
120
|
+
const triggerRef = ref();
|
|
121
|
+
const dropdownRef = ref();
|
|
122
|
+
const searchInputRef = ref();
|
|
123
|
+
const dropdownPosition = ref({ top: 0, left: 0, width: 0 });
|
|
124
|
+
const visibleOptions = computed(() => {
|
|
125
|
+
return (props.options ?? []).filter((opt) => !opt.hidden);
|
|
126
|
+
});
|
|
127
|
+
const filteredOptions = computed(() => {
|
|
128
|
+
if (!props.searchable || !searchQuery.value) {
|
|
129
|
+
return visibleOptions.value;
|
|
130
|
+
}
|
|
131
|
+
const query = searchQuery.value.toLowerCase();
|
|
132
|
+
return visibleOptions.value.filter(
|
|
133
|
+
(opt) => opt.label.toLowerCase().includes(query) || String(opt.value).toLowerCase().includes(query)
|
|
134
|
+
);
|
|
135
|
+
});
|
|
136
|
+
const selectedOption = computed(() => {
|
|
137
|
+
return visibleOptions.value.find((opt) => opt.value === modelValue.value);
|
|
138
|
+
});
|
|
139
|
+
const displayValue = computed(() => {
|
|
140
|
+
if (selectedOption.value) {
|
|
141
|
+
return selectedOption.value.label;
|
|
142
|
+
}
|
|
143
|
+
return props.placeholder || "Select...";
|
|
144
|
+
});
|
|
145
|
+
const updatePosition = () => {
|
|
146
|
+
if (!triggerRef.value || !props.teleport) return;
|
|
147
|
+
const rect = triggerRef.value.getBoundingClientRect();
|
|
148
|
+
dropdownPosition.value = {
|
|
149
|
+
top: rect.bottom + window.scrollY + 4,
|
|
150
|
+
left: rect.left + window.scrollX,
|
|
151
|
+
width: rect.width
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
const open = () => {
|
|
155
|
+
if (props.disabled) return;
|
|
156
|
+
isOpen.value = true;
|
|
157
|
+
searchQuery.value = "";
|
|
158
|
+
highlightedIndex.value = filteredOptions.value.findIndex(
|
|
159
|
+
(opt) => opt.value === modelValue.value
|
|
160
|
+
);
|
|
161
|
+
nextTick(() => {
|
|
162
|
+
var _a;
|
|
163
|
+
updatePosition();
|
|
164
|
+
if (props.searchable) {
|
|
165
|
+
(_a = searchInputRef.value) == null ? void 0 : _a.focus();
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
const close = () => {
|
|
170
|
+
isOpen.value = false;
|
|
171
|
+
searchQuery.value = "";
|
|
172
|
+
highlightedIndex.value = -1;
|
|
173
|
+
};
|
|
174
|
+
const toggle = () => {
|
|
175
|
+
if (isOpen.value) {
|
|
176
|
+
close();
|
|
177
|
+
} else {
|
|
178
|
+
open();
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
const selectOption = (option) => {
|
|
182
|
+
modelValue.value = option.value;
|
|
183
|
+
close();
|
|
184
|
+
};
|
|
185
|
+
const handleKeydown = (event) => {
|
|
186
|
+
if (!isOpen.value) {
|
|
187
|
+
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
188
|
+
event.preventDefault();
|
|
189
|
+
open();
|
|
190
|
+
}
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
switch (event.key) {
|
|
194
|
+
case "ArrowDown":
|
|
195
|
+
event.preventDefault();
|
|
196
|
+
highlightedIndex.value = Math.min(
|
|
197
|
+
highlightedIndex.value + 1,
|
|
198
|
+
filteredOptions.value.length - 1
|
|
199
|
+
);
|
|
200
|
+
scrollToHighlighted();
|
|
201
|
+
break;
|
|
202
|
+
case "ArrowUp":
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
highlightedIndex.value = Math.max(highlightedIndex.value - 1, 0);
|
|
205
|
+
scrollToHighlighted();
|
|
206
|
+
break;
|
|
207
|
+
case "Enter":
|
|
208
|
+
event.preventDefault();
|
|
209
|
+
if (highlightedIndex.value >= 0 && filteredOptions.value[highlightedIndex.value]) {
|
|
210
|
+
selectOption(filteredOptions.value[highlightedIndex.value]);
|
|
211
|
+
}
|
|
212
|
+
break;
|
|
213
|
+
case "Escape":
|
|
214
|
+
event.preventDefault();
|
|
215
|
+
close();
|
|
216
|
+
break;
|
|
217
|
+
case "Tab":
|
|
218
|
+
close();
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
const scrollToHighlighted = () => {
|
|
223
|
+
nextTick(() => {
|
|
224
|
+
if (dropdownRef.value) {
|
|
225
|
+
const highlighted = dropdownRef.value.querySelector(
|
|
226
|
+
`[data-index="${highlightedIndex.value}"]`
|
|
227
|
+
);
|
|
228
|
+
if (highlighted) {
|
|
229
|
+
highlighted.scrollIntoView({ block: "nearest" });
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
const handleClickOutside = (event) => {
|
|
235
|
+
var _a, _b;
|
|
236
|
+
const target = event.target;
|
|
237
|
+
const isInsideTrigger = (_a = triggerRef.value) == null ? void 0 : _a.contains(target);
|
|
238
|
+
const isInsideDropdown = (_b = dropdownRef.value) == null ? void 0 : _b.contains(target);
|
|
239
|
+
if (!isInsideTrigger && !isInsideDropdown) {
|
|
240
|
+
close();
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
watch(isOpen, (newValue) => {
|
|
244
|
+
if (newValue) {
|
|
245
|
+
document.addEventListener("click", handleClickOutside);
|
|
246
|
+
window.addEventListener("scroll", updatePosition, true);
|
|
247
|
+
window.addEventListener("resize", updatePosition);
|
|
248
|
+
} else {
|
|
249
|
+
document.removeEventListener("click", handleClickOutside);
|
|
250
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
251
|
+
window.removeEventListener("resize", updatePosition);
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
watch(searchQuery, () => {
|
|
255
|
+
highlightedIndex.value = 0;
|
|
256
|
+
});
|
|
257
|
+
onUnmounted(() => {
|
|
258
|
+
document.removeEventListener("click", handleClickOutside);
|
|
259
|
+
window.removeEventListener("scroll", updatePosition, true);
|
|
260
|
+
window.removeEventListener("resize", updatePosition);
|
|
261
|
+
});
|
|
262
|
+
const dropdownStyle = computed(() => {
|
|
263
|
+
if (!props.teleport) return {};
|
|
264
|
+
return {
|
|
265
|
+
position: "absolute",
|
|
266
|
+
top: `${dropdownPosition.value.top}px`,
|
|
267
|
+
left: `${dropdownPosition.value.left}px`,
|
|
268
|
+
width: `${dropdownPosition.value.width}px`
|
|
269
|
+
};
|
|
270
|
+
});
|
|
271
|
+
const triggerClasses = computed(() => {
|
|
272
|
+
const base = "flex w-full items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm text-left transition";
|
|
273
|
+
const state = props.disabled ? "cursor-not-allowed border-gray-200 bg-gray-50 text-gray-500 dark:border-gray-800 dark:bg-gray-950 dark:text-gray-500" : isOpen.value ? "border-primary ring-2 ring-primary/20 bg-white dark:bg-gray-900" : "border-gray-300 bg-white hover:border-gray-400 dark:border-gray-700 dark:bg-gray-900 dark:hover:border-gray-600";
|
|
274
|
+
const text = selectedOption.value ? "text-gray-800 dark:text-gray-200" : "text-gray-400 dark:text-gray-500";
|
|
275
|
+
return [base, state, text, props.triggerClass];
|
|
276
|
+
});
|
|
277
|
+
return (_ctx, _cache) => {
|
|
278
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
279
|
+
createElementVNode("button", {
|
|
280
|
+
ref_key: "triggerRef",
|
|
281
|
+
ref: triggerRef,
|
|
282
|
+
type: "button",
|
|
283
|
+
id: __props.id ?? __props.name ?? void 0,
|
|
284
|
+
disabled: __props.disabled,
|
|
285
|
+
class: normalizeClass(triggerClasses.value),
|
|
286
|
+
onClick: toggle,
|
|
287
|
+
onKeydown: handleKeydown
|
|
288
|
+
}, [
|
|
289
|
+
renderSlot(_ctx.$slots, "selected", {
|
|
290
|
+
option: selectedOption.value,
|
|
291
|
+
placeholder: __props.placeholder
|
|
292
|
+
}, () => [
|
|
293
|
+
createElementVNode("span", _hoisted_3$2, toDisplayString(displayValue.value), 1)
|
|
294
|
+
]),
|
|
295
|
+
createVNode(unref(Icon), {
|
|
296
|
+
icon: "lucide:chevron-down",
|
|
297
|
+
class: normalizeClass(["size-4 shrink-0 text-gray-400 transition-transform", isOpen.value && "rotate-180"])
|
|
298
|
+
}, null, 8, ["class"])
|
|
299
|
+
], 42, _hoisted_2$3),
|
|
300
|
+
(openBlock(), createBlock(Teleport, {
|
|
301
|
+
to: "body",
|
|
302
|
+
disabled: !__props.teleport
|
|
303
|
+
}, [
|
|
304
|
+
createVNode(Transition, {
|
|
305
|
+
"enter-active-class": "transition duration-100 ease-out",
|
|
306
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
307
|
+
"enter-to-class": "opacity-100 scale-100",
|
|
308
|
+
"leave-active-class": "transition duration-75 ease-in",
|
|
309
|
+
"leave-from-class": "opacity-100 scale-100",
|
|
310
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
311
|
+
}, {
|
|
312
|
+
default: withCtx(() => [
|
|
313
|
+
isOpen.value ? (openBlock(), createElementBlock("div", {
|
|
314
|
+
key: 0,
|
|
315
|
+
ref_key: "dropdownRef",
|
|
316
|
+
ref: dropdownRef,
|
|
317
|
+
style: normalizeStyle(dropdownStyle.value),
|
|
318
|
+
class: normalizeClass([
|
|
319
|
+
"z-[9999] max-h-60 overflow-auto rounded-lg border border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-800",
|
|
320
|
+
!__props.teleport && "absolute mt-1 w-full"
|
|
321
|
+
])
|
|
322
|
+
}, [
|
|
323
|
+
__props.searchable ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
|
|
324
|
+
createElementVNode("div", _hoisted_5, [
|
|
325
|
+
createVNode(unref(Icon), {
|
|
326
|
+
icon: "lucide:search",
|
|
327
|
+
class: "size-4 text-gray-400"
|
|
328
|
+
}),
|
|
329
|
+
withDirectives(createElementVNode("input", {
|
|
330
|
+
ref_key: "searchInputRef",
|
|
331
|
+
ref: searchInputRef,
|
|
332
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
|
|
333
|
+
type: "text",
|
|
334
|
+
class: "flex-1 bg-transparent text-sm outline-none dark:text-white",
|
|
335
|
+
placeholder: "Search...",
|
|
336
|
+
onKeydown: handleKeydown
|
|
337
|
+
}, null, 544), [
|
|
338
|
+
[vModelText, searchQuery.value]
|
|
339
|
+
])
|
|
340
|
+
])
|
|
341
|
+
])) : createCommentVNode("", true),
|
|
342
|
+
filteredOptions.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_6, toDisplayString(__props.noResultsText), 1)) : createCommentVNode("", true),
|
|
343
|
+
createElementVNode("div", _hoisted_7, [
|
|
344
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredOptions.value, (option, index) => {
|
|
345
|
+
return openBlock(), createElementBlock("button", {
|
|
346
|
+
key: String(option.value),
|
|
347
|
+
type: "button",
|
|
348
|
+
"data-index": index,
|
|
349
|
+
class: normalizeClass([
|
|
350
|
+
"flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition-colors",
|
|
351
|
+
highlightedIndex.value === index && "bg-gray-100 dark:bg-gray-700",
|
|
352
|
+
modelValue.value === option.value && "bg-primary/10 text-primary",
|
|
353
|
+
modelValue.value !== option.value && "text-gray-700 dark:text-gray-200"
|
|
354
|
+
]),
|
|
355
|
+
onClick: ($event) => selectOption(option),
|
|
356
|
+
onMouseenter: ($event) => highlightedIndex.value = index
|
|
357
|
+
}, [
|
|
358
|
+
renderSlot(_ctx.$slots, "option", {
|
|
359
|
+
option,
|
|
360
|
+
selected: modelValue.value === option.value,
|
|
361
|
+
index
|
|
362
|
+
}, () => [
|
|
363
|
+
modelValue.value === option.value ? (openBlock(), createBlock(unref(Icon), {
|
|
364
|
+
key: 0,
|
|
365
|
+
icon: "lucide:check",
|
|
366
|
+
class: "size-4 shrink-0 text-primary"
|
|
367
|
+
})) : (openBlock(), createElementBlock("span", _hoisted_9)),
|
|
368
|
+
createElementVNode("span", _hoisted_10, toDisplayString(option.label), 1)
|
|
369
|
+
])
|
|
370
|
+
], 42, _hoisted_8);
|
|
371
|
+
}), 128))
|
|
372
|
+
])
|
|
373
|
+
], 6)) : createCommentVNode("", true)
|
|
374
|
+
]),
|
|
375
|
+
_: 3
|
|
376
|
+
})
|
|
377
|
+
], 8, ["disabled"]))
|
|
378
|
+
]);
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
const _hoisted_1$3 = ["hidden"];
|
|
383
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
384
|
+
__name: "FormGroup",
|
|
385
|
+
props: /* @__PURE__ */ mergeModels({
|
|
386
|
+
label: {},
|
|
387
|
+
cols: { default: 6 },
|
|
388
|
+
hidden: { type: Boolean },
|
|
389
|
+
error: { type: [String, Boolean] },
|
|
390
|
+
type: {},
|
|
391
|
+
value: {},
|
|
392
|
+
placeholder: {},
|
|
393
|
+
disabled: { type: Boolean },
|
|
394
|
+
invalid: { type: Boolean },
|
|
395
|
+
id: {},
|
|
396
|
+
name: {},
|
|
397
|
+
options: {}
|
|
398
|
+
}, {
|
|
399
|
+
"modelValue": {},
|
|
400
|
+
"modelModifiers": {}
|
|
401
|
+
}),
|
|
402
|
+
emits: ["update:modelValue"],
|
|
403
|
+
setup(__props) {
|
|
404
|
+
const props = __props;
|
|
405
|
+
const modelValue = useModel(__props, "modelValue");
|
|
406
|
+
const computedCols = computed(() => `span ${props.cols} / span ${props.cols}`);
|
|
407
|
+
const isSelect = computed(() => props.type === "select");
|
|
408
|
+
return (_ctx, _cache) => {
|
|
409
|
+
return openBlock(), createElementBlock("div", {
|
|
410
|
+
style: normalizeStyle({ gridColumn: computedCols.value }),
|
|
411
|
+
hidden: __props.hidden
|
|
412
|
+
}, [
|
|
413
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
414
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
415
|
+
__props.label ? (openBlock(), createBlock(_sfc_main$7, {
|
|
416
|
+
key: 0,
|
|
417
|
+
"html-for": __props.id ?? __props.name,
|
|
418
|
+
error: __props.error
|
|
419
|
+
}, {
|
|
420
|
+
default: withCtx(() => [
|
|
421
|
+
createTextVNode(toDisplayString(__props.label), 1)
|
|
422
|
+
]),
|
|
423
|
+
_: 1
|
|
424
|
+
}, 8, ["html-for", "error"])) : createCommentVNode("", true)
|
|
425
|
+
]),
|
|
426
|
+
renderSlot(_ctx.$slots, "input", {}, () => [
|
|
427
|
+
isSelect.value ? (openBlock(), createBlock(_sfc_main$4, mergeProps({
|
|
428
|
+
key: 0,
|
|
429
|
+
modelValue: modelValue.value,
|
|
430
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
431
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"])) : (openBlock(), createBlock(_sfc_main$5, mergeProps({
|
|
432
|
+
key: 1,
|
|
433
|
+
modelValue: modelValue.value,
|
|
434
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event)
|
|
435
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"]))
|
|
436
|
+
]),
|
|
437
|
+
__props.error && typeof __props.error === "string" ? (openBlock(), createBlock(_sfc_main$6, {
|
|
438
|
+
key: 0,
|
|
439
|
+
error: true
|
|
440
|
+
}, {
|
|
441
|
+
default: withCtx(() => [
|
|
442
|
+
createTextVNode(toDisplayString(__props.error), 1)
|
|
443
|
+
]),
|
|
444
|
+
_: 1
|
|
445
|
+
})) : createCommentVNode("", true)
|
|
446
|
+
])
|
|
447
|
+
], 12, _hoisted_1$3);
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
const _hoisted_1$2 = { class: "relative" };
|
|
452
|
+
const _hoisted_2$2 = ["disabled", "placeholder", "value"];
|
|
453
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
454
|
+
__name: "SearchInput",
|
|
455
|
+
props: {
|
|
456
|
+
modelValue: {},
|
|
457
|
+
placeholder: { default: "Search..." },
|
|
458
|
+
icon: { default: "lucide:search" },
|
|
459
|
+
disabled: { type: Boolean, default: false }
|
|
460
|
+
},
|
|
461
|
+
emits: ["update:modelValue"],
|
|
462
|
+
setup(__props, { emit: __emit }) {
|
|
463
|
+
const emit = __emit;
|
|
464
|
+
const handleInput = (event) => {
|
|
465
|
+
const target = event.target;
|
|
466
|
+
emit("update:modelValue", target.value);
|
|
467
|
+
};
|
|
468
|
+
return (_ctx, _cache) => {
|
|
469
|
+
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
470
|
+
createVNode(unref(Icon), {
|
|
471
|
+
icon: __props.icon,
|
|
472
|
+
class: "absolute top-1/2 left-3 h-5 w-5 -translate-y-1/2 text-gray-400"
|
|
473
|
+
}, null, 8, ["icon"]),
|
|
474
|
+
createElementVNode("input", {
|
|
475
|
+
disabled: __props.disabled,
|
|
476
|
+
placeholder: __props.placeholder,
|
|
477
|
+
value: __props.modelValue,
|
|
478
|
+
class: "focus:border-primary focus:ring-primary w-full rounded-lg border border-gray-300 bg-white py-2 pr-4 pl-10 text-gray-900 placeholder-gray-400 transition-colors disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-500",
|
|
479
|
+
type: "text",
|
|
480
|
+
onInput: handleInput
|
|
481
|
+
}, null, 40, _hoisted_2$2)
|
|
482
|
+
]);
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
const _hoisted_1$1 = ["aria-checked", "disabled"];
|
|
487
|
+
const _hoisted_2$1 = {
|
|
488
|
+
key: 0,
|
|
489
|
+
class: "flex flex-col"
|
|
490
|
+
};
|
|
491
|
+
const _hoisted_3$1 = {
|
|
492
|
+
key: 0,
|
|
493
|
+
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
494
|
+
};
|
|
495
|
+
const _hoisted_4$1 = {
|
|
496
|
+
key: 1,
|
|
497
|
+
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
498
|
+
};
|
|
499
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
500
|
+
__name: "Switch",
|
|
501
|
+
props: {
|
|
502
|
+
modelValue: { type: Boolean, default: false },
|
|
503
|
+
label: {},
|
|
504
|
+
description: {},
|
|
505
|
+
disabled: { type: Boolean },
|
|
506
|
+
size: { default: "md" }
|
|
507
|
+
},
|
|
508
|
+
emits: ["update:modelValue"],
|
|
509
|
+
setup(__props, { emit: __emit }) {
|
|
510
|
+
const props = __props;
|
|
511
|
+
const emit = __emit;
|
|
512
|
+
const toggle = () => {
|
|
513
|
+
if (props.disabled) return;
|
|
514
|
+
emit("update:modelValue", !props.modelValue);
|
|
515
|
+
};
|
|
516
|
+
const switchSizes = {
|
|
517
|
+
sm: "h-5 w-9",
|
|
518
|
+
md: "h-6 w-11",
|
|
519
|
+
lg: "h-7 w-14"
|
|
520
|
+
};
|
|
521
|
+
const dotSizes = {
|
|
522
|
+
sm: "size-3",
|
|
523
|
+
md: "size-4",
|
|
524
|
+
lg: "size-5"
|
|
525
|
+
};
|
|
526
|
+
const translateSizes = {
|
|
527
|
+
sm: "translate-x-5",
|
|
528
|
+
md: "translate-x-6",
|
|
529
|
+
lg: "translate-x-8"
|
|
530
|
+
};
|
|
531
|
+
return (_ctx, _cache) => {
|
|
532
|
+
return openBlock(), createElementBlock("label", {
|
|
533
|
+
class: normalizeClass(["inline-flex items-start gap-3", __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"])
|
|
534
|
+
}, [
|
|
535
|
+
createElementVNode("button", {
|
|
536
|
+
type: "button",
|
|
537
|
+
role: "switch",
|
|
538
|
+
"aria-checked": __props.modelValue,
|
|
539
|
+
disabled: __props.disabled,
|
|
540
|
+
class: normalizeClass([
|
|
541
|
+
"relative inline-flex shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",
|
|
542
|
+
switchSizes[__props.size],
|
|
543
|
+
__props.modelValue ? "bg-primary" : "bg-gray-300 dark:bg-gray-600"
|
|
544
|
+
]),
|
|
545
|
+
onClick: toggle
|
|
546
|
+
}, [
|
|
547
|
+
createElementVNode("span", {
|
|
548
|
+
class: normalizeClass([
|
|
549
|
+
"inline-block transform rounded-full bg-white shadow-sm transition-transform",
|
|
550
|
+
dotSizes[__props.size],
|
|
551
|
+
__props.modelValue ? translateSizes[__props.size] : "translate-x-1"
|
|
552
|
+
])
|
|
553
|
+
}, null, 2)
|
|
554
|
+
], 10, _hoisted_1$1),
|
|
555
|
+
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
|
|
556
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
557
|
+
__props.description ? (openBlock(), createElementBlock("span", _hoisted_4$1, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
558
|
+
])) : createCommentVNode("", true)
|
|
559
|
+
], 2);
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
const _hoisted_1 = ["checked", "disabled", "indeterminate"];
|
|
564
|
+
const _hoisted_2 = {
|
|
565
|
+
key: 0,
|
|
566
|
+
class: "flex flex-col"
|
|
567
|
+
};
|
|
568
|
+
const _hoisted_3 = {
|
|
569
|
+
key: 0,
|
|
570
|
+
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
571
|
+
};
|
|
572
|
+
const _hoisted_4 = {
|
|
573
|
+
key: 1,
|
|
574
|
+
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
575
|
+
};
|
|
576
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
577
|
+
__name: "Checkbox",
|
|
578
|
+
props: {
|
|
579
|
+
modelValue: { type: Boolean, default: false },
|
|
580
|
+
label: {},
|
|
581
|
+
description: {},
|
|
582
|
+
disabled: { type: Boolean },
|
|
583
|
+
indeterminate: { type: Boolean }
|
|
584
|
+
},
|
|
585
|
+
emits: ["update:modelValue"],
|
|
586
|
+
setup(__props, { emit: __emit }) {
|
|
587
|
+
const emit = __emit;
|
|
588
|
+
const toggle = (event) => {
|
|
589
|
+
const target = event.target;
|
|
590
|
+
emit("update:modelValue", target.checked);
|
|
591
|
+
};
|
|
592
|
+
return (_ctx, _cache) => {
|
|
593
|
+
return openBlock(), createElementBlock("label", {
|
|
594
|
+
class: normalizeClass(["inline-flex items-start gap-3", __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"])
|
|
595
|
+
}, [
|
|
596
|
+
createElementVNode("input", {
|
|
597
|
+
type: "checkbox",
|
|
598
|
+
checked: __props.modelValue,
|
|
599
|
+
disabled: __props.disabled,
|
|
600
|
+
indeterminate: __props.indeterminate,
|
|
601
|
+
class: "mt-0.5 size-4 rounded border-gray-300 text-primary/90 focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed dark:border-gray-600 dark:bg-gray-800 dark:focus:ring-offset-gray-900",
|
|
602
|
+
onChange: toggle
|
|
603
|
+
}, null, 40, _hoisted_1),
|
|
604
|
+
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
605
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
606
|
+
__props.description ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
607
|
+
])) : createCommentVNode("", true)
|
|
608
|
+
], 2);
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
export {
|
|
613
|
+
_sfc_main$7 as _,
|
|
614
|
+
_sfc_main$6 as a,
|
|
615
|
+
_sfc_main$5 as b,
|
|
616
|
+
_sfc_main$4 as c,
|
|
617
|
+
_sfc_main$3 as d,
|
|
618
|
+
_sfc_main$2 as e,
|
|
619
|
+
_sfc_main$1 as f,
|
|
620
|
+
_sfc_main as g
|
|
621
|
+
};
|
|
622
|
+
//# sourceMappingURL=Checkbox.vue_vue_type_script_setup_true_lang-DVkcMcSN.js.map
|