origam 2.38.1 → 2.38.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 (228) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/src/assets/locales/en.json +1 -1
  3. package/dist/src/assets/locales/fr.json +2 -2
  4. package/dist/src/components/Alert/OrigamAlert.vue +739 -165
  5. package/dist/src/components/App/OrigamApp.vue +95 -19
  6. package/dist/src/components/App/OrigamAppBar.vue +751 -158
  7. package/dist/src/components/Audio/OrigamAudio.vue +1288 -346
  8. package/dist/src/components/Audio/OrigamAudioWaveform.vue +63 -7
  9. package/dist/src/components/Avatar/OrigamAvatar.vue +678 -126
  10. package/dist/src/components/Avatar/OrigamAvatarGroup.vue +700 -153
  11. package/dist/src/components/Badge/OrigamBadge.vue +548 -135
  12. package/dist/src/components/Blockquote/OrigamBlockquote.vue +698 -140
  13. package/dist/src/components/BottomNav/OrigamBottomNav.vue +864 -156
  14. package/dist/src/components/Bracket/OrigamBracket.vue +1013 -380
  15. package/dist/src/components/Bracket/OrigamBracketCompetitor.vue +674 -154
  16. package/dist/src/components/Bracket/OrigamBracketMatch.vue +663 -163
  17. package/dist/src/components/Bracket/OrigamBracketRound.vue +116 -34
  18. package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +654 -119
  19. package/dist/src/components/Breadcrumb/OrigamBreadcrumbDivider.vue +292 -54
  20. package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +657 -126
  21. package/dist/src/components/Btn/OrigamBtn.vue +928 -249
  22. package/dist/src/components/Btn/OrigamBtnGroup.vue +658 -141
  23. package/dist/src/components/Btn/OrigamBtnToggle.vue +578 -91
  24. package/dist/src/components/Calendar/OrigamCalendar.vue +1142 -484
  25. package/dist/src/components/Card/OrigamCard.vue +938 -194
  26. package/dist/src/components/Card/OrigamCardHeader.vue +593 -104
  27. package/dist/src/components/Card/OrigamCardText.vue +536 -84
  28. package/dist/src/components/Carousel/OrigamCarousel.vue +778 -202
  29. package/dist/src/components/Carousel/OrigamCarouselItem.vue +660 -109
  30. package/dist/src/components/Chart/OrigamChart.vue +942 -452
  31. package/dist/src/components/Chart/OrigamChartAxis.vue +111 -19
  32. package/dist/src/components/Chart/OrigamChartBoxPlot.vue +713 -297
  33. package/dist/src/components/Chart/OrigamChartBullet.vue +701 -286
  34. package/dist/src/components/Chart/OrigamChartCandlestick.vue +663 -243
  35. package/dist/src/components/Chart/OrigamChartCartesian.vue +1055 -487
  36. package/dist/src/components/Chart/OrigamChartGauge.vue +563 -164
  37. package/dist/src/components/Chart/OrigamChartHeatmap.vue +677 -251
  38. package/dist/src/components/Chart/OrigamChartHoneycomb.vue +700 -288
  39. package/dist/src/components/Chart/OrigamChartLegend.vue +108 -16
  40. package/dist/src/components/Chart/OrigamChartMap.vue +723 -299
  41. package/dist/src/components/Chart/OrigamChartPareto.vue +721 -276
  42. package/dist/src/components/Chart/OrigamChartPictorial.vue +777 -355
  43. package/dist/src/components/Chart/OrigamChartPolar.vue +603 -210
  44. package/dist/src/components/Chart/OrigamChartPolarBar.vue +674 -271
  45. package/dist/src/components/Chart/OrigamChartPyramid.vue +685 -250
  46. package/dist/src/components/Chart/OrigamChartRadar.vue +515 -165
  47. package/dist/src/components/Chart/OrigamChartRangeSelector.vue +50 -25
  48. package/dist/src/components/Chart/OrigamChartSankey.vue +913 -467
  49. package/dist/src/components/Chart/OrigamChartSparkline.vue +711 -268
  50. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +810 -368
  51. package/dist/src/components/Chart/OrigamChartSunburst.vue +779 -368
  52. package/dist/src/components/Chart/OrigamChartTooltip.vue +78 -19
  53. package/dist/src/components/Chart/OrigamChartTreemap.vue +750 -288
  54. package/dist/src/components/Chart/OrigamChartVariwide.vue +679 -251
  55. package/dist/src/components/Chart/OrigamChartWordCloud.vue +674 -265
  56. package/dist/src/components/Checkbox/OrigamCheckbox.vue +781 -136
  57. package/dist/src/components/Checkbox/OrigamCheckboxBtn.vue +465 -81
  58. package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +824 -137
  59. package/dist/src/components/Chip/OrigamChip.vue +867 -202
  60. package/dist/src/components/Chip/OrigamChipGroup.vue +633 -121
  61. package/dist/src/components/ClientOnly/OrigamClientOnly.vue +30 -4
  62. package/dist/src/components/Clipboard/OrigamClipboard.vue +624 -105
  63. package/dist/src/components/Code/OrigamCode.vue +844 -206
  64. package/dist/src/components/CodeGroup/OrigamCodeGroup.vue +494 -83
  65. package/dist/src/components/ColorPicker/OrigamColorPicker.vue +777 -159
  66. package/dist/src/components/ColorPicker/OrigamColorPickerCanvas.vue +295 -181
  67. package/dist/src/components/ColorPicker/OrigamColorPickerEdit.vue +108 -45
  68. package/dist/src/components/ColorPicker/OrigamColorPickerPreview.vue +131 -46
  69. package/dist/src/components/ColorPicker/OrigamColorPickerSwatches.vue +128 -39
  70. package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +1123 -258
  71. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +415 -162
  72. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +389 -145
  73. package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +852 -147
  74. package/dist/src/components/Counter/OrigamCounter.vue +588 -96
  75. package/dist/src/components/DataList/OrigamDataList.vue +619 -113
  76. package/dist/src/components/DataList/OrigamDataText.vue +295 -65
  77. package/dist/src/components/DataList/OrigamDataTitle.vue +295 -65
  78. package/dist/src/components/DataTable/OrigamDataTable.vue +934 -222
  79. package/dist/src/components/DataTable/OrigamDataTableColumnCell.vue +196 -51
  80. package/dist/src/components/DataTable/OrigamDataTableFooter.vue +319 -78
  81. package/dist/src/components/DataTable/OrigamDataTableGroupHeaderRow.vue +124 -44
  82. package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +181 -70
  83. package/dist/src/components/DataTable/OrigamDataTableHeaders.vue +155 -46
  84. package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +145 -27
  85. package/dist/src/components/DataTable/OrigamDataTableHeadersCellMobile.vue +126 -43
  86. package/dist/src/components/DataTable/OrigamDataTableRow.vue +151 -73
  87. package/dist/src/components/DataTable/OrigamDataTableRows.vue +261 -106
  88. package/dist/src/components/DatePicker/OrigamDatePicker.vue +1048 -261
  89. package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +155 -51
  90. package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +147 -46
  91. package/dist/src/components/DatePicker/OrigamDatePickerMonth.vue +312 -134
  92. package/dist/src/components/DatePicker/OrigamDatePickerMonths.vue +151 -61
  93. package/dist/src/components/DatePicker/OrigamDatePickerYears.vue +154 -67
  94. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +1147 -306
  95. package/dist/src/components/DefaultsProvider/OrigamDefaultsProvider.vue +74 -14
  96. package/dist/src/components/Dialog/OrigamDialog.vue +953 -196
  97. package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +886 -148
  98. package/dist/src/components/Divider/OrigamDivider.vue +210 -50
  99. package/dist/src/components/Drawer/OrigamDrawer.vue +909 -207
  100. package/dist/src/components/EmptyState/OrigamEmptyState.vue +146 -35
  101. package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +746 -159
  102. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +591 -95
  103. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +663 -143
  104. package/dist/src/components/ExpansionPanel/OrigamExpansionPanels.vue +675 -134
  105. package/dist/src/components/Field/OrigamField.vue +1118 -306
  106. package/dist/src/components/FileField/OrigamFileField.vue +1188 -311
  107. package/dist/src/components/FileField/OrigamFileFieldDragNDropItem.vue +155 -36
  108. package/dist/src/components/FileField/OrigamFileFieldListItem.vue +155 -36
  109. package/dist/src/components/Form/OrigamForm.vue +197 -74
  110. package/dist/src/components/Grid/OrigamGrid.vue +707 -147
  111. package/dist/src/components/Grid/OrigamGridItem.vue +110 -37
  112. package/dist/src/components/Grids/OrigamCol.vue +593 -110
  113. package/dist/src/components/Grids/OrigamContainer.vue +461 -80
  114. package/dist/src/components/Grids/OrigamRow.vue +573 -112
  115. package/dist/src/components/Grids/OrigamSpacer.vue +54 -17
  116. package/dist/src/components/Icon/OrigamClassIcon.vue +573 -98
  117. package/dist/src/components/Icon/OrigamComponentIcon.vue +561 -101
  118. package/dist/src/components/Icon/OrigamIcon.vue +561 -98
  119. package/dist/src/components/Icon/OrigamLigatureIcon.vue +558 -98
  120. package/dist/src/components/Icon/OrigamSvgIcon.vue +593 -100
  121. package/dist/src/components/Img/OrigamImg.vue +869 -228
  122. package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +319 -111
  123. package/dist/src/components/InfiniteScroll/OrigamInfiniteScrollIntersect.vue +80 -17
  124. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +476 -140
  125. package/dist/src/components/Input/OrigamInput.vue +747 -180
  126. package/dist/src/components/ItemGroup/OrigamItemGroup.vue +112 -36
  127. package/dist/src/components/ItemGroup/OrigamItemGroupItem.vue +80 -29
  128. package/dist/src/components/Kbd/OrigamKbd.vue +450 -75
  129. package/dist/src/components/Label/OrigamLabel.vue +584 -95
  130. package/dist/src/components/Layout/OrigamLayout.vue +563 -94
  131. package/dist/src/components/Lazy/OrigamLazy.vue +131 -34
  132. package/dist/src/components/List/OrigamList.vue +755 -170
  133. package/dist/src/components/List/OrigamListChildren.vue +59 -19
  134. package/dist/src/components/List/OrigamListGroup.vue +631 -134
  135. package/dist/src/components/List/OrigamListGroupActivator.vue +45 -17
  136. package/dist/src/components/List/OrigamListItem.vue +890 -224
  137. package/dist/src/components/List/OrigamListItemWrapper.vue +20 -10
  138. package/dist/src/components/List/OrigamListSubheader.vue +542 -93
  139. package/dist/src/components/Loader/OrigamLoader.vue +110 -25
  140. package/dist/src/components/Main/OrigamMain.vue +565 -96
  141. package/dist/src/components/Masonry/OrigamMasonry.vue +799 -187
  142. package/dist/src/components/Media/OrigamMediaController.vue +465 -182
  143. package/dist/src/components/Media/OrigamMediaScrubber.vue +389 -152
  144. package/dist/src/components/Media/OrigamMediaVolumeControl.vue +174 -44
  145. package/dist/src/components/Menu/OrigamMenu.vue +1079 -255
  146. package/dist/src/components/Messages/OrigamMessages.vue +606 -97
  147. package/dist/src/components/NumberField/OrigamNumberField.vue +1208 -333
  148. package/dist/src/components/NumberFormat/OrigamNumberFormat.vue +177 -57
  149. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +1016 -272
  150. package/dist/src/components/Overlay/OrigamOverlay.vue +446 -158
  151. package/dist/src/components/Overlay/OrigamOverlayScrim.vue +122 -30
  152. package/dist/src/components/Pagination/OrigamPagination.vue +982 -313
  153. package/dist/src/components/Parallax/OrigamParallax.vue +800 -259
  154. package/dist/src/components/Parallax/OrigamParallaxElement.vue +694 -178
  155. package/dist/src/components/Parallax/OrigamParallaxLayer.vue +132 -47
  156. package/dist/src/components/PasswordField/OrigamPasswordField.vue +1098 -265
  157. package/dist/src/components/Picker/OrigamPicker.vue +655 -108
  158. package/dist/src/components/Picker/OrigamPickerTitle.vue +108 -26
  159. package/dist/src/components/Progress/OrigamProgress.vue +436 -70
  160. package/dist/src/components/Progress/OrigamProgressCircular.vue +399 -82
  161. package/dist/src/components/Progress/OrigamProgressLinear.vue +468 -115
  162. package/dist/src/components/QrCode/OrigamQrCode.vue +642 -126
  163. package/dist/src/components/Radio/OrigamRadio.vue +772 -132
  164. package/dist/src/components/Radio/OrigamRadioBtn.vue +446 -71
  165. package/dist/src/components/Radio/OrigamRadioGroup.vue +808 -135
  166. package/dist/src/components/RatingField/OrigamRatingField.vue +963 -194
  167. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +657 -106
  168. package/dist/src/components/Responsive/OrigamResponsive.vue +548 -91
  169. package/dist/src/components/Select/OrigamSelect.vue +1639 -567
  170. package/dist/src/components/SelectionControl/OrigamSelectionControl.vue +564 -151
  171. package/dist/src/components/SelectionControl/OrigamSelectionControlGroup.vue +178 -62
  172. package/dist/src/components/Sheet/OrigamSheet.vue +773 -199
  173. package/dist/src/components/Skeleton/OrigamSkeleton.vue +249 -46
  174. package/dist/src/components/Skeleton/OrigamSkeletonGroup.vue +66 -11
  175. package/dist/src/components/Slide/OrigamSlideGroup.vue +772 -257
  176. package/dist/src/components/SliderField/OrigamSliderField.vue +1157 -335
  177. package/dist/src/components/SliderField/OrigamSliderFieldTrack.vue +236 -112
  178. package/dist/src/components/Snackbar/OrigamSnackbar.vue +871 -214
  179. package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +218 -51
  180. package/dist/src/components/Snackbar/OrigamSnackbarItem.vue +175 -43
  181. package/dist/src/components/Stepper/OrigamStepper.vue +618 -126
  182. package/dist/src/components/Stepper/OrigamStepperItem.vue +98 -37
  183. package/dist/src/components/Switch/OrigamSwitch.vue +879 -156
  184. package/dist/src/components/Switch/OrigamSwitchTrack.vue +431 -78
  185. package/dist/src/components/SystemBar/OrigamSystemBar.vue +517 -87
  186. package/dist/src/components/Table/OrigamTable.vue +585 -124
  187. package/dist/src/components/Tabs/OrigamTab.vue +239 -73
  188. package/dist/src/components/Tabs/OrigamTabPanel.vue +125 -39
  189. package/dist/src/components/Tabs/OrigamTabPanels.vue +148 -57
  190. package/dist/src/components/Tabs/OrigamTabs.vue +381 -109
  191. package/dist/src/components/TextField/OrigamTextField.vue +1077 -258
  192. package/dist/src/components/TextMask/OrigamTextMask.vue +150 -43
  193. package/dist/src/components/TextareaField/OrigamTextareaField.vue +1162 -310
  194. package/dist/src/components/TextareaField/OrigamTextareaFieldRichToolbar.vue +77 -79
  195. package/dist/src/components/ThemeProvider/OrigamThemeProvider.vue +44 -9
  196. package/dist/src/components/Timeline/OrigamTimeline.vue +113 -43
  197. package/dist/src/components/Timeline/OrigamTimelineItem.vue +163 -76
  198. package/dist/src/components/Title/OrigamTitle.vue +505 -82
  199. package/dist/src/components/Toolbar/OrigamToolbar.vue +679 -142
  200. package/dist/src/components/Tooltip/OrigamTooltip.vue +288 -72
  201. package/dist/src/components/Transition/OrigamExpandX.vue +219 -106
  202. package/dist/src/components/Transition/OrigamExpandY.vue +219 -106
  203. package/dist/src/components/Transition/OrigamFade.vue +47 -9
  204. package/dist/src/components/Transition/OrigamReverseTranslatePicker.vue +52 -10
  205. package/dist/src/components/Transition/OrigamScaleRotate.vue +52 -10
  206. package/dist/src/components/Transition/OrigamSlideX.vue +52 -10
  207. package/dist/src/components/Transition/OrigamSlideY.vue +52 -10
  208. package/dist/src/components/Transition/OrigamSnack.vue +52 -10
  209. package/dist/src/components/Transition/OrigamTransition.vue +40 -12
  210. package/dist/src/components/Transition/OrigamTranslateBottom.vue +52 -10
  211. package/dist/src/components/Transition/OrigamTranslatePicker.vue +52 -10
  212. package/dist/src/components/Transition/OrigamTranslateScale.vue +209 -97
  213. package/dist/src/components/Transition/OrigamWindowXReverseTranslate.vue +40 -7
  214. package/dist/src/components/Transition/OrigamWindowXTranslate.vue +40 -7
  215. package/dist/src/components/Transition/OrigamWindowYReverseTranslate.vue +40 -7
  216. package/dist/src/components/Transition/OrigamWindowYTranslate.vue +40 -7
  217. package/dist/src/components/Treeview/OrigamTreeview.vue +258 -118
  218. package/dist/src/components/Treeview/OrigamTreeviewNode.vue +126 -88
  219. package/dist/src/components/Video/OrigamVideo.vue +1178 -331
  220. package/dist/src/components/VirtualScroll/OrigamVirtualScroll.vue +147 -55
  221. package/dist/src/components/VirtualScroll/OrigamVirtualScrollItem.vue +94 -19
  222. package/dist/src/components/Watermark/OrigamWatermark.vue +224 -124
  223. package/dist/src/components/Window/OrigamWindow.vue +745 -175
  224. package/dist/src/components/Window/OrigamWindowItem.vue +162 -69
  225. package/dist/src/composables/Commons/display.composable.cjs +2 -0
  226. package/dist/src/composables/Commons/display.composable.js +1 -1
  227. package/dist/src/interfaces/Pagination/pagination.interface.d.ts +1 -1
  228. package/package.json +6 -6
