origam 2.38.0 → 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 +34 -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 +8 -8
@@ -195,379 +195,1048 @@ import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
195
195
  import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
196
196
  import { VARIANT } from "../../enums/Commons/variant.enum";
197
197
  import { createRange, int } from "../../utils/Commons/commons.util";
198
+ /*********************************************************
199
+ * Global
200
+ *
201
+ * @description
202
+ * Props, emits and filterProps for the Pagination component.
203
+ ********************************************************/
198
204
  const props = defineProps({
199
- start: { type: Number, required: false, default: 1 },
200
- modelValue: { type: Number, required: false },
201
- disabled: { type: Boolean, required: false },
202
- length: { type: [Number, String], required: false, default: 1 },
203
- totalVisible: { type: [Number, String], required: false },
204
- firstIcon: { type: null, required: false, default: MDI_ICONS.CHEVRON_DOUBLE_LEFT },
205
- prevIcon: { type: null, required: false, default: MDI_ICONS.CHEVRON_LEFT },
206
- nextIcon: { type: null, required: false, default: MDI_ICONS.CHEVRON_RIGHT },
207
- lastIcon: { type: null, required: false, default: MDI_ICONS.CHEVRON_DOUBLE_RIGHT },
208
- ariaLabel: { type: String, required: false, default: "origam.pagination.aria_label.root" },
209
- pageAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.page" },
210
- currentPageAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.current_page" },
211
- firstAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.first" },
212
- previousAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.previous" },
213
- nextAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.next" },
214
- lastAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.last" },
215
- ellipsis: { type: String, required: false, default: "..." },
216
- showFirstLastPage: { type: Boolean, required: false },
217
- compact: { type: Boolean, required: false, default: false },
218
- pageText: { type: String, required: false, default: "origam.pagination.page" },
219
- ofText: { type: String, required: false, default: "origam.pagination.of" },
220
- withInfo: { type: Boolean, required: false, default: false },
221
- total: { type: [Number, String], required: false },
222
- perPage: { type: [Number, String], required: false, default: 10 },
223
- infoText: { type: String, required: false, default: "origam.pagination.info" },
224
- previousText: { type: String, required: false },
225
- nextText: { type: String, required: false },
226
- pageNumberAriaLabel: { type: String, required: false, default: "origam.pagination.aria_label.page_number" },
227
- id: { type: String, required: false },
228
- class: { type: [String, Array, Object], required: false },
229
- style: { type: [String, Array, Object, Boolean, null], required: false, skipCheck: true },
230
- tag: { type: String, required: false, default: "nav" },
231
- color: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
232
- bgColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
233
- border: { type: [Boolean, Number, String, Array], required: false, skipCheck: true },
234
- borderTop: { type: [Boolean, Number, String], required: false },
235
- borderLeft: { type: [Boolean, Number, String], required: false },
236
- borderBottom: { type: [Boolean, Number, String], required: false },
237
- borderRight: { type: [Boolean, Number, String], required: false },
238
- borderBlock: { type: [Boolean, Number, String], required: false },
239
- borderInline: { type: [Boolean, Number, String], required: false },
240
- borderInlineStart: { type: [Boolean, Number, String], required: false },
241
- borderInlineEnd: { type: [Boolean, Number, String], required: false },
242
- borderBlockStart: { type: [Boolean, Number, String], required: false },
243
- borderBlockEnd: { type: [Boolean, Number, String], required: false },
244
- borderColor: { type: String, required: false },
245
- borderStyle: { type: String, required: false },
246
- borderTopColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
247
- borderRightColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
248
- borderBottomColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
249
- borderLeftColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
250
- borderInlineStartColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
251
- borderInlineEndColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
252
- borderBlockStartColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
253
- borderBlockEndColor: { type: [String, Object, Boolean, null], required: false, skipCheck: true },
254
- padding: { type: [Boolean, Number, String], required: false },
255
- paddingTop: { type: [Boolean, Number, String], required: false },
256
- paddingLeft: { type: [Boolean, Number, String], required: false },
257
- paddingBottom: { type: [Boolean, Number, String], required: false },
258
- paddingRight: { type: [Boolean, Number, String], required: false },
259
- paddingBlock: { type: [Boolean, Number, String], required: false },
260
- paddingInline: { type: [Boolean, Number, String], required: false },
261
- paddingInlineStart: { type: [Boolean, Number, String], required: false },
262
- paddingInlineEnd: { type: [Boolean, Number, String], required: false },
263
- paddingBlockStart: { type: [Boolean, Number, String], required: false },
264
- paddingBlockEnd: { type: [Boolean, Number, String], required: false },
265
- margin: { type: [Boolean, Number, String], required: false },
266
- marginTop: { type: [Boolean, Number, String], required: false },
267
- marginLeft: { type: [Boolean, Number, String], required: false },
268
- marginBottom: { type: [Boolean, Number, String], required: false },
269
- marginRight: { type: [Boolean, Number, String], required: false },
270
- marginBlock: { type: [Boolean, Number, String], required: false },
271
- marginInline: { type: [Boolean, Number, String], required: false },
272
- marginInlineStart: { type: [Boolean, Number, String], required: false },
273
- marginInlineEnd: { type: [Boolean, Number, String], required: false },
274
- marginBlockStart: { type: [Boolean, Number, String], required: false },
275
- marginBlockEnd: { type: [Boolean, Number, String], required: false },
276
- elevation: { type: [Number, String], required: false },
277
- size: { type: null, required: false },
278
- density: { type: null, required: false },
279
- fontSize: { type: null, required: false },
280
- fontWeight: { type: null, required: false }
205
+ start: {
206
+ type: Number,
207
+ required: false,
208
+ default: 1
209
+ },
210
+ modelValue: {
211
+ type: Number,
212
+ required: false
213
+ },
214
+ disabled: {
215
+ type: Boolean,
216
+ required: false
217
+ },
218
+ length: {
219
+ type: [Number, String],
220
+ required: false,
221
+ default: 1
222
+ },
223
+ totalVisible: {
224
+ type: [Number, String],
225
+ required: false
226
+ },
227
+ firstIcon: {
228
+ type: null,
229
+ required: false,
230
+ default: MDI_ICONS.CHEVRON_DOUBLE_LEFT
231
+ },
232
+ prevIcon: {
233
+ type: null,
234
+ required: false,
235
+ default: MDI_ICONS.CHEVRON_LEFT
236
+ },
237
+ nextIcon: {
238
+ type: null,
239
+ required: false,
240
+ default: MDI_ICONS.CHEVRON_RIGHT
241
+ },
242
+ lastIcon: {
243
+ type: null,
244
+ required: false,
245
+ default: MDI_ICONS.CHEVRON_DOUBLE_RIGHT
246
+ },
247
+ ariaLabel: {
248
+ type: String,
249
+ required: false,
250
+ default: "origam.pagination.aria_label.root"
251
+ },
252
+ pageAriaLabel: {
253
+ type: String,
254
+ required: false,
255
+ default: "origam.pagination.aria_label.page"
256
+ },
257
+ currentPageAriaLabel: {
258
+ type: String,
259
+ required: false,
260
+ default: "origam.pagination.aria_label.current_page"
261
+ },
262
+ firstAriaLabel: {
263
+ type: String,
264
+ required: false,
265
+ default: "origam.pagination.aria_label.first"
266
+ },
267
+ previousAriaLabel: {
268
+ type: String,
269
+ required: false,
270
+ default: "origam.pagination.aria_label.previous"
271
+ },
272
+ nextAriaLabel: {
273
+ type: String,
274
+ required: false,
275
+ default: "origam.pagination.aria_label.next"
276
+ },
277
+ lastAriaLabel: {
278
+ type: String,
279
+ required: false,
280
+ default: "origam.pagination.aria_label.last"
281
+ },
282
+ ellipsis: {
283
+ type: String,
284
+ required: false,
285
+ default: "..."
286
+ },
287
+ showFirstLastPage: {
288
+ type: Boolean,
289
+ required: false
290
+ },
291
+ compact: {
292
+ type: Boolean,
293
+ required: false,
294
+ default: false
295
+ },
296
+ pageText: {
297
+ type: String,
298
+ required: false,
299
+ default: "origam.pagination.page"
300
+ },
301
+ ofText: {
302
+ type: String,
303
+ required: false,
304
+ default: "origam.pagination.of"
305
+ },
306
+ withInfo: {
307
+ type: Boolean,
308
+ required: false,
309
+ default: false
310
+ },
311
+ total: {
312
+ type: [Number, String],
313
+ required: false
314
+ },
315
+ perPage: {
316
+ type: [Number, String],
317
+ required: false,
318
+ default: 10
319
+ },
320
+ infoText: {
321
+ type: String,
322
+ required: false,
323
+ default: "origam.pagination.info"
324
+ },
325
+ previousText: {
326
+ type: String,
327
+ required: false
328
+ },
329
+ nextText: {
330
+ type: String,
331
+ required: false
332
+ },
333
+ pageNumberAriaLabel: {
334
+ type: String,
335
+ required: false,
336
+ default: "origam.pagination.aria_label.page_number"
337
+ },
338
+ id: {
339
+ type: String,
340
+ required: false
341
+ },
342
+ class: {
343
+ type: [
344
+ String,
345
+ Array,
346
+ Object
347
+ ],
348
+ required: false
349
+ },
350
+ style: {
351
+ type: [
352
+ String,
353
+ Array,
354
+ Object,
355
+ Boolean,
356
+ null
357
+ ],
358
+ required: false,
359
+ skipCheck: true
360
+ },
361
+ tag: {
362
+ type: String,
363
+ required: false,
364
+ default: "nav"
365
+ },
366
+ color: {
367
+ type: [
368
+ String,
369
+ Object,
370
+ Boolean,
371
+ null
372
+ ],
373
+ required: false,
374
+ skipCheck: true
375
+ },
376
+ bgColor: {
377
+ type: [
378
+ String,
379
+ Object,
380
+ Boolean,
381
+ null
382
+ ],
383
+ required: false,
384
+ skipCheck: true
385
+ },
386
+ border: {
387
+ type: [
388
+ Boolean,
389
+ Number,
390
+ String,
391
+ Array
392
+ ],
393
+ required: false,
394
+ skipCheck: true
395
+ },
396
+ borderTop: {
397
+ type: [
398
+ Boolean,
399
+ Number,
400
+ String
401
+ ],
402
+ required: false
403
+ },
404
+ borderLeft: {
405
+ type: [
406
+ Boolean,
407
+ Number,
408
+ String
409
+ ],
410
+ required: false
411
+ },
412
+ borderBottom: {
413
+ type: [
414
+ Boolean,
415
+ Number,
416
+ String
417
+ ],
418
+ required: false
419
+ },
420
+ borderRight: {
421
+ type: [
422
+ Boolean,
423
+ Number,
424
+ String
425
+ ],
426
+ required: false
427
+ },
428
+ borderBlock: {
429
+ type: [
430
+ Boolean,
431
+ Number,
432
+ String
433
+ ],
434
+ required: false
435
+ },
436
+ borderInline: {
437
+ type: [
438
+ Boolean,
439
+ Number,
440
+ String
441
+ ],
442
+ required: false
443
+ },
444
+ borderInlineStart: {
445
+ type: [
446
+ Boolean,
447
+ Number,
448
+ String
449
+ ],
450
+ required: false
451
+ },
452
+ borderInlineEnd: {
453
+ type: [
454
+ Boolean,
455
+ Number,
456
+ String
457
+ ],
458
+ required: false
459
+ },
460
+ borderBlockStart: {
461
+ type: [
462
+ Boolean,
463
+ Number,
464
+ String
465
+ ],
466
+ required: false
467
+ },
468
+ borderBlockEnd: {
469
+ type: [
470
+ Boolean,
471
+ Number,
472
+ String
473
+ ],
474
+ required: false
475
+ },
476
+ borderColor: {
477
+ type: String,
478
+ required: false
479
+ },
480
+ borderStyle: {
481
+ type: String,
482
+ required: false
483
+ },
484
+ borderTopColor: {
485
+ type: [
486
+ String,
487
+ Object,
488
+ Boolean,
489
+ null
490
+ ],
491
+ required: false,
492
+ skipCheck: true
493
+ },
494
+ borderRightColor: {
495
+ type: [
496
+ String,
497
+ Object,
498
+ Boolean,
499
+ null
500
+ ],
501
+ required: false,
502
+ skipCheck: true
503
+ },
504
+ borderBottomColor: {
505
+ type: [
506
+ String,
507
+ Object,
508
+ Boolean,
509
+ null
510
+ ],
511
+ required: false,
512
+ skipCheck: true
513
+ },
514
+ borderLeftColor: {
515
+ type: [
516
+ String,
517
+ Object,
518
+ Boolean,
519
+ null
520
+ ],
521
+ required: false,
522
+ skipCheck: true
523
+ },
524
+ borderInlineStartColor: {
525
+ type: [
526
+ String,
527
+ Object,
528
+ Boolean,
529
+ null
530
+ ],
531
+ required: false,
532
+ skipCheck: true
533
+ },
534
+ borderInlineEndColor: {
535
+ type: [
536
+ String,
537
+ Object,
538
+ Boolean,
539
+ null
540
+ ],
541
+ required: false,
542
+ skipCheck: true
543
+ },
544
+ borderBlockStartColor: {
545
+ type: [
546
+ String,
547
+ Object,
548
+ Boolean,
549
+ null
550
+ ],
551
+ required: false,
552
+ skipCheck: true
553
+ },
554
+ borderBlockEndColor: {
555
+ type: [
556
+ String,
557
+ Object,
558
+ Boolean,
559
+ null
560
+ ],
561
+ required: false,
562
+ skipCheck: true
563
+ },
564
+ padding: {
565
+ type: [
566
+ Boolean,
567
+ Number,
568
+ String
569
+ ],
570
+ required: false
571
+ },
572
+ paddingTop: {
573
+ type: [
574
+ Boolean,
575
+ Number,
576
+ String
577
+ ],
578
+ required: false
579
+ },
580
+ paddingLeft: {
581
+ type: [
582
+ Boolean,
583
+ Number,
584
+ String
585
+ ],
586
+ required: false
587
+ },
588
+ paddingBottom: {
589
+ type: [
590
+ Boolean,
591
+ Number,
592
+ String
593
+ ],
594
+ required: false
595
+ },
596
+ paddingRight: {
597
+ type: [
598
+ Boolean,
599
+ Number,
600
+ String
601
+ ],
602
+ required: false
603
+ },
604
+ paddingBlock: {
605
+ type: [
606
+ Boolean,
607
+ Number,
608
+ String
609
+ ],
610
+ required: false
611
+ },
612
+ paddingInline: {
613
+ type: [
614
+ Boolean,
615
+ Number,
616
+ String
617
+ ],
618
+ required: false
619
+ },
620
+ paddingInlineStart: {
621
+ type: [
622
+ Boolean,
623
+ Number,
624
+ String
625
+ ],
626
+ required: false
627
+ },
628
+ paddingInlineEnd: {
629
+ type: [
630
+ Boolean,
631
+ Number,
632
+ String
633
+ ],
634
+ required: false
635
+ },
636
+ paddingBlockStart: {
637
+ type: [
638
+ Boolean,
639
+ Number,
640
+ String
641
+ ],
642
+ required: false
643
+ },
644
+ paddingBlockEnd: {
645
+ type: [
646
+ Boolean,
647
+ Number,
648
+ String
649
+ ],
650
+ required: false
651
+ },
652
+ margin: {
653
+ type: [
654
+ Boolean,
655
+ Number,
656
+ String
657
+ ],
658
+ required: false
659
+ },
660
+ marginTop: {
661
+ type: [
662
+ Boolean,
663
+ Number,
664
+ String
665
+ ],
666
+ required: false
667
+ },
668
+ marginLeft: {
669
+ type: [
670
+ Boolean,
671
+ Number,
672
+ String
673
+ ],
674
+ required: false
675
+ },
676
+ marginBottom: {
677
+ type: [
678
+ Boolean,
679
+ Number,
680
+ String
681
+ ],
682
+ required: false
683
+ },
684
+ marginRight: {
685
+ type: [
686
+ Boolean,
687
+ Number,
688
+ String
689
+ ],
690
+ required: false
691
+ },
692
+ marginBlock: {
693
+ type: [
694
+ Boolean,
695
+ Number,
696
+ String
697
+ ],
698
+ required: false
699
+ },
700
+ marginInline: {
701
+ type: [
702
+ Boolean,
703
+ Number,
704
+ String
705
+ ],
706
+ required: false
707
+ },
708
+ marginInlineStart: {
709
+ type: [
710
+ Boolean,
711
+ Number,
712
+ String
713
+ ],
714
+ required: false
715
+ },
716
+ marginInlineEnd: {
717
+ type: [
718
+ Boolean,
719
+ Number,
720
+ String
721
+ ],
722
+ required: false
723
+ },
724
+ marginBlockStart: {
725
+ type: [
726
+ Boolean,
727
+ Number,
728
+ String
729
+ ],
730
+ required: false
731
+ },
732
+ marginBlockEnd: {
733
+ type: [
734
+ Boolean,
735
+ Number,
736
+ String
737
+ ],
738
+ required: false
739
+ },
740
+ elevation: {
741
+ type: [Number, String],
742
+ required: false
743
+ },
744
+ size: {
745
+ type: null,
746
+ required: false
747
+ },
748
+ density: {
749
+ type: null,
750
+ required: false
751
+ },
752
+ fontSize: {
753
+ type: null,
754
+ required: false
755
+ },
756
+ fontWeight: {
757
+ type: null,
758
+ required: false
759
+ }
281
760
  });
