cisse-vue-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CJb63H1I.cjs +145 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CJb63H1I.cjs.map +1 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js +146 -0
- package/dist/BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js.map +1 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js +351 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js.map +1 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs +350 -0
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs.map +1 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs +234 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs.map +1 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js +235 -0
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js.map +1 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js +540 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js.map +1 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs +539 -0
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs.map +1 -0
- package/dist/components/core/AutocompleteComponent.vue.d.ts +19 -0
- package/dist/components/core/CardComponent.vue.d.ts +24 -0
- package/dist/components/core/MenuItem.vue.d.ts +6 -0
- package/dist/components/core/StatusBadge.vue.d.ts +21 -0
- package/dist/components/core/TableAction.vue.d.ts +8 -0
- package/dist/components/core/TableComponent.vue.d.ts +40 -0
- package/dist/components/core/index.cjs +11 -0
- package/dist/components/core/index.cjs.map +1 -0
- package/dist/components/core/index.d.ts +6 -0
- package/dist/components/core/index.js +11 -0
- package/dist/components/core/index.js.map +1 -0
- package/dist/components/feedback/LoadingSpinner.vue.d.ts +7 -0
- package/dist/components/feedback/Modal.vue.d.ts +32 -0
- package/dist/components/feedback/NotificationComponent.vue.d.ts +12 -0
- package/dist/components/feedback/NotificationList.vue.d.ts +12 -0
- package/dist/components/feedback/PaginationControls.vue.d.ts +21 -0
- package/dist/components/feedback/index.cjs +9 -0
- package/dist/components/feedback/index.cjs.map +1 -0
- package/dist/components/feedback/index.d.ts +5 -0
- package/dist/components/feedback/index.js +9 -0
- package/dist/components/feedback/index.js.map +1 -0
- package/dist/components/form/FormGroup.vue.d.ts +30 -0
- package/dist/components/form/FormHelp.vue.d.ts +21 -0
- package/dist/components/form/FormInput.vue.d.ts +13 -0
- package/dist/components/form/FormLabel.vue.d.ts +21 -0
- package/dist/components/form/FormSelect.vue.d.ts +26 -0
- package/dist/components/form/SearchInput.vue.d.ts +12 -0
- package/dist/components/form/index.cjs +10 -0
- package/dist/components/form/index.cjs.map +1 -0
- package/dist/components/form/index.d.ts +6 -0
- package/dist/components/form/index.js +10 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/index.cjs +29 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +29 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/type/BadgeType.vue.d.ts +11 -0
- package/dist/components/type/BooleanType.vue.d.ts +11 -0
- package/dist/components/type/DateType.vue.d.ts +10 -0
- package/dist/components/type/NumberType.vue.d.ts +9 -0
- package/dist/components/type/TextType.vue.d.ts +8 -0
- package/dist/components/type/index.cjs +9 -0
- package/dist/components/type/index.cjs.map +1 -0
- package/dist/components/type/index.d.ts +5 -0
- package/dist/components/type/index.js +9 -0
- package/dist/components/type/index.js.map +1 -0
- package/dist/composables/index.cjs +7 -0
- package/dist/composables/index.cjs.map +1 -0
- package/dist/composables/index.d.ts +3 -0
- package/dist/composables/index.js +7 -0
- package/dist/composables/index.js.map +1 -0
- package/dist/composables/useDarkMode.d.ts +14 -0
- package/dist/composables/useExportCSV.d.ts +10 -0
- package/dist/composables/useNotifications.d.ts +27 -0
- package/dist/index-BoCtJCg0.cjs +32 -0
- package/dist/index-BoCtJCg0.cjs.map +1 -0
- package/dist/index-CGhDI10m.js +33 -0
- package/dist/index-CGhDI10m.js.map +1 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +49 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +24 -0
- package/dist/types/components.d.ts +18 -0
- package/dist/types/form.d.ts +27 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/notification.d.ts +12 -0
- package/dist/types/property.d.ts +34 -0
- package/dist/useExportCSV-B9o9lJ3D.js +130 -0
- package/dist/useExportCSV-B9o9lJ3D.js.map +1 -0
- package/dist/useExportCSV-BPC_hd25.cjs +129 -0
- package/dist/useExportCSV-BPC_hd25.cjs.map +1 -0
- package/package.json +131 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, renderSlot, createTextVNode, toDisplayString, mergeModels, useModel, withDirectives, mergeProps, vModelDynamic, createCommentVNode, Fragment, renderList, vModelSelect, computed, normalizeStyle, createBlock, withCtx, createVNode, createElementVNode, unref } from "vue";
|
|
2
|
+
import { Icon } from "@iconify/vue";
|
|
3
|
+
const _hoisted_1$5 = ["data-error", "for"];
|
|
4
|
+
const _sfc_main$5 = /* @__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$5);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _hoisted_1$4 = ["data-error"];
|
|
23
|
+
const _sfc_main$4 = /* @__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$4);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const _hoisted_1$3 = ["id", "disabled", "name", "placeholder", "type"];
|
|
43
|
+
const _sfc_main$3 = /* @__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-slate-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-slate-400 shadow-sm invalid:border-pink-500 invalid:text-pink-600 focus:border-slate-700 focus:ring-1 focus:ring-slate-700 focus:outline-none focus:invalid:border-pink-500 focus:invalid:ring-pink-500 disabled:border-slate-200 disabled:bg-slate-50 disabled:text-gray-500 disabled:shadow-none dark:border-slate-700 dark:bg-black dark:text-gray-200 dark:placeholder-slate-600 dark:focus:border-slate-300 dark:focus:ring-slate-300 dark:disabled:border-slate-800 dark:disabled:bg-slate-950 dark:disabled:text-gray-500"
|
|
69
|
+
}, _ctx.$attrs), null, 16, _hoisted_1$3)), [
|
|
70
|
+
[vModelDynamic, modelValue.value]
|
|
71
|
+
]);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const _hoisted_1$2 = ["id", "disabled", "name"];
|
|
76
|
+
const _hoisted_2$1 = {
|
|
77
|
+
key: 0,
|
|
78
|
+
value: null,
|
|
79
|
+
disabled: ""
|
|
80
|
+
};
|
|
81
|
+
const _hoisted_3 = ["value"];
|
|
82
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
83
|
+
__name: "FormSelect",
|
|
84
|
+
props: /* @__PURE__ */ mergeModels({
|
|
85
|
+
options: {},
|
|
86
|
+
type: {},
|
|
87
|
+
value: {},
|
|
88
|
+
placeholder: {},
|
|
89
|
+
disabled: { type: Boolean },
|
|
90
|
+
invalid: { type: Boolean },
|
|
91
|
+
id: {},
|
|
92
|
+
name: {}
|
|
93
|
+
}, {
|
|
94
|
+
"modelValue": { type: [String, Number, Boolean, null] },
|
|
95
|
+
"modelModifiers": {}
|
|
96
|
+
}),
|
|
97
|
+
emits: ["update:modelValue"],
|
|
98
|
+
setup(__props) {
|
|
99
|
+
const modelValue = useModel(__props, "modelValue");
|
|
100
|
+
return (_ctx, _cache) => {
|
|
101
|
+
return withDirectives((openBlock(), createElementBlock("select", mergeProps({
|
|
102
|
+
id: __props.id ?? __props.name ?? "",
|
|
103
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
104
|
+
disabled: __props.disabled,
|
|
105
|
+
name: __props.name ?? "",
|
|
106
|
+
class: "mt-1 block w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-slate-400 shadow-sm invalid:border-pink-500 invalid:text-pink-600 focus:border-slate-700 focus:ring-1 focus:ring-slate-700 focus:outline-none focus:invalid:border-pink-500 focus:invalid:ring-pink-500 disabled:border-slate-200 disabled:bg-slate-50 disabled:text-gray-500 disabled:shadow-none dark:border-slate-700 dark:bg-black dark:text-gray-200 dark:placeholder-slate-600 dark:focus:border-slate-300 dark:focus:ring-slate-300 dark:disabled:border-slate-800 dark:disabled:bg-slate-950 dark:disabled:text-gray-500"
|
|
107
|
+
}, _ctx.$attrs), [
|
|
108
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
109
|
+
__props.placeholder ? (openBlock(), createElementBlock("option", _hoisted_2$1, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true),
|
|
110
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList((__props.options ?? []).filter((el) => !el.hidden), (option) => {
|
|
111
|
+
return openBlock(), createElementBlock("option", {
|
|
112
|
+
key: String(option.value),
|
|
113
|
+
value: option.value
|
|
114
|
+
}, toDisplayString(option.label), 9, _hoisted_3);
|
|
115
|
+
}), 128))
|
|
116
|
+
])
|
|
117
|
+
], 16, _hoisted_1$2)), [
|
|
118
|
+
[vModelSelect, modelValue.value]
|
|
119
|
+
]);
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
const _hoisted_1$1 = ["hidden"];
|
|
124
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
125
|
+
__name: "FormGroup",
|
|
126
|
+
props: /* @__PURE__ */ mergeModels({
|
|
127
|
+
label: {},
|
|
128
|
+
cols: { default: 6 },
|
|
129
|
+
hidden: { type: Boolean },
|
|
130
|
+
error: { type: [String, Boolean] },
|
|
131
|
+
type: {},
|
|
132
|
+
value: {},
|
|
133
|
+
placeholder: {},
|
|
134
|
+
disabled: { type: Boolean },
|
|
135
|
+
invalid: { type: Boolean },
|
|
136
|
+
id: {},
|
|
137
|
+
name: {},
|
|
138
|
+
options: {}
|
|
139
|
+
}, {
|
|
140
|
+
"modelValue": {},
|
|
141
|
+
"modelModifiers": {}
|
|
142
|
+
}),
|
|
143
|
+
emits: ["update:modelValue"],
|
|
144
|
+
setup(__props) {
|
|
145
|
+
const props = __props;
|
|
146
|
+
const modelValue = useModel(__props, "modelValue");
|
|
147
|
+
const computedCols = computed(() => `span ${props.cols} / span ${props.cols}`);
|
|
148
|
+
const isSelect = computed(() => props.type === "select");
|
|
149
|
+
return (_ctx, _cache) => {
|
|
150
|
+
return openBlock(), createElementBlock("div", {
|
|
151
|
+
style: normalizeStyle({ gridColumn: computedCols.value }),
|
|
152
|
+
hidden: __props.hidden
|
|
153
|
+
}, [
|
|
154
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
155
|
+
renderSlot(_ctx.$slots, "label", {}, () => [
|
|
156
|
+
__props.label ? (openBlock(), createBlock(_sfc_main$5, {
|
|
157
|
+
key: 0,
|
|
158
|
+
"html-for": __props.id ?? __props.name,
|
|
159
|
+
error: __props.error
|
|
160
|
+
}, {
|
|
161
|
+
default: withCtx(() => [
|
|
162
|
+
createTextVNode(toDisplayString(__props.label), 1)
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
}, 8, ["html-for", "error"])) : createCommentVNode("", true)
|
|
166
|
+
]),
|
|
167
|
+
renderSlot(_ctx.$slots, "input", {}, () => [
|
|
168
|
+
isSelect.value ? (openBlock(), createBlock(_sfc_main$2, mergeProps({
|
|
169
|
+
key: 0,
|
|
170
|
+
modelValue: modelValue.value,
|
|
171
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event)
|
|
172
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"])) : (openBlock(), createBlock(_sfc_main$3, mergeProps({
|
|
173
|
+
key: 1,
|
|
174
|
+
modelValue: modelValue.value,
|
|
175
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => modelValue.value = $event)
|
|
176
|
+
}, { ..._ctx.$attrs, ..._ctx.$props }), null, 16, ["modelValue"]))
|
|
177
|
+
]),
|
|
178
|
+
__props.error && typeof __props.error === "string" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
179
|
+
key: 0,
|
|
180
|
+
error: true
|
|
181
|
+
}, {
|
|
182
|
+
default: withCtx(() => [
|
|
183
|
+
createTextVNode(toDisplayString(__props.error), 1)
|
|
184
|
+
]),
|
|
185
|
+
_: 1
|
|
186
|
+
})) : createCommentVNode("", true)
|
|
187
|
+
])
|
|
188
|
+
], 12, _hoisted_1$1);
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
const _hoisted_1 = { class: "relative" };
|
|
193
|
+
const _hoisted_2 = ["disabled", "placeholder", "value"];
|
|
194
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
195
|
+
__name: "SearchInput",
|
|
196
|
+
props: {
|
|
197
|
+
modelValue: {},
|
|
198
|
+
placeholder: { default: "Search..." },
|
|
199
|
+
icon: { default: "lucide:search" },
|
|
200
|
+
disabled: { type: Boolean, default: false }
|
|
201
|
+
},
|
|
202
|
+
emits: ["update:modelValue"],
|
|
203
|
+
setup(__props, { emit: __emit }) {
|
|
204
|
+
const emit = __emit;
|
|
205
|
+
const handleInput = (event) => {
|
|
206
|
+
const target = event.target;
|
|
207
|
+
emit("update:modelValue", target.value);
|
|
208
|
+
};
|
|
209
|
+
return (_ctx, _cache) => {
|
|
210
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
211
|
+
createVNode(unref(Icon), {
|
|
212
|
+
icon: __props.icon,
|
|
213
|
+
class: "absolute top-1/2 left-3 h-5 w-5 -translate-y-1/2 text-gray-400"
|
|
214
|
+
}, null, 8, ["icon"]),
|
|
215
|
+
createElementVNode("input", {
|
|
216
|
+
disabled: __props.disabled,
|
|
217
|
+
placeholder: __props.placeholder,
|
|
218
|
+
value: __props.modelValue,
|
|
219
|
+
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",
|
|
220
|
+
type: "text",
|
|
221
|
+
onInput: handleInput
|
|
222
|
+
}, null, 40, _hoisted_2)
|
|
223
|
+
]);
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
export {
|
|
228
|
+
_sfc_main$5 as _,
|
|
229
|
+
_sfc_main$4 as a,
|
|
230
|
+
_sfc_main$3 as b,
|
|
231
|
+
_sfc_main$2 as c,
|
|
232
|
+
_sfc_main$1 as d,
|
|
233
|
+
_sfc_main as e
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js","sources":["../src/components/form/FormLabel.vue","../src/components/form/FormHelp.vue","../src/components/form/FormInput.vue","../src/components/form/FormSelect.vue","../src/components/form/FormGroup.vue","../src/components/form/SearchInput.vue"],"sourcesContent":["<script lang=\"ts\" setup>\ndefineProps<{\n error?: string | boolean\n htmlFor?: string\n}>()\n</script>\n\n<template>\n <label\n :data-error=\"!!error\"\n :for=\"htmlFor ?? ''\"\n class=\"block text-sm font-medium text-gray-700 data-[error=true]:text-red-500 dark:text-gray-300\"\n >\n <slot />\n </label>\n</template>\n","<script lang=\"ts\" setup>\ndefineProps<{\n error?: boolean\n text?: string\n}>()\n</script>\n\n<template>\n <p\n :data-error=\"error\"\n class=\"mt-2 text-sm text-gray-400 peer-invalid:visible data-[error=true]:text-red-500 dark:text-gray-500\"\n >\n <slot>{{ text ?? '' }}</slot>\n </p>\n</template>\n","<script lang=\"ts\" setup>\nimport type { InputProps } from '@/types'\n\nwithDefaults(defineProps<InputProps>(), {\n type: 'text',\n})\n\nconst modelValue = defineModel<string>()\n</script>\n\n<template>\n <input\n :id=\"id ?? name ?? ''\"\n v-model=\"modelValue\"\n :disabled=\"disabled\"\n :name=\"name ?? ''\"\n :placeholder=\"placeholder\"\n :type=\"type\"\n class=\"mt-1 block w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-slate-400 shadow-sm invalid:border-pink-500 invalid:text-pink-600 focus:border-slate-700 focus:ring-1 focus:ring-slate-700 focus:outline-none focus:invalid:border-pink-500 focus:invalid:ring-pink-500 disabled:border-slate-200 disabled:bg-slate-50 disabled:text-gray-500 disabled:shadow-none dark:border-slate-700 dark:bg-black dark:text-gray-200 dark:placeholder-slate-600 dark:focus:border-slate-300 dark:focus:ring-slate-300 dark:disabled:border-slate-800 dark:disabled:bg-slate-950 dark:disabled:text-gray-500\"\n v-bind=\"$attrs\"\n />\n</template>\n","<script lang=\"ts\" setup>\nimport type { SelectProps, SelectOption } from '@/types'\n\ndefineProps<SelectProps>()\n\nconst modelValue = defineModel<string | number | boolean | null>()\n</script>\n\n<template>\n <select\n :id=\"id ?? name ?? ''\"\n v-model=\"modelValue\"\n :disabled=\"disabled\"\n :name=\"name ?? ''\"\n class=\"mt-1 block w-full rounded-md border border-slate-300 bg-white px-3 py-2 text-sm text-gray-800 placeholder-slate-400 shadow-sm invalid:border-pink-500 invalid:text-pink-600 focus:border-slate-700 focus:ring-1 focus:ring-slate-700 focus:outline-none focus:invalid:border-pink-500 focus:invalid:ring-pink-500 disabled:border-slate-200 disabled:bg-slate-50 disabled:text-gray-500 disabled:shadow-none dark:border-slate-700 dark:bg-black dark:text-gray-200 dark:placeholder-slate-600 dark:focus:border-slate-300 dark:focus:ring-slate-300 dark:disabled:border-slate-800 dark:disabled:bg-slate-950 dark:disabled:text-gray-500\"\n v-bind=\"$attrs\"\n >\n <slot>\n <option v-if=\"placeholder\" :value=\"null\" disabled>\n {{ placeholder }}\n </option>\n\n <option\n v-for=\"option in (options ?? []).filter((el: SelectOption) => !el.hidden)\"\n :key=\"String(option.value)\"\n :value=\"option.value\"\n >\n {{ option.label }}\n </option>\n </slot>\n </select>\n</template>\n","<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport type { FormGroupProps } from '@/types'\nimport FormLabel from './FormLabel.vue'\nimport FormInput from './FormInput.vue'\nimport FormSelect from './FormSelect.vue'\nimport FormHelp from './FormHelp.vue'\n\nconst props = withDefaults(defineProps<FormGroupProps>(), {\n cols: 6,\n})\n\nconst modelValue = defineModel()\n\nconst computedCols = computed(() => `span ${props.cols} / span ${props.cols}`)\n\nconst isSelect = computed(() => props.type === 'select')\n</script>\n\n<template>\n <div :style=\"{ gridColumn: computedCols }\" :hidden=\"hidden\">\n <slot>\n <slot name=\"label\">\n <FormLabel v-if=\"label\" :html-for=\"id ?? name\" :error=\"error\">\n {{ label }}\n </FormLabel>\n </slot>\n\n <slot name=\"input\">\n <FormSelect\n v-if=\"isSelect\"\n v-model=\"modelValue\"\n v-bind=\"{ ...$attrs, ...$props }\"\n />\n <FormInput\n v-else\n v-model=\"modelValue\"\n v-bind=\"{ ...$attrs, ...$props }\"\n />\n </slot>\n\n <FormHelp v-if=\"error && typeof error === 'string'\" :error=\"true\">\n {{ error }}\n </FormHelp>\n </slot>\n </div>\n</template>\n","<script lang=\"ts\" setup>\nimport { Icon } from '@iconify/vue'\n\nconst {\n placeholder = 'Search...',\n icon = 'lucide:search',\n disabled = false,\n} = defineProps<{\n modelValue?: string\n placeholder?: string\n icon?: string\n disabled?: boolean\n}>()\n\nconst emit = defineEmits<{\n 'update:modelValue': [value: string]\n}>()\n\nconst handleInput = (event: Event) => {\n const target = event.target as HTMLInputElement\n emit('update:modelValue', target.value)\n}\n</script>\n\n<template>\n <div class=\"relative\">\n <Icon :icon=\"icon\" class=\"absolute top-1/2 left-3 h-5 w-5 -translate-y-1/2 text-gray-400\" />\n <input\n :disabled=\"disabled\"\n :placeholder=\"placeholder\"\n :value=\"modelValue\"\n 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\"\n type=\"text\"\n @input=\"handleInput\"\n />\n </div>\n</template>\n"],"names":["_createElementBlock","_renderSlot","_useModel","_withDirectives","_openBlock","_mergeProps","$attrs","_hoisted_1","_hoisted_2","_toDisplayString","_Fragment","_renderList","_createBlock","FormLabel","FormSelect","$props","FormInput","FormHelp","_createVNode","_unref","_createElementVNode"],"mappings":";;;;;;;;;;;0BAQEA,mBAMQ,SAAA;AAAA,QALL,gBAAc,QAAA;AAAA,QACd,KAAK,QAAA,WAAO;AAAA,QACb,OAAM;AAAA,MAAA;QAENC,WAAQ,KAAA,QAAA,SAAA;AAAA,MAAA;;;;;;;;;;;;;0BCLVD,mBAKI,KAAA;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