@@ -186,260 +186,513 @@ import { COMMAND_PALETTE_DEFAULT_HOTKEY, COMMAND_PALETTE_DEFAULT_MAX_HEIGHT, COM
186
186
  import { IN_BROWSER } from "../../consts/Commons/commons.const";
187
187
  import { getUid } from "../../utils/Commons/getCurrentInstance.util";
188
188
  import { fuzzyMatch } from "../../utils/CommandPalette/fuzzy-match.util";
189
+ /*********************************************************
190
+ * inheritAttrs — #916 / #853
191
+ *
192
+ * @description
193
+ * The single root is a `<teleport>` (to `document.body` by default, or
194
+ * wherever `attach` resolves via `useTeleport`), and Vue treats the
195
+ * TELEPORT shapeFlag like a fragment for automatic attrs inheritance —
196
+ * its own message says "renders fragment or text or teleport root
197
+ * nodes". It therefore logs "Extraneous non-props attributes", whose
198
+ * component trace serialises every ancestor's props including Vue
199
+ * Router's `RouteProvider` vnode: ~4.4 MB per occurrence, the mechanism
200
+ * behind #853's 5.5 GB log.
201
+ *
202
+ * This palette does NOT go through `OrigamOverlay` — it owns a hand-rolled
203
+ * `<teleport>` — so #915's fix on the overlay does not reach it. `attach`
204
+ * is resolved the same way `OrigamOverlay` resolves it though — through
205
+ * the shared `useTeleport()` composable, the single consumption point for
206
+ * the whole DS (#attach-harmonisation).
207
+ *
208
+ * ⛔ The flag alone would SILENTLY swallow the consumer's attributes, and
209
+ * there is a real one: `packages/marketing/src/layouts/default.vue` passes
210
+ * `data-cy="global-command-palette"`, which is not a declared prop and so
211
+ * arrives in `$attrs`. They are therefore forwarded explicitly onto the
212
+ * backdrop root above — the visible root of the teleported subtree, the
213
+ * element already carrying `id`, `class`, `style` and `data-cy`.
214
+ *
215
+ * ⚠️ `v-bind="{ ...$attrs }"` sits AFTER `:data-cy="dataCy"` ON PURPOSE. The
216
+ * component hardcodes `dataCy = 'origam-command-palette'`; placed before
217
+ * the spread it would mask the consumer's own value, which is exactly
218
+ * #492's silent loss. Standard Vue merge order applies: for a scalar key
219
+ * the later source wins, while `class` and `style` are concatenated by
220
+ * `mergeProps` rather than replaced.
221
+ ********************************************************/
189
222
  defineOptions({ inheritAttrs: false });
223
+ /*********************************************************
224
+ * Global
225
+ ********************************************************/
190
226
  const props = defineProps({
191
- modelValue: { type: Boolean, required: false, default: false },
192
- hotkey: { type: [Array, null], required: false, default: () => COMMAND_PALETTE_DEFAULT_HOTKEY },
193
- commands: { type: Array, required: false },
194
- filter: { type: [Boolean, Function], required: false, default: true },
195
- placeholder: { type: String, required: false, default: "origam.command_palette.placeholder" },
196
- emptyText: { type: String, required: false, default: "origam.command_palette.empty_text" },
197
- maxHeight: { type: [Number, String], required: false, default: COMMAND_PALETTE_DEFAULT_MAX_HEIGHT },
198
- width: { type: [Number, String], required: false, default: COMMAND_PALETTE_DEFAULT_WIDTH },
199
- loading: { type: Boolean, required: false, default: false },
200
- searchIcon: { type: null, required: false, default: "mdi:mdi-magnify" },
201
- loadingIcon: { type: null, required: false, default: "mdi:mdi-loading" },
202
- closeOnSelect: { type: Boolean, required: false, default: true },
203
- closeOnEscape: { type: Boolean, required: false, default: true },
204
- closeOnBackdrop: { type: Boolean, required: false, default: true },
205
- id: { type: String, required: false },
206
- class: { type: [String, Array, Object], required: false },
207
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
208
- fontSize: { type: null, required: false },
209
- attach: { type: [Boolean, String, null], required: false, skipCheck: true }
227
+ modelValue: {
228
+ type: Boolean,
229
+ required: false,
230
+ default: false
231
+ },
232
+ hotkey: {
233
+ type: [Array, null],
234
+ required: false,
235
+ default: () => COMMAND_PALETTE_DEFAULT_HOTKEY
236
+ },
237
+ commands: {
238
+ type: Array,
239
+ required: false
240
+ },
241
+ filter: {
242
+ type: [Boolean, Function],
243
+ required: false,
244
+ default: true
245
+ },
246
+ placeholder: {
247
+ type: String,
248
+ required: false,
249
+ default: "origam.command_palette.placeholder"
250
+ },
251
+ emptyText: {
252
+ type: String,
253
+ required: false,
254
+ default: "origam.command_palette.empty_text"
255
+ },
256
+ maxHeight: {
257
+ type: [Number, String],
258
+ required: false,
259
+ default: COMMAND_PALETTE_DEFAULT_MAX_HEIGHT
260
+ },
261
+ width: {
262
+ type: [Number, String],
263
+ required: false,
264
+ default: COMMAND_PALETTE_DEFAULT_WIDTH
265
+ },
266
+ loading: {
267
+ type: Boolean,
268
+ required: false,
269
+ default: false
270
+ },
271
+ searchIcon: {
272
+ type: null,
273
+ required: false,
274
+ default: "mdi:mdi-magnify"
275
+ },
276
+ loadingIcon: {
277
+ type: null,
278
+ required: false,
279
+ default: "mdi:mdi-loading"
280
+ },
281
+ closeOnSelect: {
282
+ type: Boolean,
283
+ required: false,
284
+ default: true
285
+ },
286
+ closeOnEscape: {
287
+ type: Boolean,
288
+ required: false,
289
+ default: true
290
+ },
291
+ closeOnBackdrop: {
292
+ type: Boolean,
293
+ required: false,
294
+ default: true
295
+ },
296
+ id: {
297
+ type: String,
298
+ required: false
299
+ },
300
+ class: {
301
+ type: [
302
+ String,
303
+ Array,
304
+ Object
305
+ ],
306
+ required: false
307
+ },
308
+ style: {
309
+ type: [
310
+ String,
311
+ Array,
312
+ Object,
313
+ Boolean,
314
+ null
315
+ ],
316
+ required: false,
317
+ skipCheck: true
318
+ },
319
+ fontSize: {
320
+ type: null,
321
+ required: false
322
+ },
323
+ attach: {
324
+ type: [
325
+ Boolean,
326
+ String,
327
+ null
328
+ ],
329
+ required: false,
330
+ skipCheck: true
331
+ }
210
332
  });
211
- const emit = defineEmits(["update:modelValue", "select", "query"]);
333
+ const emit = defineEmits([
334
+ "update:modelValue",
335
+ "select",
336
+ "query"
337
+ ]);
212
338
  defineSlots();
213
339
  const slots = useSlots();
340
+ /*********************************************************
341
+ * v-model — single source of truth for open/close.
342
+ *
343
+ * @description
344
+ * `useVModel` keeps `isActive` in sync with both the prop and the
345
+ * registry singleton (`useCommand`). Components mounted without an
346
+ * explicit `commands` prop fall back to the global registry.
347
+ ********************************************************/
214
348
  const isActive = useVModel(props, "modelValue");
215
349
  const { commands: registryCommands, isOpen: registryOpen } = useCommand();
350
+ // When a consumer drives the palette through `useCommand().open()`,
351
+ // mirror the registry's open state onto the local v-model so the
352
+ // declarative prop API stays consistent.
216
353
  watch(registryOpen, (next) => {
217
- if (next !== isActive.value) isActive.value = next;
354
+ if (next !== isActive.value) isActive.value = next;
218
355
  });
219
356
  watch(isActive, (next) => {
220
- if (next !== registryOpen.value) registryOpen.value = next;
357
+ if (next !== registryOpen.value) registryOpen.value = next;
221
358
  });
359
+ /*********************************************************
360
+ * Teleport — #attach-harmonisation
361
+ *
362
+ * @description
363
+ * `attach` was previously absent and the palette hard-coded
364
+ * `<teleport to="body">`. `useTeleport` is the single resolution
365
+ * point the rest of the Overlay family (`OrigamOverlay`) already
366
+ * consumes — deferred into a `computed` (never read eagerly in
367
+ * `setup()`) so a themed `attach` value is honoured.
368
+ ********************************************************/
222
369
  const { teleportTarget } = useTeleport(computed(() => props.attach || false));
370
+ /*********************************************************
371
+ * IDs & refs
372
+ ********************************************************/
223
373
  const uid = getUid();
224
374
  const inputId = computed(() => `origam-command-palette-input-${uid}`);
225
375
  const listboxId = computed(() => `origam-command-palette-listbox-${uid}`);
226
376
  const dataCy = computed(() => "origam-command-palette");
377
+ /*********************************************************
378
+ * Dialog accessible name (issue #404)
379
+ *
380
+ * @description
381
+ * Was `aria-labelledby="inputId"`, pointing the dialog's name at the
382
+ * `<input>`. Measured with a real Playwright `ariaSnapshot()` against
383
+ * Chromium: the dialog announced with NO name at all — a placeholder
384
+ * does not reliably promote to the accessible name of an ELEMENT
385
+ * REFERENCING it via `aria-labelledby` (it only names the input
386
+ * itself). `aria-label` and `aria-labelledby` can't coexist —
387
+ * `aria-labelledby` always wins when both are present — so the fix
388
+ * replaces it outright with a dedicated, always-present label rather
389
+ * than keeping a dead attribute alongside a working one.
390
+ ********************************************************/
227
391
  const { t } = useLocale();
228
392
  const dialogAriaLabel = computed(() => t("origam.command_palette.aria_label"));
393
+ /*********************************************************
394
+ * `placeholder` et `emptyText` transportent une CLÉ (#404, C8)
395
+ *
396
+ * @description
397
+ * Leurs valeurs par défaut étaient les chaînes anglaises `'Search…'` et
398
+ * `'No results'`, écrites en dur dans `withDefaults` — donc rendues
399
+ * telles quelles dans toutes les langues. Le placeholder est doublement
400
+ * exposé : il remplit l'`<input role="combobox">`, dont il constitue le
401
+ * nom accessible, et il sert d'`aria-label` à la listbox.
402
+ *
403
+ * @description
404
+ * Le défaut est désormais une clé de catalogue, résolue par `t()`. Rien
405
+ * ne casse pour un consommateur qui passe du texte littéral : l'adaptateur
406
+ * intégré rend la clé INCHANGÉE quand elle est absente du catalogue, donc
407
+ * `placeholder="Chercher un client"` s'affiche verbatim. C'est le contrat
408
+ * déjà en vigueur sur `OrigamPagination`.
409
+ ********************************************************/
229
410
  const resolvedPlaceholder = computed(() => t(props.placeholder));
230
411
  const resolvedEmptyText = computed(() => t(props.emptyText));
231
412
  const rootRef = ref();
232
413
  const dialogRef = ref();
233
414
  const inputRef = ref();
415
+ /*********************************************************
416
+ * Hotkey registration
417
+ *
418
+ * @description
419
+ * `useHotkey` returns a cleanup closure. We collect every closure
420
+ * from each combination so the listeners can be torn down together
421
+ * if the prop changes at runtime (rare but supported).
422
+ ********************************************************/
234
423
  const normalizedHotkeys = computed(() => {
235
- const raw = props.hotkey;
236
- if (!raw) return [];
237
- if (raw.length === 0) return [];
238
- if (Array.isArray(raw[0])) {
239
- return raw;
240
- }
241
- return [raw];
424
+ const raw = props.hotkey;
425
+ if (!raw) return [];
426
+ if (raw.length === 0) return [];
427
+ // A nested array means the user passed multiple combinations.
428
+ if (Array.isArray(raw[0])) {
429
+ return raw;
430
+ }
431
+ return [raw];
242
432
  });
243
433
  const toggle = () => {
244
- isActive.value = !isActive.value;
434
+ isActive.value = !isActive.value;
245
435
  };
246
436
  if (IN_BROWSER) {
247
- const installed = [];
248
- watch(normalizedHotkeys, (next) => {
249
- while (installed.length > 0) {
250
- const dispose = installed.pop();
251
- try {
252
- dispose?.();
253
- } catch {
254
- }
255
- }
256
- next.forEach((combo) => {
257
- const keysAsString = combo.join("+");
258
- const cleanup = useHotkey(keysAsString, () => toggle());
259
- installed.push(cleanup);
260
- });
261
- }, { immediate: true });
437
+ const installed = [];
438
+ watch(normalizedHotkeys, (next) => {
439
+ while (installed.length > 0) {
440
+ const dispose = installed.pop();
441
+ try {
442
+ dispose?.();
443
+ } catch {}
444
+ }
445
+ next.forEach((combo) => {
446
+ const keysAsString = combo.join("+");
447
+ // `useHotkey` itself ignores key combinations when focus is
448
+ // inside an INPUT / TEXTAREA / contentEditable element
449
+ // (its `inputs: false` default). That matches the brief —
450
+ // we don't want to grab ⌘K typed inside a user input.
451
+ const cleanup = useHotkey(keysAsString, () => toggle());
452
+ installed.push(cleanup);
453
+ });
454
+ }, { immediate: true });
262
455
  }
456
+ /*********************************************************
457
+ * Data source — declarative prop vs global registry.
458
+ ********************************************************/
263
459
  const sourceCommands = computed(() => {
264
- if (props.commands && (props.commands.length > 0 || props.filter !== true)) return props.commands;
265
- return registryCommands.value;
460
+ if (props.commands && (props.commands.length > 0 || props.filter !== true)) return props.commands;
461
+ return registryCommands.value;
266
462
  });
463
+ /*********************************************************
464
+ * Query + filtering
465
+ ********************************************************/
267
466
  const query = ref("");
268
467
  const filtered = computed(() => {
269
- if (typeof props.filter === "function") {
270
- return props.filter(sourceCommands.value, query.value).map((item) => ({ item, score: 0 }));
271
- }
272
- if (props.filter === false) {
273
- return sourceCommands.value.map((item) => ({ item, score: 0 }));
274
- }
275
- return fuzzyMatch(sourceCommands.value, query.value, (cmd) => ({
276
- label: cmd.label,
277
- haystack: [
278
- cmd.label,
279
- ...cmd.keywords ?? [],
280
- cmd.description ?? ""
281
- ].join(" ")
282
- }));
468
+ if (typeof props.filter === "function") {
469
+ return props.filter(sourceCommands.value, query.value).map((item) => ({
470
+ item,
471
+ score: 0
472
+ }));
473
+ }
474
+ if (props.filter === false) {
475
+ return sourceCommands.value.map((item) => ({
476
+ item,
477
+ score: 0
478
+ }));
479
+ }
480
+ return fuzzyMatch(sourceCommands.value, query.value, (cmd) => ({
481
+ label: cmd.label,
482
+ haystack: [
483
+ cmd.label,
484
+ ...cmd.keywords ?? [],
485
+ cmd.description ?? ""
486
+ ].join(" ")
487
+ }));
283
488
  });
284
489
  const hasResults = computed(() => filtered.value.length > 0);
490
+ /*********************************************************
491
+ * Grouping
492
+ *
493
+ * @description
494
+ * When `query` is empty we honour the `group` field on each command
495
+ * — commands without a group fall in a leading default bucket.
496
+ * When the query is non-empty we keep the fuzzy ranking flat
497
+ * (groups would conflict with score-based ordering).
498
+ ********************************************************/
285
499
  const groupedResults = computed(() => {
286
- if (query.value.trim().length > 0) {
287
- return [{ label: null, items: filtered.value }];
288
- }
289
- const buckets = /* @__PURE__ */ new Map();
290
- const order = [];
291
- filtered.value.forEach((entry) => {
292
- const key = entry.item.group ?? null;
293
- if (!buckets.has(key)) {
294
- buckets.set(key, []);
295
- order.push(key);
296
- }
297
- buckets.get(key).push(entry);
298
- });
299
- return order.map((key) => ({
300
- label: key,
301
- items: buckets.get(key) ?? []
302
- }));
500
+ if (query.value.trim().length > 0) {
501
+ // Flat view when ranked.
502
+ return [{
503
+ label: null,
504
+ items: filtered.value
505
+ }];
506
+ }
507
+ const buckets = new Map();
508
+ const order = [];
509
+ filtered.value.forEach((entry) => {
510
+ const key = entry.item.group ?? null;
511
+ if (!buckets.has(key)) {
512
+ buckets.set(key, []);
513
+ order.push(key);
514
+ }
515
+ buckets.get(key).push(entry);
516
+ });
517
+ return order.map((key) => ({
518
+ label: key,
519
+ items: buckets.get(key) ?? []
520
+ }));
303
521
  });
522
+ /*********************************************************
523
+ * Active selection (keyboard cursor)
524
+ ********************************************************/
304
525
  const flatResults = computed(() => {
305
- const flat = [];
306
- groupedResults.value.forEach((g) => {
307
- g.items.forEach((entry) => flat.push(entry.item));
308
- });
309
- return flat;
526
+ const flat = [];
527
+ groupedResults.value.forEach((g) => {
528
+ g.items.forEach((entry) => flat.push(entry.item));
529
+ });
530
+ return flat;
310
531
  });
311
532
  const activeIndex = ref(0);
312
533
  const activeCommandId = computed(() => {
313
- return flatResults.value[activeIndex.value]?.id;
534
+ return flatResults.value[activeIndex.value]?.id;
314
535
  });
315
536
  const activeOptionId = computed(() => {
316
- if (!activeCommandId.value) return void 0;
317
- return optionDomId(activeCommandId.value);
537
+ if (!activeCommandId.value) return undefined;
538
+ return optionDomId(activeCommandId.value);
318
539
  });
319
540
  function optionDomId(commandId) {
320
- return `origam-command-palette-option-${uid}-${commandId}`;
541
+ return `origam-command-palette-option-${uid}-${commandId}`;
321
542
  }
543
+ // Reset the active cursor whenever the result set changes — keeps
544
+ // the highlight on the first match instead of pointing past the
545
+ // end of a shorter list.
322
546
  watch(filtered, () => {
323
- activeIndex.value = 0;
324
- nextTick(() => scrollActiveIntoView());
547
+ activeIndex.value = 0;
548
+ nextTick(() => scrollActiveIntoView());
325
549
  });
326
550
  function moveActive(delta) {
327
- const len = flatResults.value.length;
328
- if (len === 0) return;
329
- let next = activeIndex.value;
330
- for (let i = 0; i < len; i++) {
331
- next = (next + delta + len) % len;
332
- if (!flatResults.value[next].disabled) break;
333
- }
334
- activeIndex.value = next;
335
- nextTick(() => scrollActiveIntoView());
551
+ const len = flatResults.value.length;
552
+ if (len === 0) return;
553
+ // Skip disabled commands — they cannot be activated.
554
+ let next = activeIndex.value;
555
+ for (let i = 0; i < len; i++) {
556
+ next = (next + delta + len) % len;
557
+ if (!flatResults.value[next].disabled) break;
558
+ }
559
+ activeIndex.value = next;
560
+ nextTick(() => scrollActiveIntoView());
336
561
  }
337
562
  function scrollActiveIntoView() {
338
- if (!IN_BROWSER) return;
339
- const id = activeCommandId.value;
340
- if (!id) return;
341
- const el = document.getElementById(optionDomId(id));
342
- el?.scrollIntoView({ block: "nearest" });
563
+ if (!IN_BROWSER) return;
564
+ const id = activeCommandId.value;
565
+ if (!id) return;
566
+ const el = document.getElementById(optionDomId(id));
567
+ el?.scrollIntoView({ block: "nearest" });
343
568
  }
569
+ /*********************************************************
570
+ * Selection
571
+ ********************************************************/
344
572
  async function selectCommand(cmd) {
345
- if (cmd.disabled) return;
346
- emit("select", cmd);
347
- try {
348
- await cmd.perform();
349
- } finally {
350
- if (props.closeOnSelect) {
351
- isActive.value = false;
352
- }
353
- }
573
+ if (cmd.disabled) return;
574
+ emit("select", cmd);
575
+ try {
576
+ await cmd.perform();
577
+ } finally {
578
+ if (props.closeOnSelect) {
579
+ isActive.value = false;
580
+ }
581
+ }
354
582
  }
355
583
  function handleItemClick(cmd) {
356
- void selectCommand(cmd);
584
+ void selectCommand(cmd);
357
585
  }
358
586
  function handleItemHover(cmd) {
359
- const idx = flatResults.value.findIndex((item) => item.id === cmd.id);
360
- if (idx !== -1) activeIndex.value = idx;
587
+ const idx = flatResults.value.findIndex((item) => item.id === cmd.id);
588
+ if (idx !== -1) activeIndex.value = idx;
361
589
  }
362
590
  function handleEnter() {
363
- const cmd = flatResults.value[activeIndex.value];
364
- if (cmd) void selectCommand(cmd);
591
+ const cmd = flatResults.value[activeIndex.value];
592
+ if (cmd) void selectCommand(cmd);
365
593
  }
366
594
  function handleEscape() {
367
- if (props.closeOnEscape) isActive.value = false;
595
+ if (props.closeOnEscape) isActive.value = false;
368
596
  }
369
597
  function handleBackdropClick() {
370
- if (props.closeOnBackdrop) isActive.value = false;
598
+ if (props.closeOnBackdrop) isActive.value = false;
371
599
  }
372
600
  function handleKeydown(e) {
373
- if (e.key === "Tab") {
374
- e.preventDefault();
375
- inputRef.value?.focus();
376
- }
601
+ // Tab key — focus trap. There is nothing else inside the dialog
602
+ // after the input + options + footer slot, so we keep focus on
603
+ // the input element so the user can keep typing.
604
+ if (e.key === "Tab") {
605
+ e.preventDefault();
606
+ inputRef.value?.focus();
607
+ }
377
608
  }
378
609
  function handleInput() {
379
- emit("query", query.value);
610
+ emit("query", query.value);
380
611
  }
612
+ /*********************************************************
613
+ * Focus management — restore the previously focused element on close.
614
+ ********************************************************/
381
615
  let returnFocusEl = null;
382
616
  watch(isActive, async (next) => {
383
- if (next) {
384
- if (IN_BROWSER) {
385
- returnFocusEl = document.activeElement;
386
- }
387
- query.value = "";
388
- activeIndex.value = 0;
389
- await nextTick();
390
- inputRef.value?.focus({ preventScroll: true });
391
- } else {
392
- returnFocusEl?.focus?.({ preventScroll: true });
393
- returnFocusEl = null;
394
- }
617
+ if (next) {
618
+ if (IN_BROWSER) {
619
+ returnFocusEl = document.activeElement;
620
+ }
621
+ query.value = "";
622
+ activeIndex.value = 0;
623
+ await nextTick();
624
+ inputRef.value?.focus({ preventScroll: true });
625
+ } else {
626
+ returnFocusEl?.focus?.({ preventScroll: true });
627
+ returnFocusEl = null;
628
+ }
395
629
  });
630
+ /*********************************************************
631
+ * Footer fallback strings
632
+ *
633
+ * @description
634
+ * Les trois indices du pied de palette passent par `t()` (#764, C8).
635
+ * `closeText` REUTILISE la cle generique `origam.close` deja livree
636
+ * dans les deux locales plutot que d'en creer une quatrieme : c'est
637
+ * le meme mot, dans le meme sens, en anglais comme en francais.
638
+ * `navigate` / `select` n'avaient pas d'equivalent existant et
639
+ * vivent dans l'espace de noms du composant.
640
+ ********************************************************/
396
641
  const navigateText = computed(() => t("origam.command_palette.footer_navigate"));
397
642
  const selectText = computed(() => t("origam.command_palette.footer_select"));
398
643
  const closeText = computed(() => t("origam.close"));
399
644
  const hasDefaultFooter = computed(() => true);
645
+ /*********************************************************
646
+ * Typography
647
+ *
648
+ * @description
649
+ * Two BEM surfaces consume a font-size token:
650
+ * __group-title → --origam-command-palette__group-title---font-size
651
+ * __input → --origam-command-palette__input---font-size
652
+ * Both are driven by the same `fontSize` prop (ITypographyProps).
653
+ * Other typography props (fontWeight, letterSpacing, …) emit their
654
+ * CSS vars but the SCSS does not read them on either surface — they
655
+ * have no visual effect and are not exposed in the story controls.
656
+ ********************************************************/
400
657
  const { typographyStyles: groupTitleTypographyStyles } = useTypography(props, "command-palette__group-title");
401
658
  const { typographyStyles: inputTypographyStyles } = useTypography(props, "command-palette__input");
659
+ /*********************************************************
660
+ * Class & Style
661
+ ********************************************************/
402
662
  function itemClasses(cmd) {
403
- return [
404
- "origam-command-palette__item",
405
- {
406
- "origam-command-palette__item--active": cmd.id === activeCommandId.value,
407
- "origam-command-palette__item--disabled": cmd.disabled
408
- }
409
- ];
663
+ return ["origam-command-palette__item", {
664
+ "origam-command-palette__item--active": cmd.id === activeCommandId.value,
665
+ "origam-command-palette__item--disabled": cmd.disabled
666
+ }];
410
667
  }
411
668
  function toUnit(value) {
412
- if (value === void 0) return void 0;
413
- if (typeof value === "number") return `${value}px`;
414
- return value;
669
+ if (value === undefined) return undefined;
670
+ if (typeof value === "number") return `${value}px`;
671
+ return value;
415
672
  }
416
673
  const rootClasses = computed(() => {
417
- return [
418
- "origam-command-palette",
419
- props.class
420
- ];
674
+ return ["origam-command-palette", props.class];
421
675
  });
422
676
  const rootStyles = computed(() => {
423
- return [props.style];
677
+ return [props.style];
424
678
  });
425
679
  const dialogClasses = computed(() => {
426
- return ["origam-command-palette__dialog"];
680
+ return ["origam-command-palette__dialog"];
427
681
  });
428
682
  const dialogStyles = computed(() => {
429
- return [
430
- { "--origam-command-palette---width": toUnit(props.width) }
431
- ];
683
+ return [{ "--origam-command-palette---width": toUnit(props.width) }];
432
684
  });
433
685
  const listStyles = computed(() => {
434
- return [
435
- { "--origam-command-palette---max-height": toUnit(props.maxHeight) }
436
- ];
686
+ return [{ "--origam-command-palette---max-height": toUnit(props.maxHeight) }];
437
687
  });
688
+ /*********************************************************
689
+ * Expose
690
+ ********************************************************/
438
691
  defineExpose({
439
- query,
440
- filtered,
441
- activeIndex,
442
- isActive
692
+ query,
693
+ filtered,
694
+ activeIndex,
695
+ isActive
443
696
  });
444
697
  </script>
445
698