282
- const emits = defineEmits(["first", "prev", "next", "last", "update:modelValue"]);
761
+ const emits = defineEmits([
762
+ "first",
763
+ "prev",
764
+ "next",
765
+ "last",
766
+ "update:modelValue"
767
+ ]);
283
768
  defineSlots();
284
769
  const { filterProps } = useProps(props);
285
770
  const { t } = useLocale();
771
+ /*********************************************************
772
+ * Value
773
+ *
774
+ * @description
775
+ * page is the controlled current-page number.
776
+ * width / maxButtons support the responsive total-visible calculation.
777
+ * The uncontrolled seed is passed as `() => props.start`, not
778
+ * `props.start` (#448): a plain read right here, in the setup body,
779
+ * would freeze the pre-theme value, since `useVModel` runs before the
780
+ * ADR-005 theme-props resolver patches `instance.props`. The getter
781
+ * form defers the read to `useVModel`'s internal `seed()`, which only
782
+ * runs on first actual access — after the resolver has already run.
783
+ ********************************************************/
784
+ /*********************************************************
785
+ * Page
786
+ *
787
+ * @description
788
+ * `modelValue` n'a plus de defaut (#640) pour que le repli vers `start`
789
+ * soit atteignable. Son type devient donc `number | undefined`, alors
790
+ * qu'au runtime `start` (defaut 1) garantit toujours une valeur.
791
+ * `transformIn` rend cette garantie EXPLICITE a l'execution plutot que
792
+ * de la masquer par un cast, qui aurait eteint le rouge de vue-tsc sans
793
+ * repondre a la question.
794
+ ********************************************************/
286
795
  const page = useVModel(props, "modelValue", () => props.start, (v) => v ?? props.start);
