@primevue/mcp 4.5.5 → 5.0.0-rc.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.
Files changed (173) hide show
  1. package/LICENSE.md +45 -21
  2. package/README.md +48 -250
  3. package/data/components.json +47269 -0
  4. package/data/llms/components/accordion.md +629 -0
  5. package/data/llms/components/animateonscroll.md +165 -0
  6. package/data/llms/components/autocomplete.md +995 -0
  7. package/data/llms/components/avatar.md +264 -0
  8. package/data/llms/components/badge.md +200 -0
  9. package/data/llms/components/blockui.md +99 -0
  10. package/data/llms/components/breadcrumb.md +269 -0
  11. package/data/llms/components/button.md +902 -0
  12. package/data/llms/components/card.md +209 -0
  13. package/data/llms/components/carousel.md +506 -0
  14. package/data/llms/components/cascadeselect.md +1207 -0
  15. package/data/llms/components/chart.md +1022 -0
  16. package/data/llms/components/checkbox.md +401 -0
  17. package/data/llms/components/chip.md +206 -0
  18. package/data/llms/components/colorpicker.md +213 -0
  19. package/data/llms/components/commandmenu.md +660 -0
  20. package/data/llms/components/compare.md +407 -0
  21. package/data/llms/components/confirmdialog.md +343 -0
  22. package/data/llms/components/confirmpopup.md +252 -0
  23. package/data/llms/components/contextmenu.md +522 -0
  24. package/data/llms/components/datatable.md +5266 -0
  25. package/data/llms/components/dataview.md +569 -0
  26. package/data/llms/components/datepicker.md +964 -0
  27. package/data/llms/components/deferredcontent.md +96 -0
  28. package/data/llms/components/dialog.md +702 -0
  29. package/data/llms/components/divider.md +152 -0
  30. package/data/llms/components/dock.md +488 -0
  31. package/data/llms/components/drawer.md +469 -0
  32. package/data/llms/components/dynamicdialog.md +214 -0
  33. package/data/llms/components/editor.md +205 -0
  34. package/data/llms/components/fieldset.md +253 -0
  35. package/data/llms/components/fileupload.md +459 -0
  36. package/data/llms/components/floatlabel.md +144 -0
  37. package/data/llms/components/fluid.md +104 -0
  38. package/data/llms/components/focustrap.md +59 -0
  39. package/data/llms/components/forms.md +344 -0
  40. package/data/llms/components/galleria.md +1119 -0
  41. package/data/llms/components/gallery.md +1003 -0
  42. package/data/llms/components/iconfield.md +283 -0
  43. package/data/llms/components/iftalabel.md +96 -0
  44. package/data/llms/components/image.md +179 -0
  45. package/data/llms/components/imagecompare.md +108 -0
  46. package/data/llms/components/inplace.md +183 -0
  47. package/data/llms/components/inputcolor.md +869 -0
  48. package/data/llms/components/inputgroup.md +419 -0
  49. package/data/llms/components/inputmask.md +345 -0
  50. package/data/llms/components/inputnumber.md +551 -0
  51. package/data/llms/components/inputotp.md +345 -0
  52. package/data/llms/components/inputpassword.md +738 -0
  53. package/data/llms/components/inputtags.md +432 -0
  54. package/data/llms/components/inputtext.md +569 -0
  55. package/data/llms/components/installation.md +1 -0
  56. package/data/llms/components/keyfilter.md +116 -0
  57. package/data/llms/components/knob.md +318 -0
  58. package/data/llms/components/label.md +151 -0
  59. package/data/llms/components/laravel.md +53 -0
  60. package/data/llms/components/listbox.md +636 -0
  61. package/data/llms/components/mask.md +203 -0
  62. package/data/llms/components/mcp.md +39 -0
  63. package/data/llms/components/megamenu.md +563 -0
  64. package/data/llms/components/menu.md +651 -0
  65. package/data/llms/components/menubar.md +446 -0
  66. package/data/llms/components/message.md +497 -0
  67. package/data/llms/components/metergroup.md +281 -0
  68. package/data/llms/components/multiselect.md +752 -0
  69. package/data/llms/components/orderlist.md +224 -0
  70. package/data/llms/components/organizationchart.md +418 -0
  71. package/data/llms/components/paginator.md +221 -0
  72. package/data/llms/components/panel.md +321 -0
  73. package/data/llms/components/panelmenu.md +703 -0
  74. package/data/llms/components/password.md +657 -0
  75. package/data/llms/components/picklist.md +286 -0
  76. package/data/llms/components/popover.md +145 -0
  77. package/data/llms/components/progressbar.md +242 -0
  78. package/data/llms/components/progressspinner.md +104 -0
  79. package/data/llms/components/radiobutton.md +427 -0
  80. package/data/llms/components/rating.md +312 -0
  81. package/data/llms/components/ripple.md +91 -0
  82. package/data/llms/components/scrollarea.md +700 -0
  83. package/data/llms/components/scrollpanel.md +131 -0
  84. package/data/llms/components/scrolltop.md +87 -0
  85. package/data/llms/components/select.md +1251 -0
  86. package/data/llms/components/selectbutton.md +268 -0
  87. package/data/llms/components/sidebar.md +2232 -0
  88. package/data/llms/components/skeleton.md +302 -0
  89. package/data/llms/components/slider.md +416 -0
  90. package/data/llms/components/speeddial.md +402 -0
  91. package/data/llms/components/splitbutton.md +840 -0
  92. package/data/llms/components/splitter.md +447 -0
  93. package/data/llms/components/stepper.md +551 -0
  94. package/data/llms/components/styleclass.md +226 -0
  95. package/data/llms/components/tabs.md +609 -0
  96. package/data/llms/components/tag.md +178 -0
  97. package/data/llms/components/terminal.md +123 -0
  98. package/data/llms/components/textarea.md +519 -0
  99. package/data/llms/components/tieredmenu.md +578 -0
  100. package/data/llms/components/timeline.md +494 -0
  101. package/data/llms/components/toast.md +472 -0
  102. package/data/llms/components/togglebutton.md +276 -0
  103. package/data/llms/components/toggleswitch.md +271 -0
  104. package/data/llms/components/toolbar.md +140 -0
  105. package/data/llms/components/tooltip.md +160 -0
  106. package/data/llms/components/tree.md +1076 -0
  107. package/data/llms/components/treeselect.md +660 -0
  108. package/data/llms/components/treetable.md +2493 -0
  109. package/data/llms/components/virtualscroller.md +265 -0
  110. package/data/llms/guides/autoimport.md +28 -0
  111. package/data/llms/guides/cdn.md +72 -0
  112. package/data/llms/guides/configuration.md +158 -0
  113. package/data/llms/guides/customicons.md +67 -0
  114. package/data/llms/guides/guides/accessibility.md +27 -0
  115. package/data/llms/guides/guides/animations.md +119 -0
  116. package/data/llms/guides/guides/rtl.md +7 -0
  117. package/data/llms/guides/icons.md +136 -0
  118. package/data/llms/guides/installation.md +3 -0
  119. package/data/llms/guides/laravel.md +66 -0
  120. package/data/llms/guides/llms.md +15 -0
  121. package/data/llms/guides/mcp.md +104 -0
  122. package/data/llms/guides/migration/v4.md +15 -0
  123. package/data/llms/guides/migration/v5.md +15 -0
  124. package/data/llms/guides/nuxt.md +141 -0
  125. package/data/llms/guides/passthrough.md +137 -0
  126. package/data/llms/guides/primeclt.md +43 -0
  127. package/data/llms/guides/tailwind.md +151 -0
  128. package/data/llms/guides/theming/styled.md +497 -0
  129. package/data/llms/guides/theming/unstyled.md +57 -0
  130. package/data/llms/guides/uikit.md +3 -0
  131. package/data/llms/guides/vite.md +90 -0
  132. package/data/llms/llms-full.txt +54465 -0
  133. package/data/llms/llms.txt +132 -0
  134. package/data/llms/pages/accessibility.md +27 -0
  135. package/data/llms/pages/animations.md +119 -0
  136. package/data/llms/pages/autoimport.md +28 -0
  137. package/data/llms/pages/cdn.md +72 -0
  138. package/data/llms/pages/configuration.md +158 -0
  139. package/data/llms/pages/contribution.md +31 -0
  140. package/data/llms/pages/customicons.md +67 -0
  141. package/data/llms/pages/designer.md +79 -0
  142. package/data/llms/pages/dynamicimports.md +7 -0
  143. package/data/llms/pages/forms.md +63 -0
  144. package/data/llms/pages/guides/accessibility.md +27 -0
  145. package/data/llms/pages/guides/animations.md +119 -0
  146. package/data/llms/pages/guides/rtl.md +7 -0
  147. package/data/llms/pages/icons.md +136 -0
  148. package/data/llms/pages/installation.md +3 -0
  149. package/data/llms/pages/introduction.md +23 -0
  150. package/data/llms/pages/laravel.md +66 -0
  151. package/data/llms/pages/llms.md +15 -0
  152. package/data/llms/pages/mcp.md +104 -0
  153. package/data/llms/pages/migration/v4.md +15 -0
  154. package/data/llms/pages/migration/v5.md +15 -0
  155. package/data/llms/pages/nuxt.md +141 -0
  156. package/data/llms/pages/passthrough.md +137 -0
  157. package/data/llms/pages/primeclt.md +43 -0
  158. package/data/llms/pages/rtl.md +7 -0
  159. package/data/llms/pages/setup.md +3 -0
  160. package/data/llms/pages/styled.md +497 -0
  161. package/data/llms/pages/tailwind.md +151 -0
  162. package/data/llms/pages/theming/styled.md +497 -0
  163. package/data/llms/pages/theming/unstyled.md +57 -0
  164. package/data/llms/pages/uikit.md +3 -0
  165. package/data/llms/pages/unstyled.md +57 -0
  166. package/data/llms/pages/v4.md +15 -0
  167. package/data/llms/pages/v5.md +15 -0
  168. package/data/llms/pages/vite.md +90 -0
  169. package/data/manifest.json +11117 -0
  170. package/data/mcp-data.json +55940 -0
  171. package/dist/index.d.ts +17 -1
  172. package/dist/index.js +66066 -72541
  173. package/package.json +10 -12
