@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,152 @@
1
+ # Divider
2
+
3
+ Divider is used to separate contents.
4
+
5
+ ## Basic
6
+
7
+ Divider is placed between items to separate content.
8
+
9
+ ```vue
10
+ <template>
11
+ <div class="flex justify-center">
12
+ <div class="max-w-sm w-full text-sm">
13
+ <div class="flex items-center justify-between">
14
+ <span class="text-color font-medium">Subtotal</span>
15
+ <span class="text-color">$89.00</span>
16
+ </div>
17
+ <Divider />
18
+ <div class="flex items-center justify-between">
19
+ <span class="text-color font-medium">Shipping</span>
20
+ <span class="text-color">$5.99</span>
21
+ </div>
22
+ <Divider />
23
+ <div class="flex items-center justify-between">
24
+ <span class="text-color font-semibold">Total</span>
25
+ <span class="text-color font-semibold">$94.99</span>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </template>
30
+ ```
31
+
32
+ ## Type
33
+
34
+ Style of the border is configured with the type property that can be solid , dotted or dashed .
35
+
36
+ ```vue
37
+ <template>
38
+ <div class="flex justify-center">
39
+ <div class="max-w-md w-full">
40
+ <p class="text-sm">Fast setup, no credit card required</p>
41
+ <Divider type="solid" />
42
+ <p class="text-sm">Cancel anytime from your account</p>
43
+ <Divider type="dotted" />
44
+ <p class="text-sm">24/7 support included</p>
45
+ <Divider type="dashed" />
46
+ <p class="text-sm">No long-term commitments</p>
47
+ </div>
48
+ </div>
49
+ </template>
50
+ ```
51
+
52
+ ## Vertical
53
+
54
+ Vertical divider is enabled by setting the layout property as vertical .
55
+
56
+ ```vue
57
+ <template>
58
+ <div class="flex justify-center">
59
+ <div class="flex w-fit">
60
+ <div>
61
+ <div class="uppercase font-mono text-xs">Invoice No</div>
62
+ <div class="font-light">0000123</div>
63
+ </div>
64
+ <Divider layout="vertical" />
65
+ <div>
66
+ <div class="uppercase font-mono text-xs">Issued</div>
67
+ <div class="font-light">01/01/2026</div>
68
+ </div>
69
+ <Divider layout="vertical" />
70
+ <div>
71
+ <div class="uppercase font-mono text-xs">Due Date</div>
72
+ <div class="font-light">02/02/2026</div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </template>
77
+ ```
78
+
79
+ ## Alignment
80
+
81
+ Children are rendered within the boundaries of the divider where location of the content is configured with the align property. In horizontal layout, alignment options are left , center and right whereas vertical mode supports top , center and bottom .
82
+
83
+ ```vue
84
+ <template>
85
+ <div class="flex justify-center">
86
+ <div class="max-w-md w-full">
87
+ <p class="text-sm">Fast setup with a simple onboarding process, no credit card required to get started.</p>
88
+ <Divider align="left" type="solid">
89
+ <code class="uppercase text-xs">Getting started</code>
90
+ </Divider>
91
+ <p class="text-sm">Cancel anytime directly from your account settings, with no questions asked.</p>
92
+ <Divider align="center" type="dotted">
93
+ <code class="uppercase text-xs">Flexibility</code>
94
+ </Divider>
95
+ <p class="text-sm">24/7 support included to help you resolve issues quickly, whenever you need assistance.</p>
96
+ <Divider align="right" type="dashed">
97
+ <code class="uppercase text-xs">Support</code>
98
+ </Divider>
99
+ <p class="text-sm">No long-term commitments or hidden contracts, just transparent and flexible pricing.</p>
100
+ </div>
101
+ </div>
102
+ </template>
103
+ ```
104
+
105
+ ## Accessibility
106
+
107
+ Screen Reader Divider uses a separator role with aria-orientation set to either "horizontal" or "vertical". Keyboard Support Component does not include any interactive elements.
108
+
109
+ ## Divider API
110
+
111
+ ### Props
112
+
113
+ | Name |Type |Default |Description |
114
+ | --- | --- | --- | --- |
115
+ | align | HintedString<"left" \| "right" \| "top" \| "bottom" \| "center"> | - | Alignment of the content. |
116
+ | layout | HintedString<"horizontal" \| "vertical"> | horizontal | Specifies the orientation, valid values are 'horizontal' and 'vertical'. |
117
+ | type | HintedString<"solid" \| "dashed" \| "dotted"> | solid | Border style type. |
118
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
119
+ | pt | PassThrough<DividerPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
120
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
121
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
122
+
123
+ ### Pass Through Options
124
+
125
+ | Name |Type |Description |
126
+ | --- | --- | --- |
127
+ | root | DividerPassThroughOptionType | Used to pass attributes to the root's DOM element. |
128
+ | content | DividerPassThroughOptionType | Used to pass attributes to the content's DOM element. |
129
+ | hooks | any | Used to manage all lifecycle hooks. |
130
+
131
+ ### Theming
132
+
133
+ ### CSS Classes
134
+
135
+ | Class |Description |
136
+ | --- | --- |
137
+ | p-divider | Class name of the root element |
138
+ | p-divider-content | Class name of the content element |
139
+
140
+ ### Design Tokens
141
+
142
+ | Token |CSS Variable |Description |
143
+ | --- | --- | --- |
144
+ | divider.border.color | --p-divider-border-color | Border color of root |
145
+ | divider.content.background | --p-divider-content-background | Background of content |
146
+ | divider.content.color | --p-divider-content-color | Color of content |
147
+ | divider.horizontal.margin | --p-divider-horizontal-margin | Margin of horizontal |
148
+ | divider.horizontal.padding | --p-divider-horizontal-padding | Padding of horizontal |
149
+ | divider.horizontal.content.padding | --p-divider-horizontal-content-padding | Content padding of horizontal |
150
+ | divider.vertical.margin | --p-divider-vertical-margin | Margin of vertical |
151
+ | divider.vertical.padding | --p-divider-vertical-padding | Padding of vertical |
152
+ | divider.vertical.content.padding | --p-divider-vertical-content-padding | Content padding of vertical |
@@ -0,0 +1,488 @@
1
+ # Dock
2
+
3
+ Dock is a navigation component consisting of menuitems.
4
+
5
+ ## Basic
6
+
7
+ Dock requires a collection of menuitems as its model . Default location is bottom and other sides are also available when defined with the position property. Content of the dock component is defined by item template.
8
+
9
+ ```vue
10
+ <template>
11
+ <div class="dock-demo">
12
+ <div class="flex flex-wrap gap-4 mb-7">
13
+ <div v-for="pos of positions" :key="pos.value" class="flex items-center">
14
+ <RadioButton v-model="position" :value="pos.value" :inputId="pos.label" name="dock" />
15
+ <label :for="pos.label" class="ml-2 text-sm"> {{ pos.label }} </label>
16
+ </div>
17
+ </div>
18
+ <div class="dock-window">
19
+ <Dock :model="items" :position="position">
20
+ <template #itemicon="{ item }">
21
+ <img v-tooltip.top="item.label" :alt="item.label" :src="item.icon" style="width: 100%" />
22
+ </template>
23
+ </Dock>
24
+ </div>
25
+ </div>
26
+ </template>
27
+
28
+ <script setup>
29
+ import { ref } from "vue";
30
+
31
+ const items = ref([
32
+ {
33
+ label: 'Finder',
34
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/finder.svg'
35
+ },
36
+ {
37
+ label: 'App Store',
38
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/appstore.svg'
39
+ },
40
+ {
41
+ label: 'Photos',
42
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/photos.svg'
43
+ },
44
+ {
45
+ label: 'Trash',
46
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/trash.png'
47
+ }
48
+ ]);
49
+ const position = ref('bottom');
50
+ const positions = ref([
51
+ {
52
+ label: 'Bottom',
53
+ value: 'bottom'
54
+ },
55
+ {
56
+ label: 'Top',
57
+ value: 'top'
58
+ },
59
+ {
60
+ label: 'Left',
61
+ value: 'left'
62
+ },
63
+ {
64
+ label: 'Right',
65
+ value: 'right'
66
+ }
67
+ ]);
68
+ <\/script>
69
+
70
+ <style scoped>
71
+ .dock-demo > .dock-window {
72
+ width: 100%;
73
+ height: 450px;
74
+ position: relative;
75
+ background-image: url("https://primefaces.org/cdn/primevue/images/dock/window.jpg");
76
+ background-repeat: no-repeat;
77
+ background-size: cover;
78
+ z-index: 1;
79
+ }
80
+
81
+ .dock-demo > .p-dock {
82
+ z-index: 1000;
83
+ }
84
+ </style>
85
+ ```
86
+
87
+ ## Advanced
88
+
89
+ A mock desktop UI implemented with various components in addition to Dock.
90
+
91
+ ```vue
92
+ <template>
93
+ <div class="dock-demo">
94
+ <Toast position="top-center" group="tc" />
95
+
96
+ <Menubar :model="menubarItems">
97
+ <template #start>
98
+ <Apple class="mx-2" />
99
+ </template>
100
+ <template #end>
101
+ <div class="flex items-center">
102
+ <Video class="mx-2" />
103
+ <Wifi class="mx-2" />
104
+ <VolumeUp class="mx-2" />
105
+ <span class="px-2 text-sm">Fri 13:07</span>
106
+ <Search class="mx-2" />
107
+ <Bars class="mx-2" />
108
+ </div>
109
+ </template>
110
+ </Menubar>
111
+
112
+ <div class="dock-window dock-advanced">
113
+ <Dock :model="items" position="bottom">
114
+ <template #item="{ item }">
115
+ <a v-tooltip.top="item.label" href="#" class="p-dock-item-link" @click="onDockItemClick($event, item)">
116
+ <img :alt="item.label" :src="item.icon" style="width: 100%" />
117
+ </a>
118
+ </template>
119
+ </Dock>
120
+
121
+ <Dialog v-model:visible="displayFinder" header="Finder" :breakpoints="{ '960px': '50vw' }" :style="{ width: '40vw' }" :maximizable="true">
122
+ <Tree :value="nodes" />
123
+ </Dialog>
124
+
125
+ <Dialog v-model:visible="displayTerminal" header="Terminal" :breakpoints="{ '960px': '50vw' }" :style="{ width: '40vw' }" :maximizable="true">
126
+ <Terminal welcomeMessage="Welcome to PrimeVue(cmd: 'date', 'greet {0}' and 'random')" prompt="primevue $" />
127
+ </Dialog>
128
+
129
+ <Galleria v-model:visible="displayPhotos" :value="images" :responsiveOptions="responsiveOptions" :numVisible="2" containerStyle="width: 400px" :circular="true" :fullScreen="true" :showThumbnails="false" :showItemNavigators="true">
130
+ <template #item="slotProps">
131
+ <img :src="slotProps.item.itemImageSrc" :alt="slotProps.item.alt" style="width: 100%" />
132
+ </template>
133
+ </Galleria>
134
+ </div>
135
+ </div>
136
+ </template>
137
+
138
+ <script setup>
139
+ import { ref, onMounted, onBeforeUnmount } from 'vue';
140
+ import { useToast } from 'primevue/usetoast';
141
+ import TerminalService from 'primevue/terminalservice';
142
+ import { NodeService } from '@/service/NodeService';
143
+ import { PhotoService } from '@/service/PhotoService';
144
+ import AlignCenter from '@primeicons/vue/align-center';
145
+ import AlignJustify from '@primeicons/vue/align-justify';
146
+ import AlignLeft from '@primeicons/vue/align-left';
147
+ import AlignRight from '@primeicons/vue/align-right';
148
+ import Apple from '@primeicons/vue/apple';
149
+ import Bars from '@primeicons/vue/bars';
150
+ import Bookmark from '@primeicons/vue/bookmark';
151
+ import CalendarMinus from '@primeicons/vue/calendar-minus';
152
+ import CalendarPlus from '@primeicons/vue/calendar-plus';
153
+ import CalendarTimes from '@primeicons/vue/calendar-times';
154
+ import ExternalLink from '@primeicons/vue/external-link';
155
+ import Filter from '@primeicons/vue/filter';
156
+ import Pencil from '@primeicons/vue/pencil';
157
+ import Plus from '@primeicons/vue/plus';
158
+ import Print from '@primeicons/vue/print';
159
+ import Search from '@primeicons/vue/search';
160
+ import Trash from '@primeicons/vue/trash';
161
+ import UserMinus from '@primeicons/vue/user-minus';
162
+ import UserPlus from '@primeicons/vue/user-plus';
163
+ import Users from '@primeicons/vue/users';
164
+ import Video from '@primeicons/vue/video';
165
+ import VolumeUp from '@primeicons/vue/volume-up';
166
+ import Wifi from '@primeicons/vue/wifi';
167
+
168
+ onMounted(() => {
169
+ PhotoService.getImages().then(data => images.value = data);
170
+ NodeService.getTreeNodes().then(data => nodes.value = data);
171
+ TerminalService.on('command', commandHandler);
172
+ })
173
+
174
+ onBeforeUnmount(() => {
175
+ TerminalService.off('command', commandHandler);
176
+ })
177
+
178
+ const displayFinder = ref(false);
179
+ const displayTerminal = ref(false);
180
+ const displayPhotos = ref(false);
181
+ const images = ref();
182
+ const nodes = ref();
183
+ const toast = useToast();
184
+ const items = ref([
185
+ {
186
+ label: 'Finder',
187
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/finder.svg',
188
+ command: () => {
189
+ displayFinder.value = true;
190
+ }
191
+ },
192
+ {
193
+ label: 'Terminal',
194
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/terminal.svg',
195
+ command: () => {
196
+ displayTerminal.value = true;
197
+ }
198
+ },
199
+ {
200
+ label: 'App Store',
201
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/appstore.svg',
202
+ url: 'https://www.apple.com/app-store/'
203
+ },
204
+ {
205
+ label: 'Safari',
206
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/safari.svg',
207
+ command: () => {
208
+ toast.add({ severity: 'warn', summary: 'Safari has stopped working', group: 'tc', life: 3000 });
209
+ }
210
+ },
211
+ {
212
+ label: 'Photos',
213
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/photos.svg',
214
+ command: () => {
215
+ displayPhotos.value = true;
216
+ }
217
+ },
218
+ {
219
+ label: 'GitHub',
220
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/github.svg',
221
+ url: 'https://github.com/primefaces/primevue'
222
+ },
223
+ {
224
+ label: 'Trash',
225
+ icon: 'https://primefaces.org/cdn/primevue/images/dock/trash.png',
226
+ command: () => {
227
+ toast.add({ severity: 'info', summary: 'Trash is empty', life: 3000 });
228
+ }
229
+ }
230
+ ]);
231
+ const menubarItems = ref([
232
+ {
233
+ label: 'Finder',
234
+ class: 'menubar-root'
235
+ },
236
+ {
237
+ label: 'File',
238
+ items: [
239
+ {
240
+ label: 'New',
241
+ icon: Plus,
242
+ items: [
243
+ {
244
+ label: 'Bookmark',
245
+ icon: Bookmark
246
+ },
247
+ {
248
+ label: 'Video',
249
+ icon: Video
250
+ }
251
+ ]
252
+ },
253
+ {
254
+ label: 'Delete',
255
+ icon: Trash
256
+ },
257
+ {
258
+ separator: true
259
+ },
260
+ {
261
+ label: 'Export',
262
+ icon: ExternalLink
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ label: 'Edit',
268
+ items: [
269
+ {
270
+ label: 'Left',
271
+ icon: AlignLeft
272
+ },
273
+ {
274
+ label: 'Right',
275
+ icon: AlignRight
276
+ },
277
+ {
278
+ label: 'Center',
279
+ icon: AlignCenter
280
+ },
281
+ {
282
+ label: 'Justify',
283
+ icon: AlignJustify
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ label: 'Users',
289
+ items: [
290
+ {
291
+ label: 'New',
292
+ icon: UserPlus
293
+ },
294
+ {
295
+ label: 'Delete',
296
+ icon: UserMinus
297
+ },
298
+ {
299
+ label: 'Search',
300
+ icon: Users,
301
+ items: [
302
+ {
303
+ label: 'Filter',
304
+ icon: Filter,
305
+ items: [
306
+ {
307
+ label: 'Print',
308
+ icon: Print
309
+ }
310
+ ]
311
+ },
312
+ {
313
+ icon: Bars,
314
+ label: 'List'
315
+ }
316
+ ]
317
+ }
318
+ ]
319
+ },
320
+ {
321
+ label: 'Events',
322
+ items: [
323
+ {
324
+ label: 'Edit',
325
+ icon: Pencil,
326
+ items: [
327
+ {
328
+ label: 'Save',
329
+ icon: CalendarPlus
330
+ },
331
+ {
332
+ label: 'Delete',
333
+ icon: CalendarMinus
334
+ }
335
+ ]
336
+ },
337
+ {
338
+ label: 'Archieve',
339
+ icon: CalendarTimes,
340
+ items: [
341
+ {
342
+ label: 'Remove',
343
+ icon: CalendarMinus
344
+ }
345
+ ]
346
+ }
347
+ ]
348
+ },
349
+ {
350
+ label: 'Quit'
351
+ }
352
+ ]);
353
+ const responsiveOptions = ref([
354
+ {
355
+ breakpoint: '1024px',
356
+ numVisible: 3
357
+ },
358
+ {
359
+ breakpoint: '768px',
360
+ numVisible: 2
361
+ },
362
+ {
363
+ breakpoint: '560px',
364
+ numVisible: 1
365
+ }
366
+ ]);
367
+
368
+ const onDockItemClick = (event, item) => {
369
+ if (item.command) {
370
+ item.command();
371
+ }
372
+
373
+ event.preventDefault();
374
+ };
375
+
376
+ const commandHandler = (text) => {
377
+ let response;
378
+ let argsIndex = text.indexOf(' ');
379
+ let command = argsIndex !== -1 ? text.substring(0, argsIndex) : text;
380
+
381
+ switch(command) {
382
+ case "date":
383
+ response = 'Today is ' + new Date().toDateString();
384
+ break;
385
+
386
+ case "greet":
387
+ response = 'Hola ' + text.substring(argsIndex + 1) + '!';
388
+ break;
389
+
390
+ case "random":
391
+ response = Math.floor(Math.random() * 100);
392
+ break;
393
+
394
+ default:
395
+ response = "Unknown command: " + command;
396
+ }
397
+
398
+ TerminalService.emit('response', response);
399
+ };
400
+ <\/script>
401
+
402
+ <style scoped>
403
+ .dock-demo > .dock-window {
404
+ width: 100%;
405
+ height: 450px;
406
+ position: relative;
407
+ background-image: url("https://primefaces.org/cdn/primevue/images/dock/window.jpg");
408
+ background-repeat: no-repeat;
409
+ background-size: cover;
410
+ }
411
+
412
+ .dock-demo .p-menubar {
413
+ padding: 0;
414
+ border-radius: 0;
415
+ }
416
+ </style>
417
+ ```
418
+
419
+ ## Accessibility
420
+
421
+ Screen Reader Dock component uses the menu role with the aria-orientation and the value to describe the menu can either be provided with aria-labelledby or aria-label props. Each list item has a presentation role whereas anchor elements have a menuitem role with aria-label referring to the label of the item and aria-disabled defined if the item is disabled. Keyboard Support Key Function tab Add focus to the first item if focus moves in to the menu. If the focus is already within the menu, focus moves to the next focusable item in the page tab sequence. shift + tab Add focus to the last item if focus moves in to the menu. If the focus is already within the menu, focus moves to the previous focusable item in the page tab sequence. enter Activates the focused menuitem. space Activates the focused menuitem. down arrow Moves focus to the next menuitem in vertical layout. up arrow Moves focus to the previous menuitem in vertical layout. home Moves focus to the first menuitem in horizontal layout. end Moves focus to the last menuitem in horizontal layout.
422
+
423
+ ## Dock API
424
+
425
+ ### Props
426
+
427
+ | Name |Type |Default |Description |
428
+ | --- | --- | --- | --- |
429
+ | model | MenuItem[] | - | MenuModel instance to define the action items. |
430
+ | position | HintedString<"left" \| "right" \| "top" \| "bottom"> | bottom | Position of element. |
431
+ | class | any | - | Style class of the element. |
432
+ | style | any | - | Inline style of the element. |
433
+ | breakpoint | string | 960px | The breakpoint to define the maximum width boundary. |
434
+ | tooltipOptions | DockTooltipOptions | - | Whether to display the tooltip on items. The modifiers of Tooltip can be used like an object in it. Valid keys are 'event' and 'position'. |
435
+ | menuId | string | - | Unique identifier of the menu. |
436
+ | tabindex | string \| number | - | Index of the element in tabbing order. |
437
+ | ariaLabelledby | string | - | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
438
+ | ariaLabel | string | - | Establishes a string value that labels the component. |
439
+ | dt | any | - | It generates scoped CSS variables using design tokens for the component. |
440
+ | pt | PassThrough<DockPassThroughOptions> | - | Used to pass attributes to DOM elements inside the component. |
441
+ | ptOptions | any | - | Used to configure passthrough(pt) options of the component. |
442
+ | unstyled | boolean | false | When enabled, it removes component related styles in the core. |
443
+
444
+ ### Pass Through Options
445
+
446
+ | Name |Type |Description |
447
+ | --- | --- | --- |
448
+ | root | DockPassThroughOptionType | Used to pass attributes to the root's DOM element. |
449
+ | listContainer | DockPassThroughOptionType | Used to pass attributes to the list container's DOM element. |
450
+ | list | DockPassThroughOptionType | Used to pass attributes to the list's DOM element. |
451
+ | item | DockPassThroughOptionType | Used to pass attributes to the item's DOM element. |
452
+ | itemContent | DockPassThroughOptionType | Used to pass attributes to the item content's DOM element. |
453
+ | itemLink | DockPassThroughOptionType | Used to pass attributes to the item link's DOM element. |
454
+ | itemIcon | DockPassThroughOptionType | Used to pass attributes to the item icon's DOM element. |
455
+ | hooks | any | Used to manage all lifecycle hooks. |
456
+
457
+ ### Theming
458
+
459
+ ### CSS Classes
460
+
461
+ | Class |Description |
462
+ | --- | --- |
463
+ | p-dock | Class name of the root element |
464
+ | p-dock-list-container | Class name of the list container element |
465
+ | p-dock-list | Class name of the list element |
466
+ | p-dock-item | Class name of the item element |
467
+ | p-dock-item-content | Class name of the item content element |
468
+ | p-dock-item-link | Class name of the item link element |
469
+ | p-dock-item-icon | Class name of the item icon element |
470
+
471
+ ### Design Tokens
472
+
473
+ | Token |CSS Variable |Description |
474
+ | --- | --- | --- |
475
+ | dock.background | --p-dock-background | Background of root |
476
+ | dock.border.color | --p-dock-border-color | Border color of root |
477
+ | dock.padding | --p-dock-padding | Padding of root |
478
+ | dock.border.radius | --p-dock-border-radius | Border radius of root |
479
+ | dock.item.border.radius | --p-dock-item-border-radius | Border radius of item |
480
+ | dock.item.padding | --p-dock-item-padding | Padding of item |
481
+ | dock.item.size | --p-dock-item-size | Size of item |
482
+ | dock.item.focus.ring.width | --p-dock-item-focus-ring-width | Focus ring width of item |
483
+ | dock.item.focus.ring.style | --p-dock-item-focus-ring-style | Focus ring style of item |
484
+ | dock.item.focus.ring.color | --p-dock-item-focus-ring-color | Focus ring color of item |
485
+ | dock.item.focus.ring.offset | --p-dock-item-focus-ring-offset | Focus ring offset of item |
486
+ | dock.item.focus.ring.shadow | --p-dock-item-focus-ring-shadow | Focus ring shadow of item |
487
+
488
+ ## Menu Item API