796
+ /*********************************************************
797
+ * Composables
798
+ ********************************************************/
287
799
  const { width } = useDisplay();
288
800
  const maxButtons = shallowRef(-1);
289
801
  const { resizeRef } = useResizeObserver((entries) => {
290
- if (!entries.length) return;
291
- const { target, contentRect } = entries[0];
292
- const firstItem = target.querySelector(".origam-pagination__list > *");
293
- if (!firstItem) return;
294
- const totalWidth = contentRect.width;
295
- const itemWidth = firstItem.offsetWidth + parseFloat(getComputedStyle(firstItem).marginRight) * 2;
296
- maxButtons.value = getMax(totalWidth, itemWidth);
802
+ if (!entries.length) return;
803
+ const { target, contentRect } = entries[0];
804
+ const firstItem = target.querySelector(".origam-pagination__list > *");
805
+ if (!firstItem) return;
806
+ const totalWidth = contentRect.width;
807
+ const itemWidth = firstItem.offsetWidth + parseFloat(getComputedStyle(firstItem).marginRight) * 2;
808
+ maxButtons.value = getMax(totalWidth, itemWidth);
297
809
  });
298
810
  const { refs, updateRef } = useRefs();
811
+ /*********************************************************
812
+ * Range & items
813
+ *
814
+ * @description
815
+ * length / start are int-coerced copies of the props.
816
+ * totalVisible computes how many page buttons fit.
817
+ * range produces the raw sequence (numbers + ellipsis strings).
818
+ * sharedBtnColorProps / controlColorProps forward the uniform six-field
819
+ * IColorProps contract to every btn in the row so `color`/`bgColor`
820
+ * changes repaint them all simultaneously.
821
+ * items maps range to the full button prop objects.
822
+ * controls produces the first/prev/next/last button prop objects.
823
+ ********************************************************/
299
824
  const length = computed(() => {
300
- return int(props.length);
825
+ return int(props.length);
301
826
  });