@@ -0,0 +1,459 @@
1
+ # FileUpload
2
+
3
+ FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations.
4
+
5
+ ## Basic
6
+
7
+ Select and upload files with drag-and-drop support.
8
+
9
+ ```vue
10
+ <template>
11
+ <Toast />
12
+ <div class="flex justify-between">
13
+ <div class="flex flex-wrap items-center gap-3">
14
+ <FileUpload ref="fu" mode="basic" chooseLabel="Choose" name="demo[]" url="/api/upload" accept="image/*" :multiple="true" :maxFileSize="1000000" @upload="onUpload" />
15
+ </div>
16
+ <Button type="button" severity="secondary" @click="upload">Upload</Button>
17
+ </div>
18
+ </template>
19
+
20
+ <script setup>
21
+ import { ref } from 'vue';
22
+ import { useToast } from "primevue/usetoast";
23
+
24
+ const toast = useToast();
25
+ const fu = ref();
26
+
27
+ const upload = () => {
28
+ fu.value.upload();
29
+ };
30
+
31
+ const onUpload = () => {
32
+ toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
33
+ };
34
+ <\/script>
35
+ ```
36
+
37
+ ## Auto
38
+
39
+ When auto property is enabled, a file gets uploaded instantly after selection.
40
+
41
+ ```vue
42
+ <template>
43
+ <div class="flex justify-center">
44
+ <Toast />
45
+ <FileUpload mode="basic" name="demo[]" url="/api/upload" accept="image/*" :maxFileSize="1000000" @upload="onUpload" :auto="true" chooseLabel="Browse" />
46
+ </div>
47
+ </template>
48
+
49
+ <script setup>
50
+ import { useToast } from "primevue/usetoast";
51
+ const toast = useToast();
52
+
53
+ const onUpload = () => {
54
+ toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
55
+ };
56
+ <\/script>
57
+ ```
58
+
59
+ ## Advanced
60
+
61
+ Advanced uploader provides dragdrop support, multi file uploads, auto uploading, progress tracking and validations.
62
+
63
+ ```vue
64
+ <template>
65
+ <div>
66
+ <Toast />
67
+ <FileUpload name="demo[]" url="/api/upload" @upload="onAdvancedUpload($event)" :multiple="true" accept="image/*" :maxFileSize="1000000">
68
+ <template #empty>
69
+ <div>Drag and drop files to here to upload.</div>
70
+ </template>
71
+ </FileUpload>
72
+ </div>
73
+ </template>
74
+
75
+ <script setup>
76
+ import { useToast } from "primevue/usetoast";
77
+ const toast = useToast();
78
+
79
+ const onAdvancedUpload = () => {
80
+ toast.add({ severity: 'info', summary: 'Success', detail: 'File Uploaded', life: 3000 });
81
+ };
82
+ <\/script>
83
+ ```
84
+
85
+ ## InputGroup
86
+
87
+ FileUpload can be placed inside an InputGroup as an addon to combine it with other form controls.
88
+
89
+ ```vue
90
+ <template>
91
+ <div class="flex flex-col gap-4 max-w-md mx-auto">
92
+ <InputGroup>
93
+ <InputGroupAddon>Upload</InputGroupAddon>
94
+ <InputGroupAddon>
95
+ <FileUpload mode="basic" auto accept="image/*" :maxFileSize="1000000" :chooseLabel="label1" :chooseButtonProps="{ severity: 'secondary', variant: 'text', class: 'flex-1 justify-start' }" @select="onFileSelect($event, 'label1')">
96
+ <template #chooseicon>
97
+ <Upload />
98
+ </template>
99
+ </FileUpload>
100
+ </InputGroupAddon>
101
+ </InputGroup>
102
+
103
+ <InputGroup>
104
+ <InputGroupAddon>
105
+ <FileUpload mode="basic" auto accept="image/*" :maxFileSize="1000000" :chooseLabel="label2" :chooseButtonProps="{ severity: 'secondary', variant: 'text', class: 'flex-1 justify-start' }" @select="onFileSelect($event, 'label2')">
106
+ <template #chooseicon>
107
+ <Upload />
108
+ </template>
109
+ </FileUpload>
110
+ </InputGroupAddon>
111
+ <InputGroupAddon>
112
+ <Button severity="secondary" variant="text" iconOnly>
113
+ <CloudUpload />
114
+ </Button>
115
+ </InputGroupAddon>
116
+ </InputGroup>
117
+
118
+ <InputGroup>
119
+ <InputGroupAddon>
120
+ <TagIcon />
121
+ </InputGroupAddon>
122
+ <InputText placeholder="Label" />
123
+ <InputGroupAddon>
124
+ <FileUpload mode="basic" auto accept="image/*" :maxFileSize="1000000" :chooseLabel="label3" :chooseButtonProps="{ severity: 'secondary', variant: 'text' }" @select="onFileSelect($event, 'label3')">
125
+ <template #chooseicon>
126
+ <Upload />
127
+ </template>
128
+ </FileUpload>
129
+ </InputGroupAddon>
130
+ </InputGroup>
131
+ </div>
132
+ </template>
133
+
134
+ <script setup>
135
+ import { ref } from 'vue';
136
+ import CloudUpload from '@primeicons/vue/cloud-upload';
137
+ import TagIcon from '@primeicons/vue/tag';
138
+ import Upload from '@primeicons/vue/upload';
139
+
140
+ const label1 = ref('Choose file');
141
+ const label2 = ref('Choose file');
142
+ const label3 = ref('Browse');
143
+
144
+ const onFileSelect = (event, key) => {
145
+ const files = event.files || [];
146
+
147
+ if (files.length) {
148
+ const name = files.map((f) => f.name).join(', ');
149
+
150
+ if (key === 'label1') label1.value = name;
151
+ else if (key === 'label2') label2.value = name;
152
+ else if (key === 'label3') label3.value = name;
153
+ }
154
+ };
155
+ <\/script>
156
+ ```
157
+
158
+ ## Custom Upload
159
+
160
+ Uploading implementation can be overridden by enabling customUpload property and defining a custom upload handler.
161
+
162
+ ```vue
163
+ <template>
164
+ <div class="flex flex-col items-center gap-6">
165
+ <FileUpload mode="basic" customUpload auto @uploader="onFileSelect" chooseLabel="Browse" :chooseButtonProps="{ severity: 'secondary', variant: 'outlined' }" />
166
+ <img v-if="src" :src="src" alt="Image" class="shadow-md rounded-xl w-full sm:w-64" style="filter: grayscale(100%)" />
167
+ </div>
168
+ </template>
169
+
170
+ <script setup>
171
+ import { ref } from "vue";
172
+
173
+ const src = ref(null);
174
+
175
+ function onFileSelect(event) {
176
+ const file = event.files[0];
177
+ const reader = new FileReader();
178
+
179
+ reader.onload = async (e) => {
180
+ src.value = e.target.result;
181
+ };
182
+
183
+ reader.readAsDataURL(file);
184
+ }
185
+ <\/script>
186
+ ```
187
+
188
+ ## Dropzone
189
+
190
+ A custom dropzone can be built with the content and empty slots. Files are added by dragging them onto the area or by clicking to browse, and the selected files are managed with the removeFileCallback .
191
+
192
+ ```vue
193
+ <template>
194
+ <div class="max-w-md mx-auto">
195
+ <FileUpload
196
+ ref="fu"
197
+ name="demo[]"
198
+ url="/api/upload"
199
+ :multiple="true"
200
+ accept="image/*"
201
+ :maxFileSize="1000000"
202
+ mode="advanced"
203
+ :pt="{ root: { class: 'border-0! bg-transparent!' }, header: { class: 'hidden!' }, content: { class: 'border-2! border-dashed! border-surface-200! dark:border-surface-700! rounded-xl! p-8!' } }"
204
+ >
205
+ <template #content="{ files, removeFileCallback, messages }">
206
+ <div v-if="messages?.length" class="flex flex-col gap-2">
207
+ <Message v-for="msg of messages" :key="msg" severity="error">{{ msg }}</Message>
208
+ </div>
209
+ <div v-if="files.length" class="flex flex-col gap-4">
210
+ <div class="flex items-center justify-between">
211
+ <span class="text-sm text-muted-color">{{ files.length }} file(s) selected</span>
212
+ <div class="flex items-center gap-2">
213
+ <Button variant="text" size="small" @click="onUpload">Upload</Button>
214
+ <Button variant="text" size="small" severity="danger" @click="onClear">Clear all</Button>
215
+ </div>
216
+ </div>
217
+ <div class="flex flex-col gap-2">
218
+ <div v-for="(file, index) of files" :key="file.name + file.size" class="flex items-center justify-between p-3 rounded-lg bg-surface-50 dark:bg-surface-800">
219
+ <div class="flex items-center gap-3">
220
+ <CloudUpload class="text-primary shrink-0" />
221
+ <div class="flex flex-col">
222
+ <span class="text-sm font-medium">{{ file.name }}</span>
223
+ <span class="text-xs text-muted-color">{{ formatSize(file.size) }}</span>
224
+ </div>
225
+ </div>
226
+ <Button type="button" iconOnly variant="text" severity="secondary" size="small" rounded @click="removeFileCallback(index)">
227
+ <Times />
228
+ </Button>
229
+ </div>
230
+ </div>
231
+ </div>
232
+ </template>
233
+ <template #empty>
234
+ <div class="flex flex-col items-center justify-center gap-3 py-8 cursor-pointer" @click="onChoose">
235
+ <CloudUpload :size="48" class="text-muted-color" />
236
+ <div class="text-center">
237
+ <p class="text-lg font-medium mt-0 mb-1">Drop files here</p>
238
+ <p class="text-sm text-muted-color m-0">or click to browse</p>
239
+ </div>
240
+ </div>
241
+ </template>
242
+ </FileUpload>
243
+ </div>
244
+ </template>
245
+
246
+ <script setup>
247
+ import { ref } from 'vue';
248
+ import CloudUpload from '@primeicons/vue/cloud-upload';
249
+ import Times from '@primeicons/vue/times';
250
+
251
+ const fu = ref();
252
+
253
+ const onChoose = () => {
254
+ fu.value.choose();
255
+ };
256
+
257
+ const onUpload = () => {
258
+ fu.value.upload();
259
+ };
260
+
261
+ const onClear = () => {
262
+ fu.value.clear();
263
+ };
264
+
265
+ const formatSize = (bytes) => {
266
+ if (bytes === 0) return '0 B';
267
+
268
+ const k = 1024;
269
+ const sizes = ['B', 'KB', 'MB'];
270
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
271
+
272
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
273
+ };
274
+ <\/script>
275
+ ```
276
+
277
+ ## Image Preview
278
+
279
+ Grid-based image preview with thumbnails. Hover over images to reveal the remove button.
280
+
281
+ ```vue
282
+ <template>
283
+ <FileUpload ref="fu" name="demo[]" url="/api/upload" :multiple="true" accept="image/*" :maxFileSize="1000000" mode="advanced" :pt="{ root: { class: 'border-0!' } }">
284
+ <template #header="{ files, chooseCallback, uploadCallback }">
285
+ <div class="flex items-center gap-2">
286
+ <Button type="button" severity="secondary" variant="outlined" size="small" @click="chooseCallback()">
287
+ <Plus />
288
+ Add Images
289
+ </Button>
290
+ <Button v-if="files?.length > 0" type="button" size="small" @click="uploadCallback()">
291
+ <Upload />
292
+ Upload All
293
+ </Button>
294
+ </div>
295
+ </template>
296
+ <template #content="{ files, removeFileCallback }">
297
+ <div v-if="files?.length > 0" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4">
298
+ <div v-for="(file, i) of files" :key="file.name + file.type + file.size" class="group relative rounded-lg overflow-hidden border border-surface-200 dark:border-surface-700">
299
+ <img :src="file.objectURL" :alt="file.name" class="w-full h-32 object-cover" />
300
+ <div class="absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center">
301
+ <button type="button" class="text-white bg-red-500 rounded-full p-2 hover:bg-red-600 cursor-pointer border-0" @click="removeFileCallback($event, i)">
302
+ <Times />
303
+ </button>
304
+ </div>
305
+ <div class="p-2">
306
+ <div class="text-xs font-medium truncate">{{ file.name }}</div>
307
+ <div class="text-xs text-muted-color">{{ formatSize(file.size) }}</div>
308
+ </div>
309
+ </div>
310
+ </div>
311
+ </template>
312
+ <template #empty>
313
+ <div class="border-2 border-dashed border-surface-200 dark:border-surface-700 rounded-xl p-12 text-center">
314
+ <p class="text-muted-color m-0!">No images selected. Click "Add Images" to get started.</p>
315
+ </div>
316
+ </template>
317
+ </FileUpload>
318
+ </template>
319
+
320
+ <script setup>
321
+ import Plus from '@primeicons/vue/plus';
322
+ import Times from '@primeicons/vue/times';
323
+ import Upload from '@primeicons/vue/upload';
324
+
325
+ const formatSize = (bytes) => {
326
+ if (bytes === 0) return '0 B';
327
+
328
+ const k = 1024;
329
+ const sizes = ['B', 'KB', 'MB'];
330
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
331
+
332
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
333
+ };
334
+ <\/script>
335
+ ```
336
+
337
+ ## Accessibility
338
+
339
+ Screen Reader FileUpload uses a hidden native input element with type="file" for screen readers. Keyboard Support Interactive elements of the uploader are buttons, visit the Button accessibility section for more information.
340
+
341
+ ## File Upload API
342
+
343
+ ### Props
344
+
345
+ | Name |Type |Default |Description |
346
+ | --- | --- | --- | --- |
347
+ | name | string | - | Name of the request parameter to identify the files at backend. |
348
+ | url | string | - | Remote url to upload the files. |
349
+ | mode | HintedString<"advanced" \| "basic"> | advanced | Defines the UI of the component, possible values are 'advanced' and 'basic'. |
350
+ | multiple | boolean | false | Used to select multiple files at once from file dialog. |
351
+ | accept | string | - | Pattern to restrict the allowed file types such as 'image/*'. |
352
+ | disabled | boolean | false | Disables the upload functionality. |
353
+ | auto | boolean | false | When enabled, upload begins automatically after selection is completed. |
354
+ | maxFileSize | number | - | Maximum file size allowed in bytes. |
355
+ | invalidFileSizeMessage | string | : Invalid file size, file size should be smaller than {1.} | Message of the invalid fize size. |
356
+ | invalidFileLimitMessage | string | Maximum number of files to be uploaded is {0.} | Message to display when number of files to be uploaded exceeeds the limit. |
357
+ | invalidFileTypeMessage | string | '{0}: Invalid file type.' | Message of the invalid fize type. |
358
+ | fileLimit | number | - | Maximum number of files that can be uploaded. |
359
+ | withCredentials | boolean | false | Cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. |
360
+ | previewWidth | number | 50 | Width of the image thumbnail in pixels. |
361
+ | chooseLabel | string | - | Label of the choose button. Defaults to PrimeVue Locale configuration. |
362
+ | uploadLabel | string | - | Label of the upload button. Defaults to PrimeVue Locale configuration. |
363
+ | cancelLabel | string | Cancel | Label of the cancel button. Defaults to PrimeVue Locale configuration. |
364
+ | customUpload | boolean | - | Whether to use the default upload or a manual implementation defined in uploadHandler callback. Defaults to PrimeVue Locale configuration. |
365
+ | showUploadButton | boolean | true | Whether to show the upload button. |
366
+ | showCancelButton | boolean | true | Whether to show the cancel button. |
367
+ | chooseIcon | string | - | Icon of the choose button. |
368
+ | uploadIcon | string | - | Icon of the upload button. |
369
+ | cancelIcon | string | - | Icon of the cancel button. |
370
+ | style | any | - | Inline style of the component. |
371
+ | class | any | - | Style class of the component. |
372
+ | chooseButtonProps | object | null | Used to pass all properties of the ButtonProps to the choose button inside the component. |
373
+ | uploadButtonProps | object | - | Used to pass all properties of the ButtonProps to the upload button inside the component. |
374
+ | cancelButtonProps | object | - | Used to pass all properties of the ButtonProps to the cancel button inside the component. |
375
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
376
+ | pt | PassThrough<FileUploadPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
377
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
378
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
379
+
380
+ ### Pass Through Options
381
+
382
+ | Name |Type |Description |
383
+ | --- | --- | --- |
384
+ | root | FileUploadPassThroughOptionType | Used to pass attributes to the root's DOM element. |
385
+ | input | FileUploadPassThroughOptionType | Used to pass attributes to the input's DOM element. |
386
+ | header | FileUploadPassThroughOptionType | Used to pass attributes to the header's DOM element. |
387
+ | pcChooseButton | any | Used to pass attributes to the choose Button component. |
388
+ | pcUploadButton | any | Used to pass attributes to the upload Button component. |
389
+ | pcCancelButton | any | Used to pass attributes to the cancel Button component. |
390
+ | content | FileUploadPassThroughOptionType | Used to pass attributes to the content's DOM element. |
391
+ | pcProgressBar | any | Used to pass attributes to the ProgressBar component. |
392
+ | pcMessage | any | Used to pass attributes to the message's DOM element. |
393
+ | file | FileUploadPassThroughOptionType | Used to pass attributes to the file's DOM element. |
394
+ | fileThumbnail | FileUploadPassThroughOptionType | Used to pass attributes to the file thumbnail's DOM element. |
395
+ | fileInfo | FileUploadPassThroughOptionType | Used to pass attributes to the file info's DOM element. |
396
+ | fileName | FileUploadPassThroughOptionType | Used to pass attributes to the fileName's DOM element. |
397
+ | fileSize | FileUploadPassThroughOptionType | Used to pass attributes to the fileSize's DOM element. |
398
+ | pcFileBadge | any | Used to pass attributes to the Badge component. |
399
+ | fileActions | FileUploadPassThroughOptionType | Used to pass attributes to the file actions' DOM element. |
400
+ | pcFileRemoveButton | any | Used to pass attributes to the file remove button's DOM element. |
401
+ | empty | FileUploadPassThroughOptionType | Used to pass attributes to the empty's DOM element. |
402
+ | basicContent | any | Used to pass attributes to the content in basic mode. |
403
+ | hooks | any | Used to manage all lifecycle hooks. |
404
+
405
+ ### Theming
406
+
407
+ ### CSS Classes
408
+
409
+ | Class |Description |
410
+ | --- | --- |
411
+ | p-fileupload | Class name of the root element |
412
+ | p-fileupload-header | Class name of the header element |
413
+ | p-fileupload-choose-button | Class name of the choose button element |
414
+ | p-fileupload-upload-button | Class name of the upload button element |
415
+ | p-fileupload-cancel-button | Class name of the cancel button element |
416
+ | p-fileupload-content | Class name of the content element |
417
+ | p-fileupload-file-list | Class name of the file list element |
418
+ | p-fileupload-file | Class name of the file element |
419
+ | p-fileupload-file-thumbnail | Class name of the file thumbnail element |
420
+ | p-fileupload-file-info | Class name of the file info element |
421
+ | p-fileupload-file-name | Class name of the file name element |
422
+ | p-fileupload-file-size | Class name of the file size element |
423
+ | p-fileupload-file-badge | Class name of the file badge element |
424
+ | p-fileupload-file-actions | Class name of the file actions element |
425
+ | p-fileupload-file-remove-button | Class name of the file remove button element |
426
+ | p-fileupload-basic-content | Class name of the content element in basic mode |
427
+
428
+ ### Design Tokens
429
+
430
+ | Token |CSS Variable |Description |
431
+ | --- | --- | --- |
432
+ | fileupload.background | --p-fileupload-background | Background of root |
433
+ | fileupload.border.color | --p-fileupload-border-color | Border color of root |
434
+ | fileupload.color | --p-fileupload-color | Color of root |
435
+ | fileupload.border.radius | --p-fileupload-border-radius | Border radius of root |
436
+ | fileupload.transition.duration | --p-fileupload-transition-duration | Transition duration of root |
437
+ | fileupload.header.background | --p-fileupload-header-background | Background of header |
438
+ | fileupload.header.color | --p-fileupload-header-color | Color of header |
439
+ | fileupload.header.padding | --p-fileupload-header-padding | Padding of header |
440
+ | fileupload.header.border.color | --p-fileupload-header-border-color | Border color of header |
441
+ | fileupload.header.border.width | --p-fileupload-header-border-width | Border width of header |
442
+ | fileupload.header.border.radius | --p-fileupload-header-border-radius | Border radius of header |
443
+ | fileupload.header.gap | --p-fileupload-header-gap | Gap of header |
444
+ | fileupload.content.highlight.border.color | --p-fileupload-content-highlight-border-color | Highlight border color of content |
445
+ | fileupload.content.padding | --p-fileupload-content-padding | Padding of content |
446
+ | fileupload.content.gap | --p-fileupload-content-gap | Gap of content |
447
+ | fileupload.file.padding | --p-fileupload-file-padding | Padding of file |
448
+ | fileupload.file.gap | --p-fileupload-file-gap | Gap of file |
449
+ | fileupload.file.border.color | --p-fileupload-file-border-color | Border color of file |
450
+ | fileupload.file.info.gap | --p-fileupload-file-info-gap | Info gap of file |
451
+ | fileupload.file.name.color | --p-fileupload-file-name-color | Color of file name |
452
+ | fileupload.file.name.font.weight | --p-fileupload-file-name-font-weight | Font weight of file name |
453
+ | fileupload.file.name.font.size | --p-fileupload-file-name-font-size | Font size of file name |
454
+ | fileupload.file.size.color | --p-fileupload-file-size-color | Color of file size |
455
+ | fileupload.file.size.font.weight | --p-fileupload-file-size-font-weight | Font weight of file size |
456
+ | fileupload.file.size.font.size | --p-fileupload-file-size-font-size | Font size of file size |
457
+ | fileupload.file.list.gap | --p-fileupload-file-list-gap | Gap of file list |
458
+ | fileupload.progressbar.height | --p-fileupload-progressbar-height | Height of progressbar |
459
+ | fileupload.basic.gap | --p-fileupload-basic-gap | Gap of basic |
@@ -0,0 +1,144 @@
1
+ # FloatLabel
2
+
3
+ FloatLabel appears on top of the input field when focused.
4
+
5
+ ## Basic
6
+
7
+ FloatLabel is used by wrapping the input and its label.
8
+
9
+ ```vue
10
+ <template>
11
+ <div class="flex justify-center">
12
+ <FloatLabel>
13
+ <InputText id="username" v-model="value" autocomplete="off" />
14
+ <label for="username">Username</label>
15
+ </FloatLabel>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup>
20
+ import { ref } from 'vue';
21
+
22
+ const value = ref(null);
23
+ <\/script>
24
+ ```
25
+
26
+ ## Variants
27
+
28
+ The variant property defines the position of the label. Default value is over , whereas in and on are the alternatives.
29
+
30
+ ```vue
31
+ <template>
32
+ <div class="flex flex-wrap justify-center items-end gap-4">
33
+ <FloatLabel variant="in">
34
+ <InputText id="in_label" v-model="value1" autocomplete="off" />
35
+ <label for="in_label">In Label</label>
36
+ </FloatLabel>
37
+
38
+ <FloatLabel variant="on">
39
+ <InputText id="on_label" v-model="value2" autocomplete="off" />
40
+ <label for="on_label">On Label</label>
41
+ </FloatLabel>
42
+ </div>
43
+ </template>
44
+
45
+ <script setup>
46
+ import { ref } from 'vue';
47
+
48
+ const value1 = ref(null);
49
+ const value2 = ref(null);
50
+ <\/script>
51
+ ```
52
+
53
+ ## Invalid
54
+
55
+ When the form element is invalid, the label is also highlighted.
56
+
57
+ ```vue
58
+ <template>
59
+ <div class="flex flex-wrap justify-center items-end gap-4">
60
+ <FloatLabel>
61
+ <InputText id="value1" v-model="value1" autocomplete="off" :invalid="!value1" />
62
+ <label for="value1">Username</label>
63
+ </FloatLabel>
64
+
65
+ <FloatLabel variant="in">
66
+ <InputText id="value2" v-model="value2" autocomplete="off" :invalid="!value2" />
67
+ <label for="value2">Username</label>
68
+ </FloatLabel>
69
+
70
+ <FloatLabel variant="on">
71
+ <InputText id="value3" v-model="value3" autocomplete="off" :invalid="!value3" />
72
+ <label for="value3">Username</label>
73
+ </FloatLabel>
74
+ </div>
75
+ </template>
76
+
77
+ <script setup>
78
+ import { ref } from 'vue';
79
+
80
+ const value1 = ref('');
81
+ const value2 = ref('');
82
+ const value3 = ref('');
83
+ <\/script>
84
+ ```
85
+
86
+ ## Accessibility
87
+
88
+ Screen Reader FloatLabel does not require any roles and attributes. Keyboard Support Component does not include any interactive elements.
89
+
90
+ ## Float Label API
91
+
92
+ ### Props
93
+
94
+ | Name |Type |Default |Description |
95
+ | --- | --- | --- | --- |
96
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
97
+ | pt | PassThrough<FloatLabelPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
98
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
99
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
100
+ | variant | HintedString<"on" \| "in" \| "over"> | over | Defines the positioning of the label relative to the input. |
101
+
102
+ ### Slots
103
+
104
+ | Name |Parameters |Description |
105
+ | --- | --- | --- |
106
+ | default | Function | |
107
+
108
+ ### Pass Through Options
109
+
110
+ | Name |Type |Description |
111
+ | --- | --- | --- |
112
+ | root | FloatLabelPassThroughOptionType | Used to pass attributes to the root's DOM element. |
113
+ | hooks | any | Used to manage all lifecycle hooks. |
114
+
115
+ ### Theming
116
+
117
+ ### CSS Classes
118
+
119
+ | Class |Description |
120
+ | --- | --- |
121
+ | p-floatlabel | Class name of the root element |
122
+
123
+ ### Design Tokens
124
+
125
+ | Token |CSS Variable |Description |
126
+ | --- | --- | --- |
127
+ | floatlabel.color | --p-floatlabel-color | Color of root |
128
+ | floatlabel.focus.color | --p-floatlabel-focus-color | Focus color of root |
129
+ | floatlabel.active.color | --p-floatlabel-active-color | Active color of root |
130
+ | floatlabel.invalid.color | --p-floatlabel-invalid-color | Invalid color of root |
131
+ | floatlabel.transition.duration | --p-floatlabel-transition-duration | Transition duration of root |
132
+ | floatlabel.position.x | --p-floatlabel-position-x | Position x of root |
133
+ | floatlabel.position.y | --p-floatlabel-position-y | Position y of root |
134
+ | floatlabel.font.size | --p-floatlabel-font-size | Font size of root |
135
+ | floatlabel.font.weight | --p-floatlabel-font-weight | Font weight of root |
136
+ | floatlabel.active.font.size | --p-floatlabel-active-font-size | Active font size of root |
137
+ | floatlabel.active.font.weight | --p-floatlabel-active-font-weight | Active font weight of root |
138
+ | floatlabel.over.active.top | --p-floatlabel-over-active-top | Active top of over |
139
+ | floatlabel.in.input.padding.top | --p-floatlabel-in-input-padding-top | Input padding top of in |
140
+ | floatlabel.in.input.padding.bottom | --p-floatlabel-in-input-padding-bottom | Input padding bottom of in |
141
+ | floatlabel.in.active.top | --p-floatlabel-in-active-top | Active top of in |
142
+ | floatlabel.on.border.radius | --p-floatlabel-on-border-radius | Border radius of on |
143
+ | floatlabel.on.active.background | --p-floatlabel-on-active-background | Active background of on |
144
+ | floatlabel.on.active.padding | --p-floatlabel-on-active-padding | Active padding of on |