windly-ui 1.0.1 → 1.0.3
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/module.d.mts +3 -0
- package/dist/module.json +8 -0
- package/dist/module.mjs +26 -0
- package/dist/runtime/components/Accordion.d.vue.ts +39 -0
- package/{ui-library → dist/runtime}/components/Accordion.vue +44 -70
- package/dist/runtime/components/Accordion.vue.d.ts +39 -0
- package/dist/runtime/components/Avatar.d.vue.ts +141 -0
- package/dist/runtime/components/Avatar.vue +72 -0
- package/dist/runtime/components/Avatar.vue.d.ts +141 -0
- package/dist/runtime/components/Badge.d.vue.ts +133 -0
- package/dist/runtime/components/Badge.vue +99 -0
- package/dist/runtime/components/Badge.vue.d.ts +133 -0
- package/dist/runtime/components/Breadcrumbs.d.vue.ts +83 -0
- package/{ui-library → dist/runtime}/components/Breadcrumbs.vue +37 -59
- package/dist/runtime/components/Breadcrumbs.vue.d.ts +83 -0
- package/dist/runtime/components/Button.d.vue.ts +199 -0
- package/dist/runtime/components/Button.vue +125 -0
- package/dist/runtime/components/Button.vue.d.ts +199 -0
- package/dist/runtime/components/Card.d.vue.ts +83 -0
- package/{ui-library → dist/runtime}/components/Card.vue +26 -39
- package/dist/runtime/components/Card.vue.d.ts +83 -0
- package/dist/runtime/components/Checkbox.d.vue.ts +190 -0
- package/{ui-library → dist/runtime}/components/Checkbox.vue +45 -68
- package/dist/runtime/components/Checkbox.vue.d.ts +190 -0
- package/dist/runtime/components/CodeBlock.d.vue.ts +16 -0
- package/dist/runtime/components/CodeBlock.vue +75 -0
- package/dist/runtime/components/CodeBlock.vue.d.ts +16 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +91 -0
- package/dist/runtime/components/ColorPicker.vue +244 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +91 -0
- package/dist/runtime/components/Date.d.vue.ts +137 -0
- package/dist/runtime/components/Date.vue +201 -0
- package/dist/runtime/components/Date.vue.d.ts +137 -0
- package/dist/runtime/components/Dialog.d.vue.ts +103 -0
- package/{ui-library → dist/runtime}/components/Dialog.vue +30 -65
- package/dist/runtime/components/Dialog.vue.d.ts +103 -0
- package/dist/runtime/components/Divider.d.vue.ts +51 -0
- package/dist/runtime/components/Divider.vue +52 -0
- package/dist/runtime/components/Divider.vue.d.ts +51 -0
- package/dist/runtime/components/Drawer.d.vue.ts +30 -0
- package/dist/runtime/components/Drawer.vue +43 -0
- package/dist/runtime/components/Drawer.vue.d.ts +30 -0
- package/dist/runtime/components/Dropdown.d.vue.ts +34 -0
- package/dist/runtime/components/Dropdown.vue +127 -0
- package/dist/runtime/components/Dropdown.vue.d.ts +34 -0
- package/dist/runtime/components/FileUploader.d.vue.ts +58 -0
- package/dist/runtime/components/FileUploader.vue +202 -0
- package/dist/runtime/components/FileUploader.vue.d.ts +58 -0
- package/dist/runtime/components/Icon.d.vue.ts +41 -0
- package/dist/runtime/components/Icon.vue +66 -0
- package/dist/runtime/components/Icon.vue.d.ts +41 -0
- package/dist/runtime/components/Image.d.vue.ts +77 -0
- package/dist/runtime/components/Image.vue +61 -0
- package/dist/runtime/components/Image.vue.d.ts +77 -0
- package/dist/runtime/components/Input.d.vue.ts +66 -0
- package/dist/runtime/components/Input.vue +233 -0
- package/dist/runtime/components/Input.vue.d.ts +66 -0
- package/dist/runtime/components/Radio.d.vue.ts +41 -0
- package/dist/runtime/components/Radio.vue +222 -0
- package/dist/runtime/components/Radio.vue.d.ts +41 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +79 -0
- package/dist/runtime/components/ScrollArea.vue +36 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +79 -0
- package/dist/runtime/components/Select.d.vue.ts +43 -0
- package/dist/runtime/components/Select.vue +200 -0
- package/dist/runtime/components/Select.vue.d.ts +43 -0
- package/dist/runtime/components/Stepper.d.vue.ts +46 -0
- package/dist/runtime/components/Stepper.vue +218 -0
- package/dist/runtime/components/Stepper.vue.d.ts +46 -0
- package/dist/runtime/components/TabPanel.d.vue.ts +17 -0
- package/dist/runtime/components/TabPanel.vue +21 -0
- package/dist/runtime/components/TabPanel.vue.d.ts +17 -0
- package/dist/runtime/components/Table.d.vue.ts +40 -0
- package/dist/runtime/components/Table.vue +92 -0
- package/dist/runtime/components/Table.vue.d.ts +40 -0
- package/dist/runtime/components/Tabs.d.vue.ts +20 -0
- package/dist/runtime/components/Tabs.vue +62 -0
- package/dist/runtime/components/Tabs.vue.d.ts +20 -0
- package/dist/runtime/components/Textarea.d.vue.ts +208 -0
- package/dist/runtime/components/Textarea.vue +185 -0
- package/dist/runtime/components/Textarea.vue.d.ts +208 -0
- package/dist/runtime/components/Toggle.d.vue.ts +36 -0
- package/dist/runtime/components/Toggle.vue +173 -0
- package/dist/runtime/components/Toggle.vue.d.ts +36 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +63 -0
- package/dist/runtime/components/Tooltip.vue +144 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +63 -0
- package/dist/runtime/components/uiProps.d.ts +38 -0
- package/{ui-library/components/uiProps.ts → dist/runtime/components/uiProps.js} +2 -2
- package/dist/runtime/components/useUiClasses.d.ts +43 -0
- package/{ui-library/components/useUiClasses.ts → dist/runtime/components/useUiClasses.js} +25 -60
- package/dist/runtime/composables/plugin.d.ts +2 -0
- package/dist/runtime/composables/plugin.js +3 -0
- package/dist/runtime/tailwind-color.d.ts +2 -0
- package/dist/runtime/tailwind-color.js +5859 -0
- package/dist/types.d.mts +7 -0
- package/package.json +14 -16
- package/README.md +0 -208
- package/ui-library/components/Avatar.vue +0 -121
- package/ui-library/components/Badge.vue +0 -116
- package/ui-library/components/Button.vue +0 -154
- package/ui-library/components/CodeBlock.vue +0 -99
- package/ui-library/components/ColorPicker.vue +0 -302
- package/ui-library/components/Date.vue +0 -240
- package/ui-library/components/Divider.vue +0 -78
- package/ui-library/components/Drawer.vue +0 -67
- package/ui-library/components/Dropdown.vue +0 -248
- package/ui-library/components/FileUploader.vue +0 -330
- package/ui-library/components/Icon.vue +0 -82
- package/ui-library/components/Image.vue +0 -78
- package/ui-library/components/Input.vue +0 -531
- package/ui-library/components/Radio.vue +0 -356
- package/ui-library/components/ScrollArea.vue +0 -43
- package/ui-library/components/Select.vue +0 -309
- package/ui-library/components/Stepper.vue +0 -361
- package/ui-library/components/TabPanel.vue +0 -25
- package/ui-library/components/Table.vue +0 -152
- package/ui-library/components/Tabs.vue +0 -71
- package/ui-library/components/Textarea.vue +0 -233
- package/ui-library/components/Toggle.vue +0 -319
- package/ui-library/components/Tooltip.vue +0 -200
- package/ui-library/components/plugin.ts +0 -8
- package/ui-library/module.ts +0 -20
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
defineOptions({
|
|
4
|
+
name: "UIFileUploader"
|
|
5
|
+
});
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
modelValue: { type: Array, required: false, default: () => [] },
|
|
8
|
+
header: { type: String, required: false, default: "Upload Files" },
|
|
9
|
+
subHeader: { type: String, required: false, default: "Supports document uploads" },
|
|
10
|
+
fileType: { type: String, required: false, default: "*" },
|
|
11
|
+
multiple: { type: Boolean, required: false, default: true },
|
|
12
|
+
disabled: { type: Boolean, required: false, default: false },
|
|
13
|
+
bordered: { type: Boolean, required: false, default: true },
|
|
14
|
+
flat: { type: Boolean, required: false, default: false },
|
|
15
|
+
rounded: { type: String, required: false, default: "xl" },
|
|
16
|
+
borderColor: { type: String, required: false, default: "gray-300" },
|
|
17
|
+
bgColor: { type: String, required: false, default: "white" },
|
|
18
|
+
separator: { type: String, required: false, default: "dashed" },
|
|
19
|
+
dense: { type: Boolean, required: false, default: false },
|
|
20
|
+
fileRemoverIcon: { type: String, required: false, default: "delete" },
|
|
21
|
+
fileSizeLimitKb: { type: Number, required: false, default: 2048 }
|
|
22
|
+
});
|
|
23
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
24
|
+
const fileInput = ref(
|
|
25
|
+
null
|
|
26
|
+
);
|
|
27
|
+
const errorMessage = ref("");
|
|
28
|
+
const files = computed({
|
|
29
|
+
get: () => props.modelValue,
|
|
30
|
+
set: (value) => emit(
|
|
31
|
+
"update:modelValue",
|
|
32
|
+
value
|
|
33
|
+
)
|
|
34
|
+
});
|
|
35
|
+
const isHex = (val) => val.startsWith("#");
|
|
36
|
+
const roundedClasses = computed(
|
|
37
|
+
() => {
|
|
38
|
+
const map = {
|
|
39
|
+
none: "",
|
|
40
|
+
sm: "rounded-sm",
|
|
41
|
+
md: "rounded-md",
|
|
42
|
+
lg: "rounded-lg",
|
|
43
|
+
xl: "rounded-xl"
|
|
44
|
+
};
|
|
45
|
+
return map[props.rounded];
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
const separatorClasses = computed(
|
|
49
|
+
() => {
|
|
50
|
+
switch (props.separator) {
|
|
51
|
+
case "solid":
|
|
52
|
+
return "border-solid";
|
|
53
|
+
case "dotted":
|
|
54
|
+
return "border-dotted";
|
|
55
|
+
case "dashed":
|
|
56
|
+
default:
|
|
57
|
+
return "border-dashed";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
const uploaderClasses = computed(
|
|
62
|
+
() => [
|
|
63
|
+
"border-2 transition-all duration-300 flex flex-col items-center justify-center cursor-pointer",
|
|
64
|
+
roundedClasses.value,
|
|
65
|
+
separatorClasses.value,
|
|
66
|
+
props.bordered ? !isHex(props.borderColor) ? `border-${props.borderColor}` : "" : "border-transparent",
|
|
67
|
+
props.flat ? "shadow-none" : "shadow-md",
|
|
68
|
+
!isHex(props.bgColor) ? `bg-${props.bgColor}` : "",
|
|
69
|
+
props.dense ? "p-4" : "p-8",
|
|
70
|
+
props.disabled ? "opacity-50 pointer-events-none" : "hover:shadow-lg"
|
|
71
|
+
]
|
|
72
|
+
);
|
|
73
|
+
const uploaderStyle = computed(
|
|
74
|
+
() => {
|
|
75
|
+
const style = {};
|
|
76
|
+
if (isHex(props.borderColor)) {
|
|
77
|
+
style.borderColor = props.borderColor;
|
|
78
|
+
}
|
|
79
|
+
if (isHex(props.bgColor)) {
|
|
80
|
+
style.backgroundColor = props.bgColor;
|
|
81
|
+
}
|
|
82
|
+
return style;
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
const triggerFileInput = () => {
|
|
86
|
+
fileInput.value?.click();
|
|
87
|
+
};
|
|
88
|
+
const createFileObject = (file) => ({
|
|
89
|
+
file,
|
|
90
|
+
name: file.name,
|
|
91
|
+
size: file.size,
|
|
92
|
+
type: file.type
|
|
93
|
+
});
|
|
94
|
+
const handleFiles = (event) => {
|
|
95
|
+
const selectedFiles = "dataTransfer" in event && event.dataTransfer ? Array.from(
|
|
96
|
+
event.dataTransfer.files
|
|
97
|
+
) : Array.from(
|
|
98
|
+
event.target.files || []
|
|
99
|
+
);
|
|
100
|
+
const validFiles = selectedFiles.filter((file) => {
|
|
101
|
+
const fileSizeInKb = file.size / 1024;
|
|
102
|
+
if (fileSizeInKb > props.fileSizeLimitKb) {
|
|
103
|
+
errorMessage.value = `File "${file.name}" exceeds ${props.fileSizeLimitKb} KB`;
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return true;
|
|
107
|
+
});
|
|
108
|
+
const mapped = validFiles.map(
|
|
109
|
+
createFileObject
|
|
110
|
+
);
|
|
111
|
+
files.value = props.multiple ? [
|
|
112
|
+
...files.value,
|
|
113
|
+
...mapped
|
|
114
|
+
] : mapped;
|
|
115
|
+
if (mapped.length > 0) {
|
|
116
|
+
errorMessage.value = "";
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const removeFile = (index) => {
|
|
120
|
+
files.value = files.value.filter(
|
|
121
|
+
(_, i) => i !== index
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<template>
|
|
127
|
+
<div class="max-w-lg mx-auto">
|
|
128
|
+
<!-- Header -->
|
|
129
|
+
<div class="mb-6 text-center">
|
|
130
|
+
<h2 class="text-2xl font-bold text-gray-800 dark:text-white">
|
|
131
|
+
{{ header }}
|
|
132
|
+
</h2>
|
|
133
|
+
|
|
134
|
+
<p class="text-sm text-gray-500">
|
|
135
|
+
{{ subHeader }}
|
|
136
|
+
</p>
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
<!-- Hidden Input -->
|
|
140
|
+
<input ref="fileInput" type="file" class="hidden" :accept="fileType" :multiple="multiple" @change="handleFiles">
|
|
141
|
+
|
|
142
|
+
<!-- Dropzone -->
|
|
143
|
+
<div :class="uploaderClasses" :style="uploaderStyle" @click="triggerFileInput" @dragover.prevent @drop.prevent="
|
|
144
|
+
handleFiles($event)
|
|
145
|
+
">
|
|
146
|
+
<slot name="content">
|
|
147
|
+
<p class="text-gray-600 mb-4">
|
|
148
|
+
{{
|
|
149
|
+
multiple ? "Drag & drop files here" : "Drag & drop file here"
|
|
150
|
+
}}
|
|
151
|
+
</p>
|
|
152
|
+
|
|
153
|
+
<button type="button" class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700">
|
|
154
|
+
{{
|
|
155
|
+
multiple ? "Browse Files" : "Browse File"
|
|
156
|
+
}}
|
|
157
|
+
</button>
|
|
158
|
+
</slot>
|
|
159
|
+
</div>
|
|
160
|
+
|
|
161
|
+
<!-- Uploaded Files -->
|
|
162
|
+
<div v-if="files.length" class="mt-6">
|
|
163
|
+
<h3 class="text-lg font-semibold mb-4">
|
|
164
|
+
Uploaded Files
|
|
165
|
+
</h3>
|
|
166
|
+
|
|
167
|
+
<ul class="space-y-2">
|
|
168
|
+
<li v-for="(file, index) in files" :key="index"
|
|
169
|
+
class="flex items-center justify-between p-4 rounded-lg border border-gray-200 bg-gray-50">
|
|
170
|
+
<div class="flex items-center gap-3">
|
|
171
|
+
<span class="material-icons text-blue-500">
|
|
172
|
+
description
|
|
173
|
+
</span>
|
|
174
|
+
|
|
175
|
+
<span>
|
|
176
|
+
{{ file.name }}
|
|
177
|
+
</span>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<button type="button" class="text-red-500 hover:text-red-700" @click.stop="
|
|
181
|
+
removeFile(index)
|
|
182
|
+
">
|
|
183
|
+
<span class="material-icons">
|
|
184
|
+
{{
|
|
185
|
+
fileRemoverIcon
|
|
186
|
+
}}
|
|
187
|
+
</span>
|
|
188
|
+
</button>
|
|
189
|
+
</li>
|
|
190
|
+
</ul>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<!-- Error -->
|
|
194
|
+
<div v-if="errorMessage" class="mt-4 text-sm text-red-500">
|
|
195
|
+
{{ errorMessage }}
|
|
196
|
+
</div>
|
|
197
|
+
</div>
|
|
198
|
+
</template>
|
|
199
|
+
|
|
200
|
+
<style scoped>
|
|
201
|
+
.material-icons{font-size:20px}
|
|
202
|
+
</style>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
interface UploadedFile {
|
|
2
|
+
file: File;
|
|
3
|
+
name: string;
|
|
4
|
+
size: number;
|
|
5
|
+
type: string;
|
|
6
|
+
}
|
|
7
|
+
type Separator = 'solid' | 'dashed' | 'dotted';
|
|
8
|
+
type Rounded = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
type __VLS_Props = {
|
|
10
|
+
modelValue?: UploadedFile[];
|
|
11
|
+
header?: string;
|
|
12
|
+
subHeader?: string;
|
|
13
|
+
fileType?: string;
|
|
14
|
+
multiple?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
bordered?: boolean;
|
|
17
|
+
flat?: boolean;
|
|
18
|
+
rounded?: Rounded;
|
|
19
|
+
borderColor?: string;
|
|
20
|
+
bgColor?: string;
|
|
21
|
+
separator?: Separator;
|
|
22
|
+
dense?: boolean;
|
|
23
|
+
fileRemoverIcon?: string;
|
|
24
|
+
fileSizeLimitKb?: number;
|
|
25
|
+
};
|
|
26
|
+
declare var __VLS_1: {};
|
|
27
|
+
type __VLS_Slots = {} & {
|
|
28
|
+
content?: (props: typeof __VLS_1) => any;
|
|
29
|
+
};
|
|
30
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
31
|
+
"update:modelValue": (value: UploadedFile[]) => any;
|
|
32
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
33
|
+
"onUpdate:modelValue"?: ((value: UploadedFile[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
modelValue: UploadedFile[];
|
|
36
|
+
disabled: boolean;
|
|
37
|
+
dense: boolean;
|
|
38
|
+
header: string;
|
|
39
|
+
rounded: Rounded;
|
|
40
|
+
borderColor: string;
|
|
41
|
+
separator: Separator;
|
|
42
|
+
flat: boolean;
|
|
43
|
+
bordered: boolean;
|
|
44
|
+
subHeader: string;
|
|
45
|
+
fileType: string;
|
|
46
|
+
multiple: boolean;
|
|
47
|
+
bgColor: string;
|
|
48
|
+
fileRemoverIcon: string;
|
|
49
|
+
fileSizeLimitKb: number;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
52
|
+
declare const _default: typeof __VLS_export;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
55
|
+
new (): {
|
|
56
|
+
$slots: S;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
name: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
library: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
size: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
name: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
library: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
color: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
size: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
36
|
+
color: string;
|
|
37
|
+
size: string;
|
|
38
|
+
library: string;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineOptions({
|
|
3
|
+
inheritAttrs: false
|
|
4
|
+
});
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
name: { type: String, required: true },
|
|
8
|
+
library: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: "material"
|
|
11
|
+
},
|
|
12
|
+
color: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "md"
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const isHex = (val) => val.startsWith("#");
|
|
22
|
+
const sizeMap = {
|
|
23
|
+
xs: "text-xs",
|
|
24
|
+
sm: "text-sm",
|
|
25
|
+
md: "text-base",
|
|
26
|
+
lg: "text-xl",
|
|
27
|
+
xl: "text-3xl"
|
|
28
|
+
};
|
|
29
|
+
const iconStyle = computed(() => {
|
|
30
|
+
const style = {};
|
|
31
|
+
if (isHex(props.color)) {
|
|
32
|
+
style.color = props.color;
|
|
33
|
+
}
|
|
34
|
+
return style;
|
|
35
|
+
});
|
|
36
|
+
const iconClass = computed(() => {
|
|
37
|
+
const classes = [
|
|
38
|
+
sizeMap[props.size]
|
|
39
|
+
];
|
|
40
|
+
if (!isHex(props.color) && props.color) {
|
|
41
|
+
classes.push(`text-${props.color}`);
|
|
42
|
+
}
|
|
43
|
+
switch (props.library) {
|
|
44
|
+
case "material":
|
|
45
|
+
classes.push("material-icons");
|
|
46
|
+
break;
|
|
47
|
+
case "material-symbols":
|
|
48
|
+
classes.push("material-symbols-outlined");
|
|
49
|
+
break;
|
|
50
|
+
case "fontawesome":
|
|
51
|
+
classes.push(props.name);
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
return classes;
|
|
55
|
+
});
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<i
|
|
60
|
+
:class="iconClass"
|
|
61
|
+
:style="iconStyle"
|
|
62
|
+
v-bind="$attrs"
|
|
63
|
+
>
|
|
64
|
+
{{ library.includes("material") ? name : "" }}
|
|
65
|
+
</i>
|
|
66
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
name: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
library: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
size: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
name: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
library: {
|
|
24
|
+
type: StringConstructor;
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
color: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
size: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
default: string;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {
|
|
36
|
+
color: string;
|
|
37
|
+
size: string;
|
|
38
|
+
library: string;
|
|
39
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
src: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
alt: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
placeholder: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
width: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
height: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
fit: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
borderColor: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
borderType: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
src: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
alt: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
placeholder: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
width: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
height: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
fit: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
borderColor: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
borderType: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
}>> & Readonly<{}>, {
|
|
68
|
+
borderColor: string;
|
|
69
|
+
alt: string;
|
|
70
|
+
placeholder: string;
|
|
71
|
+
width: string;
|
|
72
|
+
height: string;
|
|
73
|
+
fit: string;
|
|
74
|
+
borderType: string;
|
|
75
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
declare const _default: typeof __VLS_export;
|
|
77
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineOptions({
|
|
3
|
+
inheritAttrs: false
|
|
4
|
+
});
|
|
5
|
+
import { computed, ref } from "vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
src: { type: String, required: true },
|
|
8
|
+
alt: { type: String, default: "" },
|
|
9
|
+
placeholder: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: "/images/placeholder.png"
|
|
12
|
+
},
|
|
13
|
+
width: { type: String, default: "100%" },
|
|
14
|
+
height: { type: String, default: "auto" },
|
|
15
|
+
fit: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "cover"
|
|
18
|
+
},
|
|
19
|
+
borderColor: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
borderType: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "none"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const imageSrc = ref(props.src);
|
|
29
|
+
const isHex = (val) => val.startsWith("#");
|
|
30
|
+
const imageStyle = computed(() => {
|
|
31
|
+
const style = {
|
|
32
|
+
width: props.width,
|
|
33
|
+
height: props.height,
|
|
34
|
+
objectFit: props.fit
|
|
35
|
+
};
|
|
36
|
+
if (isHex(props.borderColor)) {
|
|
37
|
+
style.borderColor = props.borderColor;
|
|
38
|
+
}
|
|
39
|
+
return style;
|
|
40
|
+
});
|
|
41
|
+
const imageClass = computed(() => [
|
|
42
|
+
props.borderType !== "none" ? "border" : "",
|
|
43
|
+
props.borderType === "dashed" ? "border-dashed" : "",
|
|
44
|
+
props.borderType === "dotted" ? "border-dotted" : "",
|
|
45
|
+
!isHex(props.borderColor) ? `border-${props.borderColor}` : ""
|
|
46
|
+
]);
|
|
47
|
+
function onError() {
|
|
48
|
+
imageSrc.value = props.placeholder;
|
|
49
|
+
}
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<template>
|
|
53
|
+
<img
|
|
54
|
+
:src="imageSrc"
|
|
55
|
+
:alt="alt"
|
|
56
|
+
:class="imageClass"
|
|
57
|
+
:style="imageStyle"
|
|
58
|
+
@error="onError"
|
|
59
|
+
v-bind="$attrs"
|
|
60
|
+
>
|
|
61
|
+
</template>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
src: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
alt: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
placeholder: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
default: string;
|
|
13
|
+
};
|
|
14
|
+
width: {
|
|
15
|
+
type: StringConstructor;
|
|
16
|
+
default: string;
|
|
17
|
+
};
|
|
18
|
+
height: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
fit: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
borderColor: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
borderType: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
35
|
+
src: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
alt: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
default: string;
|
|
42
|
+
};
|
|
43
|
+
placeholder: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
width: {
|
|
48
|
+
type: StringConstructor;
|
|
49
|
+
default: string;
|
|
50
|
+
};
|
|
51
|
+
height: {
|
|
52
|
+
type: StringConstructor;
|
|
53
|
+
default: string;
|
|
54
|
+
};
|
|
55
|
+
fit: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
borderColor: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
borderType: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
}>> & Readonly<{}>, {
|
|
68
|
+
borderColor: string;
|
|
69
|
+
alt: string;
|
|
70
|
+
placeholder: string;
|
|
71
|
+
width: string;
|
|
72
|
+
height: string;
|
|
73
|
+
fit: string;
|
|
74
|
+
borderType: string;
|
|
75
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
declare const _default: typeof __VLS_export;
|
|
77
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
type SupportedInputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'date' | 'datetime-local' | 'month' | 'week' | 'time';
|
|
2
|
+
type ValidationRule = "alphabets" | "numbers" | "spaces" | "name" | "punctuation" | "integer" | "positive" | "negative" | "decimal" | "scientific" | "uppercase" | "lowercase";
|
|
3
|
+
type ValidateOn = "input" | "blur";
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
modelValue: string | number;
|
|
6
|
+
label: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
case?: "upper" | "lower" | "capitalize" | "normal" | null;
|
|
10
|
+
size?: string;
|
|
11
|
+
color?: string;
|
|
12
|
+
rounded?: string;
|
|
13
|
+
dense?: boolean;
|
|
14
|
+
outlined?: boolean;
|
|
15
|
+
borderless?: boolean;
|
|
16
|
+
flat?: boolean;
|
|
17
|
+
type?: SupportedInputType;
|
|
18
|
+
allow?: ValidationRule[];
|
|
19
|
+
deny?: ValidationRule[];
|
|
20
|
+
supportedValues?: Array<string | number>;
|
|
21
|
+
unsupportedValues?: Array<string | number>;
|
|
22
|
+
required?: boolean;
|
|
23
|
+
regex?: string | RegExp;
|
|
24
|
+
minLength?: number;
|
|
25
|
+
maxLength?: number;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
autocomplete?: string;
|
|
29
|
+
validateOn?: ValidateOn;
|
|
30
|
+
};
|
|
31
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
32
|
+
"update:modelValue": (value: string) => any;
|
|
33
|
+
invalid: (error: string) => any;
|
|
34
|
+
valid: () => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
37
|
+
onInvalid?: ((error: string) => any) | undefined;
|
|
38
|
+
onValid?: (() => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
modelValue: string | number;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
dense: boolean;
|
|
43
|
+
type: SupportedInputType;
|
|
44
|
+
color: string;
|
|
45
|
+
rounded: string;
|
|
46
|
+
size: string;
|
|
47
|
+
required: boolean;
|
|
48
|
+
flat: boolean;
|
|
49
|
+
placeholder: string;
|
|
50
|
+
readonly: boolean;
|
|
51
|
+
hint: string;
|
|
52
|
+
case: "upper" | "lower" | "capitalize" | "normal" | null;
|
|
53
|
+
outlined: boolean;
|
|
54
|
+
borderless: boolean;
|
|
55
|
+
allow: ValidationRule[];
|
|
56
|
+
deny: ValidationRule[];
|
|
57
|
+
supportedValues: Array<string | number>;
|
|
58
|
+
unsupportedValues: Array<string | number>;
|
|
59
|
+
regex: string | RegExp;
|
|
60
|
+
minLength: number;
|
|
61
|
+
maxLength: number;
|
|
62
|
+
autocomplete: string;
|
|
63
|
+
validateOn: ValidateOn;
|
|
64
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
65
|
+
declare const _default: typeof __VLS_export;
|
|
66
|
+
export default _default;
|