302
827
  const start = computed(() => {
303
- return int(props.start);
828
+ return int(props.start);
304
829
  });
305
830
  const totalVisible = computed(() => {
306
- if (props.totalVisible != null) {
307
- return int(props.totalVisible);
308
- }
309
- if (maxButtons.value >= 0) {
310
- return maxButtons.value;
311
- }
312
- return getMax(width.value, 58);
831
+ if (props.totalVisible != null) {
832
+ return int(props.totalVisible);
833
+ }
834
+ if (maxButtons.value >= 0) {
835
+ return maxButtons.value;
836
+ }
837
+ return getMax(width.value, 58);
313
838
  });
314
839
  const range = computed(() => {
315
- if (length.value <= 0 || isNaN(length.value) || length.value > Number.MAX_SAFE_INTEGER) return [];
316
- if (props.withInfo) {
317
- return [page.value];
318
- }
319
- if (totalVisible.value <= 0) return [];
320
- else if (totalVisible.value === 1) return [page.value];
321
- if (length.value <= totalVisible.value) {
322
- return createRange(length.value, start.value);
323
- }
324
- const even = totalVisible.value % 2 === 0;
325
- const middle = even ? totalVisible.value / 2 : Math.floor(totalVisible.value / 2);
326
- const left = even ? middle : middle + 1;
327
- const right = length.value - middle;
328
- if (left - page.value >= 0) {
329
- return [...createRange(Math.max(1, totalVisible.value - 1), start.value), props.ellipsis, length.value];
330
- } else if (page.value - right >= (even ? 1 : 0)) {
331
- const rangeLength = totalVisible.value - 1;
332
- const rangeStart = length.value - rangeLength + start.value;
333
- return [start.value, props.ellipsis, ...createRange(rangeLength, rangeStart)];
334
- } else {
335
- const rangeLength = Math.max(1, totalVisible.value - 3);
336
- const rangeStart = rangeLength === 1 ? page.value : page.value - Math.ceil(rangeLength / 2) + start.value;
337
- return [start.value, props.ellipsis, ...createRange(rangeLength, rangeStart), props.ellipsis, length.value];
338
- }
840
+ if (length.value <= 0 || isNaN(length.value) || length.value > Number.MAX_SAFE_INTEGER) return [];
841
+ // `withInfo` mode collapses the page-number row to just the
842
+ // current page button — the spec (PDF: WITH INFO) shows a
843
+ // single page indicator between the Prev / Next text buttons,
844
+ // since the `Showing N–M of total` label on the left already
845
+ // expresses position within the range. Pre-fix this rendered
846
+ // the full numbered list, drowning the simpler info layout.
847
+ if (props.withInfo) {
848
+ return [page.value];
849
+ }
850
+ if (totalVisible.value <= 0) return [];
851
+ else if (totalVisible.value === 1) return [page.value];
852
+ if (length.value <= totalVisible.value) {
853
+ return createRange(length.value, start.value);
854
+ }
855
+ const even = totalVisible.value % 2 === 0;
856
+ const middle = even ? totalVisible.value / 2 : Math.floor(totalVisible.value / 2);
857
+ const left = even ? middle : middle + 1;
858
+ const right = length.value - middle;
859
+ if (left - page.value >= 0) {
860
+ return [
861
+ ...createRange(Math.max(1, totalVisible.value - 1), start.value),
862
+ props.ellipsis,
863
+ length.value
864
+ ];
865
+ } else if (page.value - right >= (even ? 1 : 0)) {
866
+ const rangeLength = totalVisible.value - 1;
867
+ const rangeStart = length.value - rangeLength + start.value;
868
+ return [
869
+ start.value,
870
+ props.ellipsis,
871
+ ...createRange(rangeLength, rangeStart)
872
+ ];
873
+ } else {
874
+ const rangeLength = Math.max(1, totalVisible.value - 3);
875
+ const rangeStart = rangeLength === 1 ? page.value : page.value - Math.ceil(rangeLength / 2) + start.value;
876
+ return [
877
+ start.value,
878
+ props.ellipsis,
879
+ ...createRange(rangeLength, rangeStart),
880
+ props.ellipsis,
881
+ length.value
882
+ ];
883
+ }
339
884
  });
