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