885
+ // Uniform color contract — every btn in the row (page items 1..n,
886
+ // the ellipsis, AND first / prev / next / last) receives the SAME
887
+ // six IColorProps fields. Changing `color` repaints every text/icon,
888
+ // changing `bgColor` repaints every surface, hover/active rungs
889
+ // work identically. The active item differentiates itself via
890
+ // `active: true` only; a disabled btn shows its standard --disabled
891
+ // veil (Btn's opacity rule), nothing intent-specific.
892
+ // User report: "putain pourquoi tous les btn ne sont pas gérés de
893
+ // la même manière sur la pagination ; je change la couleur, tous
894
+ // les btns voient leur couleur changer ; etc."
340
895
  const sharedBtnColorProps = computed(() => {
341
- const baseBg = props.bgColor || props.color;
342
- return {
343
- // In colored mode force `flat` so the btn actually PAINTS the
344
- // pagination-driven `--origam-btn---background-color`. The theme's
345
- // default `text` variant sets `background-color: transparent
346
- // !important`, which would otherwise swallow the colored fill. When
347
- // no color is set, leave `variant` undefined → the neutral text look.
348
- variant: baseBg ? VARIANT.FLAT : void 0,
349
- color: props.color,
350
- bgColor: baseBg,
351
- // Size / density flow through to every nav btn so the whole row
352
- // scales consistently — matches the PDF spec which shows the
353
- // pagination at sm / default / lg sizes (no per-btn override).
354
- size: props.size,
355
- density: props.density
356
- };
896
+ // ── Surface / text contrast synthesis (colored mode) ──────────
897
+ // In `--colored` mode the pagination paints the inner btn's
898
+ // surface via the SCSS `--bg-base` CSS var — useStateEffect on
899
+ // the inner btn doesn't see the bg side of the contract because
900
+ // the consumer didn't necessarily pass `bgColor` to the
901
+ // pagination root. Without that info, the btn's fg resolves to
902
+ // `tokenForegroundForIntent(color)` = the same-hue subtle rung
903
+ // (e.g. primary.fgSubtle = primary.700 — dark violet on a
904
+ // primary.500 surface, the very "violet-on-violet" the user
905
+ // just spotted on screen).
906
+ //
907
+ // Synthesise bgColor = color when the consumer only specified
908
+ // `color`: the inner btn's useStateEffect then detects the
909
+ // color-clash (`color === bgColor` both intents) and swaps fg
910
+ // to the bg's paired contrast token (primary.fg = white). The
911
+ // JS-side bg is the same intent the SCSS already paints, so the
912
+ // inline declaration is harmless (same value), and the fg now
913
+ // wins by virtue of being on the same axis as the synthesised
914
+ // bg.
915
+ // NB: `TColor = string | false | null | undefined`, and Vue's
916
+ // defineProps emits `false` (not `undefined`) when a TColor prop
917
+ // is omitted. We MUST use `||` (truthy fallback), NOT `??`
918
+ // (nullish only) — `false ?? "primary"` keeps `false` and the
919
+ // synthesis silently no-ops, while `false || "primary"` falls
920
+ // through to the consumer's chosen intent as intended.
921
+ //
922
+ // hover / active are NOT forwarded here: the inner `<OrigamBtn>`
923
+ // derives its own hover/active darken cascade (bgHover / bgActive
924
+ // token rungs) from ITS OWN `hover` / `active` state via
925
+ // `useStateFlag` + `useStateEffect` — Pagination never had a
926
+ // `hover` / `active` object prop of its own to relay, and the
927
+ // legacy flat `hoverColor` / `hoverBgColor` / `activeColor` /
928
+ // `activeBgColor` props this comment used to describe forwarding
929
+ // were removed (`OrigamBtn` had already stopped reading them —
930
+ // this forwarding was dead code). The active PAGE item still
931
+ // differentiates itself via the per-item `active: true` boolean
932
+ // (see `controls` below), which IS live.
933
+ const baseBg = props.bgColor || props.color;
934
+ return {
935
+ // In colored mode force `flat` so the btn actually PAINTS the
936
+ // pagination-driven `--origam-btn---background-color`. The theme's
937
+ // default `text` variant sets `background-color: transparent
938
+ // !important`, which would otherwise swallow the colored fill. When
939
+ // no color is set, leave `variant` undefined → the neutral text look.
940
+ variant: baseBg ? VARIANT.FLAT : undefined,
941
+ color: props.color,
942
+ bgColor: baseBg,
943
+ // Size / density flow through to every nav btn so the whole row
944
+ // scales consistently — matches the PDF spec which shows the
945
+ // pagination at sm / default / lg sizes (no per-btn override).
946
+ size: props.size,
947
+ density: props.density
948
+ };
357
949
  });
358
950
  const controlColorProps = sharedBtnColorProps;
359
951
  const items = computed(() => {
360
- return range.value.map((item, index) => {
361
- const ref2 = (e) => updateRef(e, index);
362
- if (typeof item === "string") {
363
- return {
364
- isActive: false,
365
- key: `ellipsis-${index}`,
366
- page: item,
367
- props: {
368
- ref: ref2,
369
- // Same six IColorProps as the rest of the row —
370
- // even though the ellipsis is non-clickable
371
- // (`disabled: true`), it must read as visually
372
- // part of the same nav row, just dimmed by the
373
- // Btn's --disabled veil. Pre-fix it rendered
374
- // in the default neutral grey while the
375
- // surrounding btns took the consumer's bgColor,
376
- // breaking the user's "tous les btn ensemble"
377
- // expectation.
378
- ...sharedBtnColorProps.value,
379
- ellipsis: true,
380
- icon: true,
381
- disabled: true
382
- }
383
- };
384
- } else {
385
- const isActive = item === page.value;
386
- return {
387
- isActive,
388
- key: item,
389
- page: item,
390
- props: {
391
- ref: ref2,
392
- ...sharedBtnColorProps.value,
393
- ellipsis: false,
394
- // `icon: true` keeps the btn in icon-mode so its
395
- // width clamps to its height — a 36×36 square at
396
- // the default size. The pagination SCSS override
397
- // re-sets the corner radius from the btn's
398
- // default 50% to 8px, producing the rounded-SQUARE
399
- // shape the PDF prescribes (NOT a full circle).
400
- // Inactive page btns paint a transparent surface
401
- // via the `&:not(&--colored) .origam-btn:not(--active)`
402
- // rule below, so they read as plain numbers; only
403
- // the active page paints the intent-coloured fill.
404
- icon: true,
405
- disabled: !!props.disabled || +props.length < 2,
406
- // `active: true` lets the inner `<origam-btn>`
407
- // add its own --active overlay so the current
408
- // page reads as selected — without forcing the
409
- // non-active items into a different shape. All
410
- // six IColorProps fields are forwarded
411
- // uniformly via `sharedBtnColorProps` (above),
412
- // so a `color` / `bgColor` change on the
413
- // pagination updates EVERY btn at once — the
414
- // behaviour the user expects from a uniform row
415
- // of nav buttons.
416
- active: isActive,
417
- "aria-current": isActive ? "page" : void 0,
418
- "aria-label": t(isActive ? props.currentPageAriaLabel : props.pageAriaLabel, item),
419
- onClick: (e) => setValue(e, item)
420
- }
421
- };
422
- }
423
- });
952
+ return range.value.map((item, index) => {
953
+ const ref = (e) => updateRef(e, index);
954
+ if (typeof item === "string") {
955
+ return {
956
+ isActive: false,
957
+ key: `ellipsis-${index}`,
958
+ page: item,
959
+ props: {
960
+ ref,
961
+ // Same six IColorProps as the rest of the row —
962
+ // even though the ellipsis is non-clickable
963
+ // (`disabled: true`), it must read as visually
964
+ // part of the same nav row, just dimmed by the
965
+ // Btn's --disabled veil. Pre-fix it rendered
966
+ // in the default neutral grey while the
967
+ // surrounding btns took the consumer's bgColor,
968
+ // breaking the user's "tous les btn ensemble"
969
+ // expectation.
970
+ ...sharedBtnColorProps.value,
971
+ ellipsis: true,
972
+ icon: true,
973
+ disabled: true
974
+ }
975
+ };
976
+ } else {
977
+ const isActive = item === page.value;
978
+ return {
979
+ isActive,
980
+ key: item,
981
+ page: item,
982
+ props: {
983
+ ref,
984
+ ...sharedBtnColorProps.value,
985
+ ellipsis: false,
986
+ // `icon: true` keeps the btn in icon-mode so its
987
+ // width clamps to its height — a 36×36 square at
988
+ // the default size. The pagination SCSS override
989
+ // re-sets the corner radius from the btn's
990
+ // default 50% to 8px, producing the rounded-SQUARE
991
+ // shape the PDF prescribes (NOT a full circle).
992
+ // Inactive page btns paint a transparent surface
993
+ // via the `&:not(&--colored) .origam-btn:not(--active)`
994
+ // rule below, so they read as plain numbers; only
995
+ // the active page paints the intent-coloured fill.
996
+ icon: true,
997
+ disabled: !!props.disabled || +props.length < 2,
998
+ // `active: true` lets the inner `<origam-btn>`
999
+ // add its own --active overlay so the current
1000
+ // page reads as selected — without forcing the
1001
+ // non-active items into a different shape. All
1002
+ // six IColorProps fields are forwarded
1003
+ // uniformly via `sharedBtnColorProps` (above),
1004
+ // so a `color` / `bgColor` change on the
1005
+ // pagination updates EVERY btn at once — the
1006
+ // behaviour the user expects from a uniform row
1007
+ // of nav buttons.
1008
+ active: isActive,
1009
+ "aria-current": isActive ? "page" : undefined,
1010
+ "aria-label": t(isActive ? props.currentPageAriaLabel : props.pageAriaLabel, item),
1011
+ onClick: (e) => setValue(e, item)
1012
+ }
1013
+ };
1014
+ }
1015
+ });
424
1016
  });
425
1017
  const rootAriaLabel = computed(() => t(props.ariaLabel));
1018
+ /*********************************************************
1019
+ * ⛔ TOUS les `*AriaLabel` sont des CLÉS, jamais du texte prêt.
1020
+ *
1021
+ * @description
1022
+ * Leurs valeurs par défaut sont des clés de catalogue
1023
+ * (`'origam.pagination.aria_label.first'`, …). Elles DOIVENT passer par
1024
+ * `t()` avant d'atteindre un `aria-label`. Cinq ne le faisaient pas : la
1025
+ * `<nav>` racine et les boutons premier / précédent / suivant / dernier
1026
+ * annonçaient la clé littérale, alors que les boutons de PAGE, eux,
1027
+ * étaient corrects — l'incohérence tenait dans le même fichier, à trente
1028
+ * lignes d'écart.
1029
+ *
1030
+ * @description
1031
+ * Un consommateur qui passe sa propre valeur passe donc une CLÉ, pas une
1032
+ * chaîne : c'est le contrat déjà en vigueur pour `pageAriaLabel`, et il est
1033
+ * documenté comme tel. Filet : `OrigamPagination.spec.ts`, dont le dernier
1034
+ * cas refuse tout `aria-label` commençant par `origam.` sur la barre.
1035
+ ********************************************************/
426
1036
  const controls = computed(() => {
427
- const prevDisabled = !!props.disabled || page.value <= start.value;
428
- const nextDisabled = !!props.disabled || page.value >= start.value + length.value - 1;
429
- const prevTextual = props.withInfo ? {
430
- text: t(props.previousText ?? "origam.pagination.previous"),
431
- prependIcon: props.prevIcon,
432
- icon: false
433
- } : {
434
- icon: props.prevIcon
435
- };
436
- const nextTextual = props.withInfo ? {
437
- text: t(props.nextText ?? "origam.pagination.next"),
438
- appendIcon: props.nextIcon,
439
- icon: false
440
- } : {
441
- icon: props.nextIcon
442
- };
443
- return {
444
- first: {
445
- ...controlColorProps.value,
446
- icon: props.firstIcon,
447
- onClick: (e) => setValue(e, start.value, "first"),
448
- disabled: prevDisabled,
449
- "aria-label": t(props.firstAriaLabel),
450
- "aria-disabled": prevDisabled
451
- },
452
- prev: {
453
- ...controlColorProps.value,
454
- ...prevTextual,
455
- onClick: (e) => setValue(e, page.value - 1, "prev"),
456
- disabled: prevDisabled,
457
- "aria-label": t(props.previousAriaLabel),
458
- "aria-disabled": prevDisabled
459
- },
460
- next: {
461
- ...controlColorProps.value,
462
- ...nextTextual,
463
- onClick: (e) => setValue(e, page.value + 1, "next"),
464
- disabled: nextDisabled,
465
- "aria-label": t(props.nextAriaLabel),
466
- "aria-disabled": nextDisabled
467
- },
468
- last: {
469
- ...controlColorProps.value,
470
- icon: props.lastIcon,
471
- onClick: (e) => setValue(e, start.value + length.value - 1, "last"),
472
- disabled: nextDisabled,
473
- "aria-label": t(props.lastAriaLabel),
474
- "aria-disabled": nextDisabled
475
- }
476
- };
1037
+ const prevDisabled = !!props.disabled || page.value <= start.value;
1038
+ const nextDisabled = !!props.disabled || page.value >= start.value + length.value - 1;
1039
+ // `withInfo` mode renders Prev / Next as TEXT BUTTONS with the
1040
+ // chevron as a prepend / append icon (PDF spec: WITH INFO).
1041
+ // Default mode keeps them icon-only (the chevron alone). The
1042
+ // first / last controls always stay icon-only — they only show
1043
+ // when `showFirstLastPage` is set and are decorative anchors.
1044
+ const prevTextual = props.withInfo ? {
1045
+ text: t(props.previousText ?? "origam.pagination.previous"),
1046
+ prependIcon: props.prevIcon,
1047
+ icon: false
1048
+ } : { icon: props.prevIcon };
1049
+ const nextTextual = props.withInfo ? {
1050
+ text: t(props.nextText ?? "origam.pagination.next"),
1051
+ appendIcon: props.nextIcon,
1052
+ icon: false
1053
+ } : { icon: props.nextIcon };
1054
+ return {
1055
+ first: {
1056
+ ...controlColorProps.value,
1057
+ icon: props.firstIcon,
1058
+ onClick: (e) => setValue(e, start.value, "first"),
1059
+ disabled: prevDisabled,
1060
+ "aria-label": t(props.firstAriaLabel),
1061
+ "aria-disabled": prevDisabled
1062
+ },
1063
+ prev: {
1064
+ ...controlColorProps.value,
1065
+ ...prevTextual,
1066
+ onClick: (e) => setValue(e, page.value - 1, "prev"),
1067
+ disabled: prevDisabled,
1068
+ "aria-label": t(props.previousAriaLabel),
1069
+ "aria-disabled": prevDisabled
1070
+ },
1071
+ next: {
1072
+ ...controlColorProps.value,
1073
+ ...nextTextual,
1074
+ onClick: (e) => setValue(e, page.value + 1, "next"),
1075
+ disabled: nextDisabled,
1076
+ "aria-label": t(props.nextAriaLabel),
1077
+ "aria-disabled": nextDisabled
1078
+ },
1079
+ last: {
1080
+ ...controlColorProps.value,
1081
+ icon: props.lastIcon,
1082
+ onClick: (e) => setValue(e, start.value + length.value - 1, "last"),
1083
+ disabled: nextDisabled,
1084
+ "aria-label": t(props.lastAriaLabel),
1085
+ "aria-disabled": nextDisabled
1086
+ }
1087
+ };
477
1088
  });
1089
+ /*********************************************************
1090
+ * Keyboard navigation
1091
+ *
1092
+ * @description
1093
+ * handleKeydown moves the page with arrow keys and updates focus.
1094
+ * getMax computes the maximum visible buttons from available width.
1095
+ * setValue sets the page value and fires the named event.
1096
+ * updateFocus focuses the newly-active page button.
1097
+ ********************************************************/
478
1098
  const getMax = (totalWidth, itemWidth) => {
479
- const minButtons = props.showFirstLastPage ? 5 : 3;
480
- return Math.max(0, Math.floor(
481
- // Round to two decimal places to avoid floating point errors
482
- +((totalWidth - itemWidth * minButtons) / itemWidth).toFixed(2)
483
- ));
1099
+ const minButtons = props.showFirstLastPage ? 5 : 3;
1100
+ return Math.max(0, Math.floor(
1101
+ // Round to two decimal places to avoid floating point errors
1102
+ +((totalWidth - itemWidth * minButtons) / itemWidth).toFixed(2)
1103
+ ));
484
1104
  };
485
1105
  const setValue = (e, value, event) => {
486
- e.preventDefault();
487
- page.value = value;
488
- if (event) {
489
- emits(event, value);
490
- }
1106
+ e.preventDefault();
1107
+ page.value = value;
1108
+ if (event) {
1109
+ emits(event, value);
1110
+ }
491
1111
  };
492
1112
  const updateFocus = () => {
493
- const currentIndex = page.value - start.value;
494
- refs.value[currentIndex]?.$el.focus();
1113
+ const currentIndex = page.value - start.value;
1114
+ refs.value[currentIndex]?.$el.focus();
495
1115
  };
1116
+ /*********************************************************
1117
+ * Event handlers
1118
+ ********************************************************/
496
1119
  const handleKeydown = (e) => {
497
- if (e.key === KEYBOARD_VALUES.LEFT && !props.disabled && page.value > +props.start) {
498
- page.value = page.value - 1;
499
- nextTick(updateFocus);
500
- } else if (e.key === KEYBOARD_VALUES.RIGHT && !props.disabled && page.value < start.value + length.value - 1) {
501
- page.value = page.value + 1;
502
- nextTick(updateFocus);
503
- }
1120
+ if (e.key === KEYBOARD_VALUES.LEFT && !props.disabled && page.value > +props.start) {
1121
+ page.value = page.value - 1;
1122
+ nextTick(updateFocus);
1123
+ } else if (e.key === KEYBOARD_VALUES.RIGHT && !props.disabled && page.value < start.value + length.value - 1) {
1124
+ page.value = page.value + 1;
1125
+ nextTick(updateFocus);
1126
+ }
504
1127
  };
1128
+ /*********************************************************
1129
+ * Compact mode
1130
+ *
1131
+ * @description
1132
+ * compactInputRef holds the native number input for compact mode.
1133
+ * handleCompactInput clamps and applies the typed value.
1134
+ ********************************************************/
505
1135
  const compactInputRef = ref(null);
506
1136
  const handleCompactInput = (e) => {
507
- const input = e.target;
508
- const raw = parseInt(input.value, 10);
509
- const clamped = isNaN(raw) ? start.value : Math.min(Math.max(raw, start.value), length.value);
510
- input.value = String(clamped);
511
- page.value = clamped;
1137
+ const input = e.target;
1138
+ const raw = parseInt(input.value, 10);
1139
+ const clamped = isNaN(raw) ? start.value : Math.min(Math.max(raw, start.value), length.value);
1140
+ // Sync the input's displayed value to the clamped value
1141
+ input.value = String(clamped);
1142
+ page.value = clamped;
512
1143
  };
1144
+ /*********************************************************
1145
+ * With-info label
1146
+ *
1147
+ * @description
1148
+ * "Showing 21-40 of 248" range label.
1149
+ * `total` (items count) drives the right-hand bound; `perPage` slices
1150
+ * the range; `currentPage` (== `page.value`) anchors it. When `total`
1151
+ * is omitted we fall back to `length * perPage` so the label still
1152
+ * renders something sensible. End is clamped to `total` so the last
1153
+ * page reads "41-43 of 43" rather than "41-50 of 43".
1154
+ ********************************************************/
513
1155
  const perPageInt = computed(() => {
514
- const v = int(props.perPage);
515
- return Number.isFinite(v) && v > 0 ? v : 10;
1156
+ const v = int(props.perPage);
1157
+ return Number.isFinite(v) && v > 0 ? v : 10;
516
1158
  });
517
1159
  const totalInt = computed(() => {
518
- if (props.total != null) return int(props.total);
519
- return length.value * perPageInt.value;
1160
+ if (props.total != null) return int(props.total);
1161
+ return length.value * perPageInt.value;
520
1162
  });
521
1163
  const infoStart = computed(() => {
522
- if (totalInt.value <= 0) return 0;
523
- return (page.value - start.value) * perPageInt.value + 1;
1164
+ if (totalInt.value <= 0) return 0;
1165
+ return (page.value - start.value) * perPageInt.value + 1;
524
1166
  });
525
1167
  const infoEnd = computed(() => {
526
- if (totalInt.value <= 0) return 0;
527
- return Math.min(infoStart.value + perPageInt.value - 1, totalInt.value);
1168
+ if (totalInt.value <= 0) return 0;
1169
+ return Math.min(infoStart.value + perPageInt.value - 1, totalInt.value);
528
1170
  });
1171
+ /*********************************************************
1172
+ * Class & Style
1173
+ *
1174
+ * @description
1175
+ * `--colored` modifier is toggled as soon as the consumer passes any
1176
+ * truthy intent on `color`/`bgColor`. Drives the SCSS branch that
1177
+ * lets the inner OrigamBtn instances render with their own intent
1178
+ * fill (PDF "stylé" look). When absent, the SCSS overrides the
1179
+ * btn's default surface to a transparent neutral so the row reads
1180
+ * as a subtle, ghost-like nav.
1181
+ ********************************************************/
529
1182
  const isColored = computed(() => !!(props.color || props.bgColor));
530
1183
  const { sizeClasses } = useSize(props);
531
1184
  const { densityClasses } = useDensity(props);
532
1185
  const { typographyStyles } = useTypography(props, "pagination--info");
1186
+ /*********************************************************
1187
+ * Spacing / border / elevation
1188
+ *
1189
+ * @description
1190
+ * `IPaginationProps` extends IPaddingProps / IMarginProps / IBorderProps /
1191
+ * IElevationProps. None of the four were consumed: the row could not be
1192
+ * padded, spaced, bordered or raised despite the types promising it.
1193
+ * These paint the pagination ROW itself — the per-page buttons keep
1194
+ * taking their own size / density through `btnProps` above.
1195
+ ********************************************************/
533
1196
  const { paddingClasses, paddingStyles } = usePadding(props);
534
1197
  const { marginClasses, marginStyles } = useMargin(props);
535
1198
  const { borderClasses, borderStyles } = useBorder(props);
536
1199
  const { elevationClasses, elevationStyles } = useElevation(props);
537
1200
  const paginationClasses = computed(() => {
538
- return [
539
- "origam-pagination",
540
- {
541
- "origam-pagination--colored": isColored.value,
542
- "origam-pagination--compact": !!props.compact,
543
- "origam-pagination--with-info": !!props.withInfo
544
- },
545
- sizeClasses.value,
546
- densityClasses.value,
547
- borderClasses.value,
548
- elevationClasses.value,
549
- paddingClasses.value,
550
- marginClasses.value,
551
- props.class
552
- ];
1201
+ return [
1202
+ "origam-pagination",
1203
+ {
1204
+ "origam-pagination--colored": isColored.value,
1205
+ "origam-pagination--compact": !!props.compact,
1206
+ "origam-pagination--with-info": !!props.withInfo
1207
+ },
1208
+ sizeClasses.value,
1209
+ densityClasses.value,
1210
+ borderClasses.value,
1211
+ elevationClasses.value,
1212
+ paddingClasses.value,
1213
+ marginClasses.value,
1214
+ props.class
1215
+ ];
553
1216
  });
554
1217
  const paginationStyles = computed(() => {
555
- return [
556
- borderStyles.value,
557
- elevationStyles.value,
558
- marginStyles.value,
559
- paddingStyles.value,
560
- props.style
561
- ];
1218
+ return [
1219
+ borderStyles.value,
1220
+ elevationStyles.value,
1221
+ marginStyles.value,
1222
+ paddingStyles.value,
1223
+ props.style
1224
+ ];
562
1225
  });
563
1226
  const { id, css, load, isLoaded, unload } = useStyle(paginationStyles, () => props.id);
1227
+ /*********************************************************
1228
+ * Expose
1229
+ *
1230
+ * @description
1231
+ * Exposes filterProps to parent ref consumers.
1232
+ ********************************************************/
564
1233
  defineExpose({
565
- filterProps,
566
- css,
567
- id,
568
- load,
569
- unload,
570
- isLoaded
1234
+ filterProps,
1235
+ css,
1236
+ id,
1237
+ load,
1238
+ unload,
1239
+ isLoaded
571
1240
  });
572
1241
  </script>
573
1242